diff --git a/Documents/Help/Changelog.md b/Documents/Help/Changelog.md index 844946550..a289b9bb9 100644 --- a/Documents/Help/Changelog.md +++ b/Documents/Help/Changelog.md @@ -5,6 +5,36 @@ ======= +## 2024-11-12 - Build 2411 - November 2024 +* Simplified TFM project configuration +* 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. +* New `KryptonPasswordTextBox` control +* `Krypton.Toolkit.Suite.Extended.Outlook.Grid` is now deprecated, as it has now been absorbed into the standard toolkit +* Implement [#404](https://github.com/Krypton-Suite/Extended-Toolkit/issues/404), Update 'ScottPlot' to v5 +* `KryptonMessageBoxExtended` now supports RTL reading +* `Krypton.Toolkit.Suite.Extended.Toast` is now deprecated, as it has now been absorbed into the standard toolkit +* `KryptonFormExtended` - `AllowFormIntegrate` property has now been removed to fall in line with the standard toolkit +* Resolved [#446](https://github.com/Krypton-Suite/Extended-Toolkit/issues/446), Throwing exceptions using the Circularprogressbar control of The Ultimate 80.0 package during design +* New `KryptonAboutExtendedToolkit` API +* * Add support for .NET 9.0 +* Removed support for .NET 6 and 7, in accordance with their official release cadences +* Updated standard toolkit to build `2411` + +======= + +## 2024-10-15 - Build 2410 (Patch 2) - October 2024 +* Enable 'SourceLink' for NuGet packages +* Patch for `System.Private.Uri`, CVE-2019-081 + +======= + +## 2024-06-24 - Build 2406 - June 2024 + +* Updated standard toolkit to build `2406` +* Updated version from `80.xx.xx.xxx` -> `85.xx.xx.xxx` + +======= + ## 2023-11-14 - Build 2311 - November 2023 * New `KryptonToolkitExtendedPoweredByControl`, to be used in application 'About' dialogs * Added the ability to specify the message text alignment in a `KryptonMessageboxExtended` diff --git a/Documents/License/License.md b/Documents/License/License.md index 159a9c459..793c70822 100644 --- a/Documents/License/License.md +++ b/Documents/License/License.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 - 2023 Krypton Suite +Copyright (c) 2017 - 2024 Krypton Suite Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/LICENSE b/LICENSE index 159a9c459..793c70822 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 - 2023 Krypton Suite +Copyright (c) 2017 - 2024 Krypton Suite Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Source/.editorconfig b/Source/.editorconfig index 1e952f92e..096d5c87c 100644 --- a/Source/.editorconfig +++ b/Source/.editorconfig @@ -1,2 +1,97 @@ [*.cs] -dotnet_diagnostic.CS8618.severity = None \ No newline at end of file +dotnet_diagnostic.CS8618.severity = None +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_allow_blank_lines_between_consecutive_braces_experimental = true: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_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 = warning +[*.{cs,vb}] +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 +[*.{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_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 diff --git a/Source/Documentation/Extended Toolkit API Documentation/Content/VersionHistory/VersionHistory.aml b/Source/Documentation/Extended Toolkit API Documentation/Content/VersionHistory/VersionHistory.aml new file mode 100644 index 000000000..8ae2f1ae5 --- /dev/null +++ b/Source/Documentation/Extended Toolkit API Documentation/Content/VersionHistory/VersionHistory.aml @@ -0,0 +1,33 @@ + + + + + The topics in this section describe the various changes made to the [TODO: Project Title] over the +life of the project. + + +
+ Version History + + Select a version below to see a description of its changes. + + + + + + + + [TODO: Add links to each specific version page] + + + + + +
+ + + + + +
+
diff --git a/Source/Documentation/Extended Toolkit API Documentation/Content/VersionHistory/v1.0.0.0.aml b/Source/Documentation/Extended Toolkit API Documentation/Content/VersionHistory/v1.0.0.0.aml new file mode 100644 index 000000000..663753999 --- /dev/null +++ b/Source/Documentation/Extended Toolkit API Documentation/Content/VersionHistory/v1.0.0.0.aml @@ -0,0 +1,28 @@ + + + + + Version [TODO: Version] was released on [TODO: Date]. + + + +
+ Changes in This Release + + + + + [TODO: Add change items here] + + + + + +
+ + + + + +
+
diff --git a/Source/Documentation/Extended Toolkit API Documentation/Content/Welcome.aml b/Source/Documentation/Extended Toolkit API Documentation/Content/Welcome.aml new file mode 100644 index 000000000..bb5c2f43c --- /dev/null +++ b/Source/Documentation/Extended Toolkit API Documentation/Content/Welcome.aml @@ -0,0 +1,55 @@ + + + + + This is a sample conceptual topic. You can use this as a starting point for adding more conceptual +content to your help project. + + +
+ Getting Started + + To get started, add a documentation source to the project (a Visual Studio solution, project, or +assembly and XML comments file). See the Getting Started topics in the Sandcastle Help +File Builder's help file for more information. The following default items are included in this project: + + + + ContentLayout.content - Use the content layout file to manage the +conceptual content in the project and define its layout in the table of contents. + + + + The .\media folder - Place images in this folder that you will reference +from conceptual content using medialLink or mediaLinkInline +elements. If you will not have any images in the file, you may remove this folder. + + + + The .\icons folder - This contains a default logo for the help file. You +may replace it or remove it and the folder if not wanted. If removed or if you change the file name, update +the Transform Args project properties page by removing or changing the filename in the +logoFile transform argument. Note that unlike images referenced from conceptual topics, +the logo file should have its BuildAction property set to Content. + + + + The .\Content folder - Use this to store your conceptual topics. You may +name the files and organize them however you like. One suggestion is to lay the files out on disk as you have +them in the content layout file as shown in this project but the choice is yours. Files can be added via the +Solution Explorer or from within the content layout file editor. Files must appear in the content layout file +in order to be compiled into the help file. + + + + See the Conceptual Content topics in the Sandcastle Help File Builder's +help file for more information. See the Sandcastle MAML Guide for details on Microsoft +Assistance Markup Language (MAML) which is used to create these topics. + +
+ + + + +
+
diff --git a/Source/Documentation/Extended Toolkit API Documentation/ContentLayout.content b/Source/Documentation/Extended Toolkit API Documentation/ContentLayout.content new file mode 100644 index 000000000..4af5dffe9 --- /dev/null +++ b/Source/Documentation/Extended Toolkit API Documentation/ContentLayout.content @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/Documentation/Extended Toolkit API Documentation/Extended Toolkit API Documentation.shfbproj b/Source/Documentation/Extended Toolkit API Documentation/Extended Toolkit API Documentation.shfbproj new file mode 100644 index 000000000..43446799e --- /dev/null +++ b/Source/Documentation/Extended Toolkit API Documentation/Extended Toolkit API Documentation.shfbproj @@ -0,0 +1,158 @@ + + + + + + + v4.7.2 + + Debug + AnyCPU + 2.0 + 6cfe23a2-844d-4ef5-8a75-35985b11cf34 + 2017.9.26.0 + + Extended_Toolkit_API_Documentation + Extended_Toolkit_API_Documentation + Extended_Toolkit_API_Documentation + + .NET Framework 4.8 + .\Help\ + Extended_Toolkit_API_Documentation + en-US + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Website + Standard + Default2022 + True + True + False + False + OnlyWarningsAndErrors + 100 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OnBuildSuccess + + \ No newline at end of file diff --git a/Source/Documentation/Extended Toolkit API Documentation/icons/Help.png b/Source/Documentation/Extended Toolkit API Documentation/icons/Help.png new file mode 100644 index 000000000..945e89fb9 Binary files /dev/null and b/Source/Documentation/Extended Toolkit API Documentation/icons/Help.png differ diff --git a/Source/Krypton Toolkit/AutoUpdateCreator/AutoUpdateCreator.csproj b/Source/Krypton Toolkit/AutoUpdateCreator/AutoUpdateCreator.csproj index 988099f68..66eb4e05e 100644 --- a/Source/Krypton Toolkit/AutoUpdateCreator/AutoUpdateCreator.csproj +++ b/Source/Krypton Toolkit/AutoUpdateCreator/AutoUpdateCreator.csproj @@ -16,74 +16,36 @@ - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Directory.Build.props b/Source/Krypton Toolkit/Directory.Build.props index a4c2fe162..86308726d 100644 --- a/Source/Krypton Toolkit/Directory.Build.props +++ b/Source/Krypton Toolkit/Directory.Build.props @@ -6,7 +6,7 @@ true en Peter Wagner (A.K.A Wagnerp) and Simon Coghlan (A.K.A Smurf-IV), et al. - © 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) and Simon Coghlan (aka Smurf-IV) 2017 - 2024. All rights reserved. @@ -32,6 +32,8 @@ Get updates here: https://github.com/Krypton-Suite/Extended-Toolkit git https://github.com/Krypton-Suite/Extended-Toolkit + true + true true @@ -60,6 +62,8 @@ Get updates here: https://github.com/Krypton-Suite/Extended-Toolkit git https://github.com/Krypton-Suite/Extended-Toolkit + true + true true @@ -88,6 +92,8 @@ Get updates here: https://github.com/Krypton-Suite/Extended-Toolkit git https://github.com/Krypton-Suite/Extended-Toolkit + true + true ..\..\..\Bin\ diff --git a/Source/Krypton Toolkit/Directory.Build.targets b/Source/Krypton Toolkit/Directory.Build.targets index d84a08d95..f0de03fe2 100644 --- a/Source/Krypton Toolkit/Directory.Build.targets +++ b/Source/Krypton Toolkit/Directory.Build.targets @@ -7,21 +7,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 @@ -38,21 +38,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 @@ -69,19 +69,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 @@ -95,20 +95,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 @@ -122,7 +122,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 (Wagnerp) and Simon Coghlan (Smurf-IV)), 2017 - 2024. Component Factory Pty Ltd (Phil Wright), 2006 - 2016. All rights reserved. @@ -132,9 +132,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1 and .NET 6 - 7. $(Description) + An extension to the Standard Toolkit, which supports .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 6 - 7. + 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 @@ -149,9 +149,9 @@ $(PackageId).Nightly - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1 and .NET 6 - 7. $(Description) + An extension to the Standard Toolkit, which supports .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 6 - 7. + 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 @@ -166,9 +166,9 @@ $(PackageId).Lite - An extension to the Standard Toolkit, which supports .NET Framework 4.8 and 4.8.1 and .NET 5 - 7. $(Description) + An extension to the Standard Toolkit, which supports .NET Framework 4.8 and 4.8.1 and .NET 8 - 9. $(Description) - This package supports all .NET Framework versions starting .NET Framework 4.8 and 4.8.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.8 and 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 @@ -181,9 +181,9 @@ $(PackageId) - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1 and .NET 6 - 7. $(Description) + An extension to the Standard Toolkit, which supports .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 6 - 7. + 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 Toolkit/Examples/AdvancedDataGridView.Designer.cs b/Source/Krypton Toolkit/Examples/AdvancedDataGridView.Designer.cs index 0b8d227a8..c778d924b 100644 --- a/Source/Krypton Toolkit/Examples/AdvancedDataGridView.Designer.cs +++ b/Source/Krypton Toolkit/Examples/AdvancedDataGridView.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class AdvancedDataGridView { @@ -98,7 +126,6 @@ private void InitializeComponent() // // kbtnApplySavedFilters // - this.kbtnApplySavedFilters.CornerRoundingRadius = -1F; this.kbtnApplySavedFilters.Location = new System.Drawing.Point(1005, 72); this.kbtnApplySavedFilters.Name = "kbtnApplySavedFilters"; this.kbtnApplySavedFilters.Size = new System.Drawing.Size(90, 25); @@ -108,7 +135,6 @@ private void InitializeComponent() // // kbtnClearFilters // - this.kbtnClearFilters.CornerRoundingRadius = -1F; this.kbtnClearFilters.Location = new System.Drawing.Point(669, 45); this.kbtnClearFilters.Name = "kbtnClearFilters"; this.kbtnClearFilters.Size = new System.Drawing.Size(179, 25); @@ -118,7 +144,6 @@ private void InitializeComponent() // // kbtnSaveFilters // - this.kbtnSaveFilters.CornerRoundingRadius = -1F; this.kbtnSaveFilters.Location = new System.Drawing.Point(669, 13); this.kbtnSaveFilters.Name = "kbtnSaveFilters"; this.kbtnSaveFilters.Size = new System.Drawing.Size(180, 25); @@ -144,7 +169,6 @@ private void InitializeComponent() // // kcmbSortSaved // - this.kcmbSortSaved.CornerRoundingRadius = -1F; this.kcmbSortSaved.DropDownWidth = 159; this.kcmbSortSaved.IntegralHeight = false; this.kcmbSortSaved.Location = new System.Drawing.Point(937, 39); @@ -155,7 +179,6 @@ private void InitializeComponent() // // kcmbSavedFilters // - this.kcmbSavedFilters.CornerRoundingRadius = -1F; this.kcmbSavedFilters.DropDownWidth = 159; this.kcmbSavedFilters.IntegralHeight = false; this.kcmbSavedFilters.Location = new System.Drawing.Point(937, 12); @@ -218,7 +241,6 @@ private void InitializeComponent() // // kcmbMemoryTest // - this.kcmbMemoryTest.CornerRoundingRadius = -1F; this.kcmbMemoryTest.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.kcmbMemoryTest.DropDownWidth = 121; this.kcmbMemoryTest.IntegralHeight = false; @@ -230,7 +252,6 @@ private void InitializeComponent() // // kbtnMemoryTest // - this.kbtnMemoryTest.CornerRoundingRadius = -1F; this.kbtnMemoryTest.Location = new System.Drawing.Point(207, 12); this.kbtnMemoryTest.Name = "kbtnMemoryTest"; this.kbtnMemoryTest.Size = new System.Drawing.Size(180, 25); @@ -240,7 +261,6 @@ private void InitializeComponent() // // kbtnLoadRandomData // - this.kbtnLoadRandomData.CornerRoundingRadius = -1F; this.kbtnLoadRandomData.Location = new System.Drawing.Point(13, 13); this.kbtnLoadRandomData.Name = "kbtnLoadRandomData"; this.kbtnLoadRandomData.Size = new System.Drawing.Size(167, 25); diff --git a/Source/Krypton Toolkit/Examples/AdvancedDataGridView.cs b/Source/Krypton Toolkit/Examples/AdvancedDataGridView.cs index 6dbc55ea5..1c22c773f 100644 --- a/Source/Krypton Toolkit/Examples/AdvancedDataGridView.cs +++ b/Source/Krypton Toolkit/Examples/AdvancedDataGridView.cs @@ -1,12 +1,33 @@ -using System; -using System.Collections.Generic; +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion using System.ComponentModel; using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; using Krypton.Toolkit.Suite.Extended.AdvancedDataGridView; @@ -308,7 +329,7 @@ private void kryptonAdvancedDataGridViewSearchToolBar1_Search(object sender, Adv startRow = kadgvMain.CurrentCell.RowIndex + (endcol ? 1 : 0); } } - DataGridViewCell c = kadgvMain.FindCell( + DataGridViewCell? c = kadgvMain.FindCell( e.ValueToSearch, e.ColumnToSearch != null ? e.ColumnToSearch.Name : null, startRow, diff --git a/Source/Krypton Toolkit/Examples/BasicToastNotificationTest.Designer.cs b/Source/Krypton Toolkit/Examples/BasicToastNotificationTest.Designer.cs new file mode 100644 index 000000000..da80a435f --- /dev/null +++ b/Source/Krypton Toolkit/Examples/BasicToastNotificationTest.Designer.cs @@ -0,0 +1,630 @@ +namespace Examples +{ + partial class BasicToastNotificationTest + { + /// + /// 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(BasicToastNotificationTest)); + this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); + this.kbtnShow = new Krypton.Toolkit.KryptonButton(); + this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); + this.kryptonBorderEdge2 = new Krypton.Toolkit.KryptonBorderEdge(); + this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel(); + this.kcbtnBorderColor2 = new Krypton.Toolkit.KryptonColorButton(); + this.kcbtnBorderColor1 = new Krypton.Toolkit.KryptonColorButton(); + this.kryptonGroupBox3 = new Krypton.Toolkit.KryptonGroupBox(); + this.klblStartLocationX = new Krypton.Toolkit.KryptonLabel(); + this.kchkSetDefaultLocation = new Krypton.Toolkit.KryptonCheckBox(); + this.klblStartLocation = new Krypton.Toolkit.KryptonLabel(); + this.knudStartLocationY = new Krypton.Toolkit.KryptonNumericUpDown(); + this.knudStartLocationX = new Krypton.Toolkit.KryptonNumericUpDown(); + this.klblStartLocationY = new Krypton.Toolkit.KryptonLabel(); + this.knudCountdownSeconds = new Krypton.Toolkit.KryptonNumericUpDown(); + this.kryptonLabel5 = new Krypton.Toolkit.KryptonLabel(); + this.kryptonGroupBox2 = new Krypton.Toolkit.KryptonGroupBox(); + this.kchkEnableHyperLinks = new Krypton.Toolkit.KryptonCheckBox(); + this.kchkUseRTL = new Krypton.Toolkit.KryptonCheckBox(); + this.kchkReportLocation = new Krypton.Toolkit.KryptonCheckBox(); + this.kchkShowCountDownSecondsOnProgressBar = new Krypton.Toolkit.KryptonCheckBox(); + this.kchkIsDoNotShowAgainOptionChecked = new Krypton.Toolkit.KryptonCheckBox(); + this.kchkUseDoNotShowAgainOptionThreeState = new Krypton.Toolkit.KryptonCheckBox(); + this.kchkUseProgressBar = new Krypton.Toolkit.KryptonCheckBox(); + this.kchkDoNotShowAgain = new Krypton.Toolkit.KryptonCheckBox(); + this.kchkTopMost = new Krypton.Toolkit.KryptonCheckBox(); + this.kchkShowCloseButton = new Krypton.Toolkit.KryptonCheckBox(); + this.kchkUseFade = new Krypton.Toolkit.KryptonCheckBox(); + this.kryptonGroupBox1 = new Krypton.Toolkit.KryptonGroupBox(); + this.ktxtCustomIconPath = new Krypton.Toolkit.KryptonTextBox(); + this.bsaBrowseIcon = new Krypton.Toolkit.ButtonSpecAny(); + this.kcmbNotificationIconType = new Krypton.Toolkit.KryptonComboBox(); + this.kcmbTitleAlignment = new Krypton.Toolkit.KryptonComboBox(); + this.kryptonLabel3 = new Krypton.Toolkit.KryptonLabel(); + this.krtbNotificationMessage = new Krypton.Toolkit.KryptonRichTextBox(); + this.ktxtNotificationTitle = new Krypton.Toolkit.KryptonTextBox(); + this.kbtnTestText = new Krypton.Toolkit.KryptonButton(); + this.kryptonLabel2 = new Krypton.Toolkit.KryptonLabel(); + this.kryptonLabel1 = new Krypton.Toolkit.KryptonLabel(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + this.kryptonPanel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + this.kryptonPanel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3.Panel)).BeginInit(); + this.kryptonGroupBox3.Panel.SuspendLayout(); + this.kryptonGroupBox3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox2.Panel)).BeginInit(); + this.kryptonGroupBox2.Panel.SuspendLayout(); + this.kryptonGroupBox2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).BeginInit(); + this.kryptonGroupBox1.Panel.SuspendLayout(); + this.kryptonGroupBox1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kcmbNotificationIconType)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.kcmbTitleAlignment)).BeginInit(); + this.SuspendLayout(); + // + // kryptonPanel1 + // + this.kryptonPanel1.Controls.Add(this.kbtnShow); + this.kryptonPanel1.Controls.Add(this.kryptonBorderEdge1); + this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.kryptonPanel1.Location = new System.Drawing.Point(0, 646); + this.kryptonPanel1.Name = "kryptonPanel1"; + this.kryptonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; + this.kryptonPanel1.Size = new System.Drawing.Size(889, 50); + this.kryptonPanel1.TabIndex = 1; + // + // kbtnShow + // + this.kbtnShow.Location = new System.Drawing.Point(776, 13); + this.kbtnShow.Name = "kbtnShow"; + this.kbtnShow.Size = new System.Drawing.Size(90, 25); + this.kbtnShow.TabIndex = 1; + this.kbtnShow.Values.DropDownArrowColor = System.Drawing.Color.Empty; + this.kbtnShow.Values.Text = "Show"; + this.kbtnShow.Click += new System.EventHandler(this.kbtnShow_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(889, 1); + this.kryptonBorderEdge1.Text = "kryptonBorderEdge1"; + // + // kryptonBorderEdge2 + // + this.kryptonBorderEdge2.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary; + this.kryptonBorderEdge2.Dock = System.Windows.Forms.DockStyle.Bottom; + this.kryptonBorderEdge2.Location = new System.Drawing.Point(0, 645); + this.kryptonBorderEdge2.Name = "kryptonBorderEdge2"; + this.kryptonBorderEdge2.Size = new System.Drawing.Size(889, 1); + this.kryptonBorderEdge2.Text = "kryptonBorderEdge2"; + // + // kryptonPanel2 + // + this.kryptonPanel2.Controls.Add(this.kcbtnBorderColor2); + this.kryptonPanel2.Controls.Add(this.kcbtnBorderColor1); + this.kryptonPanel2.Controls.Add(this.kryptonGroupBox3); + this.kryptonPanel2.Controls.Add(this.knudCountdownSeconds); + this.kryptonPanel2.Controls.Add(this.kryptonLabel5); + this.kryptonPanel2.Controls.Add(this.kryptonGroupBox2); + this.kryptonPanel2.Controls.Add(this.kryptonGroupBox1); + this.kryptonPanel2.Controls.Add(this.kcmbTitleAlignment); + this.kryptonPanel2.Controls.Add(this.kryptonLabel3); + this.kryptonPanel2.Controls.Add(this.krtbNotificationMessage); + this.kryptonPanel2.Controls.Add(this.ktxtNotificationTitle); + this.kryptonPanel2.Controls.Add(this.kbtnTestText); + this.kryptonPanel2.Controls.Add(this.kryptonLabel2); + this.kryptonPanel2.Controls.Add(this.kryptonLabel1); + 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(889, 645); + this.kryptonPanel2.TabIndex = 4; + // + // kcbtnBorderColor2 + // + this.kcbtnBorderColor2.CustomColorPreviewShape = Krypton.Toolkit.KryptonColorButtonCustomColorPreviewShape.Circle; + this.kcbtnBorderColor2.Location = new System.Drawing.Point(602, 165); + this.kcbtnBorderColor2.Name = "kcbtnBorderColor2"; + this.kcbtnBorderColor2.Size = new System.Drawing.Size(166, 25); + this.kcbtnBorderColor2.TabIndex = 27; + this.kcbtnBorderColor2.Values.Image = ((System.Drawing.Image)(resources.GetObject("kcbtnBorderColor2.Values.Image"))); + this.kcbtnBorderColor2.Values.RoundedCorners = 8; + this.kcbtnBorderColor2.Values.Text = "Border Color 2"; + this.kcbtnBorderColor2.SelectedColorChanged += new System.EventHandler(this.kcbtnBorderColor2_SelectedColorChanged); + // + // kcbtnBorderColor1 + // + this.kcbtnBorderColor1.CustomColorPreviewShape = Krypton.Toolkit.KryptonColorButtonCustomColorPreviewShape.Circle; + this.kcbtnBorderColor1.Location = new System.Drawing.Point(430, 165); + this.kcbtnBorderColor1.Name = "kcbtnBorderColor1"; + this.kcbtnBorderColor1.Size = new System.Drawing.Size(166, 25); + this.kcbtnBorderColor1.TabIndex = 26; + this.kcbtnBorderColor1.Values.Image = ((System.Drawing.Image)(resources.GetObject("kcbtnBorderColor1.Values.Image"))); + this.kcbtnBorderColor1.Values.RoundedCorners = 8; + this.kcbtnBorderColor1.Values.Text = "Border Color 1"; + this.kcbtnBorderColor1.SelectedColorChanged += new System.EventHandler(this.kcbtnBorderColor1_SelectedColorChanged); + // + // kryptonGroupBox3 + // + this.kryptonGroupBox3.Location = new System.Drawing.Point(430, 13); + this.kryptonGroupBox3.Name = "kryptonGroupBox3"; + // + // kryptonGroupBox3.Panel + // + this.kryptonGroupBox3.Panel.Controls.Add(this.klblStartLocationX); + this.kryptonGroupBox3.Panel.Controls.Add(this.kchkSetDefaultLocation); + this.kryptonGroupBox3.Panel.Controls.Add(this.klblStartLocation); + this.kryptonGroupBox3.Panel.Controls.Add(this.knudStartLocationY); + this.kryptonGroupBox3.Panel.Controls.Add(this.knudStartLocationX); + this.kryptonGroupBox3.Panel.Controls.Add(this.klblStartLocationY); + this.kryptonGroupBox3.Size = new System.Drawing.Size(443, 146); + this.kryptonGroupBox3.TabIndex = 23; + // + // klblStartLocationX + // + this.klblStartLocationX.Enabled = false; + this.klblStartLocationX.Location = new System.Drawing.Point(12, 73); + this.klblStartLocationX.Name = "klblStartLocationX"; + this.klblStartLocationX.Size = new System.Drawing.Size(20, 20); + this.klblStartLocationX.TabIndex = 23; + this.klblStartLocationX.Values.Text = "X:"; + // + // kchkSetDefaultLocation + // + this.kchkSetDefaultLocation.Location = new System.Drawing.Point(12, 11); + this.kchkSetDefaultLocation.Name = "kchkSetDefaultLocation"; + this.kchkSetDefaultLocation.Size = new System.Drawing.Size(133, 20); + this.kchkSetDefaultLocation.TabIndex = 22; + this.kchkSetDefaultLocation.Values.Text = "Set Default Location"; + this.kchkSetDefaultLocation.CheckedChanged += new System.EventHandler(this.kchkSetDefaultLocation_CheckedChanged); + // + // klblStartLocation + // + this.klblStartLocation.Enabled = false; + this.klblStartLocation.Location = new System.Drawing.Point(12, 47); + this.klblStartLocation.Name = "klblStartLocation"; + this.klblStartLocation.Size = new System.Drawing.Size(89, 20); + this.klblStartLocation.TabIndex = 18; + this.klblStartLocation.Values.Text = "Start Location:"; + // + // knudStartLocationY + // + this.knudStartLocationY.Enabled = false; + this.knudStartLocationY.Increment = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.knudStartLocationY.Location = new System.Drawing.Point(193, 73); + this.knudStartLocationY.Maximum = new decimal(new int[] { + 180, + 0, + 0, + 0}); + this.knudStartLocationY.Minimum = new decimal(new int[] { + 5, + 0, + 0, + 0}); + this.knudStartLocationY.Name = "knudStartLocationY"; + this.knudStartLocationY.Size = new System.Drawing.Size(120, 22); + this.knudStartLocationY.TabIndex = 21; + this.knudStartLocationY.Value = new decimal(new int[] { + 60, + 0, + 0, + 0}); + // + // knudStartLocationX + // + this.knudStartLocationX.Enabled = false; + this.knudStartLocationX.Increment = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.knudStartLocationX.Location = new System.Drawing.Point(38, 73); + this.knudStartLocationX.Maximum = new decimal(new int[] { + 180, + 0, + 0, + 0}); + this.knudStartLocationX.Minimum = new decimal(new int[] { + 5, + 0, + 0, + 0}); + this.knudStartLocationX.Name = "knudStartLocationX"; + this.knudStartLocationX.Size = new System.Drawing.Size(120, 22); + this.knudStartLocationX.TabIndex = 19; + this.knudStartLocationX.Value = new decimal(new int[] { + 60, + 0, + 0, + 0}); + // + // klblStartLocationY + // + this.klblStartLocationY.Enabled = false; + this.klblStartLocationY.Location = new System.Drawing.Point(164, 73); + this.klblStartLocationY.Name = "klblStartLocationY"; + this.klblStartLocationY.Size = new System.Drawing.Size(23, 20); + this.klblStartLocationY.TabIndex = 20; + this.klblStartLocationY.Values.Text = " Y:"; + // + // knudCountdownSeconds + // + this.knudCountdownSeconds.Increment = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.knudCountdownSeconds.Location = new System.Drawing.Point(569, 206); + this.knudCountdownSeconds.Maximum = new decimal(new int[] { + 180, + 0, + 0, + 0}); + this.knudCountdownSeconds.Minimum = new decimal(new int[] { + 5, + 0, + 0, + 0}); + this.knudCountdownSeconds.Name = "knudCountdownSeconds"; + this.knudCountdownSeconds.Size = new System.Drawing.Size(272, 22); + this.knudCountdownSeconds.TabIndex = 17; + this.knudCountdownSeconds.Value = new decimal(new int[] { + 60, + 0, + 0, + 0}); + this.knudCountdownSeconds.ValueChanged += new System.EventHandler(this.knudCountdownSeconds_ValueChanged); + // + // kryptonLabel5 + // + this.kryptonLabel5.LabelStyle = Krypton.Toolkit.LabelStyle.BoldPanel; + this.kryptonLabel5.Location = new System.Drawing.Point(430, 206); + this.kryptonLabel5.Name = "kryptonLabel5"; + this.kryptonLabel5.Size = new System.Drawing.Size(133, 20); + this.kryptonLabel5.TabIndex = 16; + this.kryptonLabel5.Values.Text = "Countdown Seconds:"; + // + // kryptonGroupBox2 + // + this.kryptonGroupBox2.Location = new System.Drawing.Point(124, 348); + this.kryptonGroupBox2.Name = "kryptonGroupBox2"; + // + // kryptonGroupBox2.Panel + // + this.kryptonGroupBox2.Panel.Controls.Add(this.kchkEnableHyperLinks); + this.kryptonGroupBox2.Panel.Controls.Add(this.kchkUseRTL); + this.kryptonGroupBox2.Panel.Controls.Add(this.kchkReportLocation); + this.kryptonGroupBox2.Panel.Controls.Add(this.kchkShowCountDownSecondsOnProgressBar); + this.kryptonGroupBox2.Panel.Controls.Add(this.kchkIsDoNotShowAgainOptionChecked); + this.kryptonGroupBox2.Panel.Controls.Add(this.kchkUseDoNotShowAgainOptionThreeState); + this.kryptonGroupBox2.Panel.Controls.Add(this.kchkUseProgressBar); + this.kryptonGroupBox2.Panel.Controls.Add(this.kchkDoNotShowAgain); + this.kryptonGroupBox2.Panel.Controls.Add(this.kchkTopMost); + this.kryptonGroupBox2.Panel.Controls.Add(this.kchkShowCloseButton); + this.kryptonGroupBox2.Panel.Controls.Add(this.kchkUseFade); + this.kryptonGroupBox2.Size = new System.Drawing.Size(300, 251); + this.kryptonGroupBox2.TabIndex = 8; + this.kryptonGroupBox2.Values.Heading = "Options"; + // + // kchkEnableHyperLinks + // + this.kchkEnableHyperLinks.Location = new System.Drawing.Point(13, 202); + this.kchkEnableHyperLinks.Name = "kchkEnableHyperLinks"; + this.kchkEnableHyperLinks.Size = new System.Drawing.Size(123, 20); + this.kchkEnableHyperLinks.TabIndex = 28; + this.kchkEnableHyperLinks.Values.Text = "Enable HyperLinks"; + this.kchkEnableHyperLinks.CheckedChanged += new System.EventHandler(this.kchkEnableHyperLinks_CheckedChanged); + // + // kchkUseRTL + // + this.kchkUseRTL.Location = new System.Drawing.Point(157, 175); + this.kchkUseRTL.Name = "kchkUseRTL"; + this.kchkUseRTL.Size = new System.Drawing.Size(67, 20); + this.kchkUseRTL.TabIndex = 27; + this.kchkUseRTL.Values.Text = "Use RTL"; + this.kchkUseRTL.CheckedChanged += new System.EventHandler(this.kchkUseRTL_CheckedChanged); + // + // kchkReportLocation + // + this.kchkReportLocation.Location = new System.Drawing.Point(13, 175); + this.kchkReportLocation.Name = "kchkReportLocation"; + this.kchkReportLocation.Size = new System.Drawing.Size(138, 20); + this.kchkReportLocation.TabIndex = 8; + this.kchkReportLocation.Values.Text = "Report toast location"; + this.kchkReportLocation.CheckedChanged += new System.EventHandler(this.kchkReportLocation_CheckedChanged); + // + // kchkShowCountDownSecondsOnProgressBar + // + this.kchkShowCountDownSecondsOnProgressBar.Enabled = false; + this.kchkShowCountDownSecondsOnProgressBar.Location = new System.Drawing.Point(13, 148); + this.kchkShowCountDownSecondsOnProgressBar.Name = "kchkShowCountDownSecondsOnProgressBar"; + this.kchkShowCountDownSecondsOnProgressBar.Size = new System.Drawing.Size(259, 20); + this.kchkShowCountDownSecondsOnProgressBar.TabIndex = 7; + this.kchkShowCountDownSecondsOnProgressBar.Values.Text = "Show count down seconds on progress bar"; + this.kchkShowCountDownSecondsOnProgressBar.CheckedChanged += new System.EventHandler(this.kchkShowCountDownSecondsOnProgressBar_CheckedChanged); + // + // kchkIsDoNotShowAgainOptionChecked + // + this.kchkIsDoNotShowAgainOptionChecked.Enabled = false; + this.kchkIsDoNotShowAgainOptionChecked.Location = new System.Drawing.Point(13, 95); + this.kchkIsDoNotShowAgainOptionChecked.Name = "kchkIsDoNotShowAgainOptionChecked"; + this.kchkIsDoNotShowAgainOptionChecked.Size = new System.Drawing.Size(224, 20); + this.kchkIsDoNotShowAgainOptionChecked.TabIndex = 6; + this.kchkIsDoNotShowAgainOptionChecked.Values.Text = "Is do not show again option checked"; + this.kchkIsDoNotShowAgainOptionChecked.CheckedChanged += new System.EventHandler(this.kchkIsDoNotShowAgainOptionChecked_CheckedChanged); + // + // kchkUseDoNotShowAgainOptionThreeState + // + this.kchkUseDoNotShowAgainOptionThreeState.Enabled = false; + this.kchkUseDoNotShowAgainOptionThreeState.Location = new System.Drawing.Point(13, 68); + this.kchkUseDoNotShowAgainOptionThreeState.Name = "kchkUseDoNotShowAgainOptionThreeState"; + this.kchkUseDoNotShowAgainOptionThreeState.Size = new System.Drawing.Size(250, 20); + this.kchkUseDoNotShowAgainOptionThreeState.TabIndex = 5; + this.kchkUseDoNotShowAgainOptionThreeState.Values.Text = "Use do not show again option ThreeState"; + this.kchkUseDoNotShowAgainOptionThreeState.CheckedChanged += new System.EventHandler(this.kchkUseDoNotShowAgainOptionThreeState_CheckedChanged); + // + // kchkUseProgressBar + // + this.kchkUseProgressBar.Location = new System.Drawing.Point(13, 121); + this.kchkUseProgressBar.Name = "kchkUseProgressBar"; + this.kchkUseProgressBar.Size = new System.Drawing.Size(116, 20); + this.kchkUseProgressBar.TabIndex = 4; + this.kchkUseProgressBar.Values.Text = "Use progress bar"; + this.kchkUseProgressBar.CheckedChanged += new System.EventHandler(this.kchkUseProgressBar_CheckedChanged); + // + // kchkDoNotShowAgain + // + this.kchkDoNotShowAgain.Location = new System.Drawing.Point(93, 41); + this.kchkDoNotShowAgain.Name = "kchkDoNotShowAgain"; + this.kchkDoNotShowAgain.Size = new System.Drawing.Size(197, 20); + this.kchkDoNotShowAgain.TabIndex = 3; + this.kchkDoNotShowAgain.Values.Text = "Show do not show again option"; + this.kchkDoNotShowAgain.CheckedChanged += new System.EventHandler(this.kchkDoNotShowAgain_CheckedChanged); + // + // kchkTopMost + // + this.kchkTopMost.Location = new System.Drawing.Point(13, 41); + this.kchkTopMost.Name = "kchkTopMost"; + this.kchkTopMost.Size = new System.Drawing.Size(76, 20); + this.kchkTopMost.TabIndex = 2; + this.kchkTopMost.Values.Text = "Top Most"; + this.kchkTopMost.CheckedChanged += new System.EventHandler(this.kchkTopMost_CheckedChanged); + // + // kchkShowCloseButton + // + this.kchkShowCloseButton.Location = new System.Drawing.Point(93, 14); + this.kchkShowCloseButton.Name = "kchkShowCloseButton"; + this.kchkShowCloseButton.Size = new System.Drawing.Size(126, 20); + this.kchkShowCloseButton.TabIndex = 1; + this.kchkShowCloseButton.Values.Text = "Show Close Button"; + this.kchkShowCloseButton.CheckedChanged += new System.EventHandler(this.kchkShowCloseButton_CheckedChanged); + // + // kchkUseFade + // + this.kchkUseFade.Enabled = false; + this.kchkUseFade.Location = new System.Drawing.Point(13, 14); + this.kchkUseFade.Name = "kchkUseFade"; + this.kchkUseFade.Size = new System.Drawing.Size(73, 20); + this.kchkUseFade.TabIndex = 0; + this.kchkUseFade.Values.Text = "Use Fade"; + // + // kryptonGroupBox1 + // + this.kryptonGroupBox1.Location = new System.Drawing.Point(124, 235); + this.kryptonGroupBox1.Name = "kryptonGroupBox1"; + // + // kryptonGroupBox1.Panel + // + this.kryptonGroupBox1.Panel.Controls.Add(this.ktxtCustomIconPath); + this.kryptonGroupBox1.Panel.Controls.Add(this.kcmbNotificationIconType); + this.kryptonGroupBox1.Size = new System.Drawing.Size(300, 106); + this.kryptonGroupBox1.TabIndex = 7; + this.kryptonGroupBox1.Values.Heading = "Icon"; + // + // ktxtCustomIconPath + // + this.ktxtCustomIconPath.ButtonSpecs.Add(this.bsaBrowseIcon); + this.ktxtCustomIconPath.Enabled = false; + this.ktxtCustomIconPath.Location = new System.Drawing.Point(13, 42); + this.ktxtCustomIconPath.Name = "ktxtCustomIconPath"; + this.ktxtCustomIconPath.Size = new System.Drawing.Size(235, 24); + this.ktxtCustomIconPath.TabIndex = 1; + // + // bsaBrowseIcon + // + this.bsaBrowseIcon.Text = "..."; + this.bsaBrowseIcon.UniqueName = "7d9ab43ed4574cfdbde5e50de62f081e"; + // + // kcmbNotificationIconType + // + this.kcmbNotificationIconType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.kcmbNotificationIconType.DropDownWidth = 235; + this.kcmbNotificationIconType.IntegralHeight = false; + this.kcmbNotificationIconType.Location = new System.Drawing.Point(13, 13); + this.kcmbNotificationIconType.Name = "kcmbNotificationIconType"; + this.kcmbNotificationIconType.Size = new System.Drawing.Size(235, 22); + this.kcmbNotificationIconType.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kcmbNotificationIconType.TabIndex = 0; + this.kcmbNotificationIconType.SelectedIndexChanged += new System.EventHandler(this.kcmbNotificationIconType_SelectedIndexChanged); + // + // kcmbTitleAlignment + // + this.kcmbTitleAlignment.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.kcmbTitleAlignment.DropDownWidth = 300; + this.kcmbTitleAlignment.IntegralHeight = false; + this.kcmbTitleAlignment.Location = new System.Drawing.Point(124, 206); + this.kcmbTitleAlignment.Name = "kcmbTitleAlignment"; + this.kcmbTitleAlignment.Size = new System.Drawing.Size(300, 22); + this.kcmbTitleAlignment.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kcmbTitleAlignment.TabIndex = 6; + // + // kryptonLabel3 + // + this.kryptonLabel3.LabelStyle = Krypton.Toolkit.LabelStyle.BoldPanel; + this.kryptonLabel3.Location = new System.Drawing.Point(13, 206); + this.kryptonLabel3.Name = "kryptonLabel3"; + this.kryptonLabel3.Size = new System.Drawing.Size(104, 20); + this.kryptonLabel3.TabIndex = 5; + this.kryptonLabel3.Values.Text = "Title Alignment:"; + // + // krtbNotificationMessage + // + this.krtbNotificationMessage.Location = new System.Drawing.Point(124, 42); + this.krtbNotificationMessage.Name = "krtbNotificationMessage"; + this.krtbNotificationMessage.Size = new System.Drawing.Size(300, 158); + this.krtbNotificationMessage.TabIndex = 4; + this.krtbNotificationMessage.Text = "Enter the notification message here..."; + this.krtbNotificationMessage.TextChanged += new System.EventHandler(this.krtbNotificationMessage_TextChanged); + // + // ktxtNotificationTitle + // + this.ktxtNotificationTitle.Location = new System.Drawing.Point(124, 13); + this.ktxtNotificationTitle.Name = "ktxtNotificationTitle"; + this.ktxtNotificationTitle.Size = new System.Drawing.Size(300, 23); + this.ktxtNotificationTitle.TabIndex = 3; + this.ktxtNotificationTitle.Text = "Put the notification title here"; + // + // kbtnTestText + // + this.kbtnTestText.Location = new System.Drawing.Point(13, 91); + this.kbtnTestText.Name = "kbtnTestText"; + this.kbtnTestText.Size = new System.Drawing.Size(88, 80); + this.kbtnTestText.TabIndex = 2; + this.kbtnTestText.Values.DropDownArrowColor = System.Drawing.Color.Empty; + this.kbtnTestText.Values.Text = "Use\r\nTest\r\nText"; + this.kbtnTestText.Click += new System.EventHandler(this.kbtnTestText_Click); + // + // kryptonLabel2 + // + this.kryptonLabel2.LabelStyle = Krypton.Toolkit.LabelStyle.BoldPanel; + this.kryptonLabel2.Location = new System.Drawing.Point(13, 40); + this.kryptonLabel2.Name = "kryptonLabel2"; + this.kryptonLabel2.Size = new System.Drawing.Size(64, 20); + this.kryptonLabel2.TabIndex = 1; + this.kryptonLabel2.Values.Text = "Message:"; + // + // kryptonLabel1 + // + this.kryptonLabel1.LabelStyle = Krypton.Toolkit.LabelStyle.BoldPanel; + this.kryptonLabel1.Location = new System.Drawing.Point(13, 13); + this.kryptonLabel1.Name = "kryptonLabel1"; + this.kryptonLabel1.Size = new System.Drawing.Size(40, 20); + this.kryptonLabel1.TabIndex = 0; + this.kryptonLabel1.Values.Text = "Title:"; + // + // BasicToastNotificationTest + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(889, 696); + this.Controls.Add(this.kryptonPanel2); + this.Controls.Add(this.kryptonBorderEdge2); + this.Controls.Add(this.kryptonPanel1); + this.Name = "BasicToastNotificationTest"; + this.Text = "BasicToastNotificationTest"; + this.Load += new System.EventHandler(this.BasicToastNotificationTest_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(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3.Panel)).EndInit(); + this.kryptonGroupBox3.Panel.ResumeLayout(false); + this.kryptonGroupBox3.Panel.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3)).EndInit(); + this.kryptonGroupBox3.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox2.Panel)).EndInit(); + this.kryptonGroupBox2.Panel.ResumeLayout(false); + this.kryptonGroupBox2.Panel.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox2)).EndInit(); + this.kryptonGroupBox2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).EndInit(); + this.kryptonGroupBox1.Panel.ResumeLayout(false); + this.kryptonGroupBox1.Panel.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).EndInit(); + this.kryptonGroupBox1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.kcmbNotificationIconType)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.kcmbTitleAlignment)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private KryptonPanel kryptonPanel1; + private KryptonButton kbtnShow; + private KryptonBorderEdge kryptonBorderEdge1; + private KryptonBorderEdge kryptonBorderEdge2; + private KryptonPanel kryptonPanel2; + private KryptonRichTextBox krtbNotificationMessage; + private KryptonTextBox ktxtNotificationTitle; + private KryptonButton kbtnTestText; + private KryptonLabel kryptonLabel2; + private KryptonLabel kryptonLabel1; + private KryptonGroupBox kryptonGroupBox1; + private KryptonTextBox ktxtCustomIconPath; + private KryptonComboBox kcmbNotificationIconType; + private KryptonComboBox kcmbTitleAlignment; + private KryptonLabel kryptonLabel3; + private KryptonGroupBox kryptonGroupBox2; + private KryptonCheckBox kchkShowCloseButton; + private KryptonCheckBox kchkUseFade; + private ButtonSpecAny bsaBrowseIcon; + private KryptonCheckBox kchkDoNotShowAgain; + private KryptonCheckBox kchkTopMost; + private KryptonCheckBox kchkUseDoNotShowAgainOptionThreeState; + private KryptonCheckBox kchkUseProgressBar; + private KryptonCheckBox kchkIsDoNotShowAgainOptionChecked; + private KryptonCheckBox kchkShowCountDownSecondsOnProgressBar; + private KryptonCheckBox kchkReportLocation; + private KryptonColorButton kcbtnBorderColor2; + private KryptonColorButton kcbtnBorderColor1; + private KryptonGroupBox kryptonGroupBox3; + private KryptonLabel klblStartLocationX; + private KryptonCheckBox kchkSetDefaultLocation; + private KryptonLabel klblStartLocation; + private KryptonNumericUpDown knudStartLocationY; + private KryptonNumericUpDown knudStartLocationX; + private KryptonLabel klblStartLocationY; + private KryptonNumericUpDown knudCountdownSeconds; + private KryptonLabel kryptonLabel5; + private KryptonCheckBox kchkUseRTL; + private KryptonCheckBox kchkEnableHyperLinks; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/BasicToastNotificationTest.cs b/Source/Krypton Toolkit/Examples/BasicToastNotificationTest.cs new file mode 100644 index 000000000..73170a67b --- /dev/null +++ b/Source/Krypton Toolkit/Examples/BasicToastNotificationTest.cs @@ -0,0 +1,277 @@ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Examples +{ + public partial class BasicToastNotificationTest : KryptonForm + { + #region Instance Fields + + private bool _showCloseBox; + private bool _topMost; + private bool _useFade; + private bool _reportToastLocation; + private bool _showDoNotShowAgainOption; + private bool _enableHyperLinks; + private KryptonUseRTLLayout _useRtlReading; + private Color _borderColor1; + private Color _borderColor2; + private PaletteRelativeAlign _titleAlignment; + private Font _contentFont; + private Font _titleFont; + private int _countDownSeconds; + private KryptonToastNotificationIcon _notificationIcon; + private string _notificationTitleText; + private string _notificationContentText; + + #endregion + + #region Constants + + private const string SEED_TEXT = @"MIT License + +Copyright (c) 2017 - 2024 Krypton Suite + +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 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +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."; + + #endregion + + public BasicToastNotificationTest() + { + InitializeComponent(); + } + + private void BasicToastNotificationTest_Load(object sender, EventArgs e) + { + // Set defaults + _showCloseBox = false; + _topMost = true; + _useFade = false; + _reportToastLocation = false; + _showDoNotShowAgainOption = false; + _enableHyperLinks = true; + _titleAlignment = PaletteRelativeAlign.Inherit; + _countDownSeconds = 60; + _notificationIcon = KryptonToastNotificationIcon.Information; + _notificationTitleText = ktxtNotificationTitle.Text; + _notificationContentText = krtbNotificationMessage.Text; + _borderColor1 = Color.Empty; + _borderColor2 = Color.Empty; + _useRtlReading = KryptonUseRTLLayout.No; + + kcbtnBorderColor1.SelectedColor = Color.Empty; + kcbtnBorderColor2.SelectedColor = Color.Empty; + + foreach (var value in Enum.GetValues(typeof(KryptonToastNotificationIcon))) + { + kcmbNotificationIconType.Items.Add(value.ToString()); + } + + kcmbNotificationIconType.SelectedIndex = 8; + + foreach (var value in Enum.GetValues(typeof(PaletteRelativeAlign))) + { + kcmbTitleAlignment.Items.Add(value.ToString()); + } + + kcmbTitleAlignment.SelectedIndex = 3; + + //knudStartLocationX.Maximum = GraphicsExtensions.GetWorkingArea().Width; + + //knudStartLocationX.Value = GraphicsExtensions.GetWorkingArea().Width - Width - 5; + + //knudStartLocationY.Maximum = GraphicsExtensions.GetWorkingArea().Height; + + //knudStartLocationY.Value = GraphicsExtensions.GetWorkingArea().Height - Height - 5; + } + + private void kbtnShow_Click(object sender, EventArgs e) + { + Krypton.Toolkit.Suite.Extended.ToastNotification.KryptonBasicToastNotificationData notificationData = new Krypton.Toolkit.Suite.Extended.ToastNotification.KryptonBasicToastNotificationData() + { + CountDownSeconds = _countDownSeconds, + CustomImage = null, + NotificationContent = _notificationContentText, + NotificationTitle = _notificationTitleText, + NotificationContentFont = _contentFont, + NotificationTitleFont = _titleFont, + NotificationIcon = _notificationIcon, + EnableHyperLinks = _enableHyperLinks, + NotificationLocation = null, + ShowDoNotShowAgainOption = _showDoNotShowAgainOption, + TopMost = _topMost, + UseFade = _useFade, + ShowCloseButton = _showCloseBox, + ReportToastLocation = _reportToastLocation, + TitleAlignment = _titleAlignment, + BorderColor1 = _borderColor1, + BorderColor2 = _borderColor2, + UseRtlReading = _useRtlReading + }; + + Krypton.Toolkit.Suite.Extended.ToastNotification.KryptonBasicToastNotificationData notificationDataWithLocation = new Krypton.Toolkit.Suite.Extended.ToastNotification.KryptonBasicToastNotificationData() + { + CountDownSeconds = _countDownSeconds, + CustomImage = null, + NotificationContent = _notificationContentText, + NotificationTitle = _notificationTitleText, + NotificationContentFont = _contentFont, + NotificationTitleFont = _titleFont, + NotificationIcon = _notificationIcon, + NotificationLocation = new Point((int)knudStartLocationX.Value, (int)knudStartLocationY.Value), + TitleAlignment = _titleAlignment, + TopMost = _topMost, + UseFade = _useFade, + ShowCloseButton = _showCloseBox, + EnableHyperLinks = _enableHyperLinks + }; + + if (kchkUseProgressBar.Checked) + { + Krypton.Toolkit.Suite.Extended.ToastNotification.KryptonToastNotification.ShowBasicProgressBarNotification(notificationData); + } + else + { + Krypton.Toolkit.Suite.Extended.ToastNotification.KryptonToastNotification.ShowBasicToastNotification(notificationData); + } + } + + private void kchkShowCloseButton_CheckedChanged(object sender, EventArgs e) + { + _showCloseBox = kchkShowCloseButton.Checked; + } + + private void kchkTopMost_CheckedChanged(object sender, EventArgs e) + { + _topMost = kchkTopMost.Checked; + } + + private void kchkDoNotShowAgain_CheckedChanged(object sender, EventArgs e) + { + _showDoNotShowAgainOption = kchkDoNotShowAgain.Checked; + } + + private void kchkUseDoNotShowAgainOptionThreeState_CheckedChanged(object sender, EventArgs e) + { + + } + + private void kchkIsDoNotShowAgainOptionChecked_CheckedChanged(object sender, EventArgs e) + { + + } + + private void kchkUseProgressBar_CheckedChanged(object sender, EventArgs e) + { + + } + + private void kchkShowCountDownSecondsOnProgressBar_CheckedChanged(object sender, EventArgs e) + { + + } + + private void kchkReportLocation_CheckedChanged(object sender, EventArgs e) + { + + } + + private void kchkUseRTL_CheckedChanged(object sender, EventArgs e) + { + _useRtlReading = kchkUseRTL.Checked ? KryptonUseRTLLayout.Yes : KryptonUseRTLLayout.No; + } + + private void kchkSetDefaultLocation_CheckedChanged(object sender, EventArgs e) + { + + } + + private void kcbtnBorderColor1_SelectedColorChanged(object sender, ColorEventArgs e) + { + + } + + private void kcbtnBorderColor2_SelectedColorChanged(object sender, ColorEventArgs e) + { + + } + + private void kbtnTestText_Click(object sender, EventArgs e) + { + krtbNotificationMessage.Text = SEED_TEXT; + } + + private void knudCountdownSeconds_ValueChanged(object sender, EventArgs e) + { + _countDownSeconds = Convert.ToInt32(knudCountdownSeconds.Value); + } + + private void kchkEnableHyperLinks_CheckedChanged(object sender, EventArgs e) + { + _enableHyperLinks = kchkEnableHyperLinks.Checked; + } + + private void krtbNotificationMessage_TextChanged(object sender, EventArgs e) + { + _notificationContentText = krtbNotificationMessage.Text; + } + + private void kcmbNotificationIconType_SelectedIndexChanged(object sender, EventArgs e) + { + _notificationIcon = (KryptonToastNotificationIcon)Enum.Parse(typeof(KryptonToastNotificationIcon), + kcmbNotificationIconType.Text); + } + } +} diff --git a/Source/Krypton Toolkit/Examples/BasicToastNotificationTest.resx b/Source/Krypton Toolkit/Examples/BasicToastNotificationTest.resx new file mode 100644 index 000000000..85104d505 --- /dev/null +++ b/Source/Krypton Toolkit/Examples/BasicToastNotificationTest.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/ButtonItems.Designer.cs b/Source/Krypton Toolkit/Examples/ButtonItems.Designer.cs index a842ef2b6..2466ee1de 100644 --- a/Source/Krypton Toolkit/Examples/ButtonItems.Designer.cs +++ b/Source/Krypton Toolkit/Examples/ButtonItems.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class ButtonItems { @@ -72,7 +100,6 @@ private void InitializeComponent() this.kryptonDialogButtonExtended1.AcceptButtonBackColour2 = System.Drawing.Color.Green; this.kryptonDialogButtonExtended1.AcceptButtonTextColour1 = System.Drawing.Color.Empty; this.kryptonDialogButtonExtended1.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.kryptonDialogButtonExtended1.CornerRoundingRadius = -1F; this.kryptonDialogButtonExtended1.DenyButtonBackColour1 = System.Drawing.Color.Red; this.kryptonDialogButtonExtended1.DenyButtonBackColour2 = System.Drawing.Color.Red; this.kryptonDialogButtonExtended1.DenyButtonTextColour1 = System.Drawing.Color.Empty; @@ -89,7 +116,6 @@ private void InitializeComponent() // // kryptonYesDialogButton1 // - this.kryptonYesDialogButton1.CornerRoundingRadius = -1F; this.kryptonYesDialogButton1.DialogResult = System.Windows.Forms.DialogResult.Yes; this.kryptonYesDialogButton1.Location = new System.Drawing.Point(112, 10); this.kryptonYesDialogButton1.Name = "kryptonYesDialogButton1"; @@ -111,7 +137,6 @@ private void InitializeComponent() // this.kryptonuacButtonVersion21.AutoSize = true; this.kryptonuacButtonVersion21.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kryptonuacButtonVersion21.CornerRoundingRadius = -1F; this.kryptonuacButtonVersion21.CustomShieldSize = new System.Drawing.Size(0, 0); this.kryptonuacButtonVersion21.ExtraArguments = null; this.kryptonuacButtonVersion21.Location = new System.Drawing.Point(141, 37); @@ -127,7 +152,6 @@ private void InitializeComponent() // kryptonuacButtonVersion11 // this.kryptonuacButtonVersion11.AssemblyToElevate = null; - this.kryptonuacButtonVersion11.CornerRoundingRadius = -1F; this.kryptonuacButtonVersion11.Location = new System.Drawing.Point(10, 37); this.kryptonuacButtonVersion11.Name = "kryptonuacButtonVersion11"; this.kryptonuacButtonVersion11.Size = new System.Drawing.Size(116, 23); @@ -138,7 +162,6 @@ private void InitializeComponent() // kryptonSplitButton1 // this.kryptonSplitButton1.AutoSize = true; - this.kryptonSplitButton1.CornerRoundingRadius = -1F; this.kryptonSplitButton1.Location = new System.Drawing.Point(465, 10); this.kryptonSplitButton1.Name = "kryptonSplitButton1"; this.kryptonSplitButton1.ProcessPath = null; @@ -150,7 +173,6 @@ private void InitializeComponent() // // kryptonokDialogButton1 // - this.kryptonokDialogButton1.CornerRoundingRadius = -1F; this.kryptonokDialogButton1.DialogResult = System.Windows.Forms.DialogResult.OK; this.kryptonokDialogButton1.Location = new System.Drawing.Point(30, 10); this.kryptonokDialogButton1.Name = "kryptonokDialogButton1"; @@ -161,7 +183,6 @@ private void InitializeComponent() // // kryptonnoDialogButton1 // - this.kryptonnoDialogButton1.CornerRoundingRadius = -1F; this.kryptonnoDialogButton1.DialogResult = System.Windows.Forms.DialogResult.No; this.kryptonnoDialogButton1.Location = new System.Drawing.Point(195, 10); this.kryptonnoDialogButton1.Name = "kryptonnoDialogButton1"; @@ -172,7 +193,6 @@ private void InitializeComponent() // // kryptonCommandLinkVersion21 // - this.kryptonCommandLinkVersion21.CornerRoundingRadius = -1F; this.kryptonCommandLinkVersion21.Location = new System.Drawing.Point(230, 152); this.kryptonCommandLinkVersion21.Name = "kryptonCommandLinkVersion21"; this.kryptonCommandLinkVersion21.ProcessToElevate = null; @@ -202,7 +222,6 @@ private void InitializeComponent() // // kryptonCancelDialogButton1 // - this.kryptonCancelDialogButton1.CornerRoundingRadius = -1F; this.kryptonCancelDialogButton1.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kryptonCancelDialogButton1.Location = new System.Drawing.Point(277, 10); this.kryptonCancelDialogButton1.Name = "kryptonCancelDialogButton1"; @@ -216,7 +235,6 @@ private void InitializeComponent() this.kryptonBrowseButton1.AutoSize = true; this.kryptonBrowseButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.kryptonBrowseButton1.BrowseButtonAction = Krypton.Toolkit.Suite.Extended.Buttons.BrowseButtonAction.SaveFile; - this.kryptonBrowseButton1.CornerRoundingRadius = -1F; this.kryptonBrowseButton1.DialogFilter = null; this.kryptonBrowseButton1.DialogTitle = null; this.kryptonBrowseButton1.ExtensionList = null; diff --git a/Source/Krypton Toolkit/Examples/ButtonItems.cs b/Source/Krypton Toolkit/Examples/ButtonItems.cs index 502e3204e..006d051f1 100644 --- a/Source/Krypton Toolkit/Examples/ButtonItems.cs +++ b/Source/Krypton Toolkit/Examples/ButtonItems.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { public partial class ButtonItems : KryptonForm { diff --git a/Source/Krypton Toolkit/Examples/CalendarItems.Designer.cs b/Source/Krypton Toolkit/Examples/CalendarItems.Designer.cs index fbf64039a..e28126c55 100644 --- a/Source/Krypton Toolkit/Examples/CalendarItems.Designer.cs +++ b/Source/Krypton Toolkit/Examples/CalendarItems.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class CalendarItems { diff --git a/Source/Krypton Toolkit/Examples/CalendarItems.cs b/Source/Krypton Toolkit/Examples/CalendarItems.cs index 1be852ee2..292f44c89 100644 --- a/Source/Krypton Toolkit/Examples/CalendarItems.cs +++ b/Source/Krypton Toolkit/Examples/CalendarItems.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { public partial class CalendarItems : KryptonForm { diff --git a/Source/Krypton Toolkit/Examples/CheckBoxComboBoxTest.Designer.cs b/Source/Krypton Toolkit/Examples/CheckBoxComboBoxTest.Designer.cs new file mode 100644 index 000000000..6d2ae94b3 --- /dev/null +++ b/Source/Krypton Toolkit/Examples/CheckBoxComboBoxTest.Designer.cs @@ -0,0 +1,214 @@ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples +{ + partial class CheckBoxComboBoxTest + { + /// + /// 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() + { + Krypton.Toolkit.Suite.Extended.Controls.KryptonCheckBoxProperties kryptonCheckBoxProperties1 = new Krypton.Toolkit.Suite.Extended.Controls.KryptonCheckBoxProperties(); + this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); + this.kbtnCheckItem5 = new Krypton.Toolkit.KryptonButton(); + this.kbtnCheckDDDD = new Krypton.Toolkit.KryptonButton(); + this.kbtnCheckInserted = new Krypton.Toolkit.KryptonButton(); + this.kbtnClear = new Krypton.Toolkit.KryptonButton(); + this.kbtnCheckItem1 = new Krypton.Toolkit.KryptonButton(); + this.kryptonLabel4 = new Krypton.Toolkit.KryptonLabel(); + this.kryptonLabel3 = new Krypton.Toolkit.KryptonLabel(); + this.kryptonLabel2 = new Krypton.Toolkit.KryptonLabel(); + this.kryptonLabel1 = new Krypton.Toolkit.KryptonLabel(); + this.kccmbManual = new Krypton.Toolkit.Suite.Extended.Controls.KryptonCheckBoxComboBox(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + this.kryptonPanel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kccmbManual)).BeginInit(); + this.SuspendLayout(); + // + // kryptonPanel1 + // + this.kryptonPanel1.Controls.Add(this.kccmbManual); + this.kryptonPanel1.Controls.Add(this.kbtnCheckItem5); + this.kryptonPanel1.Controls.Add(this.kbtnCheckDDDD); + this.kryptonPanel1.Controls.Add(this.kbtnCheckInserted); + this.kryptonPanel1.Controls.Add(this.kbtnClear); + this.kryptonPanel1.Controls.Add(this.kbtnCheckItem1); + this.kryptonPanel1.Controls.Add(this.kryptonLabel4); + this.kryptonPanel1.Controls.Add(this.kryptonLabel3); + this.kryptonPanel1.Controls.Add(this.kryptonLabel2); + this.kryptonPanel1.Controls.Add(this.kryptonLabel1); + 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(475, 252); + this.kryptonPanel1.TabIndex = 0; + // + // kbtnCheckItem5 + // + this.kbtnCheckItem5.Location = new System.Drawing.Point(171, 202); + this.kbtnCheckItem5.Name = "kbtnCheckItem5"; + this.kbtnCheckItem5.Size = new System.Drawing.Size(124, 25); + this.kbtnCheckItem5.TabIndex = 13; + this.kbtnCheckItem5.Values.Text = "! Check \"Item 5\""; + this.kbtnCheckItem5.Click += new System.EventHandler(this.kbtnCheckItem5_Click); + // + // kbtnCheckDDDD + // + this.kbtnCheckDDDD.Location = new System.Drawing.Point(171, 147); + this.kbtnCheckDDDD.Name = "kbtnCheckDDDD"; + this.kbtnCheckDDDD.Size = new System.Drawing.Size(124, 25); + this.kbtnCheckDDDD.TabIndex = 12; + this.kbtnCheckDDDD.Values.Text = "! Check \"DDDD\""; + this.kbtnCheckDDDD.Click += new System.EventHandler(this.kbtnCheckDDDD_Click); + // + // kbtnCheckInserted + // + this.kbtnCheckInserted.Location = new System.Drawing.Point(171, 93); + this.kbtnCheckInserted.Name = "kbtnCheckInserted"; + this.kbtnCheckInserted.Size = new System.Drawing.Size(124, 25); + this.kbtnCheckInserted.TabIndex = 11; + this.kbtnCheckInserted.Values.Text = "! Check \"Inserted\""; + this.kbtnCheckInserted.Click += new System.EventHandler(this.kbtnCheckInserted_Click); + // + // kbtnClear + // + this.kbtnClear.Location = new System.Drawing.Point(302, 39); + this.kbtnClear.Name = "kbtnClear"; + this.kbtnClear.Size = new System.Drawing.Size(158, 25); + this.kbtnClear.TabIndex = 10; + this.kbtnClear.Values.Text = "Clear && Repopulate"; + this.kbtnClear.Click += new System.EventHandler(this.kbtnClear_Click); + // + // kbtnCheckItem1 + // + this.kbtnCheckItem1.Location = new System.Drawing.Point(171, 39); + this.kbtnCheckItem1.Name = "kbtnCheckItem1"; + this.kbtnCheckItem1.Size = new System.Drawing.Size(124, 25); + this.kbtnCheckItem1.TabIndex = 9; + this.kbtnCheckItem1.Values.Text = "! Check \"Item 1\""; + this.kbtnCheckItem1.Click += new System.EventHandler(this.kbtnCheckItem1_Click); + // + // kryptonLabel4 + // + this.kryptonLabel4.Location = new System.Drawing.Point(13, 175); + this.kryptonLabel4.Name = "kryptonLabel4"; + this.kryptonLabel4.Size = new System.Drawing.Size(282, 20); + this.kryptonLabel4.TabIndex = 8; + this.kryptonLabel4.Values.Text = "A different look. Accessed via CheckBoxProperties"; + // + // kryptonLabel3 + // + this.kryptonLabel3.Location = new System.Drawing.Point(13, 121); + this.kryptonLabel3.Name = "kryptonLabel3"; + this.kryptonLabel3.Size = new System.Drawing.Size(233, 20); + this.kryptonLabel3.TabIndex = 7; + this.kryptonLabel3.Values.Text = "Populated using a DataTable DataSource"; + // + // kryptonLabel2 + // + this.kryptonLabel2.Location = new System.Drawing.Point(13, 67); + this.kryptonLabel2.Name = "kryptonLabel2"; + this.kryptonLabel2.Size = new System.Drawing.Size(243, 20); + this.kryptonLabel2.TabIndex = 6; + this.kryptonLabel2.Values.Text = "Populated using a custom IList DataSource"; + // + // kryptonLabel1 + // + this.kryptonLabel1.Location = new System.Drawing.Point(13, 13); + this.kryptonLabel1.Name = "kryptonLabel1"; + this.kryptonLabel1.Size = new System.Drawing.Size(248, 20); + this.kryptonLabel1.TabIndex = 5; + this.kryptonLabel1.Values.Text = "Populated Manually using ComboBox.Items"; + // + // kccmbManual + // + kryptonCheckBoxProperties1.ForeColor = System.Drawing.SystemColors.ControlText; + this.kccmbManual.CheckBoxProperties = kryptonCheckBoxProperties1; + this.kccmbManual.DisplayMemberSingleItem = ""; + this.kccmbManual.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.kccmbManual.Location = new System.Drawing.Point(13, 40); + this.kccmbManual.Name = "kccmbManual"; + this.kccmbManual.Size = new System.Drawing.Size(152, 21); + this.kccmbManual.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; + this.kccmbManual.TabIndex = 1; + // + // CheckBoxComboBoxTest + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(475, 252); + this.Controls.Add(this.kryptonPanel1); + this.Name = "CheckBoxComboBoxTest"; + this.Text = "CheckBoxComboBoxTest"; + this.Load += new System.EventHandler(this.CheckBoxComboBoxTest_Load); + ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + this.kryptonPanel1.ResumeLayout(false); + this.kryptonPanel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kccmbManual)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private KryptonPanel kryptonPanel1; + private KryptonLabel kryptonLabel1; + private KryptonLabel kryptonLabel2; + private KryptonLabel kryptonLabel3; + private KryptonLabel kryptonLabel4; + private KryptonButton kbtnCheckItem1; + private KryptonButton kbtnClear; + private KryptonButton kbtnCheckInserted; + private KryptonButton kbtnCheckDDDD; + private KryptonButton kbtnCheckItem5; + private Krypton.Toolkit.Suite.Extended.Controls.KryptonCheckBoxComboBox kccmbManual; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/CheckBoxComboBoxTest.cs b/Source/Krypton Toolkit/Examples/CheckBoxComboBoxTest.cs new file mode 100644 index 000000000..c57ab6848 --- /dev/null +++ b/Source/Krypton Toolkit/Examples/CheckBoxComboBoxTest.cs @@ -0,0 +1,145 @@ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +using System.Data; + +using Krypton.Toolkit.Suite.Extended.Controls; + +namespace Examples +{ + public partial class CheckBoxComboBoxTest : KryptonForm + { + private StatusList _statusList; + + private ListSelectionWrapper _statusSelections; + + public CheckBoxComboBoxTest() + { + InitializeComponent(); + } + + private void CheckBoxComboBoxTest_Load(object sender, EventArgs e) + { + PopulateManualCombo(); + + #region POPULATED USING A CUSTOM "IList" DATASOURCE + + _statusList = new StatusList(); + + _statusList.Add(new Status(1, "New")); + _statusList.Add(new Status(2, "Loaded")); + _statusList.Add(new Status(3, "Inserted")); + Status UpdatedStatus = new Status(4, "Updated"); + _statusList.Add(UpdatedStatus); + _statusList.Add(new Status(5, "Deleted")); + + _statusSelections = new ListSelectionWrapper(_statusList, "Name"); + + //kcbcmbIListDataSource.DataSource = _statusSelections; + //kcbcmbIListDataSource.DisplayMemberSingleItem = "Name"; + //kcbcmbIListDataSource.DisplayMember = "NameConcatenated"; + //kcbcmbIListDataSource.ValueMember = "Selected"; + + //kcbcmbIListDataSource.CheckBoxItems[3].DataBindings.DefaultDataSourceUpdateMode + // = DataSourceUpdateMode.OnPropertyChanged; + //kcbcmbIListDataSource.DataBindings.DefaultDataSourceUpdateMode + // = DataSourceUpdateMode.OnPropertyChanged; + + _statusSelections.FindObjectWithItem(UpdatedStatus).Selected = true; + + #endregion + + #region POPULATED USING A DATATABLE + + DataTable DT = new DataTable("TEST TABLE FOR DEMO PURPOSES"); + DT.Columns.AddRange( + new DataColumn[] + { + new DataColumn("Id", typeof(int)), + new DataColumn("SomePropertyOrColumnName", typeof(string)), + new DataColumn("Description", typeof(string)), + }); + DT.Rows.Add(1, "AAAA", "AAAAA"); + DT.Rows.Add(2, "BBBB", "BBBBB"); + DT.Rows.Add(3, "CCCC", "CCCCC"); + DT.Rows.Add(3, "DDDD", "DDDDD"); + + //kcbcmbDataTableDataSource.DataSource = + // new ListSelectionWrapper( + // DT.Rows, + // "SomePropertyOrColumnName" // "SomePropertyOrColumnName" will populate the Name on ObjectSelectionWrapper. + // ); + //kcbcmbDataTableDataSource.DisplayMemberSingleItem = "Name"; + //kcbcmbDataTableDataSource.DisplayMember = "NameConcatenated"; + //kcbcmbDataTableDataSource.ValueMember = "Selected"; + + #endregion + } + + private void PopulateManualCombo() + { + kccmbManual.Items.Add("Item 1"); + kccmbManual.Items.Add("Item 2"); + kccmbManual.Items.Add("Item 3"); + kccmbManual.Items.Add("Item 4"); + kccmbManual.Items.Add("Item 5"); + kccmbManual.Items.Add("Item 6"); + kccmbManual.Items.Add("Item 7"); + kccmbManual.Items.Add("Item 8"); + + kccmbManual.CheckBoxItems[1].Checked = true; + } + + private void kbtnCheckItem1_Click(object sender, EventArgs e) + { + kccmbManual.CheckBoxItems["Item 1"].Checked = !kccmbManual.CheckBoxItems["Item 1"].Checked; + } + + private void kbtnCheckItem5_Click(object sender, EventArgs e) + { + //kcbcmbStyle.CheckBoxItems["Item 5"].Checked = !kcbcmbStyle.CheckBoxItems["Item 5"].Checked; + } + + private void kbtnCheckDDDD_Click(object sender, EventArgs e) + { + //kcbcmbDataTableDataSource.CheckBoxItems["DDDD"].Checked = !kcbcmbDataTableDataSource.CheckBoxItems["DDDD"].Checked; + } + + private void kbtnCheckInserted_Click(object sender, EventArgs e) + { + //kcbcmbIListDataSource.CheckBoxItems["Inserted"].Checked = !kcbcmbIListDataSource.CheckBoxItems["Inserted"].Checked; + } + + private void kbtnClear_Click(object sender, EventArgs e) + { + kccmbManual.Clear(); + + PopulateManualCombo(); + } + } +} diff --git a/Source/Krypton Toolkit/Examples/OutlookGridExample.resx b/Source/Krypton Toolkit/Examples/CheckBoxComboBoxTest.resx similarity index 100% rename from Source/Krypton Toolkit/Examples/OutlookGridExample.resx rename to Source/Krypton Toolkit/Examples/CheckBoxComboBoxTest.resx diff --git a/Source/Krypton Toolkit/Examples/CheckSumExample.Designer.cs b/Source/Krypton Toolkit/Examples/CheckSumExample.Designer.cs index 908f4f2f9..4d2cf820c 100644 --- a/Source/Krypton Toolkit/Examples/CheckSumExample.Designer.cs +++ b/Source/Krypton Toolkit/Examples/CheckSumExample.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class CheckSumExample { @@ -48,7 +76,6 @@ private void InitializeComponent() // // kryptonButton2 // - this.kryptonButton2.CornerRoundingRadius = -1F; this.kryptonButton2.Location = new System.Drawing.Point(165, 13); this.kryptonButton2.Name = "kryptonButton2"; this.kryptonButton2.Size = new System.Drawing.Size(146, 25); @@ -58,7 +85,6 @@ private void InitializeComponent() // // kryptonButton1 // - this.kryptonButton1.CornerRoundingRadius = -1F; this.kryptonButton1.Location = new System.Drawing.Point(13, 13); this.kryptonButton1.Name = "kryptonButton1"; this.kryptonButton1.Size = new System.Drawing.Size(146, 25); diff --git a/Source/Krypton Toolkit/Examples/CheckSumExample.cs b/Source/Krypton Toolkit/Examples/CheckSumExample.cs index 37b1d8982..bd6809995 100644 --- a/Source/Krypton Toolkit/Examples/CheckSumExample.cs +++ b/Source/Krypton Toolkit/Examples/CheckSumExample.cs @@ -1,4 +1,32 @@ -using Krypton.Toolkit.Suite.Extended.CheckSum.Tools; +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +using Krypton.Toolkit.Suite.Extended.CheckSum.Tools; namespace Examples { diff --git a/Source/Krypton Toolkit/Examples/CircularProgressBarExample.Designer.cs b/Source/Krypton Toolkit/Examples/CircularProgressBarExample.Designer.cs index 0bef4aea8..3c82a3d4e 100644 --- a/Source/Krypton Toolkit/Examples/CircularProgressBarExample.Designer.cs +++ b/Source/Krypton Toolkit/Examples/CircularProgressBarExample.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class CircularProgressBarExample { @@ -138,7 +166,7 @@ private void InitializeComponent() // // circularProgressBar1 // - this.circularProgressBar1.AnimationFunction = WinFormAnimation.KnownAnimationFunctions.Linear; + this.circularProgressBar1.AnimationFunction = WinFormAnimation_NET5.KnownAnimationFunctions.Linear; this.circularProgressBar1.AnimationSpeed = 500; this.circularProgressBar1.BackColor = System.Drawing.Color.Transparent; this.circularProgressBar1.FirstValueColour = System.Drawing.Color.Red; diff --git a/Source/Krypton Toolkit/Examples/CircularProgressBarExample.cs b/Source/Krypton Toolkit/Examples/CircularProgressBarExample.cs index b73a958d0..4c3ba6f3f 100644 --- a/Source/Krypton Toolkit/Examples/CircularProgressBarExample.cs +++ b/Source/Krypton Toolkit/Examples/CircularProgressBarExample.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { public partial class CircularProgressBarExample : KryptonForm { diff --git a/Source/Krypton Toolkit/Examples/Classes/DataGridViewSetup.cs b/Source/Krypton Toolkit/Examples/Classes/DataGridViewSetup.cs index b4d2ac7fa..dfdd08d1c 100644 --- a/Source/Krypton Toolkit/Examples/Classes/DataGridViewSetup.cs +++ b/Source/Krypton Toolkit/Examples/Classes/DataGridViewSetup.cs @@ -1,12 +1,31 @@ -using System.Collections; -using System.Xml.Linq; -using System.Xml.XPath; - -using Krypton.Toolkit.Suite.Extended.Outlook.Grid; -#pragma warning disable CS8600 -#pragma warning disable CS8602 -#pragma warning disable CS8604 - +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion namespace Examples { public class DataGridViewSetup @@ -24,6 +43,7 @@ public class DataGridViewSetup #region Implementaton + /* public void SetupDataGridView(KryptonOutlookGrid grid, bool restoreIfPossible) { if (File.Exists($"{Application.StartupPath}/grid.xml") & restoreIfPossible) @@ -350,24 +370,8 @@ private DataGridViewColumn SetupColumn(SandBoxGridColumn colType) default: throw new Exception("Unknown Column Type !! TODO improve that !"); } - } + }*/ #endregion } -} - -public class TypeConverter -{ - public static string ProcessType(string FullQualifiedName) - { - //Translate types here to accomodate code changes, namespaces and version - //Select Case FullQualifiedName - // Case "OutlookGridAlphabeticGroup, Krypton.Toolkit, Version=1.2.0.0, Culture=neutral, PublicKeyToken=e12f297423986ef5", - // "OutlookGridAlphabeticGroup, Krypton.Toolkit, Version=1.2.0.0, Culture=neutral, PublicKeyToken=null" - // 'Change with new version or namespace or both ! - // FullQualifiedName = "TestMe, Version=1.2.0.0, Culture=neutral, PublicKeyToken=null" - // Exit Select - //End Select - return FullQualifiedName; - } } \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/Classes/DataTableWrapper.cs b/Source/Krypton Toolkit/Examples/Classes/DataTableWrapper.cs new file mode 100644 index 000000000..b90ae0fc9 --- /dev/null +++ b/Source/Krypton Toolkit/Examples/Classes/DataTableWrapper.cs @@ -0,0 +1,39 @@ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +using System.Data; + +using Krypton.Toolkit.Suite.Extended.Controls; + +namespace Examples +{ + public class DataTableWrapper : ListSelectionWrapper + { + public DataTableWrapper(DataTable dataTable, string usePropertyAsDisplayName) : base(dataTable.Rows, false, usePropertyAsDisplayName) { } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/Classes/Enumerations.cs b/Source/Krypton Toolkit/Examples/Classes/Enumerations.cs deleted file mode 100644 index a439b20d7..000000000 --- a/Source/Krypton Toolkit/Examples/Classes/Enumerations.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace Examples -{ - public enum SandBoxGridColumn - { - ColumnCustomerID = 0, - ColumnCustomerName = 1, - ColumnAddress = 2, - ColumnCity = 3, - ColumnCountry = 4, - ColumnOrderDate = 5, - ColumnProduct = 6, - ColumnPrice = 7, - SatisfactionColumn = 8, - ColumnToken = 9 - } - - public enum LoadState - { - Before, - After - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/Classes/LoadState.cs b/Source/Krypton Toolkit/Examples/Classes/LoadState.cs new file mode 100644 index 000000000..24c299a4a --- /dev/null +++ b/Source/Krypton Toolkit/Examples/Classes/LoadState.cs @@ -0,0 +1,35 @@ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples; + +public enum LoadState +{ + Before, + After +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/Classes/OutlookGridPriceGroup.cs b/Source/Krypton Toolkit/Examples/Classes/OutlookGridPriceGroup.cs index 31ef54ad6..e18f26c97 100644 --- a/Source/Krypton Toolkit/Examples/Classes/OutlookGridPriceGroup.cs +++ b/Source/Krypton Toolkit/Examples/Classes/OutlookGridPriceGroup.cs @@ -1,6 +1,32 @@ -using System.Globalization; - -using Krypton.Toolkit.Suite.Extended.Outlook.Grid; +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +using System.Globalization; namespace Examples { @@ -9,9 +35,9 @@ public class OutlookGridPriceGroup : OutlookGridDefaultGroup private int _priceCode; private string _currency; - private object val; + private object? _val; - private const int noPrice = 999999; + private const int NO_PRICE = 999999; public OutlookGridPriceGroup() : base() { AllowHiddenWhenGrouped = false; @@ -31,10 +57,7 @@ public OutlookGridPriceGroup(IOutlookGridGroup? parentGroup) : base(parentGroup) /// /// Gets or sets the displayed text. /// - public override string Text - { - get { return string.Format("{0}: {1} ({2})", Column.DataGridViewColumn.HeaderText, GetPriceString(_priceCode), ItemCount == 1 ? OneItemText : ItemCount.ToString() + XxxItemsText); } - } + public override string Text => $"{Column.DataGridViewColumn.HeaderText}: {GetPriceString(_priceCode)} ({(ItemCount == 1 ? OneItemText : ItemCount.ToString() + XxxItemsText)})"; private int GetPriceCode(decimal price) { @@ -114,20 +137,20 @@ private string GetPriceString(int priceCode) /// /// Gets or sets the Alphabetic value /// - public override object Value + public override object? Value { - get { return val; } + get => _val; set { - if (object.ReferenceEquals(value, DBNull.Value) || value == null) + if (ReferenceEquals(value, DBNull.Value) || value == null) { - _priceCode = noPrice; - val = _priceCode; + _priceCode = NO_PRICE; + _val = _priceCode; } else { _priceCode = GetPriceCode(decimal.Parse(value.ToString())); - val = _priceCode; + _val = _priceCode; } } } @@ -143,7 +166,7 @@ public override object Clone() OutlookGridPriceGroup gr = new OutlookGridPriceGroup(this.ParentGroup); gr.Column = this.Column; - gr.Value = this.val; + gr.Value = this._val; gr.Collapsed = this.Collapsed; gr.Height = this.Height; gr.GroupImage = this.GroupImage; @@ -167,10 +190,10 @@ public override object Clone() /// /// /// - public override int CompareTo(object obj) + public override int CompareTo(object? obj) { int orderModifier = (Column.SortDirection == SortOrder.Ascending ? 1 : -1); - int priceOther = 0; + int priceOther; if (obj is OutlookGridPriceGroup) { @@ -178,7 +201,7 @@ public override int CompareTo(object obj) } else { - priceOther = noPrice; + priceOther = NO_PRICE; } return _priceCode.CompareTo(priceOther) * orderModifier; } diff --git a/Source/Krypton Toolkit/Examples/Classes/SandBoxGridColumn.cs b/Source/Krypton Toolkit/Examples/Classes/SandBoxGridColumn.cs new file mode 100644 index 000000000..57bb9826d --- /dev/null +++ b/Source/Krypton Toolkit/Examples/Classes/SandBoxGridColumn.cs @@ -0,0 +1,44 @@ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples +{ + public enum SandBoxGridColumn + { + ColumnCustomerID = 0, + ColumnCustomerName = 1, + ColumnAddress = 2, + ColumnCity = 3, + ColumnCountry = 4, + ColumnOrderDate = 5, + ColumnProduct = 6, + ColumnPrice = 7, + SatisfactionColumn = 8, + ColumnToken = 9 + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/Classes/StaticInfos.cs b/Source/Krypton Toolkit/Examples/Classes/StaticInfos.cs index aa01cd928..037a2cdc1 100644 --- a/Source/Krypton Toolkit/Examples/Classes/StaticInfos.cs +++ b/Source/Krypton Toolkit/Examples/Classes/StaticInfos.cs @@ -1,4 +1,32 @@ -namespace Examples; +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples; public static class StaticInfos { diff --git a/Source/Krypton Toolkit/Examples/Classes/Status.cs b/Source/Krypton Toolkit/Examples/Classes/Status.cs new file mode 100644 index 000000000..43b87788c --- /dev/null +++ b/Source/Krypton Toolkit/Examples/Classes/Status.cs @@ -0,0 +1,62 @@ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples +{ + /// + /// Class used for demo purposes. This could be anything listed in a CheckBoxComboBox. + /// + public class Status + { + public Status(int id, string name) + { + _id = id; + _name = name; + } + + private int _id; + private string _name; + + public int Id + { + get => _id; + set => _id = value; + } + public string Name + { + get => _name; + set => _name = value; + } + + /// + /// Now used to return the Name. + /// + /// + public override string ToString() => Name; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/Classes/StatusList.cs b/Source/Krypton Toolkit/Examples/Classes/StatusList.cs new file mode 100644 index 000000000..f0afd8e8f --- /dev/null +++ b/Source/Krypton Toolkit/Examples/Classes/StatusList.cs @@ -0,0 +1,37 @@ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples; + +/// +/// Class used for demo purposes. A list of "Status". +/// This represents the custom "IList" datasource of anything listed in a CheckBoxComboBox. +/// +public class StatusList : List +{ +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/Classes/TypeConverter.cs b/Source/Krypton Toolkit/Examples/Classes/TypeConverter.cs new file mode 100644 index 000000000..0035c37fd --- /dev/null +++ b/Source/Krypton Toolkit/Examples/Classes/TypeConverter.cs @@ -0,0 +1,43 @@ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +public class TypeConverter +{ + public static string ProcessType(string fullQualifiedName) + { + //Translate types here to accomodate code changes, namespaces and version + //Select Case FullQualifiedName + // Case "OutlookGridAlphabeticGroup, Krypton.Toolkit, Version=1.2.0.0, Culture=neutral, PublicKeyToken=e12f297423986ef5", + // "OutlookGridAlphabeticGroup, Krypton.Toolkit, Version=1.2.0.0, Culture=neutral, PublicKeyToken=null" + // 'Change with new version or namespace or both ! + // FullQualifiedName = "TestMe, Version=1.2.0.0, Culture=neutral, PublicKeyToken=null" + // Exit Select + //End Select + return fullQualifiedName; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/CoreColourDialogExamples.Designer.cs b/Source/Krypton Toolkit/Examples/CoreColourDialogExamples.Designer.cs index df0408e10..29920d5ca 100644 --- a/Source/Krypton Toolkit/Examples/CoreColourDialogExamples.Designer.cs +++ b/Source/Krypton Toolkit/Examples/CoreColourDialogExamples.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class CoreColourDialogExamples { @@ -61,7 +89,6 @@ private void InitializeComponent() // // kryptonButton1 // - this.kryptonButton1.CornerRoundingRadius = -1F; this.kryptonButton1.Location = new System.Drawing.Point(13, 13); this.kryptonButton1.Name = "kryptonButton1"; this.kryptonButton1.Size = new System.Drawing.Size(250, 25); @@ -70,7 +97,6 @@ private void InitializeComponent() // // kryptonButton2 // - this.kryptonButton2.CornerRoundingRadius = -1F; this.kryptonButton2.Location = new System.Drawing.Point(13, 44); this.kryptonButton2.Name = "kryptonButton2"; this.kryptonButton2.Size = new System.Drawing.Size(250, 25); @@ -79,7 +105,6 @@ private void InitializeComponent() // // kryptonButton3 // - this.kryptonButton3.CornerRoundingRadius = -1F; this.kryptonButton3.Location = new System.Drawing.Point(13, 75); this.kryptonButton3.Name = "kryptonButton3"; this.kryptonButton3.Size = new System.Drawing.Size(250, 25); @@ -88,7 +113,6 @@ private void InitializeComponent() // // kryptonButton4 // - this.kryptonButton4.CornerRoundingRadius = -1F; this.kryptonButton4.Location = new System.Drawing.Point(13, 106); this.kryptonButton4.Name = "kryptonButton4"; this.kryptonButton4.Size = new System.Drawing.Size(250, 25); @@ -97,7 +121,6 @@ private void InitializeComponent() // // kryptonButton5 // - this.kryptonButton5.CornerRoundingRadius = -1F; this.kryptonButton5.Location = new System.Drawing.Point(13, 137); this.kryptonButton5.Name = "kryptonButton5"; this.kryptonButton5.Size = new System.Drawing.Size(250, 25); @@ -106,7 +129,6 @@ private void InitializeComponent() // // kryptonButton6 // - this.kryptonButton6.CornerRoundingRadius = -1F; this.kryptonButton6.Location = new System.Drawing.Point(13, 168); this.kryptonButton6.Name = "kryptonButton6"; this.kryptonButton6.Size = new System.Drawing.Size(250, 25); @@ -115,7 +137,6 @@ private void InitializeComponent() // // kryptonButton7 // - this.kryptonButton7.CornerRoundingRadius = -1F; this.kryptonButton7.Location = new System.Drawing.Point(13, 199); this.kryptonButton7.Name = "kryptonButton7"; this.kryptonButton7.Size = new System.Drawing.Size(250, 25); @@ -124,7 +145,6 @@ private void InitializeComponent() // // kryptonButton8 // - this.kryptonButton8.CornerRoundingRadius = -1F; this.kryptonButton8.Location = new System.Drawing.Point(13, 230); this.kryptonButton8.Name = "kryptonButton8"; this.kryptonButton8.Size = new System.Drawing.Size(250, 25); @@ -133,7 +153,6 @@ private void InitializeComponent() // // kryptonButton9 // - this.kryptonButton9.CornerRoundingRadius = -1F; this.kryptonButton9.Location = new System.Drawing.Point(13, 261); this.kryptonButton9.Name = "kryptonButton9"; this.kryptonButton9.Size = new System.Drawing.Size(250, 25); diff --git a/Source/Krypton Toolkit/Examples/CoreColourDialogExamples.cs b/Source/Krypton Toolkit/Examples/CoreColourDialogExamples.cs index f064f671d..46fc7fcfd 100644 --- a/Source/Krypton Toolkit/Examples/CoreColourDialogExamples.cs +++ b/Source/Krypton Toolkit/Examples/CoreColourDialogExamples.cs @@ -1,13 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion namespace Examples { public partial class CoreColourDialogExamples : KryptonForm diff --git a/Source/Krypton Toolkit/Examples/CoreDialogExamples.Designer.cs b/Source/Krypton Toolkit/Examples/CoreDialogExamples.Designer.cs index 72b318266..b5bf9d870 100644 --- a/Source/Krypton Toolkit/Examples/CoreDialogExamples.Designer.cs +++ b/Source/Krypton Toolkit/Examples/CoreDialogExamples.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class CoreDialogExamples { @@ -45,7 +73,6 @@ private void InitializeComponent() // // kbtnColourDialogExamples // - this.kbtnColourDialogExamples.CornerRoundingRadius = -1F; this.kbtnColourDialogExamples.Location = new System.Drawing.Point(12, 12); this.kbtnColourDialogExamples.Name = "kbtnColourDialogExamples"; this.kbtnColourDialogExamples.Size = new System.Drawing.Size(154, 25); diff --git a/Source/Krypton Toolkit/Examples/CoreDialogExamples.cs b/Source/Krypton Toolkit/Examples/CoreDialogExamples.cs index 56c8edcb4..eae99b31b 100644 --- a/Source/Krypton Toolkit/Examples/CoreDialogExamples.cs +++ b/Source/Krypton Toolkit/Examples/CoreDialogExamples.cs @@ -1,13 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion namespace Examples { public partial class CoreDialogExamples : KryptonForm diff --git a/Source/Krypton Toolkit/Examples/DialogExamples.Designer.cs b/Source/Krypton Toolkit/Examples/DialogExamples.Designer.cs index a069126a3..a789d2ec3 100644 --- a/Source/Krypton Toolkit/Examples/DialogExamples.Designer.cs +++ b/Source/Krypton Toolkit/Examples/DialogExamples.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class DialogExamples { @@ -35,7 +63,6 @@ private void InitializeComponent() this.kbtnRun = new Krypton.Toolkit.KryptonButton(); this.kbtnCheckSum = new Krypton.Toolkit.KryptonButton(); this.kbtnException = new Krypton.Toolkit.KryptonButton(); - this.kbtnAbout = new Krypton.Toolkit.KryptonButton(); ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); this.kryptonPanel1.SuspendLayout(); this.SuspendLayout(); @@ -47,7 +74,6 @@ private void InitializeComponent() this.kryptonPanel1.Controls.Add(this.kbtnRun); this.kryptonPanel1.Controls.Add(this.kbtnCheckSum); this.kryptonPanel1.Controls.Add(this.kbtnException); - this.kryptonPanel1.Controls.Add(this.kbtnAbout); this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.kryptonPanel1.Location = new System.Drawing.Point(0, 0); this.kryptonPanel1.Name = "kryptonPanel1"; @@ -56,8 +82,7 @@ private void InitializeComponent() // // kbtnTextToSpeech // - this.kbtnTextToSpeech.CornerRoundingRadius = -1F; - this.kbtnTextToSpeech.Location = new System.Drawing.Point(240, 38); + this.kbtnTextToSpeech.Location = new System.Drawing.Point(125, 38); this.kbtnTextToSpeech.Name = "kbtnTextToSpeech"; this.kbtnTextToSpeech.Size = new System.Drawing.Size(109, 22); this.kbtnTextToSpeech.TabIndex = 8; @@ -66,8 +91,7 @@ private void InitializeComponent() // // kbtnSplash // - this.kbtnSplash.CornerRoundingRadius = -1F; - this.kbtnSplash.Location = new System.Drawing.Point(125, 38); + this.kbtnSplash.Location = new System.Drawing.Point(10, 38); this.kbtnSplash.Name = "kbtnSplash"; this.kbtnSplash.Size = new System.Drawing.Size(109, 22); this.kbtnSplash.TabIndex = 7; @@ -76,8 +100,7 @@ private void InitializeComponent() // // kbtnRun // - this.kbtnRun.CornerRoundingRadius = -1F; - this.kbtnRun.Location = new System.Drawing.Point(10, 38); + this.kbtnRun.Location = new System.Drawing.Point(240, 10); this.kbtnRun.Name = "kbtnRun"; this.kbtnRun.Size = new System.Drawing.Size(109, 22); this.kbtnRun.TabIndex = 6; @@ -86,8 +109,7 @@ private void InitializeComponent() // // kbtnCheckSum // - this.kbtnCheckSum.CornerRoundingRadius = -1F; - this.kbtnCheckSum.Location = new System.Drawing.Point(240, 10); + this.kbtnCheckSum.Location = new System.Drawing.Point(125, 10); this.kbtnCheckSum.Name = "kbtnCheckSum"; this.kbtnCheckSum.Size = new System.Drawing.Size(109, 22); this.kbtnCheckSum.TabIndex = 4; @@ -96,24 +118,13 @@ private void InitializeComponent() // // kbtnException // - this.kbtnException.CornerRoundingRadius = -1F; - this.kbtnException.Location = new System.Drawing.Point(125, 10); + this.kbtnException.Location = new System.Drawing.Point(10, 10); this.kbtnException.Name = "kbtnException"; this.kbtnException.Size = new System.Drawing.Size(109, 22); this.kbtnException.TabIndex = 3; this.kbtnException.Values.Text = "Exception"; this.kbtnException.Click += new System.EventHandler(this.kbtnException_Click); // - // kbtnAbout - // - this.kbtnAbout.CornerRoundingRadius = -1F; - this.kbtnAbout.Location = new System.Drawing.Point(10, 10); - this.kbtnAbout.Name = "kbtnAbout"; - this.kbtnAbout.Size = new System.Drawing.Size(109, 22); - this.kbtnAbout.TabIndex = 0; - this.kbtnAbout.Values.Text = "About"; - this.kbtnAbout.Click += new System.EventHandler(this.kbtnAbout_Click); - // // DialogExamples // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -141,6 +152,5 @@ private void InitializeComponent() private KryptonButton kbtnRun; private KryptonButton kbtnCheckSum; private KryptonButton kbtnException; - private KryptonButton kbtnAbout; } } \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/DialogExamples.cs b/Source/Krypton Toolkit/Examples/DialogExamples.cs index 147fb2c48..0f05e850e 100644 --- a/Source/Krypton Toolkit/Examples/DialogExamples.cs +++ b/Source/Krypton Toolkit/Examples/DialogExamples.cs @@ -1,19 +1,34 @@ -using System; -using System.CodeDom; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -using Krypton.Toolkit.Suite.Extended.Dialogs; - +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion using Examples.Properties; +using Krypton.Toolkit.Suite.Extended.Dialogs; using Krypton.Toolkit.Suite.Extended.Specialised.Dialogs; namespace Examples @@ -25,15 +40,6 @@ public DialogExamples() InitializeComponent(); } - private void kbtnAbout_Click(object sender, EventArgs e) - { - Assembly asm = Assembly.GetExecutingAssembly(); - - KryptonAboutDialog aboutDialog = new KryptonAboutDialog(Resources.Stable, asm); - - aboutDialog.ShowDialog(); - } - private void kbtnException_Click(object sender, EventArgs e) { //KryptonExceptionCaptureDialog exceptionCaptureDialog = new KryptonExceptionCaptureDialog(); diff --git a/Source/Krypton Toolkit/Examples/DockExtenderExample.Designer.cs b/Source/Krypton Toolkit/Examples/DockExtenderExample.Designer.cs index dad1d23ba..cf8b1d256 100644 --- a/Source/Krypton Toolkit/Examples/DockExtenderExample.Designer.cs +++ b/Source/Krypton Toolkit/Examples/DockExtenderExample.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class DockExtenderExample { @@ -219,14 +247,9 @@ private void InitializeComponent() this.kryptonListView1.Dock = System.Windows.Forms.DockStyle.Fill; this.kryptonListView1.FullRowSelect = true; this.kryptonListView1.HideSelection = false; - this.kryptonListView1.ItemStyle = Krypton.Toolkit.ButtonStyle.ListItem; this.kryptonListView1.Location = new System.Drawing.Point(252, 49); this.kryptonListView1.Name = "kryptonListView1"; - this.kryptonListView1.OwnerDraw = true; this.kryptonListView1.Size = new System.Drawing.Size(624, 232); - this.kryptonListView1.StateCommon.Item.Content.ShortText.MultiLine = Krypton.Toolkit.InheritBool.True; - this.kryptonListView1.StateCommon.Item.Content.ShortText.MultiLineH = Krypton.Toolkit.PaletteRelativeAlign.Center; - this.kryptonListView1.StateCommon.Item.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.kryptonListView1.TabIndex = 7; this.kryptonListView1.View = System.Windows.Forms.View.SmallIcon; // @@ -249,7 +272,6 @@ private void InitializeComponent() // // kbtnLeftClose // - this.kbtnLeftClose.CornerRoundingRadius = -1F; this.kbtnLeftClose.Dock = System.Windows.Forms.DockStyle.Fill; this.kbtnLeftClose.Location = new System.Drawing.Point(230, 3); this.kbtnLeftClose.Name = "kbtnLeftClose"; @@ -288,7 +310,6 @@ private void InitializeComponent() // // kbtnBottomClose // - this.kbtnBottomClose.CornerRoundingRadius = -1F; this.kbtnBottomClose.Dock = System.Windows.Forms.DockStyle.Fill; this.kbtnBottomClose.Location = new System.Drawing.Point(607, 3); this.kbtnBottomClose.Name = "kbtnBottomClose"; diff --git a/Source/Krypton Toolkit/Examples/DockExtenderExample.cs b/Source/Krypton Toolkit/Examples/DockExtenderExample.cs index 1675696e7..9ec7e4c7d 100644 --- a/Source/Krypton Toolkit/Examples/DockExtenderExample.cs +++ b/Source/Krypton Toolkit/Examples/DockExtenderExample.cs @@ -1,13 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion using Krypton.Toolkit.Suite.Extended.Dock.Extender; namespace Examples diff --git a/Source/Krypton Toolkit/Examples/Examples.csproj b/Source/Krypton Toolkit/Examples/Examples.csproj index b1c6b8955..7670b83c3 100644 --- a/Source/Krypton Toolkit/Examples/Examples.csproj +++ b/Source/Krypton Toolkit/Examples/Examples.csproj @@ -2,11 +2,12 @@ WinExe - net48;net6.0-windows + net48;net8.0-windows enable true enable ..\..\..\Bin\Examples\ + preview @@ -17,11 +18,6 @@ - - - Always - - Always @@ -50,9 +46,22 @@ + + + + + + + + + + + + + + + - - @@ -91,17 +100,17 @@ - - + - + + diff --git a/Source/Krypton Toolkit/Examples/Examples.licenseheader b/Source/Krypton Toolkit/Examples/Examples.licenseheader new file mode 100644 index 000000000..19d849e41 --- /dev/null +++ b/Source/Krypton Toolkit/Examples/Examples.licenseheader @@ -0,0 +1,29 @@ +extensions: .cs +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/ExtendedControlExamples.Designer.cs b/Source/Krypton Toolkit/Examples/ExtendedControlExamples.Designer.cs index 73c7fce07..01b5e357f 100644 --- a/Source/Krypton Toolkit/Examples/ExtendedControlExamples.Designer.cs +++ b/Source/Krypton Toolkit/Examples/ExtendedControlExamples.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class ExtendedControlExamples { @@ -29,19 +57,20 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.components = new System.ComponentModel.Container(); + System.Security.SecureString secureString3 = new System.Security.SecureString(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExtendedControlExamples)); - System.Security.SecureString secureString1 = new System.Security.SecureString(); this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); + this.kryptonValidationBox1 = new Krypton.Toolkit.Suite.Extended.Controls.KryptonValidationBox(); + this.kryptonStarRatingControl1 = new Krypton.Toolkit.Suite.Extended.Controls.KryptonStarRatingControl(); + this.kryptonSecureTextBox1 = new Krypton.Toolkit.Suite.Extended.Controls.KryptonSecureTextBox(); + this.kryptonProgressBarExtended1 = new Krypton.Toolkit.Suite.Extended.Controls.KryptonProgressBarExtended(); + this.kryptonProgressBarExtendedVersion11 = new Krypton.Toolkit.Suite.Extended.Controls.KryptonProgressBarExtendedVersion1(); + this.kryptonMarqueeLabel1 = new Krypton.Toolkit.Suite.Extended.Controls.KryptonMarqueeLabel(); + this.kkcv2Test = new Krypton.Toolkit.Suite.Extended.Controls.KryptonKnobControlVersion2(); + this.kkcv1Test = new Krypton.Toolkit.Suite.Extended.Controls.KryptonKnobControlVersion1(); this.kryptonBorderedLabel1 = new Krypton.Toolkit.Suite.Extended.Controls.KryptonBorderedLabel(); this.circularPictureBox1 = new Krypton.Toolkit.Suite.Extended.Controls.CircularPictureBox(); - this.kkcv1Test = new Krypton.Toolkit.Suite.Extended.Controls.KryptonKnobControlVersion1(); - this.kkcv2Test = new Krypton.Toolkit.Suite.Extended.Controls.KryptonKnobControlVersion2(); - this.kryptonMarqueeLabel1 = new Krypton.Toolkit.Suite.Extended.Controls.KryptonMarqueeLabel(); - this.kryptonProgressBarExtendedVersion11 = new Krypton.Toolkit.Suite.Extended.Controls.KryptonProgressBarExtendedVersion1(); - this.kryptonProgressBarExtended1 = new Krypton.Toolkit.Suite.Extended.Controls.KryptonProgressBarExtended(); - this.kryptonSecureTextBox1 = new Krypton.Toolkit.Suite.Extended.Controls.KryptonSecureTextBox(); - this.kryptonStarRatingControl1 = new Krypton.Toolkit.Suite.Extended.Controls.KryptonStarRatingControl(); - this.kryptonValidationBox1 = new Krypton.Toolkit.Suite.Extended.Controls.KryptonValidationBox(); + this.kryptonPasswordTextBox1 = new Krypton.Toolkit.Suite.Extended.Controls.KryptonPasswordTextBox(); ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); this.kryptonPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.circularPictureBox1)).BeginInit(); @@ -49,6 +78,7 @@ private void InitializeComponent() // // kryptonPanel1 // + this.kryptonPanel1.Controls.Add(this.kryptonPasswordTextBox1); this.kryptonPanel1.Controls.Add(this.kryptonValidationBox1); this.kryptonPanel1.Controls.Add(this.kryptonStarRatingControl1); this.kryptonPanel1.Controls.Add(this.kryptonSecureTextBox1); @@ -65,48 +95,71 @@ private void InitializeComponent() this.kryptonPanel1.Size = new System.Drawing.Size(1123, 684); this.kryptonPanel1.TabIndex = 0; // - // kryptonBorderedLabel1 + // kryptonValidationBox1 // - this.kryptonBorderedLabel1.BackColor = System.Drawing.Color.Transparent; - this.kryptonBorderedLabel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(177)))), ((int)(((byte)(192)))), ((int)(((byte)(214))))); - this.kryptonBorderedLabel1.LabelStyle = Krypton.Toolkit.LabelStyle.NormalPanel; - this.kryptonBorderedLabel1.Location = new System.Drawing.Point(275, 13); - this.kryptonBorderedLabel1.Name = "kryptonBorderedLabel1"; - this.kryptonBorderedLabel1.Size = new System.Drawing.Size(139, 20); - this.kryptonBorderedLabel1.TabIndex = 1; - this.kryptonBorderedLabel1.Values.Text = "kryptonBorderedLabel1"; + this.kryptonValidationBox1.IntermediateColour = System.Drawing.Color.Empty; + this.kryptonValidationBox1.Location = new System.Drawing.Point(601, 112); + this.kryptonValidationBox1.ModifyBackgroundColour = false; + this.kryptonValidationBox1.Name = "kryptonValidationBox1"; + this.kryptonValidationBox1.Size = new System.Drawing.Size(264, 23); + this.kryptonValidationBox1.TabIndex = 9; + this.kryptonValidationBox1.Text = "kryptonValidationBox1"; + this.kryptonValidationBox1.UseAccessibilityColours = false; + this.kryptonValidationBox1.UseIntermediateColour = false; + this.kryptonValidationBox1.ValidateEntry = false; // - // circularPictureBox1 + // kryptonStarRatingControl1 // - this.circularPictureBox1.BackColor = System.Drawing.Color.Transparent; - this.circularPictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("circularPictureBox1.Image"))); - this.circularPictureBox1.Location = new System.Drawing.Point(13, 13); - this.circularPictureBox1.Name = "circularPictureBox1"; - this.circularPictureBox1.Size = new System.Drawing.Size(256, 256); - this.circularPictureBox1.TabIndex = 0; - this.circularPictureBox1.TabStop = false; + this.kryptonStarRatingControl1.CurrentStarValue = 0; + this.kryptonStarRatingControl1.FirstColour = System.Drawing.Color.Red; + this.kryptonStarRatingControl1.FirstColourQuantity = 2; + this.kryptonStarRatingControl1.Location = new System.Drawing.Point(420, 211); + this.kryptonStarRatingControl1.Name = "kryptonStarRatingControl1"; + this.kryptonStarRatingControl1.SecondColour = System.Drawing.Color.Blue; + this.kryptonStarRatingControl1.SecondColourQuantity = 1; + this.kryptonStarRatingControl1.Size = new System.Drawing.Size(75, 15); + this.kryptonStarRatingControl1.StarCount = 5; + this.kryptonStarRatingControl1.StartSize = 15; + this.kryptonStarRatingControl1.TabIndex = 8; + this.kryptonStarRatingControl1.ThirdColour = System.Drawing.Color.Green; + this.kryptonStarRatingControl1.ThirdColourQuantity = 2; // - // kkcv1Test + // kryptonSecureTextBox1 // - this.kkcv1Test.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); - this.kkcv1Test.ImeMode = System.Windows.Forms.ImeMode.On; - this.kkcv1Test.KnobIndicatorBorderColour = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(232)))), ((int)(((byte)(246))))); - this.kkcv1Test.KnobIndicatorColourBegin = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(206)))), ((int)(((byte)(230))))); - this.kkcv1Test.KnobIndicatorColourEnd = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(206)))), ((int)(((byte)(230))))); - this.kkcv1Test.LargeChange = 20; - this.kkcv1Test.Location = new System.Drawing.Point(276, 40); - this.kkcv1Test.Maximum = 100; - this.kkcv1Test.Minimum = 0; - this.kkcv1Test.Name = "kkcv1Test"; - this.kkcv1Test.ShowLargeScale = true; - this.kkcv1Test.ShowSmallScale = true; - this.kkcv1Test.Size = new System.Drawing.Size(91, 91); - this.kkcv1Test.SizeLargeScaleMarker = 6; - this.kkcv1Test.SizeSmallScaleMarker = 3; - this.kkcv1Test.SmallChange = 5; - this.kkcv1Test.TabIndex = 2; - this.kkcv1Test.Value = 0; - this.kkcv1Test.ValueChanged += new Krypton.Toolkit.Suite.Extended.Controls.ValueChangedEventHandler(this.kkcv1Test_ValueChanged); + this.kryptonSecureTextBox1.Location = new System.Drawing.Point(601, 82); + this.kryptonSecureTextBox1.Name = "kryptonSecureTextBox1"; + this.kryptonSecureTextBox1.PasswordChar = '●'; + this.kryptonSecureTextBox1.SecuredText = secureString3; + this.kryptonSecureTextBox1.Size = new System.Drawing.Size(264, 23); + this.kryptonSecureTextBox1.TabIndex = 7; + this.kryptonSecureTextBox1.Text = "kryptonSecureTextBox1"; + this.kryptonSecureTextBox1.UseSystemPasswordChar = true; + // + // kryptonProgressBarExtended1 + // + this.kryptonProgressBarExtended1.Location = new System.Drawing.Point(601, 52); + this.kryptonProgressBarExtended1.Name = "kryptonProgressBarExtended1"; + this.kryptonProgressBarExtended1.Size = new System.Drawing.Size(264, 23); + this.kryptonProgressBarExtended1.TabIndex = 6; + this.kryptonProgressBarExtended1.Text = "0%"; + // + // kryptonProgressBarExtendedVersion11 + // + this.kryptonProgressBarExtendedVersion11.BackColor = System.Drawing.Color.Transparent; + this.kryptonProgressBarExtendedVersion11.Location = new System.Drawing.Point(601, 13); + this.kryptonProgressBarExtendedVersion11.Name = "kryptonProgressBarExtendedVersion11"; + this.kryptonProgressBarExtendedVersion11.Size = new System.Drawing.Size(264, 32); + this.kryptonProgressBarExtendedVersion11.TabIndex = 5; + // + // kryptonMarqueeLabel1 + // + this.kryptonMarqueeLabel1.Location = new System.Drawing.Point(276, 211); + this.kryptonMarqueeLabel1.Name = "kryptonMarqueeLabel1"; + this.kryptonMarqueeLabel1.Size = new System.Drawing.Size(137, 20); + this.kryptonMarqueeLabel1.Speed = 1; + this.kryptonMarqueeLabel1.TabIndex = 4; + this.kryptonMarqueeLabel1.Values.Text = "kryptonMarqueeLabel1"; + this.kryptonMarqueeLabel1.YOffset = 0; // // kkcv2Test // @@ -134,72 +187,54 @@ private void InitializeComponent() this.kkcv2Test.Value = 0; this.kkcv2Test.ValueChanged += new Krypton.Toolkit.Suite.Extended.Controls.ValueChangedEventHandler(this.kkcv2Test_ValueChanged); // - // kryptonMarqueeLabel1 - // - this.kryptonMarqueeLabel1.LabelStyle = Krypton.Toolkit.LabelStyle.NormalPanel; - this.kryptonMarqueeLabel1.Location = new System.Drawing.Point(276, 211); - this.kryptonMarqueeLabel1.Name = "kryptonMarqueeLabel1"; - this.kryptonMarqueeLabel1.Size = new System.Drawing.Size(137, 20); - this.kryptonMarqueeLabel1.Speed = 1; - this.kryptonMarqueeLabel1.TabIndex = 4; - this.kryptonMarqueeLabel1.Values.Text = "kryptonMarqueeLabel1"; - this.kryptonMarqueeLabel1.YOffset = 0; - // - // kryptonProgressBarExtendedVersion11 - // - this.kryptonProgressBarExtendedVersion11.BackColor = System.Drawing.Color.Transparent; - this.kryptonProgressBarExtendedVersion11.Location = new System.Drawing.Point(601, 13); - this.kryptonProgressBarExtendedVersion11.Name = "kryptonProgressBarExtendedVersion11"; - this.kryptonProgressBarExtendedVersion11.Size = new System.Drawing.Size(264, 32); - this.kryptonProgressBarExtendedVersion11.TabIndex = 5; - // - // kryptonProgressBarExtendedVersion21 + // kkcv1Test // - this.kryptonProgressBarExtended1.Location = new System.Drawing.Point(601, 52); - this.kryptonProgressBarExtended1.Name = "kryptonProgressBarExtended1"; - this.kryptonProgressBarExtended1.Size = new System.Drawing.Size(264, 23); - this.kryptonProgressBarExtended1.TabIndex = 6; - this.kryptonProgressBarExtended1.Text = "0%"; + this.kkcv1Test.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kkcv1Test.ImeMode = System.Windows.Forms.ImeMode.On; + this.kkcv1Test.KnobIndicatorBorderColour = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(232)))), ((int)(((byte)(246))))); + this.kkcv1Test.KnobIndicatorColourBegin = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(206)))), ((int)(((byte)(230))))); + this.kkcv1Test.KnobIndicatorColourEnd = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(206)))), ((int)(((byte)(230))))); + this.kkcv1Test.LargeChange = 20; + this.kkcv1Test.Location = new System.Drawing.Point(276, 40); + this.kkcv1Test.Maximum = 100; + this.kkcv1Test.Minimum = 0; + this.kkcv1Test.Name = "kkcv1Test"; + this.kkcv1Test.ShowLargeScale = true; + this.kkcv1Test.ShowSmallScale = true; + this.kkcv1Test.Size = new System.Drawing.Size(91, 91); + this.kkcv1Test.SizeLargeScaleMarker = 6; + this.kkcv1Test.SizeSmallScaleMarker = 3; + this.kkcv1Test.SmallChange = 5; + this.kkcv1Test.TabIndex = 2; + this.kkcv1Test.Value = 0; + this.kkcv1Test.ValueChanged += new Krypton.Toolkit.Suite.Extended.Controls.ValueChangedEventHandler(this.kkcv1Test_ValueChanged); // - // kryptonSecureTextBox1 + // kryptonBorderedLabel1 // - this.kryptonSecureTextBox1.Location = new System.Drawing.Point(601, 82); - this.kryptonSecureTextBox1.Name = "kryptonSecureTextBox1"; - this.kryptonSecureTextBox1.PasswordChar = '●'; - this.kryptonSecureTextBox1.SecuredText = secureString1; - this.kryptonSecureTextBox1.Size = new System.Drawing.Size(264, 23); - this.kryptonSecureTextBox1.TabIndex = 7; - this.kryptonSecureTextBox1.Text = "kryptonSecureTextBox1"; - this.kryptonSecureTextBox1.UseSystemPasswordChar = true; + this.kryptonBorderedLabel1.BackColor = System.Drawing.Color.Transparent; + this.kryptonBorderedLabel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(177)))), ((int)(((byte)(192)))), ((int)(((byte)(214))))); + this.kryptonBorderedLabel1.Location = new System.Drawing.Point(275, 13); + this.kryptonBorderedLabel1.Name = "kryptonBorderedLabel1"; + this.kryptonBorderedLabel1.Size = new System.Drawing.Size(139, 20); + this.kryptonBorderedLabel1.TabIndex = 1; + this.kryptonBorderedLabel1.Values.Text = "kryptonBorderedLabel1"; // - // kryptonStarRatingControl1 + // circularPictureBox1 // - this.kryptonStarRatingControl1.CurrentStarValue = 0; - this.kryptonStarRatingControl1.FirstColour = System.Drawing.Color.Red; - this.kryptonStarRatingControl1.FirstColourQuantity = 2; - this.kryptonStarRatingControl1.Location = new System.Drawing.Point(420, 211); - this.kryptonStarRatingControl1.Name = "kryptonStarRatingControl1"; - this.kryptonStarRatingControl1.SecondColour = System.Drawing.Color.Blue; - this.kryptonStarRatingControl1.SecondColourQuantity = 1; - this.kryptonStarRatingControl1.Size = new System.Drawing.Size(75, 15); - this.kryptonStarRatingControl1.StarCount = 5; - this.kryptonStarRatingControl1.StartSize = 15; - this.kryptonStarRatingControl1.TabIndex = 8; - this.kryptonStarRatingControl1.ThirdColour = System.Drawing.Color.Green; - this.kryptonStarRatingControl1.ThirdColourQuantity = 2; + this.circularPictureBox1.BackColor = System.Drawing.Color.Transparent; + this.circularPictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("circularPictureBox1.Image"))); + this.circularPictureBox1.Location = new System.Drawing.Point(13, 13); + this.circularPictureBox1.Name = "circularPictureBox1"; + this.circularPictureBox1.Size = new System.Drawing.Size(256, 256); + this.circularPictureBox1.TabIndex = 0; + this.circularPictureBox1.TabStop = false; // - // kryptonValidationBox1 + // kryptonPasswordTextBox1 // - this.kryptonValidationBox1.IntermediateColour = System.Drawing.Color.Empty; - this.kryptonValidationBox1.Location = new System.Drawing.Point(601, 112); - this.kryptonValidationBox1.ModifyBackgroundColour = false; - this.kryptonValidationBox1.Name = "kryptonValidationBox1"; - this.kryptonValidationBox1.Size = new System.Drawing.Size(264, 23); - this.kryptonValidationBox1.TabIndex = 9; - this.kryptonValidationBox1.Text = "kryptonValidationBox1"; - this.kryptonValidationBox1.UseAccessibilityColours = false; - this.kryptonValidationBox1.UseIntermediateColour = false; - this.kryptonValidationBox1.ValidateEntry = false; + this.kryptonPasswordTextBox1.Location = new System.Drawing.Point(601, 142); + this.kryptonPasswordTextBox1.Name = "kryptonPasswordTextBox1"; + this.kryptonPasswordTextBox1.Size = new System.Drawing.Size(264, 23); + this.kryptonPasswordTextBox1.TabIndex = 10; // // ExtendedControlExamples // @@ -230,5 +265,6 @@ private void InitializeComponent() private Krypton.Toolkit.Suite.Extended.Controls.KryptonSecureTextBox kryptonSecureTextBox1; private Krypton.Toolkit.Suite.Extended.Controls.KryptonStarRatingControl kryptonStarRatingControl1; private Krypton.Toolkit.Suite.Extended.Controls.KryptonValidationBox kryptonValidationBox1; + private Krypton.Toolkit.Suite.Extended.Controls.KryptonPasswordTextBox kryptonPasswordTextBox1; } } \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/ExtendedControlExamples.cs b/Source/Krypton Toolkit/Examples/ExtendedControlExamples.cs index d46a19dd5..bb8613ca3 100644 --- a/Source/Krypton Toolkit/Examples/ExtendedControlExamples.cs +++ b/Source/Krypton Toolkit/Examples/ExtendedControlExamples.cs @@ -1,13 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion namespace Examples { public partial class ExtendedControlExamples : KryptonForm diff --git a/Source/Krypton Toolkit/Examples/ExtendedControlExamples.resx b/Source/Krypton Toolkit/Examples/ExtendedControlExamples.resx index e20eb9893..2a7456649 100644 --- a/Source/Krypton Toolkit/Examples/ExtendedControlExamples.resx +++ b/Source/Krypton Toolkit/Examples/ExtendedControlExamples.resx @@ -165,7 +165,7 @@ XTesb3QPLh88M+QwdP6m681Lt7xuXbu94vbgcOjwnZHokdE77DtTd1PuvriXeW/h/sYH6AdFD6UeVjxS fNTws+7PbaOWo6fHXMf6Hwc/vj/OGn/2S8Yv7ycKnpCfVEyqTDZPmU2dmnafvvF05dOJZ+nPFmYKf5X+ tfa5zvMffnP8rX82YnbiBf/Fp99LXsq/PPRq2aueuYC5R69TXy/MF72Rf3P4LeNt37vwd5MLWe+x7ys/ - 6H7o/ujz8cGn1E+f/gUDmPP8usTo0wAAAAlwSFlzAAALEgAACxIB0t1+/AAAHopJREFUeF7tnfmPHOlZ + 6H7o/ujz8cGn1E+f/gUDmPP8usTo0wAAAAlwSFlzAAALEQAACxEBf2RfkQAAHopJREFUeF7tnfmPHOlZ x/PnIIHgByQSEhSQkLJRgiKEgpJdEMnyAyBFiGwOVkQJEJIAySIlZMNGSfaId+1dH+tjfI7tscdje2Y8 932fnstz+L728G5e6tv22/10zdPT3W8dXce3pI/s6beq3nq76/28V9X7foQbN27cuHHjxo0bN26534wx rR7cuHFL+fabZdP6JFvXtnnHlDL/ux4PCCGp477HljEPez8w4/uv1iYB75DHmd87we2uh2b+6IaZObxG diff --git a/Source/Krypton Toolkit/Examples/ExternalThemeSelectorChooser.Designer.cs b/Source/Krypton Toolkit/Examples/ExternalThemeSelectorChooser.Designer.cs index d52ad0c74..d8b0559f2 100644 --- a/Source/Krypton Toolkit/Examples/ExternalThemeSelectorChooser.Designer.cs +++ b/Source/Krypton Toolkit/Examples/ExternalThemeSelectorChooser.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class ExternalThemeSelectorChooser { @@ -47,7 +75,6 @@ private void InitializeComponent() // // kbtnXMLThemes // - this.kbtnXMLThemes.CornerRoundingRadius = -1F; this.kbtnXMLThemes.Location = new System.Drawing.Point(13, 44); this.kbtnXMLThemes.Name = "kbtnXMLThemes"; this.kbtnXMLThemes.Size = new System.Drawing.Size(250, 25); @@ -57,7 +84,6 @@ private void InitializeComponent() // // kbtnBinaryThemes // - this.kbtnBinaryThemes.CornerRoundingRadius = -1F; this.kbtnBinaryThemes.Location = new System.Drawing.Point(13, 13); this.kbtnBinaryThemes.Name = "kbtnBinaryThemes"; this.kbtnBinaryThemes.Size = new System.Drawing.Size(250, 25); diff --git a/Source/Krypton Toolkit/Examples/ExternalThemeSelectorChooser.cs b/Source/Krypton Toolkit/Examples/ExternalThemeSelectorChooser.cs index 7bc2a2ab3..ea4bb8173 100644 --- a/Source/Krypton Toolkit/Examples/ExternalThemeSelectorChooser.cs +++ b/Source/Krypton Toolkit/Examples/ExternalThemeSelectorChooser.cs @@ -1,13 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion using Krypton.Toolkit.Suite.Extended.Theme.Switcher; namespace Examples diff --git a/Source/Krypton Toolkit/Examples/FloatingMenuToolbarAdvancedExample.Designer.cs b/Source/Krypton Toolkit/Examples/FloatingMenuToolbarAdvancedExample.Designer.cs index 7f729d58e..2be45f178 100644 --- a/Source/Krypton Toolkit/Examples/FloatingMenuToolbarAdvancedExample.Designer.cs +++ b/Source/Krypton Toolkit/Examples/FloatingMenuToolbarAdvancedExample.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class FloatingMenuToolbarAdvancedExample { diff --git a/Source/Krypton Toolkit/Examples/FloatingMenuToolbarAdvancedExample.cs b/Source/Krypton Toolkit/Examples/FloatingMenuToolbarAdvancedExample.cs index dfd04a56d..99913af32 100644 --- a/Source/Krypton Toolkit/Examples/FloatingMenuToolbarAdvancedExample.cs +++ b/Source/Krypton Toolkit/Examples/FloatingMenuToolbarAdvancedExample.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { public partial class FloatingMenuToolbarAdvancedExample : KryptonForm { diff --git a/Source/Krypton Toolkit/Examples/FloatingMenuToolbarExampleMain.Designer.cs b/Source/Krypton Toolkit/Examples/FloatingMenuToolbarExampleMain.Designer.cs index 67a0ca4bc..8d902eb70 100644 --- a/Source/Krypton Toolkit/Examples/FloatingMenuToolbarExampleMain.Designer.cs +++ b/Source/Krypton Toolkit/Examples/FloatingMenuToolbarExampleMain.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class FloatingMenuToolbarExampleMain { @@ -48,7 +76,6 @@ private void InitializeComponent() // // kryptonButton2 // - this.kryptonButton2.CornerRoundingRadius = -1F; this.kryptonButton2.Location = new System.Drawing.Point(13, 44); this.kryptonButton2.Name = "kryptonButton2"; this.kryptonButton2.Size = new System.Drawing.Size(281, 25); @@ -58,7 +85,6 @@ private void InitializeComponent() // // kbtnFloatingAdvanced // - this.kbtnFloatingAdvanced.CornerRoundingRadius = -1F; this.kbtnFloatingAdvanced.Location = new System.Drawing.Point(13, 13); this.kbtnFloatingAdvanced.Name = "kbtnFloatingAdvanced"; this.kbtnFloatingAdvanced.Size = new System.Drawing.Size(281, 25); diff --git a/Source/Krypton Toolkit/Examples/FloatingMenuToolbarExampleMain.cs b/Source/Krypton Toolkit/Examples/FloatingMenuToolbarExampleMain.cs index 744bfe776..7fc1f186c 100644 --- a/Source/Krypton Toolkit/Examples/FloatingMenuToolbarExampleMain.cs +++ b/Source/Krypton Toolkit/Examples/FloatingMenuToolbarExampleMain.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { public partial class FloatingMenuToolbarExampleMain : KryptonForm { diff --git a/Source/Krypton Toolkit/Examples/Form1.Designer.cs b/Source/Krypton Toolkit/Examples/Form1.Designer.cs index 354c2b670..bab2dc80e 100644 --- a/Source/Krypton Toolkit/Examples/Form1.Designer.cs +++ b/Source/Krypton Toolkit/Examples/Form1.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class Form1 { diff --git a/Source/Krypton Toolkit/Examples/Form1.cs b/Source/Krypton Toolkit/Examples/Form1.cs index 2e18a970c..fde94ccb2 100644 --- a/Source/Krypton Toolkit/Examples/Form1.cs +++ b/Source/Krypton Toolkit/Examples/Form1.cs @@ -1,13 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion namespace Examples { public partial class Form1 : Form diff --git a/Source/Krypton Toolkit/Examples/Form2.Designer.cs b/Source/Krypton Toolkit/Examples/Form2.Designer.cs index e6ce47395..e47239d2d 100644 --- a/Source/Krypton Toolkit/Examples/Form2.Designer.cs +++ b/Source/Krypton Toolkit/Examples/Form2.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class Form2 { diff --git a/Source/Krypton Toolkit/Examples/Form2.cs b/Source/Krypton Toolkit/Examples/Form2.cs index 34ad82ae9..5919a2039 100644 --- a/Source/Krypton Toolkit/Examples/Form2.cs +++ b/Source/Krypton Toolkit/Examples/Form2.cs @@ -1,13 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion namespace Examples { public partial class Form2 : Form diff --git a/Source/Krypton Toolkit/Examples/GlobalUsings.cs b/Source/Krypton Toolkit/Examples/GlobalUsings.cs index 032ac4be7..461c74d6c 100644 --- a/Source/Krypton Toolkit/Examples/GlobalUsings.cs +++ b/Source/Krypton Toolkit/Examples/GlobalUsings.cs @@ -1,3 +1,32 @@ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion + // Global using directives global using Krypton.Toolkit; diff --git a/Source/Krypton Toolkit/Examples/KryptonFormExtended1.Designer.cs b/Source/Krypton Toolkit/Examples/KryptonFormExtended1.Designer.cs index e6d92780b..da9b1d700 100644 --- a/Source/Krypton Toolkit/Examples/KryptonFormExtended1.Designer.cs +++ b/Source/Krypton Toolkit/Examples/KryptonFormExtended1.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class KryptonFormExtended1 { @@ -46,7 +74,6 @@ private void InitializeComponent() // // kbtnCloseButton // - this.kbtnCloseButton.CornerRoundingRadius = -1F; this.kbtnCloseButton.Location = new System.Drawing.Point(346, 214); this.kbtnCloseButton.Name = "kbtnCloseButton"; this.kbtnCloseButton.Size = new System.Drawing.Size(172, 22); diff --git a/Source/Krypton Toolkit/Examples/KryptonFormExtended1.cs b/Source/Krypton Toolkit/Examples/KryptonFormExtended1.cs index 40177e089..6793e33df 100644 --- a/Source/Krypton Toolkit/Examples/KryptonFormExtended1.cs +++ b/Source/Krypton Toolkit/Examples/KryptonFormExtended1.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { public partial class KryptonFormExtended1 : KryptonFormExtended { diff --git a/Source/Krypton Toolkit/Examples/KryptonFormExtended2.Designer.cs b/Source/Krypton Toolkit/Examples/KryptonFormExtended2.Designer.cs index d365f1bc3..fa9a52e04 100644 --- a/Source/Krypton Toolkit/Examples/KryptonFormExtended2.Designer.cs +++ b/Source/Krypton Toolkit/Examples/KryptonFormExtended2.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class KryptonFormExtended2 { diff --git a/Source/Krypton Toolkit/Examples/KryptonFormExtended2.cs b/Source/Krypton Toolkit/Examples/KryptonFormExtended2.cs index c826e54f3..bc93506b4 100644 --- a/Source/Krypton Toolkit/Examples/KryptonFormExtended2.cs +++ b/Source/Krypton Toolkit/Examples/KryptonFormExtended2.cs @@ -1,13 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion namespace Examples { public partial class KryptonFormExtended2 : KryptonFormExtended diff --git a/Source/Krypton Toolkit/Examples/KryptonInputBoxExtendedExample.Designer.cs b/Source/Krypton Toolkit/Examples/KryptonInputBoxExtendedExample.Designer.cs index db4db02cb..301f142ac 100644 --- a/Source/Krypton Toolkit/Examples/KryptonInputBoxExtendedExample.Designer.cs +++ b/Source/Krypton Toolkit/Examples/KryptonInputBoxExtendedExample.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class KryptonInputBoxExtendedExample { @@ -88,7 +116,6 @@ private void InitializeComponent() // kbtnQuickTest // this.kbtnQuickTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnQuickTest.CornerRoundingRadius = -1F; this.kbtnQuickTest.Location = new System.Drawing.Point(556, 13); this.kbtnQuickTest.Name = "kbtnQuickTest"; this.kbtnQuickTest.Size = new System.Drawing.Size(136, 25); @@ -99,7 +126,6 @@ private void InitializeComponent() // kbtnShow // this.kbtnShow.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnShow.CornerRoundingRadius = -1F; this.kbtnShow.Location = new System.Drawing.Point(698, 13); this.kbtnShow.Name = "kbtnShow"; this.kbtnShow.Size = new System.Drawing.Size(90, 25); @@ -151,7 +177,6 @@ private void InitializeComponent() // // kbtnButtonTypeface // - this.kbtnButtonTypeface.CornerRoundingRadius = -1F; this.kbtnButtonTypeface.Location = new System.Drawing.Point(424, 131); this.kbtnButtonTypeface.Name = "kbtnButtonTypeface"; this.kbtnButtonTypeface.Size = new System.Drawing.Size(111, 25); @@ -160,7 +185,6 @@ private void InitializeComponent() // // kbtnPromptTypeface // - this.kbtnPromptTypeface.CornerRoundingRadius = -1F; this.kbtnPromptTypeface.Location = new System.Drawing.Point(637, 131); this.kbtnPromptTypeface.Name = "kbtnPromptTypeface"; this.kbtnPromptTypeface.Size = new System.Drawing.Size(111, 25); @@ -169,7 +193,6 @@ private void InitializeComponent() // // kbtnCueTypeface // - this.kbtnCueTypeface.CornerRoundingRadius = -1F; this.kbtnCueTypeface.Location = new System.Drawing.Point(541, 131); this.kbtnCueTypeface.Name = "kbtnCueTypeface"; this.kbtnCueTypeface.Size = new System.Drawing.Size(90, 25); @@ -179,7 +202,6 @@ private void InitializeComponent() // // kryptonComboBox5 // - this.kryptonComboBox5.CornerRoundingRadius = -1F; this.kryptonComboBox5.CueHint.Padding = new System.Windows.Forms.Padding(0); this.kryptonComboBox5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.kryptonComboBox5.DropDownWidth = 261; @@ -192,7 +214,6 @@ private void InitializeComponent() // // kcmbWrappedTextAlignment // - this.kcmbWrappedTextAlignment.CornerRoundingRadius = -1F; this.kcmbWrappedTextAlignment.CueHint.Padding = new System.Windows.Forms.Padding(0); this.kcmbWrappedTextAlignment.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.kcmbWrappedTextAlignment.DropDownWidth = 261; @@ -206,7 +227,6 @@ private void InitializeComponent() // // kcmbTextAlignment // - this.kcmbTextAlignment.CornerRoundingRadius = -1F; this.kcmbTextAlignment.CueHint.Padding = new System.Windows.Forms.Padding(0); this.kcmbTextAlignment.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.kcmbTextAlignment.DropDownWidth = 261; @@ -220,7 +240,6 @@ private void InitializeComponent() // // kcmbFocusedButton // - this.kcmbFocusedButton.CornerRoundingRadius = -1F; this.kcmbFocusedButton.CueHint.Padding = new System.Windows.Forms.Padding(0); this.kcmbFocusedButton.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.kcmbFocusedButton.DropDownWidth = 261; @@ -270,7 +289,6 @@ private void InitializeComponent() // // kcmbButtonType // - this.kcmbButtonType.CornerRoundingRadius = -1F; this.kcmbButtonType.CueHint.Padding = new System.Windows.Forms.Padding(0); this.kcmbButtonType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.kcmbButtonType.DropDownWidth = 261; diff --git a/Source/Krypton Toolkit/Examples/KryptonInputBoxExtendedExample.cs b/Source/Krypton Toolkit/Examples/KryptonInputBoxExtendedExample.cs index 7e9711297..3a455a970 100644 --- a/Source/Krypton Toolkit/Examples/KryptonInputBoxExtendedExample.cs +++ b/Source/Krypton Toolkit/Examples/KryptonInputBoxExtendedExample.cs @@ -1,13 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion using Krypton.Toolkit.Suite.Extended.InputBox; using KryptonInputBoxResponseType = Krypton.Toolkit.Suite.Extended.InputBox.KryptonInputBoxResponseType; diff --git a/Source/Krypton Toolkit/Examples/KryptonProgressBarExtendedExamples.Designer.cs b/Source/Krypton Toolkit/Examples/KryptonProgressBarExtendedExamples.Designer.cs index 5782f397a..c246b4d3c 100644 --- a/Source/Krypton Toolkit/Examples/KryptonProgressBarExtendedExamples.Designer.cs +++ b/Source/Krypton Toolkit/Examples/KryptonProgressBarExtendedExamples.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class KryptonProgressBarExtendedExamples { diff --git a/Source/Krypton Toolkit/Examples/KryptonProgressBarExtendedExamples.cs b/Source/Krypton Toolkit/Examples/KryptonProgressBarExtendedExamples.cs index bd136df2b..35bcb1947 100644 --- a/Source/Krypton Toolkit/Examples/KryptonProgressBarExtendedExamples.cs +++ b/Source/Krypton Toolkit/Examples/KryptonProgressBarExtendedExamples.cs @@ -1,13 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion namespace Examples { public partial class KryptonProgressBarExtendedExamples : KryptonForm diff --git a/Source/Krypton Toolkit/Examples/KryptonRibbonExtendedExample.Designer.cs b/Source/Krypton Toolkit/Examples/KryptonRibbonExtendedExample.Designer.cs index 7b4cd7f06..e92841b5b 100644 --- a/Source/Krypton Toolkit/Examples/KryptonRibbonExtendedExample.Designer.cs +++ b/Source/Krypton Toolkit/Examples/KryptonRibbonExtendedExample.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class KryptonRibbonExtendedExample { diff --git a/Source/Krypton Toolkit/Examples/KryptonRibbonExtendedExample.cs b/Source/Krypton Toolkit/Examples/KryptonRibbonExtendedExample.cs index ca761460f..58af8c281 100644 --- a/Source/Krypton Toolkit/Examples/KryptonRibbonExtendedExample.cs +++ b/Source/Krypton Toolkit/Examples/KryptonRibbonExtendedExample.cs @@ -1,13 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion namespace Examples { public partial class KryptonRibbonExtendedExample : KryptonForm diff --git a/Source/Krypton Toolkit/Examples/MainWindow.Designer.cs b/Source/Krypton Toolkit/Examples/MainWindow.Designer.cs index 1994967f3..9b6bcc9db 100644 --- a/Source/Krypton Toolkit/Examples/MainWindow.Designer.cs +++ b/Source/Krypton Toolkit/Examples/MainWindow.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class MainWindow { @@ -30,6 +58,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainWindow)); this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); + this.kbtnCheckBoxComboBoxExample = new Krypton.Toolkit.KryptonButton(); + this.kbtnProgressBars = new Krypton.Toolkit.KryptonButton(); this.kbtnMemoryBoxExample = new Krypton.Toolkit.KryptonButton(); this.kbtnRibbonExtended = new Krypton.Toolkit.KryptonButton(); this.kbtnThemeTools = new Krypton.Toolkit.KryptonButton(); @@ -42,7 +72,6 @@ private void InitializeComponent() this.kbtnKryptonFormExtendedExample = new Krypton.Toolkit.KryptonButton(); this.kbtnFloating = new Krypton.Toolkit.KryptonButton(); this.kbtnNotificationExample = new Krypton.Toolkit.KryptonButton(); - this.kbtnOutlookGrid = new Krypton.Toolkit.KryptonButton(); this.kryptonButton7 = new Krypton.Toolkit.KryptonButton(); this.kbtnExtendedControls = new Krypton.Toolkit.KryptonButton(); this.kryptonButton5 = new Krypton.Toolkit.KryptonButton(); @@ -52,13 +81,15 @@ private void InitializeComponent() this.kbtnCircularProgressBarItem = new Krypton.Toolkit.KryptonButton(); this.ktnToolStripItems = new Krypton.Toolkit.KryptonButton(); this.kbtnButtonItems = new Krypton.Toolkit.KryptonButton(); - this.kbtnProgressBars = new Krypton.Toolkit.KryptonButton(); + this.kbtnControls = new Krypton.Toolkit.KryptonButton(); ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); this.kryptonPanel1.SuspendLayout(); this.SuspendLayout(); // // kryptonPanel1 // + this.kryptonPanel1.Controls.Add(this.kbtnControls); + this.kryptonPanel1.Controls.Add(this.kbtnCheckBoxComboBoxExample); this.kryptonPanel1.Controls.Add(this.kbtnProgressBars); this.kryptonPanel1.Controls.Add(this.kbtnMemoryBoxExample); this.kryptonPanel1.Controls.Add(this.kbtnRibbonExtended); @@ -72,7 +103,6 @@ private void InitializeComponent() this.kryptonPanel1.Controls.Add(this.kbtnKryptonFormExtendedExample); this.kryptonPanel1.Controls.Add(this.kbtnFloating); this.kryptonPanel1.Controls.Add(this.kbtnNotificationExample); - this.kryptonPanel1.Controls.Add(this.kbtnOutlookGrid); this.kryptonPanel1.Controls.Add(this.kryptonButton7); this.kryptonPanel1.Controls.Add(this.kbtnExtendedControls); this.kryptonPanel1.Controls.Add(this.kryptonButton5); @@ -85,15 +115,36 @@ private void InitializeComponent() 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(620, 390); + this.kryptonPanel1.Size = new System.Drawing.Size(626, 396); this.kryptonPanel1.TabIndex = 0; // + // kbtnCheckBoxComboBoxExample + // + this.kbtnCheckBoxComboBoxExample.Location = new System.Drawing.Point(10, 70); + this.kbtnCheckBoxComboBoxExample.Name = "kbtnCheckBoxComboBoxExample"; + this.kbtnCheckBoxComboBoxExample.Size = new System.Drawing.Size(134, 22); + this.kbtnCheckBoxComboBoxExample.TabIndex = 23; + this.kbtnCheckBoxComboBoxExample.Values.DropDownArrowColor = System.Drawing.Color.Empty; + this.kbtnCheckBoxComboBoxExample.Values.Text = "CheckBox ComboBox Example"; + this.kbtnCheckBoxComboBoxExample.Click += new System.EventHandler(this.kbtnCheckBoxComboBoxExample_Click); + // + // kbtnProgressBars + // + this.kbtnProgressBars.Location = new System.Drawing.Point(281, 154); + this.kbtnProgressBars.Name = "kbtnProgressBars"; + this.kbtnProgressBars.Size = new System.Drawing.Size(134, 22); + this.kbtnProgressBars.TabIndex = 22; + this.kbtnProgressBars.Values.DropDownArrowColor = System.Drawing.Color.Empty; + this.kbtnProgressBars.Values.Text = "ProgressBar Examples"; + this.kbtnProgressBars.Click += new System.EventHandler(this.kbtnProgressBars_Click); + // // kbtnMemoryBoxExample // this.kbtnMemoryBoxExample.Location = new System.Drawing.Point(127, 154); this.kbtnMemoryBoxExample.Name = "kbtnMemoryBoxExample"; this.kbtnMemoryBoxExample.Size = new System.Drawing.Size(148, 22); this.kbtnMemoryBoxExample.TabIndex = 21; + this.kbtnMemoryBoxExample.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kbtnMemoryBoxExample.Values.Text = "MemoryBox Example"; this.kbtnMemoryBoxExample.Click += new System.EventHandler(this.kbtnMemoryBoxExample_Click); // @@ -103,6 +154,7 @@ private void InitializeComponent() this.kbtnRibbonExtended.Name = "kbtnRibbonExtended"; this.kbtnRibbonExtended.Size = new System.Drawing.Size(111, 22); this.kbtnRibbonExtended.TabIndex = 20; + this.kbtnRibbonExtended.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kbtnRibbonExtended.Values.Text = "Ribbon Extended"; this.kbtnRibbonExtended.Click += new System.EventHandler(this.kbtnRibbonExtended_Click); // @@ -112,6 +164,7 @@ private void InitializeComponent() this.kbtnThemeTools.Name = "kbtnThemeTools"; this.kbtnThemeTools.Size = new System.Drawing.Size(111, 22); this.kbtnThemeTools.TabIndex = 19; + this.kbtnThemeTools.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kbtnThemeTools.Values.Text = "Theme Tools"; this.kbtnThemeTools.Click += new System.EventHandler(this.kbtnThemeTools_Click); // @@ -121,6 +174,7 @@ private void InitializeComponent() this.kbtnDockExtenderExample.Name = "kbtnDockExtenderExample"; this.kbtnDockExtenderExample.Size = new System.Drawing.Size(188, 22); this.kbtnDockExtenderExample.TabIndex = 18; + this.kbtnDockExtenderExample.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kbtnDockExtenderExample.Values.Text = "Dock Extender Example"; this.kbtnDockExtenderExample.Click += new System.EventHandler(this.kbtnDockExtenderExample_Click); // @@ -130,6 +184,7 @@ private void InitializeComponent() this.kbtnAdvancedDataGridExample.Name = "kbtnAdvancedDataGridExample"; this.kbtnAdvancedDataGridExample.Size = new System.Drawing.Size(188, 22); this.kbtnAdvancedDataGridExample.TabIndex = 17; + this.kbtnAdvancedDataGridExample.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kbtnAdvancedDataGridExample.Values.Text = "Advanced Data Grid Example"; this.kbtnAdvancedDataGridExample.Click += new System.EventHandler(this.kbtnAdvancedDataGridExample_Click); // @@ -139,6 +194,7 @@ private void InitializeComponent() this.kbtnTreeGridView2Example.Name = "kbtnTreeGridView2Example"; this.kbtnTreeGridView2Example.Size = new System.Drawing.Size(150, 22); this.kbtnTreeGridView2Example.TabIndex = 16; + this.kbtnTreeGridView2Example.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kbtnTreeGridView2Example.Values.Text = "TreeGridView 2 Example"; this.kbtnTreeGridView2Example.Click += new System.EventHandler(this.kbtnTreeGridView2Example_Click); // @@ -148,6 +204,7 @@ private void InitializeComponent() this.kbtnTreeGridViewExample.Name = "kbtnTreeGridViewExample"; this.kbtnTreeGridViewExample.Size = new System.Drawing.Size(150, 22); this.kbtnTreeGridViewExample.TabIndex = 15; + this.kbtnTreeGridViewExample.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kbtnTreeGridViewExample.Values.Text = "TreeGridView Example"; this.kbtnTreeGridViewExample.Click += new System.EventHandler(this.kbtnTreeGridViewExample_Click); // @@ -157,6 +214,7 @@ private void InitializeComponent() this.kbtnInputBoxExamples.Name = "kbtnInputBoxExamples"; this.kbtnInputBoxExamples.Size = new System.Drawing.Size(150, 22); this.kbtnInputBoxExamples.TabIndex = 14; + this.kbtnInputBoxExamples.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kbtnInputBoxExamples.Values.Text = "InputBox Examples"; this.kbtnInputBoxExamples.Click += new System.EventHandler(this.kbtnInputBoxExamples_Click); // @@ -166,6 +224,7 @@ private void InitializeComponent() this.kbtnDialogExamples.Name = "kbtnDialogExamples"; this.kbtnDialogExamples.Size = new System.Drawing.Size(109, 22); this.kbtnDialogExamples.TabIndex = 13; + this.kbtnDialogExamples.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kbtnDialogExamples.Values.Text = "Dialog Examples"; this.kbtnDialogExamples.Click += new System.EventHandler(this.kbtnDialogExamples_Click); // @@ -175,6 +234,7 @@ private void InitializeComponent() this.kbtnKryptonFormExtendedExample.Name = "kbtnKryptonFormExtendedExample"; this.kbtnKryptonFormExtendedExample.Size = new System.Drawing.Size(203, 25); this.kbtnKryptonFormExtendedExample.TabIndex = 12; + this.kbtnKryptonFormExtendedExample.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kbtnKryptonFormExtendedExample.Values.Text = "Krypton Form Extended Example"; this.kbtnKryptonFormExtendedExample.Click += new System.EventHandler(this.kbtnKryptonFormExtendedExample_Click); // @@ -184,6 +244,7 @@ private void InitializeComponent() this.kbtnFloating.Name = "kbtnFloating"; this.kbtnFloating.Size = new System.Drawing.Size(110, 22); this.kbtnFloating.TabIndex = 11; + this.kbtnFloating.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kbtnFloating.Values.Text = "Floating Toolbars"; this.kbtnFloating.Click += new System.EventHandler(this.kbtnFloating_Click); // @@ -193,25 +254,17 @@ private void InitializeComponent() this.kbtnNotificationExample.Name = "kbtnNotificationExample"; this.kbtnNotificationExample.Size = new System.Drawing.Size(162, 25); this.kbtnNotificationExample.TabIndex = 10; + this.kbtnNotificationExample.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kbtnNotificationExample.Values.Text = "Notification Example"; this.kbtnNotificationExample.Click += new System.EventHandler(this.kbtnNotificationExample_Click); // - // kbtnOutlookGrid - // - this.kbtnOutlookGrid.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnOutlookGrid.Location = new System.Drawing.Point(10, 67); - this.kbtnOutlookGrid.Name = "kbtnOutlookGrid"; - this.kbtnOutlookGrid.Size = new System.Drawing.Size(127, 25); - this.kbtnOutlookGrid.TabIndex = 9; - this.kbtnOutlookGrid.Values.Text = "OutlookGrid Example"; - this.kbtnOutlookGrid.Click += new System.EventHandler(this.kbtnOutlookGrid_Click); - // // kryptonButton7 // this.kryptonButton7.Location = new System.Drawing.Point(261, 38); this.kryptonButton7.Name = "kryptonButton7"; this.kryptonButton7.Size = new System.Drawing.Size(109, 22); this.kryptonButton7.TabIndex = 8; + this.kryptonButton7.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kryptonButton7.Values.Text = "MessageBox"; this.kryptonButton7.Click += new System.EventHandler(this.kryptonButton7_Click); // @@ -221,6 +274,7 @@ private void InitializeComponent() this.kbtnExtendedControls.Name = "kbtnExtendedControls"; this.kbtnExtendedControls.Size = new System.Drawing.Size(109, 22); this.kbtnExtendedControls.TabIndex = 7; + this.kbtnExtendedControls.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kbtnExtendedControls.Values.Text = "Controls Items"; this.kbtnExtendedControls.Click += new System.EventHandler(this.kbtnExtendedControls_Click); // @@ -230,6 +284,7 @@ private void InitializeComponent() this.kryptonButton5.Name = "kryptonButton5"; this.kryptonButton5.Size = new System.Drawing.Size(130, 22); this.kryptonButton5.TabIndex = 6; + this.kryptonButton5.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kryptonButton5.Values.Text = "Compression Items"; // // kryptonButton4 @@ -238,6 +293,7 @@ private void InitializeComponent() this.kryptonButton4.Name = "kryptonButton4"; this.kryptonButton4.Size = new System.Drawing.Size(109, 22); this.kryptonButton4.TabIndex = 5; + this.kryptonButton4.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kryptonButton4.Values.Text = "ComboBox Items"; // // kbtnCheckSum @@ -246,6 +302,7 @@ private void InitializeComponent() this.kbtnCheckSum.Name = "kbtnCheckSum"; this.kbtnCheckSum.Size = new System.Drawing.Size(109, 22); this.kbtnCheckSum.TabIndex = 4; + this.kbtnCheckSum.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kbtnCheckSum.Values.Text = "CheckSum Tools"; this.kbtnCheckSum.Click += new System.EventHandler(this.kbtnCheckSum_Click); // @@ -255,6 +312,7 @@ private void InitializeComponent() this.kbtnCalendarItems.Name = "kbtnCalendarItems"; this.kbtnCalendarItems.Size = new System.Drawing.Size(109, 22); this.kbtnCalendarItems.TabIndex = 3; + this.kbtnCalendarItems.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kbtnCalendarItems.Values.Text = "Calendar Items"; this.kbtnCalendarItems.Click += new System.EventHandler(this.kbtnCalendarItems_Click); // @@ -264,6 +322,7 @@ private void InitializeComponent() this.kbtnCircularProgressBarItem.Name = "kbtnCircularProgressBarItem"; this.kbtnCircularProgressBarItem.Size = new System.Drawing.Size(134, 22); this.kbtnCircularProgressBarItem.TabIndex = 2; + this.kbtnCircularProgressBarItem.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kbtnCircularProgressBarItem.Values.Text = "Circular ProgressBar"; this.kbtnCircularProgressBarItem.Click += new System.EventHandler(this.kbtnCircularProgressBarItem_Click); // @@ -273,6 +332,7 @@ private void InitializeComponent() this.ktnToolStripItems.Name = "ktnToolStripItems"; this.ktnToolStripItems.Size = new System.Drawing.Size(110, 22); this.ktnToolStripItems.TabIndex = 1; + this.ktnToolStripItems.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.ktnToolStripItems.Values.Text = "Tool Strip Items"; this.ktnToolStripItems.Click += new System.EventHandler(this.ktnToolStripItems_Click); // @@ -282,23 +342,25 @@ private void InitializeComponent() this.kbtnButtonItems.Name = "kbtnButtonItems"; this.kbtnButtonItems.Size = new System.Drawing.Size(109, 22); this.kbtnButtonItems.TabIndex = 0; + this.kbtnButtonItems.Values.DropDownArrowColor = System.Drawing.Color.Empty; this.kbtnButtonItems.Values.Text = "Button Items"; this.kbtnButtonItems.Click += new System.EventHandler(this.kbtnButtonItems_Click); // - // kbtnProgressBars + // kbtnControls // - this.kbtnProgressBars.Location = new System.Drawing.Point(281, 154); - this.kbtnProgressBars.Name = "kbtnProgressBars"; - this.kbtnProgressBars.Size = new System.Drawing.Size(134, 22); - this.kbtnProgressBars.TabIndex = 22; - this.kbtnProgressBars.Values.Text = "ProgressBar Examples"; - this.kbtnProgressBars.Click += new System.EventHandler(this.kbtnProgressBars_Click); + this.kbtnControls.Location = new System.Drawing.Point(421, 154); + this.kbtnControls.Name = "kbtnControls"; + this.kbtnControls.Size = new System.Drawing.Size(162, 25); + this.kbtnControls.TabIndex = 24; + this.kbtnControls.Values.DropDownArrowColor = System.Drawing.Color.Empty; + this.kbtnControls.Values.Text = "Controls"; + this.kbtnControls.Click += new System.EventHandler(this.kbtnControls_Click); // // MainWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(620, 390); + this.ClientSize = new System.Drawing.Size(626, 396); this.Controls.Add(this.kryptonPanel1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "MainWindow"; @@ -321,7 +383,6 @@ private void InitializeComponent() private Krypton.Toolkit.KryptonButton kryptonButton5; private Krypton.Toolkit.KryptonButton kryptonButton4; private Krypton.Toolkit.KryptonButton kryptonButton7; - private Krypton.Toolkit.KryptonButton kbtnOutlookGrid; private Krypton.Toolkit.KryptonButton kbtnNotificationExample; private Krypton.Toolkit.KryptonButton kbtnFloating; private KryptonButton kbtnKryptonFormExtendedExample; @@ -335,5 +396,7 @@ private void InitializeComponent() private KryptonButton kbtnRibbonExtended; private KryptonButton kbtnMemoryBoxExample; private KryptonButton kbtnProgressBars; + private KryptonButton kbtnCheckBoxComboBoxExample; + private KryptonButton kbtnControls; } } \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/MainWindow.cs b/Source/Krypton Toolkit/Examples/MainWindow.cs index c8aa07df7..f9c38a4b3 100644 --- a/Source/Krypton Toolkit/Examples/MainWindow.cs +++ b/Source/Krypton Toolkit/Examples/MainWindow.cs @@ -1,3 +1,31 @@ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion namespace Examples { public partial class MainWindow : KryptonForm @@ -9,91 +37,77 @@ public MainWindow() private void kbtnButtonItems_Click(object sender, EventArgs e) { - ButtonItems buttonItems = new ButtonItems(); + var buttonItems = new ButtonItems(); buttonItems.Show(); } private void ktnToolStripItems_Click(object sender, EventArgs e) { - ToolStripItems tsi = new ToolStripItems(); + var tsi = new ToolStripItems(); tsi.Show(); } private void kbtnCalendarItems_Click(object sender, EventArgs e) { - CalendarItems calendar = new CalendarItems(); + var calendar = new CalendarItems(); calendar.Show(); } private void kbtnCircularProgressBarItem_Click(object sender, EventArgs e) { - CircularProgressBarExample circularProgressBar = new CircularProgressBarExample(); + var circularProgressBar = new CircularProgressBarExample(); circularProgressBar.Show(); } private void kbtnCheckSum_Click(object sender, EventArgs e) { - CheckSumExample checkSum = new CheckSumExample(); + var checkSum = new CheckSumExample(); checkSum.Show(); } private void kbtnExtendedControls_Click(object sender, EventArgs e) { - ExtendedControlExamples extendedControlExamples = new ExtendedControlExamples(); + var extendedControlExamples = new ExtendedControlExamples(); extendedControlExamples.Show(); } private void kryptonButton7_Click(object sender, EventArgs e) { - MessageBoxExample messageBoxExample = new MessageBoxExample(); + var messageBoxExample = new MessageBoxExample(); messageBoxExample.Show(); } - private void kbtnOutlookGrid_Click(object sender, EventArgs e) - { - OutlookGridExample outlookGridExample = new OutlookGridExample(); - - outlookGridExample.Show(); - } - - private void kbtnNotificationExample_Click(object sender, EventArgs e) - { - NotificationExample notificationExample = new NotificationExample(); - - notificationExample.Show(); - } - private void kbtnFloating_Click(object sender, EventArgs e) { - FloatingMenuToolbarExampleMain floating = new FloatingMenuToolbarExampleMain(); + var floating = new FloatingMenuToolbarExampleMain(); floating.Show(); } private void kbtnKryptonFormExtendedExample_Click(object sender, EventArgs e) { - KryptonFormExtended1 kryptonFormExtended = new KryptonFormExtended1(); + var kryptonFormExtended = new KryptonFormExtended1(); kryptonFormExtended.Show(); } private void kbtnDialogExamples_Click(object sender, EventArgs e) { - DialogExamples dialogExamples = new DialogExamples(); + var dialogExamples = new DialogExamples(); dialogExamples.Show(); } private void kbtnInputBoxExamples_Click(object sender, EventArgs e) { - KryptonInputBoxExtendedExample example = new KryptonInputBoxExtendedExample(); + var example = new KryptonInputBoxExtendedExample(); example.Show(); } @@ -107,21 +121,21 @@ private void kbtnTreeGridViewExample_Click(object sender, EventArgs e) private void kbtnTreeGridView2Example_Click(object sender, EventArgs e) { - TreeGridViewAdvancedExample treeGridViewAdvanced = new TreeGridViewAdvancedExample(); + var treeGridViewAdvanced = new TreeGridViewAdvancedExample(); treeGridViewAdvanced.Show(); } private void kbtnAdvancedDataGridExample_Click(object sender, EventArgs e) { - AdvancedDataGridView advancedDataGrid = new AdvancedDataGridView(); + var advancedDataGrid = new AdvancedDataGridView(); advancedDataGrid.Show(); } private void kbtnDockExtenderExample_Click(object sender, EventArgs e) { - DockExtenderExample dockExtenderExample = new DockExtenderExample(); + var dockExtenderExample = new DockExtenderExample(); dockExtenderExample.Show(); } @@ -135,23 +149,44 @@ private void kbtnThemeTools_Click(object sender, EventArgs e) private void kbtnRibbonExtended_Click(object sender, EventArgs e) { - KryptonRibbonExtendedExample ribbonExtendedExample = new KryptonRibbonExtendedExample(); + var ribbonExtendedExample = new KryptonRibbonExtendedExample(); ribbonExtendedExample.Show(); } private void kbtnMemoryBoxExample_Click(object sender, EventArgs e) { - MemoryBoxExample memoryBoxExample = new MemoryBoxExample(); + var memoryBoxExample = new MemoryBoxExample(); memoryBoxExample.Show(); } private void kbtnProgressBars_Click(object sender, EventArgs e) { - KryptonProgressBarExtendedExamples progressBarExtendedExamples = new KryptonProgressBarExtendedExamples(); + var progressBarExtendedExamples = new KryptonProgressBarExtendedExamples(); progressBarExtendedExamples.Show(); } + + private void kbtnCheckBoxComboBoxExample_Click(object sender, EventArgs e) + { + var example = new CheckBoxComboBoxTest(); + + example.Show(); + } + + private void kbtnNotificationExample_Click(object sender, EventArgs e) + { + var toasts = new ToastNotificationMenu(); + + toasts.Show(); + } + + private void kbtnControls_Click(object sender, EventArgs e) + { + var controls = new ExtendedControlExamples(); + + controls.Show(); + } } } \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/MemoryBoxExample.Designer.cs b/Source/Krypton Toolkit/Examples/MemoryBoxExample.Designer.cs index 31da2dd92..60066b799 100644 --- a/Source/Krypton Toolkit/Examples/MemoryBoxExample.Designer.cs +++ b/Source/Krypton Toolkit/Examples/MemoryBoxExample.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class MemoryBoxExample { diff --git a/Source/Krypton Toolkit/Examples/MemoryBoxExample.cs b/Source/Krypton Toolkit/Examples/MemoryBoxExample.cs index 1db84da78..8610210c8 100644 --- a/Source/Krypton Toolkit/Examples/MemoryBoxExample.cs +++ b/Source/Krypton Toolkit/Examples/MemoryBoxExample.cs @@ -1,4 +1,32 @@ -using Krypton.Toolkit.Suite.Extended.Memory.Box; +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +using Krypton.Toolkit.Suite.Extended.Memory.Box; using Microsoft.WindowsAPICodePack.Dialogs; @@ -11,7 +39,7 @@ public partial class MemoryBoxExample : KryptonForm private const string SEED_TEXT = @"/* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the ""Software""), to deal diff --git a/Source/Krypton Toolkit/Examples/MessageBoxExample.Designer.cs b/Source/Krypton Toolkit/Examples/MessageBoxExample.Designer.cs index 457fa29b4..0d632b9cf 100644 --- a/Source/Krypton Toolkit/Examples/MessageBoxExample.Designer.cs +++ b/Source/Krypton Toolkit/Examples/MessageBoxExample.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class MessageBoxExample { @@ -31,6 +59,13 @@ private void InitializeComponent() this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MessageBoxExample)); this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); + this.kryptonGroupBox5 = new Krypton.Toolkit.KryptonGroupBox(); + this.kcbRtlReading = new Krypton.Toolkit.KryptonCheckBox(); + this.kcbRightAlign = new Krypton.Toolkit.KryptonCheckBox(); + this.kryptonGroupBox4 = new Krypton.Toolkit.KryptonGroupBox(); + this.kcbOptionalCheckBoxChecked = new Krypton.Toolkit.KryptonCheckBox(); + this.ktxtOptionalCheckBoxText = new Krypton.Toolkit.KryptonTextBox(); + this.kcbShowOptionalCheckBox = new Krypton.Toolkit.KryptonCheckBox(); this.kmbFillText = new Krypton.Toolkit.KryptonButton(); this.kbtnShow = new Krypton.Toolkit.KryptonButton(); this.kryptonGroupBox3 = new Krypton.Toolkit.KryptonGroupBox(); @@ -43,7 +78,6 @@ private void InitializeComponent() this.kryptonLabel4 = new Krypton.Toolkit.KryptonLabel(); this.kryptonLabel3 = new Krypton.Toolkit.KryptonLabel(); this.kcmbMessageContentType = new Krypton.Toolkit.KryptonComboBox(); - this.kryptonThemeComboBox1 = new Krypton.Toolkit.KryptonThemeComboBox(); this.kryptonGroupBox2 = new Krypton.Toolkit.KryptonGroupBox(); this.kryptonComboBox3 = new Krypton.Toolkit.KryptonComboBox(); this.ktxtCustomButtonFourText = new Krypton.Toolkit.KryptonTextBox(); @@ -65,18 +99,21 @@ private void InitializeComponent() this.kryptonLabel1 = new Krypton.Toolkit.KryptonLabel(); this.kryptonManager1 = new Krypton.Toolkit.KryptonManager(this.components); this.kbtnFillText = new Krypton.Toolkit.KryptonButton(); - this.kryptonGroupBox4 = new Krypton.Toolkit.KryptonGroupBox(); - this.kcbShowOptionalCheckBox = new Krypton.Toolkit.KryptonCheckBox(); - this.ktxtOptionalCheckBoxText = new Krypton.Toolkit.KryptonTextBox(); - this.kcbOptionalCheckBoxChecked = new Krypton.Toolkit.KryptonCheckBox(); ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); this.kryptonPanel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox5)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox5.Panel)).BeginInit(); + this.kryptonGroupBox5.Panel.SuspendLayout(); + this.kryptonGroupBox5.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox4.Panel)).BeginInit(); + this.kryptonGroupBox4.Panel.SuspendLayout(); + this.kryptonGroupBox4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3.Panel)).BeginInit(); this.kryptonGroupBox3.Panel.SuspendLayout(); this.kryptonGroupBox3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.kcmbMessageContentType)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonThemeComboBox1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox2.Panel)).BeginInit(); this.kryptonGroupBox2.Panel.SuspendLayout(); @@ -95,19 +132,15 @@ private void InitializeComponent() this.groupBoxIcon.Panel.SuspendLayout(); this.groupBoxIcon.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.kcmbMessageBoxIcon)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox4)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox4.Panel)).BeginInit(); - this.kryptonGroupBox4.Panel.SuspendLayout(); - this.kryptonGroupBox4.SuspendLayout(); this.SuspendLayout(); // // kryptonPanel1 // + this.kryptonPanel1.Controls.Add(this.kryptonGroupBox5); this.kryptonPanel1.Controls.Add(this.kryptonGroupBox4); this.kryptonPanel1.Controls.Add(this.kmbFillText); this.kryptonPanel1.Controls.Add(this.kbtnShow); this.kryptonPanel1.Controls.Add(this.kryptonGroupBox3); - this.kryptonPanel1.Controls.Add(this.kryptonThemeComboBox1); this.kryptonPanel1.Controls.Add(this.kryptonGroupBox2); this.kryptonPanel1.Controls.Add(this.kryptonGroupBox1); this.kryptonPanel1.Controls.Add(this.groupBoxIcon); @@ -118,9 +151,75 @@ private void InitializeComponent() 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(1577, 429); + this.kryptonPanel1.Size = new System.Drawing.Size(1585, 437); this.kryptonPanel1.TabIndex = 0; // + // kryptonGroupBox5 + // + this.kryptonGroupBox5.Location = new System.Drawing.Point(412, 306); + this.kryptonGroupBox5.Name = "kryptonGroupBox5"; + // + // kryptonGroupBox5.Panel + // + this.kryptonGroupBox5.Panel.Controls.Add(this.kcbRtlReading); + this.kryptonGroupBox5.Panel.Controls.Add(this.kcbRightAlign); + this.kryptonGroupBox5.Size = new System.Drawing.Size(423, 63); + this.kryptonGroupBox5.TabIndex = 19; + this.kryptonGroupBox5.Values.Heading = "Options"; + // + // kcbRtlReading + // + this.kcbRtlReading.Location = new System.Drawing.Point(214, 3); + this.kcbRtlReading.Name = "kcbRtlReading"; + this.kcbRtlReading.Size = new System.Drawing.Size(197, 20); + this.kcbRtlReading.TabIndex = 2; + this.kcbRtlReading.Values.Text = "MessageBoxOptions.RtlReading"; + // + // kcbRightAlign + // + this.kcbRightAlign.Location = new System.Drawing.Point(13, 3); + this.kcbRightAlign.Name = "kcbRightAlign"; + this.kcbRightAlign.Size = new System.Drawing.Size(195, 20); + this.kcbRightAlign.TabIndex = 1; + this.kcbRightAlign.Values.Text = "MessageBoxOptions.RightAlign"; + // + // kryptonGroupBox4 + // + this.kryptonGroupBox4.Location = new System.Drawing.Point(721, 182); + this.kryptonGroupBox4.Name = "kryptonGroupBox4"; + // + // kryptonGroupBox4.Panel + // + this.kryptonGroupBox4.Panel.Controls.Add(this.kcbOptionalCheckBoxChecked); + this.kryptonGroupBox4.Panel.Controls.Add(this.ktxtOptionalCheckBoxText); + this.kryptonGroupBox4.Panel.Controls.Add(this.kcbShowOptionalCheckBox); + this.kryptonGroupBox4.Size = new System.Drawing.Size(311, 118); + this.kryptonGroupBox4.TabIndex = 18; + // + // kcbOptionalCheckBoxChecked + // + this.kcbOptionalCheckBoxChecked.Location = new System.Drawing.Point(16, 63); + this.kcbOptionalCheckBoxChecked.Name = "kcbOptionalCheckBoxChecked"; + this.kcbOptionalCheckBoxChecked.Size = new System.Drawing.Size(189, 20); + this.kcbOptionalCheckBoxChecked.TabIndex = 2; + this.kcbOptionalCheckBoxChecked.Values.Text = "Is optional checkbox checked?"; + // + // ktxtOptionalCheckBoxText + // + this.ktxtOptionalCheckBoxText.Location = new System.Drawing.Point(16, 33); + this.ktxtOptionalCheckBoxText.Name = "ktxtOptionalCheckBoxText"; + this.ktxtOptionalCheckBoxText.Size = new System.Drawing.Size(277, 23); + this.ktxtOptionalCheckBoxText.TabIndex = 1; + this.ktxtOptionalCheckBoxText.Text = "kryptonTextBox2"; + // + // kcbShowOptionalCheckBox + // + this.kcbShowOptionalCheckBox.Location = new System.Drawing.Point(16, 6); + this.kcbShowOptionalCheckBox.Name = "kcbShowOptionalCheckBox"; + this.kcbShowOptionalCheckBox.Size = new System.Drawing.Size(160, 20); + this.kcbShowOptionalCheckBox.TabIndex = 0; + this.kcbShowOptionalCheckBox.Values.Text = "Show Optional CheckBox"; + // // kmbFillText // this.kmbFillText.Location = new System.Drawing.Point(13, 66); @@ -133,7 +232,7 @@ private void InitializeComponent() // kbtnShow // this.kbtnShow.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnShow.Location = new System.Drawing.Point(1475, 392); + this.kbtnShow.Location = new System.Drawing.Point(1483, 400); this.kbtnShow.Name = "kbtnShow"; this.kbtnShow.Size = new System.Drawing.Size(90, 25); this.kbtnShow.TabIndex = 16; @@ -174,7 +273,7 @@ private void InitializeComponent() this.ktxtHyperlinkDestination.CueHint.CueHintText = "Enter a URL or resource path here..."; this.ktxtHyperlinkDestination.Location = new System.Drawing.Point(16, 37); this.ktxtHyperlinkDestination.Name = "ktxtHyperlinkDestination"; - this.ktxtHyperlinkDestination.Size = new System.Drawing.Size(277, 24); + this.ktxtHyperlinkDestination.Size = new System.Drawing.Size(277, 26); this.ktxtHyperlinkDestination.TabIndex = 6; this.ktxtHyperlinkDestination.TextChanged += new System.EventHandler(this.ktxtHyperlinkDestination_TextChanged); // @@ -271,7 +370,7 @@ private void InitializeComponent() // this.kcmbMessageContentType.CueHint.Padding = new System.Windows.Forms.Padding(0); this.kcmbMessageContentType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.kcmbMessageContentType.DropDownWidth = 247; + this.kcmbMessageContentType.DropDownWidth = 277; this.kcmbMessageContentType.IntegralHeight = false; this.kcmbMessageContentType.Location = new System.Drawing.Point(16, 6); this.kcmbMessageContentType.Name = "kcmbMessageContentType"; @@ -280,17 +379,6 @@ private void InitializeComponent() this.kcmbMessageContentType.TabIndex = 2; this.kcmbMessageContentType.SelectedIndexChanged += new System.EventHandler(this.kcmbMessageContentType_SelectedIndexChanged); // - // kryptonThemeComboBox1 - // - this.kryptonThemeComboBox1.CueHint.Padding = new System.Windows.Forms.Padding(0); - this.kryptonThemeComboBox1.DropDownWidth = 311; - this.kryptonThemeComboBox1.IntegralHeight = false; - this.kryptonThemeComboBox1.Location = new System.Drawing.Point(404, 13); - this.kryptonThemeComboBox1.Name = "kryptonThemeComboBox1"; - this.kryptonThemeComboBox1.Size = new System.Drawing.Size(311, 21); - this.kryptonThemeComboBox1.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; - this.kryptonThemeComboBox1.TabIndex = 14; - // // kryptonGroupBox2 // this.kryptonGroupBox2.Location = new System.Drawing.Point(404, 40); @@ -314,7 +402,7 @@ private void InitializeComponent() // this.kryptonComboBox3.CueHint.Padding = new System.Windows.Forms.Padding(0); this.kryptonComboBox3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.kryptonComboBox3.DropDownWidth = 247; + this.kryptonComboBox3.DropDownWidth = 270; this.kryptonComboBox3.IntegralHeight = false; this.kryptonComboBox3.Location = new System.Drawing.Point(21, 205); this.kryptonComboBox3.Name = "kryptonComboBox3"; @@ -334,7 +422,7 @@ private void InitializeComponent() // this.kryptonComboBox4.CueHint.Padding = new System.Windows.Forms.Padding(0); this.kryptonComboBox4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.kryptonComboBox4.DropDownWidth = 247; + this.kryptonComboBox4.DropDownWidth = 270; this.kryptonComboBox4.IntegralHeight = false; this.kryptonComboBox4.Location = new System.Drawing.Point(21, 148); this.kryptonComboBox4.Name = "kryptonComboBox4"; @@ -354,7 +442,7 @@ private void InitializeComponent() // this.kryptonComboBox2.CueHint.Padding = new System.Windows.Forms.Padding(0); this.kryptonComboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.kryptonComboBox2.DropDownWidth = 247; + this.kryptonComboBox2.DropDownWidth = 270; this.kryptonComboBox2.IntegralHeight = false; this.kryptonComboBox2.Location = new System.Drawing.Point(21, 91); this.kryptonComboBox2.Name = "kryptonComboBox2"; @@ -374,7 +462,7 @@ private void InitializeComponent() // this.kryptonComboBox1.CueHint.Padding = new System.Windows.Forms.Padding(0); this.kryptonComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.kryptonComboBox1.DropDownWidth = 247; + this.kryptonComboBox1.DropDownWidth = 270; this.kryptonComboBox1.IntegralHeight = false; this.kryptonComboBox1.Location = new System.Drawing.Point(21, 34); this.kryptonComboBox1.Name = "kryptonComboBox1"; @@ -434,7 +522,7 @@ private void InitializeComponent() this.kryptonTextBox1.Enabled = false; this.kryptonTextBox1.Location = new System.Drawing.Point(12, 35); this.kryptonTextBox1.Name = "kryptonTextBox1"; - this.kryptonTextBox1.Size = new System.Drawing.Size(256, 24); + this.kryptonTextBox1.Size = new System.Drawing.Size(256, 26); this.kryptonTextBox1.TabIndex = 1; // // bsaBrowse @@ -492,6 +580,10 @@ private void InitializeComponent() this.kryptonLabel1.TabIndex = 0; this.kryptonLabel1.Values.Text = "Caption:"; // + // kryptonManager1 + // + this.kryptonManager1.GlobalPaletteMode = Krypton.Toolkit.PaletteMode.SparkleOrange; + // // kbtnFillText // this.kbtnFillText.Location = new System.Drawing.Point(13, 66); @@ -500,48 +592,11 @@ private void InitializeComponent() this.kbtnFillText.TabIndex = 17; this.kbtnFillText.Values.Text = "Fill Text"; // - // kryptonGroupBox4 - // - this.kryptonGroupBox4.Location = new System.Drawing.Point(721, 182); - this.kryptonGroupBox4.Name = "kryptonGroupBox4"; - // - // kryptonGroupBox4.Panel - // - this.kryptonGroupBox4.Panel.Controls.Add(this.kcbOptionalCheckBoxChecked); - this.kryptonGroupBox4.Panel.Controls.Add(this.ktxtOptionalCheckBoxText); - this.kryptonGroupBox4.Panel.Controls.Add(this.kcbShowOptionalCheckBox); - this.kryptonGroupBox4.Size = new System.Drawing.Size(311, 118); - this.kryptonGroupBox4.TabIndex = 18; - // - // kcbShowOptionalCheckBox - // - this.kcbShowOptionalCheckBox.Location = new System.Drawing.Point(16, 6); - this.kcbShowOptionalCheckBox.Name = "kcbShowOptionalCheckBox"; - this.kcbShowOptionalCheckBox.Size = new System.Drawing.Size(160, 20); - this.kcbShowOptionalCheckBox.TabIndex = 0; - this.kcbShowOptionalCheckBox.Values.Text = "Show Optional CheckBox"; - // - // ktxtOptionalCheckBoxText - // - this.ktxtOptionalCheckBoxText.Location = new System.Drawing.Point(16, 33); - this.ktxtOptionalCheckBoxText.Name = "ktxtOptionalCheckBoxText"; - this.ktxtOptionalCheckBoxText.Size = new System.Drawing.Size(277, 23); - this.ktxtOptionalCheckBoxText.TabIndex = 1; - this.ktxtOptionalCheckBoxText.Text = "kryptonTextBox2"; - // - // kcbOptionalCheckBoxChecked - // - this.kcbOptionalCheckBoxChecked.Location = new System.Drawing.Point(16, 63); - this.kcbOptionalCheckBoxChecked.Name = "kcbOptionalCheckBoxChecked"; - this.kcbOptionalCheckBoxChecked.Size = new System.Drawing.Size(189, 20); - this.kcbOptionalCheckBoxChecked.TabIndex = 2; - this.kcbOptionalCheckBoxChecked.Values.Text = "Is optional checkbox checked?"; - // // MessageBoxExample // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1577, 429); + this.ClientSize = new System.Drawing.Size(1585, 437); this.Controls.Add(this.kryptonPanel1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; this.MaximizeBox = false; @@ -551,13 +606,22 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox5.Panel)).EndInit(); + this.kryptonGroupBox5.Panel.ResumeLayout(false); + this.kryptonGroupBox5.Panel.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox5)).EndInit(); + this.kryptonGroupBox5.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox4.Panel)).EndInit(); + this.kryptonGroupBox4.Panel.ResumeLayout(false); + this.kryptonGroupBox4.Panel.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox4)).EndInit(); + this.kryptonGroupBox4.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3.Panel)).EndInit(); this.kryptonGroupBox3.Panel.ResumeLayout(false); this.kryptonGroupBox3.Panel.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3)).EndInit(); this.kryptonGroupBox3.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.kcmbMessageContentType)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonThemeComboBox1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox2.Panel)).EndInit(); this.kryptonGroupBox2.Panel.ResumeLayout(false); this.kryptonGroupBox2.Panel.PerformLayout(); @@ -578,11 +642,6 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.groupBoxIcon)).EndInit(); this.groupBoxIcon.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.kcmbMessageBoxIcon)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox4.Panel)).EndInit(); - this.kryptonGroupBox4.Panel.ResumeLayout(false); - this.kryptonGroupBox4.Panel.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox4)).EndInit(); - this.kryptonGroupBox4.ResumeLayout(false); this.ResumeLayout(false); } @@ -605,7 +664,6 @@ private void InitializeComponent() private Krypton.Toolkit.KryptonTextBox ktxtCustomButtonTwoText; private Krypton.Toolkit.KryptonComboBox kryptonComboBox1; private Krypton.Toolkit.KryptonTextBox ktxtCustomButtonOneText; - private KryptonThemeComboBox kryptonThemeComboBox1; private KryptonComboBox kcmbMessageBoxIcon; private KryptonTextBox kryptonTextBox1; private KryptonComboBox kcmbMessageBoxButtons; @@ -628,5 +686,8 @@ private void InitializeComponent() private KryptonCheckBox kcbShowOptionalCheckBox; private KryptonTextBox ktxtOptionalCheckBoxText; private KryptonCheckBox kcbOptionalCheckBoxChecked; + private KryptonGroupBox kryptonGroupBox5; + private KryptonCheckBox kcbRightAlign; + private KryptonCheckBox kcbRtlReading; } } \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/MessageBoxExample.cs b/Source/Krypton Toolkit/Examples/MessageBoxExample.cs index e524ea787..c75df4496 100644 --- a/Source/Krypton Toolkit/Examples/MessageBoxExample.cs +++ b/Source/Krypton Toolkit/Examples/MessageBoxExample.cs @@ -1,4 +1,31 @@ -using Krypton.Toolkit.Suite.Extended.Core; +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion using Krypton.Toolkit.Suite.Extended.Developer.Utilities; using Krypton.Toolkit.Suite.Extended.Messagebox; @@ -9,10 +36,12 @@ namespace Examples { public partial class MessageBoxExample : KryptonForm { + #region Static Fields + private static string SEED_TEXT = @"/* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the ""Software""), to deal @@ -34,11 +63,45 @@ public partial class MessageBoxExample : KryptonForm * */"; + #endregion + + #region Instance Fields + + #region Standard Options + + private bool _showCloseBox; + + private string _caption; + + private string _message; + + private KryptonMessageBoxDefaultButton _defaultButton = KryptonMessageBoxDefaultButton.Button1; + + private ExtendedKryptonMessageBoxIcon _icon = ExtendedKryptonMessageBoxIcon.Information; + + private KryptonMessageBoxButtons _button = KryptonMessageBoxButtons.OK; + + private MessageBoxOptions _options = 0; + + private ContentAlignment _messageTextAlignment = ContentAlignment.MiddleLeft; + + private Image _customImage; + + #endregion + + #endregion + + #region Identity + public MessageBoxExample() { InitializeComponent(); } + #endregion + + #region Implementation + private void MessageBoxExample_Load(object sender, EventArgs e) { foreach (string value in Enum.GetNames(typeof(ExtendedKryptonMessageBoxIcon))) @@ -144,14 +207,16 @@ private void kryptonButton1_Click(object sender, EventArgs e) private void kbtnShow_Click(object sender, EventArgs e) { - DialogResult result = KryptonMessageBoxExtended.Show(ktxtMessageContent.Text, ktxtCaption.Text, ExtendedMessageBoxButtons.OK, - ExtendedKryptonMessageBoxIcon.Information, kcbShowOptionalCheckBox.Checked, kcbOptionalCheckBoxChecked.Checked, - ktxtOptionalCheckBoxText.Text, null); + //KryptonMessageBoxExtended.Show(this, _message, _caption, _button, _icon, _defaultButton, _options); - if (result == DialogResult.OK) - { - MessageBox.Show($@"{KryptonMessageBoxExtended.ReturnCheckBoxCheckedValue()}"); - } + //DialogResult result = KryptonMessageBoxExtended.Show(_message, _caption, _button, _icon, _defaultButton, _options); + + //if (result == DialogResult.OK) + //{ + // MessageBox.Show($@"{KryptonMessageBoxExtended.ReturnCheckBoxCheckedValue()}"); + //} } + + #endregion } } diff --git a/Source/Krypton Toolkit/Examples/NaviBarExample.Designer.cs b/Source/Krypton Toolkit/Examples/NaviBarExample.Designer.cs index 2551c7e75..26474cc09 100644 --- a/Source/Krypton Toolkit/Examples/NaviBarExample.Designer.cs +++ b/Source/Krypton Toolkit/Examples/NaviBarExample.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class NaviBarExample { diff --git a/Source/Krypton Toolkit/Examples/NaviBarExample.cs b/Source/Krypton Toolkit/Examples/NaviBarExample.cs index f143329af..c702e280d 100644 --- a/Source/Krypton Toolkit/Examples/NaviBarExample.cs +++ b/Source/Krypton Toolkit/Examples/NaviBarExample.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { public partial class NaviBarExample : KryptonForm { diff --git a/Source/Krypton Toolkit/Examples/NotificationExample.Designer.cs b/Source/Krypton Toolkit/Examples/NotificationExample.Designer.cs deleted file mode 100644 index 3232142b8..000000000 --- a/Source/Krypton Toolkit/Examples/NotificationExample.Designer.cs +++ /dev/null @@ -1,102 +0,0 @@ -namespace Examples -{ - partial class NotificationExample - { - /// - /// 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.kryptonToastNotificationPopup1 = new Krypton.Toolkit.Suite.Extended.Notifications.KryptonToastNotificationPopup(); - this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.kbtnShowToastNotification = new Krypton.Toolkit.KryptonButton(); - this.ktnmTest = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastNotificationManager(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); - this.kryptonPanel1.SuspendLayout(); - this.SuspendLayout(); - // - // kryptonToastNotificationPopup1 - // - this.kryptonToastNotificationPopup1.ContentFont = new System.Drawing.Font("Tahoma", 8F); - this.kryptonToastNotificationPopup1.ContentText = null; - this.kryptonToastNotificationPopup1.Image = null; - this.kryptonToastNotificationPopup1.IsRightToLeft = false; - this.kryptonToastNotificationPopup1.OptionsMenu = null; - this.kryptonToastNotificationPopup1.Size = new System.Drawing.Size(400, 100); - this.kryptonToastNotificationPopup1.TitleFont = new System.Drawing.Font("Segoe UI", 9F); - this.kryptonToastNotificationPopup1.TitleText = null; - // - // kryptonPanel1 - // - this.kryptonPanel1.Controls.Add(this.kbtnShowToastNotification); - 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(360, 184); - this.kryptonPanel1.TabIndex = 0; - // - // kbtnShowToastNotification - // - this.kbtnShowToastNotification.CornerRoundingRadius = -1F; - this.kbtnShowToastNotification.Location = new System.Drawing.Point(13, 13); - this.kbtnShowToastNotification.Name = "kbtnShowToastNotification"; - this.kbtnShowToastNotification.Size = new System.Drawing.Size(335, 25); - this.kbtnShowToastNotification.TabIndex = 0; - this.kbtnShowToastNotification.Values.Text = "Show Toast Notification"; - this.kbtnShowToastNotification.Click += new System.EventHandler(this.kbtnShowToastNotification_Click); - // - // ktnmTest - // - this.ktnmTest.ContentAreaType = Krypton.Toolkit.Suite.Extended.Toast.ToastNotificationContentAreaType.WrappedLabel; - this.ktnmTest.ContentText = "This is a sample notification."; - this.ktnmTest.DismissText = "&Dismiss"; - this.ktnmTest.IconType = Krypton.Toolkit.Suite.Extended.Toast.IconType.Information; - this.ktnmTest.RightToLeftSupport = Krypton.Toolkit.Suite.Extended.Toast.RightToLeftSupport.LeftToRight; - this.ktnmTest.Title = "Sample Notification"; - this.ktnmTest.UserResponsePromptAlignHorizontal = Krypton.Toolkit.PaletteRelativeAlign.Center; - this.ktnmTest.UserResponsePromptAlignVertical = Krypton.Toolkit.PaletteRelativeAlign.Center; - this.ktnmTest.UserResponsePromptColour = System.Drawing.Color.Gray; - this.ktnmTest.UserResponsePromptFont = new System.Drawing.Font("Segoe UI", 8.25F); - // - // NotificationExample - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(360, 184); - this.Controls.Add(this.kryptonPanel1); - this.Name = "NotificationExample"; - this.Text = "NotificationExample"; - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); - this.kryptonPanel1.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - private Krypton.Toolkit.Suite.Extended.Notifications.KryptonToastNotificationPopup kryptonToastNotificationPopup1; - private Krypton.Toolkit.KryptonPanel kryptonPanel1; - private Krypton.Toolkit.KryptonButton kbtnShowToastNotification; - private Krypton.Toolkit.Suite.Extended.Toast.KryptonToastNotificationManager ktnmTest; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/NotificationExample.cs b/Source/Krypton Toolkit/Examples/NotificationExample.cs deleted file mode 100644 index ca15dc100..000000000 --- a/Source/Krypton Toolkit/Examples/NotificationExample.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Examples -{ - public partial class NotificationExample : KryptonForm - { - public NotificationExample() - { - InitializeComponent(); - } - - private void kbtnShowToastNotification_Click(object sender, EventArgs e) - { - ktnmTest.DisplayNotificationToast(); - } - } -} diff --git a/Source/Krypton Toolkit/Examples/NotificationExample.resx b/Source/Krypton Toolkit/Examples/NotificationExample.resx deleted file mode 100644 index b31874dc0..000000000 --- a/Source/Krypton Toolkit/Examples/NotificationExample.resx +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - 119, 17 - - - 17, 17 - - \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/OutlookGridExample.Designer.cs b/Source/Krypton Toolkit/Examples/OutlookGridExample.Designer.cs deleted file mode 100644 index bfdd56bbe..000000000 --- a/Source/Krypton Toolkit/Examples/OutlookGridExample.Designer.cs +++ /dev/null @@ -1,150 +0,0 @@ -namespace Examples -{ - partial class OutlookGridExample - { - /// - /// 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() - { - Krypton.Toolkit.Suite.Extended.Outlook.Grid.OutlookGridGroupCollection outlookGridGroupCollection1 = new Krypton.Toolkit.Suite.Extended.Outlook.Grid.OutlookGridGroupCollection(); - this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonHeaderGroup1 = new Krypton.Toolkit.KryptonHeaderGroup(); - this.buttonSpecHeaderGroup1 = new Krypton.Toolkit.ButtonSpecHeaderGroup(); - this.buttonSpecHeaderGroup2 = new Krypton.Toolkit.ButtonSpecHeaderGroup(); - this.buttonSpecHeaderGroup3 = new Krypton.Toolkit.ButtonSpecHeaderGroup(); - this.kryptonOutlookGridGroupBox2 = new Krypton.Toolkit.Suite.Extended.Outlook.Grid.KryptonOutlookGridGroupBox(); - this.kogExample = new Krypton.Toolkit.Suite.Extended.Outlook.Grid.KryptonOutlookGrid(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); - this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonHeaderGroup1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonHeaderGroup1.Panel)).BeginInit(); - this.kryptonHeaderGroup1.Panel.SuspendLayout(); - this.kryptonHeaderGroup1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kogExample)).BeginInit(); - this.SuspendLayout(); - // - // kryptonPanel1 - // - this.kryptonPanel1.Controls.Add(this.kryptonHeaderGroup1); - 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(800, 450); - this.kryptonPanel1.TabIndex = 1; - // - // kryptonHeaderGroup1 - // - this.kryptonHeaderGroup1.ButtonSpecs.AddRange(new Krypton.Toolkit.ButtonSpecHeaderGroup[] { - this.buttonSpecHeaderGroup1, - this.buttonSpecHeaderGroup2, - this.buttonSpecHeaderGroup3}); - this.kryptonHeaderGroup1.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonHeaderGroup1.HeaderVisibleSecondary = false; - this.kryptonHeaderGroup1.Location = new System.Drawing.Point(0, 0); - this.kryptonHeaderGroup1.Name = "kryptonHeaderGroup1"; - // - // kryptonHeaderGroup1.Panel - // - this.kryptonHeaderGroup1.Panel.Controls.Add(this.kryptonOutlookGridGroupBox2); - this.kryptonHeaderGroup1.Panel.Controls.Add(this.kogExample); - this.kryptonHeaderGroup1.Size = new System.Drawing.Size(800, 450); - this.kryptonHeaderGroup1.TabIndex = 3; - this.kryptonHeaderGroup1.ValuesPrimary.Heading = "Options"; - this.kryptonHeaderGroup1.ValuesPrimary.Image = null; - // - // buttonSpecHeaderGroup1 - // - this.buttonSpecHeaderGroup1.Text = "Load config"; - this.buttonSpecHeaderGroup1.UniqueName = "57942eb9436944db83b334a0bf2f2362"; - this.buttonSpecHeaderGroup1.Click += new System.EventHandler(this.buttonSpecHeaderGroup1_Click); - // - // buttonSpecHeaderGroup2 - // - this.buttonSpecHeaderGroup2.Text = "Save config"; - this.buttonSpecHeaderGroup2.UniqueName = "d7f140c9902041c8ba2ab10fda344b9b"; - this.buttonSpecHeaderGroup2.Click += new System.EventHandler(this.buttonSpecHeaderGroup2_Click); - // - // buttonSpecHeaderGroup3 - // - this.buttonSpecHeaderGroup3.Text = "Toggle all nodes"; - this.buttonSpecHeaderGroup3.UniqueName = "b3b0035890fc444783d157625034a3cb"; - this.buttonSpecHeaderGroup3.Click += new System.EventHandler(this.buttonSpecHeaderGroup3_Click); - // - // kryptonOutlookGridGroupBox2 - // - this.kryptonOutlookGridGroupBox2.AllowDrop = true; - this.kryptonOutlookGridGroupBox2.Dock = System.Windows.Forms.DockStyle.Top; - this.kryptonOutlookGridGroupBox2.Location = new System.Drawing.Point(0, 0); - this.kryptonOutlookGridGroupBox2.Name = "kryptonOutlookGridGroupBox2"; - this.kryptonOutlookGridGroupBox2.Size = new System.Drawing.Size(798, 46); - this.kryptonOutlookGridGroupBox2.TabIndex = 0; - // - // kogExample - // - this.kogExample.AllowDrop = true; - this.kogExample.AllowUserToAddRows = false; - this.kogExample.Dock = System.Windows.Forms.DockStyle.Fill; - this.kogExample.FillMode = Krypton.Toolkit.Suite.Extended.Outlook.Grid.FillMode.GroupsOnly; - this.kogExample.GroupCollection = outlookGridGroupCollection1; - this.kogExample.Location = new System.Drawing.Point(0, 0); - this.kogExample.Name = "kogExample"; - this.kogExample.PreviousSelectedGroupRow = -1; - this.kogExample.ShowLines = false; - this.kogExample.Size = new System.Drawing.Size(798, 418); - this.kogExample.TabIndex = 2; - this.kogExample.GroupImageClick += new System.EventHandler(this.kogExample_GroupImageClick); - this.kogExample.Resize += new System.EventHandler(this.kogExample_Resize); - // - // OutlookGridExample - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Controls.Add(this.kryptonPanel1); - this.Name = "OutlookGridExample"; - this.Text = "OutlookGridExample"; - this.Load += new System.EventHandler(this.OutlookGridExample_Load); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); - this.kryptonPanel1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonHeaderGroup1.Panel)).EndInit(); - this.kryptonHeaderGroup1.Panel.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonHeaderGroup1)).EndInit(); - this.kryptonHeaderGroup1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kogExample)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private Krypton.Toolkit.KryptonPanel kryptonPanel1; - private Krypton.Toolkit.Suite.Extended.Outlook.Grid.KryptonOutlookGrid kogExample; - private Krypton.Toolkit.KryptonHeaderGroup kryptonHeaderGroup1; - private Krypton.Toolkit.Suite.Extended.Outlook.Grid.KryptonOutlookGridGroupBox kryptonOutlookGridGroupBox2; - private Krypton.Toolkit.ButtonSpecHeaderGroup buttonSpecHeaderGroup1; - private Krypton.Toolkit.ButtonSpecHeaderGroup buttonSpecHeaderGroup2; - private Krypton.Toolkit.ButtonSpecHeaderGroup buttonSpecHeaderGroup3; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/OutlookGridExample.cs b/Source/Krypton Toolkit/Examples/OutlookGridExample.cs deleted file mode 100644 index 95ca3d9a4..000000000 --- a/Source/Krypton Toolkit/Examples/OutlookGridExample.cs +++ /dev/null @@ -1,260 +0,0 @@ -using System.Globalization; -using System.Xml; - -using Krypton.Toolkit.Suite.Extended.Developer.Utilities; -using Krypton.Toolkit.Suite.Extended.Outlook.Grid; -#pragma warning disable CS0219 -#pragma warning disable CS8603 -#pragma warning disable CS8602 - -namespace Examples -{ - public partial class OutlookGridExample : KryptonForm - { - private static Random rand = new Random(); - - public OutlookGridExample() - { - InitializeComponent(); - } - - #region Implementation - - DateTime GetRandomDate(DateTime dtStart, DateTime dtEnd) - { - int cdayRange = (dtEnd - dtStart).Days; - - return dtStart.AddDays(rand.NextDouble() * cdayRange); - } - - private void LoadData() - { - string? fileName = null; - - //Setup Rows - OutlookGridRow row = new OutlookGridRow(); - List l = new List(); - kogExample.SuspendLayout(); - kogExample.ClearInternalRows(); - kogExample.FillMode = FillMode.GroupsAndNodes; - - List tokensList = new List(); - tokensList.Add(new Token("Best seller", Color.Orange, Color.Black)); - tokensList.Add(new Token("New", Color.LightGreen, Color.Black)); - tokensList.Add(null); - tokensList.Add(null); - tokensList.Add(null); - - Random random = new Random(); - //.Next permet de retourner un nombre aléatoire contenu dans la plage spécifiée entre parenthèses. - - //OpenFileDialog ofd = new OpenFileDialog(); - - //if (ofd.ShowDialog() == DialogResult.OK) - //{ - // fileName = Path.GetFullPath(ofd.FileName); - //} - - XmlDocument doc = new XmlDocument(); - - try - { - doc.Load("invoices.xml"); - - IFormatProvider culture = new CultureInfo("en-US", true); - foreach (XmlNode customer in doc.SelectNodes("//invoice")) //TODO for instead foreach for perfs... - { - try - { - row = new OutlookGridRow(); - row.CreateCells(kogExample, new object[] - { - customer["CustomerID"].InnerText, - customer["CustomerName"].InnerText, - customer["Address"].InnerText, - customer["City"].InnerText, - new TextAndImage(customer["Country"].InnerText, GetFlag(customer["Country"].InnerText)), - DateTime.Parse(customer["OrderDate"].InnerText, culture), - customer["ProductName"].InnerText, - double.Parse(customer["Price"].InnerText, - CultureInfo.InvariantCulture), //We put a float the formatting in design does the rest - (double) random.Next(101) / 100, - tokensList[random.Next(5)] - }); - if (random.Next(2) == 1) - { - //Sub row - OutlookGridRow row2 = new OutlookGridRow(); - row2.CreateCells(kogExample, new object[] - { - $"{customer["CustomerID"].InnerText} 2", - $"{customer["CustomerName"].InnerText} 2", - $"{customer["Address"].InnerText}2", - $"{customer["City"].InnerText} 2", - new TextAndImage(customer["Country"].InnerText, GetFlag(customer["Country"].InnerText)), - DateTime.Now, - $"{customer["ProductName"].InnerText} 2", - (double) random.Next(1000), - (double) random.Next(101) / 100, - tokensList[random.Next(5)] - }); - row.Nodes.Add(row2); - ((KryptonDataGridViewTreeTextCell)row2.Cells[1]) - .UpdateStyle(); //Important : after added to the parent node - } - - l.Add(row); - ((KryptonDataGridViewTreeTextCell)row.Cells[1]) - .UpdateStyle(); //Important : after added to the rows list - } - catch (Exception ex) - { - MessageBox.Show($"Gasp...Something went wrong ! {ex.Message}", "Error", MessageBoxButtons.OK, - MessageBoxIcon.Error); - } - } - - - - kogExample.ResumeLayout(); - kogExample.AssignRows(l); - kogExample.ForceRefreshGroupBox(); - kogExample.Fill(); - } - catch (Exception e) - { - ExceptionCapture.CaptureException(e); - } - - } - - private Image GetFlag(string country) - { - //Icons from http://365icon.com/icon-styles/ethnic/classic2/ - - switch (country) - { - case "France": - return Properties.Resources.fr; - case "Germany": - return Properties.Resources.de; - case "Argentina": - return Properties.Resources.ar; - case "Austria": - return Properties.Resources.au; - case "Belgium": - return Properties.Resources.be; - case "Brazil": - return Properties.Resources.br; - case "Canada": - return Properties.Resources.ca; - case "Denmark": - return Properties.Resources.dk; - case "Finland": - return Properties.Resources.fi; - case "Ireland": - return Properties.Resources.ie; - case "Italy": - return Properties.Resources.it; - case "Mexico": - return Properties.Resources.mx; - case "Norway": - return Properties.Resources.no; - case "Poland": - return Properties.Resources.pl; - case "Portugal": - return Properties.Resources.pt; - case "Spain": - return Properties.Resources.es; - case "Sweden": - return Properties.Resources.se; - case "Switzerland": - return Properties.Resources.ch; - case "UK": - return Properties.Resources.gb; - case "USA": - return Properties.Resources.us; - case "Venezuela": - return Properties.Resources.ve; - default: - return null; - } - } - - #endregion - - private void OutlookGridExample_Load(object sender, EventArgs e) - { - kogExample.GroupBox = kryptonOutlookGridGroupBox2; - - kogExample.RegisterGroupBoxEvents(); - - DataGridViewSetup setup = new DataGridViewSetup(); - - setup.SetupDataGridView(kogExample, true); - - kogExample.ShowLines = true; - - LoadData(); - } - - private void kogExample_Resize(object sender, EventArgs e) - { - int preferredTotalWidth = 1; - - //Calculate the total preferred width - foreach (DataGridViewColumn c in kogExample.Columns) - { - preferredTotalWidth += Math.Min(c.GetPreferredWidth(DataGridViewAutoSizeColumnMode.DisplayedCells, true), 250); - } - - if (kogExample.Width > preferredTotalWidth) - { - kogExample.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; - kogExample.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells); - } - else - { - kogExample.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None; - foreach (DataGridViewColumn c in kogExample.Columns) - { - c.Width = Math.Min(c.GetPreferredWidth(DataGridViewAutoSizeColumnMode.DisplayedCells, true), 250); - } - } - } - - private void kogExample_GroupImageClick(object sender, OutlookGridGroupImageEventArgs e) - { - MessageBox.Show($"Group Image clicked for group row : {e.Row.Group.Text}"); - } - - private void buttonSpecHeaderGroup1_Click(object sender, EventArgs e) - { - DataGridViewSetup setup = new DataGridViewSetup(); - setup.SetupDataGridView(this.kogExample, true); - LoadData(); - - } - - private void buttonSpecHeaderGroup2_Click(object sender, EventArgs e) - { - kogExample.PersistConfiguration($"{Application.StartupPath}/grid.xml", StaticInfos.GRIDCONFIG_VERSION.ToString()); - } - - bool expand = true; - - private void buttonSpecHeaderGroup3_Click(object sender, EventArgs e) - { - if (expand) - { - kogExample.ExpandAllNodes(); - } - else - { - kogExample.CollapseAllNodes(); - } - - expand = !expand; - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/Program.cs b/Source/Krypton Toolkit/Examples/Program.cs index 8a0756d51..02225e2c0 100644 --- a/Source/Krypton Toolkit/Examples/Program.cs +++ b/Source/Krypton Toolkit/Examples/Program.cs @@ -1,3 +1,31 @@ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion namespace Examples { internal static class Program diff --git a/Source/Krypton Toolkit/Examples/Properties/Resources.Designer.cs b/Source/Krypton Toolkit/Examples/Properties/Resources.Designer.cs index 3df08d1fa..5c8bf0002 100644 --- a/Source/Krypton Toolkit/Examples/Properties/Resources.Designer.cs +++ b/Source/Krypton Toolkit/Examples/Properties/Resources.Designer.cs @@ -1,4 +1,33 @@ -//------------------------------------------------------------------------------ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion + +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 diff --git a/Source/Krypton Toolkit/Examples/ThemeTools.Designer.cs b/Source/Krypton Toolkit/Examples/ThemeTools.Designer.cs index dcee573be..e07844cec 100644 --- a/Source/Krypton Toolkit/Examples/ThemeTools.Designer.cs +++ b/Source/Krypton Toolkit/Examples/ThemeTools.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class ThemeTools { @@ -47,7 +75,6 @@ private void InitializeComponent() // // kbtnThemeSelector // - this.kbtnThemeSelector.CornerRoundingRadius = -1F; this.kbtnThemeSelector.Location = new System.Drawing.Point(13, 43); this.kbtnThemeSelector.Name = "kbtnThemeSelector"; this.kbtnThemeSelector.Size = new System.Drawing.Size(250, 25); @@ -57,7 +84,6 @@ private void InitializeComponent() // // kbtnExternalThemeSelector // - this.kbtnExternalThemeSelector.CornerRoundingRadius = -1F; this.kbtnExternalThemeSelector.Location = new System.Drawing.Point(13, 12); this.kbtnExternalThemeSelector.Name = "kbtnExternalThemeSelector"; this.kbtnExternalThemeSelector.Size = new System.Drawing.Size(250, 25); diff --git a/Source/Krypton Toolkit/Examples/ThemeTools.cs b/Source/Krypton Toolkit/Examples/ThemeTools.cs index 7ccd1366c..53876d618 100644 --- a/Source/Krypton Toolkit/Examples/ThemeTools.cs +++ b/Source/Krypton Toolkit/Examples/ThemeTools.cs @@ -1,13 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion using Krypton.Toolkit.Suite.Extended.Theme.Switcher; namespace Examples diff --git a/Source/Krypton Toolkit/Examples/ToastExample.Designer.cs b/Source/Krypton Toolkit/Examples/ToastExample.Designer.cs deleted file mode 100644 index 63978ef7e..000000000 --- a/Source/Krypton Toolkit/Examples/ToastExample.Designer.cs +++ /dev/null @@ -1,753 +0,0 @@ -namespace Examples -{ - partial class ToastExample - { - /// - /// 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(ToastExample)); - this.kryptonToastNotificationManager1 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastNotificationManager(); - this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonGroupBox5 = new Krypton.Toolkit.KryptonGroupBox(); - this.kbtnAttachCommand = new Krypton.Toolkit.KryptonButton(); - this.kcmbActionButtonLocation = new Krypton.Toolkit.KryptonComboBox(); - this.kryptonLabel6 = new Krypton.Toolkit.KryptonLabel(); - this.kcbOpenProcessInExplorer = new Krypton.Toolkit.KryptonCheckBox(); - this.kbbProcessPath = new Krypton.Toolkit.Suite.Extended.Controls.KryptonBrowseBox(); - this.kryptonTextBox2 = new Krypton.Toolkit.KryptonTextBox(); - this.kcbActionType = new Krypton.Toolkit.KryptonComboBox(); - this.kryptonLabel5 = new Krypton.Toolkit.KryptonLabel(); - this.kryptonCheckBox4 = new Krypton.Toolkit.KryptonCheckBox(); - this.kbtnShow = new Krypton.Toolkit.KryptonButton(); - this.kryptonGroupBox4 = new Krypton.Toolkit.KryptonGroupBox(); - this.kcmbUserResponseTextAlignVertical = new Krypton.Toolkit.KryptonComboBox(); - this.kcmbUserResponseTextAlignHorizontal = new Krypton.Toolkit.KryptonComboBox(); - this.kryptonLabel4 = new Krypton.Toolkit.KryptonLabel(); - this.kryptonLabel3 = new Krypton.Toolkit.KryptonLabel(); - this.kbtnUserResponseFont = new Krypton.Toolkit.KryptonButton(); - this.kcolUserResponseColour = new Krypton.Toolkit.KryptonColorButton(); - this.ktxtPromptText = new Krypton.Toolkit.KryptonTextBox(); - this.kchkUseUserResponse = new Krypton.Toolkit.KryptonCheckBox(); - this.kryptonGroupBox3 = new Krypton.Toolkit.KryptonGroupBox(); - this.krbRightToLeft = new Krypton.Toolkit.KryptonRadioButton(); - this.krbLeftToRight = new Krypton.Toolkit.KryptonRadioButton(); - this.kryptonGroupBox2 = new Krypton.Toolkit.KryptonGroupBox(); - this.krbContentAreaTypeMultilinedTextBox = new Krypton.Toolkit.KryptonRadioButton(); - this.krbContentAreaTypeRichTextBox = new Krypton.Toolkit.KryptonRadioButton(); - this.krbContentAreaTypeWrappedLabel = new Krypton.Toolkit.KryptonRadioButton(); - this.krbContentAreaTypeLabel = new Krypton.Toolkit.KryptonRadioButton(); - this.kryptonGroupBox1 = new Krypton.Toolkit.KryptonGroupBox(); - this.krbIconTypeWindowsLogo = new Krypton.Toolkit.KryptonRadioButton(); - this.krbIconTypeWarning = new Krypton.Toolkit.KryptonRadioButton(); - this.krbIconTypeInformation = new Krypton.Toolkit.KryptonRadioButton(); - this.krbIconTypeStop = new Krypton.Toolkit.KryptonRadioButton(); - this.krbIconTypeShield = new Krypton.Toolkit.KryptonRadioButton(); - this.krbIconTypeOk = new Krypton.Toolkit.KryptonRadioButton(); - this.krbIconTypeNone = new Krypton.Toolkit.KryptonRadioButton(); - this.krbIconTypeHand = new Krypton.Toolkit.KryptonRadioButton(); - this.krbIconTypeExclamation = new Krypton.Toolkit.KryptonRadioButton(); - this.kbbIconTypeCustomPath = new Krypton.Toolkit.Suite.Extended.Controls.KryptonBrowseBox(); - this.krbIconTypeError = new Krypton.Toolkit.KryptonRadioButton(); - this.krbIconTypeAsterisk = new Krypton.Toolkit.KryptonRadioButton(); - this.krbIconTypeCustom = new Krypton.Toolkit.KryptonRadioButton(); - this.krtbToastContent = new Krypton.Toolkit.KryptonRichTextBox(); - this.ktxtToastTitle = new Krypton.Toolkit.KryptonTextBox(); - this.kryptonLabel2 = new Krypton.Toolkit.KryptonLabel(); - this.kryptonLabel1 = new Krypton.Toolkit.KryptonLabel(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); - this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox5)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox5.Panel)).BeginInit(); - this.kryptonGroupBox5.Panel.SuspendLayout(); - this.kryptonGroupBox5.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbActionButtonLocation)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kcbActionType)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox4)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox4.Panel)).BeginInit(); - this.kryptonGroupBox4.Panel.SuspendLayout(); - this.kryptonGroupBox4.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbUserResponseTextAlignVertical)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbUserResponseTextAlignHorizontal)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3.Panel)).BeginInit(); - this.kryptonGroupBox3.Panel.SuspendLayout(); - this.kryptonGroupBox3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox2)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox2.Panel)).BeginInit(); - this.kryptonGroupBox2.Panel.SuspendLayout(); - this.kryptonGroupBox2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).BeginInit(); - this.kryptonGroupBox1.Panel.SuspendLayout(); - this.kryptonGroupBox1.SuspendLayout(); - this.SuspendLayout(); - // - // kryptonToastNotificationManager1 - // - this.kryptonToastNotificationManager1.ActionButtonLocation = Krypton.Toolkit.Suite.Extended.Toast.ActionButtonLocation.Left; - this.kryptonToastNotificationManager1.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.kryptonToastNotificationManager1.ContentAreaType = Krypton.Toolkit.Suite.Extended.Toast.ToastNotificationContentAreaType.WrappedLabel; - this.kryptonToastNotificationManager1.ContentTypeface = new System.Drawing.Font("Segoe UI", 8.25F); - this.kryptonToastNotificationManager1.DefaultNotificationButton = Krypton.Toolkit.Suite.Extended.Toast.DefaultNotificationButton.DismissButton; - this.kryptonToastNotificationManager1.DismissText = "&Dismiss"; - this.kryptonToastNotificationManager1.HeaderTypeface = new System.Drawing.Font("Segoe UI", 12F); - this.kryptonToastNotificationManager1.IconType = Krypton.Toolkit.Suite.Extended.Toast.IconType.None; - this.kryptonToastNotificationManager1.RightToLeftSupport = Krypton.Toolkit.Suite.Extended.Toast.RightToLeftSupport.LeftToRight; - this.kryptonToastNotificationManager1.ToastNotificationSound = Krypton.Toolkit.Suite.Extended.Toast.ToastNotificationSystemSounds.None; - this.kryptonToastNotificationManager1.UserResponsePromptAlignHorizontal = Krypton.Toolkit.PaletteRelativeAlign.Center; - this.kryptonToastNotificationManager1.UserResponsePromptAlignVertical = Krypton.Toolkit.PaletteRelativeAlign.Center; - this.kryptonToastNotificationManager1.UserResponsePromptColour = System.Drawing.Color.Gray; - this.kryptonToastNotificationManager1.UserResponsePromptFont = new System.Drawing.Font("Segoe UI", 8.25F); - // - // kryptonPanel1 - // - this.kryptonPanel1.Controls.Add(this.kryptonGroupBox5); - this.kryptonPanel1.Controls.Add(this.kbtnShow); - this.kryptonPanel1.Controls.Add(this.kryptonGroupBox4); - this.kryptonPanel1.Controls.Add(this.kryptonGroupBox3); - this.kryptonPanel1.Controls.Add(this.kryptonGroupBox2); - this.kryptonPanel1.Controls.Add(this.kryptonGroupBox1); - this.kryptonPanel1.Controls.Add(this.krtbToastContent); - this.kryptonPanel1.Controls.Add(this.ktxtToastTitle); - this.kryptonPanel1.Controls.Add(this.kryptonLabel2); - this.kryptonPanel1.Controls.Add(this.kryptonLabel1); - 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(1446, 730); - this.kryptonPanel1.TabIndex = 0; - // - // kryptonGroupBox5 - // - this.kryptonGroupBox5.Location = new System.Drawing.Point(377, 199); - this.kryptonGroupBox5.Name = "kryptonGroupBox5"; - // - // kryptonGroupBox5.Panel - // - this.kryptonGroupBox5.Panel.Controls.Add(this.kbtnAttachCommand); - this.kryptonGroupBox5.Panel.Controls.Add(this.kcmbActionButtonLocation); - this.kryptonGroupBox5.Panel.Controls.Add(this.kryptonLabel6); - this.kryptonGroupBox5.Panel.Controls.Add(this.kcbOpenProcessInExplorer); - this.kryptonGroupBox5.Panel.Controls.Add(this.kbbProcessPath); - this.kryptonGroupBox5.Panel.Controls.Add(this.kryptonTextBox2); - this.kryptonGroupBox5.Panel.Controls.Add(this.kcbActionType); - this.kryptonGroupBox5.Panel.Controls.Add(this.kryptonLabel5); - this.kryptonGroupBox5.Panel.Controls.Add(this.kryptonCheckBox4); - this.kryptonGroupBox5.Size = new System.Drawing.Size(413, 250); - this.kryptonGroupBox5.TabIndex = 12; - this.kryptonGroupBox5.Values.Heading = "Action Button"; - // - // kbtnAttachCommand - // - this.kbtnAttachCommand.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnAttachCommand.CornerRoundingRadius = -1F; - this.kbtnAttachCommand.Enabled = false; - this.kbtnAttachCommand.Location = new System.Drawing.Point(14, 179); - this.kbtnAttachCommand.Name = "kbtnAttachCommand"; - this.kbtnAttachCommand.Size = new System.Drawing.Size(162, 25); - this.kbtnAttachCommand.TabIndex = 12; - this.kbtnAttachCommand.Values.Text = "Att&ach Action Command"; - this.kbtnAttachCommand.Click += new System.EventHandler(this.kbtnAttachCommand_Click); - // - // kcmbActionButtonLocation - // - this.kcmbActionButtonLocation.CornerRoundingRadius = -1F; - this.kcmbActionButtonLocation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.kcmbActionButtonLocation.DropDownWidth = 290; - this.kcmbActionButtonLocation.IntegralHeight = false; - this.kcmbActionButtonLocation.Items.AddRange(new object[] { - "Default", - "Dismiss", - "LaunchProcess", - "Open"}); - this.kcmbActionButtonLocation.Location = new System.Drawing.Point(159, 153); - this.kcmbActionButtonLocation.Name = "kcmbActionButtonLocation"; - this.kcmbActionButtonLocation.Size = new System.Drawing.Size(235, 21); - this.kcmbActionButtonLocation.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; - this.kcmbActionButtonLocation.TabIndex = 7; - this.kcmbActionButtonLocation.TextChanged += new System.EventHandler(this.kcmbActionButtonLocation_TextChanged); - // - // kryptonLabel6 - // - this.kryptonLabel6.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl; - this.kryptonLabel6.Location = new System.Drawing.Point(14, 153); - this.kryptonLabel6.Name = "kryptonLabel6"; - this.kryptonLabel6.Size = new System.Drawing.Size(149, 20); - this.kryptonLabel6.TabIndex = 6; - this.kryptonLabel6.Values.Text = "Action Button Location:"; - // - // kcbOpenProcessInExplorer - // - this.kcbOpenProcessInExplorer.Location = new System.Drawing.Point(14, 127); - this.kcbOpenProcessInExplorer.Name = "kcbOpenProcessInExplorer"; - this.kcbOpenProcessInExplorer.Size = new System.Drawing.Size(160, 20); - this.kcbOpenProcessInExplorer.TabIndex = 5; - this.kcbOpenProcessInExplorer.Values.Text = "&Open process in explorer"; - // - // kbbProcessPath - // - this.kbbProcessPath.LargeResetImage = ((System.Drawing.Image)(resources.GetObject("kbbProcessPath.LargeResetImage"))); - this.kbbProcessPath.Location = new System.Drawing.Point(14, 96); - this.kbbProcessPath.Name = "kbbProcessPath"; - this.kbbProcessPath.ResetText = null; - this.kbbProcessPath.ResetTextToolTipDescription = null; - this.kbbProcessPath.ResetTextToolTipHeading = null; - this.kbbProcessPath.ShowResetButton = true; - this.kbbProcessPath.Size = new System.Drawing.Size(380, 24); - this.kbbProcessPath.SmallResetImage = ((System.Drawing.Image)(resources.GetObject("kbbProcessPath.SmallResetImage"))); - this.kbbProcessPath.TabIndex = 4; - this.kbbProcessPath.Text = "kryptonBrowseBox2"; - // - // kryptonTextBox2 - // - this.kryptonTextBox2.CueHint.CueHintText = "Action button text..."; - this.kryptonTextBox2.CueHint.Padding = new System.Windows.Forms.Padding(0); - this.kryptonTextBox2.Location = new System.Drawing.Point(14, 67); - this.kryptonTextBox2.Name = "kryptonTextBox2"; - this.kryptonTextBox2.Size = new System.Drawing.Size(380, 23); - this.kryptonTextBox2.TabIndex = 3; - // - // kcbActionType - // - this.kcbActionType.CornerRoundingRadius = -1F; - this.kcbActionType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.kcbActionType.DropDownWidth = 290; - this.kcbActionType.IntegralHeight = false; - this.kcbActionType.Items.AddRange(new object[] { - "Default", - "Dismiss", - "LaunchProcess", - "Open"}); - this.kcbActionType.Location = new System.Drawing.Point(104, 40); - this.kcbActionType.Name = "kcbActionType"; - this.kcbActionType.Size = new System.Drawing.Size(290, 21); - this.kcbActionType.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; - this.kcbActionType.TabIndex = 2; - this.kcbActionType.TextChanged += new System.EventHandler(this.kcbActionType_TextChanged); - // - // kryptonLabel5 - // - this.kryptonLabel5.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl; - this.kryptonLabel5.Location = new System.Drawing.Point(14, 40); - this.kryptonLabel5.Name = "kryptonLabel5"; - this.kryptonLabel5.Size = new System.Drawing.Size(83, 20); - this.kryptonLabel5.TabIndex = 1; - this.kryptonLabel5.Values.Text = "Action Type:"; - // - // kryptonCheckBox4 - // - this.kryptonCheckBox4.Location = new System.Drawing.Point(14, 13); - this.kryptonCheckBox4.Name = "kryptonCheckBox4"; - this.kryptonCheckBox4.Size = new System.Drawing.Size(132, 20); - this.kryptonCheckBox4.TabIndex = 0; - this.kryptonCheckBox4.Values.Text = "Show Action &Button"; - // - // kbtnShow - // - this.kbtnShow.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnShow.CornerRoundingRadius = -1F; - this.kbtnShow.Location = new System.Drawing.Point(1272, 693); - this.kbtnShow.Name = "kbtnShow"; - this.kbtnShow.Size = new System.Drawing.Size(162, 25); - this.kbtnShow.TabIndex = 11; - this.kbtnShow.Values.Text = "Sh&ow"; - this.kbtnShow.Click += new System.EventHandler(this.kbtnShow_Click); - // - // kryptonGroupBox4 - // - this.kryptonGroupBox4.Location = new System.Drawing.Point(377, 13); - this.kryptonGroupBox4.Name = "kryptonGroupBox4"; - // - // kryptonGroupBox4.Panel - // - this.kryptonGroupBox4.Panel.Controls.Add(this.kcmbUserResponseTextAlignVertical); - this.kryptonGroupBox4.Panel.Controls.Add(this.kcmbUserResponseTextAlignHorizontal); - this.kryptonGroupBox4.Panel.Controls.Add(this.kryptonLabel4); - this.kryptonGroupBox4.Panel.Controls.Add(this.kryptonLabel3); - this.kryptonGroupBox4.Panel.Controls.Add(this.kbtnUserResponseFont); - this.kryptonGroupBox4.Panel.Controls.Add(this.kcolUserResponseColour); - this.kryptonGroupBox4.Panel.Controls.Add(this.ktxtPromptText); - this.kryptonGroupBox4.Panel.Controls.Add(this.kchkUseUserResponse); - this.kryptonGroupBox4.Size = new System.Drawing.Size(413, 179); - this.kryptonGroupBox4.TabIndex = 7; - this.kryptonGroupBox4.Values.Heading = "User Response"; - // - // kcmbUserResponseTextAlignVertical - // - this.kcmbUserResponseTextAlignVertical.CornerRoundingRadius = -1F; - this.kcmbUserResponseTextAlignVertical.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.kcmbUserResponseTextAlignVertical.DropDownWidth = 235; - this.kcmbUserResponseTextAlignVertical.Enabled = false; - this.kcmbUserResponseTextAlignVertical.IntegralHeight = false; - this.kcmbUserResponseTextAlignVertical.Items.AddRange(new object[] { - "Inherit", - "Near", - "Center", - "Far"}); - this.kcmbUserResponseTextAlignVertical.Location = new System.Drawing.Point(159, 123); - this.kcmbUserResponseTextAlignVertical.Name = "kcmbUserResponseTextAlignVertical"; - this.kcmbUserResponseTextAlignVertical.Size = new System.Drawing.Size(235, 21); - this.kcmbUserResponseTextAlignVertical.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; - this.kcmbUserResponseTextAlignVertical.TabIndex = 9; - // - // kcmbUserResponseTextAlignHorizontal - // - this.kcmbUserResponseTextAlignHorizontal.CornerRoundingRadius = -1F; - this.kcmbUserResponseTextAlignHorizontal.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.kcmbUserResponseTextAlignHorizontal.DropDownWidth = 235; - this.kcmbUserResponseTextAlignHorizontal.Enabled = false; - this.kcmbUserResponseTextAlignHorizontal.IntegralHeight = false; - this.kcmbUserResponseTextAlignHorizontal.Items.AddRange(new object[] { - "Inherit", - "Near", - "Center", - "Far"}); - this.kcmbUserResponseTextAlignHorizontal.Location = new System.Drawing.Point(159, 96); - this.kcmbUserResponseTextAlignHorizontal.Name = "kcmbUserResponseTextAlignHorizontal"; - this.kcmbUserResponseTextAlignHorizontal.Size = new System.Drawing.Size(235, 21); - this.kcmbUserResponseTextAlignHorizontal.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; - this.kcmbUserResponseTextAlignHorizontal.TabIndex = 8; - // - // kryptonLabel4 - // - this.kryptonLabel4.Enabled = false; - this.kryptonLabel4.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl; - this.kryptonLabel4.Location = new System.Drawing.Point(14, 123); - this.kryptonLabel4.Name = "kryptonLabel4"; - this.kryptonLabel4.Size = new System.Drawing.Size(121, 20); - this.kryptonLabel4.TabIndex = 7; - this.kryptonLabel4.Values.Text = "Text Align Vertical:"; - // - // kryptonLabel3 - // - this.kryptonLabel3.Enabled = false; - this.kryptonLabel3.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl; - this.kryptonLabel3.Location = new System.Drawing.Point(14, 96); - this.kryptonLabel3.Name = "kryptonLabel3"; - this.kryptonLabel3.Size = new System.Drawing.Size(138, 20); - this.kryptonLabel3.TabIndex = 6; - this.kryptonLabel3.Values.Text = "Text Align Horizontal:"; - // - // kbtnUserResponseFont - // - this.kbtnUserResponseFont.CornerRoundingRadius = -1F; - this.kbtnUserResponseFont.Enabled = false; - this.kbtnUserResponseFont.Location = new System.Drawing.Point(216, 64); - this.kbtnUserResponseFont.Name = "kbtnUserResponseFont"; - this.kbtnUserResponseFont.Size = new System.Drawing.Size(178, 25); - this.kbtnUserResponseFont.TabIndex = 5; - this.kbtnUserResponseFont.Values.Text = "User Response &Font"; - // - // kcolUserResponseColour - // - this.kcolUserResponseColour.CustomColorPreviewShape = Krypton.Toolkit.KryptonColorButtonCustomColorPreviewShape.Circle; - this.kcolUserResponseColour.Enabled = false; - this.kcolUserResponseColour.Location = new System.Drawing.Point(14, 64); - this.kcolUserResponseColour.Name = "kcolUserResponseColour"; - this.kcolUserResponseColour.SelectedColor = System.Drawing.Color.Gray; - this.kcolUserResponseColour.Size = new System.Drawing.Size(195, 25); - this.kcolUserResponseColour.TabIndex = 4; - this.kcolUserResponseColour.Values.Image = ((System.Drawing.Image)(resources.GetObject("kcolUserResponseColour.Values.Image"))); - this.kcolUserResponseColour.Values.RoundedCorners = 8; - this.kcolUserResponseColour.Values.Text = "User Response &Colour"; - // - // ktxtPromptText - // - this.ktxtPromptText.CueHint.CueHintText = "Enter a answer here..."; - this.ktxtPromptText.CueHint.Padding = new System.Windows.Forms.Padding(0); - this.ktxtPromptText.Enabled = false; - this.ktxtPromptText.Location = new System.Drawing.Point(14, 34); - this.ktxtPromptText.Name = "ktxtPromptText"; - this.ktxtPromptText.Size = new System.Drawing.Size(380, 23); - this.ktxtPromptText.TabIndex = 3; - // - // kchkUseUserResponse - // - this.kchkUseUserResponse.Location = new System.Drawing.Point(14, 8); - this.kchkUseUserResponse.Name = "kchkUseUserResponse"; - this.kchkUseUserResponse.Size = new System.Drawing.Size(127, 20); - this.kchkUseUserResponse.TabIndex = 0; - this.kchkUseUserResponse.Values.Text = "Use User Response"; - this.kchkUseUserResponse.CheckedChanged += new System.EventHandler(this.kchkUseUserResponse_CheckedChanged); - // - // kryptonGroupBox3 - // - this.kryptonGroupBox3.Location = new System.Drawing.Point(13, 523); - this.kryptonGroupBox3.Name = "kryptonGroupBox3"; - // - // kryptonGroupBox3.Panel - // - this.kryptonGroupBox3.Panel.Controls.Add(this.krbRightToLeft); - this.kryptonGroupBox3.Panel.Controls.Add(this.krbLeftToRight); - this.kryptonGroupBox3.Size = new System.Drawing.Size(357, 66); - this.kryptonGroupBox3.TabIndex = 6; - this.kryptonGroupBox3.Values.Heading = "Right to Left Support"; - // - // krbRightToLeft - // - this.krbRightToLeft.Location = new System.Drawing.Point(109, 11); - this.krbRightToLeft.Name = "krbRightToLeft"; - this.krbRightToLeft.Size = new System.Drawing.Size(90, 20); - this.krbRightToLeft.TabIndex = 3; - this.krbRightToLeft.Values.Text = "R&ight to Left"; - // - // krbLeftToRight - // - this.krbLeftToRight.Checked = true; - this.krbLeftToRight.Location = new System.Drawing.Point(13, 11); - this.krbLeftToRight.Name = "krbLeftToRight"; - this.krbLeftToRight.Size = new System.Drawing.Size(90, 20); - this.krbLeftToRight.TabIndex = 2; - this.krbLeftToRight.Values.Text = "&Left to Right"; - // - // kryptonGroupBox2 - // - this.kryptonGroupBox2.Location = new System.Drawing.Point(13, 392); - this.kryptonGroupBox2.Name = "kryptonGroupBox2"; - // - // kryptonGroupBox2.Panel - // - this.kryptonGroupBox2.Panel.Controls.Add(this.krbContentAreaTypeMultilinedTextBox); - this.kryptonGroupBox2.Panel.Controls.Add(this.krbContentAreaTypeRichTextBox); - this.kryptonGroupBox2.Panel.Controls.Add(this.krbContentAreaTypeWrappedLabel); - this.kryptonGroupBox2.Panel.Controls.Add(this.krbContentAreaTypeLabel); - this.kryptonGroupBox2.Size = new System.Drawing.Size(357, 98); - this.kryptonGroupBox2.TabIndex = 5; - this.kryptonGroupBox2.Values.Heading = "Content Area Type"; - // - // krbContentAreaTypeMultilinedTextBox - // - this.krbContentAreaTypeMultilinedTextBox.Location = new System.Drawing.Point(13, 41); - this.krbContentAreaTypeMultilinedTextBox.Name = "krbContentAreaTypeMultilinedTextBox"; - this.krbContentAreaTypeMultilinedTextBox.Size = new System.Drawing.Size(124, 20); - this.krbContentAreaTypeMultilinedTextBox.TabIndex = 4; - this.krbContentAreaTypeMultilinedTextBox.Values.Text = "Multilined TextBox"; - this.krbContentAreaTypeMultilinedTextBox.CheckedChanged += new System.EventHandler(this.ChangeContentAreaType_CheckedChanged); - // - // krbContentAreaTypeRichTextBox - // - this.krbContentAreaTypeRichTextBox.Location = new System.Drawing.Point(201, 15); - this.krbContentAreaTypeRichTextBox.Name = "krbContentAreaTypeRichTextBox"; - this.krbContentAreaTypeRichTextBox.Size = new System.Drawing.Size(92, 20); - this.krbContentAreaTypeRichTextBox.TabIndex = 3; - this.krbContentAreaTypeRichTextBox.Values.Text = "Rich TextBox"; - this.krbContentAreaTypeRichTextBox.CheckedChanged += new System.EventHandler(this.ChangeContentAreaType_CheckedChanged); - // - // krbContentAreaTypeWrappedLabel - // - this.krbContentAreaTypeWrappedLabel.Location = new System.Drawing.Point(80, 15); - this.krbContentAreaTypeWrappedLabel.Name = "krbContentAreaTypeWrappedLabel"; - this.krbContentAreaTypeWrappedLabel.Size = new System.Drawing.Size(105, 20); - this.krbContentAreaTypeWrappedLabel.TabIndex = 2; - this.krbContentAreaTypeWrappedLabel.Values.Text = "Wrapped Label"; - this.krbContentAreaTypeWrappedLabel.CheckedChanged += new System.EventHandler(this.ChangeContentAreaType_CheckedChanged); - // - // krbContentAreaTypeLabel - // - this.krbContentAreaTypeLabel.Location = new System.Drawing.Point(13, 15); - this.krbContentAreaTypeLabel.Name = "krbContentAreaTypeLabel"; - this.krbContentAreaTypeLabel.Size = new System.Drawing.Size(51, 20); - this.krbContentAreaTypeLabel.TabIndex = 1; - this.krbContentAreaTypeLabel.CheckedChanged += new System.EventHandler(this.ChangeContentAreaType_CheckedChanged); - // - // kryptonGroupBox1 - // - this.kryptonGroupBox1.Location = new System.Drawing.Point(13, 182); - this.kryptonGroupBox1.Name = "kryptonGroupBox1"; - // - // kryptonGroupBox1.Panel - // - this.kryptonGroupBox1.Panel.Controls.Add(this.krbIconTypeWindowsLogo); - this.kryptonGroupBox1.Panel.Controls.Add(this.krbIconTypeWarning); - this.kryptonGroupBox1.Panel.Controls.Add(this.krbIconTypeInformation); - this.kryptonGroupBox1.Panel.Controls.Add(this.krbIconTypeStop); - this.kryptonGroupBox1.Panel.Controls.Add(this.krbIconTypeShield); - this.kryptonGroupBox1.Panel.Controls.Add(this.krbIconTypeOk); - this.kryptonGroupBox1.Panel.Controls.Add(this.krbIconTypeNone); - this.kryptonGroupBox1.Panel.Controls.Add(this.krbIconTypeHand); - this.kryptonGroupBox1.Panel.Controls.Add(this.krbIconTypeExclamation); - this.kryptonGroupBox1.Panel.Controls.Add(this.kbbIconTypeCustomPath); - this.kryptonGroupBox1.Panel.Controls.Add(this.krbIconTypeError); - this.kryptonGroupBox1.Panel.Controls.Add(this.krbIconTypeAsterisk); - this.kryptonGroupBox1.Panel.Controls.Add(this.krbIconTypeCustom); - this.kryptonGroupBox1.Size = new System.Drawing.Size(357, 203); - this.kryptonGroupBox1.TabIndex = 4; - this.kryptonGroupBox1.Values.Heading = "Icon Type"; - // - // krbIconTypeWindowsLogo - // - this.krbIconTypeWindowsLogo.Location = new System.Drawing.Point(234, 42); - this.krbIconTypeWindowsLogo.Name = "krbIconTypeWindowsLogo"; - this.krbIconTypeWindowsLogo.Size = new System.Drawing.Size(104, 20); - this.krbIconTypeWindowsLogo.TabIndex = 12; - this.krbIconTypeWindowsLogo.Values.Text = "Windows Logo"; - this.krbIconTypeWindowsLogo.CheckedChanged += new System.EventHandler(this.ChangeIconType_CheckedChanged); - // - // krbIconTypeWarning - // - this.krbIconTypeWarning.Location = new System.Drawing.Point(234, 16); - this.krbIconTypeWarning.Name = "krbIconTypeWarning"; - this.krbIconTypeWarning.Size = new System.Drawing.Size(69, 20); - this.krbIconTypeWarning.TabIndex = 11; - this.krbIconTypeWarning.Values.Text = "Warning"; - this.krbIconTypeWarning.CheckedChanged += new System.EventHandler(this.ChangeIconType_CheckedChanged); - // - // krbIconTypeInformation - // - this.krbIconTypeInformation.Location = new System.Drawing.Point(149, 120); - this.krbIconTypeInformation.Name = "krbIconTypeInformation"; - this.krbIconTypeInformation.Size = new System.Drawing.Size(87, 20); - this.krbIconTypeInformation.TabIndex = 10; - this.krbIconTypeInformation.Values.Text = "Information"; - this.krbIconTypeInformation.CheckedChanged += new System.EventHandler(this.ChangeIconType_CheckedChanged); - // - // krbIconTypeStop - // - this.krbIconTypeStop.Location = new System.Drawing.Point(149, 94); - this.krbIconTypeStop.Name = "krbIconTypeStop"; - this.krbIconTypeStop.Size = new System.Drawing.Size(48, 20); - this.krbIconTypeStop.TabIndex = 9; - this.krbIconTypeStop.Values.Text = "Stop"; - this.krbIconTypeStop.CheckedChanged += new System.EventHandler(this.ChangeIconType_CheckedChanged); - // - // krbIconTypeShield - // - this.krbIconTypeShield.Location = new System.Drawing.Point(149, 68); - this.krbIconTypeShield.Name = "krbIconTypeShield"; - this.krbIconTypeShield.Size = new System.Drawing.Size(56, 20); - this.krbIconTypeShield.TabIndex = 8; - this.krbIconTypeShield.Values.Text = "Shield"; - this.krbIconTypeShield.CheckedChanged += new System.EventHandler(this.ChangeIconType_CheckedChanged); - // - // krbIconTypeOk - // - this.krbIconTypeOk.Location = new System.Drawing.Point(149, 42); - this.krbIconTypeOk.Name = "krbIconTypeOk"; - this.krbIconTypeOk.Size = new System.Drawing.Size(38, 20); - this.krbIconTypeOk.TabIndex = 7; - this.krbIconTypeOk.Values.Text = "Ok"; - this.krbIconTypeOk.CheckedChanged += new System.EventHandler(this.ChangeIconType_CheckedChanged); - // - // krbIconTypeNone - // - this.krbIconTypeNone.Location = new System.Drawing.Point(149, 16); - this.krbIconTypeNone.Name = "krbIconTypeNone"; - this.krbIconTypeNone.Size = new System.Drawing.Size(52, 20); - this.krbIconTypeNone.TabIndex = 6; - this.krbIconTypeNone.Values.Text = "None"; - this.krbIconTypeNone.CheckedChanged += new System.EventHandler(this.ChangeIconType_CheckedChanged); - // - // krbIconTypeHand - // - this.krbIconTypeHand.Location = new System.Drawing.Point(13, 120); - this.krbIconTypeHand.Name = "krbIconTypeHand"; - this.krbIconTypeHand.Size = new System.Drawing.Size(52, 20); - this.krbIconTypeHand.TabIndex = 5; - this.krbIconTypeHand.Values.Text = "Hand"; - this.krbIconTypeHand.CheckedChanged += new System.EventHandler(this.ChangeIconType_CheckedChanged); - // - // krbIconTypeExclamation - // - this.krbIconTypeExclamation.Location = new System.Drawing.Point(13, 94); - this.krbIconTypeExclamation.Name = "krbIconTypeExclamation"; - this.krbIconTypeExclamation.Size = new System.Drawing.Size(88, 20); - this.krbIconTypeExclamation.TabIndex = 4; - this.krbIconTypeExclamation.Values.Text = "Exclamation"; - this.krbIconTypeExclamation.CheckedChanged += new System.EventHandler(this.ChangeIconType_CheckedChanged); - // - // kbbIconTypeCustomPath - // - this.kbbIconTypeCustomPath.CueHint.CueHintText = "Enter custom icon path..."; - this.kbbIconTypeCustomPath.CueHint.Padding = new System.Windows.Forms.Padding(0); - this.kbbIconTypeCustomPath.LargeResetImage = ((System.Drawing.Image)(resources.GetObject("kbbIconTypeCustomPath.LargeResetImage"))); - this.kbbIconTypeCustomPath.Location = new System.Drawing.Point(13, 146); - this.kbbIconTypeCustomPath.Name = "kbbIconTypeCustomPath"; - this.kbbIconTypeCustomPath.ResetText = null; - this.kbbIconTypeCustomPath.ResetTextToolTipDescription = null; - this.kbbIconTypeCustomPath.ResetTextToolTipHeading = null; - this.kbbIconTypeCustomPath.ShowResetButton = true; - this.kbbIconTypeCustomPath.Size = new System.Drawing.Size(325, 24); - this.kbbIconTypeCustomPath.SmallResetImage = ((System.Drawing.Image)(resources.GetObject("kbbIconTypeCustomPath.SmallResetImage"))); - this.kbbIconTypeCustomPath.TabIndex = 3; - // - // krbIconTypeError - // - this.krbIconTypeError.Location = new System.Drawing.Point(13, 68); - this.krbIconTypeError.Name = "krbIconTypeError"; - this.krbIconTypeError.Size = new System.Drawing.Size(49, 20); - this.krbIconTypeError.TabIndex = 2; - this.krbIconTypeError.Values.Text = "Error"; - this.krbIconTypeError.CheckedChanged += new System.EventHandler(this.ChangeIconType_CheckedChanged); - // - // krbIconTypeAsterisk - // - this.krbIconTypeAsterisk.Location = new System.Drawing.Point(13, 16); - this.krbIconTypeAsterisk.Name = "krbIconTypeAsterisk"; - this.krbIconTypeAsterisk.Size = new System.Drawing.Size(65, 20); - this.krbIconTypeAsterisk.TabIndex = 1; - this.krbIconTypeAsterisk.Values.Text = "Asterisk"; - this.krbIconTypeAsterisk.CheckedChanged += new System.EventHandler(this.ChangeIconType_CheckedChanged); - // - // krbIconTypeCustom - // - this.krbIconTypeCustom.Location = new System.Drawing.Point(13, 42); - this.krbIconTypeCustom.Name = "krbIconTypeCustom"; - this.krbIconTypeCustom.Size = new System.Drawing.Size(64, 20); - this.krbIconTypeCustom.TabIndex = 0; - this.krbIconTypeCustom.Values.Text = "Custom"; - this.krbIconTypeCustom.CheckedChanged += new System.EventHandler(this.ChangeIconType_CheckedChanged); - // - // krtbToastContent - // - this.krtbToastContent.Location = new System.Drawing.Point(109, 43); - this.krtbToastContent.Name = "krtbToastContent"; - this.krtbToastContent.Size = new System.Drawing.Size(261, 132); - this.krtbToastContent.TabIndex = 3; - this.krtbToastContent.Text = "This is an example notification to demonstrate what the toast notification is cap" + - "able of."; - // - // ktxtToastTitle - // - this.ktxtToastTitle.Location = new System.Drawing.Point(108, 13); - this.ktxtToastTitle.Name = "ktxtToastTitle"; - this.ktxtToastTitle.Size = new System.Drawing.Size(262, 23); - this.ktxtToastTitle.TabIndex = 2; - this.ktxtToastTitle.Text = "Test Notification"; - // - // kryptonLabel2 - // - this.kryptonLabel2.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl; - this.kryptonLabel2.Location = new System.Drawing.Point(13, 43); - this.kryptonLabel2.Name = "kryptonLabel2"; - this.kryptonLabel2.Size = new System.Drawing.Size(89, 20); - this.kryptonLabel2.TabIndex = 1; - this.kryptonLabel2.Values.Text = "Content Text:"; - // - // kryptonLabel1 - // - this.kryptonLabel1.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl; - this.kryptonLabel1.Location = new System.Drawing.Point(62, 13); - this.kryptonLabel1.Name = "kryptonLabel1"; - this.kryptonLabel1.Size = new System.Drawing.Size(40, 20); - this.kryptonLabel1.TabIndex = 0; - this.kryptonLabel1.Values.Text = "Title:"; - // - // ToastExample - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1446, 730); - this.Controls.Add(this.kryptonPanel1); - this.Name = "ToastExample"; - this.Text = "ToastExample"; - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); - this.kryptonPanel1.ResumeLayout(false); - this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox5.Panel)).EndInit(); - this.kryptonGroupBox5.Panel.ResumeLayout(false); - this.kryptonGroupBox5.Panel.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox5)).EndInit(); - this.kryptonGroupBox5.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kcmbActionButtonLocation)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kcbActionType)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox4.Panel)).EndInit(); - this.kryptonGroupBox4.Panel.ResumeLayout(false); - this.kryptonGroupBox4.Panel.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox4)).EndInit(); - this.kryptonGroupBox4.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kcmbUserResponseTextAlignVertical)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbUserResponseTextAlignHorizontal)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3.Panel)).EndInit(); - this.kryptonGroupBox3.Panel.ResumeLayout(false); - this.kryptonGroupBox3.Panel.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3)).EndInit(); - this.kryptonGroupBox3.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox2.Panel)).EndInit(); - this.kryptonGroupBox2.Panel.ResumeLayout(false); - this.kryptonGroupBox2.Panel.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox2)).EndInit(); - this.kryptonGroupBox2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).EndInit(); - this.kryptonGroupBox1.Panel.ResumeLayout(false); - this.kryptonGroupBox1.Panel.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).EndInit(); - this.kryptonGroupBox1.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private Krypton.Toolkit.Suite.Extended.Toast.KryptonToastNotificationManager kryptonToastNotificationManager1; - private Krypton.Toolkit.KryptonPanel kryptonPanel1; - private Krypton.Toolkit.KryptonRichTextBox krtbToastContent; - private Krypton.Toolkit.KryptonTextBox ktxtToastTitle; - private Krypton.Toolkit.KryptonLabel kryptonLabel2; - private Krypton.Toolkit.KryptonLabel kryptonLabel1; - private Krypton.Toolkit.KryptonGroupBox kryptonGroupBox3; - private Krypton.Toolkit.KryptonGroupBox kryptonGroupBox2; - private Krypton.Toolkit.KryptonGroupBox kryptonGroupBox1; - private Krypton.Toolkit.Suite.Extended.Controls.KryptonBrowseBox kbbIconTypeCustomPath; - private Krypton.Toolkit.KryptonRadioButton krbIconTypeError; - private Krypton.Toolkit.KryptonRadioButton krbIconTypeAsterisk; - private Krypton.Toolkit.KryptonRadioButton krbIconTypeCustom; - private Krypton.Toolkit.KryptonRadioButton krbIconTypeHand; - private Krypton.Toolkit.KryptonRadioButton krbIconTypeExclamation; - private Krypton.Toolkit.KryptonRadioButton krbIconTypeWindowsLogo; - private Krypton.Toolkit.KryptonRadioButton krbIconTypeWarning; - private Krypton.Toolkit.KryptonRadioButton krbIconTypeInformation; - private Krypton.Toolkit.KryptonRadioButton krbIconTypeStop; - private Krypton.Toolkit.KryptonRadioButton krbIconTypeShield; - private Krypton.Toolkit.KryptonRadioButton krbIconTypeOk; - private Krypton.Toolkit.KryptonRadioButton krbIconTypeNone; - private Krypton.Toolkit.KryptonRadioButton krbContentAreaTypeMultilinedTextBox; - private Krypton.Toolkit.KryptonRadioButton krbContentAreaTypeRichTextBox; - private Krypton.Toolkit.KryptonRadioButton krbContentAreaTypeWrappedLabel; - private Krypton.Toolkit.KryptonRadioButton krbContentAreaTypeLabel; - private Krypton.Toolkit.KryptonGroupBox kryptonGroupBox4; - private Krypton.Toolkit.KryptonCheckBox kchkUseUserResponse; - private Krypton.Toolkit.KryptonTextBox ktxtPromptText; - private Krypton.Toolkit.KryptonButton kbtnShow; - private Krypton.Toolkit.KryptonComboBox kcmbUserResponseTextAlignVertical; - private Krypton.Toolkit.KryptonComboBox kcmbUserResponseTextAlignHorizontal; - private Krypton.Toolkit.KryptonLabel kryptonLabel4; - private Krypton.Toolkit.KryptonLabel kryptonLabel3; - private Krypton.Toolkit.KryptonButton kbtnUserResponseFont; - private Krypton.Toolkit.KryptonColorButton kcolUserResponseColour; - private Krypton.Toolkit.KryptonGroupBox kryptonGroupBox5; - private Krypton.Toolkit.KryptonTextBox kryptonTextBox2; - private Krypton.Toolkit.KryptonComboBox kcbActionType; - private Krypton.Toolkit.KryptonLabel kryptonLabel5; - private Krypton.Toolkit.KryptonCheckBox kryptonCheckBox4; - private Krypton.Toolkit.Suite.Extended.Controls.KryptonBrowseBox kbbProcessPath; - private Krypton.Toolkit.KryptonCheckBox kcbOpenProcessInExplorer; - private Krypton.Toolkit.KryptonRadioButton krbRightToLeft; - private Krypton.Toolkit.KryptonRadioButton krbLeftToRight; - private Krypton.Toolkit.KryptonComboBox kcmbActionButtonLocation; - private Krypton.Toolkit.KryptonLabel kryptonLabel6; - private Krypton.Toolkit.KryptonButton kbtnAttachCommand; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/ToastExample.cs b/Source/Krypton Toolkit/Examples/ToastExample.cs deleted file mode 100644 index 11bcbc19b..000000000 --- a/Source/Krypton Toolkit/Examples/ToastExample.cs +++ /dev/null @@ -1,228 +0,0 @@ -using Krypton.Toolkit.Suite.Extended.Toast; - -namespace Examples -{ - public partial class ToastExample : KryptonForm - { - #region Instance Fields - - private ActionType _actionType = ActionType.Default; - - private ActionButtonLocation _actionButtonLocation = ActionButtonLocation.Left; - - private DefaultNotificationButton _defaultNotificationButton = DefaultNotificationButton.None; - - private Krypton.Toolkit.Suite.Extended.Toast.IconType _iconType = Krypton.Toolkit.Suite.Extended.Toast.IconType.None; - - private RightToLeftSupport _rightToLeftSupport = RightToLeftSupport.LeftToRight; - - private ToastNotificationSystemSounds _systemSounds = ToastNotificationSystemSounds.None; - - private ToastNotificationContentAreaType _contentAreaType = ToastNotificationContentAreaType.Label; - - private PaletteRelativeAlign _userResponsePromptAlignHorizontal; - - private PaletteRelativeAlign _userResponsePromptAlignVertical; - - private KryptonCommand _actionButtonCommand = null; - - #endregion - - public ToastExample() - { - InitializeComponent(); - } - - #region Setters & Getters - - /// Sets the ActionType to value. - /// The value of the ActionType. - public void SetActionType(ActionType value) => _actionType = value; - - /// Gets the ActionType value. - /// The value of the ActionType. - public ActionType GetActionType() => _actionType; - - /// Sets the ActionButtonLocation to value. - /// The value of the ActionButtonLocation. - public void SetActionButtonLocation(ActionButtonLocation value) => _actionButtonLocation = value; - - /// Gets the ActionButtonLocation value. - /// The value of the ActionButtonLocation. - public ActionButtonLocation GetActionButtonLocation() => _actionButtonLocation; - - /// Sets the DefaultNotificationButton to value. - /// The value of the DefaultNotificationButton. - public void SetDefaultNotificationButton(DefaultNotificationButton value) => _defaultNotificationButton = value; - - /// Gets the DefaultNotificationButton value. - /// The value of the DefaultNotificationButton. - public DefaultNotificationButton GetDefaultNotificationButton() => _defaultNotificationButton; - - /// Sets the IconType to value. - /// The value of the IconType. - public void SetIconType(Krypton.Toolkit.Suite.Extended.Toast.IconType value) => _iconType = value; - - /// Gets the IconType value. - /// The value of the IconType. - public Krypton.Toolkit.Suite.Extended.Toast.IconType GetIconType() => _iconType; - - /// Sets the RightToLeftSupport to value. - /// The value of the RightToLeftSupport. - public void SetRightToLeftSupport(RightToLeftSupport value) => _rightToLeftSupport = value; - - /// Gets the RightToLeftSupport value. - /// The value of the RightToLeftSupport. - public RightToLeftSupport GetRightToLeftSupport() => _rightToLeftSupport; - - /// Sets the ToastNotificationSystemSounds to value. - /// The value of the ToastNotificationSystemSounds. - public void SetToastNotificationSystemSounds(ToastNotificationSystemSounds value) => _systemSounds = value; - - /// Gets the ToastNotificationSystemSounds value. - /// The value of the ToastNotificationSystemSounds. - public ToastNotificationSystemSounds GetToastNotificationSystemSounds() => _systemSounds; - - /// Sets the ToastNotificationContentAreaType to value. - /// The value of the ToastNotificationContentAreaType. - public void SetToastNotificationContentAreaType(ToastNotificationContentAreaType value) => _contentAreaType = value; - - /// Gets the ToastNotificationContentAreaType value. - /// The value of the ToastNotificationContentAreaType. - public ToastNotificationContentAreaType GetToastNotificationContentAreaType() => _contentAreaType; - - /// Sets the UserResponsePromptAlignHorizontal to value. - /// The value of the UserResponsePromptAlignHorizontal. - public void SetUserResponsePromptAlignHorizontal(PaletteRelativeAlign value) => _userResponsePromptAlignHorizontal = value; - - /// Gets the UserResponsePromptAlignHorizontal value. - /// The value of the UserResponsePromptAlignHorizontal. - public PaletteRelativeAlign GetUserResponsePromptAlignHorizontal() => _userResponsePromptAlignHorizontal; - - /// Sets the UserResponsePromptAlignVertical to value. - /// The value of the UserResponsePromptAlignVertical. - public void SetUserResponsePromptAlignVertical(PaletteRelativeAlign value) => _userResponsePromptAlignVertical = value; - - /// Gets the UserResponsePromptAlignVertical value. - /// The value of the UserResponsePromptAlignVertical. - public PaletteRelativeAlign GetUserResponsePromptAlignVertical() => _userResponsePromptAlignVertical; - - #endregion - - #region Methods - - private void EnableUserResponseUI(bool enabled) - { - ktxtPromptText.Enabled = enabled; - - kcolUserResponseColour.Enabled = enabled; - - kbtnUserResponseFont.Enabled = enabled; - - kryptonLabel3.Enabled = enabled; - - kcmbUserResponseTextAlignHorizontal.Enabled = enabled; - - kryptonLabel4.Enabled = enabled; - - kcmbUserResponseTextAlignVertical.Enabled = enabled; - } - - #endregion - - private void ChangeIconType_CheckedChanged(object sender, EventArgs e) - { - kbbIconTypeCustomPath.Enabled = krbIconTypeCustom.Checked; - - if (krbIconTypeAsterisk.Checked) - { - SetIconType(Krypton.Toolkit.Suite.Extended.Toast.IconType.Asterisk); - } - else if (krbIconTypeCustom.Checked) - { - SetIconType(Krypton.Toolkit.Suite.Extended.Toast.IconType.Custom); - } - else if (krbIconTypeError.Checked) - { - SetIconType(Krypton.Toolkit.Suite.Extended.Toast.IconType.Error); - } - else if (krbIconTypeExclamation.Checked) - { - SetIconType(Krypton.Toolkit.Suite.Extended.Toast.IconType.Exclamation); - } - else if (krbIconTypeHand.Checked) - { - SetIconType(Krypton.Toolkit.Suite.Extended.Toast.IconType.Hand); - } - else if (krbIconTypeNone.Checked) - { - SetIconType(Krypton.Toolkit.Suite.Extended.Toast.IconType.None); - } - else if (krbIconTypeOk.Checked) - { - SetIconType(Krypton.Toolkit.Suite.Extended.Toast.IconType.Ok); - } - else if (krbIconTypeShield.Checked) - { - SetIconType(Krypton.Toolkit.Suite.Extended.Toast.IconType.Shield); - } - else if (krbIconTypeStop.Checked) - { - SetIconType(Krypton.Toolkit.Suite.Extended.Toast.IconType.Stop); - } - else if (krbIconTypeInformation.Checked) - { - SetIconType(Krypton.Toolkit.Suite.Extended.Toast.IconType.Information); - } - else if (krbIconTypeWarning.Checked) - { - SetIconType(Krypton.Toolkit.Suite.Extended.Toast.IconType.Warning); - } - else if (krbIconTypeWindowsLogo.Checked) - { - SetIconType(Krypton.Toolkit.Suite.Extended.Toast.IconType.WindowsLogo); - } - } - - private void ChangeContentAreaType_CheckedChanged(object sender, EventArgs e) - { - if (krbContentAreaTypeLabel.Checked) - { - SetToastNotificationContentAreaType(ToastNotificationContentAreaType.Label); - } - else if (krbContentAreaTypeMultilinedTextBox.Checked) - { - SetToastNotificationContentAreaType(ToastNotificationContentAreaType.MultiLinedTextBox); - } - else if (krbContentAreaTypeRichTextBox.Checked) - { - SetToastNotificationContentAreaType(ToastNotificationContentAreaType.RichTextBox); - } - else if (krbContentAreaTypeWrappedLabel.Checked) - { - SetToastNotificationContentAreaType(ToastNotificationContentAreaType.WrappedLabel); - } - } - - private void kcmbActionButtonLocation_TextChanged(object sender, EventArgs e) => SetActionButtonLocation((ActionButtonLocation)Enum.Parse(typeof(ActionButtonLocation), kcmbActionButtonLocation.Text)); - - private void kcbActionType_TextChanged(object sender, EventArgs e) => SetActionType((ActionType)Enum.Parse(typeof(ActionType), kcbActionType.Text)); - - private void kbtnShow_Click(object sender, EventArgs e) - { - KryptonToastNotificationManager manager = new() - { - - }; - - manager.DisplayNotificationToast(); - } - - private void kchkUseUserResponse_CheckedChanged(object sender, EventArgs e) => EnableUserResponseUI(kchkUseUserResponse.Checked); - - private void kbtnAttachCommand_Click(object sender, EventArgs e) - { - _actionButtonCommand = new(); - } - } -} diff --git a/Source/Krypton Toolkit/Examples/ToastExample.resx b/Source/Krypton Toolkit/Examples/ToastExample.resx deleted file mode 100644 index 9951ccccf..000000000 --- a/Source/Krypton Toolkit/Examples/ToastExample.resx +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m - dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAVhSURBVFhHvZZraJtlFMdfKAyEgW16Sy9JL2mTJWlu - TS9Jb0naBrvqREWc+GFtKVtx7JMoOhxFbWthHzamMCwMXbdVh4JfnHSu4mAXWcXN2k2YrIN1c1acUhC0 - m9tyPP/HPfF50mxZp/jhR96T93nP/zznnOdiEFGSa4s/rxhrmdUoLy/fzr+rLRaLkQlVD2hGOoFMVFZW - Gn6//7rL5brEgYQhUmopvSuqHtCMdAKZqLZXG9FoNBEKh8jr9d62VdmGrVbrqnTiQNUDmpFOIBN2u93o - jHcm2jvaqaW1hQK1AXKsccyUlZU5hGipjqoHNCOdQCaQgY7OjgQHQSASjVBDYwO5a9xLFRUVL4iS/FcB - WKwWV3lF+aDNZjteXV39B4uTx+Oh5pZm4iBEAPiNxWIUbgqTz+ejquqqI1ySkpLSEgOoekAz0okCFq7i - Zju4xrlGOK2rr6PGUKMQgXg0FhXCKrH2mChJMBgkbtDfuEGfe6AMlJWXrWfhpUAgQGi01rZWkWYIoO73 - AmPaIm3U2NhINTU1xJOYUPWAZqSKc7pfcbvdoqYQxkzhdKUg4Hg8TvsOjH+h6gHNUMV55k9zI4lUy1k/ - EJEI9fT20LnzZxfZb5eqBzRDiqPmPPMbcuZIowT13fnWTjr+5THisYL4I3FtjATfDr42SFcWLp/hcdb7 - 3gn9Af9nwbqgaDA4kfT09dCZ2dNLPGaYCWMs94fBM02o4wBSv39iHwLcwzxUUlJiFBUVaXpAM+CQl4zV - 4/UkQqGQCECyaWAj/fTLwlc8xoFxEu5ug98n1LHrHl9HJ6dPXOf3m3BWFBUXGWazWaDqAc2AQ146Q9jN - sMSampsEkViEvr94/hi/z5LCEu4Vg8ck5NiB5wdo7tKFK/wuiGVnLjIbhebCJKoe0Aw4jMYic1jnCABg - 6Q2/OXSD35mkqApvuQaPS6BZd+zagSxN8f+m4uLiv0ULdVQ9oBlwWN9Qf5MR3Q/QCxMfHHhfFVXhihlc - 79uHJj9BvV9nspDqgsICo6BgOaoe0Aw4rPHUEALACgDckDRz7psOKZgKttdvv5u5ys+PotEwy3TCElUP - aAYvvyxuQBGAxOvz0tiedx5OFZYgzfxrRYdDIL8g/56oekAz2FFWuCkk0i5BRjgTTlVUJT+fHd8hLz8v - I6oe0Aw4XP/sMzexCmqDtQIEwFvwYKqwJC+PHafCQtwD+dyIt7hEJOHl+IOqBzQDDl96+cV5n98nLhYA - JXF73Iuc6rRlSBcAsuFwOMZxXLvcLoHT6aT+jf2/q3pAM+Dw8NTkGM4ABAH4mkXsjCptlROp4iA3N1cn - LxcbTpzHi+xJP3h+b/zd+zqMHH39fWLmaECAgOCQN5VRFlilBmDKNSVBANyIXXwv/BV3B9XH2u61OBO6 - VT2gGdLpyVMnjvo5ajgAiB4O+XgmrutZrnFLMgDTHfG8XDMvwTFeSWR32EXQ8ns8f/Txh/M8PkvVA5oh - nTJVu8d238KHEAd4RhB8HSO+bCIbCyz4NXOE+2OW9wARoBRXv9s2+Co2qS70h6oHNEMJAGwZGnlDNBCc - SJwupxDhu54oC99yiFNOaDgEqI7H8+Ytm2nh2o+7sEcgW6oe0IyUAMDo3v17RQ1lN0sQiIC7G7/p3o9u - H8XMDzJZEM/JydH0gGYowiq906dP/bmhd8M/ohl48qkn6POjU+JskDPPzskWqHpAM1KEVVzMJG5BI6Mj - 1P1Y9zLRzngHbd22lT49fAjC00wLNqQcU05S/N8EIAkyuA3NMnT56jxdnJ+DILjAvM3EsecnZ52to+oB - zeCPV8pqxoSjF7sfNqG7CUtUPbDsj/8XMv4C4EU4InvAOU4AAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m - dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ8SURBVDhPdZJNaBNREMcfFAIFofnaTbJJdpNsNnTz - 0SbSbLKbbL6gxUvxUMRbq5TGU1EJngTxUMWLp+LBS0FBISAFsVoiCAqpFhEvOXi1FRT0UFAoKJZx5km2 - Vujhz+PNx2/mzRsWjUaPlazILBaP3VcU5cT/PgDgYpFo5Fipqsoy2QykM+mPCKpT4tB3CIigYSh0YDUj - oSbWNU37kcvloGyWoVQuQTaXBbTfjspRF8U6gHA4zIXJrng8voLVDgonCzypUq1Ao9ngsioW5At5SKVS - A1mW0w5AkiRePakl13ITWLFcBrtm86Rmq+mI7gRcOL/wfWPzSekIIBaLtahd0zR58vLFZdja7sO3va9g - 2zbUG3Wo1WuwemeVbBuoMQdA7VuWtTVVnOIV2heWKGgTZei6zopGEWZOzUDvRY/s17AYL+oAaHDFUvGn - UTKA9Kz39B1OnIWkEFNiCps7MweDD4M9TJ6m2GAwyAKBwCEApzpCb6dkGt6bt69boVCIiaLIwpEw2/28 - 8x6TZQKKAZHbSQ4AnSOmZQI9gUCzp2czFCAIAk9A/yhVRNtoIBhoYwdtvJ91AFJYYvPn5n/RF9HSZCey - 64IoML/f74hg+MXXcUcAnwdVu9p3AEhlD7sPtqk6LYuaVAHbvesX/GM+n48ALqx6Fbfy97g+DqTuo+5z - B4CB1Ob05c4lDtDTOiQSCcD3A85iBzvkVSmROuxc6dBvVB2A1+vlQ/n0ZffezVs3OISCtZQGuFz8HCaT - H+PWjgzR7XFzCFJdqJVX/ZcHi0uLMJmf5N3QSXeyk5/iPF7PPwC3m8vj8fCBYYCBeozaR1G7dNLdID/F - UfxfALA//kaIMNcH69EAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL - DAAACwwBP0AiyAAAAAd0SU1FB9gBEgI0L+a2mIYAAAATSURBVDhPYxgFo2AUjAIwYGAAAAQQAAGnRHxj - AAAAAElFTkSuQmCC - - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m - dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAVhSURBVFhHvZZraJtlFMdfKAyEgW16Sy9JL2mTJWlu - TS9Jb0naBrvqREWc+GFtKVtx7JMoOhxFbWthHzamMCwMXbdVh4JfnHSu4mAXWcXN2k2YrIN1c1acUhC0 - m9tyPP/HPfF50mxZp/jhR96T93nP/zznnOdiEFGSa4s/rxhrmdUoLy/fzr+rLRaLkQlVD2hGOoFMVFZW - Gn6//7rL5brEgYQhUmopvSuqHtCMdAKZqLZXG9FoNBEKh8jr9d62VdmGrVbrqnTiQNUDmpFOIBN2u93o - jHcm2jvaqaW1hQK1AXKsccyUlZU5hGipjqoHNCOdQCaQgY7OjgQHQSASjVBDYwO5a9xLFRUVL4iS/FcB - WKwWV3lF+aDNZjteXV39B4uTx+Oh5pZm4iBEAPiNxWIUbgqTz+ejquqqI1ySkpLSEgOoekAz0okCFq7i - Zju4xrlGOK2rr6PGUKMQgXg0FhXCKrH2mChJMBgkbtDfuEGfe6AMlJWXrWfhpUAgQGi01rZWkWYIoO73 - AmPaIm3U2NhINTU1xJOYUPWAZqSKc7pfcbvdoqYQxkzhdKUg4Hg8TvsOjH+h6gHNUMV55k9zI4lUy1k/ - EJEI9fT20LnzZxfZb5eqBzRDiqPmPPMbcuZIowT13fnWTjr+5THisYL4I3FtjATfDr42SFcWLp/hcdb7 - 3gn9Af9nwbqgaDA4kfT09dCZ2dNLPGaYCWMs94fBM02o4wBSv39iHwLcwzxUUlJiFBUVaXpAM+CQl4zV - 4/UkQqGQCECyaWAj/fTLwlc8xoFxEu5ug98n1LHrHl9HJ6dPXOf3m3BWFBUXGWazWaDqAc2AQ146Q9jN - sMSampsEkViEvr94/hi/z5LCEu4Vg8ck5NiB5wdo7tKFK/wuiGVnLjIbhebCJKoe0Aw4jMYic1jnCABg - 6Q2/OXSD35mkqApvuQaPS6BZd+zagSxN8f+m4uLiv0ULdVQ9oBlwWN9Qf5MR3Q/QCxMfHHhfFVXhihlc - 79uHJj9BvV9nspDqgsICo6BgOaoe0Aw4rPHUEALACgDckDRz7psOKZgKttdvv5u5ys+PotEwy3TCElUP - aAYvvyxuQBGAxOvz0tiedx5OFZYgzfxrRYdDIL8g/56oekAz2FFWuCkk0i5BRjgTTlVUJT+fHd8hLz8v - I6oe0Aw4XP/sMzexCmqDtQIEwFvwYKqwJC+PHafCQtwD+dyIt7hEJOHl+IOqBzQDDl96+cV5n98nLhYA - JXF73Iuc6rRlSBcAsuFwOMZxXLvcLoHT6aT+jf2/q3pAM+Dw8NTkGM4ABAH4mkXsjCptlROp4iA3N1cn - LxcbTpzHi+xJP3h+b/zd+zqMHH39fWLmaECAgOCQN5VRFlilBmDKNSVBANyIXXwv/BV3B9XH2u61OBO6 - VT2gGdLpyVMnjvo5ajgAiB4O+XgmrutZrnFLMgDTHfG8XDMvwTFeSWR32EXQ8ns8f/Txh/M8PkvVA5oh - nTJVu8d238KHEAd4RhB8HSO+bCIbCyz4NXOE+2OW9wARoBRXv9s2+Co2qS70h6oHNEMJAGwZGnlDNBCc - SJwupxDhu54oC99yiFNOaDgEqI7H8+Ytm2nh2o+7sEcgW6oe0IyUAMDo3v17RQ1lN0sQiIC7G7/p3o9u - H8XMDzJZEM/JydH0gGYowiq906dP/bmhd8M/ohl48qkn6POjU+JskDPPzskWqHpAM1KEVVzMJG5BI6Mj - 1P1Y9zLRzngHbd22lT49fAjC00wLNqQcU05S/N8EIAkyuA3NMnT56jxdnJ+DILjAvM3EsecnZ52to+oB - zeCPV8pqxoSjF7sfNqG7CUtUPbDsj/8XMv4C4EU4InvAOU4AAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m - dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ8SURBVDhPdZJNaBNREMcfFAIFofnaTbJJdpNsNnTz - 0SbSbLKbbL6gxUvxUMRbq5TGU1EJngTxUMWLp+LBS0FBISAFsVoiCAqpFhEvOXi1FRT0UFAoKJZx5km2 - Vujhz+PNx2/mzRsWjUaPlazILBaP3VcU5cT/PgDgYpFo5Fipqsoy2QykM+mPCKpT4tB3CIigYSh0YDUj - oSbWNU37kcvloGyWoVQuQTaXBbTfjspRF8U6gHA4zIXJrng8voLVDgonCzypUq1Ao9ngsioW5At5SKVS - A1mW0w5AkiRePakl13ITWLFcBrtm86Rmq+mI7gRcOL/wfWPzSekIIBaLtahd0zR58vLFZdja7sO3va9g - 2zbUG3Wo1WuwemeVbBuoMQdA7VuWtTVVnOIV2heWKGgTZei6zopGEWZOzUDvRY/s17AYL+oAaHDFUvGn - UTKA9Kz39B1OnIWkEFNiCps7MweDD4M9TJ6m2GAwyAKBwCEApzpCb6dkGt6bt69boVCIiaLIwpEw2/28 - 8x6TZQKKAZHbSQ4AnSOmZQI9gUCzp2czFCAIAk9A/yhVRNtoIBhoYwdtvJ91AFJYYvPn5n/RF9HSZCey - 64IoML/f74hg+MXXcUcAnwdVu9p3AEhlD7sPtqk6LYuaVAHbvesX/GM+n48ALqx6Fbfy97g+DqTuo+5z - B4CB1Ob05c4lDtDTOiQSCcD3A85iBzvkVSmROuxc6dBvVB2A1+vlQ/n0ZffezVs3OISCtZQGuFz8HCaT - H+PWjgzR7XFzCFJdqJVX/ZcHi0uLMJmf5N3QSXeyk5/iPF7PPwC3m8vj8fCBYYCBeozaR1G7dNLdID/F - UfxfALA//kaIMNcH69EAAAAASUVORK5CYII= - - - \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/ToastNotificationMenu.Designer.cs b/Source/Krypton Toolkit/Examples/ToastNotificationMenu.Designer.cs new file mode 100644 index 000000000..ba8bd2a2a --- /dev/null +++ b/Source/Krypton Toolkit/Examples/ToastNotificationMenu.Designer.cs @@ -0,0 +1,101 @@ +namespace Examples +{ + partial class ToastNotificationMenu + { + /// + /// 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.kbtnQuickNotificationTest = new Krypton.Toolkit.KryptonButton(); + this.kbtnUserInputNotification = new Krypton.Toolkit.KryptonButton(); + this.kbtnBasicNotification = new Krypton.Toolkit.KryptonButton(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + this.kryptonPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // kryptonPanel1 + // + this.kryptonPanel1.Controls.Add(this.kbtnQuickNotificationTest); + this.kryptonPanel1.Controls.Add(this.kbtnUserInputNotification); + this.kryptonPanel1.Controls.Add(this.kbtnBasicNotification); + 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(320, 229); + this.kryptonPanel1.TabIndex = 1; + // + // kbtnQuickNotificationTest + // + this.kbtnQuickNotificationTest.Location = new System.Drawing.Point(13, 75); + this.kbtnQuickNotificationTest.Name = "kbtnQuickNotificationTest"; + this.kbtnQuickNotificationTest.Size = new System.Drawing.Size(291, 25); + this.kbtnQuickNotificationTest.TabIndex = 2; + this.kbtnQuickNotificationTest.Values.DropDownArrowColor = System.Drawing.Color.Empty; + this.kbtnQuickNotificationTest.Values.Text = "Quick Notification Test"; + // + // kbtnUserInputNotification + // + this.kbtnUserInputNotification.Location = new System.Drawing.Point(13, 44); + this.kbtnUserInputNotification.Name = "kbtnUserInputNotification"; + this.kbtnUserInputNotification.Size = new System.Drawing.Size(291, 25); + this.kbtnUserInputNotification.TabIndex = 1; + this.kbtnUserInputNotification.Values.DropDownArrowColor = System.Drawing.Color.Empty; + this.kbtnUserInputNotification.Values.Text = "User Input Notification"; + // + // kbtnBasicNotification + // + this.kbtnBasicNotification.Location = new System.Drawing.Point(13, 13); + this.kbtnBasicNotification.Name = "kbtnBasicNotification"; + this.kbtnBasicNotification.Size = new System.Drawing.Size(291, 25); + this.kbtnBasicNotification.TabIndex = 0; + this.kbtnBasicNotification.Values.DropDownArrowColor = System.Drawing.Color.Empty; + this.kbtnBasicNotification.Values.Text = "Basic Notification"; + this.kbtnBasicNotification.Click += new System.EventHandler(this.kbtnBasicNotification_Click); + // + // ToastNotificationMenu + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(320, 229); + this.Controls.Add(this.kryptonPanel1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; + this.MaximizeBox = false; + this.Name = "ToastNotificationMenu"; + this.Text = "ToastNotificationMenu"; + ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + this.kryptonPanel1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private KryptonPanel kryptonPanel1; + private KryptonButton kbtnQuickNotificationTest; + private KryptonButton kbtnUserInputNotification; + private KryptonButton kbtnBasicNotification; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Examples/ToastNotificationMenu.cs b/Source/Krypton Toolkit/Examples/ToastNotificationMenu.cs new file mode 100644 index 000000000..4be31d637 --- /dev/null +++ b/Source/Krypton Toolkit/Examples/ToastNotificationMenu.cs @@ -0,0 +1,56 @@ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Examples +{ + public partial class ToastNotificationMenu : KryptonForm + { + public ToastNotificationMenu() + { + InitializeComponent(); + } + + private void kbtnBasicNotification_Click(object sender, EventArgs e) + { + var basicNotification = new BasicToastNotificationTest(); + + basicNotification.Show(); + } + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/UX/PlotViewer.resx b/Source/Krypton Toolkit/Examples/ToastNotificationMenu.resx similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/UX/PlotViewer.resx rename to Source/Krypton Toolkit/Examples/ToastNotificationMenu.resx diff --git a/Source/Krypton Toolkit/Examples/ToolBoxExample.Designer.cs b/Source/Krypton Toolkit/Examples/ToolBoxExample.Designer.cs index 55a0c8fa6..44d62110d 100644 --- a/Source/Krypton Toolkit/Examples/ToolBoxExample.Designer.cs +++ b/Source/Krypton Toolkit/Examples/ToolBoxExample.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class ToolBoxExample { diff --git a/Source/Krypton Toolkit/Examples/ToolBoxExample.cs b/Source/Krypton Toolkit/Examples/ToolBoxExample.cs index 87c6460e1..3c4d9e01b 100644 --- a/Source/Krypton Toolkit/Examples/ToolBoxExample.cs +++ b/Source/Krypton Toolkit/Examples/ToolBoxExample.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { public partial class ToolBoxExample : KryptonForm { diff --git a/Source/Krypton Toolkit/Examples/ToolStripItems.Designer.cs b/Source/Krypton Toolkit/Examples/ToolStripItems.Designer.cs index c0129b3a8..335528b8b 100644 --- a/Source/Krypton Toolkit/Examples/ToolStripItems.Designer.cs +++ b/Source/Krypton Toolkit/Examples/ToolStripItems.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class ToolStripItems { diff --git a/Source/Krypton Toolkit/Examples/ToolStripItems.cs b/Source/Krypton Toolkit/Examples/ToolStripItems.cs index 728bc83f9..fa28f5526 100644 --- a/Source/Krypton Toolkit/Examples/ToolStripItems.cs +++ b/Source/Krypton Toolkit/Examples/ToolStripItems.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { public partial class ToolStripItems : KryptonForm { diff --git a/Source/Krypton Toolkit/Examples/TreeGridViewAdvancedExample.Designer.cs b/Source/Krypton Toolkit/Examples/TreeGridViewAdvancedExample.Designer.cs index 4cf43a83c..f7eb51ee0 100644 --- a/Source/Krypton Toolkit/Examples/TreeGridViewAdvancedExample.Designer.cs +++ b/Source/Krypton Toolkit/Examples/TreeGridViewAdvancedExample.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class TreeGridViewAdvancedExample { @@ -57,7 +85,6 @@ private void InitializeComponent() // // kbtnDataSource // - this.kbtnDataSource.CornerRoundingRadius = -1F; this.kbtnDataSource.Location = new System.Drawing.Point(576, 41); this.kbtnDataSource.Name = "kbtnDataSource"; this.kbtnDataSource.Size = new System.Drawing.Size(212, 31); @@ -67,7 +94,6 @@ private void InitializeComponent() // // kryptonThemeComboBox1 // - this.kryptonThemeComboBox1.CornerRoundingRadius = -1F; this.kryptonThemeComboBox1.CueHint.Padding = new System.Windows.Forms.Padding(0); this.kryptonThemeComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.kryptonThemeComboBox1.DropDownWidth = 212; diff --git a/Source/Krypton Toolkit/Examples/TreeGridViewAdvancedExample.cs b/Source/Krypton Toolkit/Examples/TreeGridViewAdvancedExample.cs index 5605ef1e9..827667a47 100644 --- a/Source/Krypton Toolkit/Examples/TreeGridViewAdvancedExample.cs +++ b/Source/Krypton Toolkit/Examples/TreeGridViewAdvancedExample.cs @@ -1,13 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion using Krypton.Toolkit.Suite.Extended.TreeGridView; #pragma warning disable CS8602 diff --git a/Source/Krypton Toolkit/Examples/TreeGridViewDataSourceExample.Designer.cs b/Source/Krypton Toolkit/Examples/TreeGridViewDataSourceExample.Designer.cs index b4cef5f39..2429379d2 100644 --- a/Source/Krypton Toolkit/Examples/TreeGridViewDataSourceExample.Designer.cs +++ b/Source/Krypton Toolkit/Examples/TreeGridViewDataSourceExample.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class TreeGridViewDataSourceExample { @@ -153,11 +181,7 @@ private void InitializeComponent() // // kryptonPropertyGrid1 // - this.kryptonPropertyGrid1.CategoryForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); this.kryptonPropertyGrid1.Font = new System.Drawing.Font("Segoe UI", 9F); - this.kryptonPropertyGrid1.HelpBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(206)))), ((int)(((byte)(230))))); - this.kryptonPropertyGrid1.HelpForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); - this.kryptonPropertyGrid1.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(179)))), ((int)(((byte)(196)))), ((int)(((byte)(216))))); this.kryptonPropertyGrid1.Location = new System.Drawing.Point(607, 9); this.kryptonPropertyGrid1.Name = "kryptonPropertyGrid1"; this.kryptonPropertyGrid1.SelectedObject = this.kryptonTreeGridView1; diff --git a/Source/Krypton Toolkit/Examples/TreeGridViewDataSourceExample.cs b/Source/Krypton Toolkit/Examples/TreeGridViewDataSourceExample.cs index cdd13b087..dd30857fd 100644 --- a/Source/Krypton Toolkit/Examples/TreeGridViewDataSourceExample.cs +++ b/Source/Krypton Toolkit/Examples/TreeGridViewDataSourceExample.cs @@ -1,12 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; namespace Examples { diff --git a/Source/Krypton Toolkit/Examples/TreeGridViewExample.Designer.cs b/Source/Krypton Toolkit/Examples/TreeGridViewExample.Designer.cs index 8405ea208..3174db325 100644 --- a/Source/Krypton Toolkit/Examples/TreeGridViewExample.Designer.cs +++ b/Source/Krypton Toolkit/Examples/TreeGridViewExample.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class TreeGridViewExample { diff --git a/Source/Krypton Toolkit/Examples/TreeGridViewExample.cs b/Source/Krypton Toolkit/Examples/TreeGridViewExample.cs index 1c0449911..cc6737b92 100644 --- a/Source/Krypton Toolkit/Examples/TreeGridViewExample.cs +++ b/Source/Krypton Toolkit/Examples/TreeGridViewExample.cs @@ -1,13 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion using System.Data; using System.Data.SQLite; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; namespace Examples { diff --git a/Source/Krypton Toolkit/Examples/WizardExample.Designer.cs b/Source/Krypton Toolkit/Examples/WizardExample.Designer.cs index eeca8834c..ebf334796 100644 --- a/Source/Krypton Toolkit/Examples/WizardExample.Designer.cs +++ b/Source/Krypton Toolkit/Examples/WizardExample.Designer.cs @@ -1,4 +1,32 @@ -namespace Examples +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion +namespace Examples { partial class WizardExample { diff --git a/Source/Krypton Toolkit/Examples/WizardExample.cs b/Source/Krypton Toolkit/Examples/WizardExample.cs index 0f9d2aae5..5194b8e92 100644 --- a/Source/Krypton Toolkit/Examples/WizardExample.cs +++ b/Source/Krypton Toolkit/Examples/WizardExample.cs @@ -1,6 +1,31 @@ -using Krypton.Toolkit.Suite.Extended.TreeGridView; -using Krypton.Toolkit.Suite.Extended.Wizard; +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion namespace Examples { public partial class WizardExample : KryptonForm diff --git a/Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022 - Dev.sln b/Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022 - Dev.sln new file mode 100644 index 000000000..1a580e81c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022 - Dev.sln @@ -0,0 +1,834 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31825.309 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Main", "Main", "{252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Repository Items", "Repository Items", "{5D85B551-9AFC-4E96-93C3-D8D81B69971F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build System", "Build System", "{87BE2145-50BE-4A57-9C79-FCE5A64F6065}" + ProjectSection(SolutionItems) = preProject + ..\..\build.cmd = ..\..\build.cmd + ..\..\build.proj = ..\..\build.proj + ..\..\debug.cmd = ..\..\debug.cmd + ..\..\debug.proj = ..\..\debug.proj + ..\..\purge.cmd = ..\..\purge.cmd + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Markdown", "Markdown", "{A7A69BC2-7682-43FB-8E7C-C42FDAA2A215}" + ProjectSection(SolutionItems) = preProject + ..\..\Documents\Help\Changelog.md = ..\..\Documents\Help\Changelog.md + ..\..\Documents\Examples\Examples.md = ..\..\Documents\Examples\Examples.md + ..\..\Documents\Modules\NuGet Package Information.md = ..\..\Documents\Modules\NuGet Package Information.md + ..\..\Documents\Help\Prerequisites.md = ..\..\Documents\Help\Prerequisites.md + ..\..\README.md = ..\..\README.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Assets", "Assets", "{6B01F113-016E-445F-BE5E-80BA7144B928}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\ToggleSwich.bmp = ..\..\Assets\ToggleSwich.bmp + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{404EC0E7-92CB-4E90-80F7-440A4F5D772C}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\Examples\CircularProgressBar.png = ..\..\Assets\Examples\CircularProgressBar.png + ..\..\Assets\Examples\CommandLinks.png = ..\..\Assets\Examples\CommandLinks.png + ..\..\Assets\Examples\ExtendedKryptonMessageBox1.png = ..\..\Assets\Examples\ExtendedKryptonMessageBox1.png + ..\..\Assets\Examples\ExtendedKryptonMessageBox2.png = ..\..\Assets\Examples\ExtendedKryptonMessageBox2.png + ..\..\Assets\Examples\FloatableToolStrip.png = ..\..\Assets\Examples\FloatableToolStrip.png + ..\..\Assets\Examples\FlotableMenuStrip.png = ..\..\Assets\Examples\FlotableMenuStrip.png + ..\..\Assets\Examples\KryptonColourMixer.png = ..\..\Assets\Examples\KryptonColourMixer.png + ..\..\Assets\Examples\KryptonColourWheel.png = ..\..\Assets\Examples\KryptonColourWheel.png + ..\..\Assets\Examples\KryptonInputBoxExtended.png = ..\..\Assets\Examples\KryptonInputBoxExtended.png + ..\..\Assets\Examples\KryptonKnobControl.png = ..\..\Assets\Examples\KryptonKnobControl.png + ..\..\Assets\Examples\KryptonPaletteColourShader.png = ..\..\Assets\Examples\KryptonPaletteColourShader.png + ..\..\Assets\Examples\KryptonPropertyGrid.png = ..\..\Assets\Examples\KryptonPropertyGrid.png + ..\..\Assets\Examples\KryptonScrollBars.png = ..\..\Assets\Examples\KryptonScrollBars.png + ..\..\Assets\Examples\KryptonThemeSelector.png = ..\..\Assets\Examples\KryptonThemeSelector.png + ..\..\Assets\Examples\KryptonToastNotificationV1.png = ..\..\Assets\Examples\KryptonToastNotificationV1.png + ..\..\Assets\Examples\KryptonToggleSwitch.png = ..\..\Assets\Examples\KryptonToggleSwitch.png + ..\..\Assets\Examples\KryptonViewBar.png = ..\..\Assets\Examples\KryptonViewBar.png + ..\..\Assets\Examples\TreeViews.png = ..\..\Assets\Examples\TreeViews.png + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ICO", "ICO", "{734B2F67-D055-44B2-818A-FE569C479937}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "JPEG", "JPEG", "{15346861-5444-49D7-9686-3835EE271259}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "License", "License", "{5E13A5BB-407A-46A5-95A8-9DA57FB21C6C}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\License\LICENSE.md = ..\..\Assets\License\LICENSE.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Package Icon", "Package Icon", "{6EFEF411-B16C-4DEA-992F-9CA767EB1265}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\Package Icon\Canary_Icon_128_x_128.png = ..\..\Assets\Package Icon\Canary_Icon_128_x_128.png + ..\..\Assets\Package Icon\Stable_Icon_128_x_128.png = ..\..\Assets\Package Icon\Stable_Icon_128_x_128.png + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PNG", "PNG", "{F96630C5-2A89-44D5-BED6-99609A6D716A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PSD", "PSD", "{247BBF4E-22B0-49CC-981B-0420AD7FF4E8}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\PSD\Command Link Button.psd = ..\..\Assets\PSD\Command Link Button.psd + ..\..\Assets\PSD\Main Icon 512 x 512 Canary.psd = ..\..\Assets\PSD\Main Icon 512 x 512 Canary.psd + ..\..\Assets\PSD\Main Icon 512 x 512 Nightly.psd = ..\..\Assets\PSD\Main Icon 512 x 512 Nightly.psd + ..\..\Assets\PSD\PE Icon 512 x 512.psd = ..\..\Assets\PSD\PE Icon 512 x 512.psd + ..\..\Assets\PSD\Square Design 512 x 512 Orange.psd = ..\..\Assets\PSD\Square Design 512 x 512 Orange.psd + ..\..\Assets\PSD\ToggleSwich.psd = ..\..\Assets\PSD\ToggleSwich.psd + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "48 x 48", "48 x 48", "{071034AA-BFA3-4325-B763-E95A2E05EF4D}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\ICO\48 x 48\KR 48 x 48 Orange.ico = ..\..\Assets\ICO\48 x 48\KR 48 x 48 Orange.ico + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "256 x 256", "256 x 256", "{378BEE59-0131-4497-80B8-69B3124325D7}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\ICO\256 x 256\KR 256 x 256 Orange.ico = ..\..\Assets\ICO\256 x 256\KR 256 x 256 Orange.ico + ..\..\Assets\ICO\256 x 256\PE Icon 256 x 256.ico = ..\..\Assets\ICO\256 x 256\PE Icon 256 x 256.ico + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "48 x 48", "48 x 48", "{69F98672-EBB9-4B12-BD04-45AEF3C37FC6}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\JPEG\48 x 48\Logo Stable.jpg = ..\..\Assets\JPEG\48 x 48\Logo Stable.jpg + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Arrows", "Arrows", "{0451E883-C718-4679-962F-E2825B1513B2}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\PSD\Arrows\Arrow-1.psd = ..\..\Assets\PSD\Arrows\Arrow-1.psd + ..\..\Assets\PSD\Arrows\Arrow-2.psd = ..\..\Assets\PSD\Arrows\Arrow-2.psd + ..\..\Assets\PSD\Arrows\Arrow-3.psd = ..\..\Assets\PSD\Arrows\Arrow-3.psd + ..\..\Assets\PSD\Arrows\Arrow-4.psd = ..\..\Assets\PSD\Arrows\Arrow-4.psd + ..\..\Assets\PSD\Arrows\Template.psd = ..\..\Assets\PSD\Arrows\Template.psd + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FDDE0872-007C-4945-9D20-C9011C37204B}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + .nuspec = .nuspec + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Core 2022", "Krypton.Toolkit.Suite.Extended.Core\Krypton.Toolkit.Suite.Extended.Core 2022.csproj", "{E68C45C0-418B-4CFC-97C0-282798B38B37}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Common 2022", "Krypton.Toolkit.Suite.Extended.Common\Krypton.Toolkit.Suite.Extended.Common 2022.csproj", "{57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Developer.Utilities 2022", "Krypton.Toolkit.Suite.Extended.Developer.Utilities\Krypton.Toolkit.Suite.Extended.Developer.Utilities 2022.csproj", "{58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Drawing 2022", "Krypton.Toolkit.Suite.Extended.Drawing\Krypton.Toolkit.Suite.Extended.Drawing 2022.csproj", "{9CB33D7B-BF7E-4221-859D-5E61E24772E3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Effects 2022", "Krypton.Toolkit.Suite.Extended.Effects\Krypton.Toolkit.Suite.Extended.Effects 2022.csproj", "{B47A7562-B3B5-4521-91DB-E5CC4CC986E3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Global.Utilities 2022", "Krypton.Toolkit.Suite.Extended.Global.Utilities\Krypton.Toolkit.Suite.Extended.Global.Utilities 2022.csproj", "{B9A5A472-F747-4C87-B5E9-C5A05DB17827}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Language.Model 2022", "Krypton.Toolkit.Suite.Extended.Language.Model\Krypton.Toolkit.Suite.Extended.Language.Model 2022.csproj", "{81BCFC34-220F-43A8-A58B-8F9E123C72E1}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Resources 2022", "Krypton.Toolkit.Suite.Extended.Resources\Krypton.Toolkit.Suite.Extended.Resources 2022.csproj", "{4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Settings 2022", "Krypton.Toolkit.Suite.Extended.Settings\Krypton.Toolkit.Suite.Extended.Settings 2022.csproj", "{C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Tools 2022", "Krypton.Toolkit.Suite.Extended.Tools\Krypton.Toolkit.Suite.Extended.Tools 2022.csproj", "{CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Utilities 2022", "Krypton.Toolkit.Suite.Extended.Utilities\Krypton.Toolkit.Suite.Extended.Utilities 2022.csproj", "{E66AA060-36AC-4C48-98B5-41701F5524A6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.File.Explorer 2022", "Krypton.Toolkit.Suite.Extended.File.Explorer\Krypton.Toolkit.Suite.Extended.File.Explorer 2022.csproj", "{1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Gages 2022", "Krypton.Toolkit.Suite.Extended.Gages\Krypton.Toolkit.Suite.Extended.Gages 2022.csproj", "{7E1B169E-AD04-4C98-9971-DC7F450BF610}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Palette.Selectors 2022", "Krypton.Toolkit.Suite.Extended.Palette.Selectors\Krypton.Toolkit.Suite.Extended.Palette.Selectors 2022.csproj", "{4545427A-2FD5-441A-A35E-F09F2AB1B20D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.TaskDialogs 2022", "Krypton.Toolkit.Suite.Extended.TaskDialogs\Krypton.Toolkit.Suite.Extended.TaskDialogs 2022.csproj", "{116CDDE3-823F-486E-B0AC-2F0FE810A7EF}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Generic", "Generic", "{4696C160-BC97-414A-8D30-B09A2CA76085}" + ProjectSection(SolutionItems) = preProject + ..\..\Directory.Build.props = ..\..\Directory.Build.props + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Generate Packages", "Generate Packages", "{9ACA6117-D269-4425-8500-6BC57560DEB2}" + ProjectSection(SolutionItems) = preProject + Directory.Build.props = Directory.Build.props + Directory.Build.targets = Directory.Build.targets + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Miscellaneous", "Miscellaneous", "{241C9BD1-CB7D-4AF0-8FDB-3BCB4C98AF51}" + ProjectSection(SolutionItems) = preProject + ..\.editorconfig = ..\.editorconfig + Directory.Build.props = Directory.Build.props + Directory.Build.targets = Directory.Build.targets + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{0703388D-5FBE-4345-94B0-5FA9FD043079}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Shared 2022", "Krypton.Toolkit.Suite.Extended.Shared\Krypton.Toolkit.Suite.Extended.Shared 2022.csproj", "{0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{5DB6B467-9257-42D3-B81F-380B5D537C04}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Schemas", "Schemas", "{1AD413AC-FAD3-4F79-A948-4FB66AF10685}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\NuGet\Schemas\Krypton.Toolkit.Suite.Extended.Lite.nuspec = ..\..\Assets\NuGet\Schemas\Krypton.Toolkit.Suite.Extended.Lite.nuspec + ..\..\Assets\NuGet\Schemas\Krypton.Toolkit.Suite.Extended.nuspec = ..\..\Assets\NuGet\Schemas\Krypton.Toolkit.Suite.Extended.nuspec + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Themes 2022", "Krypton.Toolkit.Suite.Extended.Themes\Krypton.Toolkit.Suite.Extended.Themes 2022.csproj", "{A58A93DE-0CBF-495B-8D29-761B1143AD32}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "License", "License", "{BA86BDC7-D11C-4E74-875C-B284E740B599}" + ProjectSection(SolutionItems) = preProject + ..\..\Documents\License\License.md = ..\..\Documents\License\License.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Projects to Work On", "Projects to Work On", "{ADF53878-BE1F-43A3-A890-E11190BE5465}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.PDF 2022", "Krypton.Toolkit.Suite.Extended.PDF\Krypton.Toolkit.Suite.Extended.PDF 2022.csproj", "{A59A87BE-E92A-4717-92DC-A2286EE812EC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples", "Examples\Examples.csproj", "{744D6A50-F8DB-4D5F-B571-34B0597E03B8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Scintilla.NET 2022", "Krypton.Toolkit.Suite.Extended.Scintilla.NET\Krypton.Toolkit.Suite.Extended.Scintilla.NET 2022.csproj", "{BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.CheckSum.Tools 2022", "Krypton.Toolkit.Suite.Extended.CheckSum.Tools\Krypton.Toolkit.Suite.Extended.CheckSum.Tools 2022.csproj", "{26A8A753-BC4B-4E42-B124-8EA3FA64303F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Circular.ProgressBar 2022", "Krypton.Toolkit.Suite.Extended.Circular.ProgressBar\Krypton.Toolkit.Suite.Extended.Circular.ProgressBar 2022.csproj", "{7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.ComboBox 2022", "Krypton.Toolkit.Suite.Extended.ComboBox\Krypton.Toolkit.Suite.Extended.ComboBox 2022.csproj", "{253E37F3-A36F-4D96-B22E-1D50C31C0D2D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Controls 2022", "Krypton.Toolkit.Suite.Extended.Controls\Krypton.Toolkit.Suite.Extended.Controls 2022.csproj", "{C4D0363C-6CA9-4D47-B896-D287C1E6BD11}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Data.Visualisation 2022", "Krypton.Toolkit.Suite.Extended.Data.Visualisation\Krypton.Toolkit.Suite.Extended.Data.Visualisation 2022.csproj", "{558D7C96-4E2D-4679-8D1A-508E734855D8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Dialogs 2022", "Krypton.Toolkit.Suite.Extended.Dialogs\Krypton.Toolkit.Suite.Extended.Dialogs 2022.csproj", "{3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Dock.Extender 2022", "Krypton.Toolkit.Suite.Extended.Dock.Extender\Krypton.Toolkit.Suite.Extended.Dock.Extender 2022.csproj", "{AA363B11-8B13-4333-85E1-8623D21E1202}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Error.Reporting 2022", "Krypton.Toolkit.Suite.Extended.Error.Reporting\Krypton.Toolkit.Suite.Extended.Error.Reporting 2022.csproj", "{3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.File.Copier 2022", "Krypton.Toolkit.Suite.Extended.File.Copier\Krypton.Toolkit.Suite.Extended.File.Copier 2022.csproj", "{14542128-1DF0-44DB-9365-1FF39324B317}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Floating.Toolbars 2022", "Krypton.Toolkit.Suite.Extended.Floating.Toolbars\Krypton.Toolkit.Suite.Extended.Floating.Toolbars 2022.csproj", "{4804A209-411D-43E5-B104-77D6A19131E2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Messagebox 2022", "Krypton.Toolkit.Suite.Extended.Messagebox\Krypton.Toolkit.Suite.Extended.Messagebox 2022.csproj", "{FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Memory.Box 2022", "Krypton.Toolkit.Suite.Extended.Memory.Box\Krypton.Toolkit.Suite.Extended.Memory.Box 2022.csproj", "{4C448625-CBCB-4147-9288-659906B17C28}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Navi.Suite 2022", "Krypton.Toolkit.Suite.Extended.Navi.Suite\Krypton.Toolkit.Suite.Extended.Navi.Suite 2022.csproj", "{AA7EBA51-F1BA-4A45-9344-22F4E173109A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Navigator 2022", "Krypton.Toolkit.Suite.Extended.Navigator\Krypton.Toolkit.Suite.Extended.Navigator 2022.csproj", "{65DDD9BE-D9BB-456A-97D4-D0B75607F657}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Networking 2022", "Krypton.Toolkit.Suite.Extended.Networking\Krypton.Toolkit.Suite.Extended.Networking 2022.csproj", "{B9D53724-D2C8-4067-8146-15C04533BAE3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Notifications 2022", "Krypton.Toolkit.Suite.Extended.Notifications\Krypton.Toolkit.Suite.Extended.Notifications 2022.csproj", "{A7DFFED4-3872-491C-B560-C8E4E4733A4D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Outlook.Grid 2022", "Krypton.Toolkit.Suite.Extended.Outlook.Grid\Krypton.Toolkit.Suite.Extended.Outlook.Grid 2022.csproj", "{9B5D60B1-765A-4793-92C4-23E8F8A76A77}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Drawing.Utilities 2022", "Krypton.Toolkit.Suite.Extended.Drawing.Utilities\Krypton.Toolkit.Suite.Extended.Drawing.Utilities 2022.csproj", "{F33622D3-84D1-4C58-9241-45243882739C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.IO 2022", "Krypton.Toolkit.Suite.Extended.IO\Krypton.Toolkit.Suite.Extended.IO 2022.csproj", "{62253CD1-5FFB-4B07-82E9-00C978A96478}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Software.Updater 2022", "Krypton.Toolkit.Suite.Extended.Software.Updater\Krypton.Toolkit.Suite.Extended.Software.Updater 2022.csproj", "{A5FA199B-9AA4-4061-AE07-3036A115AA24}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Specialised.Dialogs 2022", "Krypton.Toolkit.Suite.Extended.Specialised.Dialogs\Krypton.Toolkit.Suite.Extended.Specialised.Dialogs 2022.csproj", "{2C946C86-12F4-40A3-B964-09C71DA3B845}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Software.Updater.Core 2022", "Krypton.Toolkit.Suite.Extended.Software.Updater.Core\Krypton.Toolkit.Suite.Extended.Software.Updater.Core 2022.csproj", "{5C2389E8-1198-48D2-BDCC-44F74BE6B294}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ZipExtractor", "ZipExtractor\ZipExtractor.csproj", "{1126FD6E-8A3E-4C93-AABB-06073B27EB75}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Applications", "Applications", "{4985A154-8526-4CB0-A7DC-B39736C4A8AC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoUpdateCreator", "AutoUpdateCreator\AutoUpdateCreator.csproj", "{975DA9CB-501F-442E-8339-AF625C7A5DA4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub", "GitHub", "{5D204922-259D-4140-B115-F01EDF031B5A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Issue Templates", "Issue Templates", "{362F24FA-1AA0-4821-A539-C5A863D39B8B}" + ProjectSection(SolutionItems) = preProject + ..\..\.github\ISSUE_TEMPLATE\bug_report.md = ..\..\.github\ISSUE_TEMPLATE\bug_report.md + ..\..\.github\ISSUE_TEMPLATE\feature-request.md = ..\..\.github\ISSUE_TEMPLATE\feature-request.md + ..\..\.github\ISSUE_TEMPLATE\other-issues.md = ..\..\.github\ISSUE_TEMPLATE\other-issues.md + ..\..\.github\ISSUE_TEMPLATE\post-a-question.md = ..\..\.github\ISSUE_TEMPLATE\post-a-question.md + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Docking 2022", "..\..\..\Standard-Toolkit\Source\Krypton Components\Krypton.Docking\Krypton.Docking 2022.csproj", "{8F8E1B19-EFA1-4BC2-AEB3-8985B07A6A2B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Navigator 2022", "..\..\..\Standard-Toolkit\Source\Krypton Components\Krypton.Navigator\Krypton.Navigator 2022.csproj", "{39E6D9FC-E30F-4F4A-9EAC-F1234226FE2E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Ribbon 2022", "..\..\..\Standard-Toolkit\Source\Krypton Components\Krypton.Ribbon\Krypton.Ribbon 2022.csproj", "{B48CAFB1-659A-4898-8004-3F909B788E56}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit 2022", "..\..\..\Standard-Toolkit\Source\Krypton Components\Krypton.Toolkit\Krypton.Toolkit 2022.csproj", "{76250480-3D16-4CC7-9F38-18EA880B8150}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Workspace 2022", "..\..\..\Standard-Toolkit\Source\Krypton Components\Krypton.Workspace\Krypton.Workspace 2022.csproj", "{3CD6AC31-4080-4E66-B3C5-91068408765A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Canary|Any CPU = Canary|Any CPU + Debug|Any CPU = Debug|Any CPU + Installer|Any CPU = Installer|Any CPU + Nightly|Any CPU = Nightly|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E68C45C0-418B-4CFC-97C0-282798B38B37}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {E68C45C0-418B-4CFC-97C0-282798B38B37}.Canary|Any CPU.Build.0 = Canary|Any CPU + {E68C45C0-418B-4CFC-97C0-282798B38B37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E68C45C0-418B-4CFC-97C0-282798B38B37}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E68C45C0-418B-4CFC-97C0-282798B38B37}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {E68C45C0-418B-4CFC-97C0-282798B38B37}.Installer|Any CPU.Build.0 = Release|Any CPU + {E68C45C0-418B-4CFC-97C0-282798B38B37}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {E68C45C0-418B-4CFC-97C0-282798B38B37}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {E68C45C0-418B-4CFC-97C0-282798B38B37}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E68C45C0-418B-4CFC-97C0-282798B38B37}.Release|Any CPU.Build.0 = Release|Any CPU + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Canary|Any CPU.Build.0 = Canary|Any CPU + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Debug|Any CPU.Build.0 = Debug|Any CPU + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Installer|Any CPU.Build.0 = Release|Any CPU + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Release|Any CPU.ActiveCfg = Release|Any CPU + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Release|Any CPU.Build.0 = Release|Any CPU + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Canary|Any CPU.Build.0 = Canary|Any CPU + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Installer|Any CPU.Build.0 = Release|Any CPU + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Release|Any CPU.Build.0 = Release|Any CPU + {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Canary|Any CPU.Build.0 = Canary|Any CPU + {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Installer|Any CPU.Build.0 = Release|Any CPU + {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Release|Any CPU.Build.0 = Release|Any CPU + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Canary|Any CPU.Build.0 = Canary|Any CPU + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Installer|Any CPU.Build.0 = Release|Any CPU + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Release|Any CPU.Build.0 = Release|Any CPU + {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Canary|Any CPU.Build.0 = Canary|Any CPU + {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Installer|Any CPU.Build.0 = Release|Any CPU + {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Release|Any CPU.Build.0 = Release|Any CPU + {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Canary|Any CPU.Build.0 = Canary|Any CPU + {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Installer|Any CPU.Build.0 = Release|Any CPU + {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Release|Any CPU.Build.0 = Release|Any CPU + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Canary|Any CPU.Build.0 = Canary|Any CPU + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Installer|Any CPU.Build.0 = Release|Any CPU + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Release|Any CPU.Build.0 = Release|Any CPU + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Canary|Any CPU.Build.0 = Canary|Any CPU + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Installer|Any CPU.Build.0 = Release|Any CPU + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Release|Any CPU.Build.0 = Release|Any CPU + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Canary|Any CPU.Build.0 = Canary|Any CPU + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Installer|Any CPU.Build.0 = Release|Any CPU + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Release|Any CPU.Build.0 = Release|Any CPU + {E66AA060-36AC-4C48-98B5-41701F5524A6}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {E66AA060-36AC-4C48-98B5-41701F5524A6}.Canary|Any CPU.Build.0 = Canary|Any CPU + {E66AA060-36AC-4C48-98B5-41701F5524A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E66AA060-36AC-4C48-98B5-41701F5524A6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E66AA060-36AC-4C48-98B5-41701F5524A6}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {E66AA060-36AC-4C48-98B5-41701F5524A6}.Installer|Any CPU.Build.0 = Release|Any CPU + {E66AA060-36AC-4C48-98B5-41701F5524A6}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {E66AA060-36AC-4C48-98B5-41701F5524A6}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {E66AA060-36AC-4C48-98B5-41701F5524A6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E66AA060-36AC-4C48-98B5-41701F5524A6}.Release|Any CPU.Build.0 = Release|Any CPU + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Canary|Any CPU.Build.0 = Canary|Any CPU + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Installer|Any CPU.Build.0 = Release|Any CPU + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Release|Any CPU.Build.0 = Release|Any CPU + {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Canary|Any CPU.Build.0 = Canary|Any CPU + {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Installer|Any CPU.Build.0 = Release|Any CPU + {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Release|Any CPU.Build.0 = Release|Any CPU + {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Canary|Any CPU.Build.0 = Canary|Any CPU + {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Installer|Any CPU.Build.0 = Release|Any CPU + {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Release|Any CPU.Build.0 = Release|Any CPU + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Canary|Any CPU.Build.0 = Canary|Any CPU + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Installer|Any CPU.Build.0 = Release|Any CPU + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Release|Any CPU.Build.0 = Release|Any CPU + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Canary|Any CPU.Build.0 = Canary|Any CPU + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Installer|Any CPU.Build.0 = Release|Any CPU + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Release|Any CPU.Build.0 = Release|Any CPU + {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Canary|Any CPU.ActiveCfg = Debug|Any CPU + {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Canary|Any CPU.Build.0 = Debug|Any CPU + {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Installer|Any CPU.ActiveCfg = Canary|Any CPU + {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Installer|Any CPU.Build.0 = Canary|Any CPU + {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Release|Any CPU.Build.0 = Release|Any CPU + {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Canary|Any CPU.ActiveCfg = Debug|Any CPU + {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Canary|Any CPU.Build.0 = Debug|Any CPU + {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Installer|Any CPU.ActiveCfg = Nightly|Any CPU + {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Installer|Any CPU.Build.0 = Nightly|Any CPU + {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Nightly|Any CPU.ActiveCfg = Debug|Any CPU + {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Nightly|Any CPU.Build.0 = Debug|Any CPU + {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Release|Any CPU.Build.0 = Release|Any CPU + {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Canary|Any CPU.ActiveCfg = Debug|Any CPU + {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Canary|Any CPU.Build.0 = Debug|Any CPU + {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Installer|Any CPU.Build.0 = Release|Any CPU + {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Nightly|Any CPU.ActiveCfg = Debug|Any CPU + {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Nightly|Any CPU.Build.0 = Debug|Any CPU + {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Release|Any CPU.Build.0 = Release|Any CPU + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Canary|Any CPU.ActiveCfg = Debug|Any CPU + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Canary|Any CPU.Build.0 = Debug|Any CPU + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Installer|Any CPU.ActiveCfg = Canary|Any CPU + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Installer|Any CPU.Build.0 = Canary|Any CPU + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Release|Any CPU.Build.0 = Release|Any CPU + {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Canary|Any CPU.Build.0 = Canary|Any CPU + {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Installer|Any CPU.Build.0 = Release|Any CPU + {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Release|Any CPU.Build.0 = Release|Any CPU + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Canary|Any CPU.Build.0 = Canary|Any CPU + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Installer|Any CPU.Build.0 = Release|Any CPU + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Release|Any CPU.Build.0 = Release|Any CPU + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Canary|Any CPU.Build.0 = Canary|Any CPU + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Installer|Any CPU.Build.0 = Release|Any CPU + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Release|Any CPU.Build.0 = Release|Any CPU + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Canary|Any CPU.Build.0 = Canary|Any CPU + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Installer|Any CPU.Build.0 = Release|Any CPU + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Release|Any CPU.Build.0 = Release|Any CPU + {558D7C96-4E2D-4679-8D1A-508E734855D8}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {558D7C96-4E2D-4679-8D1A-508E734855D8}.Canary|Any CPU.Build.0 = Canary|Any CPU + {558D7C96-4E2D-4679-8D1A-508E734855D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {558D7C96-4E2D-4679-8D1A-508E734855D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {558D7C96-4E2D-4679-8D1A-508E734855D8}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {558D7C96-4E2D-4679-8D1A-508E734855D8}.Installer|Any CPU.Build.0 = Release|Any CPU + {558D7C96-4E2D-4679-8D1A-508E734855D8}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {558D7C96-4E2D-4679-8D1A-508E734855D8}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {558D7C96-4E2D-4679-8D1A-508E734855D8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {558D7C96-4E2D-4679-8D1A-508E734855D8}.Release|Any CPU.Build.0 = Release|Any CPU + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Canary|Any CPU.Build.0 = Canary|Any CPU + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Installer|Any CPU.Build.0 = Release|Any CPU + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Release|Any CPU.Build.0 = Release|Any CPU + {AA363B11-8B13-4333-85E1-8623D21E1202}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {AA363B11-8B13-4333-85E1-8623D21E1202}.Canary|Any CPU.Build.0 = Canary|Any CPU + {AA363B11-8B13-4333-85E1-8623D21E1202}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AA363B11-8B13-4333-85E1-8623D21E1202}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AA363B11-8B13-4333-85E1-8623D21E1202}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {AA363B11-8B13-4333-85E1-8623D21E1202}.Installer|Any CPU.Build.0 = Release|Any CPU + {AA363B11-8B13-4333-85E1-8623D21E1202}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {AA363B11-8B13-4333-85E1-8623D21E1202}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {AA363B11-8B13-4333-85E1-8623D21E1202}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AA363B11-8B13-4333-85E1-8623D21E1202}.Release|Any CPU.Build.0 = Release|Any CPU + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Canary|Any CPU.Build.0 = Canary|Any CPU + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Installer|Any CPU.Build.0 = Release|Any CPU + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Release|Any CPU.Build.0 = Release|Any CPU + {14542128-1DF0-44DB-9365-1FF39324B317}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {14542128-1DF0-44DB-9365-1FF39324B317}.Canary|Any CPU.Build.0 = Canary|Any CPU + {14542128-1DF0-44DB-9365-1FF39324B317}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {14542128-1DF0-44DB-9365-1FF39324B317}.Debug|Any CPU.Build.0 = Debug|Any CPU + {14542128-1DF0-44DB-9365-1FF39324B317}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {14542128-1DF0-44DB-9365-1FF39324B317}.Installer|Any CPU.Build.0 = Release|Any CPU + {14542128-1DF0-44DB-9365-1FF39324B317}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {14542128-1DF0-44DB-9365-1FF39324B317}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {14542128-1DF0-44DB-9365-1FF39324B317}.Release|Any CPU.ActiveCfg = Release|Any CPU + {14542128-1DF0-44DB-9365-1FF39324B317}.Release|Any CPU.Build.0 = Release|Any CPU + {4804A209-411D-43E5-B104-77D6A19131E2}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {4804A209-411D-43E5-B104-77D6A19131E2}.Canary|Any CPU.Build.0 = Canary|Any CPU + {4804A209-411D-43E5-B104-77D6A19131E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4804A209-411D-43E5-B104-77D6A19131E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4804A209-411D-43E5-B104-77D6A19131E2}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {4804A209-411D-43E5-B104-77D6A19131E2}.Installer|Any CPU.Build.0 = Release|Any CPU + {4804A209-411D-43E5-B104-77D6A19131E2}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {4804A209-411D-43E5-B104-77D6A19131E2}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {4804A209-411D-43E5-B104-77D6A19131E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4804A209-411D-43E5-B104-77D6A19131E2}.Release|Any CPU.Build.0 = Release|Any CPU + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Canary|Any CPU.Build.0 = Canary|Any CPU + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Installer|Any CPU.Build.0 = Release|Any CPU + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Release|Any CPU.Build.0 = Release|Any CPU + {4C448625-CBCB-4147-9288-659906B17C28}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {4C448625-CBCB-4147-9288-659906B17C28}.Canary|Any CPU.Build.0 = Canary|Any CPU + {4C448625-CBCB-4147-9288-659906B17C28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4C448625-CBCB-4147-9288-659906B17C28}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4C448625-CBCB-4147-9288-659906B17C28}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {4C448625-CBCB-4147-9288-659906B17C28}.Installer|Any CPU.Build.0 = Release|Any CPU + {4C448625-CBCB-4147-9288-659906B17C28}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {4C448625-CBCB-4147-9288-659906B17C28}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {4C448625-CBCB-4147-9288-659906B17C28}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4C448625-CBCB-4147-9288-659906B17C28}.Release|Any CPU.Build.0 = Release|Any CPU + {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Canary|Any CPU.Build.0 = Canary|Any CPU + {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Installer|Any CPU.Build.0 = Release|Any CPU + {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Release|Any CPU.Build.0 = Release|Any CPU + {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Canary|Any CPU.Build.0 = Canary|Any CPU + {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Installer|Any CPU.Build.0 = Release|Any CPU + {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Release|Any CPU.Build.0 = Release|Any CPU + {B9D53724-D2C8-4067-8146-15C04533BAE3}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {B9D53724-D2C8-4067-8146-15C04533BAE3}.Canary|Any CPU.Build.0 = Canary|Any CPU + {B9D53724-D2C8-4067-8146-15C04533BAE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B9D53724-D2C8-4067-8146-15C04533BAE3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B9D53724-D2C8-4067-8146-15C04533BAE3}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {B9D53724-D2C8-4067-8146-15C04533BAE3}.Installer|Any CPU.Build.0 = Release|Any CPU + {B9D53724-D2C8-4067-8146-15C04533BAE3}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {B9D53724-D2C8-4067-8146-15C04533BAE3}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {B9D53724-D2C8-4067-8146-15C04533BAE3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B9D53724-D2C8-4067-8146-15C04533BAE3}.Release|Any CPU.Build.0 = Release|Any CPU + {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Canary|Any CPU.Build.0 = Canary|Any CPU + {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Installer|Any CPU.Build.0 = Release|Any CPU + {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Release|Any CPU.Build.0 = Release|Any CPU + {9B5D60B1-765A-4793-92C4-23E8F8A76A77}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {9B5D60B1-765A-4793-92C4-23E8F8A76A77}.Canary|Any CPU.Build.0 = Canary|Any CPU + {9B5D60B1-765A-4793-92C4-23E8F8A76A77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9B5D60B1-765A-4793-92C4-23E8F8A76A77}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9B5D60B1-765A-4793-92C4-23E8F8A76A77}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {9B5D60B1-765A-4793-92C4-23E8F8A76A77}.Installer|Any CPU.Build.0 = Release|Any CPU + {9B5D60B1-765A-4793-92C4-23E8F8A76A77}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {9B5D60B1-765A-4793-92C4-23E8F8A76A77}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {9B5D60B1-765A-4793-92C4-23E8F8A76A77}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9B5D60B1-765A-4793-92C4-23E8F8A76A77}.Release|Any CPU.Build.0 = Release|Any CPU + {F33622D3-84D1-4C58-9241-45243882739C}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {F33622D3-84D1-4C58-9241-45243882739C}.Canary|Any CPU.Build.0 = Canary|Any CPU + {F33622D3-84D1-4C58-9241-45243882739C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F33622D3-84D1-4C58-9241-45243882739C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F33622D3-84D1-4C58-9241-45243882739C}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {F33622D3-84D1-4C58-9241-45243882739C}.Installer|Any CPU.Build.0 = Release|Any CPU + {F33622D3-84D1-4C58-9241-45243882739C}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {F33622D3-84D1-4C58-9241-45243882739C}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {F33622D3-84D1-4C58-9241-45243882739C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F33622D3-84D1-4C58-9241-45243882739C}.Release|Any CPU.Build.0 = Release|Any CPU + {62253CD1-5FFB-4B07-82E9-00C978A96478}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {62253CD1-5FFB-4B07-82E9-00C978A96478}.Canary|Any CPU.Build.0 = Canary|Any CPU + {62253CD1-5FFB-4B07-82E9-00C978A96478}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {62253CD1-5FFB-4B07-82E9-00C978A96478}.Debug|Any CPU.Build.0 = Debug|Any CPU + {62253CD1-5FFB-4B07-82E9-00C978A96478}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {62253CD1-5FFB-4B07-82E9-00C978A96478}.Installer|Any CPU.Build.0 = Release|Any CPU + {62253CD1-5FFB-4B07-82E9-00C978A96478}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {62253CD1-5FFB-4B07-82E9-00C978A96478}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {62253CD1-5FFB-4B07-82E9-00C978A96478}.Release|Any CPU.ActiveCfg = Release|Any CPU + {62253CD1-5FFB-4B07-82E9-00C978A96478}.Release|Any CPU.Build.0 = Release|Any CPU + {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Canary|Any CPU.Build.0 = Canary|Any CPU + {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Installer|Any CPU.Build.0 = Release|Any CPU + {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Release|Any CPU.Build.0 = Release|Any CPU + {2C946C86-12F4-40A3-B964-09C71DA3B845}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {2C946C86-12F4-40A3-B964-09C71DA3B845}.Canary|Any CPU.Build.0 = Canary|Any CPU + {2C946C86-12F4-40A3-B964-09C71DA3B845}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2C946C86-12F4-40A3-B964-09C71DA3B845}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2C946C86-12F4-40A3-B964-09C71DA3B845}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {2C946C86-12F4-40A3-B964-09C71DA3B845}.Installer|Any CPU.Build.0 = Release|Any CPU + {2C946C86-12F4-40A3-B964-09C71DA3B845}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {2C946C86-12F4-40A3-B964-09C71DA3B845}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {2C946C86-12F4-40A3-B964-09C71DA3B845}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2C946C86-12F4-40A3-B964-09C71DA3B845}.Release|Any CPU.Build.0 = Release|Any CPU + {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Canary|Any CPU.Build.0 = Canary|Any CPU + {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Installer|Any CPU.Build.0 = Release|Any CPU + {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Release|Any CPU.Build.0 = Release|Any CPU + {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Canary|Any CPU.Build.0 = Canary|Any CPU + {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Installer|Any CPU.Build.0 = Release|Any CPU + {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Release|Any CPU.Build.0 = Release|Any CPU + {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Canary|Any CPU.Build.0 = Canary|Any CPU + {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Installer|Any CPU.ActiveCfg = Release|Any CPU + {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Installer|Any CPU.Build.0 = Release|Any CPU + {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Release|Any CPU.Build.0 = Release|Any CPU + {8F8E1B19-EFA1-4BC2-AEB3-8985B07A6A2B}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {8F8E1B19-EFA1-4BC2-AEB3-8985B07A6A2B}.Canary|Any CPU.Build.0 = Canary|Any CPU + {8F8E1B19-EFA1-4BC2-AEB3-8985B07A6A2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8F8E1B19-EFA1-4BC2-AEB3-8985B07A6A2B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8F8E1B19-EFA1-4BC2-AEB3-8985B07A6A2B}.Installer|Any CPU.ActiveCfg = Installer|Any CPU + {8F8E1B19-EFA1-4BC2-AEB3-8985B07A6A2B}.Installer|Any CPU.Build.0 = Installer|Any CPU + {8F8E1B19-EFA1-4BC2-AEB3-8985B07A6A2B}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {8F8E1B19-EFA1-4BC2-AEB3-8985B07A6A2B}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {8F8E1B19-EFA1-4BC2-AEB3-8985B07A6A2B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8F8E1B19-EFA1-4BC2-AEB3-8985B07A6A2B}.Release|Any CPU.Build.0 = Release|Any CPU + {39E6D9FC-E30F-4F4A-9EAC-F1234226FE2E}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {39E6D9FC-E30F-4F4A-9EAC-F1234226FE2E}.Canary|Any CPU.Build.0 = Canary|Any CPU + {39E6D9FC-E30F-4F4A-9EAC-F1234226FE2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39E6D9FC-E30F-4F4A-9EAC-F1234226FE2E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39E6D9FC-E30F-4F4A-9EAC-F1234226FE2E}.Installer|Any CPU.ActiveCfg = Installer|Any CPU + {39E6D9FC-E30F-4F4A-9EAC-F1234226FE2E}.Installer|Any CPU.Build.0 = Installer|Any CPU + {39E6D9FC-E30F-4F4A-9EAC-F1234226FE2E}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {39E6D9FC-E30F-4F4A-9EAC-F1234226FE2E}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {39E6D9FC-E30F-4F4A-9EAC-F1234226FE2E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39E6D9FC-E30F-4F4A-9EAC-F1234226FE2E}.Release|Any CPU.Build.0 = Release|Any CPU + {B48CAFB1-659A-4898-8004-3F909B788E56}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {B48CAFB1-659A-4898-8004-3F909B788E56}.Canary|Any CPU.Build.0 = Canary|Any CPU + {B48CAFB1-659A-4898-8004-3F909B788E56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B48CAFB1-659A-4898-8004-3F909B788E56}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B48CAFB1-659A-4898-8004-3F909B788E56}.Installer|Any CPU.ActiveCfg = Installer|Any CPU + {B48CAFB1-659A-4898-8004-3F909B788E56}.Installer|Any CPU.Build.0 = Installer|Any CPU + {B48CAFB1-659A-4898-8004-3F909B788E56}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {B48CAFB1-659A-4898-8004-3F909B788E56}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {B48CAFB1-659A-4898-8004-3F909B788E56}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B48CAFB1-659A-4898-8004-3F909B788E56}.Release|Any CPU.Build.0 = Release|Any CPU + {76250480-3D16-4CC7-9F38-18EA880B8150}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {76250480-3D16-4CC7-9F38-18EA880B8150}.Canary|Any CPU.Build.0 = Canary|Any CPU + {76250480-3D16-4CC7-9F38-18EA880B8150}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {76250480-3D16-4CC7-9F38-18EA880B8150}.Debug|Any CPU.Build.0 = Debug|Any CPU + {76250480-3D16-4CC7-9F38-18EA880B8150}.Installer|Any CPU.ActiveCfg = Installer|Any CPU + {76250480-3D16-4CC7-9F38-18EA880B8150}.Installer|Any CPU.Build.0 = Installer|Any CPU + {76250480-3D16-4CC7-9F38-18EA880B8150}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {76250480-3D16-4CC7-9F38-18EA880B8150}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {76250480-3D16-4CC7-9F38-18EA880B8150}.Release|Any CPU.ActiveCfg = Release|Any CPU + {76250480-3D16-4CC7-9F38-18EA880B8150}.Release|Any CPU.Build.0 = Release|Any CPU + {3CD6AC31-4080-4E66-B3C5-91068408765A}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {3CD6AC31-4080-4E66-B3C5-91068408765A}.Canary|Any CPU.Build.0 = Canary|Any CPU + {3CD6AC31-4080-4E66-B3C5-91068408765A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3CD6AC31-4080-4E66-B3C5-91068408765A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3CD6AC31-4080-4E66-B3C5-91068408765A}.Installer|Any CPU.ActiveCfg = Installer|Any CPU + {3CD6AC31-4080-4E66-B3C5-91068408765A}.Installer|Any CPU.Build.0 = Installer|Any CPU + {3CD6AC31-4080-4E66-B3C5-91068408765A}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {3CD6AC31-4080-4E66-B3C5-91068408765A}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {3CD6AC31-4080-4E66-B3C5-91068408765A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3CD6AC31-4080-4E66-B3C5-91068408765A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {87BE2145-50BE-4A57-9C79-FCE5A64F6065} = {5D85B551-9AFC-4E96-93C3-D8D81B69971F} + {A7A69BC2-7682-43FB-8E7C-C42FDAA2A215} = {5D85B551-9AFC-4E96-93C3-D8D81B69971F} + {6B01F113-016E-445F-BE5E-80BA7144B928} = {5D85B551-9AFC-4E96-93C3-D8D81B69971F} + {404EC0E7-92CB-4E90-80F7-440A4F5D772C} = {6B01F113-016E-445F-BE5E-80BA7144B928} + {734B2F67-D055-44B2-818A-FE569C479937} = {6B01F113-016E-445F-BE5E-80BA7144B928} + {15346861-5444-49D7-9686-3835EE271259} = {6B01F113-016E-445F-BE5E-80BA7144B928} + {5E13A5BB-407A-46A5-95A8-9DA57FB21C6C} = {6B01F113-016E-445F-BE5E-80BA7144B928} + {6EFEF411-B16C-4DEA-992F-9CA767EB1265} = {6B01F113-016E-445F-BE5E-80BA7144B928} + {F96630C5-2A89-44D5-BED6-99609A6D716A} = {6B01F113-016E-445F-BE5E-80BA7144B928} + {247BBF4E-22B0-49CC-981B-0420AD7FF4E8} = {6B01F113-016E-445F-BE5E-80BA7144B928} + {071034AA-BFA3-4325-B763-E95A2E05EF4D} = {734B2F67-D055-44B2-818A-FE569C479937} + {378BEE59-0131-4497-80B8-69B3124325D7} = {734B2F67-D055-44B2-818A-FE569C479937} + {69F98672-EBB9-4B12-BD04-45AEF3C37FC6} = {15346861-5444-49D7-9686-3835EE271259} + {0451E883-C718-4679-962F-E2825B1513B2} = {247BBF4E-22B0-49CC-981B-0420AD7FF4E8} + {E68C45C0-418B-4CFC-97C0-282798B38B37} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {9CB33D7B-BF7E-4221-859D-5E61E24772E3} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {B9A5A472-F747-4C87-B5E9-C5A05DB17827} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {81BCFC34-220F-43A8-A58B-8F9E123C72E1} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9} = {ADF53878-BE1F-43A3-A890-E11190BE5465} + {E66AA060-36AC-4C48-98B5-41701F5524A6} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B} = {ADF53878-BE1F-43A3-A890-E11190BE5465} + {7E1B169E-AD04-4C98-9971-DC7F450BF610} = {ADF53878-BE1F-43A3-A890-E11190BE5465} + {4545427A-2FD5-441A-A35E-F09F2AB1B20D} = {ADF53878-BE1F-43A3-A890-E11190BE5465} + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF} = {ADF53878-BE1F-43A3-A890-E11190BE5465} + {4696C160-BC97-414A-8D30-B09A2CA76085} = {87BE2145-50BE-4A57-9C79-FCE5A64F6065} + {9ACA6117-D269-4425-8500-6BC57560DEB2} = {87BE2145-50BE-4A57-9C79-FCE5A64F6065} + {241C9BD1-CB7D-4AF0-8FDB-3BCB4C98AF51} = {5D85B551-9AFC-4E96-93C3-D8D81B69971F} + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {5DB6B467-9257-42D3-B81F-380B5D537C04} = {6B01F113-016E-445F-BE5E-80BA7144B928} + {1AD413AC-FAD3-4F79-A948-4FB66AF10685} = {5DB6B467-9257-42D3-B81F-380B5D537C04} + {A58A93DE-0CBF-495B-8D29-761B1143AD32} = {ADF53878-BE1F-43A3-A890-E11190BE5465} + {BA86BDC7-D11C-4E74-875C-B284E740B599} = {A7A69BC2-7682-43FB-8E7C-C42FDAA2A215} + {A59A87BE-E92A-4717-92DC-A2286EE812EC} = {ADF53878-BE1F-43A3-A890-E11190BE5465} + {744D6A50-F8DB-4D5F-B571-34B0597E03B8} = {0703388D-5FBE-4345-94B0-5FA9FD043079} + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F} = {ADF53878-BE1F-43A3-A890-E11190BE5465} + {26A8A753-BC4B-4E42-B124-8EA3FA64303F} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {558D7C96-4E2D-4679-8D1A-508E734855D8} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {AA363B11-8B13-4333-85E1-8623D21E1202} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {14542128-1DF0-44DB-9365-1FF39324B317} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {4804A209-411D-43E5-B104-77D6A19131E2} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {4C448625-CBCB-4147-9288-659906B17C28} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {AA7EBA51-F1BA-4A45-9344-22F4E173109A} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {65DDD9BE-D9BB-456A-97D4-D0B75607F657} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {B9D53724-D2C8-4067-8146-15C04533BAE3} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {A7DFFED4-3872-491C-B560-C8E4E4733A4D} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {9B5D60B1-765A-4793-92C4-23E8F8A76A77} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {F33622D3-84D1-4C58-9241-45243882739C} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {62253CD1-5FFB-4B07-82E9-00C978A96478} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {A5FA199B-9AA4-4061-AE07-3036A115AA24} = {ADF53878-BE1F-43A3-A890-E11190BE5465} + {2C946C86-12F4-40A3-B964-09C71DA3B845} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {5C2389E8-1198-48D2-BDCC-44F74BE6B294} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {1126FD6E-8A3E-4C93-AABB-06073B27EB75} = {4985A154-8526-4CB0-A7DC-B39736C4A8AC} + {975DA9CB-501F-442E-8339-AF625C7A5DA4} = {4985A154-8526-4CB0-A7DC-B39736C4A8AC} + {5D204922-259D-4140-B115-F01EDF031B5A} = {5D85B551-9AFC-4E96-93C3-D8D81B69971F} + {362F24FA-1AA0-4821-A539-C5A863D39B8B} = {5D204922-259D-4140-B115-F01EDF031B5A} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A7CE7732-0982-4703-8EFD-7715D569BAB5} + EndGlobalSection +EndGlobal diff --git a/Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022 - NuGet.sln b/Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022 - NuGet.sln new file mode 100644 index 000000000..52eee1093 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022 - NuGet.sln @@ -0,0 +1,902 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31825.309 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Main", "Main", "{252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Repository Items", "Repository Items", "{5D85B551-9AFC-4E96-93C3-D8D81B69971F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build System", "Build System", "{87BE2145-50BE-4A57-9C79-FCE5A64F6065}" + ProjectSection(SolutionItems) = preProject + ..\..\build.cmd = ..\..\build.cmd + ..\..\build.proj = ..\..\build.proj + ..\..\debug.cmd = ..\..\debug.cmd + ..\..\debug.proj = ..\..\debug.proj + ..\..\purge.cmd = ..\..\purge.cmd + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Markdown", "Markdown", "{A7A69BC2-7682-43FB-8E7C-C42FDAA2A215}" + ProjectSection(SolutionItems) = preProject + ..\..\Documents\Help\Changelog.md = ..\..\Documents\Help\Changelog.md + ..\..\Documents\Examples\Examples.md = ..\..\Documents\Examples\Examples.md + ..\..\Documents\Modules\NuGet Package Information.md = ..\..\Documents\Modules\NuGet Package Information.md + ..\..\Documents\Help\Prerequisites.md = ..\..\Documents\Help\Prerequisites.md + ..\..\README.md = ..\..\README.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Assets", "Assets", "{6B01F113-016E-445F-BE5E-80BA7144B928}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\ToggleSwich.bmp = ..\..\Assets\ToggleSwich.bmp + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{404EC0E7-92CB-4E90-80F7-440A4F5D772C}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\Examples\CircularProgressBar.png = ..\..\Assets\Examples\CircularProgressBar.png + ..\..\Assets\Examples\CommandLinks.png = ..\..\Assets\Examples\CommandLinks.png + ..\..\Assets\Examples\ExtendedKryptonMessageBox1.png = ..\..\Assets\Examples\ExtendedKryptonMessageBox1.png + ..\..\Assets\Examples\ExtendedKryptonMessageBox2.png = ..\..\Assets\Examples\ExtendedKryptonMessageBox2.png + ..\..\Assets\Examples\FloatableToolStrip.png = ..\..\Assets\Examples\FloatableToolStrip.png + ..\..\Assets\Examples\FlotableMenuStrip.png = ..\..\Assets\Examples\FlotableMenuStrip.png + ..\..\Assets\Examples\KryptonColourMixer.png = ..\..\Assets\Examples\KryptonColourMixer.png + ..\..\Assets\Examples\KryptonColourWheel.png = ..\..\Assets\Examples\KryptonColourWheel.png + ..\..\Assets\Examples\KryptonInputBoxExtended.png = ..\..\Assets\Examples\KryptonInputBoxExtended.png + ..\..\Assets\Examples\KryptonKnobControl.png = ..\..\Assets\Examples\KryptonKnobControl.png + ..\..\Assets\Examples\KryptonPaletteColourShader.png = ..\..\Assets\Examples\KryptonPaletteColourShader.png + ..\..\Assets\Examples\KryptonPropertyGrid.png = ..\..\Assets\Examples\KryptonPropertyGrid.png + ..\..\Assets\Examples\KryptonScrollBars.png = ..\..\Assets\Examples\KryptonScrollBars.png + ..\..\Assets\Examples\KryptonThemeSelector.png = ..\..\Assets\Examples\KryptonThemeSelector.png + ..\..\Assets\Examples\KryptonToastNotificationV1.png = ..\..\Assets\Examples\KryptonToastNotificationV1.png + ..\..\Assets\Examples\KryptonToggleSwitch.png = ..\..\Assets\Examples\KryptonToggleSwitch.png + ..\..\Assets\Examples\KryptonViewBar.png = ..\..\Assets\Examples\KryptonViewBar.png + ..\..\Assets\Examples\TreeViews.png = ..\..\Assets\Examples\TreeViews.png + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ICO", "ICO", "{734B2F67-D055-44B2-818A-FE569C479937}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "JPEG", "JPEG", "{15346861-5444-49D7-9686-3835EE271259}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "License", "License", "{5E13A5BB-407A-46A5-95A8-9DA57FB21C6C}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\License\LICENSE.md = ..\..\Assets\License\LICENSE.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Package Icon", "Package Icon", "{6EFEF411-B16C-4DEA-992F-9CA767EB1265}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\Package Icon\Canary_Icon_128_x_128.png = ..\..\Assets\Package Icon\Canary_Icon_128_x_128.png + ..\..\Assets\Package Icon\Stable_Icon_128_x_128.png = ..\..\Assets\Package Icon\Stable_Icon_128_x_128.png + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PNG", "PNG", "{F96630C5-2A89-44D5-BED6-99609A6D716A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PSD", "PSD", "{247BBF4E-22B0-49CC-981B-0420AD7FF4E8}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\PSD\Command Link Button.psd = ..\..\Assets\PSD\Command Link Button.psd + ..\..\Assets\PSD\Main Icon 512 x 512 Canary.psd = ..\..\Assets\PSD\Main Icon 512 x 512 Canary.psd + ..\..\Assets\PSD\Main Icon 512 x 512 Nightly.psd = ..\..\Assets\PSD\Main Icon 512 x 512 Nightly.psd + ..\..\Assets\PSD\PE Icon 512 x 512.psd = ..\..\Assets\PSD\PE Icon 512 x 512.psd + ..\..\Assets\PSD\Square Design 512 x 512 Orange.psd = ..\..\Assets\PSD\Square Design 512 x 512 Orange.psd + ..\..\Assets\PSD\ToggleSwich.psd = ..\..\Assets\PSD\ToggleSwich.psd + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "48 x 48", "48 x 48", "{071034AA-BFA3-4325-B763-E95A2E05EF4D}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\ICO\48 x 48\KR 48 x 48 Orange.ico = ..\..\Assets\ICO\48 x 48\KR 48 x 48 Orange.ico + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "256 x 256", "256 x 256", "{378BEE59-0131-4497-80B8-69B3124325D7}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\ICO\256 x 256\KR 256 x 256 Orange.ico = ..\..\Assets\ICO\256 x 256\KR 256 x 256 Orange.ico + ..\..\Assets\ICO\256 x 256\PE Icon 256 x 256.ico = ..\..\Assets\ICO\256 x 256\PE Icon 256 x 256.ico + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "48 x 48", "48 x 48", "{69F98672-EBB9-4B12-BD04-45AEF3C37FC6}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\JPEG\48 x 48\Logo Stable.jpg = ..\..\Assets\JPEG\48 x 48\Logo Stable.jpg + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Arrows", "Arrows", "{0451E883-C718-4679-962F-E2825B1513B2}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\PSD\Arrows\Arrow-1.psd = ..\..\Assets\PSD\Arrows\Arrow-1.psd + ..\..\Assets\PSD\Arrows\Arrow-2.psd = ..\..\Assets\PSD\Arrows\Arrow-2.psd + ..\..\Assets\PSD\Arrows\Arrow-3.psd = ..\..\Assets\PSD\Arrows\Arrow-3.psd + ..\..\Assets\PSD\Arrows\Arrow-4.psd = ..\..\Assets\PSD\Arrows\Arrow-4.psd + ..\..\Assets\PSD\Arrows\Template.psd = ..\..\Assets\PSD\Arrows\Template.psd + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FDDE0872-007C-4945-9D20-C9011C37204B}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + .nuspec = .nuspec + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Core 2022", "Krypton.Toolkit.Suite.Extended.Core\Krypton.Toolkit.Suite.Extended.Core 2022.csproj", "{E68C45C0-418B-4CFC-97C0-282798B38B37}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Common 2022", "Krypton.Toolkit.Suite.Extended.Common\Krypton.Toolkit.Suite.Extended.Common 2022.csproj", "{57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Developer.Utilities 2022", "Krypton.Toolkit.Suite.Extended.Developer.Utilities\Krypton.Toolkit.Suite.Extended.Developer.Utilities 2022.csproj", "{58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Drawing 2022", "Krypton.Toolkit.Suite.Extended.Drawing\Krypton.Toolkit.Suite.Extended.Drawing 2022.csproj", "{9CB33D7B-BF7E-4221-859D-5E61E24772E3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Effects 2022", "Krypton.Toolkit.Suite.Extended.Effects\Krypton.Toolkit.Suite.Extended.Effects 2022.csproj", "{B47A7562-B3B5-4521-91DB-E5CC4CC986E3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Global.Utilities 2022", "Krypton.Toolkit.Suite.Extended.Global.Utilities\Krypton.Toolkit.Suite.Extended.Global.Utilities 2022.csproj", "{B9A5A472-F747-4C87-B5E9-C5A05DB17827}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Language.Model 2022", "Krypton.Toolkit.Suite.Extended.Language.Model\Krypton.Toolkit.Suite.Extended.Language.Model 2022.csproj", "{81BCFC34-220F-43A8-A58B-8F9E123C72E1}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Resources 2022", "Krypton.Toolkit.Suite.Extended.Resources\Krypton.Toolkit.Suite.Extended.Resources 2022.csproj", "{4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Settings 2022", "Krypton.Toolkit.Suite.Extended.Settings\Krypton.Toolkit.Suite.Extended.Settings 2022.csproj", "{C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Tools 2022", "Krypton.Toolkit.Suite.Extended.Tools\Krypton.Toolkit.Suite.Extended.Tools 2022.csproj", "{CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Utilities 2022", "Krypton.Toolkit.Suite.Extended.Utilities\Krypton.Toolkit.Suite.Extended.Utilities 2022.csproj", "{E66AA060-36AC-4C48-98B5-41701F5524A6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.File.Explorer 2022", "Krypton.Toolkit.Suite.Extended.File.Explorer\Krypton.Toolkit.Suite.Extended.File.Explorer 2022.csproj", "{1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Gages 2022", "Krypton.Toolkit.Suite.Extended.Gages\Krypton.Toolkit.Suite.Extended.Gages 2022.csproj", "{7E1B169E-AD04-4C98-9971-DC7F450BF610}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Palette.Selectors 2022", "Krypton.Toolkit.Suite.Extended.Palette.Selectors\Krypton.Toolkit.Suite.Extended.Palette.Selectors 2022.csproj", "{4545427A-2FD5-441A-A35E-F09F2AB1B20D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.TaskDialogs 2022", "Krypton.Toolkit.Suite.Extended.TaskDialogs\Krypton.Toolkit.Suite.Extended.TaskDialogs 2022.csproj", "{116CDDE3-823F-486E-B0AC-2F0FE810A7EF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Theme.Switcher 2022", "Krypton.Toolkit.Suite.Extended.Theme.Switcher\Krypton.Toolkit.Suite.Extended.Theme.Switcher 2022.csproj", "{062AB625-3AAB-46ED-891D-E7103D1F7EBE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Toggle.Switch 2022", "Krypton.Toolkit.Suite.Extended.Toggle.Switch\Krypton.Toolkit.Suite.Extended.Toggle.Switch 2022.csproj", "{3804493B-31D2-4D70-89EF-EDED205037EC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Tool.Box 2022", "Krypton.Toolkit.Suite.Extended.Tool.Box\Krypton.Toolkit.Suite.Extended.Tool.Box 2022.csproj", "{66B492AC-74E6-4951-9376-47B4B7BA43EB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Tool.Strip.Items 2022", "Krypton.Toolkit.Suite.Extended.Tool.Strip.Items\Krypton.Toolkit.Suite.Extended.Tool.Strip.Items 2022.csproj", "{8FD6FEBA-B906-4C66-9A8D-E370B961162C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Wizard 2022", "Krypton.Toolkit.Suite.Extended.Wizard\Krypton.Toolkit.Suite.Extended.Wizard 2022.csproj", "{6353C3DA-7BCE-4D1E-844D-70A4B8401E7F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.DataGridView 2022", "Krypton.Toolkit.Suite.Extended.DataGridView\Krypton.Toolkit.Suite.Extended.DataGridView 2022.csproj", "{A55B5F11-F812-4FF4-900C-B12601B34E52}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.TreeGridView 2022", "Krypton.Toolkit.Suite.Extended.TreeGridView\Krypton.Toolkit.Suite.Extended.TreeGridView 2022.csproj", "{34F32E4D-79EF-4447-A585-B1A79BF1C3C3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Compression 2022", "Krypton.Toolkit.Suite.Extended.Compression\Krypton.Toolkit.Suite.Extended.Compression 2022.csproj", "{18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Forms 2022", "Krypton.Toolkit.Suite.Extended.Forms\Krypton.Toolkit.Suite.Extended.Forms 2022.csproj", "{EE0904D6-72EF-4107-A286-CB5EEC2A5CE0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Generic", "Generic", "{4696C160-BC97-414A-8D30-B09A2CA76085}" + ProjectSection(SolutionItems) = preProject + ..\..\Directory.Build.props = ..\..\Directory.Build.props + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Generate Packages", "Generate Packages", "{9ACA6117-D269-4425-8500-6BC57560DEB2}" + ProjectSection(SolutionItems) = preProject + Directory.Build.props = Directory.Build.props + Directory.Build.targets = Directory.Build.targets + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.InputBox 2022", "Krypton.Toolkit.Suite.Extended.InputBox\Krypton.Toolkit.Suite.Extended.InputBox 2022.csproj", "{2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Panels 2022", "Krypton.Toolkit.Suite.Extended.Panels\Krypton.Toolkit.Suite.Extended.Panels 2022.csproj", "{335DD135-6475-46D5-A7DB-EA329224D59E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Miscellaneous", "Miscellaneous", "{241C9BD1-CB7D-4AF0-8FDB-3BCB4C98AF51}" + ProjectSection(SolutionItems) = preProject + ..\.editorconfig = ..\.editorconfig + Directory.Build.props = Directory.Build.props + Directory.Build.targets = Directory.Build.targets + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView 2022", "Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView\Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView 2022.csproj", "{CB1E8B1F-E019-498A-8E4E-117012F6368C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Ribbon 2022", "Krypton.Toolkit.Suite.Extended.Ribbon\Krypton.Toolkit.Suite.Extended.Ribbon 2022.csproj", "{9FCE31CF-18F7-4F24-8B73-799B3CB19D57}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{0703388D-5FBE-4345-94B0-5FA9FD043079}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Shared 2022", "Krypton.Toolkit.Suite.Extended.Shared\Krypton.Toolkit.Suite.Extended.Shared 2022.csproj", "{0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{5DB6B467-9257-42D3-B81F-380B5D537C04}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Schemas", "Schemas", "{1AD413AC-FAD3-4F79-A948-4FB66AF10685}" + ProjectSection(SolutionItems) = preProject + ..\..\Assets\NuGet\Schemas\Krypton.Toolkit.Suite.Extended.Lite.nuspec = ..\..\Assets\NuGet\Schemas\Krypton.Toolkit.Suite.Extended.Lite.nuspec + ..\..\Assets\NuGet\Schemas\Krypton.Toolkit.Suite.Extended.nuspec = ..\..\Assets\NuGet\Schemas\Krypton.Toolkit.Suite.Extended.nuspec + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Themes 2022", "Krypton.Toolkit.Suite.Extended.Themes\Krypton.Toolkit.Suite.Extended.Themes 2022.csproj", "{A58A93DE-0CBF-495B-8D29-761B1143AD32}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Buttons 2022", "Krypton.Toolkit.Suite.Extended.Buttons\Krypton.Toolkit.Suite.Extended.Buttons 2022.csproj", "{A7C0B094-539C-4283-AA9A-3959749886B7}" + ProjectSection(ProjectDependencies) = postProject + {DDC3EC31-7D14-47BD-9DAF-24AF5B032354} = {DDC3EC31-7D14-47BD-9DAF-24AF5B032354} + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Calendar 2022", "Krypton.Toolkit.Suite.Extended.Calendar\Krypton.Toolkit.Suite.Extended.Calendar 2022.csproj", "{BE3A7DFA-3616-4840-B9CC-09E96CC894B4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "License", "License", "{BA86BDC7-D11C-4E74-875C-B284E740B599}" + ProjectSection(SolutionItems) = preProject + ..\..\Documents\License\License.md = ..\..\Documents\License\License.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Projects to Work On", "Projects to Work On", "{ADF53878-BE1F-43A3-A890-E11190BE5465}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.PDF 2022", "Krypton.Toolkit.Suite.Extended.PDF\Krypton.Toolkit.Suite.Extended.PDF 2022.csproj", "{A59A87BE-E92A-4717-92DC-A2286EE812EC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples", "Examples\Examples.csproj", "{744D6A50-F8DB-4D5F-B571-34B0597E03B8}" + ProjectSection(ProjectDependencies) = postProject + {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F} = {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F} + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.AdvancedDataGridView 2022", "Krypton.Toolkit.Suite.Extended.AdvancedDataGridView\Krypton.Toolkit.Suite.Extended.AdvancedDataGridView 2022.csproj", "{5E23D530-6349-4786-AA2D-F1DD9CC1586E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Scintilla.NET 2022", "Krypton.Toolkit.Suite.Extended.Scintilla.NET\Krypton.Toolkit.Suite.Extended.Scintilla.NET 2022.csproj", "{BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.CheckSum.Tools 2022", "Krypton.Toolkit.Suite.Extended.CheckSum.Tools\Krypton.Toolkit.Suite.Extended.CheckSum.Tools 2022.csproj", "{26A8A753-BC4B-4E42-B124-8EA3FA64303F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Circular.ProgressBar 2022", "Krypton.Toolkit.Suite.Extended.Circular.ProgressBar\Krypton.Toolkit.Suite.Extended.Circular.ProgressBar 2022.csproj", "{7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.ComboBox 2022", "Krypton.Toolkit.Suite.Extended.ComboBox\Krypton.Toolkit.Suite.Extended.ComboBox 2022.csproj", "{253E37F3-A36F-4D96-B22E-1D50C31C0D2D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Controls 2022", "Krypton.Toolkit.Suite.Extended.Controls\Krypton.Toolkit.Suite.Extended.Controls 2022.csproj", "{C4D0363C-6CA9-4D47-B896-D287C1E6BD11}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Data.Visualisation 2022", "Krypton.Toolkit.Suite.Extended.Data.Visualisation\Krypton.Toolkit.Suite.Extended.Data.Visualisation 2022.csproj", "{558D7C96-4E2D-4679-8D1A-508E734855D8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Dialogs 2022", "Krypton.Toolkit.Suite.Extended.Dialogs\Krypton.Toolkit.Suite.Extended.Dialogs 2022.csproj", "{3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Dock.Extender 2022", "Krypton.Toolkit.Suite.Extended.Dock.Extender\Krypton.Toolkit.Suite.Extended.Dock.Extender 2022.csproj", "{AA363B11-8B13-4333-85E1-8623D21E1202}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Error.Reporting 2022", "Krypton.Toolkit.Suite.Extended.Error.Reporting\Krypton.Toolkit.Suite.Extended.Error.Reporting 2022.csproj", "{3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.File.Copier 2022", "Krypton.Toolkit.Suite.Extended.File.Copier\Krypton.Toolkit.Suite.Extended.File.Copier 2022.csproj", "{14542128-1DF0-44DB-9365-1FF39324B317}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Floating.Toolbars 2022", "Krypton.Toolkit.Suite.Extended.Floating.Toolbars\Krypton.Toolkit.Suite.Extended.Floating.Toolbars 2022.csproj", "{4804A209-411D-43E5-B104-77D6A19131E2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Messagebox 2022", "Krypton.Toolkit.Suite.Extended.Messagebox\Krypton.Toolkit.Suite.Extended.Messagebox 2022.csproj", "{FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Memory.Box 2022", "Krypton.Toolkit.Suite.Extended.Memory.Box\Krypton.Toolkit.Suite.Extended.Memory.Box 2022.csproj", "{4C448625-CBCB-4147-9288-659906B17C28}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Navi.Suite 2022", "Krypton.Toolkit.Suite.Extended.Navi.Suite\Krypton.Toolkit.Suite.Extended.Navi.Suite 2022.csproj", "{AA7EBA51-F1BA-4A45-9344-22F4E173109A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Navigator 2022", "Krypton.Toolkit.Suite.Extended.Navigator\Krypton.Toolkit.Suite.Extended.Navigator 2022.csproj", "{65DDD9BE-D9BB-456A-97D4-D0B75607F657}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Networking 2022", "Krypton.Toolkit.Suite.Extended.Networking\Krypton.Toolkit.Suite.Extended.Networking 2022.csproj", "{B9D53724-D2C8-4067-8146-15C04533BAE3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Notifications 2022", "Krypton.Toolkit.Suite.Extended.Notifications\Krypton.Toolkit.Suite.Extended.Notifications 2022.csproj", "{A7DFFED4-3872-491C-B560-C8E4E4733A4D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Drawing.Utilities 2022", "Krypton.Toolkit.Suite.Extended.Drawing.Utilities\Krypton.Toolkit.Suite.Extended.Drawing.Utilities 2022.csproj", "{F33622D3-84D1-4C58-9241-45243882739C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.IO 2022", "Krypton.Toolkit.Suite.Extended.IO\Krypton.Toolkit.Suite.Extended.IO 2022.csproj", "{62253CD1-5FFB-4B07-82E9-00C978A96478}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Software.Updater 2022", "Krypton.Toolkit.Suite.Extended.Software.Updater\Krypton.Toolkit.Suite.Extended.Software.Updater 2022.csproj", "{A5FA199B-9AA4-4061-AE07-3036A115AA24}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Specialised.Dialogs 2022", "Krypton.Toolkit.Suite.Extended.Specialised.Dialogs\Krypton.Toolkit.Suite.Extended.Specialised.Dialogs 2022.csproj", "{2C946C86-12F4-40A3-B964-09C71DA3B845}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Software.Updater.Core 2022", "Krypton.Toolkit.Suite.Extended.Software.Updater.Core\Krypton.Toolkit.Suite.Extended.Software.Updater.Core 2022.csproj", "{5C2389E8-1198-48D2-BDCC-44F74BE6B294}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ZipExtractor", "ZipExtractor\ZipExtractor.csproj", "{1126FD6E-8A3E-4C93-AABB-06073B27EB75}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Applications", "Applications", "{4985A154-8526-4CB0-A7DC-B39736C4A8AC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoUpdateCreator", "AutoUpdateCreator\AutoUpdateCreator.csproj", "{975DA9CB-501F-442E-8339-AF625C7A5DA4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub", "GitHub", "{5D204922-259D-4140-B115-F01EDF031B5A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Issue Templates", "Issue Templates", "{362F24FA-1AA0-4821-A539-C5A863D39B8B}" + ProjectSection(SolutionItems) = preProject + ..\..\.github\ISSUE_TEMPLATE\bug_report.md = ..\..\.github\ISSUE_TEMPLATE\bug_report.md + ..\..\.github\ISSUE_TEMPLATE\feature-request.md = ..\..\.github\ISSUE_TEMPLATE\feature-request.md + ..\..\.github\ISSUE_TEMPLATE\other-issues.md = ..\..\.github\ISSUE_TEMPLATE\other-issues.md + ..\..\.github\ISSUE_TEMPLATE\post-a-question.md = ..\..\.github\ISSUE_TEMPLATE\post-a-question.md + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Debug.Tools 2022", "Krypton.Toolkit.Suite.Extended.Debug.Tools\Krypton.Toolkit.Suite.Extended.Debug.Tools 2022.csproj", "{DDC3EC31-7D14-47BD-9DAF-24AF5B032354}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.MessageDialog", "Krypton.Toolkit.Suite.Extended.MessageDialog\Krypton.Toolkit.Suite.Extended.MessageDialog.csproj", "{B93429BE-5941-40A4-89F8-C14109959886}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.ToastNotification 2022", "Krypton.Toolkit.Suite.Extended.ToastNotification\Krypton.Toolkit.Suite.Extended.ToastNotification 2022.csproj", "{9622B3B8-E6FA-4DC6-A151-826AA0C90CE7}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documentation", "Documentation", "{74E3A6CE-ED3C-41EF-B5AC-814D289DCDE5}" +EndProject +Project("{7CF6DF6D-3B04-46F8-A40B-537D21BCA0B4}") = "Extended Toolkit API Documentation", "..\Documentation\Extended Toolkit API Documentation\Extended Toolkit API Documentation.shfbproj", "{6CFE23A2-844D-4EF5-8A75-35985B11CF34}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Canary|Any CPU = Canary|Any CPU + Debug|Any CPU = Debug|Any CPU + Nightly|Any CPU = Nightly|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E68C45C0-418B-4CFC-97C0-282798B38B37}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {E68C45C0-418B-4CFC-97C0-282798B38B37}.Canary|Any CPU.Build.0 = Canary|Any CPU + {E68C45C0-418B-4CFC-97C0-282798B38B37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E68C45C0-418B-4CFC-97C0-282798B38B37}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E68C45C0-418B-4CFC-97C0-282798B38B37}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {E68C45C0-418B-4CFC-97C0-282798B38B37}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {E68C45C0-418B-4CFC-97C0-282798B38B37}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E68C45C0-418B-4CFC-97C0-282798B38B37}.Release|Any CPU.Build.0 = Release|Any CPU + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Canary|Any CPU.Build.0 = Canary|Any CPU + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Debug|Any CPU.Build.0 = Debug|Any CPU + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Release|Any CPU.ActiveCfg = Release|Any CPU + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Release|Any CPU.Build.0 = Release|Any CPU + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Canary|Any CPU.Build.0 = Canary|Any CPU + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Release|Any CPU.Build.0 = Release|Any CPU + {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Canary|Any CPU.Build.0 = Canary|Any CPU + {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Release|Any CPU.Build.0 = Release|Any CPU + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Canary|Any CPU.Build.0 = Canary|Any CPU + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Release|Any CPU.Build.0 = Release|Any CPU + {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Canary|Any CPU.Build.0 = Canary|Any CPU + {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Release|Any CPU.Build.0 = Release|Any CPU + {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Canary|Any CPU.Build.0 = Canary|Any CPU + {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Release|Any CPU.Build.0 = Release|Any CPU + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Canary|Any CPU.Build.0 = Canary|Any CPU + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Release|Any CPU.Build.0 = Release|Any CPU + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Canary|Any CPU.Build.0 = Canary|Any CPU + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Release|Any CPU.Build.0 = Release|Any CPU + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Canary|Any CPU.Build.0 = Canary|Any CPU + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Release|Any CPU.Build.0 = Release|Any CPU + {E66AA060-36AC-4C48-98B5-41701F5524A6}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {E66AA060-36AC-4C48-98B5-41701F5524A6}.Canary|Any CPU.Build.0 = Canary|Any CPU + {E66AA060-36AC-4C48-98B5-41701F5524A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E66AA060-36AC-4C48-98B5-41701F5524A6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E66AA060-36AC-4C48-98B5-41701F5524A6}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {E66AA060-36AC-4C48-98B5-41701F5524A6}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {E66AA060-36AC-4C48-98B5-41701F5524A6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E66AA060-36AC-4C48-98B5-41701F5524A6}.Release|Any CPU.Build.0 = Release|Any CPU + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Canary|Any CPU.Build.0 = Canary|Any CPU + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Release|Any CPU.Build.0 = Release|Any CPU + {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Canary|Any CPU.Build.0 = Canary|Any CPU + {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Release|Any CPU.Build.0 = Release|Any CPU + {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Canary|Any CPU.Build.0 = Canary|Any CPU + {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Release|Any CPU.Build.0 = Release|Any CPU + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Canary|Any CPU.Build.0 = Canary|Any CPU + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Release|Any CPU.Build.0 = Release|Any CPU + {062AB625-3AAB-46ED-891D-E7103D1F7EBE}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {062AB625-3AAB-46ED-891D-E7103D1F7EBE}.Canary|Any CPU.Build.0 = Canary|Any CPU + {062AB625-3AAB-46ED-891D-E7103D1F7EBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {062AB625-3AAB-46ED-891D-E7103D1F7EBE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {062AB625-3AAB-46ED-891D-E7103D1F7EBE}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {062AB625-3AAB-46ED-891D-E7103D1F7EBE}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {062AB625-3AAB-46ED-891D-E7103D1F7EBE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {062AB625-3AAB-46ED-891D-E7103D1F7EBE}.Release|Any CPU.Build.0 = Release|Any CPU + {3804493B-31D2-4D70-89EF-EDED205037EC}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {3804493B-31D2-4D70-89EF-EDED205037EC}.Canary|Any CPU.Build.0 = Canary|Any CPU + {3804493B-31D2-4D70-89EF-EDED205037EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3804493B-31D2-4D70-89EF-EDED205037EC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3804493B-31D2-4D70-89EF-EDED205037EC}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {3804493B-31D2-4D70-89EF-EDED205037EC}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {3804493B-31D2-4D70-89EF-EDED205037EC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3804493B-31D2-4D70-89EF-EDED205037EC}.Release|Any CPU.Build.0 = Release|Any CPU + {66B492AC-74E6-4951-9376-47B4B7BA43EB}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {66B492AC-74E6-4951-9376-47B4B7BA43EB}.Canary|Any CPU.Build.0 = Canary|Any CPU + {66B492AC-74E6-4951-9376-47B4B7BA43EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {66B492AC-74E6-4951-9376-47B4B7BA43EB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {66B492AC-74E6-4951-9376-47B4B7BA43EB}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {66B492AC-74E6-4951-9376-47B4B7BA43EB}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {66B492AC-74E6-4951-9376-47B4B7BA43EB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {66B492AC-74E6-4951-9376-47B4B7BA43EB}.Release|Any CPU.Build.0 = Release|Any CPU + {8FD6FEBA-B906-4C66-9A8D-E370B961162C}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {8FD6FEBA-B906-4C66-9A8D-E370B961162C}.Canary|Any CPU.Build.0 = Canary|Any CPU + {8FD6FEBA-B906-4C66-9A8D-E370B961162C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8FD6FEBA-B906-4C66-9A8D-E370B961162C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8FD6FEBA-B906-4C66-9A8D-E370B961162C}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {8FD6FEBA-B906-4C66-9A8D-E370B961162C}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {8FD6FEBA-B906-4C66-9A8D-E370B961162C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8FD6FEBA-B906-4C66-9A8D-E370B961162C}.Release|Any CPU.Build.0 = Release|Any CPU + {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F}.Canary|Any CPU.Build.0 = Canary|Any CPU + {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F}.Release|Any CPU.Build.0 = Release|Any CPU + {A55B5F11-F812-4FF4-900C-B12601B34E52}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {A55B5F11-F812-4FF4-900C-B12601B34E52}.Canary|Any CPU.Build.0 = Canary|Any CPU + {A55B5F11-F812-4FF4-900C-B12601B34E52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A55B5F11-F812-4FF4-900C-B12601B34E52}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A55B5F11-F812-4FF4-900C-B12601B34E52}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {A55B5F11-F812-4FF4-900C-B12601B34E52}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {A55B5F11-F812-4FF4-900C-B12601B34E52}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A55B5F11-F812-4FF4-900C-B12601B34E52}.Release|Any CPU.Build.0 = Release|Any CPU + {34F32E4D-79EF-4447-A585-B1A79BF1C3C3}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {34F32E4D-79EF-4447-A585-B1A79BF1C3C3}.Canary|Any CPU.Build.0 = Canary|Any CPU + {34F32E4D-79EF-4447-A585-B1A79BF1C3C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {34F32E4D-79EF-4447-A585-B1A79BF1C3C3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {34F32E4D-79EF-4447-A585-B1A79BF1C3C3}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {34F32E4D-79EF-4447-A585-B1A79BF1C3C3}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {34F32E4D-79EF-4447-A585-B1A79BF1C3C3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {34F32E4D-79EF-4447-A585-B1A79BF1C3C3}.Release|Any CPU.Build.0 = Release|Any CPU + {18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC}.Canary|Any CPU.Build.0 = Canary|Any CPU + {18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC}.Release|Any CPU.Build.0 = Release|Any CPU + {EE0904D6-72EF-4107-A286-CB5EEC2A5CE0}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {EE0904D6-72EF-4107-A286-CB5EEC2A5CE0}.Canary|Any CPU.Build.0 = Canary|Any CPU + {EE0904D6-72EF-4107-A286-CB5EEC2A5CE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EE0904D6-72EF-4107-A286-CB5EEC2A5CE0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EE0904D6-72EF-4107-A286-CB5EEC2A5CE0}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {EE0904D6-72EF-4107-A286-CB5EEC2A5CE0}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {EE0904D6-72EF-4107-A286-CB5EEC2A5CE0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EE0904D6-72EF-4107-A286-CB5EEC2A5CE0}.Release|Any CPU.Build.0 = Release|Any CPU + {2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB}.Canary|Any CPU.Build.0 = Canary|Any CPU + {2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB}.Release|Any CPU.Build.0 = Release|Any CPU + {335DD135-6475-46D5-A7DB-EA329224D59E}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {335DD135-6475-46D5-A7DB-EA329224D59E}.Canary|Any CPU.Build.0 = Canary|Any CPU + {335DD135-6475-46D5-A7DB-EA329224D59E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {335DD135-6475-46D5-A7DB-EA329224D59E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {335DD135-6475-46D5-A7DB-EA329224D59E}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {335DD135-6475-46D5-A7DB-EA329224D59E}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {335DD135-6475-46D5-A7DB-EA329224D59E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {335DD135-6475-46D5-A7DB-EA329224D59E}.Release|Any CPU.Build.0 = Release|Any CPU + {CB1E8B1F-E019-498A-8E4E-117012F6368C}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {CB1E8B1F-E019-498A-8E4E-117012F6368C}.Canary|Any CPU.Build.0 = Canary|Any CPU + {CB1E8B1F-E019-498A-8E4E-117012F6368C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CB1E8B1F-E019-498A-8E4E-117012F6368C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CB1E8B1F-E019-498A-8E4E-117012F6368C}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {CB1E8B1F-E019-498A-8E4E-117012F6368C}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {CB1E8B1F-E019-498A-8E4E-117012F6368C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CB1E8B1F-E019-498A-8E4E-117012F6368C}.Release|Any CPU.Build.0 = Release|Any CPU + {9FCE31CF-18F7-4F24-8B73-799B3CB19D57}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {9FCE31CF-18F7-4F24-8B73-799B3CB19D57}.Canary|Any CPU.Build.0 = Canary|Any CPU + {9FCE31CF-18F7-4F24-8B73-799B3CB19D57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9FCE31CF-18F7-4F24-8B73-799B3CB19D57}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9FCE31CF-18F7-4F24-8B73-799B3CB19D57}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {9FCE31CF-18F7-4F24-8B73-799B3CB19D57}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {9FCE31CF-18F7-4F24-8B73-799B3CB19D57}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9FCE31CF-18F7-4F24-8B73-799B3CB19D57}.Release|Any CPU.Build.0 = Release|Any CPU + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Canary|Any CPU.Build.0 = Canary|Any CPU + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Release|Any CPU.Build.0 = Release|Any CPU + {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Canary|Any CPU.Build.0 = Canary|Any CPU + {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Release|Any CPU.Build.0 = Release|Any CPU + {A7C0B094-539C-4283-AA9A-3959749886B7}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {A7C0B094-539C-4283-AA9A-3959749886B7}.Canary|Any CPU.Build.0 = Canary|Any CPU + {A7C0B094-539C-4283-AA9A-3959749886B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A7C0B094-539C-4283-AA9A-3959749886B7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A7C0B094-539C-4283-AA9A-3959749886B7}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {A7C0B094-539C-4283-AA9A-3959749886B7}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {A7C0B094-539C-4283-AA9A-3959749886B7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A7C0B094-539C-4283-AA9A-3959749886B7}.Release|Any CPU.Build.0 = Release|Any CPU + {BE3A7DFA-3616-4840-B9CC-09E96CC894B4}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {BE3A7DFA-3616-4840-B9CC-09E96CC894B4}.Canary|Any CPU.Build.0 = Canary|Any CPU + {BE3A7DFA-3616-4840-B9CC-09E96CC894B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE3A7DFA-3616-4840-B9CC-09E96CC894B4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE3A7DFA-3616-4840-B9CC-09E96CC894B4}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {BE3A7DFA-3616-4840-B9CC-09E96CC894B4}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {BE3A7DFA-3616-4840-B9CC-09E96CC894B4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE3A7DFA-3616-4840-B9CC-09E96CC894B4}.Release|Any CPU.Build.0 = Release|Any CPU + {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Canary|Any CPU.Build.0 = Canary|Any CPU + {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Nightly|Any CPU.ActiveCfg = Debug|Any CPU + {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Nightly|Any CPU.Build.0 = Debug|Any CPU + {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Release|Any CPU.Build.0 = Release|Any CPU + {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Canary|Any CPU.ActiveCfg = Debug|Any CPU + {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Canary|Any CPU.Build.0 = Debug|Any CPU + {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Nightly|Any CPU.ActiveCfg = Debug|Any CPU + {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Nightly|Any CPU.Build.0 = Debug|Any CPU + {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Release|Any CPU.Build.0 = Release|Any CPU + {5E23D530-6349-4786-AA2D-F1DD9CC1586E}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {5E23D530-6349-4786-AA2D-F1DD9CC1586E}.Canary|Any CPU.Build.0 = Canary|Any CPU + {5E23D530-6349-4786-AA2D-F1DD9CC1586E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5E23D530-6349-4786-AA2D-F1DD9CC1586E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5E23D530-6349-4786-AA2D-F1DD9CC1586E}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {5E23D530-6349-4786-AA2D-F1DD9CC1586E}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {5E23D530-6349-4786-AA2D-F1DD9CC1586E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5E23D530-6349-4786-AA2D-F1DD9CC1586E}.Release|Any CPU.Build.0 = Release|Any CPU + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Canary|Any CPU.Build.0 = Canary|Any CPU + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Release|Any CPU.Build.0 = Release|Any CPU + {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Canary|Any CPU.Build.0 = Canary|Any CPU + {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Release|Any CPU.Build.0 = Release|Any CPU + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Canary|Any CPU.Build.0 = Canary|Any CPU + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Release|Any CPU.Build.0 = Release|Any CPU + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Canary|Any CPU.Build.0 = Canary|Any CPU + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Release|Any CPU.Build.0 = Release|Any CPU + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Canary|Any CPU.Build.0 = Canary|Any CPU + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Release|Any CPU.Build.0 = Release|Any CPU + {558D7C96-4E2D-4679-8D1A-508E734855D8}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {558D7C96-4E2D-4679-8D1A-508E734855D8}.Canary|Any CPU.Build.0 = Canary|Any CPU + {558D7C96-4E2D-4679-8D1A-508E734855D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {558D7C96-4E2D-4679-8D1A-508E734855D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {558D7C96-4E2D-4679-8D1A-508E734855D8}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {558D7C96-4E2D-4679-8D1A-508E734855D8}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {558D7C96-4E2D-4679-8D1A-508E734855D8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {558D7C96-4E2D-4679-8D1A-508E734855D8}.Release|Any CPU.Build.0 = Release|Any CPU + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Canary|Any CPU.Build.0 = Canary|Any CPU + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Release|Any CPU.Build.0 = Release|Any CPU + {AA363B11-8B13-4333-85E1-8623D21E1202}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {AA363B11-8B13-4333-85E1-8623D21E1202}.Canary|Any CPU.Build.0 = Canary|Any CPU + {AA363B11-8B13-4333-85E1-8623D21E1202}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AA363B11-8B13-4333-85E1-8623D21E1202}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AA363B11-8B13-4333-85E1-8623D21E1202}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {AA363B11-8B13-4333-85E1-8623D21E1202}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {AA363B11-8B13-4333-85E1-8623D21E1202}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AA363B11-8B13-4333-85E1-8623D21E1202}.Release|Any CPU.Build.0 = Release|Any CPU + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Canary|Any CPU.Build.0 = Canary|Any CPU + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Release|Any CPU.Build.0 = Release|Any CPU + {14542128-1DF0-44DB-9365-1FF39324B317}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {14542128-1DF0-44DB-9365-1FF39324B317}.Canary|Any CPU.Build.0 = Canary|Any CPU + {14542128-1DF0-44DB-9365-1FF39324B317}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {14542128-1DF0-44DB-9365-1FF39324B317}.Debug|Any CPU.Build.0 = Debug|Any CPU + {14542128-1DF0-44DB-9365-1FF39324B317}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {14542128-1DF0-44DB-9365-1FF39324B317}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {14542128-1DF0-44DB-9365-1FF39324B317}.Release|Any CPU.ActiveCfg = Release|Any CPU + {14542128-1DF0-44DB-9365-1FF39324B317}.Release|Any CPU.Build.0 = Release|Any CPU + {4804A209-411D-43E5-B104-77D6A19131E2}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {4804A209-411D-43E5-B104-77D6A19131E2}.Canary|Any CPU.Build.0 = Canary|Any CPU + {4804A209-411D-43E5-B104-77D6A19131E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4804A209-411D-43E5-B104-77D6A19131E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4804A209-411D-43E5-B104-77D6A19131E2}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {4804A209-411D-43E5-B104-77D6A19131E2}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {4804A209-411D-43E5-B104-77D6A19131E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4804A209-411D-43E5-B104-77D6A19131E2}.Release|Any CPU.Build.0 = Release|Any CPU + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Canary|Any CPU.Build.0 = Canary|Any CPU + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Release|Any CPU.Build.0 = Release|Any CPU + {4C448625-CBCB-4147-9288-659906B17C28}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {4C448625-CBCB-4147-9288-659906B17C28}.Canary|Any CPU.Build.0 = Canary|Any CPU + {4C448625-CBCB-4147-9288-659906B17C28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4C448625-CBCB-4147-9288-659906B17C28}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4C448625-CBCB-4147-9288-659906B17C28}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {4C448625-CBCB-4147-9288-659906B17C28}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {4C448625-CBCB-4147-9288-659906B17C28}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4C448625-CBCB-4147-9288-659906B17C28}.Release|Any CPU.Build.0 = Release|Any CPU + {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Canary|Any CPU.Build.0 = Canary|Any CPU + {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Release|Any CPU.Build.0 = Release|Any CPU + {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Canary|Any CPU.Build.0 = Canary|Any CPU + {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Release|Any CPU.Build.0 = Release|Any CPU + {B9D53724-D2C8-4067-8146-15C04533BAE3}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {B9D53724-D2C8-4067-8146-15C04533BAE3}.Canary|Any CPU.Build.0 = Canary|Any CPU + {B9D53724-D2C8-4067-8146-15C04533BAE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B9D53724-D2C8-4067-8146-15C04533BAE3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B9D53724-D2C8-4067-8146-15C04533BAE3}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {B9D53724-D2C8-4067-8146-15C04533BAE3}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {B9D53724-D2C8-4067-8146-15C04533BAE3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B9D53724-D2C8-4067-8146-15C04533BAE3}.Release|Any CPU.Build.0 = Release|Any CPU + {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Canary|Any CPU.Build.0 = Canary|Any CPU + {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Release|Any CPU.Build.0 = Release|Any CPU + {F33622D3-84D1-4C58-9241-45243882739C}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {F33622D3-84D1-4C58-9241-45243882739C}.Canary|Any CPU.Build.0 = Canary|Any CPU + {F33622D3-84D1-4C58-9241-45243882739C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F33622D3-84D1-4C58-9241-45243882739C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F33622D3-84D1-4C58-9241-45243882739C}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {F33622D3-84D1-4C58-9241-45243882739C}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {F33622D3-84D1-4C58-9241-45243882739C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F33622D3-84D1-4C58-9241-45243882739C}.Release|Any CPU.Build.0 = Release|Any CPU + {62253CD1-5FFB-4B07-82E9-00C978A96478}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {62253CD1-5FFB-4B07-82E9-00C978A96478}.Canary|Any CPU.Build.0 = Canary|Any CPU + {62253CD1-5FFB-4B07-82E9-00C978A96478}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {62253CD1-5FFB-4B07-82E9-00C978A96478}.Debug|Any CPU.Build.0 = Debug|Any CPU + {62253CD1-5FFB-4B07-82E9-00C978A96478}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {62253CD1-5FFB-4B07-82E9-00C978A96478}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {62253CD1-5FFB-4B07-82E9-00C978A96478}.Release|Any CPU.ActiveCfg = Release|Any CPU + {62253CD1-5FFB-4B07-82E9-00C978A96478}.Release|Any CPU.Build.0 = Release|Any CPU + {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Canary|Any CPU.Build.0 = Canary|Any CPU + {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Release|Any CPU.Build.0 = Release|Any CPU + {2C946C86-12F4-40A3-B964-09C71DA3B845}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {2C946C86-12F4-40A3-B964-09C71DA3B845}.Canary|Any CPU.Build.0 = Canary|Any CPU + {2C946C86-12F4-40A3-B964-09C71DA3B845}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2C946C86-12F4-40A3-B964-09C71DA3B845}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2C946C86-12F4-40A3-B964-09C71DA3B845}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {2C946C86-12F4-40A3-B964-09C71DA3B845}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {2C946C86-12F4-40A3-B964-09C71DA3B845}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2C946C86-12F4-40A3-B964-09C71DA3B845}.Release|Any CPU.Build.0 = Release|Any CPU + {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Canary|Any CPU.Build.0 = Canary|Any CPU + {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Release|Any CPU.Build.0 = Release|Any CPU + {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Canary|Any CPU.Build.0 = Canary|Any CPU + {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Release|Any CPU.Build.0 = Release|Any CPU + {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Canary|Any CPU.Build.0 = Canary|Any CPU + {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Release|Any CPU.Build.0 = Release|Any CPU + {DDC3EC31-7D14-47BD-9DAF-24AF5B032354}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {DDC3EC31-7D14-47BD-9DAF-24AF5B032354}.Canary|Any CPU.Build.0 = Canary|Any CPU + {DDC3EC31-7D14-47BD-9DAF-24AF5B032354}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DDC3EC31-7D14-47BD-9DAF-24AF5B032354}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DDC3EC31-7D14-47BD-9DAF-24AF5B032354}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {DDC3EC31-7D14-47BD-9DAF-24AF5B032354}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {DDC3EC31-7D14-47BD-9DAF-24AF5B032354}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DDC3EC31-7D14-47BD-9DAF-24AF5B032354}.Release|Any CPU.Build.0 = Release|Any CPU + {B93429BE-5941-40A4-89F8-C14109959886}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {B93429BE-5941-40A4-89F8-C14109959886}.Canary|Any CPU.Build.0 = Canary|Any CPU + {B93429BE-5941-40A4-89F8-C14109959886}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B93429BE-5941-40A4-89F8-C14109959886}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B93429BE-5941-40A4-89F8-C14109959886}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {B93429BE-5941-40A4-89F8-C14109959886}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {B93429BE-5941-40A4-89F8-C14109959886}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B93429BE-5941-40A4-89F8-C14109959886}.Release|Any CPU.Build.0 = Release|Any CPU + {9622B3B8-E6FA-4DC6-A151-826AA0C90CE7}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {9622B3B8-E6FA-4DC6-A151-826AA0C90CE7}.Canary|Any CPU.Build.0 = Canary|Any CPU + {9622B3B8-E6FA-4DC6-A151-826AA0C90CE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9622B3B8-E6FA-4DC6-A151-826AA0C90CE7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9622B3B8-E6FA-4DC6-A151-826AA0C90CE7}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {9622B3B8-E6FA-4DC6-A151-826AA0C90CE7}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {9622B3B8-E6FA-4DC6-A151-826AA0C90CE7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9622B3B8-E6FA-4DC6-A151-826AA0C90CE7}.Release|Any CPU.Build.0 = Release|Any CPU + {6CFE23A2-844D-4EF5-8A75-35985B11CF34}.Canary|Any CPU.ActiveCfg = Canary|Any CPU + {6CFE23A2-844D-4EF5-8A75-35985B11CF34}.Canary|Any CPU.Build.0 = Canary|Any CPU + {6CFE23A2-844D-4EF5-8A75-35985B11CF34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6CFE23A2-844D-4EF5-8A75-35985B11CF34}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6CFE23A2-844D-4EF5-8A75-35985B11CF34}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU + {6CFE23A2-844D-4EF5-8A75-35985B11CF34}.Nightly|Any CPU.Build.0 = Nightly|Any CPU + {6CFE23A2-844D-4EF5-8A75-35985B11CF34}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6CFE23A2-844D-4EF5-8A75-35985B11CF34}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {87BE2145-50BE-4A57-9C79-FCE5A64F6065} = {5D85B551-9AFC-4E96-93C3-D8D81B69971F} + {A7A69BC2-7682-43FB-8E7C-C42FDAA2A215} = {5D85B551-9AFC-4E96-93C3-D8D81B69971F} + {6B01F113-016E-445F-BE5E-80BA7144B928} = {5D85B551-9AFC-4E96-93C3-D8D81B69971F} + {404EC0E7-92CB-4E90-80F7-440A4F5D772C} = {6B01F113-016E-445F-BE5E-80BA7144B928} + {734B2F67-D055-44B2-818A-FE569C479937} = {6B01F113-016E-445F-BE5E-80BA7144B928} + {15346861-5444-49D7-9686-3835EE271259} = {6B01F113-016E-445F-BE5E-80BA7144B928} + {5E13A5BB-407A-46A5-95A8-9DA57FB21C6C} = {6B01F113-016E-445F-BE5E-80BA7144B928} + {6EFEF411-B16C-4DEA-992F-9CA767EB1265} = {6B01F113-016E-445F-BE5E-80BA7144B928} + {F96630C5-2A89-44D5-BED6-99609A6D716A} = {6B01F113-016E-445F-BE5E-80BA7144B928} + {247BBF4E-22B0-49CC-981B-0420AD7FF4E8} = {6B01F113-016E-445F-BE5E-80BA7144B928} + {071034AA-BFA3-4325-B763-E95A2E05EF4D} = {734B2F67-D055-44B2-818A-FE569C479937} + {378BEE59-0131-4497-80B8-69B3124325D7} = {734B2F67-D055-44B2-818A-FE569C479937} + {69F98672-EBB9-4B12-BD04-45AEF3C37FC6} = {15346861-5444-49D7-9686-3835EE271259} + {0451E883-C718-4679-962F-E2825B1513B2} = {247BBF4E-22B0-49CC-981B-0420AD7FF4E8} + {E68C45C0-418B-4CFC-97C0-282798B38B37} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {9CB33D7B-BF7E-4221-859D-5E61E24772E3} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {B47A7562-B3B5-4521-91DB-E5CC4CC986E3} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {B9A5A472-F747-4C87-B5E9-C5A05DB17827} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {81BCFC34-220F-43A8-A58B-8F9E123C72E1} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9} = {ADF53878-BE1F-43A3-A890-E11190BE5465} + {E66AA060-36AC-4C48-98B5-41701F5524A6} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B} = {ADF53878-BE1F-43A3-A890-E11190BE5465} + {7E1B169E-AD04-4C98-9971-DC7F450BF610} = {ADF53878-BE1F-43A3-A890-E11190BE5465} + {4545427A-2FD5-441A-A35E-F09F2AB1B20D} = {ADF53878-BE1F-43A3-A890-E11190BE5465} + {116CDDE3-823F-486E-B0AC-2F0FE810A7EF} = {ADF53878-BE1F-43A3-A890-E11190BE5465} + {062AB625-3AAB-46ED-891D-E7103D1F7EBE} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {3804493B-31D2-4D70-89EF-EDED205037EC} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {66B492AC-74E6-4951-9376-47B4B7BA43EB} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {8FD6FEBA-B906-4C66-9A8D-E370B961162C} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {A55B5F11-F812-4FF4-900C-B12601B34E52} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {34F32E4D-79EF-4447-A585-B1A79BF1C3C3} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {EE0904D6-72EF-4107-A286-CB5EEC2A5CE0} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {4696C160-BC97-414A-8D30-B09A2CA76085} = {87BE2145-50BE-4A57-9C79-FCE5A64F6065} + {9ACA6117-D269-4425-8500-6BC57560DEB2} = {87BE2145-50BE-4A57-9C79-FCE5A64F6065} + {2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {335DD135-6475-46D5-A7DB-EA329224D59E} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {241C9BD1-CB7D-4AF0-8FDB-3BCB4C98AF51} = {5D85B551-9AFC-4E96-93C3-D8D81B69971F} + {CB1E8B1F-E019-498A-8E4E-117012F6368C} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {9FCE31CF-18F7-4F24-8B73-799B3CB19D57} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {5DB6B467-9257-42D3-B81F-380B5D537C04} = {6B01F113-016E-445F-BE5E-80BA7144B928} + {1AD413AC-FAD3-4F79-A948-4FB66AF10685} = {5DB6B467-9257-42D3-B81F-380B5D537C04} + {A58A93DE-0CBF-495B-8D29-761B1143AD32} = {ADF53878-BE1F-43A3-A890-E11190BE5465} + {A7C0B094-539C-4283-AA9A-3959749886B7} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {BE3A7DFA-3616-4840-B9CC-09E96CC894B4} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {BA86BDC7-D11C-4E74-875C-B284E740B599} = {A7A69BC2-7682-43FB-8E7C-C42FDAA2A215} + {A59A87BE-E92A-4717-92DC-A2286EE812EC} = {ADF53878-BE1F-43A3-A890-E11190BE5465} + {744D6A50-F8DB-4D5F-B571-34B0597E03B8} = {0703388D-5FBE-4345-94B0-5FA9FD043079} + {5E23D530-6349-4786-AA2D-F1DD9CC1586E} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F} = {ADF53878-BE1F-43A3-A890-E11190BE5465} + {26A8A753-BC4B-4E42-B124-8EA3FA64303F} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {253E37F3-A36F-4D96-B22E-1D50C31C0D2D} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {C4D0363C-6CA9-4D47-B896-D287C1E6BD11} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {558D7C96-4E2D-4679-8D1A-508E734855D8} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {AA363B11-8B13-4333-85E1-8623D21E1202} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {14542128-1DF0-44DB-9365-1FF39324B317} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {4804A209-411D-43E5-B104-77D6A19131E2} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {4C448625-CBCB-4147-9288-659906B17C28} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {AA7EBA51-F1BA-4A45-9344-22F4E173109A} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {65DDD9BE-D9BB-456A-97D4-D0B75607F657} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {B9D53724-D2C8-4067-8146-15C04533BAE3} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {A7DFFED4-3872-491C-B560-C8E4E4733A4D} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {F33622D3-84D1-4C58-9241-45243882739C} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {62253CD1-5FFB-4B07-82E9-00C978A96478} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {A5FA199B-9AA4-4061-AE07-3036A115AA24} = {ADF53878-BE1F-43A3-A890-E11190BE5465} + {2C946C86-12F4-40A3-B964-09C71DA3B845} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {5C2389E8-1198-48D2-BDCC-44F74BE6B294} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {1126FD6E-8A3E-4C93-AABB-06073B27EB75} = {4985A154-8526-4CB0-A7DC-B39736C4A8AC} + {975DA9CB-501F-442E-8339-AF625C7A5DA4} = {4985A154-8526-4CB0-A7DC-B39736C4A8AC} + {5D204922-259D-4140-B115-F01EDF031B5A} = {5D85B551-9AFC-4E96-93C3-D8D81B69971F} + {362F24FA-1AA0-4821-A539-C5A863D39B8B} = {5D204922-259D-4140-B115-F01EDF031B5A} + {DDC3EC31-7D14-47BD-9DAF-24AF5B032354} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} + {B93429BE-5941-40A4-89F8-C14109959886} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {9622B3B8-E6FA-4DC6-A151-826AA0C90CE7} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} + {6CFE23A2-844D-4EF5-8A75-35985B11CF34} = {74E3A6CE-ED3C-41EF-B5AC-814D289DCDE5} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A7CE7732-0982-4703-8EFD-7715D569BAB5} + EndGlobalSection +EndGlobal diff --git a/Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022.sln b/Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022.sln deleted file mode 100644 index 673c17598..000000000 --- a/Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022.sln +++ /dev/null @@ -1,875 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31825.309 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Main", "Main", "{252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Repository Items", "Repository Items", "{5D85B551-9AFC-4E96-93C3-D8D81B69971F}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build System", "Build System", "{87BE2145-50BE-4A57-9C79-FCE5A64F6065}" - ProjectSection(SolutionItems) = preProject - ..\..\build.cmd = ..\..\build.cmd - ..\..\build.proj = ..\..\build.proj - ..\..\debug.cmd = ..\..\debug.cmd - ..\..\debug.proj = ..\..\debug.proj - ..\..\purge.cmd = ..\..\purge.cmd - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Markdown", "Markdown", "{A7A69BC2-7682-43FB-8E7C-C42FDAA2A215}" - ProjectSection(SolutionItems) = preProject - ..\..\Documents\Help\Changelog.md = ..\..\Documents\Help\Changelog.md - ..\..\Documents\Examples\Examples.md = ..\..\Documents\Examples\Examples.md - ..\..\Documents\Modules\NuGet Package Information.md = ..\..\Documents\Modules\NuGet Package Information.md - ..\..\Documents\Help\Prerequisites.md = ..\..\Documents\Help\Prerequisites.md - ..\..\README.md = ..\..\README.md - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Assets", "Assets", "{6B01F113-016E-445F-BE5E-80BA7144B928}" - ProjectSection(SolutionItems) = preProject - ..\..\Assets\ToggleSwich.bmp = ..\..\Assets\ToggleSwich.bmp - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{404EC0E7-92CB-4E90-80F7-440A4F5D772C}" - ProjectSection(SolutionItems) = preProject - ..\..\Assets\Examples\CircularProgressBar.png = ..\..\Assets\Examples\CircularProgressBar.png - ..\..\Assets\Examples\CommandLinks.png = ..\..\Assets\Examples\CommandLinks.png - ..\..\Assets\Examples\ExtendedKryptonMessageBox1.png = ..\..\Assets\Examples\ExtendedKryptonMessageBox1.png - ..\..\Assets\Examples\ExtendedKryptonMessageBox2.png = ..\..\Assets\Examples\ExtendedKryptonMessageBox2.png - ..\..\Assets\Examples\FloatableToolStrip.png = ..\..\Assets\Examples\FloatableToolStrip.png - ..\..\Assets\Examples\FlotableMenuStrip.png = ..\..\Assets\Examples\FlotableMenuStrip.png - ..\..\Assets\Examples\KryptonColourMixer.png = ..\..\Assets\Examples\KryptonColourMixer.png - ..\..\Assets\Examples\KryptonColourWheel.png = ..\..\Assets\Examples\KryptonColourWheel.png - ..\..\Assets\Examples\KryptonInputBoxExtended.png = ..\..\Assets\Examples\KryptonInputBoxExtended.png - ..\..\Assets\Examples\KryptonKnobControl.png = ..\..\Assets\Examples\KryptonKnobControl.png - ..\..\Assets\Examples\KryptonPaletteColourShader.png = ..\..\Assets\Examples\KryptonPaletteColourShader.png - ..\..\Assets\Examples\KryptonPropertyGrid.png = ..\..\Assets\Examples\KryptonPropertyGrid.png - ..\..\Assets\Examples\KryptonScrollBars.png = ..\..\Assets\Examples\KryptonScrollBars.png - ..\..\Assets\Examples\KryptonThemeSelector.png = ..\..\Assets\Examples\KryptonThemeSelector.png - ..\..\Assets\Examples\KryptonToastNotificationV1.png = ..\..\Assets\Examples\KryptonToastNotificationV1.png - ..\..\Assets\Examples\KryptonToggleSwitch.png = ..\..\Assets\Examples\KryptonToggleSwitch.png - ..\..\Assets\Examples\KryptonViewBar.png = ..\..\Assets\Examples\KryptonViewBar.png - ..\..\Assets\Examples\TreeViews.png = ..\..\Assets\Examples\TreeViews.png - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ICO", "ICO", "{734B2F67-D055-44B2-818A-FE569C479937}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "JPEG", "JPEG", "{15346861-5444-49D7-9686-3835EE271259}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "License", "License", "{5E13A5BB-407A-46A5-95A8-9DA57FB21C6C}" - ProjectSection(SolutionItems) = preProject - ..\..\Assets\License\LICENSE.md = ..\..\Assets\License\LICENSE.md - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Package Icon", "Package Icon", "{6EFEF411-B16C-4DEA-992F-9CA767EB1265}" - ProjectSection(SolutionItems) = preProject - ..\..\Assets\Package Icon\Canary_Icon_128_x_128.png = ..\..\Assets\Package Icon\Canary_Icon_128_x_128.png - ..\..\Assets\Package Icon\Stable_Icon_128_x_128.png = ..\..\Assets\Package Icon\Stable_Icon_128_x_128.png - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PNG", "PNG", "{F96630C5-2A89-44D5-BED6-99609A6D716A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PSD", "PSD", "{247BBF4E-22B0-49CC-981B-0420AD7FF4E8}" - ProjectSection(SolutionItems) = preProject - ..\..\Assets\PSD\Command Link Button.psd = ..\..\Assets\PSD\Command Link Button.psd - ..\..\Assets\PSD\Main Icon 512 x 512 Canary.psd = ..\..\Assets\PSD\Main Icon 512 x 512 Canary.psd - ..\..\Assets\PSD\Main Icon 512 x 512 Nightly.psd = ..\..\Assets\PSD\Main Icon 512 x 512 Nightly.psd - ..\..\Assets\PSD\PE Icon 512 x 512.psd = ..\..\Assets\PSD\PE Icon 512 x 512.psd - ..\..\Assets\PSD\Square Design 512 x 512 Orange.psd = ..\..\Assets\PSD\Square Design 512 x 512 Orange.psd - ..\..\Assets\PSD\ToggleSwich.psd = ..\..\Assets\PSD\ToggleSwich.psd - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "48 x 48", "48 x 48", "{071034AA-BFA3-4325-B763-E95A2E05EF4D}" - ProjectSection(SolutionItems) = preProject - ..\..\Assets\ICO\48 x 48\KR 48 x 48 Orange.ico = ..\..\Assets\ICO\48 x 48\KR 48 x 48 Orange.ico - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "256 x 256", "256 x 256", "{378BEE59-0131-4497-80B8-69B3124325D7}" - ProjectSection(SolutionItems) = preProject - ..\..\Assets\ICO\256 x 256\KR 256 x 256 Orange.ico = ..\..\Assets\ICO\256 x 256\KR 256 x 256 Orange.ico - ..\..\Assets\ICO\256 x 256\PE Icon 256 x 256.ico = ..\..\Assets\ICO\256 x 256\PE Icon 256 x 256.ico - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "48 x 48", "48 x 48", "{69F98672-EBB9-4B12-BD04-45AEF3C37FC6}" - ProjectSection(SolutionItems) = preProject - ..\..\Assets\JPEG\48 x 48\Logo Stable.jpg = ..\..\Assets\JPEG\48 x 48\Logo Stable.jpg - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Arrows", "Arrows", "{0451E883-C718-4679-962F-E2825B1513B2}" - ProjectSection(SolutionItems) = preProject - ..\..\Assets\PSD\Arrows\Arrow-1.psd = ..\..\Assets\PSD\Arrows\Arrow-1.psd - ..\..\Assets\PSD\Arrows\Arrow-2.psd = ..\..\Assets\PSD\Arrows\Arrow-2.psd - ..\..\Assets\PSD\Arrows\Arrow-3.psd = ..\..\Assets\PSD\Arrows\Arrow-3.psd - ..\..\Assets\PSD\Arrows\Arrow-4.psd = ..\..\Assets\PSD\Arrows\Arrow-4.psd - ..\..\Assets\PSD\Arrows\Template.psd = ..\..\Assets\PSD\Arrows\Template.psd - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FDDE0872-007C-4945-9D20-C9011C37204B}" - ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig - .nuspec = .nuspec - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Core 2022", "Krypton.Toolkit.Suite.Extended.Core\Krypton.Toolkit.Suite.Extended.Core 2022.csproj", "{E68C45C0-418B-4CFC-97C0-282798B38B37}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Common 2022", "Krypton.Toolkit.Suite.Extended.Common\Krypton.Toolkit.Suite.Extended.Common 2022.csproj", "{57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Developer.Utilities 2022", "Krypton.Toolkit.Suite.Extended.Developer.Utilities\Krypton.Toolkit.Suite.Extended.Developer.Utilities 2022.csproj", "{58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Drawing 2022", "Krypton.Toolkit.Suite.Extended.Drawing\Krypton.Toolkit.Suite.Extended.Drawing 2022.csproj", "{9CB33D7B-BF7E-4221-859D-5E61E24772E3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Effects 2022", "Krypton.Toolkit.Suite.Extended.Effects\Krypton.Toolkit.Suite.Extended.Effects 2022.csproj", "{B47A7562-B3B5-4521-91DB-E5CC4CC986E3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Global.Utilities 2022", "Krypton.Toolkit.Suite.Extended.Global.Utilities\Krypton.Toolkit.Suite.Extended.Global.Utilities 2022.csproj", "{B9A5A472-F747-4C87-B5E9-C5A05DB17827}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Language.Model 2022", "Krypton.Toolkit.Suite.Extended.Language.Model\Krypton.Toolkit.Suite.Extended.Language.Model 2022.csproj", "{81BCFC34-220F-43A8-A58B-8F9E123C72E1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Resources 2022", "Krypton.Toolkit.Suite.Extended.Resources\Krypton.Toolkit.Suite.Extended.Resources 2022.csproj", "{4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Settings 2022", "Krypton.Toolkit.Suite.Extended.Settings\Krypton.Toolkit.Suite.Extended.Settings 2022.csproj", "{C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Tools 2022", "Krypton.Toolkit.Suite.Extended.Tools\Krypton.Toolkit.Suite.Extended.Tools 2022.csproj", "{CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Utilities 2022", "Krypton.Toolkit.Suite.Extended.Utilities\Krypton.Toolkit.Suite.Extended.Utilities 2022.csproj", "{E66AA060-36AC-4C48-98B5-41701F5524A6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.File.Explorer 2022", "Krypton.Toolkit.Suite.Extended.File.Explorer\Krypton.Toolkit.Suite.Extended.File.Explorer 2022.csproj", "{1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Gages 2022", "Krypton.Toolkit.Suite.Extended.Gages\Krypton.Toolkit.Suite.Extended.Gages 2022.csproj", "{7E1B169E-AD04-4C98-9971-DC7F450BF610}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Palette.Selectors 2022", "Krypton.Toolkit.Suite.Extended.Palette.Selectors\Krypton.Toolkit.Suite.Extended.Palette.Selectors 2022.csproj", "{4545427A-2FD5-441A-A35E-F09F2AB1B20D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.TaskDialogs 2022", "Krypton.Toolkit.Suite.Extended.TaskDialogs\Krypton.Toolkit.Suite.Extended.TaskDialogs 2022.csproj", "{116CDDE3-823F-486E-B0AC-2F0FE810A7EF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Theme.Switcher 2022", "Krypton.Toolkit.Suite.Extended.Theme.Switcher\Krypton.Toolkit.Suite.Extended.Theme.Switcher 2022.csproj", "{062AB625-3AAB-46ED-891D-E7103D1F7EBE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Toggle.Switch 2022", "Krypton.Toolkit.Suite.Extended.Toggle.Switch\Krypton.Toolkit.Suite.Extended.Toggle.Switch 2022.csproj", "{3804493B-31D2-4D70-89EF-EDED205037EC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Tool.Box 2022", "Krypton.Toolkit.Suite.Extended.Tool.Box\Krypton.Toolkit.Suite.Extended.Tool.Box 2022.csproj", "{66B492AC-74E6-4951-9376-47B4B7BA43EB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Tool.Strip.Items 2022", "Krypton.Toolkit.Suite.Extended.Tool.Strip.Items\Krypton.Toolkit.Suite.Extended.Tool.Strip.Items 2022.csproj", "{8FD6FEBA-B906-4C66-9A8D-E370B961162C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Wizard 2022", "Krypton.Toolkit.Suite.Extended.Wizard\Krypton.Toolkit.Suite.Extended.Wizard 2022.csproj", "{6353C3DA-7BCE-4D1E-844D-70A4B8401E7F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.DataGridView 2022", "Krypton.Toolkit.Suite.Extended.DataGridView\Krypton.Toolkit.Suite.Extended.DataGridView 2022.csproj", "{A55B5F11-F812-4FF4-900C-B12601B34E52}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.TreeGridView 2022", "Krypton.Toolkit.Suite.Extended.TreeGridView\Krypton.Toolkit.Suite.Extended.TreeGridView 2022.csproj", "{34F32E4D-79EF-4447-A585-B1A79BF1C3C3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Compression 2022", "Krypton.Toolkit.Suite.Extended.Compression\Krypton.Toolkit.Suite.Extended.Compression 2022.csproj", "{18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Forms 2022", "Krypton.Toolkit.Suite.Extended.Forms\Krypton.Toolkit.Suite.Extended.Forms 2022.csproj", "{EE0904D6-72EF-4107-A286-CB5EEC2A5CE0}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Generic", "Generic", "{4696C160-BC97-414A-8D30-B09A2CA76085}" - ProjectSection(SolutionItems) = preProject - ..\..\Directory.Build.props = ..\..\Directory.Build.props - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Generate Packages", "Generate Packages", "{9ACA6117-D269-4425-8500-6BC57560DEB2}" - ProjectSection(SolutionItems) = preProject - Directory.Build.props = Directory.Build.props - Directory.Build.targets = Directory.Build.targets - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.InputBox 2022", "Krypton.Toolkit.Suite.Extended.InputBox\Krypton.Toolkit.Suite.Extended.InputBox 2022.csproj", "{2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Panels 2022", "Krypton.Toolkit.Suite.Extended.Panels\Krypton.Toolkit.Suite.Extended.Panels 2022.csproj", "{335DD135-6475-46D5-A7DB-EA329224D59E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Toast 2022", "Krypton.Toolkit.Suite.Extended.Toast\Krypton.Toolkit.Suite.Extended.Toast 2022.csproj", "{97917447-2353-4D4D-935F-CF9279F1464F}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Miscellaneous", "Miscellaneous", "{241C9BD1-CB7D-4AF0-8FDB-3BCB4C98AF51}" - ProjectSection(SolutionItems) = preProject - ..\.editorconfig = ..\.editorconfig - Directory.Build.props = Directory.Build.props - Directory.Build.targets = Directory.Build.targets - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView 2022", "Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView\Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView 2022.csproj", "{CB1E8B1F-E019-498A-8E4E-117012F6368C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Ribbon 2022", "Krypton.Toolkit.Suite.Extended.Ribbon\Krypton.Toolkit.Suite.Extended.Ribbon 2022.csproj", "{9FCE31CF-18F7-4F24-8B73-799B3CB19D57}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{0703388D-5FBE-4345-94B0-5FA9FD043079}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Shared 2022", "Krypton.Toolkit.Suite.Extended.Shared\Krypton.Toolkit.Suite.Extended.Shared 2022.csproj", "{0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{5DB6B467-9257-42D3-B81F-380B5D537C04}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Schemas", "Schemas", "{1AD413AC-FAD3-4F79-A948-4FB66AF10685}" - ProjectSection(SolutionItems) = preProject - ..\..\Assets\NuGet\Schemas\Krypton.Toolkit.Suite.Extended.Lite.nuspec = ..\..\Assets\NuGet\Schemas\Krypton.Toolkit.Suite.Extended.Lite.nuspec - ..\..\Assets\NuGet\Schemas\Krypton.Toolkit.Suite.Extended.nuspec = ..\..\Assets\NuGet\Schemas\Krypton.Toolkit.Suite.Extended.nuspec - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Themes 2022", "Krypton.Toolkit.Suite.Extended.Themes\Krypton.Toolkit.Suite.Extended.Themes 2022.csproj", "{A58A93DE-0CBF-495B-8D29-761B1143AD32}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Buttons 2022", "Krypton.Toolkit.Suite.Extended.Buttons\Krypton.Toolkit.Suite.Extended.Buttons 2022.csproj", "{A7C0B094-539C-4283-AA9A-3959749886B7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Calendar 2022", "Krypton.Toolkit.Suite.Extended.Calendar\Krypton.Toolkit.Suite.Extended.Calendar 2022.csproj", "{BE3A7DFA-3616-4840-B9CC-09E96CC894B4}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "License", "License", "{BA86BDC7-D11C-4E74-875C-B284E740B599}" - ProjectSection(SolutionItems) = preProject - ..\..\Documents\License\License.md = ..\..\Documents\License\License.md - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Projects to Work On", "Projects to Work On", "{ADF53878-BE1F-43A3-A890-E11190BE5465}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.PDF 2022", "Krypton.Toolkit.Suite.Extended.PDF\Krypton.Toolkit.Suite.Extended.PDF 2022.csproj", "{A59A87BE-E92A-4717-92DC-A2286EE812EC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples", "Examples\Examples.csproj", "{744D6A50-F8DB-4D5F-B571-34B0597E03B8}" - ProjectSection(ProjectDependencies) = postProject - {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F} = {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F} - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.AdvancedDataGridView 2022", "Krypton.Toolkit.Suite.Extended.AdvancedDataGridView\Krypton.Toolkit.Suite.Extended.AdvancedDataGridView 2022.csproj", "{5E23D530-6349-4786-AA2D-F1DD9CC1586E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Scintilla.NET 2022", "Krypton.Toolkit.Suite.Extended.Scintilla.NET\Krypton.Toolkit.Suite.Extended.Scintilla.NET 2022.csproj", "{BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.CheckSum.Tools 2022", "Krypton.Toolkit.Suite.Extended.CheckSum.Tools\Krypton.Toolkit.Suite.Extended.CheckSum.Tools 2022.csproj", "{26A8A753-BC4B-4E42-B124-8EA3FA64303F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Circular.ProgressBar 2022", "Krypton.Toolkit.Suite.Extended.Circular.ProgressBar\Krypton.Toolkit.Suite.Extended.Circular.ProgressBar 2022.csproj", "{7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.ComboBox 2022", "Krypton.Toolkit.Suite.Extended.ComboBox\Krypton.Toolkit.Suite.Extended.ComboBox 2022.csproj", "{253E37F3-A36F-4D96-B22E-1D50C31C0D2D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Controls 2022", "Krypton.Toolkit.Suite.Extended.Controls\Krypton.Toolkit.Suite.Extended.Controls 2022.csproj", "{C4D0363C-6CA9-4D47-B896-D287C1E6BD11}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Data.Visualisation 2022", "Krypton.Toolkit.Suite.Extended.Data.Visualisation\Krypton.Toolkit.Suite.Extended.Data.Visualisation 2022.csproj", "{558D7C96-4E2D-4679-8D1A-508E734855D8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Dialogs 2022", "Krypton.Toolkit.Suite.Extended.Dialogs\Krypton.Toolkit.Suite.Extended.Dialogs 2022.csproj", "{3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Dock.Extender 2022", "Krypton.Toolkit.Suite.Extended.Dock.Extender\Krypton.Toolkit.Suite.Extended.Dock.Extender 2022.csproj", "{AA363B11-8B13-4333-85E1-8623D21E1202}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Error.Reporting 2022", "Krypton.Toolkit.Suite.Extended.Error.Reporting\Krypton.Toolkit.Suite.Extended.Error.Reporting 2022.csproj", "{3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.File.Copier 2022", "Krypton.Toolkit.Suite.Extended.File.Copier\Krypton.Toolkit.Suite.Extended.File.Copier 2022.csproj", "{14542128-1DF0-44DB-9365-1FF39324B317}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Floating.Toolbars 2022", "Krypton.Toolkit.Suite.Extended.Floating.Toolbars\Krypton.Toolkit.Suite.Extended.Floating.Toolbars 2022.csproj", "{4804A209-411D-43E5-B104-77D6A19131E2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Messagebox 2022", "Krypton.Toolkit.Suite.Extended.Messagebox\Krypton.Toolkit.Suite.Extended.Messagebox 2022.csproj", "{FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Memory.Box 2022", "Krypton.Toolkit.Suite.Extended.Memory.Box\Krypton.Toolkit.Suite.Extended.Memory.Box 2022.csproj", "{4C448625-CBCB-4147-9288-659906B17C28}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Navi.Suite 2022", "Krypton.Toolkit.Suite.Extended.Navi.Suite\Krypton.Toolkit.Suite.Extended.Navi.Suite 2022.csproj", "{AA7EBA51-F1BA-4A45-9344-22F4E173109A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Navigator 2022", "Krypton.Toolkit.Suite.Extended.Navigator\Krypton.Toolkit.Suite.Extended.Navigator 2022.csproj", "{65DDD9BE-D9BB-456A-97D4-D0B75607F657}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Networking 2022", "Krypton.Toolkit.Suite.Extended.Networking\Krypton.Toolkit.Suite.Extended.Networking 2022.csproj", "{B9D53724-D2C8-4067-8146-15C04533BAE3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Notifications 2022", "Krypton.Toolkit.Suite.Extended.Notifications\Krypton.Toolkit.Suite.Extended.Notifications 2022.csproj", "{A7DFFED4-3872-491C-B560-C8E4E4733A4D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Outlook.Grid 2022", "Krypton.Toolkit.Suite.Extended.Outlook.Grid\Krypton.Toolkit.Suite.Extended.Outlook.Grid 2022.csproj", "{9B5D60B1-765A-4793-92C4-23E8F8A76A77}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Drawing.Utilities 2022", "Krypton.Toolkit.Suite.Extended.Drawing.Utilities\Krypton.Toolkit.Suite.Extended.Drawing.Utilities 2022.csproj", "{F33622D3-84D1-4C58-9241-45243882739C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.IO 2022", "Krypton.Toolkit.Suite.Extended.IO\Krypton.Toolkit.Suite.Extended.IO 2022.csproj", "{62253CD1-5FFB-4B07-82E9-00C978A96478}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Software.Updater 2022", "Krypton.Toolkit.Suite.Extended.Software.Updater\Krypton.Toolkit.Suite.Extended.Software.Updater 2022.csproj", "{A5FA199B-9AA4-4061-AE07-3036A115AA24}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Specialised.Dialogs 2022", "Krypton.Toolkit.Suite.Extended.Specialised.Dialogs\Krypton.Toolkit.Suite.Extended.Specialised.Dialogs 2022.csproj", "{2C946C86-12F4-40A3-B964-09C71DA3B845}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.Software.Updater.Core 2022", "Krypton.Toolkit.Suite.Extended.Software.Updater.Core\Krypton.Toolkit.Suite.Extended.Software.Updater.Core 2022.csproj", "{5C2389E8-1198-48D2-BDCC-44F74BE6B294}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ZipExtractor", "ZipExtractor\ZipExtractor.csproj", "{1126FD6E-8A3E-4C93-AABB-06073B27EB75}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Applications", "Applications", "{4985A154-8526-4CB0-A7DC-B39736C4A8AC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoUpdateCreator", "AutoUpdateCreator\AutoUpdateCreator.csproj", "{975DA9CB-501F-442E-8339-AF625C7A5DA4}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub", "GitHub", "{5D204922-259D-4140-B115-F01EDF031B5A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Issue Templates", "Issue Templates", "{362F24FA-1AA0-4821-A539-C5A863D39B8B}" - ProjectSection(SolutionItems) = preProject - ..\..\.github\ISSUE_TEMPLATE\bug_report.md = ..\..\.github\ISSUE_TEMPLATE\bug_report.md - ..\..\.github\ISSUE_TEMPLATE\feature-request.md = ..\..\.github\ISSUE_TEMPLATE\feature-request.md - ..\..\.github\ISSUE_TEMPLATE\other-issues.md = ..\..\.github\ISSUE_TEMPLATE\other-issues.md - ..\..\.github\ISSUE_TEMPLATE\post-a-question.md = ..\..\.github\ISSUE_TEMPLATE\post-a-question.md - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Canary|Any CPU = Canary|Any CPU - Debug|Any CPU = Debug|Any CPU - Nightly|Any CPU = Nightly|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E68C45C0-418B-4CFC-97C0-282798B38B37}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {E68C45C0-418B-4CFC-97C0-282798B38B37}.Canary|Any CPU.Build.0 = Canary|Any CPU - {E68C45C0-418B-4CFC-97C0-282798B38B37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E68C45C0-418B-4CFC-97C0-282798B38B37}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E68C45C0-418B-4CFC-97C0-282798B38B37}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {E68C45C0-418B-4CFC-97C0-282798B38B37}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {E68C45C0-418B-4CFC-97C0-282798B38B37}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E68C45C0-418B-4CFC-97C0-282798B38B37}.Release|Any CPU.Build.0 = Release|Any CPU - {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Canary|Any CPU.Build.0 = Canary|Any CPU - {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Debug|Any CPU.Build.0 = Debug|Any CPU - {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Release|Any CPU.ActiveCfg = Release|Any CPU - {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870}.Release|Any CPU.Build.0 = Release|Any CPU - {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Canary|Any CPU.Build.0 = Canary|Any CPU - {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4}.Release|Any CPU.Build.0 = Release|Any CPU - {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Canary|Any CPU.Build.0 = Canary|Any CPU - {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9CB33D7B-BF7E-4221-859D-5E61E24772E3}.Release|Any CPU.Build.0 = Release|Any CPU - {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Canary|Any CPU.Build.0 = Canary|Any CPU - {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B47A7562-B3B5-4521-91DB-E5CC4CC986E3}.Release|Any CPU.Build.0 = Release|Any CPU - {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Canary|Any CPU.Build.0 = Canary|Any CPU - {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B9A5A472-F747-4C87-B5E9-C5A05DB17827}.Release|Any CPU.Build.0 = Release|Any CPU - {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Canary|Any CPU.Build.0 = Canary|Any CPU - {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {81BCFC34-220F-43A8-A58B-8F9E123C72E1}.Release|Any CPU.Build.0 = Release|Any CPU - {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Canary|Any CPU.Build.0 = Canary|Any CPU - {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E}.Release|Any CPU.Build.0 = Release|Any CPU - {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Canary|Any CPU.Build.0 = Canary|Any CPU - {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC}.Release|Any CPU.Build.0 = Release|Any CPU - {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Canary|Any CPU.Build.0 = Canary|Any CPU - {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9}.Release|Any CPU.Build.0 = Release|Any CPU - {E66AA060-36AC-4C48-98B5-41701F5524A6}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {E66AA060-36AC-4C48-98B5-41701F5524A6}.Canary|Any CPU.Build.0 = Canary|Any CPU - {E66AA060-36AC-4C48-98B5-41701F5524A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E66AA060-36AC-4C48-98B5-41701F5524A6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E66AA060-36AC-4C48-98B5-41701F5524A6}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {E66AA060-36AC-4C48-98B5-41701F5524A6}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {E66AA060-36AC-4C48-98B5-41701F5524A6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E66AA060-36AC-4C48-98B5-41701F5524A6}.Release|Any CPU.Build.0 = Release|Any CPU - {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Canary|Any CPU.Build.0 = Canary|Any CPU - {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B}.Release|Any CPU.Build.0 = Release|Any CPU - {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Canary|Any CPU.Build.0 = Canary|Any CPU - {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7E1B169E-AD04-4C98-9971-DC7F450BF610}.Release|Any CPU.Build.0 = Release|Any CPU - {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Canary|Any CPU.Build.0 = Canary|Any CPU - {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4545427A-2FD5-441A-A35E-F09F2AB1B20D}.Release|Any CPU.Build.0 = Release|Any CPU - {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Canary|Any CPU.Build.0 = Canary|Any CPU - {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {116CDDE3-823F-486E-B0AC-2F0FE810A7EF}.Release|Any CPU.Build.0 = Release|Any CPU - {062AB625-3AAB-46ED-891D-E7103D1F7EBE}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {062AB625-3AAB-46ED-891D-E7103D1F7EBE}.Canary|Any CPU.Build.0 = Canary|Any CPU - {062AB625-3AAB-46ED-891D-E7103D1F7EBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {062AB625-3AAB-46ED-891D-E7103D1F7EBE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {062AB625-3AAB-46ED-891D-E7103D1F7EBE}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {062AB625-3AAB-46ED-891D-E7103D1F7EBE}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {062AB625-3AAB-46ED-891D-E7103D1F7EBE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {062AB625-3AAB-46ED-891D-E7103D1F7EBE}.Release|Any CPU.Build.0 = Release|Any CPU - {3804493B-31D2-4D70-89EF-EDED205037EC}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {3804493B-31D2-4D70-89EF-EDED205037EC}.Canary|Any CPU.Build.0 = Canary|Any CPU - {3804493B-31D2-4D70-89EF-EDED205037EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3804493B-31D2-4D70-89EF-EDED205037EC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3804493B-31D2-4D70-89EF-EDED205037EC}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {3804493B-31D2-4D70-89EF-EDED205037EC}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {3804493B-31D2-4D70-89EF-EDED205037EC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3804493B-31D2-4D70-89EF-EDED205037EC}.Release|Any CPU.Build.0 = Release|Any CPU - {66B492AC-74E6-4951-9376-47B4B7BA43EB}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {66B492AC-74E6-4951-9376-47B4B7BA43EB}.Canary|Any CPU.Build.0 = Canary|Any CPU - {66B492AC-74E6-4951-9376-47B4B7BA43EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {66B492AC-74E6-4951-9376-47B4B7BA43EB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {66B492AC-74E6-4951-9376-47B4B7BA43EB}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {66B492AC-74E6-4951-9376-47B4B7BA43EB}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {66B492AC-74E6-4951-9376-47B4B7BA43EB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {66B492AC-74E6-4951-9376-47B4B7BA43EB}.Release|Any CPU.Build.0 = Release|Any CPU - {8FD6FEBA-B906-4C66-9A8D-E370B961162C}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {8FD6FEBA-B906-4C66-9A8D-E370B961162C}.Canary|Any CPU.Build.0 = Canary|Any CPU - {8FD6FEBA-B906-4C66-9A8D-E370B961162C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8FD6FEBA-B906-4C66-9A8D-E370B961162C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8FD6FEBA-B906-4C66-9A8D-E370B961162C}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {8FD6FEBA-B906-4C66-9A8D-E370B961162C}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {8FD6FEBA-B906-4C66-9A8D-E370B961162C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8FD6FEBA-B906-4C66-9A8D-E370B961162C}.Release|Any CPU.Build.0 = Release|Any CPU - {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F}.Canary|Any CPU.Build.0 = Canary|Any CPU - {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F}.Release|Any CPU.Build.0 = Release|Any CPU - {A55B5F11-F812-4FF4-900C-B12601B34E52}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {A55B5F11-F812-4FF4-900C-B12601B34E52}.Canary|Any CPU.Build.0 = Canary|Any CPU - {A55B5F11-F812-4FF4-900C-B12601B34E52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A55B5F11-F812-4FF4-900C-B12601B34E52}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A55B5F11-F812-4FF4-900C-B12601B34E52}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {A55B5F11-F812-4FF4-900C-B12601B34E52}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {A55B5F11-F812-4FF4-900C-B12601B34E52}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A55B5F11-F812-4FF4-900C-B12601B34E52}.Release|Any CPU.Build.0 = Release|Any CPU - {34F32E4D-79EF-4447-A585-B1A79BF1C3C3}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {34F32E4D-79EF-4447-A585-B1A79BF1C3C3}.Canary|Any CPU.Build.0 = Canary|Any CPU - {34F32E4D-79EF-4447-A585-B1A79BF1C3C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {34F32E4D-79EF-4447-A585-B1A79BF1C3C3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {34F32E4D-79EF-4447-A585-B1A79BF1C3C3}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {34F32E4D-79EF-4447-A585-B1A79BF1C3C3}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {34F32E4D-79EF-4447-A585-B1A79BF1C3C3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {34F32E4D-79EF-4447-A585-B1A79BF1C3C3}.Release|Any CPU.Build.0 = Release|Any CPU - {18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC}.Canary|Any CPU.Build.0 = Canary|Any CPU - {18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC}.Release|Any CPU.Build.0 = Release|Any CPU - {EE0904D6-72EF-4107-A286-CB5EEC2A5CE0}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {EE0904D6-72EF-4107-A286-CB5EEC2A5CE0}.Canary|Any CPU.Build.0 = Canary|Any CPU - {EE0904D6-72EF-4107-A286-CB5EEC2A5CE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE0904D6-72EF-4107-A286-CB5EEC2A5CE0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE0904D6-72EF-4107-A286-CB5EEC2A5CE0}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {EE0904D6-72EF-4107-A286-CB5EEC2A5CE0}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {EE0904D6-72EF-4107-A286-CB5EEC2A5CE0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE0904D6-72EF-4107-A286-CB5EEC2A5CE0}.Release|Any CPU.Build.0 = Release|Any CPU - {2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB}.Canary|Any CPU.Build.0 = Canary|Any CPU - {2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB}.Release|Any CPU.Build.0 = Release|Any CPU - {335DD135-6475-46D5-A7DB-EA329224D59E}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {335DD135-6475-46D5-A7DB-EA329224D59E}.Canary|Any CPU.Build.0 = Canary|Any CPU - {335DD135-6475-46D5-A7DB-EA329224D59E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {335DD135-6475-46D5-A7DB-EA329224D59E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {335DD135-6475-46D5-A7DB-EA329224D59E}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {335DD135-6475-46D5-A7DB-EA329224D59E}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {335DD135-6475-46D5-A7DB-EA329224D59E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {335DD135-6475-46D5-A7DB-EA329224D59E}.Release|Any CPU.Build.0 = Release|Any CPU - {97917447-2353-4D4D-935F-CF9279F1464F}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {97917447-2353-4D4D-935F-CF9279F1464F}.Canary|Any CPU.Build.0 = Canary|Any CPU - {97917447-2353-4D4D-935F-CF9279F1464F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {97917447-2353-4D4D-935F-CF9279F1464F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {97917447-2353-4D4D-935F-CF9279F1464F}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {97917447-2353-4D4D-935F-CF9279F1464F}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {97917447-2353-4D4D-935F-CF9279F1464F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {97917447-2353-4D4D-935F-CF9279F1464F}.Release|Any CPU.Build.0 = Release|Any CPU - {CB1E8B1F-E019-498A-8E4E-117012F6368C}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {CB1E8B1F-E019-498A-8E4E-117012F6368C}.Canary|Any CPU.Build.0 = Canary|Any CPU - {CB1E8B1F-E019-498A-8E4E-117012F6368C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CB1E8B1F-E019-498A-8E4E-117012F6368C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CB1E8B1F-E019-498A-8E4E-117012F6368C}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {CB1E8B1F-E019-498A-8E4E-117012F6368C}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {CB1E8B1F-E019-498A-8E4E-117012F6368C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CB1E8B1F-E019-498A-8E4E-117012F6368C}.Release|Any CPU.Build.0 = Release|Any CPU - {9FCE31CF-18F7-4F24-8B73-799B3CB19D57}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {9FCE31CF-18F7-4F24-8B73-799B3CB19D57}.Canary|Any CPU.Build.0 = Canary|Any CPU - {9FCE31CF-18F7-4F24-8B73-799B3CB19D57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9FCE31CF-18F7-4F24-8B73-799B3CB19D57}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9FCE31CF-18F7-4F24-8B73-799B3CB19D57}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {9FCE31CF-18F7-4F24-8B73-799B3CB19D57}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {9FCE31CF-18F7-4F24-8B73-799B3CB19D57}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9FCE31CF-18F7-4F24-8B73-799B3CB19D57}.Release|Any CPU.Build.0 = Release|Any CPU - {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Canary|Any CPU.Build.0 = Canary|Any CPU - {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3}.Release|Any CPU.Build.0 = Release|Any CPU - {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Canary|Any CPU.ActiveCfg = Debug|Any CPU - {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Canary|Any CPU.Build.0 = Debug|Any CPU - {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A58A93DE-0CBF-495B-8D29-761B1143AD32}.Release|Any CPU.Build.0 = Release|Any CPU - {A7C0B094-539C-4283-AA9A-3959749886B7}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {A7C0B094-539C-4283-AA9A-3959749886B7}.Canary|Any CPU.Build.0 = Canary|Any CPU - {A7C0B094-539C-4283-AA9A-3959749886B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A7C0B094-539C-4283-AA9A-3959749886B7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A7C0B094-539C-4283-AA9A-3959749886B7}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {A7C0B094-539C-4283-AA9A-3959749886B7}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {A7C0B094-539C-4283-AA9A-3959749886B7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A7C0B094-539C-4283-AA9A-3959749886B7}.Release|Any CPU.Build.0 = Release|Any CPU - {BE3A7DFA-3616-4840-B9CC-09E96CC894B4}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {BE3A7DFA-3616-4840-B9CC-09E96CC894B4}.Canary|Any CPU.Build.0 = Canary|Any CPU - {BE3A7DFA-3616-4840-B9CC-09E96CC894B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BE3A7DFA-3616-4840-B9CC-09E96CC894B4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BE3A7DFA-3616-4840-B9CC-09E96CC894B4}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {BE3A7DFA-3616-4840-B9CC-09E96CC894B4}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {BE3A7DFA-3616-4840-B9CC-09E96CC894B4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BE3A7DFA-3616-4840-B9CC-09E96CC894B4}.Release|Any CPU.Build.0 = Release|Any CPU - {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Canary|Any CPU.ActiveCfg = Debug|Any CPU - {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Canary|Any CPU.Build.0 = Debug|Any CPU - {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Nightly|Any CPU.ActiveCfg = Debug|Any CPU - {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Nightly|Any CPU.Build.0 = Debug|Any CPU - {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A59A87BE-E92A-4717-92DC-A2286EE812EC}.Release|Any CPU.Build.0 = Release|Any CPU - {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Canary|Any CPU.ActiveCfg = Debug|Any CPU - {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Canary|Any CPU.Build.0 = Debug|Any CPU - {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Nightly|Any CPU.ActiveCfg = Debug|Any CPU - {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Nightly|Any CPU.Build.0 = Debug|Any CPU - {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {744D6A50-F8DB-4D5F-B571-34B0597E03B8}.Release|Any CPU.Build.0 = Release|Any CPU - {5E23D530-6349-4786-AA2D-F1DD9CC1586E}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {5E23D530-6349-4786-AA2D-F1DD9CC1586E}.Canary|Any CPU.Build.0 = Canary|Any CPU - {5E23D530-6349-4786-AA2D-F1DD9CC1586E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5E23D530-6349-4786-AA2D-F1DD9CC1586E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5E23D530-6349-4786-AA2D-F1DD9CC1586E}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {5E23D530-6349-4786-AA2D-F1DD9CC1586E}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {5E23D530-6349-4786-AA2D-F1DD9CC1586E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5E23D530-6349-4786-AA2D-F1DD9CC1586E}.Release|Any CPU.Build.0 = Release|Any CPU - {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Canary|Any CPU.ActiveCfg = Debug|Any CPU - {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Canary|Any CPU.Build.0 = Debug|Any CPU - {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F}.Release|Any CPU.Build.0 = Release|Any CPU - {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Canary|Any CPU.Build.0 = Canary|Any CPU - {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {26A8A753-BC4B-4E42-B124-8EA3FA64303F}.Release|Any CPU.Build.0 = Release|Any CPU - {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Canary|Any CPU.Build.0 = Canary|Any CPU - {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27}.Release|Any CPU.Build.0 = Release|Any CPU - {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Canary|Any CPU.Build.0 = Canary|Any CPU - {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {253E37F3-A36F-4D96-B22E-1D50C31C0D2D}.Release|Any CPU.Build.0 = Release|Any CPU - {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Canary|Any CPU.Build.0 = Canary|Any CPU - {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C4D0363C-6CA9-4D47-B896-D287C1E6BD11}.Release|Any CPU.Build.0 = Release|Any CPU - {558D7C96-4E2D-4679-8D1A-508E734855D8}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {558D7C96-4E2D-4679-8D1A-508E734855D8}.Canary|Any CPU.Build.0 = Canary|Any CPU - {558D7C96-4E2D-4679-8D1A-508E734855D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {558D7C96-4E2D-4679-8D1A-508E734855D8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {558D7C96-4E2D-4679-8D1A-508E734855D8}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {558D7C96-4E2D-4679-8D1A-508E734855D8}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {558D7C96-4E2D-4679-8D1A-508E734855D8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {558D7C96-4E2D-4679-8D1A-508E734855D8}.Release|Any CPU.Build.0 = Release|Any CPU - {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Canary|Any CPU.Build.0 = Canary|Any CPU - {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E}.Release|Any CPU.Build.0 = Release|Any CPU - {AA363B11-8B13-4333-85E1-8623D21E1202}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {AA363B11-8B13-4333-85E1-8623D21E1202}.Canary|Any CPU.Build.0 = Canary|Any CPU - {AA363B11-8B13-4333-85E1-8623D21E1202}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AA363B11-8B13-4333-85E1-8623D21E1202}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AA363B11-8B13-4333-85E1-8623D21E1202}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {AA363B11-8B13-4333-85E1-8623D21E1202}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {AA363B11-8B13-4333-85E1-8623D21E1202}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AA363B11-8B13-4333-85E1-8623D21E1202}.Release|Any CPU.Build.0 = Release|Any CPU - {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Canary|Any CPU.Build.0 = Canary|Any CPU - {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B}.Release|Any CPU.Build.0 = Release|Any CPU - {14542128-1DF0-44DB-9365-1FF39324B317}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {14542128-1DF0-44DB-9365-1FF39324B317}.Canary|Any CPU.Build.0 = Canary|Any CPU - {14542128-1DF0-44DB-9365-1FF39324B317}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {14542128-1DF0-44DB-9365-1FF39324B317}.Debug|Any CPU.Build.0 = Debug|Any CPU - {14542128-1DF0-44DB-9365-1FF39324B317}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {14542128-1DF0-44DB-9365-1FF39324B317}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {14542128-1DF0-44DB-9365-1FF39324B317}.Release|Any CPU.ActiveCfg = Release|Any CPU - {14542128-1DF0-44DB-9365-1FF39324B317}.Release|Any CPU.Build.0 = Release|Any CPU - {4804A209-411D-43E5-B104-77D6A19131E2}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {4804A209-411D-43E5-B104-77D6A19131E2}.Canary|Any CPU.Build.0 = Canary|Any CPU - {4804A209-411D-43E5-B104-77D6A19131E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4804A209-411D-43E5-B104-77D6A19131E2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4804A209-411D-43E5-B104-77D6A19131E2}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {4804A209-411D-43E5-B104-77D6A19131E2}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {4804A209-411D-43E5-B104-77D6A19131E2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4804A209-411D-43E5-B104-77D6A19131E2}.Release|Any CPU.Build.0 = Release|Any CPU - {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Canary|Any CPU.Build.0 = Canary|Any CPU - {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03}.Release|Any CPU.Build.0 = Release|Any CPU - {4C448625-CBCB-4147-9288-659906B17C28}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {4C448625-CBCB-4147-9288-659906B17C28}.Canary|Any CPU.Build.0 = Canary|Any CPU - {4C448625-CBCB-4147-9288-659906B17C28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4C448625-CBCB-4147-9288-659906B17C28}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4C448625-CBCB-4147-9288-659906B17C28}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {4C448625-CBCB-4147-9288-659906B17C28}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {4C448625-CBCB-4147-9288-659906B17C28}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4C448625-CBCB-4147-9288-659906B17C28}.Release|Any CPU.Build.0 = Release|Any CPU - {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Canary|Any CPU.Build.0 = Canary|Any CPU - {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AA7EBA51-F1BA-4A45-9344-22F4E173109A}.Release|Any CPU.Build.0 = Release|Any CPU - {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Canary|Any CPU.Build.0 = Canary|Any CPU - {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Debug|Any CPU.Build.0 = Debug|Any CPU - {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Release|Any CPU.ActiveCfg = Release|Any CPU - {65DDD9BE-D9BB-456A-97D4-D0B75607F657}.Release|Any CPU.Build.0 = Release|Any CPU - {B9D53724-D2C8-4067-8146-15C04533BAE3}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {B9D53724-D2C8-4067-8146-15C04533BAE3}.Canary|Any CPU.Build.0 = Canary|Any CPU - {B9D53724-D2C8-4067-8146-15C04533BAE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B9D53724-D2C8-4067-8146-15C04533BAE3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B9D53724-D2C8-4067-8146-15C04533BAE3}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {B9D53724-D2C8-4067-8146-15C04533BAE3}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {B9D53724-D2C8-4067-8146-15C04533BAE3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B9D53724-D2C8-4067-8146-15C04533BAE3}.Release|Any CPU.Build.0 = Release|Any CPU - {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Canary|Any CPU.Build.0 = Canary|Any CPU - {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A7DFFED4-3872-491C-B560-C8E4E4733A4D}.Release|Any CPU.Build.0 = Release|Any CPU - {9B5D60B1-765A-4793-92C4-23E8F8A76A77}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {9B5D60B1-765A-4793-92C4-23E8F8A76A77}.Canary|Any CPU.Build.0 = Canary|Any CPU - {9B5D60B1-765A-4793-92C4-23E8F8A76A77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9B5D60B1-765A-4793-92C4-23E8F8A76A77}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9B5D60B1-765A-4793-92C4-23E8F8A76A77}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {9B5D60B1-765A-4793-92C4-23E8F8A76A77}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {9B5D60B1-765A-4793-92C4-23E8F8A76A77}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9B5D60B1-765A-4793-92C4-23E8F8A76A77}.Release|Any CPU.Build.0 = Release|Any CPU - {F33622D3-84D1-4C58-9241-45243882739C}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {F33622D3-84D1-4C58-9241-45243882739C}.Canary|Any CPU.Build.0 = Canary|Any CPU - {F33622D3-84D1-4C58-9241-45243882739C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F33622D3-84D1-4C58-9241-45243882739C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F33622D3-84D1-4C58-9241-45243882739C}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {F33622D3-84D1-4C58-9241-45243882739C}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {F33622D3-84D1-4C58-9241-45243882739C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F33622D3-84D1-4C58-9241-45243882739C}.Release|Any CPU.Build.0 = Release|Any CPU - {62253CD1-5FFB-4B07-82E9-00C978A96478}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {62253CD1-5FFB-4B07-82E9-00C978A96478}.Canary|Any CPU.Build.0 = Canary|Any CPU - {62253CD1-5FFB-4B07-82E9-00C978A96478}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {62253CD1-5FFB-4B07-82E9-00C978A96478}.Debug|Any CPU.Build.0 = Debug|Any CPU - {62253CD1-5FFB-4B07-82E9-00C978A96478}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {62253CD1-5FFB-4B07-82E9-00C978A96478}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {62253CD1-5FFB-4B07-82E9-00C978A96478}.Release|Any CPU.ActiveCfg = Release|Any CPU - {62253CD1-5FFB-4B07-82E9-00C978A96478}.Release|Any CPU.Build.0 = Release|Any CPU - {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Canary|Any CPU.Build.0 = Canary|Any CPU - {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A5FA199B-9AA4-4061-AE07-3036A115AA24}.Release|Any CPU.Build.0 = Release|Any CPU - {2C946C86-12F4-40A3-B964-09C71DA3B845}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {2C946C86-12F4-40A3-B964-09C71DA3B845}.Canary|Any CPU.Build.0 = Canary|Any CPU - {2C946C86-12F4-40A3-B964-09C71DA3B845}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2C946C86-12F4-40A3-B964-09C71DA3B845}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2C946C86-12F4-40A3-B964-09C71DA3B845}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {2C946C86-12F4-40A3-B964-09C71DA3B845}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {2C946C86-12F4-40A3-B964-09C71DA3B845}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2C946C86-12F4-40A3-B964-09C71DA3B845}.Release|Any CPU.Build.0 = Release|Any CPU - {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Canary|Any CPU.Build.0 = Canary|Any CPU - {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5C2389E8-1198-48D2-BDCC-44F74BE6B294}.Release|Any CPU.Build.0 = Release|Any CPU - {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Canary|Any CPU.Build.0 = Canary|Any CPU - {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1126FD6E-8A3E-4C93-AABB-06073B27EB75}.Release|Any CPU.Build.0 = Release|Any CPU - {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Canary|Any CPU.ActiveCfg = Canary|Any CPU - {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Canary|Any CPU.Build.0 = Canary|Any CPU - {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Nightly|Any CPU.ActiveCfg = Nightly|Any CPU - {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Nightly|Any CPU.Build.0 = Nightly|Any CPU - {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {975DA9CB-501F-442E-8339-AF625C7A5DA4}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {87BE2145-50BE-4A57-9C79-FCE5A64F6065} = {5D85B551-9AFC-4E96-93C3-D8D81B69971F} - {A7A69BC2-7682-43FB-8E7C-C42FDAA2A215} = {5D85B551-9AFC-4E96-93C3-D8D81B69971F} - {6B01F113-016E-445F-BE5E-80BA7144B928} = {5D85B551-9AFC-4E96-93C3-D8D81B69971F} - {404EC0E7-92CB-4E90-80F7-440A4F5D772C} = {6B01F113-016E-445F-BE5E-80BA7144B928} - {734B2F67-D055-44B2-818A-FE569C479937} = {6B01F113-016E-445F-BE5E-80BA7144B928} - {15346861-5444-49D7-9686-3835EE271259} = {6B01F113-016E-445F-BE5E-80BA7144B928} - {5E13A5BB-407A-46A5-95A8-9DA57FB21C6C} = {6B01F113-016E-445F-BE5E-80BA7144B928} - {6EFEF411-B16C-4DEA-992F-9CA767EB1265} = {6B01F113-016E-445F-BE5E-80BA7144B928} - {F96630C5-2A89-44D5-BED6-99609A6D716A} = {6B01F113-016E-445F-BE5E-80BA7144B928} - {247BBF4E-22B0-49CC-981B-0420AD7FF4E8} = {6B01F113-016E-445F-BE5E-80BA7144B928} - {071034AA-BFA3-4325-B763-E95A2E05EF4D} = {734B2F67-D055-44B2-818A-FE569C479937} - {378BEE59-0131-4497-80B8-69B3124325D7} = {734B2F67-D055-44B2-818A-FE569C479937} - {69F98672-EBB9-4B12-BD04-45AEF3C37FC6} = {15346861-5444-49D7-9686-3835EE271259} - {0451E883-C718-4679-962F-E2825B1513B2} = {247BBF4E-22B0-49CC-981B-0420AD7FF4E8} - {E68C45C0-418B-4CFC-97C0-282798B38B37} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} - {57DA94A4-FA2D-4B83-A84F-FE4A4AAA9870} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} - {58E921DB-43E2-4743-A6B3-3DF9ED09F5D4} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} - {9CB33D7B-BF7E-4221-859D-5E61E24772E3} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} - {B47A7562-B3B5-4521-91DB-E5CC4CC986E3} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} - {B9A5A472-F747-4C87-B5E9-C5A05DB17827} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} - {81BCFC34-220F-43A8-A58B-8F9E123C72E1} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} - {4B57DCA9-277B-4AB1-B297-7EC8311EEE1E} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} - {C996C6FF-AC18-4C5C-BEB0-E5D48D7CF3FC} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} - {CA2FB62E-F7EE-45F4-BA59-15CB110D22F9} = {ADF53878-BE1F-43A3-A890-E11190BE5465} - {E66AA060-36AC-4C48-98B5-41701F5524A6} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} - {1ED17EC9-8959-4FE1-BC33-48CEFEA7373B} = {ADF53878-BE1F-43A3-A890-E11190BE5465} - {7E1B169E-AD04-4C98-9971-DC7F450BF610} = {ADF53878-BE1F-43A3-A890-E11190BE5465} - {4545427A-2FD5-441A-A35E-F09F2AB1B20D} = {ADF53878-BE1F-43A3-A890-E11190BE5465} - {116CDDE3-823F-486E-B0AC-2F0FE810A7EF} = {ADF53878-BE1F-43A3-A890-E11190BE5465} - {062AB625-3AAB-46ED-891D-E7103D1F7EBE} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {3804493B-31D2-4D70-89EF-EDED205037EC} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {66B492AC-74E6-4951-9376-47B4B7BA43EB} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {8FD6FEBA-B906-4C66-9A8D-E370B961162C} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {6353C3DA-7BCE-4D1E-844D-70A4B8401E7F} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {A55B5F11-F812-4FF4-900C-B12601B34E52} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {34F32E4D-79EF-4447-A585-B1A79BF1C3C3} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {18DE1F27-6D6B-44E2-BA62-7A1005EEB8CC} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {EE0904D6-72EF-4107-A286-CB5EEC2A5CE0} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {4696C160-BC97-414A-8D30-B09A2CA76085} = {87BE2145-50BE-4A57-9C79-FCE5A64F6065} - {9ACA6117-D269-4425-8500-6BC57560DEB2} = {87BE2145-50BE-4A57-9C79-FCE5A64F6065} - {2AEC1C12-E8A8-4715-8B8D-9DB405C06FBB} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {335DD135-6475-46D5-A7DB-EA329224D59E} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {97917447-2353-4D4D-935F-CF9279F1464F} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {241C9BD1-CB7D-4AF0-8FDB-3BCB4C98AF51} = {5D85B551-9AFC-4E96-93C3-D8D81B69971F} - {CB1E8B1F-E019-498A-8E4E-117012F6368C} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {9FCE31CF-18F7-4F24-8B73-799B3CB19D57} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {0F113F6F-775D-456D-93F7-B0D3BFEF8FB3} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} - {5DB6B467-9257-42D3-B81F-380B5D537C04} = {6B01F113-016E-445F-BE5E-80BA7144B928} - {1AD413AC-FAD3-4F79-A948-4FB66AF10685} = {5DB6B467-9257-42D3-B81F-380B5D537C04} - {A58A93DE-0CBF-495B-8D29-761B1143AD32} = {ADF53878-BE1F-43A3-A890-E11190BE5465} - {A7C0B094-539C-4283-AA9A-3959749886B7} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {BE3A7DFA-3616-4840-B9CC-09E96CC894B4} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {BA86BDC7-D11C-4E74-875C-B284E740B599} = {A7A69BC2-7682-43FB-8E7C-C42FDAA2A215} - {A59A87BE-E92A-4717-92DC-A2286EE812EC} = {ADF53878-BE1F-43A3-A890-E11190BE5465} - {744D6A50-F8DB-4D5F-B571-34B0597E03B8} = {0703388D-5FBE-4345-94B0-5FA9FD043079} - {5E23D530-6349-4786-AA2D-F1DD9CC1586E} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {BE0F9864-6A7F-4712-B5C4-C33267EB1C1F} = {ADF53878-BE1F-43A3-A890-E11190BE5465} - {26A8A753-BC4B-4E42-B124-8EA3FA64303F} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {7A73097A-73B3-4EE5-9D57-1B25AF2A1A27} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {253E37F3-A36F-4D96-B22E-1D50C31C0D2D} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {C4D0363C-6CA9-4D47-B896-D287C1E6BD11} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {558D7C96-4E2D-4679-8D1A-508E734855D8} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {3DBA5DAE-5FDB-4FEF-BE41-4E394006E66E} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {AA363B11-8B13-4333-85E1-8623D21E1202} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {3F9CBC70-3EFC-4CCD-B986-CEFD8CEB3D1B} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {14542128-1DF0-44DB-9365-1FF39324B317} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {4804A209-411D-43E5-B104-77D6A19131E2} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {FD3FD0D6-EB4A-4E16-BF30-C7B57BF6EA03} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {4C448625-CBCB-4147-9288-659906B17C28} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {AA7EBA51-F1BA-4A45-9344-22F4E173109A} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {65DDD9BE-D9BB-456A-97D4-D0B75607F657} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {B9D53724-D2C8-4067-8146-15C04533BAE3} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {A7DFFED4-3872-491C-B560-C8E4E4733A4D} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {9B5D60B1-765A-4793-92C4-23E8F8A76A77} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {F33622D3-84D1-4C58-9241-45243882739C} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} - {62253CD1-5FFB-4B07-82E9-00C978A96478} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {A5FA199B-9AA4-4061-AE07-3036A115AA24} = {ADF53878-BE1F-43A3-A890-E11190BE5465} - {2C946C86-12F4-40A3-B964-09C71DA3B845} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5} - {5C2389E8-1198-48D2-BDCC-44F74BE6B294} = {726DC0AA-2B0D-4EAC-BB7A-7C49AE13A390} - {1126FD6E-8A3E-4C93-AABB-06073B27EB75} = {4985A154-8526-4CB0-A7DC-B39736C4A8AC} - {975DA9CB-501F-442E-8339-AF625C7A5DA4} = {4985A154-8526-4CB0-A7DC-B39736C4A8AC} - {5D204922-259D-4140-B115-F01EDF031B5A} = {5D85B551-9AFC-4E96-93C3-D8D81B69971F} - {362F24FA-1AA0-4821-A539-C5A863D39B8B} = {5D204922-259D-4140-B115-F01EDF031B5A} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {A7CE7732-0982-4703-8EFD-7715D569BAB5} - EndGlobalSection -EndGlobal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/AdvancedDataGridViewSearchToolBarSearchEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/AdvancedDataGridViewSearchToolBarSearchEventArgs.cs index 2a61e9f49..f4ca2f5dc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/AdvancedDataGridViewSearchToolBarSearchEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/AdvancedDataGridViewSearchToolBarSearchEventArgs.cs @@ -40,7 +40,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -68,7 +68,7 @@ namespace Krypton.Toolkit.Suite.Extended.AdvancedDataGridView public class AdvancedDataGridViewSearchToolBarSearchEventArgs : EventArgs { public string ValueToSearch { get; private set; } - public DataGridViewColumn ColumnToSearch { get; private set; } + public DataGridViewColumn? ColumnToSearch { get; private set; } public bool CaseSensitive { get; private set; } public bool WholeWord { get; private set; } public bool FromBegin { get; private set; } @@ -79,7 +79,7 @@ public class AdvancedDataGridViewSearchToolBarSearchEventArgs : EventArgs /// if set to true [case]. /// if set to true [whole]. /// if set to true [from begin]. - public AdvancedDataGridViewSearchToolBarSearchEventArgs(string value, DataGridViewColumn column, bool @case, bool whole, bool fromBegin) + public AdvancedDataGridViewSearchToolBarSearchEventArgs(string value, DataGridViewColumn? column, bool @case, bool whole, bool fromBegin) { ValueToSearch = value; ColumnToSearch = column; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/AdvancedDataGridViewSearchToolBarSearchEventHandler.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/AdvancedDataGridViewSearchToolBarSearchEventHandler.cs index 936868749..90699bfda 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/AdvancedDataGridViewSearchToolBarSearchEventHandler.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/AdvancedDataGridViewSearchToolBarSearchEventHandler.cs @@ -40,7 +40,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/ColumnHeaderCellEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/ColumnHeaderCellEventArgs.cs index 20346eb66..97f920caf 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/ColumnHeaderCellEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/ColumnHeaderCellEventArgs.cs @@ -40,7 +40,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/ColumnHeaderCellEventHandler.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/ColumnHeaderCellEventHandler.cs index a3042772d..21e59987b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/ColumnHeaderCellEventHandler.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/ColumnHeaderCellEventHandler.cs @@ -40,7 +40,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/KryptonAdvancedDataGridView.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/KryptonAdvancedDataGridView.cs index 8c8b55938..ae8a8ce33 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/KryptonAdvancedDataGridView.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/KryptonAdvancedDataGridView.cs @@ -40,7 +40,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -64,6 +64,8 @@ #endregion // ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract +using DebugUtilities = Krypton.Toolkit.Suite.Extended.Debug.Tools.DebugUtilities; + namespace Krypton.Toolkit.Suite.Extended.AdvancedDataGridView { [DesignerCategory("code")] @@ -71,14 +73,14 @@ public class KryptonAdvancedDataGridView : KryptonDataGridView { #region Instance Fields - private List _sortOrderList = new List(); - private List _filterOrderList = new List(); - private List _filteredColumns = new List(); + private readonly List _sortOrderList = new List(); + private readonly List _filterOrderList = new List(); + private readonly List _filteredColumns = new List(); private List _menuStripToDispose = new List(); - private bool _loadedFilter = false; - private string? _sortString = null; - private string? _filterString = null; + private bool _loadedFilter; + private string? _sortString; + private string? _filterString; private bool _sortStringChangedInvokeBeforeDatasourceUpdate = true; private bool _filterStringChangedInvokeBeforeDatasourceUpdate = true; @@ -125,6 +127,7 @@ public FilterEventArgs() #region Identity + /// Initializes a new instance of the class. public KryptonAdvancedDataGridView() { //System.Windows.Forms.RightToLeft = System.Windows.Forms.RightToLeft.No; @@ -237,10 +240,10 @@ public static IDictionary LoadTranslationsFromFile(string filena Dictionary translations = new JavaScriptSerializer().Deserialize>(jsontext); #else - Dictionary translations = + Dictionary? translations = JsonSerializer.Deserialize>(jsontext); #endif - foreach (KeyValuePair translation in translations) + foreach (KeyValuePair translation in translations!) { if (!ret.ContainsKey(translation.Key) && Translations.ContainsKey(translation.Key)) { @@ -250,7 +253,7 @@ public static IDictionary LoadTranslationsFromFile(string filena } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } @@ -289,14 +292,8 @@ public void SetDoubleBuffered() /// public bool SortStringChangedInvokeBeforeDatasourceUpdate { - get - { - return _sortStringChangedInvokeBeforeDatasourceUpdate; - } - set - { - _sortStringChangedInvokeBeforeDatasourceUpdate = value; - } + get => _sortStringChangedInvokeBeforeDatasourceUpdate; + set => _sortStringChangedInvokeBeforeDatasourceUpdate = value; } /// @@ -304,14 +301,8 @@ public bool SortStringChangedInvokeBeforeDatasourceUpdate /// public bool FilterStringChangedInvokeBeforeDatasourceUpdate { - get - { - return _filterStringChangedInvokeBeforeDatasourceUpdate; - } - set - { - _filterStringChangedInvokeBeforeDatasourceUpdate = value; - } + get => _filterStringChangedInvokeBeforeDatasourceUpdate; + set => _filterStringChangedInvokeBeforeDatasourceUpdate = value; } /// @@ -325,7 +316,7 @@ public void DisableFilterAndSort(DataGridViewColumn column) KryptonColumnHeaderCell? cell = column.HeaderCell as KryptonColumnHeaderCell; if (cell != null) { - if (cell.FilterAndSortEnabled == true && (cell.SortString.Length > 0 || cell.FilterString.Length > 0)) + if (cell.FilterAndSortEnabled && (cell.SortString!.Length > 0 || cell.FilterString!.Length > 0)) { CleanFilter(true); cell.FilterAndSortEnabled = false; @@ -353,7 +344,7 @@ public void EnableFilterAndSort(DataGridViewColumn column) KryptonColumnHeaderCell? cell = column.HeaderCell as KryptonColumnHeaderCell; if (cell != null) { - if (!cell.FilterAndSortEnabled && (cell.FilterString.Length > 0 || cell.SortString.Length > 0)) + if (!cell.FilterAndSortEnabled && (cell.FilterString!.Length > 0 || cell.SortString!.Length > 0)) { CleanFilter(true); } @@ -369,9 +360,9 @@ public void EnableFilterAndSort(DataGridViewColumn column) { column.SortMode = DataGridViewColumnSortMode.Programmatic; cell = new KryptonColumnHeaderCell(column.HeaderCell, true); - cell.SortChanged += new ColumnHeaderCellEventHandler(Cell_SortChanged); - cell.FilterChanged += new ColumnHeaderCellEventHandler(Cell_FilterChanged); - cell.FilterPopup += new ColumnHeaderCellEventHandler(Cell_FilterPopup); + cell.SortChanged += Cell_SortChanged; + cell.FilterChanged += Cell_FilterChanged; + cell.FilterPopup += Cell_FilterPopup; column.MinimumWidth = cell.MinimumSize.Width; if (ColumnHeadersHeight < cell.MinimumSize.Height) { @@ -691,14 +682,8 @@ public void SetMenuStripFilterNotInLogic(bool enabled) /// public bool FilterAndSortEnabled { - get - { - return _filterAndSortEnabled; - } - set - { - _filterAndSortEnabled = value; - } + get => _filterAndSortEnabled; + set => _filterAndSortEnabled = value; } private bool _filterAndSortEnabled = true; @@ -712,10 +697,7 @@ public bool FilterAndSortEnabled /// public string? SortString { - get - { - return (!String.IsNullOrEmpty(_sortString) ? _sortString : ""); - } + get => !string.IsNullOrEmpty(_sortString) ? _sortString : string.Empty; private set { string? old = value; @@ -805,7 +787,7 @@ public void SortDescending(DataGridViewColumn column) { if (Columns.Contains(column)) { - KryptonColumnHeaderCell cell = column.HeaderCell as KryptonColumnHeaderCell; + KryptonColumnHeaderCell? cell = column.HeaderCell as KryptonColumnHeaderCell; if (cell != null) { cell.SortDESC(); @@ -822,7 +804,7 @@ public void CleanSort(DataGridViewColumn column, bool fireEvent) { if (Columns.Contains(column)) { - KryptonColumnHeaderCell cell = column.HeaderCell as KryptonColumnHeaderCell; + KryptonColumnHeaderCell? cell = column.HeaderCell as KryptonColumnHeaderCell; if (cell != null && FilterableCells.Contains(cell)) { cell.CleanSort(); @@ -888,10 +870,7 @@ public void CleanSort() /// public string? FilterString { - get - { - return (!String.IsNullOrEmpty(_filterString) ? _filterString : ""); - } + get => !String.IsNullOrEmpty(_filterString) ? _filterString : ""; private set { string? old = value; @@ -961,7 +940,7 @@ public void SetFilterDateAndTimeEnabled(DataGridViewColumn column, bool enabled) { if (Columns.Contains(column)) { - KryptonColumnHeaderCell cell = column.HeaderCell as KryptonColumnHeaderCell; + KryptonColumnHeaderCell? cell = column.HeaderCell as KryptonColumnHeaderCell; if (cell != null) { cell.IsFilterDateAndTimeEnabled = enabled; @@ -978,7 +957,7 @@ public void SetFilterEnabled(DataGridViewColumn column, bool enabled) { if (Columns.Contains(column)) { - KryptonColumnHeaderCell cell = column.HeaderCell as KryptonColumnHeaderCell; + KryptonColumnHeaderCell? cell = column.HeaderCell as KryptonColumnHeaderCell; if (cell != null) { cell.SetFilterEnabled(enabled); @@ -995,7 +974,7 @@ public void SetChecklistTextFilterRemoveNodesOnSearchMode(DataGridViewColumn col { if (Columns.Contains(column)) { - KryptonColumnHeaderCell cell = column.HeaderCell as KryptonColumnHeaderCell; + KryptonColumnHeaderCell? cell = column.HeaderCell as KryptonColumnHeaderCell; if (cell != null) { cell.SetChecklistTextFilterRemoveNodesOnSearchMode(enabled); @@ -1012,7 +991,7 @@ public void CleanFilter(DataGridViewColumn column, bool fireEvent) { if (Columns.Contains(column)) { - KryptonColumnHeaderCell cell = column.HeaderCell as KryptonColumnHeaderCell; + KryptonColumnHeaderCell? cell = column.HeaderCell as KryptonColumnHeaderCell; if (cell != null) { cell.CleanFilter(); @@ -1077,7 +1056,7 @@ public void SetTextFilterRemoveNodesOnSearch(DataGridViewColumn column, bool ena { if (Columns.Contains(column)) { - KryptonColumnHeaderCell cell = column.HeaderCell as KryptonColumnHeaderCell; + KryptonColumnHeaderCell? cell = column.HeaderCell as KryptonColumnHeaderCell; if (cell != null) { cell.DoesTextFilterRemoveNodesOnSearch = enabled; @@ -1088,12 +1067,12 @@ public void SetTextFilterRemoveNodesOnSearch(DataGridViewColumn column, bool ena /// /// Get the text filter search nodes behaviour /// - public Nullable GetTextFilterRemoveNodesOnSearch(DataGridViewColumn column) + public bool? GetTextFilterRemoveNodesOnSearch(DataGridViewColumn column) { - Nullable ret = null; + bool? ret = null; if (Columns.Contains(column)) { - KryptonColumnHeaderCell cell = column.HeaderCell as KryptonColumnHeaderCell; + KryptonColumnHeaderCell? cell = column.HeaderCell as KryptonColumnHeaderCell; if (cell != null) { ret = cell.DoesTextFilterRemoveNodesOnSearch; @@ -1117,9 +1096,9 @@ public Nullable GetTextFilterRemoveNodesOnSearch(DataGridViewColumn column /// /// /// - public DataGridViewCell FindCell(string valueToFind, string columnName, int rowIndex, int columnIndex, bool isWholeWordSearch, bool isCaseSensitive) + public DataGridViewCell? FindCell(string valueToFind, string columnName, int rowIndex, int columnIndex, bool isWholeWordSearch, bool isCaseSensitive) { - if (valueToFind != null && RowCount > 0 && ColumnCount > 0 && (columnName == null || (Columns.Contains(columnName) && Columns[columnName].Visible))) + if (valueToFind != null && RowCount > 0 && ColumnCount > 0 && (columnName == null || (Columns.Contains(columnName) && Columns[columnName]!.Visible))) { rowIndex = Math.Max(0, rowIndex); @@ -1130,7 +1109,7 @@ public DataGridViewCell FindCell(string valueToFind, string columnName, int rowI if (columnName != null) { - int c = Columns[columnName].Index; + int c = Columns[columnName]!.Index; if (columnIndex > c) { rowIndex++; @@ -1138,13 +1117,13 @@ public DataGridViewCell FindCell(string valueToFind, string columnName, int rowI for (int r = rowIndex; r < RowCount; r++) { - string value = Rows[r].Cells[c].FormattedValue.ToString(); + string? value = Rows[r].Cells[c].FormattedValue!.ToString(); if (!isCaseSensitive) { - value = value.ToLower(); + value = value?.ToLower(); } - if ((!isWholeWordSearch && value.Contains(valueToFind)) || value.Equals(valueToFind)) + if ((!isWholeWordSearch && value!.Contains(valueToFind)) || value!.Equals(valueToFind)) { return Rows[r].Cells[c]; } @@ -1163,13 +1142,13 @@ public DataGridViewCell FindCell(string valueToFind, string columnName, int rowI continue; } - string value = Rows[r].Cells[c].FormattedValue.ToString(); + string? value = Rows[r].Cells[c].FormattedValue!.ToString(); if (!isCaseSensitive) { - value = value.ToLower(); + value = value?.ToLower(); } - if ((!isWholeWordSearch && value.Contains(valueToFind)) || value.Equals(valueToFind)) + if ((!isWholeWordSearch && value!.Contains(valueToFind)) || value!.Equals(valueToFind)) { return Rows[r].Cells[c]; } @@ -1212,15 +1191,10 @@ public void ShowMenuStrip(DataGridViewColumn column) /// /// Get all columns /// - private IEnumerable FilterableCells - { - get - { - return from DataGridViewColumn c in Columns - where c.HeaderCell != null && c.HeaderCell is KryptonColumnHeaderCell - select (c.HeaderCell as KryptonColumnHeaderCell); - } - } + private IEnumerable FilterableCells => + from DataGridViewColumn c in Columns + where c.HeaderCell != null && c.HeaderCell is KryptonColumnHeaderCell + select c.HeaderCell as KryptonColumnHeaderCell; #endregion @@ -1235,9 +1209,9 @@ protected override void OnColumnAdded(DataGridViewColumnEventArgs e) { e.Column.SortMode = DataGridViewColumnSortMode.Programmatic; KryptonColumnHeaderCell cell = new KryptonColumnHeaderCell(e.Column.HeaderCell, FilterAndSortEnabled); - cell.SortChanged += new ColumnHeaderCellEventHandler(Cell_SortChanged); - cell.FilterChanged += new ColumnHeaderCellEventHandler(Cell_FilterChanged); - cell.FilterPopup += new ColumnHeaderCellEventHandler(Cell_FilterPopup); + cell.SortChanged += Cell_SortChanged; + cell.FilterChanged += Cell_FilterChanged; + cell.FilterPopup += Cell_FilterPopup; e.Column.MinimumWidth = cell.MinimumSize.Width; if (ColumnHeadersHeight < cell.MinimumSize.Height) { @@ -1259,7 +1233,7 @@ protected override void OnColumnRemoved(DataGridViewColumnEventArgs e) _filterOrderList.Remove(e.Column.Name); _sortOrderList.Remove(e.Column.Name); - KryptonColumnHeaderCell cell = e.Column.HeaderCell as KryptonColumnHeaderCell; + KryptonColumnHeaderCell? cell = e.Column.HeaderCell as KryptonColumnHeaderCell; if (cell != null) { cell.SortChanged -= Cell_SortChanged; @@ -1340,18 +1314,18 @@ protected override void OnCellValueChanged(DataGridViewCellEventArgs e) /// Build the complete Filter string /// /// - private string? BuildFilterString() + private string BuildFilterString() { StringBuilder sb = new StringBuilder(""); string appx = ""; foreach (string filterOrder in _filterOrderList) { - DataGridViewColumn column = Columns[filterOrder]; + DataGridViewColumn? column = Columns[filterOrder]; if (column != null) { - KryptonColumnHeaderCell cell = column.HeaderCell as KryptonColumnHeaderCell; + KryptonColumnHeaderCell? cell = column.HeaderCell as KryptonColumnHeaderCell; if (cell != null) { if (cell.FilterAndSortEnabled && cell.ActiveFilterType != MenuStrip.FilterType.None) @@ -1436,18 +1410,18 @@ private void Cell_FilterChanged(object sender, ColumnHeaderCellEventArgs e) /// Build the complete Sort string /// /// - private string? BuildSortString() + private string BuildSortString() { StringBuilder sb = new StringBuilder(""); string appx = ""; foreach (string sortOrder in _sortOrderList) { - DataGridViewColumn column = Columns[sortOrder]; + DataGridViewColumn? column = Columns[sortOrder]; if (column != null) { - KryptonColumnHeaderCell cell = column.HeaderCell as KryptonColumnHeaderCell; + KryptonColumnHeaderCell? cell = column.HeaderCell as KryptonColumnHeaderCell; if (cell != null) { if (cell.FilterAndSortEnabled && cell.ActiveSortType != MenuStrip.SortType.None) @@ -1494,7 +1468,7 @@ protected override void OnHandleDestroyed(EventArgs e) { foreach (DataGridViewColumn column in Columns) { - KryptonColumnHeaderCell cell = column.HeaderCell as KryptonColumnHeaderCell; + KryptonColumnHeaderCell? cell = column.HeaderCell as KryptonColumnHeaderCell; if (cell != null) { @@ -1518,9 +1492,9 @@ protected override void OnDataSourceChanged(EventArgs e) { foreach (DataGridViewColumn column in Columns) { - KryptonColumnHeaderCell cell = column.HeaderCell as KryptonColumnHeaderCell; + KryptonColumnHeaderCell? cell = column.HeaderCell as KryptonColumnHeaderCell; - _menuStripToDispose = _menuStripToDispose.Where(f => f != cell.MenuStrip).ToList(); + _menuStripToDispose = _menuStripToDispose.Where(f => f != cell!.MenuStrip).ToList(); } foreach (MenuStrip menuStrip in _menuStripToDispose) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/KryptonAdvancedDataGridViewSearchToolBar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/KryptonAdvancedDataGridViewSearchToolBar.cs index 60daaf169..b795f36d8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/KryptonAdvancedDataGridViewSearchToolBar.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/KryptonAdvancedDataGridViewSearchToolBar.cs @@ -40,7 +40,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -64,6 +64,7 @@ #endregion //#pragma warning disable +// ReSharper disable InconsistentNaming namespace Krypton.Toolkit.Suite.Extended.AdvancedDataGridView { [DesignerCategory("code")] @@ -74,7 +75,7 @@ public partial class KryptonAdvancedDataGridViewSearchToolBar : ToolStrip /// /// Required designer variable. /// - private IContainer components = null; + private IContainer? components = null; /// /// Clean up any resources being used. @@ -83,7 +84,7 @@ public partial class KryptonAdvancedDataGridViewSearchToolBar : ToolStrip protected override void Dispose(bool disposing) { // ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract - if (disposing && (components != null)) + if (disposing && components != null) { components.Dispose(); } @@ -239,16 +240,16 @@ private void InitializeComponent() #region public events - public event AdvancedDataGridViewSearchToolBarSearchEventHandler Search; + public event AdvancedDataGridViewSearchToolBarSearchEventHandler? Search; #endregion #region class properties - private DataGridViewColumnCollection _columnsList = null; + private DataGridViewColumnCollection? _columnsList; - private const bool ButtonCloseEnabled = false; + private const bool BUTTON_CLOSE_ENABLED = false; #endregion @@ -304,12 +305,12 @@ public KryptonAdvancedDataGridViewSearchToolBar() RefreshComponentTranslations(); //set default values - if (!ButtonCloseEnabled) + if (!BUTTON_CLOSE_ENABLED) { Items.RemoveAt(0); } - comboBox_columns.SelectedIndex = 0; + comboBox_columns!.SelectedIndex = 0; // Use Krypton RenderMode = ToolStripRenderMode.ManagerRenderMode; @@ -324,7 +325,7 @@ public KryptonAdvancedDataGridViewSearchToolBar() /// Set translation dictionary /// /// - public static void SetTranslations(IDictionary translations) + public static void SetTranslations(IDictionary? translations) { //set localization strings if (translations != null) @@ -362,13 +363,15 @@ public static IDictionary LoadTranslationsFromFile(string filena //deserialize the file try { - string jsontext = File.ReadAllText(filename); + string jsonText = File.ReadAllText(filename); #if NETFRAMEWORK - Dictionary translations = new JavaScriptSerializer().Deserialize>(jsontext); + Dictionary translations = + new JavaScriptSerializer().Deserialize>(jsonText); #else - Dictionary translations = JsonSerializer.Deserialize>(jsontext); + Dictionary? translations = + JsonSerializer.Deserialize>(jsonText); #endif - foreach (KeyValuePair translation in translations) + foreach (KeyValuePair translation in translations!) { if (!ret.ContainsKey(translation.Key) && Translations.ContainsKey(translation.Key)) { @@ -376,7 +379,10 @@ public static IDictionary LoadTranslationsFromFile(string filena } } } - catch { } + catch + { + // Nothing to do + } } //add default translations if not in files @@ -434,14 +440,14 @@ void button_search_Click(object sender, EventArgs e) { if (textBox_search.TextLength > 0 && textBox_search.Text != textBox_search.ToolTipText && Search != null) { - DataGridViewColumn c = null; + DataGridViewColumn? c = null; if (comboBox_columns.SelectedIndex > 0 && _columnsList != null && _columnsList.GetColumnCount(DataGridViewElementStates.Visible) > 0) { - DataGridViewColumn[] cols = _columnsList.Cast().Where(col => col.Visible).ToArray(); + DataGridViewColumn?[] cols = _columnsList.Cast().Where(col => col.Visible).ToArray(); if (cols.Length == comboBox_columns.Items.Count - 1) { - if (cols[comboBox_columns.SelectedIndex - 1].HeaderText == comboBox_columns.SelectedItem.ToString()) + if (cols[comboBox_columns.SelectedIndex - 1]!.HeaderText == comboBox_columns.SelectedItem.ToString()) { c = cols[comboBox_columns.SelectedIndex - 1]; } @@ -702,7 +708,7 @@ private void GetResizeBoxSize(int width, ref int w1, ref int w2) protected override void OnPaint(PaintEventArgs e) { //check if translations are changed and update components - if (!((_translationsRefreshComponentTranslationsCheck == Translations) || (_translationsRefreshComponentTranslationsCheck.Count == Translations.Count && !_translationsRefreshComponentTranslationsCheck.Except(Translations).Any()))) + if (!(_translationsRefreshComponentTranslationsCheck == Translations || (_translationsRefreshComponentTranslationsCheck.Count == Translations.Count && !_translationsRefreshComponentTranslationsCheck.Except(Translations).Any()))) { _translationsRefreshComponentTranslationsCheck = Translations; RefreshComponentTranslations(); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/KryptonColumnHeaderCell.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/KryptonColumnHeaderCell.cs index 95bbcb5d9..11dc2f9b1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/KryptonColumnHeaderCell.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/KryptonColumnHeaderCell.cs @@ -40,7 +40,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -64,7 +64,6 @@ #endregion // ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract -#pragma warning disable CS8600, CS8622, CS8602 namespace Krypton.Toolkit.Suite.Extended.AdvancedDataGridView { internal class KryptonColumnHeaderCell : DataGridViewColumnHeaderCell @@ -168,10 +167,7 @@ public KryptonColumnHeaderCell(DataGridViewColumnHeaderCell oldCell, bool filter /// public bool FilterAndSortEnabled { - get - { - return _filterEnabled; - } + get => _filterEnabled; set { if (!value) @@ -184,12 +180,12 @@ public bool FilterAndSortEnabled { _filterEnabled = value; bool refreshed = false; - if (MenuStrip.FilterString.Length > 0) + if (MenuStrip.FilterString!.Length > 0) { MenuStrip_FilterChanged(this, new EventArgs()); refreshed = true; } - if (MenuStrip.SortString.Length > 0) + if (MenuStrip.SortString!.Length > 0) { MenuStrip_SortChanged(this, new EventArgs()); refreshed = true; @@ -345,28 +341,17 @@ public string? FilterString /// /// Get the Minimum size /// - public Size MinimumSize - { - get - { - return new Size(_filterButtonImageSize.Width + _filterButtonMargin.Left + _filterButtonMargin.Right, - _filterButtonImageSize.Height + _filterButtonMargin.Bottom + _filterButtonMargin.Top); - } - } + public Size MinimumSize => + new(_filterButtonImageSize.Width + _filterButtonMargin.Left + _filterButtonMargin.Right, + _filterButtonImageSize.Height + _filterButtonMargin.Bottom + _filterButtonMargin.Top); /// /// Get or Set the Sort enabled status /// public bool IsSortEnabled { - get - { - return MenuStrip.IsSortEnabled; - } - set - { - MenuStrip.IsSortEnabled = value; - } + get => MenuStrip.IsSortEnabled; + set => MenuStrip.IsSortEnabled = value; } /// @@ -374,14 +359,8 @@ public bool IsSortEnabled /// public bool IsFilterEnabled { - get - { - return MenuStrip.IsFilterEnabled; - } - set - { - MenuStrip.IsFilterEnabled = value; - } + get => MenuStrip.IsFilterEnabled; + set => MenuStrip.IsFilterEnabled = value; } /// @@ -389,14 +368,8 @@ public bool IsFilterEnabled /// public bool IsFilterChecklistEnabled { - get - { - return MenuStrip.IsFilterChecklistEnabled; - } - set - { - MenuStrip.IsFilterChecklistEnabled = value; - } + get => MenuStrip.IsFilterChecklistEnabled; + set => MenuStrip.IsFilterChecklistEnabled = value; } /// @@ -404,14 +377,8 @@ public bool IsFilterChecklistEnabled /// public bool IsFilterDateAndTimeEnabled { - get - { - return MenuStrip.IsFilterDateAndTimeEnabled; - } - set - { - MenuStrip.IsFilterDateAndTimeEnabled = value; - } + get => MenuStrip.IsFilterDateAndTimeEnabled; + set => MenuStrip.IsFilterDateAndTimeEnabled = value; } /// @@ -419,14 +386,8 @@ public bool IsFilterDateAndTimeEnabled /// public bool IsMenuStripFilterNOTINLogicEnabled { - get - { - return MenuStrip.IsFilterNotinLogicEnabled; - } - set - { - MenuStrip.IsFilterNotinLogicEnabled = value; - } + get => MenuStrip.IsFilterNotinLogicEnabled; + set => MenuStrip.IsFilterNotinLogicEnabled = value; } /// @@ -434,14 +395,8 @@ public bool IsMenuStripFilterNOTINLogicEnabled /// public bool DoesTextFilterRemoveNodesOnSearch { - get - { - return MenuStrip.DoesTextFilterRemoveNodesOnSearch; - } - set - { - MenuStrip.DoesTextFilterRemoveNodesOnSearch = value; - } + get => MenuStrip.DoesTextFilterRemoveNodesOnSearch; + set => MenuStrip.DoesTextFilterRemoveNodesOnSearch = value; } /// @@ -449,14 +404,8 @@ public bool DoesTextFilterRemoveNodesOnSearch /// public int TextFilterTextChangedDelayNodes { - get - { - return MenuStrip.TextFilterTextChangedDelayNodes; - } - set - { - MenuStrip.TextFilterTextChangedDelayNodes = value; - } + get => MenuStrip.TextFilterTextChangedDelayNodes; + set => MenuStrip.TextFilterTextChangedDelayNodes = value; } /// @@ -743,7 +692,7 @@ protected override void Paint( /// private Rectangle GetFilterBounds(bool withOffset = true) { - Rectangle cell = DataGridView.GetCellDisplayRectangle(ColumnIndex, -1, false); + Rectangle cell = DataGridView!.GetCellDisplayRectangle(ColumnIndex, -1, false); Point p = new Point( (withOffset ? cell.Right : cell.Width) - _filterButtonImageSize.Width - _filterButtonMargin.Right, diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/MenuStrip.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/MenuStrip.cs index 8bb305e8a..06baa7bc5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/MenuStrip.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/MenuStrip.cs @@ -40,7 +40,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -65,9 +65,6 @@ using Timer = System.Windows.Forms.Timer; // ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract -#pragma warning disable CS8602 - -#pragma warning disable CS8625, CS8622 namespace Krypton.Toolkit.Suite.Extended.AdvancedDataGridView { [DesignerCategory("code")] @@ -86,7 +83,7 @@ internal partial class MenuStrip : ContextMenuStrip /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { - if (disposing && (components != null)) + if (disposing && components != null) { components.Dispose(); } @@ -482,10 +479,10 @@ public enum SortType : byte private FilterType _activeFilterType = FilterType.None; private SortType _activeSortType = SortType.None; - private TreeNodeItemSelector[] _loadedNodes = new TreeNodeItemSelector[] { }; - private TreeNodeItemSelector[] _startingNodes = new TreeNodeItemSelector[] { }; - private TreeNodeItemSelector[] _removedNodes = new TreeNodeItemSelector[] { }; - private TreeNodeItemSelector[] _removedsessionNodes = new TreeNodeItemSelector[] { }; + private TreeNodeItemSelector?[] _loadedNodes = new TreeNodeItemSelector?[] { }; + private TreeNodeItemSelector?[] _startingNodes = new TreeNodeItemSelector[] { }; + private TreeNodeItemSelector?[] _removedNodes = new TreeNodeItemSelector[] { }; + private TreeNodeItemSelector?[] _removedsessionNodes = new TreeNodeItemSelector[] { }; private string? _sortString = null; private string? _filterString = null; private static Point _resizeStartPoint = new Point(1, 1); @@ -717,37 +714,19 @@ private static ImageList GetCheckListStateImages() /// public int MaxChecklistNodes { - get - { - return _maxChecklistNodes; - } - set - { - _maxChecklistNodes = value; - } + get => _maxChecklistNodes; + set => _maxChecklistNodes = value; } /// /// Get the current MenuStripSortType type /// - public SortType ActiveSortType - { - get - { - return _activeSortType; - } - } + public SortType ActiveSortType => _activeSortType; /// /// Get the current MenuStripFilterType type /// - public FilterType ActiveFilterType - { - get - { - return _activeFilterType; - } - } + public FilterType ActiveFilterType => _activeFilterType; /// /// Get the DataType for the MenuStrip Filter @@ -789,14 +768,8 @@ public FilterType ActiveFilterType /// public bool DoesTextFilterRemoveNodesOnSearch { - get - { - return _checkTextFilterRemoveNodesOnSearch; - } - set - { - _checkTextFilterRemoveNodesOnSearch = value; - } + get => _checkTextFilterRemoveNodesOnSearch; + set => _checkTextFilterRemoveNodesOnSearch = value; } /// @@ -804,14 +777,8 @@ public bool DoesTextFilterRemoveNodesOnSearch /// public int TextFilterTextChangedDelayNodes { - get - { - return _textFilterTextChangedDelayNodes; - } - set - { - _textFilterTextChangedDelayNodes = value; - } + get => _textFilterTextChangedDelayNodes; + set => _textFilterTextChangedDelayNodes = value; } /// @@ -819,14 +786,8 @@ public int TextFilterTextChangedDelayNodes /// public int TextFilterTextChangedDelayMs { - get - { - return _textFilterTextChangedDelayMs; - } - set - { - _textFilterTextChangedDelayMs = value; - } + get => _textFilterTextChangedDelayMs; + set => _textFilterTextChangedDelayMs = value; } #endregion @@ -856,7 +817,7 @@ public void SetFilterEnabled(bool enabled) IsFilterEnabled = enabled; _cancelFilterMenuItem.Enabled = enabled; - _customFilterLastFiltersListMenuItem.Enabled = (enabled && DataType != typeof(bool)); + _customFilterLastFiltersListMenuItem.Enabled = enabled && DataType != typeof(bool); _buttonFilter.Enabled = enabled; _buttonUndofilter.Enabled = enabled; _checkList.Enabled = enabled; @@ -1065,13 +1026,10 @@ public void SortDesc() /// public string? SortString { - get - { - return (!String.IsNullOrEmpty(_sortString) ? _sortString : ""); - } + get => !String.IsNullOrEmpty(_sortString) ? _sortString : ""; private set { - _cancelSortMenuItem.Enabled = (value != null && value.Length > 0); + _cancelSortMenuItem.Enabled = value != null && value.Length > 0; _sortString = value; } } @@ -1097,13 +1055,10 @@ public void CleanSort() /// public string? FilterString { - get - { - return (!String.IsNullOrEmpty(_filterString) ? _filterString : ""); - } + get => !String.IsNullOrEmpty(_filterString) ? _filterString : ""; private set { - _cancelFilterMenuItem.Enabled = (value != null && value.Length > 0); + _cancelFilterMenuItem.Enabled = value != null && value.Length > 0; _filterString = value; } } @@ -1173,7 +1128,7 @@ private void ChecklistReloadNodes() _checkList.BeginUpdate(); _checkList.Nodes.Clear(); int nodecount = 0; - foreach (TreeNodeItemSelector node in _loadedNodes) + foreach (TreeNodeItemSelector? node in _loadedNodes) { if (node.NodeType == TreeNodeItemSelector.CustomNodeType.Default) { @@ -1250,17 +1205,17 @@ private void SetCheckListFilter() if (_loadedNodes.Length > 2 || selectAllNode == null) { string filter = BuildNodesFilterString( - (IsFilterNotinLogicEnabled && (DataType != typeof(DateTime) && DataType != typeof(TimeSpan) && DataType != typeof(bool)) ? + IsFilterNotinLogicEnabled && DataType != typeof(DateTime) && DataType != typeof(TimeSpan) && DataType != typeof(bool) ? _loadedNodes.AsParallel().Cast().Where( n => n.NodeType != TreeNodeItemSelector.CustomNodeType.SelectAll - && n.NodeType != TreeNodeItemSelector.CustomNodeType.SelectEmpty - && n.CheckState == CheckState.Unchecked + && n.NodeType != TreeNodeItemSelector.CustomNodeType.SelectEmpty + && n.CheckState == CheckState.Unchecked ) : _loadedNodes.AsParallel().Cast().Where( n => n.NodeType != TreeNodeItemSelector.CustomNodeType.SelectAll - && n.NodeType != TreeNodeItemSelector.CustomNodeType.SelectEmpty - && n.CheckState != CheckState.Unchecked - )) + && n.NodeType != TreeNodeItemSelector.CustomNodeType.SelectEmpty + && n.CheckState != CheckState.Unchecked + ) ); if (filter.Length > 0) @@ -1329,11 +1284,11 @@ private string BuildNodesFilterString(IEnumerable nodes) { foreach (TreeNodeItemSelector n in nodes) { - if (n.Checked && (n.Nodes.AsParallel().Cast().Where(sn => sn.CheckState != CheckState.Unchecked).Count() == 0)) + if (n.Checked && n.Nodes.AsParallel().Cast().Where(sn => sn.CheckState != CheckState.Unchecked).Count() == 0) { DateTime dt = (DateTime)n.Value; sb.Append( - $"'{Convert.ToString((IsFilterDateAndTimeEnabled ? dt : dt.Date), CultureInfo.CurrentCulture)}'{appx}"); + $"'{Convert.ToString(IsFilterDateAndTimeEnabled ? dt : dt.Date, CultureInfo.CurrentCulture)}'{appx}"); } else if (n.CheckState != CheckState.Unchecked && n.Nodes.Count > 0) { @@ -1349,7 +1304,7 @@ private string BuildNodesFilterString(IEnumerable nodes) { foreach (TreeNodeItemSelector n in nodes) { - if (n.Checked && (n.Nodes.AsParallel().Cast().Where(sn => sn.CheckState != CheckState.Unchecked).Count() == 0)) + if (n.Checked && n.Nodes.AsParallel().Cast().Where(sn => sn.CheckState != CheckState.Unchecked).Count() == 0) { TimeSpan ts = (TimeSpan)n.Value; sb.Append( @@ -1628,10 +1583,10 @@ private void CheckFilterButtonEnabled() /// /// /// - private bool HasNodesChecked(TreeNodeItemSelector[] nodes) + private bool HasNodesChecked(TreeNodeItemSelector?[] nodes) { bool state = false; - if (!String.IsNullOrEmpty(_checkTextFilter.Text)) + if (!string.IsNullOrEmpty(_checkTextFilter.Text)) { state = nodes.Any(n => n.CheckState == CheckState.Checked && n.Text.ToLower().Contains(_checkTextFilter.Text.ToLower())); } @@ -1647,7 +1602,7 @@ private bool HasNodesChecked(TreeNodeItemSelector[] nodes) foreach (TreeNodeItemSelector node in nodes) { - foreach (TreeNodeItemSelector nodesel in node.Nodes) + foreach (TreeNodeItemSelector nodesel in node!.Nodes) { state = HasNodesChecked(new TreeNodeItemSelector[] { nodesel }); if (state) @@ -1668,7 +1623,7 @@ private bool HasNodesChecked(TreeNodeItemSelector[] nodes) /// Check /// /// - private void NodeCheckChange(TreeNodeItemSelector node) + private void NodeCheckChange(TreeNodeItemSelector? node) { if (node.CheckState == CheckState.Checked) { @@ -1695,7 +1650,7 @@ private void NodeCheckChange(TreeNodeItemSelector node) //refresh nodes CheckState state = UpdateNodesCheckState(ChecklistNodes()); - GetSelectAllNode().CheckState = state; + GetSelectAllNode()!.CheckState = state; } } @@ -1704,11 +1659,11 @@ private void NodeCheckChange(TreeNodeItemSelector node) /// /// /// - private void SetNodesCheckState(TreeNodeItemSelector[] nodes, bool isChecked) + private void SetNodesCheckState(TreeNodeItemSelector?[] nodes, bool isChecked) { foreach (TreeNodeItemSelector node in nodes) { - node.Checked = isChecked; + node!.Checked = isChecked; if (node.Nodes != null && node.Nodes.Count > 0) { foreach (TreeNodeItemSelector subnode in node.Nodes) @@ -1757,14 +1712,7 @@ private CheckState UpdateNodesCheckState(TreeNodeCollection nodes) } } - if (isAllNodesSomeCheckState) - { - return result; - } - else - { - return CheckState.Indeterminate; - } + return isAllNodesSomeCheckState ? result : CheckState.Indeterminate; } /// @@ -1826,13 +1774,13 @@ private CheckState UpdateNodesCheckState(TreeNodeCollection nodes) /// /// Duplicate Nodes /// - private static TreeNodeItemSelector[] DuplicateNodes(TreeNodeItemSelector[] nodes) + private static TreeNodeItemSelector?[] DuplicateNodes(TreeNodeItemSelector?[] nodes) { - TreeNodeItemSelector[] ret = new TreeNodeItemSelector[nodes.Length]; + TreeNodeItemSelector?[] ret = new TreeNodeItemSelector[nodes.Length]; int i = 0; - foreach (TreeNodeItemSelector n in nodes) + foreach (TreeNodeItemSelector? n in nodes) { - ret[i] = n.Clone(); + ret[i] = n?.Clone(); i++; } return ret; @@ -1883,10 +1831,10 @@ private void CheckList_KeyDown(object sender, KeyEventArgs e) /// private void CheckList_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { - TreeNodeItemSelector n = e.Node as TreeNodeItemSelector; + TreeNodeItemSelector? n = e.Node as TreeNodeItemSelector; //set the new node check status SetNodesCheckState(_loadedNodes, false); - n.CheckState = CheckState.Unchecked; + n!.CheckState = CheckState.Unchecked; NodeCheckChange(n); //set filter button enabled CheckFilterButtonEnabled(); @@ -1950,7 +1898,7 @@ private void UnCheckCustomFilters() { for (int i = 2; i < _customFilterLastFiltersListMenuItem.DropDownItems.Count; i++) { - (_customFilterLastFiltersListMenuItem.DropDownItems[i] as ToolStripMenuItem).Checked = false; + ((_customFilterLastFiltersListMenuItem.DropDownItems[i] as ToolStripMenuItem)!).Checked = false; } } @@ -1984,14 +1932,14 @@ private void SetCustomFilter(int filtersMenuItemIndex) //uncheck other preset for (int i = 3; i < _customFilterLastFiltersListMenuItem.DropDownItems.Count; i++) { - (_customFilterLastFiltersListMenuItem.DropDownItems[i] as ToolStripMenuItem).Checked = false; + ((_customFilterLastFiltersListMenuItem.DropDownItems[i] as ToolStripMenuItem)!).Checked = false; } - (_customFilterLastFiltersListMenuItem.DropDownItems[2] as ToolStripMenuItem).Checked = true; + ((_customFilterLastFiltersListMenuItem.DropDownItems[2] as ToolStripMenuItem)!).Checked = true; _activeFilterType = FilterType.Custom; //get Filter string - string oldfilter = FilterString; + string? oldfilter = FilterString; FilterString = filterstring; //set CheckList nodes @@ -2019,7 +1967,7 @@ private void SetCustomFilter(int filtersMenuItemIndex) /// private void CancelFilterMenuItem_Click(object sender, EventArgs e) { - string oldfilter = FilterString; + string? oldfilter = FilterString; //clean Filter CleanFilter(); @@ -2038,9 +1986,9 @@ private void CancelFilterMenuItem_Click(object sender, EventArgs e) /// private void CancelFilterMenuItem_MouseEnter(object sender, EventArgs e) { - if ((sender as ToolStripMenuItem).Enabled) + if (((sender as ToolStripMenuItem)!).Enabled) { - (sender as ToolStripMenuItem).Select(); + ((sender as ToolStripMenuItem)!).Select(); } } @@ -2113,9 +2061,9 @@ private void CustomFilterMenuItem_Click(object sender, EventArgs e) /// private void CustomFilterLastFiltersListMenuItem_MouseEnter(object sender, EventArgs e) { - if ((sender as ToolStripMenuItem).Enabled) + if (((sender as ToolStripMenuItem)!).Enabled) { - (sender as ToolStripMenuItem).Select(); + ((sender as ToolStripMenuItem)!).Select(); } } @@ -2124,7 +2072,7 @@ private void CustomFilterLastFiltersListMenuItem_MouseEnter(object sender, Event /// /// /// - private void CustomFilterLastFiltersListMenuItem_Paint(Object sender, PaintEventArgs e) + private void CustomFilterLastFiltersListMenuItem_Paint(object sender, PaintEventArgs e) { Rectangle rect = new Rectangle(_customFilterLastFiltersListMenuItem.Width - 12, 7, 10, 10); ControlPaint.DrawMenuGlyph(e.Graphics, rect, MenuGlyph.Arrow, Color.Black, Color.Transparent); @@ -2138,7 +2086,7 @@ private void CustomFilterLastFiltersListMenuItem_Paint(Object sender, PaintEvent private void CustomFilterLastFilter1MenuItem_VisibleChanged(object sender, EventArgs e) { _toolStripSeparator2MenuItem.Visible = !_customFilterLastFilter1MenuItem.Visible; - (sender as ToolStripMenuItem).VisibleChanged -= CustomFilterLastFilter1MenuItem_VisibleChanged; + ((sender as ToolStripMenuItem)!).VisibleChanged -= CustomFilterLastFilter1MenuItem_VisibleChanged; } /// @@ -2148,11 +2096,11 @@ private void CustomFilterLastFilter1MenuItem_VisibleChanged(object sender, Event /// private void CustomFilterLastFilterMenuItem_Click(object sender, EventArgs e) { - ToolStripMenuItem menuitem = sender as ToolStripMenuItem; + ToolStripMenuItem? menuitem = sender as ToolStripMenuItem; for (int i = 2; i < _customFilterLastFiltersListMenuItem.DropDownItems.Count; i++) { - if (_customFilterLastFiltersListMenuItem.DropDownItems[i].Text == menuitem.Text && _customFilterLastFiltersListMenuItem.DropDownItems[i].Tag.ToString() == menuitem.Tag.ToString()) + if (_customFilterLastFiltersListMenuItem.DropDownItems[i].Text == menuitem?.Text && _customFilterLastFiltersListMenuItem.DropDownItems[i].Tag.ToString() == menuitem.Tag.ToString()) { //set current filter preset as active SetCustomFilter(i); @@ -2168,8 +2116,8 @@ private void CustomFilterLastFilterMenuItem_Click(object sender, EventArgs e) /// private void CustomFilterLastFilterMenuItem_TextChanged(object sender, EventArgs e) { - (sender as ToolStripMenuItem).Available = true; - (sender as ToolStripMenuItem).TextChanged -= CustomFilterLastFilterMenuItem_TextChanged; + ((sender as ToolStripMenuItem)!).Available = true; + ((sender as ToolStripMenuItem)!).TextChanged -= CustomFilterLastFilterMenuItem_TextChanged; } /// @@ -2237,7 +2185,7 @@ private void CheckTextFilterHandleTextChanged(string text) } for (int i = _loadedNodes.Length - 1; i >= 0; i--) { - TreeNodeItemSelector node = _loadedNodes[i]; + TreeNodeItemSelector? node = _loadedNodes[i]; if (node.Text == allnode.Text) { node.CheckState = CheckState.Indeterminate; @@ -2272,12 +2220,12 @@ private void CheckTextFilterHandleTextChanged(string text) { for (int i = _loadedNodes.Length - 1; i >= 0; i--) { - TreeNodeItemSelector node = _loadedNodes[i]; + TreeNodeItemSelector? node = _loadedNodes[i]; if (!(node.Text == allnode.Text || node.Text == nullnode.Text)) { if (!node.Text.ToLower().Contains(text)) { - _removedNodes = _removedNodes.Concat(new TreeNodeItemSelector[] { node }).ToArray(); + _removedNodes = _removedNodes.Concat(new TreeNodeItemSelector?[] { node }).ToArray(); } } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/TreeNodeItemSelector.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/TreeNodeItemSelector.cs index 4fc4b30a7..32e55c78e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/TreeNodeItemSelector.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Toolkit/TreeNodeItemSelector.cs @@ -40,7 +40,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -115,7 +115,7 @@ private TreeNodeItemSelector(String text, object value, CheckState state, Custom /// Clone a Node /// /// - public new TreeNodeItemSelector Clone() + public new TreeNodeItemSelector? Clone() { TreeNodeItemSelector? n = new TreeNodeItemSelector(Text, Value, _checkState, NodeType) { @@ -163,14 +163,8 @@ private TreeNodeItemSelector(String text, object value, CheckState state, Custom /// public new bool Checked { - get - { - return _checkState == CheckState.Checked; - } - set - { - CheckState = (value == true ? CheckState.Checked : CheckState.Unchecked); - } + get => _checkState == CheckState.Checked; + set => CheckState = value == true ? CheckState.Checked : CheckState.Unchecked; } /// @@ -178,10 +172,7 @@ private TreeNodeItemSelector(String text, object value, CheckState state, Custom /// public CheckState CheckState { - get - { - return _checkState; - } + get => _checkState; set { _checkState = value; @@ -253,7 +244,7 @@ public static TreeNodeItemSelector CreateNode(string text, object value, CheckSt /// Add a child Node to this Node /// /// - protected void AddChild(TreeNodeItemSelector child) + protected void AddChild(TreeNodeItemSelector? child) { child.Parent = this; Nodes.Add(child); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Visuals/Filtering/FormCustomFilter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Visuals/Filtering/FormCustomFilter.cs index 7dc1a1a34..be786038b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Visuals/Filtering/FormCustomFilter.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Controls Visuals/Filtering/FormCustomFilter.cs @@ -40,7 +40,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -150,15 +150,15 @@ public FormCustomFilter(Type dataType, bool filterDateAndTimeEnabled) { DateTimeFormatInfo dt = Thread.CurrentThread.CurrentCulture.DateTimeFormat; - ((_valControl1 as DateTimePicker)!).CustomFormat = $@"{dt.ShortDatePattern} HH:mm"; - ((_valControl2 as DateTimePicker)!).CustomFormat = $@"{dt.ShortDatePattern} HH:mm"; - ((_valControl1 as DateTimePicker)!).Format = DateTimePickerFormat.Custom; - ((_valControl2 as DateTimePicker)!).Format = DateTimePickerFormat.Custom; + (_valControl1 as DateTimePicker)!.CustomFormat = $@"{dt.ShortDatePattern} HH:mm"; + (_valControl2 as DateTimePicker)!.CustomFormat = $@"{dt.ShortDatePattern} HH:mm"; + (_valControl1 as DateTimePicker)!.Format = DateTimePickerFormat.Custom; + (_valControl2 as DateTimePicker)!.Format = DateTimePickerFormat.Custom; } else { - ((_valControl1 as DateTimePicker)!).Format = DateTimePickerFormat.Short; - ((_valControl2 as DateTimePicker)!).Format = DateTimePickerFormat.Short; + (_valControl1 as DateTimePicker)!.Format = DateTimePickerFormat.Short; + (_valControl2 as DateTimePicker)!.Format = DateTimePickerFormat.Short; } comboBox_filterType.Items.AddRange(new[] { @@ -284,41 +284,41 @@ private void FormCustomFilter_Load(object sender, EventArgs e) if (filterTypeConditionText == KryptonAdvancedDataGridView.Translations[TranslationKey.KryptonAdvancedDataGridViewEquals.ToString()]) { filterString = - $"Convert([{{0}}], 'System.String') LIKE '%{Convert.ToString((filterDateAndTimeEnabled ? dt : dt.Date), CultureInfo.CurrentCulture)}%'"; + $"Convert([{{0}}], 'System.String') LIKE '%{Convert.ToString(filterDateAndTimeEnabled ? dt : dt.Date, CultureInfo.CurrentCulture)}%'"; } else if (filterTypeConditionText == KryptonAdvancedDataGridView.Translations[TranslationKey.KryptonAdvancedDataGridViewEarlierThan.ToString()]) { filterString += - $"< '{Convert.ToString((filterDateAndTimeEnabled ? dt : dt.Date), CultureInfo.CurrentCulture)}'"; + $"< '{Convert.ToString(filterDateAndTimeEnabled ? dt : dt.Date, CultureInfo.CurrentCulture)}'"; } else if (filterTypeConditionText == KryptonAdvancedDataGridView.Translations[TranslationKey.KryptonAdvancedDataGridViewEarlierThanOrEqualTo.ToString()]) { filterString += - $"<= '{Convert.ToString((filterDateAndTimeEnabled ? dt : dt.Date), CultureInfo.CurrentCulture)}'"; + $"<= '{Convert.ToString(filterDateAndTimeEnabled ? dt : dt.Date, CultureInfo.CurrentCulture)}'"; } else if (filterTypeConditionText == KryptonAdvancedDataGridView.Translations[TranslationKey.KryptonAdvancedDataGridViewLaterThan.ToString()]) { filterString += - $"> '{Convert.ToString((filterDateAndTimeEnabled ? dt : dt.Date), CultureInfo.CurrentCulture)}'"; + $"> '{Convert.ToString(filterDateAndTimeEnabled ? dt : dt.Date, CultureInfo.CurrentCulture)}'"; } else if (filterTypeConditionText == KryptonAdvancedDataGridView.Translations[TranslationKey.KryptonAdvancedDataGridViewLaterThanOrEqualTo.ToString()]) { filterString += - $">= '{Convert.ToString((filterDateAndTimeEnabled ? dt : dt.Date), CultureInfo.CurrentCulture)}'"; + $">= '{Convert.ToString(filterDateAndTimeEnabled ? dt : dt.Date, CultureInfo.CurrentCulture)}'"; } else if (filterTypeConditionText == KryptonAdvancedDataGridView.Translations[TranslationKey.KryptonAdvancedDataGridViewBetween.ToString()]) { DateTime dt1 = ((DateTimePicker)control2).Value; dt1 = new(dt1.Year, dt1.Month, dt1.Day, dt1.Hour, dt1.Minute, 0); filterString += - $">= '{Convert.ToString((filterDateAndTimeEnabled ? dt : dt.Date), CultureInfo.CurrentCulture)}'"; + $">= '{Convert.ToString(filterDateAndTimeEnabled ? dt : dt.Date, CultureInfo.CurrentCulture)}'"; filterString += - $" AND {column}<= '{Convert.ToString((filterDateAndTimeEnabled ? dt1 : dt1.Date), CultureInfo.CurrentCulture)}'"; + $" AND {column}<= '{Convert.ToString(filterDateAndTimeEnabled ? dt1 : dt1.Date, CultureInfo.CurrentCulture)}'"; } else if (filterTypeConditionText == KryptonAdvancedDataGridView.Translations[TranslationKey.KryptonAdvancedDataGridViewDoesNotEqual.ToString()]) { filterString = - $"Convert([{{0}}], 'System.String') NOT LIKE '%{Convert.ToString((filterDateAndTimeEnabled ? dt : dt.Date), CultureInfo.CurrentCulture)}%'"; + $"Convert([{{0}}], 'System.String') NOT LIKE '%{Convert.ToString(filterDateAndTimeEnabled ? dt : dt.Date, CultureInfo.CurrentCulture)}%'"; } break; @@ -464,8 +464,8 @@ private void button_cancel_Click(object sender, EventArgs e) private void button_ok_Click(object sender, EventArgs e) { - if (_valControl1 != null && _valControl2 != null && ((_valControl1.Visible && _valControl1.Tag != null && ((bool)_valControl1.Tag)) || - (_valControl2.Visible && _valControl2.Tag != null && ((bool)_valControl2.Tag)))) + if (_valControl1 != null && _valControl2 != null && ((_valControl1.Visible && _valControl1.Tag != null && (bool)_valControl1.Tag) || + (_valControl2.Visible && _valControl2.Tag != null && (bool)_valControl2.Tag))) { button_ok.Enabled = false; return; @@ -510,8 +510,8 @@ private void comboBox_filterType_SelectedIndexChanged(object sender, EventArgs e if (_valControl1 != null) { button_ok.Enabled = - !(_valControl1.Visible && _valControl1.Tag != null && ((bool)_valControl1.Tag)) || - (_valControl2.Visible && _valControl2.Tag != null && ((bool)_valControl2.Tag)); + !(_valControl1.Visible && _valControl1.Tag != null && (bool)_valControl1.Tag) || + (_valControl2.Visible && _valControl2.Tag != null && (bool)_valControl2.Tag); } } } @@ -541,30 +541,30 @@ private void valControl_TextChanged(object sender, EventArgs e) { case FilterType.Integer: long val; - hasErrors = !(long.TryParse(((sender as TextBox)!).Text, out val)); + hasErrors = !long.TryParse((sender as TextBox)!.Text, out val); break; case FilterType.Float: double val1; - hasErrors = !(double.TryParse(((sender as TextBox)!).Text, out val1)); + hasErrors = !double.TryParse((sender as TextBox)!.Text, out val1); break; } - ((sender as Control)!).Tag = hasErrors || ((sender as TextBox)!).Text.Length == 0; + (sender as Control)!.Tag = hasErrors || (sender as TextBox)!.Text.Length == 0; - if (hasErrors && ((sender as TextBox)!).Text.Length > 0) + if (hasErrors && (sender as TextBox)!.Text.Length > 0) { - ep.SetError(((sender as Control)!), KryptonAdvancedDataGridView.Translations[TranslationKey.KryptonAdvancedDataGridViewInvalidValue.ToString()]); + ep.SetError((sender as Control)!, KryptonAdvancedDataGridView.Translations[TranslationKey.KryptonAdvancedDataGridViewInvalidValue.ToString()]); } else { - ep.SetError(((sender as Control)!), ""); + ep.SetError((sender as Control)!, ""); } if (_valControl1 != null && _valControl2 != null) { - button_ok.Enabled = !(_valControl1.Visible && _valControl1.Tag != null && ((bool)_valControl1.Tag)) || - (_valControl2.Visible && _valControl2.Tag != null && ((bool)_valControl2.Tag)); + button_ok.Enabled = !(_valControl1.Visible && _valControl1.Tag != null && (bool)_valControl1.Tag) || + (_valControl2.Visible && _valControl2.Tag != null && (bool)_valControl2.Tag); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Enumerations/FilterType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Enumerations/FilterType.cs index 14d580f72..d937a8b00 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Enumerations/FilterType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Enumerations/FilterType.cs @@ -40,7 +40,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Enumerations/TranslationKey.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Enumerations/TranslationKey.cs index ac19f0c77..22c7065d9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Enumerations/TranslationKey.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Enumerations/TranslationKey.cs @@ -40,7 +40,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Globals/GlobalDeclarations.cs index f52c8432d..fb14f6d0c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView 2022.csproj index b5f1fe0f0..a140b7b2b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements the advanced data grid view controls. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements the advanced data grid view controls. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,44 +69,36 @@ - - - preview - - - - - - - - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - + @@ -130,6 +110,7 @@ enable + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView.licenseheader index b15f2d6dd..145513ab7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView.licenseheader @@ -41,7 +41,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Utilities/GlobalMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Utilities/GlobalMethods.cs index b34b153a3..d28fbe5ec 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Utilities/GlobalMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Utilities/GlobalMethods.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -126,9 +126,7 @@ public bool CheckIfTargetPlatformIsSupported(bool useLegacyVistaSupport = false) } catch (Exception exc) { - //ExceptionCapture.CaptureException(exc, "Exception Thrown", MessageBoxButtons.OK, KryptonMessageBoxIcon.Error, "GlobalMethods", "CheckIfTargetPlatformIsSupported(bool useLegacyVistaSupport = false)"); - - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); SetIsTargetPlatformSupported(false); } @@ -155,7 +153,7 @@ public bool IsTargetPlatformRunningIn64BITMode() } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); SetIsTargetPlatform64BIT(false); } @@ -175,7 +173,7 @@ public bool AreAssemblies64BIT() } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); SetIsAssemblies64BIT(false); } @@ -247,7 +245,7 @@ private string HKLM_GetString(string path, string key) catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); return string.Empty; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Utilities/NativeMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Utilities/NativeMethods.cs index 063b678b0..c44d90512 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Utilities/NativeMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Utilities/NativeMethods.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Utilities/PlatformHelper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Utilities/PlatformHelper.cs index 65d6681e1..f0b99131d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Utilities/PlatformHelper.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Utilities/PlatformHelper.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -40,8 +40,8 @@ static PlatformHelper() PlatformHelper.Win32NT = Environment.OSVersion.Platform == PlatformID.Win32NT; PlatformHelper.XpOrHigher = PlatformHelper.Win32NT && Environment.OSVersion.Version.Major >= 5; PlatformHelper.VistaOrHigher = PlatformHelper.Win32NT && Environment.OSVersion.Version.Major >= 6; - PlatformHelper.SevenOrHigher = PlatformHelper.Win32NT && (Environment.OSVersion.Version >= new Version(6, 1)); - PlatformHelper.EightOrHigher = PlatformHelper.Win32NT && (Environment.OSVersion.Version >= new Version(6, 2, 9200)); + PlatformHelper.SevenOrHigher = PlatformHelper.Win32NT && Environment.OSVersion.Version >= new Version(6, 1); + PlatformHelper.EightOrHigher = PlatformHelper.Win32NT && Environment.OSVersion.Version >= new Version(6, 2, 9200); PlatformHelper.VisualStylesEnabled = VisualStyleInformation.IsEnabledByUser; SystemEvents.UserPreferenceChanged += (s, e) => diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Utilities/UACSecurity.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Utilities/UACSecurity.cs index 90b57e697..3ab445631 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Utilities/UACSecurity.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Utilities/UACSecurity.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -36,7 +36,7 @@ public static class UACSecurity #endregion #region Constants - internal const int BCM_FIRST = 0x1600, BCM_SETSHIELD = (BCM_FIRST + 0x000C); + internal const int BCM_FIRST = 0x1600, BCM_SETSHIELD = BCM_FIRST + 0x000C; #endregion #region Methods @@ -80,7 +80,7 @@ internal static void RestartElevated() } catch (Win32Exception ex) { - ExceptionCapture.CaptureException(ex); + DebugUtilities.NotImplemented(ex.ToString()); return; //If cancelled, do nothing } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/CommandLinkTextValues.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/CommandLinkTextValues.cs index c33fb396f..5f15b50ac 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/CommandLinkTextValues.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/CommandLinkTextValues.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/ImageValue.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/ImageValue.cs index 2a8ef2749..6f1a8b1d6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/ImageValue.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/ImageValue.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -78,9 +78,8 @@ public Image Image /// Gets a value indicating if all values are default. /// [Browsable(false)] - public override bool IsDefault => ((Image == defaultImage) && - (ImageTransparentColor == Color.Empty) - ); + public override bool IsDefault => Image == defaultImage && + ImageTransparentColor == Color.Empty; #endregion @@ -126,8 +125,8 @@ public string GetLongText() [Localizable(true)] [Category("Visuals")] [Description("Image transparent color.")] - [RefreshPropertiesAttribute(RefreshProperties.All)] - [KryptonDefaultColorAttribute()] + [RefreshProperties(RefreshProperties.All)] + [KryptonDefaultColor()] public Color ImageTransparentColor { get => _transparent; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/MainTextValue.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/MainTextValue.cs index 8eb07e3cf..9a07764a7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/MainTextValue.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/MainTextValue.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/SubscriptTextValue.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/SubscriptTextValue.cs index 8075c9deb..6ae75afa8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/SubscriptTextValue.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/SubscriptTextValue.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/View Draw/ViewDrawCommandLinkButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/View Draw/ViewDrawCommandLinkButton.cs index be52547d2..6cd08b7f3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/View Draw/ViewDrawCommandLinkButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/View Draw/ViewDrawCommandLinkButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -27,509 +27,509 @@ namespace Krypton.Toolkit.Suite.Extended.Buttons { - /// - /// View element that can draw a CommandLinkButton. - /// - public class ViewDrawCommandLinkButton : ViewComposite - { - #region Instance Fields - - private IPaletteTriple _paletteDisabled; - private IPaletteTriple _paletteNormal; - private IPaletteTriple _paletteTracking; - private IPaletteTriple _palettePressed; - private IPaletteTriple _paletteCheckedNormal; - private IPaletteTriple _paletteCheckedTracking; - private IPaletteTriple _paletteCheckedPressed; - private readonly ViewDrawCanvas _drawCanvas; - private readonly ViewDrawContent _drawContent; - private readonly ViewDrawContent _drawImageContent; - private readonly ViewLayoutCenter _drawImage; - private bool _forcePaletteUpdate; - #endregion - - #region Identity - - /// - /// Initialize a new instance of the ViewDrawButton class. - /// - /// Palette source for the disabled state. - /// Palette source for the normal state. - /// Palette source for the tracking state. - /// Palette source for the pressed state. - /// Palette source for metric values. - /// - /// - /// Visual orientation of the content. - /// Use mnemonics. - public ViewDrawCommandLinkButton(IPaletteTriple paletteDisabled, - IPaletteTriple paletteNormal, - IPaletteTriple paletteTracking, - IPaletteTriple palettePressed, - IPaletteMetric paletteMetric, - ImageValue imageValue, CommandLinkTextValues commandLinkTextValues, - VisualOrientation orientation, - bool useMnemonic) - : this(paletteDisabled, paletteNormal, paletteTracking, palettePressed, - paletteNormal, paletteTracking, palettePressed, paletteMetric, - imageValue, commandLinkTextValues, orientation, useMnemonic) - { - } - - /// - /// Initialize a new instance of the ViewDrawButton class. - /// - /// Palette source for the disabled state. - /// Palette source for the normal state. - /// Palette source for the tracking state. - /// Palette source for the pressed state. - /// Palette source for the normal checked state. - /// Palette source for the tracking checked state. - /// Palette source for the pressed checked state. - /// Palette source for metric values. - /// - /// - /// Visual orientation of the content. - /// Use mnemonics. - public ViewDrawCommandLinkButton(IPaletteTriple paletteDisabled, - IPaletteTriple paletteNormal, - IPaletteTriple paletteTracking, - IPaletteTriple palettePressed, - IPaletteTriple paletteCheckedNormal, - IPaletteTriple paletteCheckedTracking, - IPaletteTriple paletteCheckedPressed, - IPaletteMetric paletteMetric, - ImageValue imageValue, CommandLinkTextValues commandLinkTextValues, - VisualOrientation orientation, - bool useMnemonic) - { - // Remember the source information - _paletteDisabled = paletteDisabled; - _paletteNormal = paletteNormal; - _paletteTracking = paletteTracking; - _palettePressed = palettePressed; - _paletteCheckedNormal = paletteCheckedNormal; - _paletteCheckedTracking = paletteCheckedTracking; - _paletteCheckedPressed = paletteCheckedPressed; - CurrentPalette = _paletteNormal; - - // Default to not being checked - Checked = false; - AllowUncheck = true; - - // Create the drop down view - _drawImageContent = new(_paletteNormal.PaletteContent, imageValue, orientation); - _drawImage = new(paletteMetric, PaletteMetricPadding.BarPaddingOnly, - orientation, _drawImageContent); - - // Our view contains background and border with content inside - _drawContent = new(_paletteNormal.PaletteContent, commandLinkTextValues, orientation) - { - // Pass the mnemonic default to the content view - UseMnemonic = useMnemonic - }; - - // Use a docker layout to organize the contents of the canvas - LayoutDocker = new() - { - { _drawContent, ViewDockStyle.Left }, - { _drawImage, ViewDockStyle.Left } - }; - LayoutDocker.Tag = this; - - - _drawCanvas = new(_paletteNormal.PaletteBack, _paletteNormal.PaletteBorder, paletteMetric, - PaletteMetricPadding.BarPaddingTabs, orientation) - { + /// + /// View element that can draw a CommandLinkButton. + /// + public class ViewDrawCommandLinkButton : ViewComposite + { + #region Instance Fields + + private IPaletteTriple _paletteDisabled; + private IPaletteTriple _paletteNormal; + private IPaletteTriple _paletteTracking; + private IPaletteTriple _palettePressed; + private IPaletteTriple _paletteCheckedNormal; + private IPaletteTriple _paletteCheckedTracking; + private IPaletteTriple _paletteCheckedPressed; + private readonly ViewDrawCanvas _drawCanvas; + private readonly ViewDrawContent _drawContent; + private readonly ViewDrawContent _drawImageContent; + private readonly ViewLayoutCenter _drawImage; + private bool _forcePaletteUpdate; + #endregion + + #region Identity + + /// + /// Initialize a new instance of the ViewDrawButton class. + /// + /// Palette source for the disabled state. + /// Palette source for the normal state. + /// Palette source for the tracking state. + /// Palette source for the pressed state. + /// Palette source for metric values. + /// + /// + /// Visual orientation of the content. + /// Use mnemonics. + public ViewDrawCommandLinkButton(IPaletteTriple paletteDisabled, + IPaletteTriple paletteNormal, + IPaletteTriple paletteTracking, + IPaletteTriple palettePressed, + IPaletteMetric paletteMetric, + ImageValue imageValue, CommandLinkTextValues commandLinkTextValues, + VisualOrientation orientation, + bool useMnemonic) + : this(paletteDisabled, paletteNormal, paletteTracking, palettePressed, + paletteNormal, paletteTracking, palettePressed, paletteMetric, + imageValue, commandLinkTextValues, orientation, useMnemonic) + { + } + + /// + /// Initialize a new instance of the ViewDrawButton class. + /// + /// Palette source for the disabled state. + /// Palette source for the normal state. + /// Palette source for the tracking state. + /// Palette source for the pressed state. + /// Palette source for the normal checked state. + /// Palette source for the tracking checked state. + /// Palette source for the pressed checked state. + /// Palette source for metric values. + /// + /// + /// Visual orientation of the content. + /// Use mnemonics. + public ViewDrawCommandLinkButton(IPaletteTriple paletteDisabled, + IPaletteTriple paletteNormal, + IPaletteTriple paletteTracking, + IPaletteTriple palettePressed, + IPaletteTriple paletteCheckedNormal, + IPaletteTriple paletteCheckedTracking, + IPaletteTriple paletteCheckedPressed, + IPaletteMetric paletteMetric, + ImageValue imageValue, CommandLinkTextValues commandLinkTextValues, + VisualOrientation orientation, + bool useMnemonic) + { + // Remember the source information + _paletteDisabled = paletteDisabled; + _paletteNormal = paletteNormal; + _paletteTracking = paletteTracking; + _palettePressed = palettePressed; + _paletteCheckedNormal = paletteCheckedNormal; + _paletteCheckedTracking = paletteCheckedTracking; + _paletteCheckedPressed = paletteCheckedPressed; + CurrentPalette = _paletteNormal; + + // Default to not being checked + Checked = false; + AllowUncheck = true; + + // Create the drop down view + _drawImageContent = new(_paletteNormal.PaletteContent, imageValue, orientation); + _drawImage = new(paletteMetric, PaletteMetricPadding.BarPaddingOnly, + orientation, _drawImageContent); + + // Our view contains background and border with content inside + _drawContent = new(_paletteNormal.PaletteContent, commandLinkTextValues, orientation) + { + // Pass the mnemonic default to the content view + UseMnemonic = useMnemonic + }; + + // Use a docker layout to organize the contents of the canvas + LayoutDocker = new() + { + { _drawContent, ViewDockStyle.Left }, + { _drawImage, ViewDockStyle.Left } + }; + LayoutDocker.Tag = this; + + + _drawCanvas = new(_paletteNormal.PaletteBack, _paletteNormal.PaletteBorder, paletteMetric, + PaletteMetricPadding.BarPaddingTabs, orientation) + { // Place the content inside the canvas LayoutDocker - }; - - // Place the canvas inside ourself - Add(_drawCanvas); - } - - /// - /// 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 $"ViewDrawButton:{Id}"; - } - #endregion - - #region LayoutDocker - /// - /// Gets access to the contained layout docker. - /// - public ViewLayoutDocker LayoutDocker { get; } - - #endregion - - #region CurrentPalette - /// - /// Gets access to the currently selected palette. - /// - public IPaletteTriple CurrentPalette { get; private set; } - - #endregion - - #region ButtonValues - /// - /// Gets and sets the source for button values. - /// - public IContentValues ButtonValues - { - get => _drawContent.Values; - set => _drawContent.Values = value; - } - #endregion - - #region DrawTabBorder - /// - /// Gets and sets if the border should be drawn as a tab border. - /// - public bool DrawTabBorder - { - get => _drawCanvas.DrawTabBorder; - set => _drawCanvas.DrawTabBorder = value; - } - #endregion - - #region TabBorderStyle - /// - /// Gets and sets the tab border style of the button. - /// - public TabBorderStyle TabBorderStyle - { - get => _drawCanvas.TabBorderStyle; - set => _drawCanvas.TabBorderStyle = value; - } - #endregion - - #region Enabled - /// - /// Gets and sets the enabled state of the element. - /// - public override bool Enabled - { - get => base.Enabled; - - set - { - base.Enabled = value; - - if (Enabled && (ElementState == PaletteState.Disabled)) - { - ElementState = Checked ? PaletteState.CheckedNormal : PaletteState.Normal; - } - - // Pass on the new state to the child elements - _drawCanvas.Enabled = value; - _drawContent.Enabled = value; - _drawImageContent.Enabled = value; - } - } - #endregion - - #region Orientation - /// - /// Gets and sets the visual orientation. - /// - public virtual VisualOrientation Orientation - { - get => _drawCanvas.Orientation; - set => SetOrientation(value, value); - } - - /// - /// Set the orientation of the two button components. - /// - /// Orientation of the button border and background.. - /// Orientation of the button contents. - public void SetOrientation(VisualOrientation borderBackOrient, - VisualOrientation contentOrient) - { - _drawCanvas.Orientation = borderBackOrient; - _drawContent.Orientation = contentOrient; - } - #endregion - - #region UseMnemonic - /// - /// Gets and sets usage of mnemonics. - /// - public bool UseMnemonic - { - get => _drawContent.UseMnemonic; - set => _drawContent.UseMnemonic = value; - } - #endregion - - #region Checked - /// - /// Gets and sets the checked state. - /// - public bool Checked { get; set; } - - #endregion - - #region AllowUncheck - /// - /// Gets and sets the allow uncheck state. - /// - public bool AllowUncheck { get; set; } - - #endregion - - #region DrawButtonComposition - /// - /// Gets and sets the composition usage of the button. - /// - public bool DrawButtonComposition - { - get => _drawCanvas.DrawCanvasOnComposition; - set => _drawCanvas.DrawCanvasOnComposition = value; - } - #endregion - - #region TestForFocusCues - /// - /// Gets and sets the use of focus cues for deciding if focus rects are allowed. - /// - public bool TestForFocusCues - { - get => _drawContent.TestForFocusCues; - set => _drawContent.TestForFocusCues = value; - } - #endregion - - #region Palettes - /// - /// Update the source palettes for non-checked drawing. - /// - /// Palette source for the disabled state. - /// Palette source for the normal state. - /// Palette source for the tracking state. - /// Palette source for the pressed state. - public void SetPalettes(IPaletteTriple paletteDisabled, - IPaletteTriple paletteNormal, - IPaletteTriple paletteTracking, - IPaletteTriple palettePressed) - { - Debug.Assert(paletteDisabled != null); - Debug.Assert(paletteNormal != null); - Debug.Assert(paletteTracking != null); - Debug.Assert(palettePressed != null); - - // Remember the new palette settings - _paletteDisabled = paletteDisabled; - _paletteNormal = paletteNormal; - _paletteTracking = paletteTracking; - _palettePressed = palettePressed; - - // Must force update of palettes to use latest ones provided - _forcePaletteUpdate = true; - } - - /// - /// Update the source palettes for checked state drawing. - /// - /// Palette source for the normal checked state. - /// Palette source for the tracking checked state. - /// Palette source for the pressed checked state. - public void SetCheckedPalettes(IPaletteTriple paletteCheckedNormal, - IPaletteTriple paletteCheckedTracking, - IPaletteTriple paletteCheckedPressed) - { - Debug.Assert(paletteCheckedNormal != null); - Debug.Assert(paletteCheckedTracking != null); - Debug.Assert(paletteCheckedPressed != null); - - // Remember the new palette settings - _paletteCheckedNormal = paletteCheckedNormal; - _paletteCheckedTracking = paletteCheckedTracking; - _paletteCheckedPressed = paletteCheckedPressed; - - // Must force update of palettes to use latest ones provided - _forcePaletteUpdate = true; - } - #endregion - - #region Eval - /// - /// Evaluate the need for drawing transparent areas. - /// - /// Evaluation context. - /// True if transparent areas exist; otherwise false. - public override bool EvalTransparentPaint(ViewContext context) - { - Debug.Assert(context != null); - - // Ensure that child elements have correct palette state - CheckPaletteState(context); - - // Ask the renderer to evaluate the given palette - return _drawCanvas.EvalTransparentPaint(context); - } - #endregion - - #region Layout - /// - /// Discover the preferred size of the element. - /// - /// Layout context. - public override Size GetPreferredSize(ViewLayoutContext context) - { - Debug.Assert(context != null); - Debug.Assert(_drawCanvas != null); - - // Ensure that child elements have correct palette state - CheckPaletteState(context); - - // Delegate work to the child canvas - return _drawCanvas.GetPreferredSize(context); - } - - /// - /// Perform a layout of the elements. - /// - /// Layout context. - /// - public override void Layout(ViewLayoutContext context) - { - Debug.Assert(context != null); - - // Validate incoming reference - if (context == null) - { - throw new ArgumentNullException(nameof(context)); - } - - // We take on all the available display area - ClientRectangle = context.DisplayRectangle; - - // Ensure that child elements have correct palette state - CheckPaletteState(context); - - // Let base class perform usual processing - base.Layout(context); - - - } - #endregion - - #region Paint - /// - /// Perform a render of the elements. - /// - /// Rendering context. - public override void Render(RenderContext context) - { - Debug.Assert(context != null); - - // Ensure that child elements have correct palette state - CheckPaletteState(context); - - // Let base class perform standard rendering - base.Render(context); - } - #endregion - - #region Protected - /// - /// Check that the palette and state are correct. - /// - /// Reference to the view context. - protected virtual void CheckPaletteState(ViewContext context) - { - // Default to using this element calculated state - PaletteState buttonState = State; - - // If the actual control is not enabled, force to disabled state - if (!IsFixed && !context.Control.Enabled) - { - buttonState = PaletteState.Disabled; - } - - // Apply the checked state if not fixed - if (!IsFixed && Checked) - { - // Is the checked button allowed to become unchecked - if (AllowUncheck) - { - // Show feedback on tracking and pressed - switch (buttonState) - { - case PaletteState.Normal: - buttonState = PaletteState.CheckedNormal; - break; - case PaletteState.Tracking: - buttonState = PaletteState.CheckedTracking; - break; - case PaletteState.Pressed: - buttonState = PaletteState.CheckedPressed; - break; - } - } - else - { - // Always use the normal state as user cannot uncheck the button - buttonState = PaletteState.CheckedNormal; - } - } - - // If the child elements are not in correct state - if (_forcePaletteUpdate || (_drawCanvas.ElementState != buttonState)) - { - // No longer need to force the palettes to be updated - _forcePaletteUpdate = false; - - // Switch the child elements over to correct state - _drawCanvas.ElementState = buttonState; - _drawContent.ElementState = buttonState; - _drawImageContent.ElementState = buttonState; - - // Push the correct palettes into them - switch (buttonState) - { - case PaletteState.Disabled: - CurrentPalette = _paletteDisabled; - break; - case PaletteState.Normal: - CurrentPalette = _paletteNormal; - break; - case PaletteState.CheckedNormal: - CurrentPalette = _paletteCheckedNormal; - break; - case PaletteState.Pressed: - CurrentPalette = _palettePressed; - break; - case PaletteState.CheckedPressed: - CurrentPalette = _paletteCheckedPressed; - break; - case PaletteState.Tracking: - CurrentPalette = _paletteTracking; - break; - case PaletteState.CheckedTracking: - CurrentPalette = _paletteCheckedTracking; - break; - default: - // Should never happen! - Debug.Assert(false); - break; - } - - // Update with the correct palettes - _drawCanvas.SetPalettes(CurrentPalette.PaletteBack, CurrentPalette.PaletteBorder); - - _drawContent.SetPalette(CurrentPalette.PaletteContent); - //_drawImageContent.SetPalette(CurrentPalette.PaletteContent); - } - } - #endregion - - } + }; + + // Place the canvas inside ourself + Add(_drawCanvas); + } + + /// + /// 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 $"ViewDrawButton:{Id}"; + } + #endregion + + #region LayoutDocker + /// + /// Gets access to the contained layout docker. + /// + public ViewLayoutDocker LayoutDocker { get; } + + #endregion + + #region CurrentPalette + /// + /// Gets access to the currently selected palette. + /// + public IPaletteTriple CurrentPalette { get; private set; } + + #endregion + + #region ButtonValues + /// + /// Gets and sets the source for button values. + /// + public IContentValues ButtonValues + { + get => _drawContent.Values; + set => _drawContent.Values = value; + } + #endregion + + #region DrawTabBorder + /// + /// Gets and sets if the border should be drawn as a tab border. + /// + public bool DrawTabBorder + { + get => _drawCanvas.DrawTabBorder; + set => _drawCanvas.DrawTabBorder = value; + } + #endregion + + #region TabBorderStyle + /// + /// Gets and sets the tab border style of the button. + /// + public TabBorderStyle TabBorderStyle + { + get => _drawCanvas.TabBorderStyle; + set => _drawCanvas.TabBorderStyle = value; + } + #endregion + + #region Enabled + /// + /// Gets and sets the enabled state of the element. + /// + public override bool Enabled + { + get => base.Enabled; + + set + { + base.Enabled = value; + + if (Enabled && ElementState == PaletteState.Disabled) + { + ElementState = Checked ? PaletteState.CheckedNormal : PaletteState.Normal; + } + + // Pass on the new state to the child elements + _drawCanvas.Enabled = value; + _drawContent.Enabled = value; + _drawImageContent.Enabled = value; + } + } + #endregion + + #region Orientation + /// + /// Gets and sets the visual orientation. + /// + public virtual VisualOrientation Orientation + { + get => _drawCanvas.Orientation; + set => SetOrientation(value, value); + } + + /// + /// Set the orientation of the two button components. + /// + /// Orientation of the button border and background.. + /// Orientation of the button contents. + public void SetOrientation(VisualOrientation borderBackOrient, + VisualOrientation contentOrient) + { + _drawCanvas.Orientation = borderBackOrient; + _drawContent.Orientation = contentOrient; + } + #endregion + + #region UseMnemonic + /// + /// Gets and sets usage of mnemonics. + /// + public bool UseMnemonic + { + get => _drawContent.UseMnemonic; + set => _drawContent.UseMnemonic = value; + } + #endregion + + #region Checked + /// + /// Gets and sets the checked state. + /// + public bool Checked { get; set; } + + #endregion + + #region AllowUncheck + /// + /// Gets and sets the allow uncheck state. + /// + public bool AllowUncheck { get; set; } + + #endregion + + #region DrawButtonComposition + /// + /// Gets and sets the composition usage of the button. + /// + public bool DrawButtonComposition + { + get => _drawCanvas.DrawCanvasOnComposition; + set => _drawCanvas.DrawCanvasOnComposition = value; + } + #endregion + + #region TestForFocusCues + /// + /// Gets and sets the use of focus cues for deciding if focus rects are allowed. + /// + public bool TestForFocusCues + { + get => _drawContent.TestForFocusCues; + set => _drawContent.TestForFocusCues = value; + } + #endregion + + #region Palettes + /// + /// Update the source palettes for non-checked drawing. + /// + /// Palette source for the disabled state. + /// Palette source for the normal state. + /// Palette source for the tracking state. + /// Palette source for the pressed state. + public void SetPalettes(IPaletteTriple paletteDisabled, + IPaletteTriple paletteNormal, + IPaletteTriple paletteTracking, + IPaletteTriple palettePressed) + { + System.Diagnostics.Debug.Assert(paletteDisabled != null); + System.Diagnostics.Debug.Assert(paletteNormal != null); + System.Diagnostics.Debug.Assert(paletteTracking != null); + System.Diagnostics.Debug.Assert(palettePressed != null); + + // Remember the new palette settings + _paletteDisabled = paletteDisabled!; + _paletteNormal = paletteNormal!; + _paletteTracking = paletteTracking!; + _palettePressed = palettePressed!; + + // Must force update of palettes to use latest ones provided + _forcePaletteUpdate = true; + } + + /// + /// Update the source palettes for checked state drawing. + /// + /// Palette source for the normal checked state. + /// Palette source for the tracking checked state. + /// Palette source for the pressed checked state. + public void SetCheckedPalettes(IPaletteTriple paletteCheckedNormal, + IPaletteTriple paletteCheckedTracking, + IPaletteTriple paletteCheckedPressed) + { + System.Diagnostics.Debug.Assert(paletteCheckedNormal != null); + System.Diagnostics.Debug.Assert(paletteCheckedTracking != null); + System.Diagnostics.Debug.Assert(paletteCheckedPressed != null); + + // Remember the new palette settings + _paletteCheckedNormal = paletteCheckedNormal; + _paletteCheckedTracking = paletteCheckedTracking; + _paletteCheckedPressed = paletteCheckedPressed; + + // Must force update of palettes to use latest ones provided + _forcePaletteUpdate = true; + } + #endregion + + #region Eval + /// + /// Evaluate the need for drawing transparent areas. + /// + /// Evaluation context. + /// True if transparent areas exist; otherwise false. + public override bool EvalTransparentPaint(ViewContext context) + { + System.Diagnostics.Debug.Assert(context != null); + + // Ensure that child elements have correct palette state + CheckPaletteState(context); + + // Ask the renderer to evaluate the given palette + return _drawCanvas.EvalTransparentPaint(context); + } + #endregion + + #region Layout + /// + /// Discover the preferred size of the element. + /// + /// Layout context. + public override Size GetPreferredSize(ViewLayoutContext context) + { + System.Diagnostics.Debug.Assert(context != null); + System.Diagnostics.Debug.Assert(_drawCanvas != null); + + // Ensure that child elements have correct palette state + CheckPaletteState(context); + + // Delegate work to the child canvas + return _drawCanvas.GetPreferredSize(context); + } + + /// + /// Perform a layout of the elements. + /// + /// Layout context. + /// + public override void Layout(ViewLayoutContext context) + { + System.Diagnostics.Debug.Assert(context != null); + + // Validate incoming reference + if (context == null) + { + throw new ArgumentNullException(nameof(context)); + } + + // We take on all the available display area + ClientRectangle = context.DisplayRectangle; + + // Ensure that child elements have correct palette state + CheckPaletteState(context); + + // Let base class perform usual processing + base.Layout(context); + + + } + #endregion + + #region Paint + /// + /// Perform a render of the elements. + /// + /// Rendering context. + public override void Render(RenderContext context) + { + System.Diagnostics.Debug.Assert(context != null); + + // Ensure that child elements have correct palette state + CheckPaletteState(context); + + // Let base class perform standard rendering + base.Render(context); + } + #endregion + + #region Protected + /// + /// Check that the palette and state are correct. + /// + /// Reference to the view context. + protected virtual void CheckPaletteState(ViewContext context) + { + // Default to using this element calculated state + PaletteState buttonState = State; + + // If the actual control is not enabled, force to disabled state + if (!IsFixed && !context.Control.Enabled) + { + buttonState = PaletteState.Disabled; + } + + // Apply the checked state if not fixed + if (!IsFixed && Checked) + { + // Is the checked button allowed to become unchecked + if (AllowUncheck) + { + // Show feedback on tracking and pressed + switch (buttonState) + { + case PaletteState.Normal: + buttonState = PaletteState.CheckedNormal; + break; + case PaletteState.Tracking: + buttonState = PaletteState.CheckedTracking; + break; + case PaletteState.Pressed: + buttonState = PaletteState.CheckedPressed; + break; + } + } + else + { + // Always use the normal state as user cannot uncheck the button + buttonState = PaletteState.CheckedNormal; + } + } + + // If the child elements are not in correct state + if (_forcePaletteUpdate || _drawCanvas.ElementState != buttonState) + { + // No longer need to force the palettes to be updated + _forcePaletteUpdate = false; + + // Switch the child elements over to correct state + _drawCanvas.ElementState = buttonState; + _drawContent.ElementState = buttonState; + _drawImageContent.ElementState = buttonState; + + // Push the correct palettes into them + switch (buttonState) + { + case PaletteState.Disabled: + CurrentPalette = _paletteDisabled; + break; + case PaletteState.Normal: + CurrentPalette = _paletteNormal; + break; + case PaletteState.CheckedNormal: + CurrentPalette = _paletteCheckedNormal; + break; + case PaletteState.Pressed: + CurrentPalette = _palettePressed; + break; + case PaletteState.CheckedPressed: + CurrentPalette = _paletteCheckedPressed; + break; + case PaletteState.Tracking: + CurrentPalette = _paletteTracking; + break; + case PaletteState.CheckedTracking: + CurrentPalette = _paletteCheckedTracking; + break; + default: + // Should never happen! + System.Diagnostics.Debug.Assert(false); + break; + } + + // Update with the correct palettes + _drawCanvas.SetPalettes(CurrentPalette.PaletteBack, CurrentPalette.PaletteBorder); + + _drawContent.SetPalette(CurrentPalette.PaletteContent); + //_drawImageContent.SetPalette(CurrentPalette.PaletteContent); + } + } + #endregion + + } } \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Command Links/KryptonCommandLinkVersion1.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Command Links/KryptonCommandLinkVersion1.cs index 32ce6c8b1..a4efeb531 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Command Links/KryptonCommandLinkVersion1.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Command Links/KryptonCommandLinkVersion1.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,7 +25,6 @@ */ #endregion -#pragma warning disable CS0618 namespace Krypton.Toolkit.Suite.Extended.Buttons { /// @@ -37,7 +36,8 @@ namespace Krypton.Toolkit.Suite.Extended.Buttons [ToolboxItem(true), ToolboxBitmap(typeof(KryptonButton), "ToolboxBitmaps.CommandLinkButton.bmp"), DefaultEvent("Click"), DefaultProperty("Heading"), Designer(typeof(KryptonCommandLinkButtonDesigner)), DesignerCategory("code"), ClassInterface(ClassInterfaceType.AutoDispatch), DisplayName("Krypton Command Link"), - Description("A Krypton Command Link Button."), ComVisible(true)] + Description("A Krypton Command Link Button."), ComVisible(true), + Obsolete(@"Use versions that are supported in the Standard Toolkit.")] public class KryptonCommandLinkButton : VisualSimpleBase, IButtonControl { #region Instance Fields @@ -268,7 +268,7 @@ public ButtonStyle ButtonStyle private bool ShouldSerializeButtonStyle() { - return (ButtonStyle != ButtonStyle.Command); + return ButtonStyle != ButtonStyle.Command; } private void ResetButtonStyle() @@ -442,7 +442,7 @@ public virtual IKryptonCommand KryptonCommand /// true if the control should behave as a default button; otherwise false. public void NotifyDefault(bool value) { - if (!ViewDrawButton.IsFixed && (_isDefault != value)) + if (!ViewDrawButton.IsFixed && _isDefault != value) { // Remember new default status _isDefault = value; @@ -669,7 +669,7 @@ protected override void OnClick(EventArgs e) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Command Links/KryptonCommandLinkVersion2.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Command Links/KryptonCommandLinkVersion2.cs index 98fbc3cc5..f2a9ae158 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Command Links/KryptonCommandLinkVersion2.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Command Links/KryptonCommandLinkVersion2.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -174,7 +174,7 @@ protected override void OnClick(EventArgs e) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Dialog Buttons/KryptonCancelDialogButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Dialog Buttons/KryptonCancelDialogButton.cs index 6bb40154d..348bb89d2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Dialog Buttons/KryptonCancelDialogButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Dialog Buttons/KryptonCancelDialogButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -55,13 +55,13 @@ private void KryptonCancelDialogButton_TextChanged(object sender, EventArgs e) { if (Text == Name) { - Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel; + Text = KryptonManager.Strings.GeneralStrings.Cancel; } } private void KryptonCancelDialogButton_ParentChanged(object sender, EventArgs e) { - Control parent = Parent; + Control? parent = Parent; while (!(Parent is KryptonForm) && parent != null) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Dialog Buttons/KryptonNODialogButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Dialog Buttons/KryptonNODialogButton.cs index 6dead5dbc..d8dd14207 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Dialog Buttons/KryptonNODialogButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Dialog Buttons/KryptonNODialogButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -53,7 +53,7 @@ public KryptonNODialogButton() private void KryptonNODialogButton_ParentChanged(object sender, EventArgs e) { - Control parent = Parent; + Control? parent = Parent; while (!(Parent is KryptonForm) && parent != null) { @@ -72,7 +72,7 @@ private void KryptonNODialogButton_TextChanged(object sender, EventArgs e) { if (Text == Name) { - Text = KryptonLanguageManager.GeneralToolkitStrings.No; + Text = KryptonManager.Strings.GeneralStrings.No; } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Dialog Buttons/KryptonOKDialogButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Dialog Buttons/KryptonOKDialogButton.cs index 156bd5e1f..a9d44fff0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Dialog Buttons/KryptonOKDialogButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Dialog Buttons/KryptonOKDialogButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -55,13 +55,13 @@ private void KryptonOKDialogButton_TextChanged(object sender, EventArgs e) { if (Text == Name) { - Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + Text = KryptonManager.Strings.GeneralStrings.OK; } } private void KryptonOKDialogButton_ParentChanged(object sender, EventArgs e) { - Control parent = Parent; + Control? parent = Parent; while (!(Parent is KryptonForm) && parent != null) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Dialog Buttons/KryptonYesDialogButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Dialog Buttons/KryptonYesDialogButton.cs index e3ecf33fe..12c31cbf3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Dialog Buttons/KryptonYesDialogButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Dialog Buttons/KryptonYesDialogButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -55,13 +55,13 @@ private void KryptonYesDialogButton_TextChanged(object sender, EventArgs e) { if (Text == Name) { - Text = KryptonLanguageManager.GeneralToolkitStrings.Yes; + Text = KryptonManager.Strings.GeneralStrings.Yes; } } private void KryptonYesDialogButton_ParentChanged(object sender, EventArgs e) { - Control parent = Parent; + Control? parent = Parent; while (!(Parent is KryptonForm) && parent != null) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/General/KryptonBrowseButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/General/KryptonBrowseButton.cs index c11b5c9b5..1f3b11a20 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/General/KryptonBrowseButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/General/KryptonBrowseButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/General/KryptonDialogButtonExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/General/KryptonDialogButtonExtended.cs index 68b424d5d..3ce895853 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/General/KryptonDialogButtonExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/General/KryptonDialogButtonExtended.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -149,81 +149,81 @@ private void ChangeText(KryptonButtonBuiltInDisplayString displayString, string switch (displayString) { case KryptonButtonBuiltInDisplayString.Abort: - Text = KryptonLanguageManager.GeneralToolkitStrings.Abort; + Text = KryptonManager.Strings.GeneralStrings.Abort; DialogResult = DialogResult.Abort; SetDenyButton(true); break; case KryptonButtonBuiltInDisplayString.Apply: - Text = KryptonLanguageManager.CustomToolkitStrings.Apply; + Text = KryptonManager.Strings.CustomStrings.Apply; SetAcceptButton(true); break; case KryptonButtonBuiltInDisplayString.Cancel: - Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel; + Text = KryptonManager.Strings.GeneralStrings.Cancel; DialogResult = DialogResult.Cancel; SetDenyButton(false); break; case KryptonButtonBuiltInDisplayString.Collapse: - Text = KryptonLanguageManager.CustomToolkitStrings.Collapse; + Text = KryptonManager.Strings.CustomStrings.Collapse; break; case KryptonButtonBuiltInDisplayString.Continue: - Text = KryptonLanguageManager.GeneralToolkitStrings.Continue; + Text = KryptonManager.Strings.GeneralStrings.Continue; SetAcceptButton(true); break; case KryptonButtonBuiltInDisplayString.Close: - Text = KryptonLanguageManager.GeneralToolkitStrings.Close; + Text = KryptonManager.Strings.GeneralStrings.Close; DialogResult = DialogResult.Cancel; SetDenyButton(true); break; case KryptonButtonBuiltInDisplayString.Yes: - Text = KryptonLanguageManager.GeneralToolkitStrings.Yes; + Text = KryptonManager.Strings.GeneralStrings.Yes; DialogResult = DialogResult.Yes; SetAcceptButton(true); break; case KryptonButtonBuiltInDisplayString.No: - Text = KryptonLanguageManager.GeneralToolkitStrings.No; + Text = KryptonManager.Strings.GeneralStrings.No; DialogResult = DialogResult.No; SetDenyButton(true); break; case KryptonButtonBuiltInDisplayString.Ok: - Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + Text = KryptonManager.Strings.GeneralStrings.OK; DialogResult = DialogResult.OK; SetAcceptButton(true); break; case KryptonButtonBuiltInDisplayString.Retry: - Text = KryptonLanguageManager.GeneralToolkitStrings.Retry; + Text = KryptonManager.Strings.GeneralStrings.Retry; DialogResult = DialogResult.Retry; break; case KryptonButtonBuiltInDisplayString.Ignore: - Text = KryptonLanguageManager.GeneralToolkitStrings.Ignore; + Text = KryptonManager.Strings.GeneralStrings.Ignore; DialogResult = DialogResult.Ignore; break; case KryptonButtonBuiltInDisplayString.Help: - Text = KryptonLanguageManager.GeneralToolkitStrings.Help; + Text = KryptonManager.Strings.GeneralStrings.Help; break; case KryptonButtonBuiltInDisplayString.TryAgain: - Text = KryptonLanguageManager.GeneralToolkitStrings.TryAgain; + Text = KryptonManager.Strings.GeneralStrings.TryAgain; break; case KryptonButtonBuiltInDisplayString.Expand: - Text = KryptonLanguageManager.CustomToolkitStrings.Expand; + Text = KryptonManager.Strings.CustomStrings.Expand; break; case KryptonButtonBuiltInDisplayString.Today: - Text = KryptonLanguageManager.GeneralToolkitStrings.Today; + Text = KryptonManager.Strings.GeneralStrings.Today; break; } @@ -242,63 +242,63 @@ private void ChangeButtonText(string buttonText) /// private KryptonButtonBuiltInDisplayString ReturnDisplayString(string buttonText) { - if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.Abort) + if (buttonText == KryptonManager.Strings.GeneralStrings.Abort) { return KryptonButtonBuiltInDisplayString.Abort; } - else if (buttonText == KryptonLanguageManager.CustomToolkitStrings.Apply) + else if (buttonText == KryptonManager.Strings.CustomStrings.Apply) { return KryptonButtonBuiltInDisplayString.Apply; } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.Cancel) + else if (buttonText == KryptonManager.Strings.GeneralStrings.Cancel) { return KryptonButtonBuiltInDisplayString.Cancel; } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.Close) + else if (buttonText == KryptonManager.Strings.GeneralStrings.Close) { return KryptonButtonBuiltInDisplayString.Close; } - else if (buttonText == KryptonLanguageManager.CustomToolkitStrings.Collapse) + else if (buttonText == KryptonManager.Strings.CustomStrings.Collapse) { return KryptonButtonBuiltInDisplayString.Collapse; } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.Continue) + else if (buttonText == KryptonManager.Strings.GeneralStrings.Continue) { return KryptonButtonBuiltInDisplayString.Continue; } - else if (buttonText == KryptonLanguageManager.CustomToolkitStrings.Expand) + else if (buttonText == KryptonManager.Strings.CustomStrings.Expand) { return KryptonButtonBuiltInDisplayString.Expand; } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.Help) + else if (buttonText == KryptonManager.Strings.GeneralStrings.Help) { return KryptonButtonBuiltInDisplayString.Help; } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.Ignore) + else if (buttonText == KryptonManager.Strings.GeneralStrings.Ignore) { return KryptonButtonBuiltInDisplayString.Ignore; } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.No) + else if (buttonText == KryptonManager.Strings.GeneralStrings.No) { return KryptonButtonBuiltInDisplayString.No; } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.OK) + else if (buttonText == KryptonManager.Strings.GeneralStrings.OK) { return KryptonButtonBuiltInDisplayString.Ok; } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.Retry) + else if (buttonText == KryptonManager.Strings.GeneralStrings.Retry) { return KryptonButtonBuiltInDisplayString.Retry; } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.Today) + else if (buttonText == KryptonManager.Strings.GeneralStrings.Today) { return KryptonButtonBuiltInDisplayString.Today; } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.TryAgain) + else if (buttonText == KryptonManager.Strings.GeneralStrings.TryAgain) { return KryptonButtonBuiltInDisplayString.TryAgain; } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.Yes) + else if (buttonText == KryptonManager.Strings.GeneralStrings.Yes) { return KryptonButtonBuiltInDisplayString.Yes; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/General/KryptonViewButtons.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/General/KryptonViewButtons.cs index 9f61e39c7..b4405e215 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/General/KryptonViewButtons.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/General/KryptonViewButtons.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -42,7 +42,7 @@ public partial class KryptonViewButtons : UserControl /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { - if (disposing && (components != null)) + if (disposing && components != null) { components.Dispose(); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Internal/InternalKryptonButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Internal/InternalKryptonButton.cs index 705a48912..db6758820 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Internal/InternalKryptonButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Internal/InternalKryptonButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -124,24 +124,10 @@ public InternalKryptonButton() _useAsDialogButton = false; _useAsUACElevationButton = false; - - // Set `CornerRoundingRadius' to 'GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE' (-1) - 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(-1)] - public float CornerRoundingRadius - { - get => StateCommon.Border.Rounding; - - set => StateCommon.Border.Rounding = value; - } /// /// Gets and sets the automatic resize of the control to fit contents. @@ -397,7 +383,7 @@ public virtual IKryptonCommand KryptonCommand /// true if the control should behave as a default button; otherwise false. public void NotifyDefault(bool value) { - if (!ViewDrawButton.IsFixed && (_isDefault != value)) + if (!ViewDrawButton.IsFixed && _isDefault != value) { // Remember new default status _isDefault = value; @@ -637,43 +623,43 @@ 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 (DialogResult == DialogResult.Abort) { - Text = KryptonLanguageManager.GeneralToolkitStrings.Abort; + Text = KryptonManager.Strings.GeneralStrings.Abort; } if (DialogResult == DialogResult.Cancel) { - Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel; + Text = KryptonManager.Strings.GeneralStrings.Cancel; } if (DialogResult == DialogResult.OK) { - Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + Text = KryptonManager.Strings.GeneralStrings.OK; } if (DialogResult == DialogResult.Yes) { - Text = KryptonLanguageManager.GeneralToolkitStrings.Yes; + Text = KryptonManager.Strings.GeneralStrings.Yes; } if (DialogResult == DialogResult.No) { - Text = KryptonLanguageManager.GeneralToolkitStrings.No; + Text = KryptonManager.Strings.GeneralStrings.No; } if (DialogResult == DialogResult.Retry) { - Text = KryptonLanguageManager.GeneralToolkitStrings.Retry; + Text = KryptonManager.Strings.GeneralStrings.Retry; } if (DialogResult == DialogResult.Ignore) { - Text = KryptonLanguageManager.GeneralToolkitStrings.Ignore; + Text = KryptonManager.Strings.GeneralStrings.Ignore; } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Split Button/KryptonSplitButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Split Button/KryptonSplitButton.cs index 2401037f1..56af3a37d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Split Button/KryptonSplitButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Split Button/KryptonSplitButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -208,7 +208,7 @@ protected override void OnPaint(PaintEventArgs e) int internalBorder = BORDER_SIZE; - Rectangle focusRectangle = new(internalBorder, internalBorder, bounds.Width - _dropDownRectangle.Width - internalBorder, bounds.Height - (internalBorder * 2)); + Rectangle focusRectangle = new(internalBorder, internalBorder, bounds.Width - _dropDownRectangle.Width - internalBorder, bounds.Height - internalBorder * 2); PaletteBase palette = KryptonManager.CurrentGlobalPalette; @@ -261,7 +261,7 @@ private static void PaintArrow(Graphics graphics, Rectangle rectangle) { Point midPoint = new(Convert.ToInt32(rectangle.Left + rectangle.Width / 2), Convert.ToInt32(rectangle.Top + rectangle.Height / 2)); - midPoint.X += (rectangle.Width % 2); + midPoint.X += rectangle.Width % 2; Point[] arrow = new Point[] { new(midPoint.X - 2, midPoint.Y - 1), new(midPoint.X + 3, midPoint.Y - 1), new(midPoint.X, midPoint.Y + 2) }; @@ -305,7 +305,7 @@ private void KryptonContextMenu_Closed(object sender, ToolStripDropDownClosedEve //if (e.CloseReason == ToolStripDropDownCloseReason.AppClicked) //{ - _skipNextOpen = (_dropDownRectangle.Contains(PointToClient(Cursor.Position))); + _skipNextOpen = _dropDownRectangle.Contains(PointToClient(Cursor.Position)); //} } @@ -319,7 +319,7 @@ private void ContextMenuStrip_Closing(object sender, ToolStripDropDownClosingEve if (e.CloseReason == ToolStripDropDownCloseReason.AppClicked) { - _skipNextOpen = (_dropDownRectangle.Contains(PointToClient(Cursor.Position))); + _skipNextOpen = _dropDownRectangle.Contains(PointToClient(Cursor.Position)); } } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/UAC Buttons/KryptonUACButtonVersion1.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/UAC Buttons/KryptonUACButtonVersion1.cs index 23254038e..785174a89 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/UAC Buttons/KryptonUACButtonVersion1.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/UAC Buttons/KryptonUACButtonVersion1.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/UAC Buttons/KryptonUACButtonVersion2.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/UAC Buttons/KryptonUACButtonVersion2.cs index 754ec00fe..c1cb435e3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/UAC Buttons/KryptonUACButtonVersion2.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/UAC Buttons/KryptonUACButtonVersion2.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/Command Links/KryptonCommandLinkButtonActionList.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/Command Links/KryptonCommandLinkButtonActionList.cs index 973a3ce5c..7535d8688 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/Command Links/KryptonCommandLinkButtonActionList.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/Command Links/KryptonCommandLinkButtonActionList.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/Command Links/KryptonCommandLinkButtonDesigner.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/Command Links/KryptonCommandLinkButtonDesigner.cs index 10b817e7c..ef184efa5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/Command Links/KryptonCommandLinkButtonDesigner.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/Command Links/KryptonCommandLinkButtonDesigner.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/General/KryptonDialogButtonExtendedActionList.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/General/KryptonDialogButtonExtendedActionList.cs index df17a9f6c..a64f13066 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/General/KryptonDialogButtonExtendedActionList.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/General/KryptonDialogButtonExtendedActionList.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -201,7 +201,7 @@ public Font StateCommonShortTextFont /// Gets or sets the font. /// The font. - public Font StateCommonLongTextFont + public Font? StateCommonLongTextFont { get => _button.StateCommon.Content.LongText.Font; @@ -218,7 +218,7 @@ public Font StateCommonLongTextFont /// Gets or sets the corner radius. /// The corner radius. - [DefaultValue(GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE)] + [DefaultValue(-1)] public float StateCommonCornerRoundingRadius { get => _button.StateCommon.Border.Rounding; @@ -239,15 +239,15 @@ public float StateCommonCornerRoundingRadius [DefaultValue(false)] public bool UseAsUACElevatedButton { - get => _button.UseAsUACElevationButton; + get => _button.Values.UseAsUACElevationButton; set { - if (_button.UseAsUACElevationButton != value) + if (_button.Values.UseAsUACElevationButton != value) { - _service.OnComponentChanged(_button, null, _button.UseAsUACElevationButton, value); + _service.OnComponentChanged(_button, null, _button.Values.UseAsUACElevationButton, value); - _button.UseAsUACElevationButton = value; + _button.Values.UseAsUACElevationButton = value; } } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/General/KryptonDialogButtonExtendedDesigner.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/General/KryptonDialogButtonExtendedDesigner.cs index 9ba0c7f54..f86fe51d1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/General/KryptonDialogButtonExtendedDesigner.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/General/KryptonDialogButtonExtendedDesigner.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/UAC Elevation/KryptonUACButtonActionList.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/UAC Elevation/KryptonUACButtonActionList.cs index e9d8a49fd..3ebaaffc8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/UAC Elevation/KryptonUACButtonActionList.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/UAC Elevation/KryptonUACButtonActionList.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/UAC Elevation/KryptonUACButtonDesigner.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/UAC Elevation/KryptonUACButtonDesigner.cs index 407b35d94..a5780ed8b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/UAC Elevation/KryptonUACButtonDesigner.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Designers/UAC Elevation/KryptonUACButtonDesigner.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Enumerations/BrowseButtonAction.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Enumerations/BrowseButtonAction.cs index c8ba83d1b..55491f4cd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Enumerations/BrowseButtonAction.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Enumerations/BrowseButtonAction.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Enumerations/KryptonButtonBuiltInDisplayString.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Enumerations/KryptonButtonBuiltInDisplayString.cs index 691b6829b..b83a65ba2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Enumerations/KryptonButtonBuiltInDisplayString.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Enumerations/KryptonButtonBuiltInDisplayString.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Enumerations/UACShieldSize.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Enumerations/UACShieldSize.cs index 85a769765..278f206e4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Enumerations/UACShieldSize.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Enumerations/UACShieldSize.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Events/General/OwnerWindowChangedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Events/General/OwnerWindowChangedEventArgs.cs index 50d804c77..ec9415d1f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Events/General/OwnerWindowChangedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Events/General/OwnerWindowChangedEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Events/UAC Elevation/ExecuteProcessAsAdministratorEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Events/UAC Elevation/ExecuteProcessAsAdministratorEventArgs.cs index 1b8f3be5b..7d03b7288 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Events/UAC Elevation/ExecuteProcessAsAdministratorEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Events/UAC Elevation/ExecuteProcessAsAdministratorEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -104,7 +104,7 @@ private void ElevateProcessWithAdministrativeRights(object objectToElevate, stri } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } @@ -138,7 +138,7 @@ public void ElevateProcessWithAdministrativeRights(string processName, string ar } catch (Win32Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } return; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Globals/GlobalDeclarations.cs index 2960c902a..9a46f3eff 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -42,7 +42,7 @@ global using System.Windows.Forms.VisualStyles; global using Krypton.Toolkit.Suite.Extended.Core; -global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; +global using Krypton.Toolkit.Suite.Extended.Debug.Tools; global using Krypton.Toolkit.Suite.Extended.Shared; global using Microsoft.Win32; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Krypton - Backup.Toolkit.Suite.Extended.Buttons 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Krypton - Backup.Toolkit.Suite.Extended.Buttons 2022.csproj new file mode 100644 index 000000000..549b54daf --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Krypton - Backup.Toolkit.Suite.Extended.Buttons 2022.csproj @@ -0,0 +1,189 @@ + + + + + + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows + + + + + + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows + + + + + + library + Krypton.Toolkit.Suite.Extended.Buttons + Krypton.Toolkit.Suite.Extended.Buttons + + false + true + en + Debug;Release;Nightly;Canary + preview + enable + 6 + true + + + + + + + Krypton.Toolkit.Suite.Extended.Buttons.Canary + + + + + + Krypton.Toolkit.Suite.Extended.Buttons.Nightly + + + + + + Krypton.Toolkit.Suite.Extended.Buttons + + + + + Krypton.Toolkit.Suite.Extended.Buttons + + + + + + + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package holds extensions to the KryptonButton controls. + + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. + Also, all libraries are included targeting each specific framework version for performance purposes. + + To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + 4.0.0.0 + True + + + True + 5.0.0.0 + True + + + True + 6.0.0.0 + True + + + + + + + ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.Buttons\Krypton.Toolkit.Suite.Extended.Buttons.xml + ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.Buttons\ + True + True + StrongKrypton.snk + enable + + + + + + + + + + + True + True + Resources.resx + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + + + \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Krypton.Toolkit.Suite.Extended.Buttons 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Krypton.Toolkit.Suite.Extended.Buttons 2022.csproj index 34eab00b9..e01ddb2f8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Krypton.Toolkit.Suite.Extended.Buttons 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Krypton.Toolkit.Suite.Extended.Buttons 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -69,9 +57,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package holds extensions to the KryptonButton controls. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package holds extensions to the KryptonButton controls. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -79,82 +67,44 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + - + - + @@ -187,6 +137,7 @@ + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Krypton.Toolkit.Suite.Extended.Buttons.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Krypton.Toolkit.Suite.Extended.Buttons.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Krypton.Toolkit.Suite.Extended.Buttons.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Krypton.Toolkit.Suite.Extended.Buttons.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarColourTable.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarColourTable.cs index 050dcb79c..a79a87bca 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarColourTable.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarColourTable.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -56,7 +56,7 @@ public static Color FromHex(string hexadecimal) hexadecimal = hexadecimal.Substring(1); } - if (hexadecimal.Length < 3 || hexadecimal.Length > 6) + if (hexadecimal.Length is < 3 or > 6) { throw new Exception("Hexadecimal value not valid!"); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarDay.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarDay.cs index ae81bc5e2..135a3813b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarDay.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarDay.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -298,7 +298,7 @@ internal void UpdateHighlights() { for (int i = 0; i < TimeUnits.Length; i++) { - TimeUnits[i].SetHighlighted(TimeUnits[i].CheckHighlighted()); + TimeUnits[i]?.SetHighlighted(TimeUnits[i]!.CheckHighlighted()); } } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarDayTop.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarDayTop.cs index d852a90d6..857e49f1f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarDayTop.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarDayTop.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarHighlightRange.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarHighlightRange.cs index 8c2be9cd0..8681eefc6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarHighlightRange.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarHighlightRange.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarItem.cs index 8a96935a3..c132f1001 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarItem.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarItemAlternative.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarItemAlternative.cs index 60e2c95b9..c89a49af9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarItemAlternative.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarItemAlternative.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarItemCollection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarItemCollection.cs index ffed0e1a0..1d47708c0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarItemCollection.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarItemCollection.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarKryptonRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarKryptonRenderer.cs index 4584f3595..cd2ed00ff 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarKryptonRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarKryptonRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarProfessionalRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarProfessionalRenderer.cs index 6cfc83ef7..93e9afd1d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarProfessionalRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarProfessionalRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarRenderer.cs index 4151e9911..969bc5e4b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -40,7 +40,7 @@ public class CalendarRenderer #region Types /// - /// Possible corners to pass to the method + /// Possible corners to pass to the method /// [Flags()] public enum Corners @@ -483,7 +483,7 @@ public GraphicsPath ItemRectangle(CalendarRendererItemBoundsEventArgs evtData, R evtData.Item != null && (evtData.Item.Bounds.Top != evtData.Item.MinuteStartTop || evtData.Item.Bounds.Bottom != evtData.Item.MinuteEndTop) && - (evtData.Item.MinuteEndTop != 0 && evtData.Item.MinuteStartTop != 0) && + evtData.Item.MinuteEndTop != 0 && evtData.Item.MinuteStartTop != 0 && !evtData.Item.IsOnDayTop && evtData.Calendar.DaysMode == CalendarDaysMode.Expanded) { /* @@ -661,7 +661,7 @@ public void PerformLayout(bool performItemsLayout) if (unit != null) { - if (Calendar.TimeUnitsOffset * -1 >= (j + 1)) + if (Calendar.TimeUnitsOffset * -1 >= j + 1) { unit.SetVisible(false); } @@ -1683,7 +1683,7 @@ public virtual void OnDrawItems(CalendarRendererEventArgs e) new CalendarRendererItemEventArgs(e, item), rects[i], i == 0 && !item.IsOpenStart, - (i == rects.Count - 1) && !item.IsOpenEnd); + i == rects.Count - 1 && !item.IsOpenEnd); OnDrawItemShadow(evt); } @@ -1735,7 +1735,7 @@ public virtual void OnDrawItems(CalendarRendererEventArgs e) new CalendarRendererItemEventArgs(e, item), rects[i], i == 0 && !item.IsOpenStart, - (i == rects.Count - 1) && !item.IsOpenEnd); + i == rects.Count - 1 && !item.IsOpenEnd); if (e.Graphics != null) { @@ -1769,7 +1769,7 @@ public virtual void OnDrawItem(CalendarRendererItemEventArgs e) e, rects[i], i == 0 && !e.Item.IsOpenStart, - (i == rects.Count - 1) && !e.Item.IsOpenEnd); + i == rects.Count - 1 && !e.Item.IsOpenEnd); //OnDrawItemShadow(evt); @@ -1922,11 +1922,11 @@ public virtual void OnDrawItemContent(CalendarRendererItemBoundsEventArgs e) { case CalendarItemImageAlign.North: case CalendarItemImageAlign.South: - imageBounds.X = e.Item.Bounds.X + ((e.Item.Bounds.Width - imageBounds.Width) / 2); + imageBounds.X = e.Item.Bounds.X + (e.Item.Bounds.Width - imageBounds.Width) / 2; break; case CalendarItemImageAlign.East: case CalendarItemImageAlign.West: - imageBounds.Y = e.Item.Bounds.Y + ((e.Item.Bounds.Height - imageBounds.Height) / 2); + imageBounds.Y = e.Item.Bounds.Y + (e.Item.Bounds.Height - imageBounds.Height) / 2; break; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarSelectableElement.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarSelectableElement.cs index 81e511b2c..119338f14 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarSelectableElement.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarSelectableElement.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarSystemRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarSystemRenderer.cs index 74104ff94..b93d25aa8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarSystemRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarSystemRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarTimeScaleUnit.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarTimeScaleUnit.cs index 79d4ca90a..52ad17fb3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarTimeScaleUnit.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarTimeScaleUnit.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarTimeSpan.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarTimeSpan.cs index b0cc05860..e38eeeae6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarTimeSpan.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarTimeSpan.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarWeek.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarWeek.cs index 910cba68f..1b2ca1593 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarWeek.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/CalendarWeek.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/ColourTable.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/ColourTable.cs index 1b5168dbb..25a7a7a49 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/ColourTable.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/ColourTable.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -208,17 +208,17 @@ public static Color GetDarkColour(Color c, byte d) byte g = 0; byte b = 0; - if ((c.R > d)) + if (c.R > d) { r = (byte)(c.R - d); } - if ((c.G > d)) + if (c.G > d) { g = (byte)(c.G - d); } - if ((c.B > d)) + if (c.B > d) { b = (byte)(c.B - d); } @@ -232,17 +232,17 @@ public static Color GetLightColour(Color c, byte d) byte g = 255; byte b = 255; - if (((int)c.R + (int)d <= 255)) + if ((int)c.R + (int)d <= 255) { r = (byte)(c.R + d); } - if (((int)c.G + (int)d <= 255)) + if ((int)c.G + (int)d <= 255) { g = (byte)(c.G + d); } - if (((int)c.B + (int)d <= 255)) + if ((int)c.B + (int)d <= 255) { b = (byte)(c.B + d); } @@ -263,7 +263,7 @@ public static Color CheckColourFromNameRGB(string inputColour) { //named color (string)? Color NamedColor = Color.FromName(inputColour); - if ((NamedColor.A == 0 & NamedColor.R == 0 & NamedColor.G == 0 & NamedColor.B == 0)) + if (NamedColor.A == 0 & NamedColor.R == 0 & NamedColor.G == 0 & NamedColor.B == 0) { //is an array? int r = 0; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/MonthViewDay.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/MonthViewDay.cs index 2f72b857a..319e37006 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/MonthViewDay.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/MonthViewDay.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -90,7 +90,7 @@ public MonthView MonthView /// /// Gets a value indicating if the day instance is visible on the calendar /// - public bool Visible => !(Grayed && (Date > MonthView.ViewStart && Date < MonthView.ViewEnd)); + public bool Visible => !(Grayed && Date > MonthView.ViewStart && Date < MonthView.ViewEnd); #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/MonthViewMonth.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/MonthViewMonth.cs index d781e10a5..00cce80a9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/MonthViewMonth.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Classes/MonthViewMonth.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -61,7 +61,7 @@ internal MonthViewMonth(MonthView monthView, DateTime date) _monthview = monthView; _date = date; - int preDays = (new int[] { 0, 1, 2, 3, 4, 5, 6 })[(int)date.DayOfWeek] - (int)MonthView.FirstDayOfWeek; + int preDays = new int[] { 0, 1, 2, 3, 4, 5, 6 }[(int)date.DayOfWeek] - (int)MonthView.FirstDayOfWeek; days = new MonthViewDay?[6 * 7]; DateTime curDate = date.AddDays(-preDays); DayHeaders = new string[7]; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Controls/KryptonCalendar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Controls/KryptonCalendar.cs index 66878c018..2a89b42ac 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Controls/KryptonCalendar.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Controls/KryptonCalendar.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -1087,10 +1087,7 @@ public bool ViewIntersects(CalendarItemAlternative item) protected override bool IsInputKey(Keys keyData) { if ( - keyData == Keys.Down || - keyData == Keys.Up || - keyData == Keys.Right || - keyData == Keys.Left) + keyData is Keys.Down or Keys.Up or Keys.Right or Keys.Left) { return true; } @@ -1339,7 +1336,7 @@ private void TextBox_KeyDown(object sender, KeyEventArgs e) /// private void UpdateDaysAndWeeks() { - TimeSpan span = (new DateTime(ViewEnd.Year, ViewEnd.Month, ViewEnd.Day, 23, 59, 59)).Subtract(ViewStart.Date); + TimeSpan span = new DateTime(ViewEnd.Year, ViewEnd.Month, ViewEnd.Day, 23, 59, 59).Subtract(ViewStart.Date); int preDays = 0; span = span.Add(new TimeSpan(0, 0, 0, 1, 0)); @@ -1351,7 +1348,7 @@ private void UpdateDaysAndWeeks() if (span.Days > MaximumFullDays) { SetDaysMode(CalendarDaysMode.Short); - preDays = (new[] { 0, 1, 2, 3, 4, 5, 6 })[(int)ViewStart.DayOfWeek] - (int)FirstDayOfWeek; + preDays = new[] { 0, 1, 2, 3, 4, 5, 6 }[(int)ViewStart.DayOfWeek] - (int)FirstDayOfWeek; span = span.Add(new TimeSpan(preDays, 0, 0, 0)); while (span.Days % 7 != 0) @@ -1438,7 +1435,7 @@ private void UpdateSelectionElements() bool reached = false; for (int i = unitStart.Day.Index; !reached; i++) { - for (int j = (i == unitStart.Day.Index ? unitStart.Index : 0); i < Days.Length && j < Days[i]!.TimeUnits.Length; j++) + for (int j = i == unitStart.Day.Index ? unitStart.Index : 0; i < Days.Length && j < Days[i]!.TimeUnits.Length; j++) { CalendarTimeScaleUnit? unit = Days[i]!.TimeUnits[j]; if (unit != null) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Controls/KryptonCalendarTextBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Controls/KryptonCalendarTextBox.cs index 51a3a9e92..94e53f6eb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Controls/KryptonCalendarTextBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Controls/KryptonCalendarTextBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Controls/MonthView.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Controls/MonthView.cs index aa5162a2a..d10030592 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Controls/MonthView.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Controls/MonthView.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -561,7 +561,7 @@ private void SetBackwardButtonSelected(bool selected) /// private void SelectWeek(DateTime hit) { - int preDays = (new int[] { 0, 1, 2, 3, 4, 5, 6 })[(int)hit.DayOfWeek] - (int)FirstDayOfWeek; + int preDays = new int[] { 0, 1, 2, 3, 4, 5, 6 }[(int)hit.DayOfWeek] - (int)FirstDayOfWeek; _selectionStart = hit.AddDays(-preDays); SelectionEnd = SelectionStart.AddDays(6); @@ -573,7 +573,7 @@ private void SelectWeek(DateTime hit) /// private void SelectWorkWeek(DateTime hit) { - int preDays = (new int[] { 0, 1, 2, 3, 4, 5, 6 })[(int)hit.DayOfWeek] - (int)WorkWeekStart; + int preDays = new int[] { 0, 1, 2, 3, 4, 5, 6 }[(int)hit.DayOfWeek] - (int)WorkWeekStart; _selectionStart = hit.AddDays(-preDays); SelectionEnd = SelectionStart.AddDays(Math.Abs(WorkWeekStart - WorkWeekEnd)); @@ -658,8 +658,8 @@ private void UpdateMonths() int calendarsX = Convert.ToInt32(Math.Max(Math.Floor((double)ClientSize.Width / (double)(MonthSize.Width + gapping)), 1.0)); int calendarsY = Convert.ToInt32(Math.Max(Math.Floor((double)ClientSize.Height / (double)(MonthSize.Height + gapping)), 1.0)); int calendars = calendarsX * calendarsY; - int monthsWidth = (calendarsX * MonthSize.Width) + (calendarsX - 1) * gapping; - int monthsHeight = (calendarsY * MonthSize.Height) + (calendarsY - 1) * gapping; + int monthsWidth = calendarsX * MonthSize.Width + (calendarsX - 1) * gapping; + int monthsHeight = calendarsY * MonthSize.Height + (calendarsY - 1) * gapping; int startX = (ClientSize.Width - monthsWidth) / 2; int startY = (ClientSize.Height - monthsHeight) / 2; int curX = startX; @@ -879,7 +879,7 @@ protected override void OnPaint(PaintEventArgs e) MonthViewBoxEventArgs evtDay = new MonthViewBoxEventArgs(e.Graphics, day.Bounds, day.Date.Day.ToString(), StringAlignment.Far, - day.Grayed ? DayGrayedText : (day.Selected ? DaySelectedTextColour : ForeColor), + day.Grayed ? DayGrayedText : day.Selected ? DaySelectedTextColour : ForeColor, day.Selected ? DaySelectedBackgroundColour : DayBackgroundColour); if (day.Date.Equals(DateTime.Now.Date)) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Enumerations/CalendarDaysMode.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Enumerations/CalendarDaysMode.cs index 47c362b06..d1c294521 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Enumerations/CalendarDaysMode.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Enumerations/CalendarDaysMode.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Enumerations/CalendarItemImageAlign.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Enumerations/CalendarItemImageAlign.cs index a6fb5960e..16ce3cd97 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Enumerations/CalendarItemImageAlign.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Enumerations/CalendarItemImageAlign.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Enumerations/CalendarTimeScale.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Enumerations/CalendarTimeScale.cs index 259622004..616594011 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Enumerations/CalendarTimeScale.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Enumerations/CalendarTimeScale.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarDayEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarDayEventArgs.cs index 2c55c44b4..18fd2e4c8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarDayEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarDayEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarItemCancelEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarItemCancelEventArgs.cs index 2608d310b..2a45ba06e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarItemCancelEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarItemCancelEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarItemEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarItemEventArgs.cs index b549c6b0c..c992de314 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarItemEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarItemEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarLoadEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarLoadEventArgs.cs index 3e15532fd..8f1d5c881 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarLoadEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarLoadEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererBoxEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererBoxEventArgs.cs index 0b1af805a..3adfd9539 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererBoxEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererBoxEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererDayEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererDayEventArgs.cs index 4b3db7e58..4e6878d14 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererDayEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererDayEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererEventArgs.cs index 54a0e6e6e..e4647b03f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererItemBoundsEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererItemBoundsEventArgs.cs index 6da739c3e..4a194b4ba 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererItemBoundsEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererItemBoundsEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererItemEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererItemEventArgs.cs index 2447948fe..6a80cd594 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererItemEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererItemEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererTimeUnitEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererTimeUnitEventArgs.cs index 920da4021..fff8c4672 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererTimeUnitEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/CalendarRendererTimeUnitEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/MonthViewBoxEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/MonthViewBoxEventArgs.cs index 59e2e9a29..9c6795ca6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/MonthViewBoxEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/MonthViewBoxEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/MonthViewMontEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/MonthViewMontEventArgs.cs index aaa9ed3f6..921a53701 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/MonthViewMontEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Events/MonthViewMontEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Globals/GlobalDeclarations.cs index 78c55c7b1..c916f92b0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Interfaces/ICalendarSelectableElement.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Interfaces/ICalendarSelectableElement.cs index f0156e13e..8726a1adb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Interfaces/ICalendarSelectableElement.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Interfaces/ICalendarSelectableElement.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Interfaces/ISelectableElement.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Interfaces/ISelectableElement.cs index 644fad374..fb88ef573 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Interfaces/ISelectableElement.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Interfaces/ISelectableElement.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Krypton.Toolkit.Suite.Extended.Calendar 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Krypton.Toolkit.Suite.Extended.Calendar 2022.csproj index f6a101efd..520e78a3c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Krypton.Toolkit.Suite.Extended.Calendar 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Krypton.Toolkit.Suite.Extended.Calendar 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -69,9 +57,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements a KryptonCalendar control. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements a KryptonCalendar control. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -79,74 +67,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Krypton.Toolkit.Suite.Extended.Calendar.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Krypton.Toolkit.Suite.Extended.Calendar.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Krypton.Toolkit.Suite.Extended.Calendar.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Krypton.Toolkit.Suite.Extended.Calendar.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Classes/HashingHelpers.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Classes/HashingHelpers.cs index 42f8b720f..1e2a021f7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Classes/HashingHelpers.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Classes/HashingHelpers.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -34,27 +34,27 @@ public class HashingHelpers #if !NETCOREAPP3_1_OR_GREATER public static SupportedHashAlgorithims ReturnHashType(string hashType) { - if (hashType == @"MD-5" || hashType == @"md-5" || hashType == @"MD5" || hashType == @"md5") + if (hashType is @"MD-5" or @"md-5" or @"MD5" or @"md5") { return SupportedHashAlgorithims.MD5; } - else if (hashType == @"SHA-1" || hashType == @"sha-1" || hashType == @"SHA1" || hashType == @"sha1") + else if (hashType is @"SHA-1" or @"sha-1" or @"SHA1" or @"sha1") { return SupportedHashAlgorithims.SHA1; } - else if (hashType == @"SHA-256" || hashType == @"sha-256" || hashType == @"SHA256" || hashType == @"sha256") + else if (hashType is @"SHA-256" or @"sha-256" or @"SHA256" or @"sha256") { return SupportedHashAlgorithims.SHA256; } - else if (hashType == @"SHA-384" || hashType == @"sha-384" || hashType == @"SHA384" || hashType == @"sha384") + else if (hashType is @"SHA-384" or @"sha-384" or @"SHA384" or @"sha384") { return SupportedHashAlgorithims.SHA384; } - else if (hashType == @"SHA-512" || hashType == @"sha-512" || hashType == @"SHA512" || hashType == @"sha512") + else if (hashType is @"SHA-512" or @"sha-512" or @"SHA512" or @"sha512") { return SupportedHashAlgorithims.SHA512; } - else if (hashType == @"RIPEMD-160" || hashType == @"ripemd-160" || hashType == @"RIPEMD160" || hashType == @"ripemd160") + else if (hashType is @"RIPEMD-160" or @"ripemd-160" or @"RIPEMD160" or @"ripemd160") { return SupportedHashAlgorithims.RIPEMD160; } @@ -64,23 +64,23 @@ public static SupportedHashAlgorithims ReturnHashType(string hashType) #else public static SafeNETCoreAndNewerSupportedHashAlgorithims ReturnHashType(string hashType) { - if (hashType == @"MD-5" || hashType == @"md-5" || hashType == @"MD5" || hashType == @"md5") + if (hashType is @"MD-5" or @"md-5" or @"MD5" or @"md5") { return SafeNETCoreAndNewerSupportedHashAlgorithims.MD5; } - else if (hashType == @"SHA-1" || hashType == @"sha-1" || hashType == @"SHA1" || hashType == @"sha1") + else if (hashType is @"SHA-1" or @"sha-1" or @"SHA1" or @"sha1") { return SafeNETCoreAndNewerSupportedHashAlgorithims.SHA1; } - else if (hashType == @"SHA-256" || hashType == @"sha-256" || hashType == @"SHA256" || hashType == @"sha256") + else if (hashType is @"SHA-256" or @"sha-256" or @"SHA256" or @"sha256") { return SafeNETCoreAndNewerSupportedHashAlgorithims.SHA256; } - else if (hashType == @"SHA-384" || hashType == @"sha-384" || hashType == @"SHA384" || hashType == @"sha384") + else if (hashType is @"SHA-384" or @"sha-384" or @"SHA384" or @"sha384") { return SafeNETCoreAndNewerSupportedHashAlgorithims.SHA384; } - else if (hashType == @"SHA-512" || hashType == @"sha-512" || hashType == @"SHA512" || hashType == @"sha512") + else if (hashType is @"SHA-512" or @"sha-512" or @"SHA512" or @"sha512") { return SafeNETCoreAndNewerSupportedHashAlgorithims.SHA512; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Classes/HelperMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Classes/HelperMethods.cs index 83b0a03f8..c8d22dce2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Classes/HelperMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Classes/HelperMethods.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Controls Toolkit/KryptonBrowseBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Controls Toolkit/KryptonBrowseBox.cs index 437883a3f..ee04a7ba9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Controls Toolkit/KryptonBrowseBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Controls Toolkit/KryptonBrowseBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Controls Visuals/KryptonComputeFileCheckSum.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Controls Visuals/KryptonComputeFileCheckSum.cs index a9b7f205b..7f2a4ad67 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Controls Visuals/KryptonComputeFileCheckSum.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Controls Visuals/KryptonComputeFileCheckSum.cs @@ -18,7 +18,7 @@ public KryptonComputeFileCheckSum(bool? useAPICodePackFeatures) CancelButton = kbtnCancel; - kbtnCancel.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel; + kbtnCancel.Text = KryptonManager.Strings.GeneralStrings.Cancel; _useAPICodePackFeatures = useAPICodePackFeatures ?? true; @@ -247,7 +247,7 @@ private void CalculateHash() } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } @@ -308,7 +308,7 @@ private void kbtnCalculate_Click(object sender, EventArgs e) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } @@ -348,7 +348,7 @@ private void kbtnCancel_Click(object sender, EventArgs e) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } } @@ -358,7 +358,7 @@ private void kbtnCancel_Click(object sender, EventArgs e) private void bgwMD5_DoWork(object sender, DoWorkEventArgs e) { - string filePath = e.Argument.ToString(); + string? filePath = e.Argument?.ToString(); byte[] buffer; @@ -366,28 +366,31 @@ private void bgwMD5_DoWork(object sender, DoWorkEventArgs e) long size, totalBytesRead = 0; - using (Stream file = File.OpenRead(filePath)) + if (filePath != null) { - size = file.Length; - - using (HashAlgorithm hasher = MD5.Create()) + using (Stream file = File.OpenRead(filePath)) { - do + size = file.Length; + + using (HashAlgorithm hasher = MD5.Create()) { - buffer = new byte[4096]; + do + { + buffer = new byte[4096]; - bytesRead = file.Read(buffer, 0, buffer.Length); + bytesRead = file.Read(buffer, 0, buffer.Length); - totalBytesRead += bytesRead; + totalBytesRead += bytesRead; - hasher.TransformBlock(buffer, 0, bytesRead, null, 0); + hasher.TransformBlock(buffer, 0, bytesRead, null, 0); - bgwMD5.ReportProgress((int)((double)totalBytesRead / size * 100)); - } while (bytesRead != 0); + bgwMD5.ReportProgress((int)((double)totalBytesRead / size * 100)); + } while (bytesRead != 0); - hasher.TransformFinalBlock(buffer, 0, 0); + hasher.TransformFinalBlock(buffer, 0, 0); - e.Result = HashingHelpers.BuildMD5HashString(hasher.Hash); + e.Result = HashingHelpers.BuildMD5HashString(hasher.Hash); + } } } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Controls Visuals/KryptonVerifyFileCheckSum.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Controls Visuals/KryptonVerifyFileCheckSum.cs index 340b38abf..57f66e0fe 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Controls Visuals/KryptonVerifyFileCheckSum.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Controls Visuals/KryptonVerifyFileCheckSum.cs @@ -1,4 +1,6 @@ -namespace Krypton.Toolkit.Suite.Extended.CheckSum.Tools +// ToDo: Add license + +namespace Krypton.Toolkit.Suite.Extended.CheckSum.Tools { public partial class KryptonVerifyFileCheckSum : KryptonForm { @@ -20,7 +22,7 @@ public KryptonVerifyFileCheckSum(bool? useAPICodePackFeatures) CancelButton = kbtnCancel; - kbtnCancel.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel; + kbtnCancel.Text = KryptonManager.Strings.GeneralStrings.Cancel; _useAPICodePackFeatures = useAPICodePackFeatures ?? true; @@ -104,7 +106,7 @@ private void CalculateHash() } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } @@ -165,7 +167,7 @@ private void kbtnCalculate_Click(object sender, EventArgs e) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } @@ -208,7 +210,7 @@ private void kbtnCancel_Click(object sender, EventArgs e) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } } @@ -236,7 +238,7 @@ private void ImportCheckSumFromFile(string filePath) } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Enumerations/SafeNETCoreAndNewerSupportedHashAlgorithims.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Enumerations/SafeNETCoreAndNewerSupportedHashAlgorithims.cs index 2b413cf27..d68c582be 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Enumerations/SafeNETCoreAndNewerSupportedHashAlgorithims.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Enumerations/SafeNETCoreAndNewerSupportedHashAlgorithims.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Enumerations/SupportedHashAlgorithims.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Enumerations/SupportedHashAlgorithims.cs index acc7b98b1..3d40d1831 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Enumerations/SupportedHashAlgorithims.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Enumerations/SupportedHashAlgorithims.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Globals/GlobalDeclarations.cs index 7266400fc..373adbff3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -34,7 +34,7 @@ global using System.Windows.Forms; global using Krypton.Toolkit.Suite.Extended.CheckSum.Tools.Properties; -global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; +global using Krypton.Toolkit.Suite.Extended.Debug.Tools; global using Microsoft.WindowsAPICodePack.Dialogs; global using Microsoft.WindowsAPICodePack.Taskbar; \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Krypton.Toolkit.Suite.Extended.CheckSum.Tools 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Krypton.Toolkit.Suite.Extended.CheckSum.Tools 2022.csproj index 341636346..1b64f967f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Krypton.Toolkit.Suite.Extended.CheckSum.Tools 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Krypton.Toolkit.Suite.Extended.CheckSum.Tools 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package holds utilities to compute and verify checksums. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package holds utilities to compute and verify checksums. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,74 +69,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + @@ -178,6 +128,7 @@ + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/UX/KryptonComputeFileCheckSumOld.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/UX/KryptonComputeFileCheckSumOld.cs index a55884334..83f3306b1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/UX/KryptonComputeFileCheckSumOld.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/UX/KryptonComputeFileCheckSumOld.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -79,15 +79,15 @@ private void InitializeComponent() this.bgSHA512Hash = new System.ComponentModel.BackgroundWorker(); this.bgRIPEMD160Hash = new System.ComponentModel.BackgroundWorker(); this.statusStrip1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1.Panel).BeginInit(); this.kryptonGroupBox1.Panel.SuspendLayout(); this.kryptonGroupBox1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbAlgorithimType)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbAlgorithimType).BeginInit(); this.SuspendLayout(); // // statusStrip1 @@ -141,7 +141,6 @@ private void InitializeComponent() // // kbtnSaveToFile // - this.kbtnSaveToFile.CornerRoundingRadius = -1F; this.kbtnSaveToFile.Enabled = false; this.kbtnSaveToFile.Location = new System.Drawing.Point(507, 12); this.kbtnSaveToFile.Name = "kbtnSaveToFile"; @@ -152,7 +151,6 @@ private void InitializeComponent() // // kbtnCancel // - this.kbtnCancel.CornerRoundingRadius = -1F; this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kbtnCancel.Location = new System.Drawing.Point(603, 12); this.kbtnCancel.Name = "kbtnCancel"; @@ -190,7 +188,7 @@ private void InitializeComponent() this.kbbFilePath.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.FileSystem; this.kbbFilePath.CueHint.CueHintText = "Type a file path here..."; this.kbbFilePath.CueHint.Padding = new System.Windows.Forms.Padding(0); - this.kbbFilePath.LargeResetImage = ((System.Drawing.Image)(resources.GetObject("kbbFilePath.LargeResetImage"))); + this.kbbFilePath.LargeResetImage = (System.Drawing.Image)resources.GetObject("kbbFilePath.LargeResetImage"); this.kbbFilePath.Location = new System.Drawing.Point(82, 12); this.kbbFilePath.Name = "kbbFilePath"; this.kbbFilePath.ResetText = null; @@ -198,7 +196,7 @@ private void InitializeComponent() this.kbbFilePath.ResetTextToolTipHeading = null; this.kbbFilePath.ShowResetButton = true; this.kbbFilePath.Size = new System.Drawing.Size(614, 24); - this.kbbFilePath.SmallResetImage = ((System.Drawing.Image)(resources.GetObject("kbbFilePath.SmallResetImage"))); + this.kbbFilePath.SmallResetImage = (System.Drawing.Image)resources.GetObject("kbbFilePath.SmallResetImage"); this.kbbFilePath.TabIndex = 11; // // kryptonGroupBox1 @@ -217,18 +215,17 @@ private void InitializeComponent() // this.kwlHash.AutoSize = false; this.kwlHash.Dock = System.Windows.Forms.DockStyle.Fill; - this.kwlHash.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlHash.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kwlHash.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); + this.kwlHash.ForeColor = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kwlHash.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl; this.kwlHash.Location = new System.Drawing.Point(0, 0); this.kwlHash.Name = "kwlHash"; this.kwlHash.Size = new System.Drawing.Size(680, 71); - this.kwlHash.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kwlHash.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kwlHash.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // kbtnCompute // - this.kbtnCompute.CornerRoundingRadius = -1F; this.kbtnCompute.Enabled = false; this.kbtnCompute.Location = new System.Drawing.Point(255, 59); this.kbtnCompute.Name = "kbtnCompute"; @@ -239,7 +236,6 @@ private void InitializeComponent() // // kcmbAlgorithimType // - this.kcmbAlgorithimType.CornerRoundingRadius = -1F; this.kcmbAlgorithimType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.kcmbAlgorithimType.DropDownWidth = 121; this.kcmbAlgorithimType.Enabled = false; @@ -333,17 +329,17 @@ private void InitializeComponent() this.Text = "Calculate CheckSum"; this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); this.kryptonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1.Panel).EndInit(); this.kryptonGroupBox1.Panel.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1).EndInit(); this.kryptonGroupBox1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kcmbAlgorithimType)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbAlgorithimType).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -385,7 +381,7 @@ private void kbtnCompute_Click(object sender, EventArgs e) } catch (Exception ex) { - ExceptionCapture.CaptureException(ex); + DebugUtilities.NotImplemented(ex.ToString()); } } @@ -401,7 +397,7 @@ private void CalculateHash() } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } @@ -441,7 +437,7 @@ private void kbtnCancel_Click(object sender, EventArgs e) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } } @@ -807,7 +803,7 @@ private void SaveHashToFile(string text, bool toUpper) } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } @@ -831,7 +827,7 @@ private void WriteToFile(string fileName, string text, bool toUpper) } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/UX/KryptonVarifyFileCheckSumOld.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/UX/KryptonVarifyFileCheckSumOld.cs index aac814d55..e9318827c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/UX/KryptonVarifyFileCheckSumOld.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/UX/KryptonVarifyFileCheckSumOld.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -96,20 +96,20 @@ private void InitializeComponent() this.bgSHA1Hash = new System.ComponentModel.BackgroundWorker(); this.bgMD5Hash = new System.ComponentModel.BackgroundWorker(); this.kbbFilePath = new Krypton.Toolkit.Suite.Extended.CheckSum.Tools.KryptonBrowseBox(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox2)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox2.Panel)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox2).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox2.Panel).BeginInit(); this.kryptonGroupBox2.Panel.SuspendLayout(); this.kryptonGroupBox2.SuspendLayout(); this.cmsCheckSumValidation.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1.Panel).BeginInit(); this.kryptonGroupBox1.Panel.SuspendLayout(); this.kryptonGroupBox1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbAlgorithimType)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbAlgorithimType).BeginInit(); this.ss.SuspendLayout(); this.SuspendLayout(); // @@ -128,7 +128,6 @@ private void InitializeComponent() // // kbtnValidate // - this.kbtnValidate.CornerRoundingRadius = -1F; this.kbtnValidate.Enabled = false; this.kbtnValidate.Location = new System.Drawing.Point(511, 13); this.kbtnValidate.Name = "kbtnValidate"; @@ -139,7 +138,6 @@ private void InitializeComponent() // // kbtnImportHash // - this.kbtnImportHash.CornerRoundingRadius = -1F; this.kbtnImportHash.Enabled = false; this.kbtnImportHash.Location = new System.Drawing.Point(13, 13); this.kbtnImportHash.Name = "kbtnImportHash"; @@ -150,7 +148,6 @@ private void InitializeComponent() // // kbtnCancel // - this.kbtnCancel.CornerRoundingRadius = -1F; this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kbtnCancel.Location = new System.Drawing.Point(607, 13); this.kbtnCancel.Name = "kbtnCancel"; @@ -203,7 +200,7 @@ private void InitializeComponent() this.ktxtVarifyCheckSum.Location = new System.Drawing.Point(6, 23); this.ktxtVarifyCheckSum.Name = "ktxtVarifyCheckSum"; this.ktxtVarifyCheckSum.Size = new System.Drawing.Size(665, 24); - this.ktxtVarifyCheckSum.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ktxtVarifyCheckSum.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.ktxtVarifyCheckSum.TabIndex = 0; this.ktxtVarifyCheckSum.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.ktxtVarifyCheckSum.TextChanged += new System.EventHandler(this.ktxtVarifyCheckSum_TextChanged); @@ -253,18 +250,17 @@ private void InitializeComponent() // this.kwlCalculatedCheckSum.AutoSize = false; this.kwlCalculatedCheckSum.Dock = System.Windows.Forms.DockStyle.Fill; - this.kwlCalculatedCheckSum.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlCalculatedCheckSum.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kwlCalculatedCheckSum.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); + this.kwlCalculatedCheckSum.ForeColor = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kwlCalculatedCheckSum.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl; this.kwlCalculatedCheckSum.Location = new System.Drawing.Point(0, 0); this.kwlCalculatedCheckSum.Name = "kwlCalculatedCheckSum"; this.kwlCalculatedCheckSum.Size = new System.Drawing.Size(680, 71); - this.kwlCalculatedCheckSum.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kwlCalculatedCheckSum.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kwlCalculatedCheckSum.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // kbtnCompute // - this.kbtnCompute.CornerRoundingRadius = -1F; this.kbtnCompute.Enabled = false; this.kbtnCompute.Location = new System.Drawing.Point(256, 63); this.kbtnCompute.Name = "kbtnCompute"; @@ -275,7 +271,6 @@ private void InitializeComponent() // // kcmbAlgorithimType // - this.kcmbAlgorithimType.CornerRoundingRadius = -1F; this.kcmbAlgorithimType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.kcmbAlgorithimType.DropDownWidth = 121; this.kcmbAlgorithimType.Enabled = false; @@ -387,7 +382,7 @@ private void InitializeComponent() this.kbbFilePath.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.FileSystem; this.kbbFilePath.CueHint.CueHintText = "Type a file path here..."; this.kbbFilePath.CueHint.Padding = new System.Windows.Forms.Padding(0); - this.kbbFilePath.LargeResetImage = ((System.Drawing.Image)(resources.GetObject("kbbFilePath.LargeResetImage"))); + this.kbbFilePath.LargeResetImage = (System.Drawing.Image)resources.GetObject("kbbFilePath.LargeResetImage"); this.kbbFilePath.Location = new System.Drawing.Point(83, 13); this.kbbFilePath.Name = "kbbFilePath"; this.kbbFilePath.ResetText = null; @@ -395,7 +390,7 @@ private void InitializeComponent() this.kbbFilePath.ResetTextToolTipHeading = null; this.kbbFilePath.ShowResetButton = true; this.kbbFilePath.Size = new System.Drawing.Size(614, 24); - this.kbbFilePath.SmallResetImage = ((System.Drawing.Image)(resources.GetObject("kbbFilePath.SmallResetImage"))); + this.kbbFilePath.SmallResetImage = (System.Drawing.Image)resources.GetObject("kbbFilePath.SmallResetImage"); this.kbbFilePath.TabIndex = 12; // // KryptonVarifyFileCheckSum @@ -411,23 +406,23 @@ private void InitializeComponent() this.ShowIcon = false; this.ShowInTaskbar = false; this.Text = "Varify File CheckSum"; - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); this.kryptonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox2.Panel)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox2.Panel).EndInit(); this.kryptonGroupBox2.Panel.ResumeLayout(false); this.kryptonGroupBox2.Panel.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox2).EndInit(); this.kryptonGroupBox2.ResumeLayout(false); this.cmsCheckSumValidation.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1.Panel).EndInit(); this.kryptonGroupBox1.Panel.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1).EndInit(); this.kryptonGroupBox1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kcmbAlgorithimType)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbAlgorithimType).EndInit(); this.ss.ResumeLayout(false); this.ss.PerformLayout(); this.ResumeLayout(false); @@ -747,7 +742,7 @@ private void kbtnCompute_Click(object sender, EventArgs e) } catch (Exception ex) { - ExceptionCapture.CaptureException(ex); + DebugUtilities.NotImplemented(ex.ToString()); } } @@ -782,7 +777,7 @@ private void kbtnImportHash_Click(object sender, EventArgs e) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } @@ -829,7 +824,7 @@ private void CalculateHash() } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Controls/CircularProgressBar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Controls/CircularProgressBar.cs index 5094388f3..f8fa6f2f4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Controls/CircularProgressBar.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Controls/CircularProgressBar.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,6 +25,8 @@ */ #endregion +using DebugUtilities = Krypton.Toolkit.Suite.Extended.Debug.Tools.DebugUtilities; + namespace Krypton.Toolkit.Suite.Extended.Circular.ProgressBar { /// The circular progress bar windows form control. @@ -34,7 +36,7 @@ namespace Krypton.Toolkit.Suite.Extended.Circular.ProgressBar public class CircularProgressBar : System.Windows.Forms.ProgressBar { #region Variables - private readonly Animator _animator; + private readonly Animator? _animator; private int? _animatedStartAngle; private float? _animatedValue; private AnimationFunctions.Function _animationFunction; @@ -270,7 +272,7 @@ public CircularProgressBar() Size = new Size(320, 320); - if (((_palette != null))) + if (_palette != null) { _palette.PalettePaint += new EventHandler(OnPalettePaint); } @@ -333,7 +335,7 @@ protected virtual void InitialiseContinues(bool firstTime) _lastValue = Value; - _animator.Stop(); + _animator?.Stop(); _animatedStartAngle = null; if (AnimationSpeed <= 0) @@ -344,7 +346,7 @@ protected virtual void InitialiseContinues(bool firstTime) return; } - _animator.Paths = + _animator!.Paths = new Path(_animatedValue ?? Value, Value, (ulong)AnimationSpeed, CustomAnimationFunction).ToArray(); _animator.Repeat = false; _animator.Play( @@ -371,14 +373,14 @@ protected virtual void InitialiseContinues(bool firstTime) protected virtual void InitialiseMarquee(bool firstTime) { if (!firstTime && - (_animator.ActivePath == null || + (_animator?.ActivePath == null || _animator.ActivePath.Duration == (ulong)MarqueeAnimationSpeed && _animator.ActivePath.Function == CustomAnimationFunction)) { return; } - _animator.Stop(); + _animator?.Stop(); _animatedValue = null; if (AnimationSpeed <= 0) @@ -389,7 +391,7 @@ protected virtual void InitialiseMarquee(bool firstTime) return; } - _animator.Paths = new Path(0, 359, (ulong)MarqueeAnimationSpeed, CustomAnimationFunction).ToArray(); + _animator!.Paths = new Path(0, 359, (ulong)MarqueeAnimationSpeed, CustomAnimationFunction).ToArray(); _animator.Repeat = true; _animator.Play( new SafeInvoker( @@ -429,7 +431,7 @@ protected virtual void RecreateBackgroundBrush() { lock (this) { - _backBrush?.Dispose(); + _backBrush.Dispose(); _backBrush = new SolidBrush(BackColor); if (BackColor.A == 255) @@ -679,7 +681,7 @@ protected override void OnPaint(PaintEventArgs e) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } @@ -734,13 +736,13 @@ private void InitialiseKrypton() private void OnGlobalPaletteChanged(object sender, EventArgs e) { - if (((_palette != null))) + if (_palette != null) { _palette.PalettePaint -= new EventHandler(OnPalettePaint); } _palette = KryptonManager.CurrentGlobalPalette; _paletteRedirect.Target = _palette; - if (((_palette != null))) + if (_palette != null) { _palette.PalettePaint += new EventHandler(OnPalettePaint); InitialiseKrypton(); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Events/ValueChangedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Events/ValueChangedEventArgs.cs index 76b8595e4..c4e035cb2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Events/ValueChangedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Events/ValueChangedEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Globals/GlobalDeclarations.cs index 2082cd5ca..85247aa3f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar 2022.csproj index 717cc1952..da3476815 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package holds the circular progressbar control. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package holds the circular progressbar control. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,74 +69,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + @@ -184,6 +134,7 @@ + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Krypton.Toolkit.Suite.Extended.CircularProgress.Bar.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Krypton.Toolkit.Suite.Extended.CircularProgress.Bar.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Krypton.Toolkit.Suite.Extended.CircularProgress.Bar.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Krypton.Toolkit.Suite.Extended.CircularProgress.Bar.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Classes/Internal/WIN32.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Classes/Internal/WIN32.cs index 04b1a7b95..c71e37a8a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Classes/Internal/WIN32.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Classes/Internal/WIN32.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -27,38 +27,38 @@ namespace Krypton.Toolkit.Suite.Extended.ComboBox { - internal class WIN32 + internal class Win32 { /* * GetWindow() Constants */ - public const int GW_HWNDFIRST = 0; - public const int GW_HWNDLAST = 1; - public const int GW_HWNDNEXT = 2; - public const int GW_HWNDPREV = 3; - public const int GW_OWNER = 4; - public const int GW_CHILD = 5; - - public const int WM_NCCALCSIZE = 0x83; - public const int WM_WINDOWPOSCHANGING = 0x46; - public const int WM_PAINT = 0xF; - public const int WM_CREATE = 0x1; - public const int WM_NCCREATE = 0x81; - public const int WM_NCPAINT = 0x85; - public const int WM_PRINT = 0x317; - public const int WM_DESTROY = 0x2; - public const int WM_SHOWWINDOW = 0x18; - public const int WM_SHARED_MENU = 0x1E2; - public const int WH_CALLWNDPROC = 4; - public const int WM_PARENTNOTIFY = 0x210; - public const int WM_HSCROLL = 0x114; - public const int WM_NCHITTEST = 0x84; - public const int WM_ERASEBKGND = 0x0014; // WM_ERASEBKGND message - - public const int HC_ACTION = 0; - public const int GWL_WNDPROC = -4; - - public WIN32() + public const int GwHwndfirst = 0; + public const int GwHwndlast = 1; + public const int GwHwndnext = 2; + public const int GwHwndprev = 3; + public const int GwOwner = 4; + public const int GwChild = 5; + + public const int WmNccalcsize = 0x83; + public const int WmWindowposchanging = 0x46; + public const int WmPaint = 0xF; + public const int WmCreate = 0x1; + public const int WmNccreate = 0x81; + public const int WmNcpaint = 0x85; + public const int WmPrint = 0x317; + public const int WmDestroy = 0x2; + public const int WmShowwindow = 0x18; + public const int WmSharedMenu = 0x1E2; + public const int WhCallwndproc = 4; + public const int WmParentnotify = 0x210; + public const int WmHscroll = 0x114; + public const int WmNchittest = 0x84; + public const int WmErasebkgnd = 0x0014; // WM_ERASEBKGND message + + public const int HcAction = 0; + public const int GwlWndproc = -4; + + public Win32() { // // TODO: Add constructor logic here @@ -73,7 +73,7 @@ public WIN32() public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent); [DllImport("user32.dll")] - public static extern IntPtr SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam); + public static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam); [DllImport("User32.dll", CharSet = CharSet.Auto)] @@ -89,7 +89,7 @@ IntPtr hWndNewNext // handle to next window public static extern IntPtr GetDCEx(IntPtr hwnd, IntPtr hrgnclip, uint fdwOptions); [DllImport("user32.dll")] - public static extern int ReleaseDC(IntPtr hwnd, IntPtr hDC); + public static extern int ReleaseDC(IntPtr hwnd, IntPtr hDc); [DllImport("User32.dll", CharSet = CharSet.Auto)] @@ -108,13 +108,13 @@ IntPtr hWndNewNext // handle to next window public static extern bool IsWindowVisible(IntPtr hwnd); [DllImport("user32", CharSet = CharSet.Auto)] - public static extern int GetClientRect(IntPtr hwnd, ref RECT lpRect); + public static extern int GetClientRect(IntPtr hwnd, ref Rect lpRect); [DllImport("user32", CharSet = CharSet.Auto)] public static extern int GetClientRect(IntPtr hwnd, [In, Out] ref Rectangle rect); [DllImport("user32", CharSet = CharSet.Auto)] - public static extern bool MoveWindow(IntPtr hwnd, int X, int Y, int nWidth, int nHeight, bool bRepaint); + public static extern bool MoveWindow(IntPtr hwnd, int x, int y, int nWidth, int nHeight, bool bRepaint); [DllImport("user32", CharSet = CharSet.Auto)] public static extern bool UpdateWindow(IntPtr hwnd); @@ -141,7 +141,7 @@ IntPtr hWndNewNext // handle to next window public static extern int SetWindowTheme(IntPtr hWnd, int pszSubAppName, int pszSubIdList); [StructLayout(LayoutKind.Sequential)] - public struct RECT + public struct Rect { public int Left; public int Top; @@ -150,7 +150,7 @@ public struct RECT } [StructLayout(LayoutKind.Sequential)] - public struct WINDOWPOS + public struct Windowpos { public IntPtr hwnd; public IntPtr hwndAfter; @@ -162,10 +162,10 @@ public struct WINDOWPOS } [StructLayout(LayoutKind.Sequential)] - public struct NCCALCSIZE_PARAMS + public struct NccalcsizeParams { - public RECT rgc; - public WINDOWPOS wndpos; + public Rect rgc; + public Windowpos wndpos; } } @@ -174,215 +174,215 @@ public struct NCCALCSIZE_PARAMS /// public enum Msgs { - WM_NULL = 0x0000, - WM_CREATE = 0x0001, - WM_DESTROY = 0x0002, - WM_MOVE = 0x0003, - WM_SIZE = 0x0005, - WM_ACTIVATE = 0x0006, - WM_SETFOCUS = 0x0007, - WM_KILLFOCUS = 0x0008, - WM_ENABLE = 0x000A, - WM_SETREDRAW = 0x000B, - WM_SETTEXT = 0x000C, - WM_GETTEXT = 0x000D, - WM_GETTEXTLENGTH = 0x000E, - WM_PAINT = 0x000F, - WM_CLOSE = 0x0010, - WM_QUERYENDSESSION = 0x0011, - WM_QUIT = 0x0012, - WM_QUERYOPEN = 0x0013, - WM_ERASEBKGND = 0x0014, - WM_SYSCOLORCHANGE = 0x0015, - WM_ENDSESSION = 0x0016, - WM_SHOWWINDOW = 0x0018, - WM_WININICHANGE = 0x001A, - WM_SETTINGCHANGE = 0x001A, - WM_DEVMODECHANGE = 0x001B, - WM_ACTIVATEAPP = 0x001C, - WM_FONTCHANGE = 0x001D, - WM_TIMECHANGE = 0x001E, - WM_CANCELMODE = 0x001F, - WM_SETCURSOR = 0x0020, - WM_MOUSEACTIVATE = 0x0021, - WM_CHILDACTIVATE = 0x0022, - WM_QUEUESYNC = 0x0023, - WM_GETMINMAXINFO = 0x0024, - WM_PAINTICON = 0x0026, - WM_ICONERASEBKGND = 0x0027, - WM_NEXTDLGCTL = 0x0028, - WM_SPOOLERSTATUS = 0x002A, - WM_DRAWITEM = 0x002B, - WM_MEASUREITEM = 0x002C, - WM_DELETEITEM = 0x002D, - WM_VKEYTOITEM = 0x002E, - WM_CHARTOITEM = 0x002F, - WM_SETFONT = 0x0030, - WM_GETFONT = 0x0031, - WM_SETHOTKEY = 0x0032, - WM_GETHOTKEY = 0x0033, - WM_QUERYDRAGICON = 0x0037, - WM_COMPAREITEM = 0x0039, - WM_GETOBJECT = 0x003D, - WM_COMPACTING = 0x0041, - WM_COMMNOTIFY = 0x0044, - WM_WINDOWPOSCHANGING = 0x0046, - WM_WINDOWPOSCHANGED = 0x0047, - WM_POWER = 0x0048, - WM_COPYDATA = 0x004A, - WM_CANCELJOURNAL = 0x004B, - WM_NOTIFY = 0x004E, - WM_INPUTLANGCHANGEREQUEST = 0x0050, - WM_INPUTLANGCHANGE = 0x0051, - WM_TCARD = 0x0052, - WM_HELP = 0x0053, - WM_USERCHANGED = 0x0054, - WM_NOTIFYFORMAT = 0x0055, - WM_CONTEXTMENU = 0x007B, - WM_STYLECHANGING = 0x007C, - WM_STYLECHANGED = 0x007D, - WM_DISPLAYCHANGE = 0x007E, - WM_GETICON = 0x007F, - WM_SETICON = 0x0080, - WM_NCCREATE = 0x0081, - WM_NCDESTROY = 0x0082, - WM_NCCALCSIZE = 0x0083, - WM_NCHITTEST = 0x0084, - WM_NCPAINT = 0x0085, - WM_NCACTIVATE = 0x0086, - WM_GETDLGCODE = 0x0087, - WM_SYNCPAINT = 0x0088, - WM_NCMOUSEMOVE = 0x00A0, - WM_NCLBUTTONDOWN = 0x00A1, - WM_NCLBUTTONUP = 0x00A2, - WM_NCLBUTTONDBLCLK = 0x00A3, - WM_NCRBUTTONDOWN = 0x00A4, - WM_NCRBUTTONUP = 0x00A5, - WM_NCRBUTTONDBLCLK = 0x00A6, - WM_NCMBUTTONDOWN = 0x00A7, - WM_NCMBUTTONUP = 0x00A8, - WM_NCMBUTTONDBLCLK = 0x00A9, - WM_NCXBUTTONDOWN = 0x00AB, - WM_NCXBUTTONUP = 0x00AC, - WM_KEYDOWN = 0x0100, - WM_KEYUP = 0x0101, - WM_CHAR = 0x0102, - WM_DEADCHAR = 0x0103, - WM_SYSKEYDOWN = 0x0104, - WM_SYSKEYUP = 0x0105, - WM_SYSCHAR = 0x0106, - WM_SYSDEADCHAR = 0x0107, - WM_KEYLAST = 0x0108, - WM_IME_STARTCOMPOSITION = 0x010D, - WM_IME_ENDCOMPOSITION = 0x010E, - WM_IME_COMPOSITION = 0x010F, - WM_IME_KEYLAST = 0x010F, - WM_INITDIALOG = 0x0110, - WM_COMMAND = 0x0111, - WM_SYSCOMMAND = 0x0112, - WM_TIMER = 0x0113, - WM_HSCROLL = 0x0114, - WM_VSCROLL = 0x0115, - WM_INITMENU = 0x0116, - WM_INITMENUPOPUP = 0x0117, - WM_MENUSELECT = 0x011F, - WM_MENUCHAR = 0x0120, - WM_ENTERIDLE = 0x0121, - WM_MENURBUTTONUP = 0x0122, - WM_MENUDRAG = 0x0123, - WM_MENUGETOBJECT = 0x0124, - WM_UNINITMENUPOPUP = 0x0125, - WM_MENUCOMMAND = 0x0126, - WM_CTLCOLORMSGBOX = 0x0132, - WM_CTLCOLOREDIT = 0x0133, - WM_CTLCOLORLISTBOX = 0x0134, - WM_CTLCOLORBTN = 0x0135, - WM_CTLCOLORDLG = 0x0136, - WM_CTLCOLORSCROLLBAR = 0x0137, - WM_CTLCOLORSTATIC = 0x0138, - WM_MOUSEMOVE = 0x0200, - WM_LBUTTONDOWN = 0x0201, - WM_LBUTTONUP = 0x0202, - WM_LBUTTONDBLCLK = 0x0203, - WM_RBUTTONDOWN = 0x0204, - WM_RBUTTONUP = 0x0205, - WM_RBUTTONDBLCLK = 0x0206, - WM_MBUTTONDOWN = 0x0207, - WM_MBUTTONUP = 0x0208, - WM_MBUTTONDBLCLK = 0x0209, - WM_MOUSEWHEEL = 0x020A, - WM_XBUTTONDOWN = 0x020B, - WM_XBUTTONUP = 0x020C, - WM_XBUTTONDBLCLK = 0x020D, - WM_PARENTNOTIFY = 0x0210, - WM_ENTERMENULOOP = 0x0211, - WM_EXITMENULOOP = 0x0212, - WM_NEXTMENU = 0x0213, - WM_SIZING = 0x0214, - WM_CAPTURECHANGED = 0x0215, - WM_MOVING = 0x0216, - WM_DEVICECHANGE = 0x0219, - WM_MDICREATE = 0x0220, - WM_MDIDESTROY = 0x0221, - WM_MDIACTIVATE = 0x0222, - WM_MDIRESTORE = 0x0223, - WM_MDINEXT = 0x0224, - WM_MDIMAXIMIZE = 0x0225, - WM_MDITILE = 0x0226, - WM_MDICASCADE = 0x0227, - WM_MDIICONARRANGE = 0x0228, - WM_MDIGETACTIVE = 0x0229, - WM_MDISETMENU = 0x0230, - WM_ENTERSIZEMOVE = 0x0231, - WM_EXITSIZEMOVE = 0x0232, - WM_DROPFILES = 0x0233, - WM_MDIREFRESHMENU = 0x0234, - WM_IME_SETCONTEXT = 0x0281, - WM_IME_NOTIFY = 0x0282, - WM_IME_CONTROL = 0x0283, - WM_IME_COMPOSITIONFULL = 0x0284, - WM_IME_SELECT = 0x0285, - WM_IME_CHAR = 0x0286, - WM_IME_REQUEST = 0x0288, - WM_IME_KEYDOWN = 0x0290, - WM_IME_KEYUP = 0x0291, - WM_MOUSEHOVER = 0x02A1, - WM_MOUSELEAVE = 0x02A3, - WM_CUT = 0x0300, - WM_COPY = 0x0301, - WM_PASTE = 0x0302, - WM_CLEAR = 0x0303, - WM_UNDO = 0x0304, - WM_RENDERFORMAT = 0x0305, - WM_RENDERALLFORMATS = 0x0306, - WM_DESTROYCLIPBOARD = 0x0307, - WM_DRAWCLIPBOARD = 0x0308, - WM_PAINTCLIPBOARD = 0x0309, - WM_VSCROLLCLIPBOARD = 0x030A, - WM_SIZECLIPBOARD = 0x030B, - WM_ASKCBFORMATNAME = 0x030C, - WM_CHANGECBCHAIN = 0x030D, - WM_HSCROLLCLIPBOARD = 0x030E, - WM_QUERYNEWPALETTE = 0x030F, - WM_PALETTEISCHANGING = 0x0310, - WM_PALETTECHANGED = 0x0311, - WM_HOTKEY = 0x0312, - WM_PRINT = 0x0317, - WM_PRINTCLIENT = 0x0318, - WM_HANDHELDFIRST = 0x0358, - WM_HANDHELDLAST = 0x035F, - WM_AFXFIRST = 0x0360, - WM_AFXLAST = 0x037F, - WM_PENWINFIRST = 0x0380, - WM_PENWINLAST = 0x038F, - WM_APP = 0x8000, - WM_USER = 0x0400, + WmNull = 0x0000, + WmCreate = 0x0001, + WmDestroy = 0x0002, + WmMove = 0x0003, + WmSize = 0x0005, + WmActivate = 0x0006, + WmSetfocus = 0x0007, + WmKillfocus = 0x0008, + WmEnable = 0x000A, + WmSetredraw = 0x000B, + WmSettext = 0x000C, + WmGettext = 0x000D, + WmGettextlength = 0x000E, + WmPaint = 0x000F, + WmClose = 0x0010, + WmQueryendsession = 0x0011, + WmQuit = 0x0012, + WmQueryopen = 0x0013, + WmErasebkgnd = 0x0014, + WmSyscolorchange = 0x0015, + WmEndsession = 0x0016, + WmShowwindow = 0x0018, + WmWininichange = 0x001A, + WmSettingchange = 0x001A, + WmDevmodechange = 0x001B, + WmActivateapp = 0x001C, + WmFontchange = 0x001D, + WmTimechange = 0x001E, + WmCancelmode = 0x001F, + WmSetcursor = 0x0020, + WmMouseactivate = 0x0021, + WmChildactivate = 0x0022, + WmQueuesync = 0x0023, + WmGetminmaxinfo = 0x0024, + WmPainticon = 0x0026, + WmIconerasebkgnd = 0x0027, + WmNextdlgctl = 0x0028, + WmSpoolerstatus = 0x002A, + WmDrawitem = 0x002B, + WmMeasureitem = 0x002C, + WmDeleteitem = 0x002D, + WmVkeytoitem = 0x002E, + WmChartoitem = 0x002F, + WmSetfont = 0x0030, + WmGetfont = 0x0031, + WmSethotkey = 0x0032, + WmGethotkey = 0x0033, + WmQuerydragicon = 0x0037, + WmCompareitem = 0x0039, + WmGetobject = 0x003D, + WmCompacting = 0x0041, + WmCommnotify = 0x0044, + WmWindowposchanging = 0x0046, + WmWindowposchanged = 0x0047, + WmPower = 0x0048, + WmCopydata = 0x004A, + WmCanceljournal = 0x004B, + WmNotify = 0x004E, + WmInputlangchangerequest = 0x0050, + WmInputlangchange = 0x0051, + WmTcard = 0x0052, + WmHelp = 0x0053, + WmUserchanged = 0x0054, + WmNotifyformat = 0x0055, + WmContextmenu = 0x007B, + WmStylechanging = 0x007C, + WmStylechanged = 0x007D, + WmDisplaychange = 0x007E, + WmGeticon = 0x007F, + WmSeticon = 0x0080, + WmNccreate = 0x0081, + WmNcdestroy = 0x0082, + WmNccalcsize = 0x0083, + WmNchittest = 0x0084, + WmNcpaint = 0x0085, + WmNcactivate = 0x0086, + WmGetdlgcode = 0x0087, + WmSyncpaint = 0x0088, + WmNcmousemove = 0x00A0, + WmNclbuttondown = 0x00A1, + WmNclbuttonup = 0x00A2, + WmNclbuttondblclk = 0x00A3, + WmNcrbuttondown = 0x00A4, + WmNcrbuttonup = 0x00A5, + WmNcrbuttondblclk = 0x00A6, + WmNcmbuttondown = 0x00A7, + WmNcmbuttonup = 0x00A8, + WmNcmbuttondblclk = 0x00A9, + WmNcxbuttondown = 0x00AB, + WmNcxbuttonup = 0x00AC, + WmKeydown = 0x0100, + WmKeyup = 0x0101, + WmChar = 0x0102, + WmDeadchar = 0x0103, + WmSyskeydown = 0x0104, + WmSyskeyup = 0x0105, + WmSyschar = 0x0106, + WmSysdeadchar = 0x0107, + WmKeylast = 0x0108, + WmImeStartcomposition = 0x010D, + WmImeEndcomposition = 0x010E, + WmImeComposition = 0x010F, + WmImeKeylast = 0x010F, + WmInitdialog = 0x0110, + WmCommand = 0x0111, + WmSyscommand = 0x0112, + WmTimer = 0x0113, + WmHscroll = 0x0114, + WmVscroll = 0x0115, + WmInitmenu = 0x0116, + WmInitmenupopup = 0x0117, + WmMenuselect = 0x011F, + WmMenuchar = 0x0120, + WmEnteridle = 0x0121, + WmMenurbuttonup = 0x0122, + WmMenudrag = 0x0123, + WmMenugetobject = 0x0124, + WmUninitmenupopup = 0x0125, + WmMenucommand = 0x0126, + WmCtlcolormsgbox = 0x0132, + WmCtlcoloredit = 0x0133, + WmCtlcolorlistbox = 0x0134, + WmCtlcolorbtn = 0x0135, + WmCtlcolordlg = 0x0136, + WmCtlcolorscrollbar = 0x0137, + WmCtlcolorstatic = 0x0138, + WmMousemove = 0x0200, + WmLbuttondown = 0x0201, + WmLbuttonup = 0x0202, + WmLbuttondblclk = 0x0203, + WmRbuttondown = 0x0204, + WmRbuttonup = 0x0205, + WmRbuttondblclk = 0x0206, + WmMbuttondown = 0x0207, + WmMbuttonup = 0x0208, + WmMbuttondblclk = 0x0209, + WmMousewheel = 0x020A, + WmXbuttondown = 0x020B, + WmXbuttonup = 0x020C, + WmXbuttondblclk = 0x020D, + WmParentnotify = 0x0210, + WmEntermenuloop = 0x0211, + WmExitmenuloop = 0x0212, + WmNextmenu = 0x0213, + WmSizing = 0x0214, + WmCapturechanged = 0x0215, + WmMoving = 0x0216, + WmDevicechange = 0x0219, + WmMdicreate = 0x0220, + WmMdidestroy = 0x0221, + WmMdiactivate = 0x0222, + WmMdirestore = 0x0223, + WmMdinext = 0x0224, + WmMdimaximize = 0x0225, + WmMditile = 0x0226, + WmMdicascade = 0x0227, + WmMdiiconarrange = 0x0228, + WmMdigetactive = 0x0229, + WmMdisetmenu = 0x0230, + WmEntersizemove = 0x0231, + WmExitsizemove = 0x0232, + WmDropfiles = 0x0233, + WmMdirefreshmenu = 0x0234, + WmImeSetcontext = 0x0281, + WmImeNotify = 0x0282, + WmImeControl = 0x0283, + WmImeCompositionfull = 0x0284, + WmImeSelect = 0x0285, + WmImeChar = 0x0286, + WmImeRequest = 0x0288, + WmImeKeydown = 0x0290, + WmImeKeyup = 0x0291, + WmMousehover = 0x02A1, + WmMouseleave = 0x02A3, + WmCut = 0x0300, + WmCopy = 0x0301, + WmPaste = 0x0302, + WmClear = 0x0303, + WmUndo = 0x0304, + WmRenderformat = 0x0305, + WmRenderallformats = 0x0306, + WmDestroyclipboard = 0x0307, + WmDrawclipboard = 0x0308, + WmPaintclipboard = 0x0309, + WmVscrollclipboard = 0x030A, + WmSizeclipboard = 0x030B, + WmAskcbformatname = 0x030C, + WmChangecbchain = 0x030D, + WmHscrollclipboard = 0x030E, + WmQuerynewpalette = 0x030F, + WmPaletteischanging = 0x0310, + WmPalettechanged = 0x0311, + WmHotkey = 0x0312, + WmPrint = 0x0317, + WmPrintclient = 0x0318, + WmHandheldfirst = 0x0358, + WmHandheldlast = 0x035F, + WmAfxfirst = 0x0360, + WmAfxlast = 0x037F, + WmPenwinfirst = 0x0380, + WmPenwinlast = 0x038F, + WmApp = 0x8000, + WmUser = 0x0400, // For Windows XP Balloon messages from the System Notification Area - NIN_BALLOONSHOW = 0x0402, - NIN_BALLOONHIDE = 0x0403, - NIN_BALLOONTIMEOUT = 0x0404, - NIN_BALLOONUSERCLICK = 0x0405 + NinBalloonshow = 0x0402, + NinBalloonhide = 0x0403, + NinBalloontimeout = 0x0404, + NinBalloonuserclick = 0x0405 } #region SubClass Classing Handler Class @@ -390,23 +390,23 @@ internal class SubClass : System.Windows.Forms.NativeWindow { public delegate int SubClassWndProcEventHandler(ref System.Windows.Forms.Message m); public event SubClassWndProcEventHandler SubClassedWndProc; - private bool IsSubClassed = false; + private bool _isSubClassed = false; - public SubClass(IntPtr Handle, bool _SubClass) + public SubClass(IntPtr handle, bool subClass) { - base.AssignHandle(Handle); - this.IsSubClassed = _SubClass; + base.AssignHandle(handle); + this._isSubClassed = subClass; } public bool SubClassed { - get => this.IsSubClassed; - set => this.IsSubClassed = value; + get => this._isSubClassed; + set => this._isSubClassed = value; } protected override void WndProc(ref Message m) { - if (this.IsSubClassed) + if (this._isSubClassed) { if (OnSubClassedWndProc(ref m) != 0) { @@ -422,30 +422,30 @@ public void CallDefaultWndProc(ref Message m) } #region HiWord Message Cracker - public int HiWord(int Number) + public int HiWord(int number) { - return ((Number >> 16) & 0xffff); + return (number >> 16) & 0xffff; } #endregion #region LoWord Message Cracker - public int LoWord(int Number) + public int LoWord(int number) { - return (Number & 0xffff); + return number & 0xffff; } #endregion #region MakeLong Message Cracker - public int MakeLong(int LoWord, int HiWord) + public int MakeLong(int loWord, int hiWord) { - return (HiWord << 16) | (LoWord & 0xffff); + return (hiWord << 16) | (loWord & 0xffff); } #endregion #region MakeLParam Message Cracker - public IntPtr MakeLParam(int LoWord, int HiWord) + public IntPtr MakeLParam(int loWord, int hiWord) { - return (IntPtr)((HiWord << 16) | (LoWord & 0xffff)); + return (IntPtr)((hiWord << 16) | (loWord & 0xffff)); } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Controls Toolkit/KryptonComboBoxTree.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Controls Toolkit/KryptonComboBoxTree.cs index 0569a8545..6d305009a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Controls Toolkit/KryptonComboBoxTree.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Controls Toolkit/KryptonComboBoxTree.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,7 +25,6 @@ */ #endregion -#pragma warning disable CS8622 namespace Krypton.Toolkit.Suite.Extended.ComboBox { public delegate void NodeSelectEventHandler(); @@ -37,40 +36,40 @@ namespace Krypton.Toolkit.Suite.Extended.ComboBox public sealed class KryptonComboBoxTree : Control { #region Private Fields - private KryptonPanel pnlBack; - private Panel pnlTree; - private KryptonComboBox combobox; - private KryptonTreeView tvTreeView; - private LabelEx lblSizingGrip; - private Form frmTreeView; + private KryptonPanel _pnlBack; + private Panel _pnlTree; + private KryptonComboBox _combobox; + private KryptonTreeView _tvTreeView; + private LabelEx _lblSizingGrip; + private Form _frmTreeView; private string _branchSeparator; private bool _absoluteChildrenSelectableOnly; - private Point DragOffset; + private Point _dragOffset; #endregion #region Public Properties [Browsable(true), Description("Gets the TreeView Nodes collection"), Category("TreeView"), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Editor(typeof(TreeNodeCollection), typeof(TreeNodeCollection))] - public TreeNodeCollection Nodes => tvTreeView.Nodes; + public TreeNodeCollection Nodes => _tvTreeView.Nodes; [Browsable(true), Description("Gets or sets the TreeView's Selected Node"), Category("TreeView")] public TreeNode SelectedNode { set { - tvTreeView.SelectedNode = value; + _tvTreeView.SelectedNode = value; TreeViewNodeSelect(null, null); } - get => tvTreeView.SelectedNode; + get => _tvTreeView.SelectedNode; } [Browsable(false)] - public KryptonComboBox ComboBox { get => combobox; set => combobox = value; } + public KryptonComboBox ComboBox { get => _combobox; set => _combobox = value; } [Browsable(true), Description("Gets or sets the TreeView's Selected Node"), Category("TreeView")] - public ImageList? Imagelist { get => tvTreeView.ImageList; set => tvTreeView.ImageList = value; } + public ImageList? Imagelist { get => _tvTreeView.ImageList; set => _tvTreeView.ImageList = value; } [Browsable(true), Description("Gets or sets the separator for the selected node's value"), Category("Appearance")] public string BranchSeparator @@ -96,50 +95,50 @@ public KryptonComboBoxTree() InitializeComponent(); // Initializing Controls - pnlBack = new KryptonPanel(); - pnlBack.BorderStyle = BorderStyle.None; - pnlBack.Dock = DockStyle.Fill; - pnlBack.AutoScroll = false; + _pnlBack = new KryptonPanel(); + _pnlBack.BorderStyle = BorderStyle.None; + _pnlBack.Dock = DockStyle.Fill; + _pnlBack.AutoScroll = false; //pnlBack.BackColor = txtSelectedValue.BackColor; - lblSizingGrip = new LabelEx(); - lblSizingGrip.Size = new Size(9, 9); - lblSizingGrip.Cursor = Cursors.SizeNWSE; - lblSizingGrip.Text = ""; - lblSizingGrip.MouseMove += new MouseEventHandler(SizingGripMouseMove); - lblSizingGrip.MouseDown += new MouseEventHandler(SizingGripMouseDown); - - tvTreeView = new KryptonTreeView(); - tvTreeView.BorderStyle = PaletteBorderStyle.ControlClient; - tvTreeView.DoubleClick += new EventHandler(TreeViewNodeSelect); - tvTreeView.Location = new Point(0, 0); - tvTreeView.LostFocus += new EventHandler(TreeViewLostFocus); + _lblSizingGrip = new LabelEx(); + _lblSizingGrip.Size = new Size(9, 9); + _lblSizingGrip.Cursor = Cursors.SizeNWSE; + _lblSizingGrip.Text = ""; + _lblSizingGrip.MouseMove += new MouseEventHandler(SizingGripMouseMove); + _lblSizingGrip.MouseDown += new MouseEventHandler(SizingGripMouseDown); + + _tvTreeView = new KryptonTreeView(); + _tvTreeView.BorderStyle = PaletteBorderStyle.ControlClient; + _tvTreeView.DoubleClick += new EventHandler(TreeViewNodeSelect); + _tvTreeView.Location = new Point(0, 0); + _tvTreeView.LostFocus += new EventHandler(TreeViewLostFocus); //tvTreeView.Scrollable = false; - frmTreeView = new Form(); - frmTreeView.FormBorderStyle = FormBorderStyle.None; - frmTreeView.StartPosition = FormStartPosition.Manual; - frmTreeView.ShowInTaskbar = false; + _frmTreeView = new Form(); + _frmTreeView.FormBorderStyle = FormBorderStyle.None; + _frmTreeView.StartPosition = FormStartPosition.Manual; + _frmTreeView.ShowInTaskbar = false; - pnlTree = new Panel(); - pnlTree.Dock = DockStyle.Fill; - pnlTree.BorderStyle = BorderStyle.FixedSingle; - pnlTree.BackColor = Color.White; + _pnlTree = new Panel(); + _pnlTree.Dock = DockStyle.Fill; + _pnlTree.BorderStyle = BorderStyle.FixedSingle; + _pnlTree.BackColor = Color.White; - combobox = new KryptonComboBox(); - combobox.DropDownStyle = ComboBoxStyle.DropDownList; - combobox.Dock = DockStyle.Fill; - combobox.ComboBox.Click += new EventHandler(ToggleTreeView); + _combobox = new KryptonComboBox(); + _combobox.DropDownStyle = ComboBoxStyle.DropDownList; + _combobox.Dock = DockStyle.Fill; + _combobox.ComboBox.Click += new EventHandler(ToggleTreeView); // Adding Controls to UserControl - pnlTree.Controls.Add(lblSizingGrip); - pnlTree.Controls.Add(tvTreeView); - frmTreeView.Controls.Add(pnlTree); - pnlBack.Controls.Add(combobox); - Controls.Add(pnlBack); + _pnlTree.Controls.Add(_lblSizingGrip); + _pnlTree.Controls.Add(_tvTreeView); + _frmTreeView.Controls.Add(_pnlTree); + _pnlBack.Controls.Add(_combobox); + Controls.Add(_pnlBack); } - public KryptonTreeView TreeView => tvTreeView; + public KryptonTreeView TreeView => _tvTreeView; private void txtSelectedValue_Click(object sender, EventArgs e) { @@ -148,41 +147,41 @@ private void txtSelectedValue_Click(object sender, EventArgs e) private void RelocateGrip() { - lblSizingGrip.Top = frmTreeView.Height - lblSizingGrip.Height - 1; - lblSizingGrip.Left = frmTreeView.Width - lblSizingGrip.Width - 1; + _lblSizingGrip.Top = _frmTreeView.Height - _lblSizingGrip.Height - 1; + _lblSizingGrip.Left = _frmTreeView.Width - _lblSizingGrip.Width - 1; } private void ToggleTreeView(object? sender, EventArgs? e) { - if (!frmTreeView.Visible) + if (!_frmTreeView.Visible) { Rectangle cbRect = RectangleToScreen(ClientRectangle); - frmTreeView.Location = new Point(cbRect.X, cbRect.Y + pnlBack.Height); + _frmTreeView.Location = new Point(cbRect.X, cbRect.Y + _pnlBack.Height); - frmTreeView.Show(); - frmTreeView.BringToFront(); + _frmTreeView.Show(); + _frmTreeView.BringToFront(); RelocateGrip(); //tbSelectedValue.Text = ""; } else { - frmTreeView.Hide(); + _frmTreeView.Hide(); } } public bool ValidateText() { string validatorText = Text; - TreeNodeCollection nodes = tvTreeView.Nodes; + TreeNodeCollection nodes = _tvTreeView.Nodes; for (int i = 0; i < validatorText.Split(_branchSeparator.ToCharArray()[0]).Length; i++) { bool nodeFound = false; - string NodeToFind = validatorText.Split(_branchSeparator.ToCharArray()[0])[i]; + string nodeToFind = validatorText.Split(_branchSeparator.ToCharArray()[0])[i]; for (int j = 0; j < nodes.Count; j++) { - if (nodes[j].Text == NodeToFind) + if (nodes[j].Text == nodeToFind) { nodeFound = true; nodes = nodes[j].Nodes; @@ -204,25 +203,25 @@ private void SizingGripMouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { - int TvWidth, TvHeight; - TvWidth = Cursor.Position.X - frmTreeView.Location.X; - TvWidth = TvWidth + DragOffset.X; - TvHeight = Cursor.Position.Y - frmTreeView.Location.Y; - TvHeight = TvHeight + DragOffset.Y; + int tvWidth, tvHeight; + tvWidth = Cursor.Position.X - _frmTreeView.Location.X; + tvWidth = tvWidth + _dragOffset.X; + tvHeight = Cursor.Position.Y - _frmTreeView.Location.Y; + tvHeight = tvHeight + _dragOffset.Y; - if (TvWidth < 50) + if (tvWidth < 50) { - TvWidth = 50; + tvWidth = 50; } - if (TvHeight < 50) + if (tvHeight < 50) { - TvHeight = 50; + tvHeight = 50; } - frmTreeView.Size = new Size(TvWidth, TvHeight); - pnlTree.Size = frmTreeView.Size; - tvTreeView.Size = new Size(frmTreeView.Size.Width - lblSizingGrip.Width, frmTreeView.Size.Height - lblSizingGrip.Width); ; + _frmTreeView.Size = new Size(tvWidth, tvHeight); + _pnlTree.Size = _frmTreeView.Size; + _tvTreeView.Size = new Size(_frmTreeView.Size.Width - _lblSizingGrip.Width, _frmTreeView.Size.Height - _lblSizingGrip.Width); ; RelocateGrip(); } } @@ -231,10 +230,10 @@ private void SizingGripMouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { - int OffsetX = Math.Abs(Cursor.Position.X - frmTreeView.RectangleToScreen(frmTreeView.ClientRectangle).Right); - int OffsetY = Math.Abs(Cursor.Position.Y - frmTreeView.RectangleToScreen(frmTreeView.ClientRectangle).Bottom); + int offsetX = Math.Abs(Cursor.Position.X - _frmTreeView.RectangleToScreen(_frmTreeView.ClientRectangle).Right); + int offsetY = Math.Abs(Cursor.Position.Y - _frmTreeView.RectangleToScreen(_frmTreeView.ClientRectangle).Bottom); - DragOffset = new Point(OffsetX, OffsetY); + _dragOffset = new Point(offsetX, offsetY); } } @@ -242,36 +241,36 @@ private void TreeViewLostFocus(object sender, EventArgs e) { if (!IsDisposed && Created) { - if (!combobox.RectangleToScreen(combobox.ClientRectangle).Contains(Cursor.Position)) + if (!_combobox.RectangleToScreen(_combobox.ClientRectangle).Contains(Cursor.Position)) { - frmTreeView.Hide(); + _frmTreeView.Hide(); } } } private void TreeViewNodeSelect(object? sender, EventArgs? e) { - if (tvTreeView.SelectedNode != null) + if (_tvTreeView.SelectedNode != null) { if (_absoluteChildrenSelectableOnly) { - if (tvTreeView.SelectedNode.Nodes.Count == 0) + if (_tvTreeView.SelectedNode.Nodes.Count == 0) { - combobox.Items.Clear(); - combobox.Items.Add(tvTreeView.SelectedNode.FullPath.Replace(@"\", _branchSeparator)); - combobox.SelectedIndex = 0; + _combobox.Items.Clear(); + _combobox.Items.Add(_tvTreeView.SelectedNode.FullPath.Replace(@"\", _branchSeparator)); + _combobox.SelectedIndex = 0; ToggleTreeView(sender, null); } } else { - combobox.Items.Clear(); - combobox.Items.Add(tvTreeView.SelectedNode.FullPath.Replace(@"\", _branchSeparator)); - combobox.SelectedIndex = 0; + _combobox.Items.Clear(); + _combobox.Items.Add(_tvTreeView.SelectedNode.FullPath.Replace(@"\", _branchSeparator)); + _combobox.SelectedIndex = 0; ToggleTreeView(sender, null); } - combobox.Text = tvTreeView.SelectedNode.Text; + _combobox.Text = _tvTreeView.SelectedNode.Text; } } @@ -289,12 +288,12 @@ private void InitializeComponent() private void ComboBoxTree_Layout(object sender, LayoutEventArgs e) { //Height = combobox.Height + 10; - pnlBack.Size = new Size(Width, Height - 2); + _pnlBack.Size = new Size(Width, Height - 2); - frmTreeView.Size = new Size(Width, tvTreeView.Height + 30); - pnlTree.Size = frmTreeView.Size; - tvTreeView.Width = frmTreeView.Width - lblSizingGrip.Width; - tvTreeView.Height = frmTreeView.Height - lblSizingGrip.Width; + _frmTreeView.Size = new Size(Width, _tvTreeView.Height + 30); + _pnlTree.Size = _frmTreeView.Size; + _tvTreeView.Width = _frmTreeView.Width - _lblSizingGrip.Width; + _tvTreeView.Height = _frmTreeView.Height - _lblSizingGrip.Width; RelocateGrip(); } @@ -326,7 +325,7 @@ protected override void OnPaint(PaintEventArgs e) #region ButtonEx private class ButtonEx : KryptonButton { - private ButtonState state; + private ButtonState _state; /// /// @@ -342,7 +341,7 @@ public ButtonEx() /// protected override void OnMouseDown(MouseEventArgs e) { - state = ButtonState.Flat; + _state = ButtonState.Flat; base.OnMouseDown(e); } @@ -352,7 +351,7 @@ protected override void OnMouseDown(MouseEventArgs e) /// protected override void OnMouseUp(MouseEventArgs e) { - state = ButtonState.Normal; + _state = ButtonState.Normal; base.OnMouseUp(e); } @@ -360,11 +359,11 @@ protected override void OnMouseUp(MouseEventArgs e) /// /// /// - protected override void OnPaint(PaintEventArgs e) + protected override void OnPaint(PaintEventArgs? e) { base.OnPaint(e); - ControlPaint.DrawComboButton(e.Graphics, e.ClipRectangle, state); + ControlPaint.DrawComboButton(e?.Graphics!, e!.ClipRectangle, _state); } } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Globals/GlobalDeclarations.cs index 3c510d6d9..7d54fa29a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Krypton.Toolkit.Suite.Extended.ComboBox 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Krypton.Toolkit.Suite.Extended.ComboBox 2022.csproj index 2bc0e92b6..ecb5d4ad5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Krypton.Toolkit.Suite.Extended.ComboBox 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Krypton.Toolkit.Suite.Extended.ComboBox 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements extensions to the Krypton standard toolkit ComboBox, including additional Drop Down types and views. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements extensions to the Krypton standard toolkit ComboBox, including additional Drop Down types and views. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,74 +69,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Krypton.Toolkit.Suite.Extended.ComboBox.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Krypton.Toolkit.Suite.Extended.ComboBox.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Krypton.Toolkit.Suite.Extended.ComboBox.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Krypton.Toolkit.Suite.Extended.ComboBox.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/AnimationFunctions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/AnimationFunctions.cs index d0012e2f0..fe6ff3525 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/AnimationFunctions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/AnimationFunctions.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/AnimationPath.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/AnimationPath.cs index fd8c99800..096b7c7b0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/AnimationPath.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/AnimationPath.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/AnimationTimer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/AnimationTimer.cs index 315a0e0fb..18e37ec0b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/AnimationTimer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/AnimationTimer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -105,7 +105,7 @@ public AnimationTimer(Action callback, int fpsLimit) private void Tick() { - if ((1000 / FrameLimiter) < (GetTimeDifferenceAsMs() - LastTick)) + if (1000 / FrameLimiter < GetTimeDifferenceAsMs() - LastTick) { LastTick = GetTimeDifferenceAsMs(); _callback((ulong)(LastTick - FirstTick)); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Animator.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Animator.cs index 3e2488de9..e7e066343 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Animator.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Animator.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -49,7 +49,7 @@ public class Animator : IAnimator /// /// The callback to get invoked at the end of the animation /// - protected SafeInvoker EndCallback; + protected SafeInvoker? EndCallback; /// /// The callback to get invoked at each frame @@ -212,7 +212,7 @@ public virtual void Play(object targetObject, string propertyName) /// /// The callback to get invoked at the end of the animation /// - public virtual void Play(object targetObject, string propertyName, SafeInvoker endCallback) + public virtual void Play(object targetObject, string propertyName, SafeInvoker? endCallback) { TargetObject = targetObject; var prop = TargetObject.GetType() @@ -244,7 +244,7 @@ public virtual void Play(object targetObject, string propertyName, SafeInvoker e /// /// Any object containing a property /// - public virtual void Play(T targetObject, Expression> propertySetter) + public virtual void Play(T targetObject, Expression>? propertySetter) { Play(targetObject, propertySetter, null); } @@ -265,7 +265,7 @@ public virtual void Play(T targetObject, Expression> property /// /// Any object containing a property /// - public virtual void Play(T targetObject, Expression> propertySetter, SafeInvoker endCallback) + public virtual void Play(T targetObject, Expression>? propertySetter, SafeInvoker? endCallback) { if (propertySetter == null) { @@ -275,8 +275,8 @@ public virtual void Play(T targetObject, Expression> property TargetObject = targetObject; var property = - ((propertySetter.Body as MemberExpression) ?? - (((UnaryExpression)propertySetter.Body).Operand as MemberExpression))?.Member as PropertyInfo; + (propertySetter.Body as MemberExpression ?? + ((UnaryExpression)propertySetter.Body).Operand as MemberExpression)?.Member as PropertyInfo; if (property == null) { throw new ArgumentException(nameof(propertySetter)); @@ -342,7 +342,7 @@ public virtual void Play(object targetObject, KnownProperties property) /// /// The callback to get invoked at the end of the animation /// - public virtual void Play(object targetObject, KnownProperties property, SafeInvoker endCallback) + public virtual void Play(object targetObject, KnownProperties property, SafeInvoker? endCallback) { Play(targetObject, property.ToString(), endCallback); } @@ -368,7 +368,7 @@ public virtual void Play(SafeInvoker frameCallback) /// /// The callback to get invoked at the end of the animation /// - public virtual void Play(SafeInvoker frameCallback, SafeInvoker endCallback) + public virtual void Play(SafeInvoker frameCallback, SafeInvoker? endCallback) { Stop(); FrameCallback = frameCallback; @@ -440,7 +440,7 @@ private void Elapsed(ulong millSinceBeginning = 0) } } } - if (_tempReverseRepeat && (millSinceBeginning - ActivePath.Duration) < ActivePath.Delay) + if (_tempReverseRepeat && millSinceBeginning - ActivePath.Duration < ActivePath.Delay) { CurrentStatus = AnimatorStatus.OnHold; return; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Animator2D.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Animator2D.cs index ba78117cd..4bf24231e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Animator2D.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Animator2D.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,9 +26,6 @@ */ #endregion -using System.Collections.Generic; -using System.Linq.Expressions; - namespace Krypton.Toolkit.Suite.Extended.Common { /// @@ -40,10 +37,8 @@ public class Animator2D : IAnimator private readonly List _paths = new List(); - /// - /// The callback to get invoked at the end of the animation - /// - protected SafeInvoker EndCallback; + /// The callback to get invoked at the end of the animation. + protected SafeInvoker? EndCallback; /// /// The callback to get invoked at each frame @@ -241,7 +236,7 @@ public virtual AnimatorStatus CurrentStatus /// public virtual void Pause() { - if (CurrentStatus == AnimatorStatus.OnHold || CurrentStatus == AnimatorStatus.Playing) + if (CurrentStatus is AnimatorStatus.OnHold or AnimatorStatus.Playing) { HorizontalAnimator.Pause(); VerticalAnimator.Pause(); @@ -274,7 +269,7 @@ public virtual void Play(object targetObject, string propertyName) /// /// The callback to get invoked at the end of the animation /// - public virtual void Play(object targetObject, string propertyName, SafeInvoker endCallback) + public virtual void Play(object targetObject, string propertyName, SafeInvoker? endCallback) { TargetObject = targetObject; var prop = TargetObject.GetType() @@ -307,7 +302,7 @@ public virtual void Play(object targetObject, string propertyName, SafeInvoker e /// /// Any object containing a property /// - public virtual void Play(T targetObject, Expression> propertySetter) + public virtual void Play(T targetObject, Expression>? propertySetter) { Play(targetObject, propertySetter, null); } @@ -327,18 +322,18 @@ public virtual void Play(T targetObject, Expression> property /// /// Any object containing a property /// - public virtual void Play(T targetObject, Expression> propertySetter, SafeInvoker endCallback) + public virtual void Play(T targetObject, Expression>? propertySetter, SafeInvoker? endCallback) { if (propertySetter == null) { return; } - TargetObject = targetObject; + TargetObject = targetObject ?? throw new ArgumentNullException(nameof(targetObject)); var property = - ((propertySetter.Body as MemberExpression) ?? - (((UnaryExpression)propertySetter.Body).Operand as MemberExpression))?.Member as PropertyInfo; + (propertySetter.Body as MemberExpression ?? + ((UnaryExpression)propertySetter.Body).Operand as MemberExpression)?.Member as PropertyInfo; if (property == null) { throw new ArgumentException(nameof(propertySetter)); @@ -401,7 +396,7 @@ public void Play(object targetObject, KnownFormProperties property) /// /// The callback to get invoked at the end of the animation /// - public void Play(object targetObject, KnownFormProperties property, SafeInvoker endCallback) + public void Play(object targetObject, KnownFormProperties property, SafeInvoker? endCallback) { Play(targetObject, property.ToString(), endCallback); } @@ -412,10 +407,7 @@ public void Play(object targetObject, KnownFormProperties property, SafeInvoker /// /// The callback to get invoked at each frame /// - public void Play(SafeInvoker frameCallback) - { - Play(frameCallback, (SafeInvoker)null); - } + public void Play(SafeInvoker frameCallback) => Play(frameCallback, (SafeInvoker)null); /// /// Starts the playing of the animation @@ -426,7 +418,7 @@ public void Play(SafeInvoker frameCallback) /// /// The callback to get invoked at the end of the animation /// - public void Play(SafeInvoker frameCallback, SafeInvoker endCallback) + public void Play(SafeInvoker frameCallback, SafeInvoker? endCallback) { Stop(); FrameCallback = frameCallback; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Animator3D.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Animator3D.cs index 107342b10..fffa3a4f8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Animator3D.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Animator3D.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -42,7 +42,7 @@ public class Animator3D : IAnimator /// /// The callback to get invoked at the end of the animation /// - protected SafeInvoker EndCallback; + protected SafeInvoker? EndCallback; /// /// The callback to get invoked at each frame @@ -265,7 +265,7 @@ public virtual AnimatorStatus CurrentStatus /// public virtual void Pause() { - if (CurrentStatus == AnimatorStatus.OnHold || CurrentStatus == AnimatorStatus.Playing) + if (CurrentStatus is AnimatorStatus.OnHold or AnimatorStatus.Playing) { HorizontalAnimator.Pause(); VerticalAnimator.Pause(); @@ -299,7 +299,7 @@ public virtual void Play(object targetObject, string propertyName) /// /// The callback to get invoked at the end of the animation /// - public virtual void Play(object targetObject, string propertyName, SafeInvoker endCallback) + public virtual void Play(object targetObject, string propertyName, SafeInvoker? endCallback) { TargetObject = targetObject; var prop = TargetObject.GetType() @@ -332,7 +332,7 @@ public virtual void Play(object targetObject, string propertyName, SafeInvoker e /// /// Any object containing a property /// - public virtual void Play(T targetObject, Expression> propertySetter) + public virtual void Play(T targetObject, Expression>? propertySetter) { Play(targetObject, propertySetter, null); } @@ -352,7 +352,7 @@ public virtual void Play(T targetObject, Expression> property /// /// Any object containing a property /// - public virtual void Play(T targetObject, Expression> propertySetter, SafeInvoker endCallback) + public virtual void Play(T targetObject, Expression>? propertySetter, SafeInvoker? endCallback) { if (propertySetter == null) { @@ -362,8 +362,8 @@ public virtual void Play(T targetObject, Expression> property TargetObject = targetObject; var property = - ((propertySetter.Body as MemberExpression) ?? - (((UnaryExpression)propertySetter.Body).Operand as MemberExpression))?.Member as PropertyInfo; + (propertySetter.Body as MemberExpression ?? + ((UnaryExpression)propertySetter.Body).Operand as MemberExpression)?.Member as PropertyInfo; if (property == null) { throw new ArgumentException(nameof(propertySetter)); @@ -427,7 +427,7 @@ public void Play(object targetObject, KnownColourProperties property) /// /// The callback to get invoked at the end of the animation /// - public void Play(object targetObject, KnownColourProperties property, SafeInvoker endCallback) + public void Play(object targetObject, KnownColourProperties property, SafeInvoker? endCallback) { Play(targetObject, property.ToString(), endCallback); } @@ -452,7 +452,7 @@ public void Play(SafeInvoker frameCallback) /// /// The callback to get invoked at the end of the animation /// - public void Play(SafeInvoker frameCallback, SafeInvoker endCallback) + public void Play(SafeInvoker frameCallback, SafeInvoker? endCallback) { Stop(); FrameCallback = frameCallback; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Float2D.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Float2D.cs index a3a6255bd..bcbecc07e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Float2D.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Float2D.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -508,7 +508,7 @@ public override int GetHashCode() return ReferenceEquals(left, null) && ReferenceEquals(right, null); } // ReSharper disable CompareOfFloatsByEqualityOperator - return ReferenceEquals(left, right) || ((double)(left.X) == right.X && (double)(left.Y) == right.Y); + return ReferenceEquals(left, right) || ((double)left.X == right.X && (double)left.Y == right.Y); // ReSharper restore CompareOfFloatsByEqualityOperator } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Float3D.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Float3D.cs index c810b140a..6482966ae 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Float3D.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Float3D.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -462,7 +462,7 @@ public override int GetHashCode() } // ReSharper disable CompareOfFloatsByEqualityOperator return ReferenceEquals(left, right) || - ((double)(left.X) == right.X && (double)(left.Y) == right.Y && (double)(left.Z) == right.Z); + ((double)left.X == right.X && (double)left.Y == right.Y && (double)left.Z == right.Z); // ReSharper restore CompareOfFloatsByEqualityOperator } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/FloatExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/FloatExtensions.cs index 9bd09b734..20c08e965 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/FloatExtensions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/FloatExtensions.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Path2D.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Path2D.cs index 11a0a4bfd..f20c5b8ab 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Path2D.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Path2D.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Path2DExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Path2DExtensions.cs index 8090d871b..301954524 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Path2DExtensions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Path2DExtensions.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Path3D.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Path3D.cs index ea46e403d..4e8c3a4b7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Path3D.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Path3D.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Path3DExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Path3DExtensions.cs index 9b18bbb9d..1110934b6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Path3DExtensions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/Path3DExtensions.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/PathExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/PathExtensions.cs index ab8b3b2e4..e7eaa438a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/PathExtensions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/PathExtensions.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/SafeInvoker.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/SafeInvoker.cs index 2e952f1fb..998ea3fbd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/SafeInvoker.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/SafeInvoker.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/SafeInvoker1.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/SafeInvoker1.cs index 6210d8dfc..8f4d0c52e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/SafeInvoker1.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Animation/SafeInvoker1.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Development/DevelopmentInformation.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Development/DevelopmentInformation.cs index 98e747e2a..352784366 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Development/DevelopmentInformation.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Development/DevelopmentInformation.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,9 +26,6 @@ */ #endregion -using System.Globalization; -using System.IO; - namespace Krypton.Toolkit.Suite.Extended.Common { public class DevelopmentInformation @@ -89,7 +86,7 @@ public static void SetBuildInformation(KryptonForm target, DevelopmentState stat } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } @@ -129,7 +126,7 @@ public static void SetBuildInformation(KryptonForm target, Assembly assembly, De } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Development/DevelopmentUtilities.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Development/DevelopmentUtilities.cs index 152ed6388..876f3c127 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Development/DevelopmentUtilities.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Development/DevelopmentUtilities.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Drawing/KryptonKnobUtilities.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Drawing/KryptonKnobUtilities.cs index cd933b9a1..b13bd6536 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Drawing/KryptonKnobUtilities.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Drawing/KryptonKnobUtilities.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/AssemblyDetails.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/AssemblyDetails.cs index e986cebcf..f129c8fe3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/AssemblyDetails.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/AssemblyDetails.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -42,7 +42,7 @@ public static T GetAssemblyAttribute(Assembly assembly) where T : Attribute object[] attributes = assembly.GetCustomAttributes(typeof(T), true); // If we didn't get anything, return null. - if ((attributes == null) || (attributes.Length == 0)) + if (attributes == null || attributes.Length == 0) { return null; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/CommonMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/CommonMethods.cs index 9a7e8ab29..46b333633 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/CommonMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/CommonMethods.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/DefaultToolkitTypefaceTypes.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/DefaultToolkitTypefaceTypes.cs index 9fa348d7e..041d2c7ea 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/DefaultToolkitTypefaceTypes.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/DefaultToolkitTypefaceTypes.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/GlobalValues.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/GlobalValues.cs index 9fe782600..e6a9dac0f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/GlobalValues.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/GlobalValues.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/IconExtractor.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/IconExtractor.cs index c3a5a4535..7bced3833 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/IconExtractor.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/IconExtractor.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/InternalKryptonMessageBoxExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/InternalKryptonMessageBoxExtended.cs index 708d66519..109d5fadb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/InternalKryptonMessageBoxExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/InternalKryptonMessageBoxExtended.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -49,14 +49,14 @@ private void InitialiseComponent() _button3 = new MessageButton(); _button1 = new MessageButton(); _button2 = new MessageButton(); - ((ISupportInitialize)(_panelMessage)).BeginInit(); + ((ISupportInitialize)_panelMessage).BeginInit(); _panelMessage.SuspendLayout(); - ((ISupportInitialize)(_panelMessageText)).BeginInit(); + ((ISupportInitialize)_panelMessageText).BeginInit(); _panelMessageText.SuspendLayout(); - ((ISupportInitialize)(_panelMessageIcon)).BeginInit(); + ((ISupportInitialize)_panelMessageIcon).BeginInit(); _panelMessageIcon.SuspendLayout(); - ((ISupportInitialize)(_messageIcon)).BeginInit(); - ((ISupportInitialize)(_panelButtons)).BeginInit(); + ((ISupportInitialize)_messageIcon).BeginInit(); + ((ISupportInitialize)_panelButtons).BeginInit(); _panelButtons.SuspendLayout(); SuspendLayout(); // @@ -198,15 +198,15 @@ private void InitialiseComponent() SizeGripStyle = SizeGripStyle.Hide; StartPosition = FormStartPosition.CenterParent; TopMost = true; - ((ISupportInitialize)(_panelMessage)).EndInit(); + ((ISupportInitialize)_panelMessage).EndInit(); _panelMessage.ResumeLayout(false); _panelMessage.PerformLayout(); - ((ISupportInitialize)(_panelMessageText)).EndInit(); + ((ISupportInitialize)_panelMessageText).EndInit(); _panelMessageText.ResumeLayout(false); - ((ISupportInitialize)(_panelMessageIcon)).EndInit(); + ((ISupportInitialize)_panelMessageIcon).EndInit(); _panelMessageIcon.ResumeLayout(false); - ((ISupportInitialize)(_messageIcon)).EndInit(); - ((ISupportInitialize)(_panelButtons)).EndInit(); + ((ISupportInitialize)_messageIcon).EndInit(); + ((ISupportInitialize)_panelButtons).EndInit(); _panelButtons.ResumeLayout(false); _panelButtons.PerformLayout(); ResumeLayout(false); @@ -353,10 +353,10 @@ protected override void WndProc(ref Message m) if (IgnoreAltF4) { // Extract the keys being pressed - Keys keys = ((Keys)((int)m.WParam.ToInt64())); + Keys keys = (Keys)(int)m.WParam.ToInt64(); // If the user standard combination ALT + F4 - if ((keys == Keys.F4) && ((ModifierKeys & Keys.Alt) == Keys.Alt)) + if (keys == Keys.F4 && (ModifierKeys & Keys.Alt) == Keys.Alt) { // Eat the message, so standard window proc does not close the window return; @@ -844,26 +844,26 @@ private static DialogResult InternalShow(IWin32Window owner, HelPlatformInvokenformation helPlatformInvokenformation, bool? showCtrlCopy, Font messageboxTypeface = null) { // 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)) + 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)) + 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 ((helPlatformInvokenformation != null) && ((options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) != 0)) + if (helPlatformInvokenformation != null && (options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) != 0) { throw new ArgumentException(@"Cannot show message box from a service with help specified", nameof(options)); } // If help information provided or we are not a service/default desktop application then grab an owner for showing the message box IWin32Window showOwner = null; - if ((helPlatformInvokenformation != null) || ((options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) == 0)) + if (helPlatformInvokenformation != 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 ?? FromHandle(PlatformInvoke.GetActiveWindow()); @@ -880,7 +880,7 @@ private static DialogResult InternalShow(IWin32Window owner, private void UpdateText() { - Text = (string.IsNullOrEmpty(_caption) ? string.Empty : _caption.Split(Environment.NewLine.ToCharArray())[0]); + Text = string.IsNullOrEmpty(_caption) ? string.Empty : _caption.Split(Environment.NewLine.ToCharArray())[0]; _messageText.StateCommon.Font = MessageBoxTypeface; _messageText.Text = _text; } @@ -950,14 +950,14 @@ private void UpdateButtons() switch (_buttons) { case MessageBoxButtons.OK: - _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + _button1.Text = KryptonManager.Strings.GeneralStrings.OK; _button1.DialogResult = DialogResult.OK; _button1.StateCommon.Content.ShortText.Font = MessageBoxTypeface; _button2.Visible = _button3.Visible = false; break; case MessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -965,8 +965,8 @@ private void UpdateButtons() _button3.Visible = false; break; case MessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -975,9 +975,9 @@ private void UpdateButtons() ControlBox = false; break; case MessageBoxButtons.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; @@ -986,8 +986,8 @@ private void UpdateButtons() _button3.StateCommon.Content.ShortText.Font = MessageBoxTypeface; break; case MessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -995,9 +995,9 @@ private void UpdateButtons() _button3.Visible = false; break; case MessageBoxButtons.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; @@ -1052,7 +1052,7 @@ private Size UpdateMessageSizing(IWin32Window showOwner) // 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.Width *= 2 / 3.0f; scaledMonitorSize.Height *= 0.95f; _messageText.UpdateFont(); SizeF messageSize = g.MeasureString(_text, _messageText.Font, scaledMonitorSize); @@ -1061,8 +1061,8 @@ private Size UpdateMessageSizing(IWin32Window showOwner) float messageXSize = Math.Max(messageSize.Width, captionSize.Width); // Work out DPlatformInvoke adjustment factor - float factorX = g.DpiX > 96 ? ((1.0f * g.DpiX) / 96) : 1.0f; - float factorY = g.DpiX > 96 ? ((1.0f * g.DpiX) / 96) : 1.0f; + float factorX = g.DpiX > 96 ? 1.0f * g.DpiX / 96 : 1.0f; + float factorY = g.DpiX > 96 ? 1.0f * g.DpiX / 96 : 1.0f; messageSize.Width = messageXSize * factorX; messageSize.Height = messageSize.Height * factorY; @@ -1171,23 +1171,23 @@ private Size UpdateButtonsSizing() _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 + GAP * (numButtons + 1), maxButtonSize.Height + GAP * 2); // Button area is the number of buttons with gaps between them and 10 PlatformInvokexels around all edges - return new Size((maxButtonSize.Width * numButtons) + (GAP * (numButtons + 1)), maxButtonSize.Height + (GAP * 2)); + return new Size(maxButtonSize.Width * numButtons + GAP * (numButtons + 1), maxButtonSize.Height + GAP * 2); } private void button_keyDown(object sender, KeyEventArgs e) { // Escape key kills the dialog if we allow it to be closed - if ((e.KeyCode == Keys.Escape) && ControlBox) + if (e.KeyCode == Keys.Escape && ControlBox) { Close(); } else { // Pressing Ctrl+C should copy message text into the clipboard - if ((e.Modifiers == Keys.Control) && (e.KeyCode == Keys.C)) + if (e.Modifiers == Keys.Control && e.KeyCode == Keys.C) { StringBuilder sb = new StringBuilder(); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/PaletteColourDefinitions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/PaletteColourDefinitions.cs index 7be1e0988..2a43feb06 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/PaletteColourDefinitions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/PaletteColourDefinitions.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/Utility.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/Utility.cs index a9d703fc6..62307e8bc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/Utility.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/Utility.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/UtilityMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/UtilityMethods.cs index eb0c4adba..dac911eb4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/UtilityMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/UtilityMethods.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -67,7 +67,7 @@ public static void ElevateProcessWithAdministrativeRights(string processName) } catch (Win32Exception wexc) { - ExceptionCapture.CaptureException(wexc); + DebugUtilities.NotImplemented(wexc.ToString()); } return; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/WIN32.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/WIN32.cs index 2ce6e3379..439509082 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/WIN32.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/General/WIN32.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -425,14 +425,14 @@ public void CallDefaultWndProc(ref Message m) #region HiWord Message Cracker public int HiWord(int Number) { - return ((Number >> 16) & 0xffff); + return (Number >> 16) & 0xffff; } #endregion #region LoWord Message Cracker public int LoWord(int Number) { - return (Number & 0xffff); + return Number & 0xffff; } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Helpers/AssemblyManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Helpers/AssemblyManager.cs index df6b0a578..f5ad34643 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Helpers/AssemblyManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Helpers/AssemblyManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Helpers/HashingHelper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Helpers/HashingHelper.cs index 3d46aaf07..6e9f03433 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Helpers/HashingHelper.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Helpers/HashingHelper.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -71,7 +71,7 @@ public static void PropagateHashInput(KryptonComboBox box) } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } @@ -189,7 +189,7 @@ public static void CancelBackgroundWorkerProgress(BackgroundWorker md5, Backgrou } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Helpers/OSHelper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Helpers/OSHelper.cs index 4e06661b7..86d0183d7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Helpers/OSHelper.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Helpers/OSHelper.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/IO/FileUtilities.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/IO/FileUtilities.cs index b6cab047c..e7cc02930 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/IO/FileUtilities.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/IO/FileUtilities.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -63,7 +63,7 @@ public static FileInfo GetFileInformation(string filePath) public static string GetReadableFileSize(long fileLength) { // Get absolute value - long absolute_i = (fileLength < 0 ? -fileLength : fileLength); + long absolute_i = fileLength < 0 ? -fileLength : fileLength; // Determine the suffix and readable value string suffix; @@ -74,31 +74,31 @@ public static string GetReadableFileSize(long fileLength) { suffix = "EB"; - readable = (fileLength >> 50); + readable = fileLength >> 50; } else if (absolute_i >= 0x4000000000000) // Petabyte { suffix = "PB"; - readable = (fileLength >> 40); + readable = fileLength >> 40; } else if (absolute_i >= 0x10000000000) // Terabyte { suffix = "TB"; - readable = (fileLength >> 30); + readable = fileLength >> 30; } else if (absolute_i >= 0x40000000) // Gigabyte { suffix = "GB"; - readable = (fileLength >> 20); + readable = fileLength >> 20; } else if (absolute_i >= 0x100000) // Megabyte { suffix = "MB"; - readable = (fileLength >> 10); + readable = fileLength >> 10; } else if (absolute_i >= 0x400) // Kilobyte { @@ -112,7 +112,7 @@ public static string GetReadableFileSize(long fileLength) } // Divide by 1024 to get fractional value - readable = (readable / 1024); + readable = readable / 1024; // Return formatted number with suffix return readable.ToString("0.### ") + suffix; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/IO/ShellIcon.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/IO/ShellIcon.cs index 477c030da..042d58094 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/IO/ShellIcon.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/IO/ShellIcon.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Internal/InternalExtendedKryptonMessageBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Internal/InternalExtendedKryptonMessageBox.cs index 7cc281b17..b392baa27 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Internal/InternalExtendedKryptonMessageBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Internal/InternalExtendedKryptonMessageBox.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -54,14 +54,14 @@ private void InitialiseComponent() _button1 = new MessageButton(); _button2 = new MessageButton(); _doNotShowAgainOption = new KryptonCheckBox(); - ((ISupportInitialize)(_panelMessage)).BeginInit(); + ((ISupportInitialize)_panelMessage).BeginInit(); _panelMessage.SuspendLayout(); - ((ISupportInitialize)(_panelMessageText)).BeginInit(); + ((ISupportInitialize)_panelMessageText).BeginInit(); _panelMessageText.SuspendLayout(); - ((ISupportInitialize)(_panelMessageIcon)).BeginInit(); + ((ISupportInitialize)_panelMessageIcon).BeginInit(); _panelMessageIcon.SuspendLayout(); - ((ISupportInitialize)(_messageIcon)).BeginInit(); - ((ISupportInitialize)(_panelButtons)).BeginInit(); + ((ISupportInitialize)_messageIcon).BeginInit(); + ((ISupportInitialize)_panelButtons).BeginInit(); _panelButtons.SuspendLayout(); SuspendLayout(); // @@ -216,15 +216,15 @@ private void InitialiseComponent() SizeGripStyle = SizeGripStyle.Hide; StartPosition = FormStartPosition.CenterParent; TopMost = true; - ((ISupportInitialize)(_panelMessage)).EndInit(); + ((ISupportInitialize)_panelMessage).EndInit(); _panelMessage.ResumeLayout(false); _panelMessage.PerformLayout(); - ((ISupportInitialize)(_panelMessageText)).EndInit(); + ((ISupportInitialize)_panelMessageText).EndInit(); _panelMessageText.ResumeLayout(false); - ((ISupportInitialize)(_panelMessageIcon)).EndInit(); + ((ISupportInitialize)_panelMessageIcon).EndInit(); _panelMessageIcon.ResumeLayout(false); - ((ISupportInitialize)(_messageIcon)).EndInit(); - ((ISupportInitialize)(_panelButtons)).EndInit(); + ((ISupportInitialize)_messageIcon).EndInit(); + ((ISupportInitialize)_panelButtons).EndInit(); _panelButtons.ResumeLayout(false); _panelButtons.PerformLayout(); ResumeLayout(false); @@ -454,10 +454,10 @@ protected override void WndProc(ref Message m) if (IgnoreAltF4) { // Extract the keys being pressed - Keys keys = ((Keys)((int)m.WParam.ToInt64())); + Keys keys = (Keys)(int)m.WParam.ToInt64(); // If the user standard combination ALT + F4 - if ((keys == Keys.F4) && ((ModifierKeys & Keys.Alt) == Keys.Alt)) + if (keys == Keys.F4 && (ModifierKeys & Keys.Alt) == Keys.Alt) { // Eat the message, so standard window proc does not close the window return; @@ -1045,26 +1045,26 @@ private static DialogResult InternalShow(IWin32Window owner, string button1Text = null, string button2Text = null, string button3Text = null) { // 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)) + 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)) + 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 ((helpInformation != null) && ((options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) != 0)) + if (helpInformation != null && (options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) != 0) { throw new ArgumentException(@"Cannot show message box from a service with help specified", nameof(options)); } // If help information provided or we are not a service/default desktop application then grab an owner for showing the message box IWin32Window showOwner = null; - if ((helpInformation != null) || ((options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) == 0)) + if (helpInformation != 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 ?? FromHandle(PlatformInvoke.GetActiveWindow()); @@ -1081,7 +1081,7 @@ private static DialogResult InternalShow(IWin32Window owner, private void UpdateText() { - Text = (string.IsNullOrEmpty(_caption) ? string.Empty : _caption.Split(Environment.NewLine.ToCharArray())[0]); + Text = string.IsNullOrEmpty(_caption) ? string.Empty : _caption.Split(Environment.NewLine.ToCharArray())[0]; _messageText.StateCommon.Font = MessageBoxTypeface; _messageText.Text = _text; } @@ -1151,14 +1151,14 @@ private void UpdateButtons() switch (_buttons) { case MessageBoxButtons.OK: - _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + _button1.Text = KryptonManager.Strings.GeneralStrings.OK; _button1.DialogResult = DialogResult.OK; _button1.StateCommon.Content.ShortText.Font = MessageBoxTypeface; _button2.Visible = _button3.Visible = false; break; case MessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -1166,8 +1166,8 @@ private void UpdateButtons() _button3.Visible = false; break; case MessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -1176,9 +1176,9 @@ private void UpdateButtons() ControlBox = false; break; case MessageBoxButtons.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; @@ -1187,8 +1187,8 @@ private void UpdateButtons() _button3.StateCommon.Content.ShortText.Font = MessageBoxTypeface; break; case MessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -1196,9 +1196,9 @@ private void UpdateButtons() _button3.Visible = false; break; case MessageBoxButtons.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; @@ -1223,14 +1223,14 @@ private void UpdateButtons(bool timeOutTimerEnabled, int timeOut, DialogResult d switch (_buttons) { case MessageBoxButtons.OK: - _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + _button1.Text = KryptonManager.Strings.GeneralStrings.OK; _button1.DialogResult = DialogResult.OK; _button1.StateCommon.Content.ShortText.Font = MessageBoxTypeface; _button2.Visible = _button3.Visible = false; break; case MessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -1238,8 +1238,8 @@ private void UpdateButtons(bool timeOutTimerEnabled, int timeOut, DialogResult d _button3.Visible = false; break; case MessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -1248,9 +1248,9 @@ private void UpdateButtons(bool timeOutTimerEnabled, int timeOut, DialogResult d ControlBox = false; break; case MessageBoxButtons.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; @@ -1259,8 +1259,8 @@ private void UpdateButtons(bool timeOutTimerEnabled, int timeOut, DialogResult d _button3.StateCommon.Content.ShortText.Font = MessageBoxTypeface; break; case MessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -1268,9 +1268,9 @@ private void UpdateButtons(bool timeOutTimerEnabled, int timeOut, DialogResult d _button3.Visible = false; break; case MessageBoxButtons.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; @@ -1441,7 +1441,7 @@ private Size UpdateMessageSizing(IWin32Window showOwner) // 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.Width *= 2 / 3.0f; scaledMonitorSize.Height *= 0.95f; _messageText.UpdateFont(); SizeF messageSize = g.MeasureString(_text, _messageText.Font, scaledMonitorSize); @@ -1450,8 +1450,8 @@ private Size UpdateMessageSizing(IWin32Window showOwner) float messageXSize = Math.Max(messageSize.Width, captionSize.Width); // Work out DPI adjustment factor - float factorX = g.DpiX > 96 ? ((1.0f * g.DpiX) / 96) : 1.0f; - float factorY = g.DpiY > 96 ? ((1.0f * g.DpiY) / 96) : 1.0f; + float factorX = g.DpiX > 96 ? 1.0f * g.DpiX / 96 : 1.0f; + float factorY = g.DpiY > 96 ? 1.0f * g.DpiY / 96 : 1.0f; messageSize.Width = messageXSize * factorX; messageSize.Height = messageSize.Height * factorY; @@ -1560,23 +1560,23 @@ private Size UpdateButtonsSizing() _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 + GAP * (numButtons + 1), maxButtonSize.Height + GAP * 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 + GAP * (numButtons + 1), maxButtonSize.Height + GAP * 2); } private void button_keyDown(object sender, KeyEventArgs e) { // Escape key kills the dialog if we allow it to be closed - if ((e.KeyCode == Keys.Escape) && ControlBox) + if (e.KeyCode == Keys.Escape && ControlBox) { Close(); } else { // Pressing Ctrl+C should copy message text into the clipboard - if ((e.Modifiers == Keys.Control) && (e.KeyCode == Keys.C)) + if (e.Modifiers == Keys.Control && e.KeyCode == Keys.C) { StringBuilder sb = new StringBuilder(); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Security/UACSecurity.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Security/UACSecurity.cs index 6bac24125..589e81913 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Security/UACSecurity.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Security/UACSecurity.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -37,7 +37,7 @@ public static class UACSecurity #endregion #region Constants - internal const int BCM_FIRST = 0x1600, BCM_SETSHIELD = (BCM_FIRST + 0x000C); + internal const int BCM_FIRST = 0x1600, BCM_SETSHIELD = BCM_FIRST + 0x000C; #endregion #region Methods diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Controls/User Controls/CommonCircularPictureBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Controls/User Controls/CommonCircularPictureBox.cs index 84f8e5a1e..9940fc802 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Controls/User Controls/CommonCircularPictureBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Controls/User Controls/CommonCircularPictureBox.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Controls/User Controls/CommonKryptonKnobControlEnhanced.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Controls/User Controls/CommonKryptonKnobControlEnhanced.cs index 7531d7035..a3fa6f782 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Controls/User Controls/CommonKryptonKnobControlEnhanced.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Controls/User Controls/CommonKryptonKnobControlEnhanced.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -517,7 +517,7 @@ public CommonKryptonKnobControlEnhanced() SetDimensions(); - if (((_palette != null))) + if (_palette != null) { _palette.PalettePaint += OnPalettePaint; } @@ -652,7 +652,7 @@ protected override void OnMouseWheel(MouseEventArgs e) if (_isFocused && _isKnobRotating && KryptonKnobUtilities.IsPointinRectangle(new Point(e.X, e.Y), _rKnob)) { // the Delta value is always 120, as explained in MSDN - int v = (e.Delta / 120) * (_maximum - _minimum) / _mouseWheelBarPartitions; + int v = e.Delta / 120 * (_maximum - _minimum) / _mouseWheelBarPartitions; SetProperValue(Value + v); // Avoid to send MouseWheel event to the parent container @@ -677,7 +677,7 @@ protected override void OnKeyDown(KeyEventArgs e) //-------------------------------------------------------- // Handles knob rotation with up,down,left and right keys //-------------------------------------------------------- - if (e.KeyCode == Keys.Up || e.KeyCode == Keys.Right) + if (e.KeyCode is Keys.Up or Keys.Right) { if (_value < _maximum) { @@ -686,7 +686,7 @@ protected override void OnKeyDown(KeyEventArgs e) this.Refresh(); } - else if (e.KeyCode == Keys.Down || e.KeyCode == Keys.Left) + else if (e.KeyCode is Keys.Down or Keys.Left) { if (_value > _minimum) { @@ -840,8 +840,8 @@ private bool DrawDivisions(Graphics Gr, RectangleF rc) Font font; - Pen penL = new Pen(_scaleColour, (2 * _drawRatio)); - Pen penS = new Pen(_scaleColour, (1 * _drawRatio)); + Pen penL = new Pen(_scaleColour, 2 * _drawRatio); + Pen penS = new Pen(_scaleColour, 1 * _drawRatio); SolidBrush br = new SolidBrush(_scaleColour); @@ -887,8 +887,8 @@ private bool DrawDivisions(Graphics Gr, RectangleF rc) for (; n < _scaleDivisions; n++) { // draw divisions - ptStart.X = (float)(cx + (radius) * Math.Cos(currentAngle)); - ptStart.Y = (float)(cy + (radius) * Math.Sin(currentAngle)); + ptStart.X = (float)(cx + radius * Math.Cos(currentAngle)); + ptStart.Y = (float)(cy + radius * Math.Sin(currentAngle)); ptEnd.X = (float)(cx + (radius + _gradLength) * Math.Cos(currentAngle)); ptEnd.Y = (float)(cy + (radius + _gradLength) * Math.Sin(currentAngle)); @@ -914,7 +914,7 @@ private bool DrawDivisions(Graphics Gr, RectangleF rc) if (_drawDivInside) { // graduations values inside the knob - l = (int)radius - (wmax / 2) - 2; + l = (int)radius - wmax / 2 - 2; tx = (float)(cx + l * Math.Cos(currentAngle)); ty = (float)(cy + l * Math.Sin(currentAngle)); @@ -1189,8 +1189,8 @@ private Point[] GetKnobLine(Graphics Gr, int l) if (_drawDivInside) { // Center (from) - Pos.X = (int)(cx + (radius / 10) * Math.Cos(degree)); - Pos.Y = (int)(cy + (radius / 10) * Math.Sin(degree)); + Pos.X = (int)(cx + radius / 10 * Math.Cos(degree)); + Pos.Y = (int)(cy + radius / 10 * Math.Sin(degree)); pret[0] = new Point(Pos.X, Pos.Y); // External (to) @@ -1231,7 +1231,7 @@ private int GetValueFromPosition(Point p) degree = (float)(_pKnob.Y - p.Y) / (float)(_pKnob.X - p.X); degree = (float)Math.Atan(degree); - degree = (degree) * (float)(180 / Math.PI) + (180 - _startAngle); + degree = degree * (float)(180 / Math.PI) + (180 - _startAngle); } else if (p.X > _pKnob.X) @@ -1239,7 +1239,7 @@ private int GetValueFromPosition(Point p) degree = (float)(p.Y - _pKnob.Y) / (float)(p.X - _pKnob.X); degree = (float)Math.Atan(degree); - degree = (degree) * (float)(180 / Math.PI) + 360 - _startAngle; + degree = degree * (float)(180 / Math.PI) + 360 - _startAngle; } // round to the nearest value (when you click just before or after a graduation!) @@ -1284,7 +1284,7 @@ private void KryptonKnobControlEnhanced_Resize(object sender, EventArgs e) private void OnGlobalPaletteChanged(object sender, EventArgs e) { - if (((_palette != null))) + if (_palette != null) { _palette.PalettePaint -= OnPalettePaint; } @@ -1293,7 +1293,7 @@ private void OnGlobalPaletteChanged(object sender, EventArgs e) _paletteRedirect.Target = _palette; - if (((_palette != null))) + if (_palette != null) { _palette.PalettePaint += OnPalettePaint; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Drawing/GraphicsUtilities.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Drawing/GraphicsUtilities.cs index cd393f847..052d06613 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Drawing/GraphicsUtilities.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Drawing/GraphicsUtilities.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Drawing/RoundedRectangleF.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Drawing/RoundedRectangleF.cs index 63fc231ca..3ed49e234 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Drawing/RoundedRectangleF.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Drawing/RoundedRectangleF.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Drawing/Transparenter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Drawing/Transparenter.cs index 8c58386a7..2774be84d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Drawing/Transparenter.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Drawing/Transparenter.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/AnimatorStatus.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/AnimatorStatus.cs index 729d13dba..f6c3d8766 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/AnimatorStatus.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/AnimatorStatus.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/DevelopmentState.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/DevelopmentState.cs index 9b42af626..7cac3815c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/DevelopmentState.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/DevelopmentState.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/FPSLimiterKnownValues.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/FPSLimiterKnownValues.cs index afe0f9473..3892d1481 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/FPSLimiterKnownValues.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/FPSLimiterKnownValues.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/IconType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/IconType.cs index 81e5171ed..a73ebc904 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/IconType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/IconType.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/SupportedHashAlgorithms.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/SupportedHashAlgorithms.cs index b142015db..0114b1b70 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/SupportedHashAlgorithms.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/SupportedHashAlgorithms.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/ToolkitType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/ToolkitType.cs index eed98a554..3ae17aa68 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/ToolkitType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Enumerations/ToolkitType.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Events/Knob/KnobValueChangedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Events/Knob/KnobValueChangedEventArgs.cs index 829d2794f..e4c7424f6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Events/Knob/KnobValueChangedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Events/Knob/KnobValueChangedEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Globals/GlobalDeclarations.cs index 80ed6d3a0..429ebb526 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Globals/GlobalDeclarations.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -28,6 +28,8 @@ global using System; global using System.Collections; +global using System.Collections.Generic; +global using System.Linq.Expressions; global using System.ComponentModel; global using System.Diagnostics; global using System.Diagnostics.CodeAnalysis; @@ -36,12 +38,14 @@ global using System.Drawing.Imaging; global using System.Reflection; global using System.Runtime.InteropServices; +global using System.Globalization; +global using System.IO; global using System.Security.Principal; global using System.Media; global using System.Text; global using System.Threading; global using System.Windows.Forms; -global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; +global using Krypton.Toolkit.Suite.Extended.Debug.Tools; global using Krypton.Toolkit.Suite.Extended.Common.Resources; global using Krypton.Toolkit.Suite.Extended.Shared; \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Interfaces/Animation/IAnimator.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Interfaces/Animation/IAnimator.cs index 17f0befc0..d7a1faee0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Interfaces/Animation/IAnimator.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Interfaces/Animation/IAnimator.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -73,7 +73,7 @@ public interface IAnimator /// /// The callback to get invoked at the end of the animation /// - void Play(object targetObject, string propertyName, SafeInvoker endCallback); + void Play(object targetObject, string propertyName, SafeInvoker? endCallback); /// /// Starts the playing of the animation @@ -87,7 +87,7 @@ public interface IAnimator /// /// Any object containing a property /// - void Play(T targetObject, Expression> propertySetter); + void Play(T targetObject, Expression>? propertySetter); /// /// Starts the playing of the animation @@ -104,7 +104,7 @@ public interface IAnimator /// /// Any object containing a property /// - void Play(T targetObject, Expression> propertySetter, SafeInvoker endCallback); + void Play(T targetObject, Expression>? propertySetter, SafeInvoker? endCallback); /// /// Resume the animation from where it paused diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Krypton.Toolkit.Suite.Extended.Common 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Krypton.Toolkit.Suite.Extended.Common 2022.csproj index 70f12f87d..d1c6a2f02 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Krypton.Toolkit.Suite.Extended.Common 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Krypton.Toolkit.Suite.Extended.Common 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -34,7 +22,7 @@ false True StrongKrypton.snk - False + True true Debug;Release;Nightly;Canary preview @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements common tools and utilities that are used by the extended toolkit. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements common tools and utilities that are used by the extended toolkit. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,79 +69,42 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Krypton.Toolkit.Suite.Extended.Common.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Krypton.Toolkit.Suite.Extended.Common.licenseheader index c890e86c0..a0e5e0a62 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Krypton.Toolkit.Suite.Extended.Common.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Krypton.Toolkit.Suite.Extended.Common.licenseheader @@ -4,7 +4,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Security/UACSecurity.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Security/UACSecurity.cs index 77bdb1802..a028a473d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Security/UACSecurity.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Security/UACSecurity.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/UX/CommonExtendedKryptonForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/UX/CommonExtendedKryptonForm.cs index 3c6cd750f..bce9373a0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/UX/CommonExtendedKryptonForm.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/UX/CommonExtendedKryptonForm.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -75,7 +75,7 @@ protected override void OnLoad(EventArgs e) #if NETCOREAPP3_1_OR_GREATER FadeControllerNETCoreSafe.FadeWindowInExtended(this, SleepInterval); #else - FadeController.FadeIn(this, FadeSpeedChoice, FadeSpeed); + FadeController.FadeIn(this, FadeSpeed); #endif } @@ -91,7 +91,7 @@ protected override void OnFormClosing(FormClosingEventArgs e) #if NETCOREAPP3_1_OR_GREATER FadeControllerNETCoreSafe.FadeWindowOutExtended(this, SleepInterval); #else - FadeController.FadeOutAndClose(this, _fadeSpeedChoice); + FadeController.FadeOutAndClose(this, _fadeSpeed); #endif } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Compression/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Compression/Globals/GlobalDeclarations.cs index 8a934217a..dfeb5e7ca 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Compression/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Compression/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Compression/Krypton.Toolkit.Suite.Extended.Compression 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Compression/Krypton.Toolkit.Suite.Extended.Compression 2022.csproj index 4c5472047..51b0d48a3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Compression/Krypton.Toolkit.Suite.Extended.Compression 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Compression/Krypton.Toolkit.Suite.Extended.Compression 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package holds additional file compression utilities. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package holds additional file compression utilities. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,74 +69,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Compression/Krypton.Toolkit.Suite.Extended.Compression.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Compression/Krypton.Toolkit.Suite.Extended.Compression.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Compression/Krypton.Toolkit.Suite.Extended.Compression.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Compression/Krypton.Toolkit.Suite.Extended.Compression.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/KryptonCheckBoxComboBoxItemList.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/KryptonCheckBoxComboBoxItemList.cs new file mode 100644 index 000000000..a0883dae2 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/KryptonCheckBoxComboBoxItemList.cs @@ -0,0 +1,157 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + /// + /// A Typed List of the CheckBox items. + /// Simply a wrapper for the CheckBoxComboBox.Items. A list of CheckBoxComboBoxItem objects. + /// This List is automatically synchronised with the Items of the ComboBox and extended to + /// handle the additional boolean value. That said, do not Add or Remove using this List, + /// it will be lost or regenerated from the ComboBox.Items. + /// + [ToolboxItem(false)] + public class KryptonCheckBoxComboBoxItemList : List + { + #region CONSTRUCTORS + + public KryptonCheckBoxComboBoxItemList(KryptonCheckBoxComboBox checkBoxComboBox) + { + _checkBoxComboBox = checkBoxComboBox; + } + + #endregion + + #region PRIVATE FIELDS + + private KryptonCheckBoxComboBox _checkBoxComboBox; + + #endregion + + #region EVENTS, This could be moved to the list control if needed + + public event EventHandler CheckBoxCheckedChanged; + + protected void OnCheckBoxCheckedChanged(object sender, EventArgs e) + { + EventHandler handler = CheckBoxCheckedChanged; + if (handler != null) + { + handler(sender, e); + } + } + + private void item_CheckedChanged(object sender, EventArgs e) + { + OnCheckBoxCheckedChanged(sender, e); + } + + #endregion + + #region LIST MEMBERS & OBSOLETE INDICATORS + + [Obsolete("Do not add items to this list directly. Use the ComboBox items instead.", false)] + public new void Add(KryptonCheckBoxComboBoxItem item) + { + item.CheckedChanged += new EventHandler(item_CheckedChanged); + base.Add(item); + } + + public new void AddRange(IEnumerable collection) + { + foreach (KryptonCheckBoxComboBoxItem item in collection) + item.CheckedChanged += new EventHandler(item_CheckedChanged); + base.AddRange(collection); + } + + public new void Clear() + { + foreach (KryptonCheckBoxComboBoxItem item in this) + item.CheckedChanged -= item_CheckedChanged; + base.Clear(); + } + + [Obsolete("Do not remove items from this list directly. Use the ComboBox items instead.", false)] + public new bool Remove(KryptonCheckBoxComboBoxItem item) + { + item.CheckedChanged -= item_CheckedChanged; + return base.Remove(item); + } + + #endregion + + #region DEFAULT PROPERTIES + + /// + /// Returns the item with the specified displayName or Text. + /// + public KryptonCheckBoxComboBoxItem this[string displayName] + { + get + { + int startIndex = + // An invisible item exists in this scenario to help + // with the Text displayed in the TextBox of the Combo + _checkBoxComboBox.DropDownStyle == ComboBoxStyle.DropDownList + && _checkBoxComboBox.DataSource == null + ? 1 // Ubiklou : 2008-04-28 : Ignore first item. (http://www.codeproject.com/KB/combobox/extending_combobox.aspx?fid=476622&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=2526813&fr=1#xx2526813xx) + : 0; + for (int index = startIndex; index <= Count - 1; index++) + { + KryptonCheckBoxComboBoxItem item = this[index]; + + string text; + // The binding might not be active yet + if (string.IsNullOrEmpty(item.Text) + // Ubiklou : 2008-04-28 : No databinding + && item.DataBindings != null + && item.DataBindings["Text"] != null + ) + { + PropertyInfo propertyInfo + = item.ComboBoxItem.GetType().GetProperty( + item.DataBindings["Text"].BindingMemberInfo.BindingMember); + text = (string)propertyInfo.GetValue(item.ComboBoxItem, null); + } + else + { + text = item.Text; + } + + if (text.CompareTo(displayName) == 0) + { + return item; + } + } + + throw new ArgumentOutOfRangeException($"\"{displayName}\" does not exist in this combo box."); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/KryptonCheckBoxProperties.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/KryptonCheckBoxProperties.cs new file mode 100644 index 000000000..be6e6a844 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/KryptonCheckBoxProperties.cs @@ -0,0 +1,248 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + [TypeConverter(typeof(ExpandableObjectConverter))] + public class KryptonCheckBoxProperties + { + #region Identity + + public KryptonCheckBoxProperties() + { + } + + #endregion + + #region Instance Fields + + private Appearance _appearance = Appearance.Normal; + private bool _autoSize = false; + private bool _autoCheck = true; + private bool _autoEllipsis = false; + private ContentAlignment _checkAlign = ContentAlignment.MiddleLeft; + private Color _flatAppearanceBorderColor = Color.Empty; + private int _flatAppearanceBorderSize = 1; + private Color _flatAppearanceCheckedBackColor = Color.Empty; + private Color _flatAppearanceMouseDownBackColor = Color.Empty; + private Color _flatAppearanceMouseOverBackColor = Color.Empty; + private FlatStyle _flatStyle = FlatStyle.Standard; + private Color _foreColor = SystemColors.ControlText; + private RightToLeft _rightToLeft = RightToLeft.No; + private ContentAlignment _textAlign = ContentAlignment.MiddleLeft; + private bool _threeState = false; + + #endregion + + #region Public + + [DefaultValue(Appearance.Normal)] + public Appearance Appearance + { + get { return _appearance; } + set + { + _appearance = value; + OnPropertyChanged(); + } + } + + [DefaultValue(true)] + public bool AutoCheck + { + get { return _autoCheck; } + set + { + _autoCheck = value; + OnPropertyChanged(); + } + } + + [DefaultValue(false)] + public bool AutoEllipsis + { + get { return _autoEllipsis; } + set + { + _autoEllipsis = value; + OnPropertyChanged(); + } + } + + [DefaultValue(false)] + public bool AutoSize + { + get { return _autoSize; } + set + { + _autoSize = true; + OnPropertyChanged(); + } + } + + [DefaultValue(ContentAlignment.MiddleLeft)] + public ContentAlignment CheckAlign + { + get { return _checkAlign; } + set + { + _checkAlign = value; + OnPropertyChanged(); + } + } + + [DefaultValue(typeof(Color), "")] + public Color FlatAppearanceBorderColor + { + get { return _flatAppearanceBorderColor; } + set + { + _flatAppearanceBorderColor = value; + OnPropertyChanged(); + } + } + + [DefaultValue(1)] + public int FlatAppearanceBorderSize + { + get { return _flatAppearanceBorderSize; } + set + { + _flatAppearanceBorderSize = value; + OnPropertyChanged(); + } + } + + [DefaultValue(typeof(Color), "")] + public Color FlatAppearanceCheckedBackColor + { + get { return _flatAppearanceCheckedBackColor; } + set + { + _flatAppearanceCheckedBackColor = value; + OnPropertyChanged(); + } + } + + [DefaultValue(typeof(Color), "")] + public Color FlatAppearanceMouseDownBackColor + { + get { return _flatAppearanceMouseDownBackColor; } + set + { + _flatAppearanceMouseDownBackColor = value; + OnPropertyChanged(); + } + } + + [DefaultValue(typeof(Color), "")] + public Color FlatAppearanceMouseOverBackColor + { + get { return _flatAppearanceMouseOverBackColor; } + set + { + _flatAppearanceMouseOverBackColor = value; + OnPropertyChanged(); + } + } + + [DefaultValue(FlatStyle.Standard)] + public FlatStyle FlatStyle + { + get { return _flatStyle; } + set + { + _flatStyle = value; + OnPropertyChanged(); + } + } + + [DefaultValue(typeof(SystemColors), "ControlText")] + public Color ForeColor + { + get { return _foreColor; } + set + { + _foreColor = value; + OnPropertyChanged(); + } + } + + [DefaultValue(RightToLeft.No)] + public RightToLeft RightToLeft + { + get { return _rightToLeft; } + set + { + _rightToLeft = value; + OnPropertyChanged(); + } + } + + [DefaultValue(ContentAlignment.MiddleLeft)] + public ContentAlignment TextAlign + { + get { return _textAlign; } + set + { + _textAlign = value; + OnPropertyChanged(); + } + } + + [DefaultValue(false)] + public bool ThreeState + { + get { return _threeState; } + set + { + _threeState = value; + OnPropertyChanged(); + } + } + + #endregion + + #region Implementation + + /// + /// Called when any property changes. + /// + public event EventHandler PropertyChanged; + + protected void OnPropertyChanged() + { + EventHandler handler = PropertyChanged; + if (handler != null) + { + handler(this, EventArgs.Empty); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/ListSelectionWrapper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/ListSelectionWrapper.cs new file mode 100644 index 000000000..131b9b710 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/ListSelectionWrapper.cs @@ -0,0 +1,261 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + /// + /// Maintains an additional "Selected" & "Count" value for each item in a List. + /// Useful in the CheckBoxComboBox. It holds a reference to the List[Index] Item and + /// whether it is selected or not. + /// It also caters for a Count, if needed. + /// + /// + public class ListSelectionWrapper : List> + { + #region Identity + + /// + /// No property on the object is specified for display purposes, so simple ToString() operation + /// will be performed. And no Counts will be displayed + /// + public ListSelectionWrapper(IEnumerable source) : this(source, false) { } + /// + /// No property on the object is specified for display purposes, so simple ToString() operation + /// will be performed. + /// + public ListSelectionWrapper(IEnumerable source, bool showCounts) + : base() + { + _source = source; + _showCounts = showCounts; + if (_source is IBindingList) + { + ((IBindingList)_source).ListChanged += new ListChangedEventHandler(ListSelectionWrapper_ListChanged); + } + + Populate(); + } + /// + /// A Display "Name" property is specified. ToString() will not be performed on items. + /// This is specifically useful on DataTable implementations, or where PropertyDescriptors are used to read the values. + /// If a PropertyDescriptor is not found, a Property will be used. + /// + public ListSelectionWrapper(IEnumerable source, string usePropertyAsDisplayName) : this(source, false, usePropertyAsDisplayName) { } + /// + /// A Display "Name" property is specified. ToString() will not be performed on items. + /// This is specifically useful on DataTable implementations, or where PropertyDescriptors are used to read the values. + /// If a PropertyDescriptor is not found, a Property will be used. + /// + public ListSelectionWrapper(IEnumerable source, bool showCounts, string usePropertyAsDisplayName) + : this(source, showCounts) + { + _displayNameProperty = usePropertyAsDisplayName; + } + + #endregion + + #region Instance Fields + + /// + /// Is a Count indicator used. + /// + private bool _showCounts; + /// + /// The original List of values wrapped. A "Selected" and possibly "Count" functionality is added. + /// + private IEnumerable _source; + /// + /// Used to indicate NOT to use ToString(), but read this property instead as a display value. + /// + private string _displayNameProperty = null; + + #endregion + + #region Public + + /// + /// When specified, indicates that ToString() should not be performed on the items. + /// This property will be read instead. + /// This is specifically useful on DataTable implementations, where PropertyDescriptors are used to read the values. + /// + public string DisplayNameProperty + { + get => _displayNameProperty; + set => _displayNameProperty = value; + } + /// + /// Builds a concatenation list of selected items in the list. + /// + public string SelectedNames + { + get + { + string text = ""; + foreach (ObjectSelectionWrapper item in this) + if (item.Selected) + { + text += string.IsNullOrEmpty(text) + ? $"\"{(object)item.Name}\"" + : $" & \"{(object)item.Name}\""; + } + + return text; + } + } + /// + /// Indicates whether the Item display value (Name) should include a count. + /// + public bool ShowCounts + { + get => _showCounts; + set => _showCounts = value; + } + + #endregion + + #region Implementation + + /// + /// Reset all counts to zero. + /// + public void ClearCounts() + { + foreach (ObjectSelectionWrapper item in this) + { + item.Count = 0; + } + } + /// + /// Creates a ObjectSelectionWrapper item. + /// Note that the constructor signature of sub classes classes are important. + /// + /// + /// + private ObjectSelectionWrapper CreateSelectionWrapper(IEnumerator @object) + { + Type[] types = new Type[] { typeof(T), GetType() }; + ConstructorInfo ci = typeof(ObjectSelectionWrapper).GetConstructor(types); + if (ci == null) + { + throw new Exception( + $"The selection wrapper class {typeof(ObjectSelectionWrapper)} must have a constructor with ({typeof(T)} Item, {GetType()} Container) parameters."); + } + + object[] parameters = new object[] { @object.Current, this }; + object result = ci.Invoke(parameters); + return (ObjectSelectionWrapper)result; + } + + public ObjectSelectionWrapper FindObjectWithItem(T @object) + { + return Find(new Predicate>( + target => target.Item.Equals(@object))); + } + + /* + public TSelectionWrapper FindObjectWithKey(object key) + { + return FindObjectWithKey(new object[] { key }); + } + + public TSelectionWrapper FindObjectWithKey(object[] keys) + { + return Find(new Predicate( + delegate(TSelectionWrapper target) + { + return + ReflectionHelper.CompareKeyValues( + ReflectionHelper.GetKeyValuesFromObject(target.Item, target.Item.TableInfo), + keys); + })); + } + + public object[] GetArrayOfSelectedKeys() + { + List List = new List(); + foreach (TSelectionWrapper Item in this) + if (Item.Selected) + { + if (Item.Item.TableInfo.KeyProperties.Length == 1) + List.Add(ReflectionHelper.GetKeyValueFromObject(Item.Item, Item.Item.TableInfo)); + else + List.Add(ReflectionHelper.GetKeyValuesFromObject(Item.Item, Item.Item.TableInfo)); + } + return List.ToArray(); + } + + public T[] GetArrayOfSelectedKeys() + { + List List = new List(); + foreach (TSelectionWrapper Item in this) + if (Item.Selected) + { + if (Item.Item.TableInfo.KeyProperties.Length == 1) + List.Add((T)ReflectionHelper.GetKeyValueFromObject(Item.Item, Item.Item.TableInfo)); + else + throw new LibraryException("This generator only supports single value keys."); + // List.Add((T)ReflectionHelper.GetKeyValuesFromObject(Item.Item, Item.Item.TableInfo)); + } + return List.ToArray(); + } + */ + private void Populate() + { + Clear(); + /* + for(int Index = 0; Index <= _Source.Count -1; Index++) + Add(CreateSelectionWrapper(_Source[Index])); + */ + IEnumerator? enumerator = _source.GetEnumerator(); + if (enumerator != null) + { + while (enumerator.MoveNext()) + { + Add(CreateSelectionWrapper(enumerator)); + } + } + } + + private void ListSelectionWrapper_ListChanged(object sender, ListChangedEventArgs e) + { + switch (e.ListChangedType) + { + case ListChangedType.ItemAdded: + Add(CreateSelectionWrapper((IEnumerator)((IBindingList)_source)[e.NewIndex])); + break; + case ListChangedType.ItemDeleted: + Remove(FindObjectWithItem((T)((IBindingList)_source)[e.OldIndex])); + break; + case ListChangedType.Reset: + Populate(); + break; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/NativeMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/NativeMethods.cs index af3e65df4..6d223220f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/NativeMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/NativeMethods.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,6 +29,28 @@ namespace Krypton.Toolkit.Suite.Extended.Controls { internal class NativeMethods { + #region Constants + + internal const int WM_NCHITTEST = 0x0084; + internal const int WM_NCACTIVATE = 0x0086; + internal const int WS_EX_NOACTIVATE = 0x08000000; + internal const int HTTRANSPARENT = -1; + internal const int HTLEFT = 10; + internal const int HTRIGHT = 11; + internal const int HTTOP = 12; + internal const int HTTOPLEFT = 13; + internal const int HTTOPRIGHT = 14; + internal const int HTBOTTOM = 15; + internal const int HTBOTTOMLEFT = 16; + internal const int HTBOTTOMRIGHT = 17; + internal const int WM_USER = 0x0400; + internal const int WM_REFLECT = WM_USER + 0x1C00; + internal const int WM_COMMAND = 0x0111; + internal const int CBN_DROPDOWN = 7; + internal const int WM_GETMINMAXINFO = 0x0024; + + #endregion + #region Parameters /* Sent when the system makes a request to paint (a portion of) a window. */ @@ -295,6 +317,40 @@ internal struct KryptonRichTextBoxExtendedRECT public int Bottom; } + [StructLayout(LayoutKind.Sequential)] + internal struct MINMAXINFO + { + public Point Reserved; + public Size MaximumSize; + public Point MaximumPosition; + public Size MinimumTrackSize; + public Size MaximumTrackSize; + } + + #endregion + + #region Implementation + + internal static int HIWORD(int n) + { + return (n >> 16) & 0xffff; + } + + internal static int HIWORD(IntPtr n) + { + return HIWORD(unchecked((int)(long)n)); + } + + internal static int LOWORD(int n) + { + return n & 0xffff; + } + + internal static int LOWORD(IntPtr n) + { + return LOWORD(unchecked((int)(long)n)); + } + #endregion } } \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/ObjectSelectionWrapper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/ObjectSelectionWrapper.cs new file mode 100644 index 000000000..dcbaaec19 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/ObjectSelectionWrapper.cs @@ -0,0 +1,163 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + /// + /// Used together with the ListSelectionWrapper in order to wrap data sources for a CheckBoxComboBox. + /// It helps to ensure you don't add an extra "Selected" property to a class that don't really need or want that information. + /// + public class ObjectSelectionWrapper : INotifyPropertyChanged + { + public ObjectSelectionWrapper(T item, ListSelectionWrapper container) + : base() + { + _container = container; + _item = item; + } + + + #region Instance Fields + + /// + /// Used as a count indicator for the item. Not necessarily displayed. + /// + private int _count = 0; + /// + /// Is this item selected. + /// + private bool _selected = false; + /// + /// A reference to the wrapped item. + /// + private T _item; + /// + /// The containing list for these selections. + /// + private readonly ListSelectionWrapper _container; + + #endregion + + #region Public + + /// + /// An indicator of how many items with the specified status is available for the current filter level. + /// Thought this would make the app a bit more user-friendly and help not to miss items in Statuses + /// that are not often used. + /// + public int Count + { + get => _count; + set => _count = value; + } + /// + /// A reference to the item wrapped. + /// + public T Item + { + get => _item; + set => _item = value; + } + /// + /// The item display value. If ShowCount is true, it displays the "Name [Count]". + /// + public string? Name + { + get + { + string? name = null; + if (string.IsNullOrEmpty(_container.DisplayNameProperty)) + { + name = Item.ToString(); + } + else if (Item is DataRow) // A specific implementation for DataRow + { + name = ((DataRow)(object)Item)[_container.DisplayNameProperty].ToString(); + } + else + { + PropertyDescriptorCollection pDs = TypeDescriptor.GetProperties(Item); + foreach (PropertyDescriptor pd in pDs) + if (pd.Name.CompareTo(_container.DisplayNameProperty) == 0) + { + name = (string)pd.GetValue(Item).ToString(); + break; + } + if (string.IsNullOrEmpty(name)) + { + PropertyInfo pi = Item.GetType().GetProperty(_container.DisplayNameProperty); + if (pi == null) + { + throw new Exception($"Property {_container.DisplayNameProperty} cannot be found on {Item.GetType()}."); + } + + name = pi.GetValue(Item, null).ToString(); + } + } + return _container.ShowCounts ? $"{name} [{Count}]" : name; + } + } + /// + /// The textbox display value. The names concatenated. + /// + public string NameConcatenated => _container.SelectedNames; + + /// + /// Indicates whether the item is selected. + /// + public bool Selected + { + get => _selected; + set + { + if (_selected != value) + { + _selected = value; + OnPropertyChanged("Selected"); + OnPropertyChanged("NameConcatenated"); + } + } + } + + #endregion + + #region INotifyPropertyChanged + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged(string propertyName) + { + PropertyChangedEventHandler? handler = PropertyChanged; + if (handler != null) + { + handler(this, new PropertyChangedEventArgs(propertyName)); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/SafeNativeMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/SafeNativeMethods.cs index 142b43ca1..18b2923f7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/SafeNativeMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/SafeNativeMethods.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/UnsafeNativeMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/UnsafeNativeMethods.cs index e42ae7c6e..111f6b5a3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/UnsafeNativeMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/UnsafeNativeMethods.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/Utilities.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/Utilities.cs new file mode 100644 index 000000000..085ae8e59 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Classes/Utilities.cs @@ -0,0 +1,6 @@ +namespace Krypton.Toolkit.Suite.Extended.Controls.Classes +{ + internal class Utilities + { + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Components/General/Popup.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Components/General/Popup.cs new file mode 100644 index 000000000..15043715c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Components/General/Popup.cs @@ -0,0 +1,555 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +using VisualStyleRender = System.Windows.Forms.VisualStyles; + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + [ToolboxItem(false), CLSCompliant(true)] + public partial class Popup : ToolStripDropDown + { + #region Instance Fields + + private bool _fade; + + private bool _focusOnOpen; + + private bool _acceptAlt; + + private bool _resizable; + + private bool _resizableControl; + + private bool _resizableTop; + + private bool _resizableRight; + + private Control _content; + + private Popup _ownerPopup; + + private Popup _childPopup; + + private ToolStripControlHost _host; + + private Size _maximumSize; + + private Size _minimumSize; + + private VisualStyleRender.VisualStyleRenderer _sizeGripRenderer; + + #endregion + + #region Public + + public bool UseFadeEffect + { + get => _fade; + + set + { + if (_fade != value) + { + _fade = value; + } + else + { + return; + } + } + } + + public bool FocusOnOpen + { + get => _focusOnOpen; + set => _focusOnOpen = value; + } + + public bool AcceptAlt + { + get => _acceptAlt; + set => _acceptAlt = value; + } + + public bool Resizable + { + get => _resizableControl && _resizable; + set => _resizableControl = value; + } + + public Control Content => _content; + + public DateTime LastClosedTimeStamp { get; set; } + + public new Size MinimumSize + { + get => _minimumSize; + set => _minimumSize = value; + } + + public new Size MaximumSize + { + get => _maximumSize; + set => _maximumSize = value; + } + + #endregion + + #region Identity + + public Popup(Control? content) + { + if (content == null) + { + return; + } + + _content = content; + + _fade = SystemInformation.IsMenuAnimationEnabled && SystemInformation.IsMenuFadeEnabled; + + _resizable = true; + + InitializeComponent(); + + AutoSize = false; + + DoubleBuffered = true; + + ResizeRedraw = true; + + _host = new ToolStripControlHost(content); + + Padding = Margin = _host.Padding = _host.Margin = Padding.Empty; + + MinimumSize = content.MinimumSize; + + content.MinimumSize = content.Size; + + MaximumSize = content.MaximumSize; + + content.MaximumSize = content.Size; + + Size = content.Size; + + content.Location = Point.Empty; + + Items.Add(_host); + + content.Disposed += delegate (object sender, EventArgs e) + { + content = null; + Dispose(true); + }; + + content.RegionChanged += delegate (object sender, EventArgs e) + { + UpdateRegion(); + }; + + content.Paint += delegate (object sender, PaintEventArgs e) + { + PaintSizeGrip(e); + }; + + UpdateRegion(); + } + + #endregion + + #region Protected Overrides + + protected override CreateParams CreateParams + { + [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] + get + { + CreateParams cp = base.CreateParams; + + cp.ExStyle |= NativeMethods.WS_EX_NOACTIVATE; + + return cp; + } + } + + protected override bool ProcessDialogKey(Keys keyData) + { + if (_acceptAlt && (keyData & Keys.Alt) == Keys.Alt) + { + return false; + } + + return base.ProcessDialogKey(keyData); + } + + protected override void SetVisibleCore(bool visible) + { + double opacity = Opacity; + if (visible && _fade && _focusOnOpen) + { + Opacity = 0; + } + + base.SetVisibleCore(visible); + if (!visible || !_fade || !_focusOnOpen) + { + return; + } + for (int i = 1; i <= FRAMES; i++) + { + if (i > 1) + { + System.Threading.Thread.Sleep(FRAMEDURATION); + } + Opacity = opacity * (double)i / (double)FRAMES; + } + Opacity = opacity; + } + + protected override void OnSizeChanged(EventArgs e) + { + _content.MinimumSize = Size; + _content.MaximumSize = Size; + _content.Size = Size; + _content.Location = Point.Empty; + + base.OnSizeChanged(e); + } + + protected override void OnOpening(CancelEventArgs e) + { + if (_content.IsDisposed || _content.Disposing) + { + e.Cancel = true; + return; + } + UpdateRegion(); + + base.OnOpening(e); + } + + protected override void OnOpened(EventArgs e) + { + if (_ownerPopup != null) + { + _ownerPopup._resizable = false; + } + if (_focusOnOpen) + { + _content.Focus(); + } + + base.OnOpened(e); + } + + protected override void OnClosed(ToolStripDropDownClosedEventArgs e) + { + if (_ownerPopup != null) + { + _ownerPopup._resizable = true; + } + + base.OnClosed(e); + } + + protected override void OnVisibleChanged(EventArgs e) + { + if (!Visible) + { + LastClosedTimeStamp = DateTime.Now; + } + + base.OnVisibleChanged(e); + } + + [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] + protected override void WndProc(ref Message m) + { + if (InternalProcessResizing(ref m, false)) + { + return; + } + base.WndProc(ref m); + } + + #endregion + + #region Implementation + + /// + /// Updates the pop-up region. + /// + protected void UpdateRegion() + { + if (Region != null) + { + Region.Dispose(); + Region = null; + } + if (_content.Region != null) + { + Region = _content.Region.Clone(); + } + } + + /// + /// Shows pop-up window below the specified control. + /// + /// The control below which the pop-up will be shown. + /// + /// When there is no space below the specified control, the pop-up control is shown above it. + /// + /// is null. + public void Show(Control control) + { + if (control == null) + { + throw new ArgumentNullException("control"); + } + SetOwnerItem(control); + Show(control, control.ClientRectangle); + } + + /// + /// Shows pop-up window below the specified area of specified control. + /// + /// The control used to compute screen location of specified area. + /// The area of control below which the pop-up will be shown. + /// + /// When there is no space below specified area, the pop-up control is shown above it. + /// + /// is null. + public void Show(Control control, Rectangle area) + { + if (control == null) + { + throw new ArgumentNullException("control"); + } + SetOwnerItem(control); + _resizableTop = _resizableRight = false; + Point location = control.PointToScreen(new Point(area.Left, area.Top + area.Height)); + Rectangle screen = Screen.FromControl(control).WorkingArea; + if (location.X + Size.Width > screen.Left + screen.Width) + { + _resizableRight = true; + location.X = screen.Left + screen.Width - Size.Width; + } + if (location.Y + Size.Height > screen.Top + screen.Height) + { + _resizableTop = true; + location.Y -= Size.Height + area.Height; + } + location = control.PointToClient(location); + Show(control, location, ToolStripDropDownDirection.BelowRight); + } + + private void SetOwnerItem(Control control) + { + if (control == null) + { + return; + } + if (control is Popup) + { + Popup popupControl = control as Popup; + _ownerPopup = popupControl; + _ownerPopup._childPopup = this; + OwnerItem = popupControl.Items[0]; + return; + } + if (control.Parent != null) + { + SetOwnerItem(control.Parent); + } + } + + [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] + public bool ProcessResizing(ref Message m) + { + return InternalProcessResizing(ref m, true); + } + + [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] + private bool InternalProcessResizing(ref Message m, bool contentControl) + { + if (m.Msg == NativeMethods.WM_NCACTIVATE && m.WParam != IntPtr.Zero && _childPopup != null && _childPopup.Visible) + { + _childPopup.Hide(); + } + if (!Resizable) + { + return false; + } + if (m.Msg == NativeMethods.WM_NCHITTEST) + { + return OnNcHitTest(ref m, contentControl); + } + else if (m.Msg == NativeMethods.WM_GETMINMAXINFO) + { + return OnGetMinMaxInfo(ref m); + } + return false; + } + + [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] + private bool OnGetMinMaxInfo(ref Message m) + { + NativeMethods.MINMAXINFO minmax = (NativeMethods.MINMAXINFO)Marshal.PtrToStructure(m.LParam, typeof(NativeMethods.MINMAXINFO)); + minmax.MaximumTrackSize = this.MaximumSize; + minmax.MinimumTrackSize = this.MinimumSize; + Marshal.StructureToPtr(minmax, m.LParam, false); + return true; + } + + private bool OnNcHitTest(ref Message m, bool contentControl) + { + int x = NativeMethods.LOWORD(m.LParam); + int y = NativeMethods.HIWORD(m.LParam); + Point clientLocation = PointToClient(new Point(x, y)); + + GripBounds gripBounds = new GripBounds(contentControl ? _content.ClientRectangle : ClientRectangle); + IntPtr transparent = new IntPtr(NativeMethods.HTTRANSPARENT); + + if (_resizableTop) + { + if (_resizableRight && gripBounds.TopLeft.Contains(clientLocation)) + { + m.Result = contentControl ? transparent : (IntPtr)NativeMethods.HTTOPLEFT; + return true; + } + if (!_resizableRight && gripBounds.TopRight.Contains(clientLocation)) + { + m.Result = contentControl ? transparent : (IntPtr)NativeMethods.HTTOPRIGHT; + return true; + } + if (gripBounds.Top.Contains(clientLocation)) + { + m.Result = contentControl ? transparent : (IntPtr)NativeMethods.HTTOP; + return true; + } + } + else + { + if (_resizableRight && gripBounds.BottomLeft.Contains(clientLocation)) + { + m.Result = contentControl ? transparent : (IntPtr)NativeMethods.HTBOTTOMLEFT; + return true; + } + if (!_resizableRight && gripBounds.BottomRight.Contains(clientLocation)) + { + m.Result = contentControl ? transparent : (IntPtr)NativeMethods.HTBOTTOMRIGHT; + return true; + } + if (gripBounds.Bottom.Contains(clientLocation)) + { + m.Result = contentControl ? transparent : (IntPtr)NativeMethods.HTBOTTOM; + return true; + } + } + if (_resizableRight && gripBounds.Left.Contains(clientLocation)) + { + m.Result = contentControl ? transparent : (IntPtr)NativeMethods.HTLEFT; + return true; + } + if (!_resizableRight && gripBounds.Right.Contains(clientLocation)) + { + m.Result = contentControl ? transparent : (IntPtr)NativeMethods.HTRIGHT; + return true; + } + return false; + } + + public void PaintSizeGrip(PaintEventArgs e) + { + if (e == null || e.Graphics == null || !_resizable) + { + return; + } + Size clientSize = _content.ClientSize; + if (Application.RenderWithVisualStyles) + { + _sizeGripRenderer ??= new VisualStyleRender.VisualStyleRenderer(VisualStyleRender.VisualStyleElement.Status.Gripper.Normal); + + _sizeGripRenderer.DrawBackground(e.Graphics, new Rectangle(clientSize.Width - 0x10, clientSize.Height - 0x10, 0x10, 0x10)); + } + else + { + ControlPaint.DrawSizeGrip(e.Graphics, _content.BackColor, clientSize.Width - 0x10, clientSize.Height - 0x10, 0x10, 0x10); + } + } + + private const int FRAMES = 1; + private const int TOTALDURATION = 0; // ML : 2007-11-05 : was 100 but caused a flicker. + private const int FRAMEDURATION = TOTALDURATION / FRAMES; + + #endregion + + #region Designer Code + + /// + /// 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) + { + if (components != null) + { + components.Dispose(); + } + if (_content != null) + { + Control? content = _content; + content = null; + _content.Dispose(); + } + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Components/General/Star.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Components/General/Star.cs index ec08ae128..c2f3be518 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Components/General/Star.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Components/General/Star.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -45,7 +45,7 @@ private enum States { Off, On } internal Star(int starNumber, Image offImage, Image onImage, Action clicked, Action mouseEnter, Action mouseLeave) { Size = new Size(offImage.Width, offImage.Height); - Left = (Width * (starNumber - 1)); + Left = Width * (starNumber - 1); _stars = new Dictionary { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/CircularPictureBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/CircularPictureBox.cs index d68d3348f..0d3492e70 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/CircularPictureBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/CircularPictureBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -56,7 +56,7 @@ protected override void OnPaint(PaintEventArgs pe) pe.Graphics.SmoothingMode = SmoothingMode.AntiAlias; - pe.Graphics.DrawEllipse(new Pen(new SolidBrush(BackColor), 1), 0, 0, Width - 1, Height - 1); + pe.Graphics.DrawEllipse(new Pen(new System.Drawing.SolidBrush(BackColor), 1), 0, 0, Width - 1, Height - 1); } base.OnPaint(pe); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonBorderedLabel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonBorderedLabel.cs index 8c8ee6e0d..66bc2f9a3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonBorderedLabel.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonBorderedLabel.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,6 +25,7 @@ */ #endregion + namespace Krypton.Toolkit.Suite.Extended.Controls { public class KryptonBorderedLabel : KryptonLabel @@ -45,13 +46,13 @@ public KryptonBorderedLabel() #region Protected Overrides // TODO: Help to get this 'Kryptonised' - protected override void OnPaint(PaintEventArgs e) + protected override void OnPaint(PaintEventArgs? e) { base.OnPaint(e); ForeColor = KryptonManager.CurrentGlobalPalette.GetBorderColor1(PaletteBorderStyle.InputControlCustom1, PaletteState.Normal); - Graphics gfx = e.Graphics; + Graphics gfx = e!.Graphics; Rectangle r = new Rectangle(e.ClipRectangle.X, e.ClipRectangle.Y, e.ClipRectangle.Width - 1, e.ClipRectangle.Height - 1); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonBrowseBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonBrowseBox.cs index ebe7a2e12..82fd6d5e2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonBrowseBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonBrowseBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -114,7 +114,7 @@ public class KryptonBrowseBox : KryptonTextBox /// Gets or sets the reset text. /// The reset text. [DefaultValue(@"&Reset"), Description(@"Gets or sets the reset text.")] - public string ResetText { get => _resetText; set { _resetText = value; Invalidate(); } } + public new string ResetText { get => _resetText; set { _resetText = value; Invalidate(); } } /// Gets or sets the reset text tool tip heading. /// The reset text tool tip heading. @@ -151,15 +151,15 @@ public KryptonBrowseBox() _kcReset = new KryptonCommand(); - _smallResetImage = Properties.Resources.Reset_16_x_16; + _smallResetImage = Resources.Reset_16_x_16; - _largeResetImage = Properties.Resources.Reset_32_x_32; + _largeResetImage = Resources.Reset_32_x_32; - _bsaBrowse.Text = "..."; + _bsaBrowse.Text = @"..."; _bsaBrowse.KryptonCommand = _kcBrowse; - _kcBrowse.Text = "..."; + _kcBrowse.Text = @"..."; _bsaReset.ToolTipImage = _smallResetImage; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonBrowseComboBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonBrowseComboBox.cs index fd52ec337..a87cff204 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonBrowseComboBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonBrowseComboBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonButtonPanel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonButtonPanel.cs index a3581069b..9fc991758 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonButtonPanel.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonButtonPanel.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -41,7 +41,7 @@ private void InitializeComponent() { this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); this.SuspendLayout(); // @@ -69,7 +69,7 @@ private void InitializeComponent() this.Controls.Add(this.kryptonPanel1); this.Name = "KryptonButtonPanel"; this.Size = new System.Drawing.Size(398, 50); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); this.ResumeLayout(false); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonCheckBoxComboBox.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonCheckBoxComboBox.Designer.cs new file mode 100644 index 000000000..2bad42bec --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonCheckBoxComboBox.Designer.cs @@ -0,0 +1,36 @@ +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + partial class KryptonCheckBoxComboBox + { + /// + /// 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 Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + + #endregion + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonCheckBoxComboBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonCheckBoxComboBox.cs new file mode 100644 index 000000000..c21dd8645 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonCheckBoxComboBox.cs @@ -0,0 +1,327 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + public partial class KryptonCheckBoxComboBox : KryptonPopupComboBox + { + #region Instance Fields + + /// + /// The checkbox list control. The public CheckBoxItems property provides a direct reference to its Items. + /// + internal KryptonCheckBoxComboBoxListControl CheckBoxComboBoxListControl; + + /// + /// In DataBinding operations, this property will be used as the DisplayMember in the CheckBoxComboBoxListBox. + /// The normal/existing "DisplayMember" property is used by the TextBox of the ComboBox to display + /// a concatenated Text of the items selected. This concatenation and its formatting however is controlled + /// by the Binded object, since it owns that property. + /// + private string? _displayMemberSingleItem; + + internal bool MustAddHiddenItem; + + private KryptonCheckBoxProperties _checkBoxProperties; + + #endregion + + #region Events + + public event EventHandler CheckBoxCheckedChanged; + + #endregion + + #region Identity + + public KryptonCheckBoxComboBox() + { + InitializeComponent(); + + _checkBoxProperties = new KryptonCheckBoxProperties(); + _checkBoxProperties.PropertyChanged += CheckBoxProperties_PropertyChanged; + // Dumps the ListControl in a(nother) Container to ensure the ScrollBar on the ListControl does not + // Paint over the Size grip. Setting the Padding or Margin on the Popup or host control does + // not work as I expected. I don't think it can work that way. + KryptonCheckBoxComboBoxListControlContainer containerControl = new KryptonCheckBoxComboBoxListControlContainer(); + CheckBoxComboBoxListControl = new KryptonCheckBoxComboBoxListControl(this); + CheckBoxComboBoxListControl.Items.CheckBoxCheckedChanged += Items_CheckBoxCheckedChanged; + containerControl.Controls.Add(CheckBoxComboBoxListControl); + // This padding spaces neatly on the left-hand side and allows space for the size grip at the bottom. + containerControl.Padding = new Padding(4, 0, 0, 14); + // The ListControl FILLS the ListContainer. + CheckBoxComboBoxListControl.Dock = DockStyle.Fill; + // The DropDownControl used by the base class. Will be wrapped in a popup by the base class. + DropDownControl = containerControl; + // Must be set after the DropDownControl is set, since the popup is recreated. + // NOTE: I made the dropDown protected so that it can be accessible here. It was private. + _dropDown!.Resizable = true; + } + + #endregion + + #region Public + + /// + /// A direct reference to the Items of CheckBoxComboBoxListControl. + /// You can use it to Get or Set the Checked status of items manually if you want. + /// But do not manipulate the List itself directly, e.g. Adding and Removing, + /// since the list is synchronised when shown with the ComboBox.Items. So for changing + /// the list contents, use Items instead. + /// + [Browsable(false)] + public KryptonCheckBoxComboBoxItemList CheckBoxItems + { + get + { + // Added to ensure the CheckBoxItems are ALWAYS + // available for modification via code. + if (CheckBoxComboBoxListControl.Items.Count != Items.Count) + { + CheckBoxComboBoxListControl.SynchroniseControlsWithComboBoxItems(); + } + return CheckBoxComboBoxListControl.Items; + } + } + /// + /// The DataSource of the combobox. Refreshes the CheckBox wrappers when this is set. + /// + public new object? DataSource + { + get => base.DataSource; + set + { + base.DataSource = value; + if (!string.IsNullOrEmpty(ValueMember)) + { + // This ensures that at least the checkboxitems are available to be initialised. + CheckBoxComboBoxListControl.SynchroniseControlsWithComboBoxItems(); + } + } + } + /// + /// The ValueMember of the combobox. Refreshes the CheckBox wrappers when this is set. + /// + public new string ValueMember + { + get => base.ValueMember; + set + { + base.ValueMember = value; + if (!string.IsNullOrEmpty(ValueMember)) + { + // This ensures that at least the checkboxitems are available to be initialised. + CheckBoxComboBoxListControl.SynchroniseControlsWithComboBoxItems(); + } + } + } + /// + /// In DataBinding operations, this property will be used as the DisplayMember in the CheckBoxComboBoxListBox. + /// The normal/existing "DisplayMember" property is used by the TextBox of the ComboBox to display + /// a concatenated Text of the items selected. This concatenation however is controlled by the Binded + /// object, since it owns that property. + /// + public string? DisplayMemberSingleItem + { + get + { + if (string.IsNullOrEmpty(_displayMemberSingleItem)) + { + return DisplayMember; + } + else + { + return _displayMemberSingleItem; + } + } + set => _displayMemberSingleItem = value; + } + /// + /// Made this property Browsable again, since the Base Popup hides it. This class uses it again. + /// Gets an object representing the collection of the items contained in this + /// System.Windows.Forms.ComboBox. + /// + /// A System.Windows.Forms.ComboBox.ObjectCollection representing the items in + /// the System.Windows.Forms.ComboBox. + /// + [Browsable(true)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + public new ComboBox.ObjectCollection Items => base.Items; + + /// + /// The properties that will be assigned to the checkboxes as default values. + /// + [Description("The properties that will be assigned to the checkboxes as default values.")] + [Browsable(true)] + public KryptonCheckBoxProperties CheckBoxProperties + { + get => _checkBoxProperties; + set + { + _checkBoxProperties = value; CheckBoxProperties_PropertyChanged(this, EventArgs.Empty); + } + } + + #endregion + + #region Implementation + + /// + /// Builds a CSV string of the items selected. + /// + internal string GetCsvText(bool skipFirstItem) + { + string listText = string.Empty; + int startIndex = + DropDownStyle == ComboBoxStyle.DropDownList + && DataSource == null + && skipFirstItem + ? 1 + : 0; + for (int index = startIndex; index <= CheckBoxComboBoxListControl.Items.Count - 1; index++) + { + KryptonCheckBoxComboBoxItem item = CheckBoxComboBoxListControl.Items[index]; + if (item.Checked) + { + listText += string.IsNullOrEmpty(listText) ? item.Text : $", {item.Text}"; + } + } + return listText; + } + + private void Items_CheckBoxCheckedChanged(object sender, EventArgs e) + { + OnCheckBoxCheckedChanged(sender, e); + } + + /// + /// A function to clear/reset the list. + /// (Ubiklou : http://www.codeproject.com/KB/combobox/extending_combobox.aspx?msg=2526813#xx2526813xx) + /// + public void Clear() + { + Items.Clear(); + + if (DropDownStyle == ComboBoxStyle.DropDownList && DataSource == null) + { + MustAddHiddenItem = true; + } + } + + /// + /// Uncheck all items. + /// + public void ClearSelection() + { + foreach (KryptonCheckBoxComboBoxItem item in CheckBoxItems) + { + if (item.Checked) + { + item.Checked = false; + } + } + } + + private void CheckBoxProperties_PropertyChanged(object sender, EventArgs e) + { + foreach (KryptonCheckBoxComboBoxItem item in CheckBoxItems) + { + item.ApplyProperties(CheckBoxProperties); + } + } + + #endregion + + #region Protected + + protected void OnCheckBoxCheckedChanged(object sender, EventArgs e) + { + string ListText = GetCsvText(true); + // The DropDownList style seems to require that the text + // part of the "textbox" should match a single item. + if (DropDownStyle != ComboBoxStyle.DropDownList) + { + Text = ListText; + } + // This refreshes the Text of the first item (which is not visible) + else if (DataSource == null) + { + Items[0] = ListText; + // Keep the hidden item and first checkbox item in + // sync in order to ensure the Synchronise process + // can match the items. + CheckBoxItems[0].ComboBoxItem = ListText; + } + + EventHandler handler = CheckBoxCheckedChanged; + handler?.Invoke(sender, e); + } + + #endregion + + #region Protected Overrides + + protected override void OnDropDownStyleChanged(EventArgs e) + { + base.OnDropDownStyleChanged(e); + + if (DropDownStyle == ComboBoxStyle.DropDownList + && DataSource == null + && !DesignMode) + { + MustAddHiddenItem = true; + } + } + + protected override void OnResize(EventArgs e) + { + //Size size = new Size(Width, DropDownControl.Height); + + //_dropDown!.Size = size; + + //_dropDown.Size = new Size(DropDownWidth, DropDownHeight); + + base.OnResize(e); + } + + protected override void WndProc(ref Message m) + { + // 323 : Item Added + // 331 : Clearing + if (m.Msg == 331 + && DropDownStyle == ComboBoxStyle.DropDownList + && DataSource == null) + { + MustAddHiddenItem = true; + } + + base.WndProc(ref m); + } + + #endregion + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonCheckBoxComboBoxItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonCheckBoxComboBoxItem.cs new file mode 100644 index 000000000..7414fe33e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonCheckBoxComboBoxItem.cs @@ -0,0 +1,186 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + /// + /// The CheckBox items displayed in the Popup of the ComboBox. + /// + [ToolboxItem(false)] + public class KryptonCheckBoxComboBoxItem : KryptonCheckBox + { + #region Identity + + /// + /// + /// + /// A reference to the CheckBoxComboBox. + /// A reference to the item in the ComboBox.Items that this object is extending. + public KryptonCheckBoxComboBoxItem(KryptonCheckBoxComboBox owner, object comboBoxItem) + : base() + { + DoubleBuffered = true; + _checkBoxComboBox = owner; + _comboBoxItem = comboBoxItem; + if (_checkBoxComboBox.DataSource != null) + { + AddBindings(); + } + else + { + Text = comboBoxItem.ToString(); + } + } + + #endregion + + #region Instance Fields + + /// + /// A reference to the CheckBoxComboBox. + /// + private readonly KryptonCheckBoxComboBox _checkBoxComboBox; + + /// + /// A reference to the Item in ComboBox.Items that this object is extending. + /// + private object _comboBoxItem; + + #endregion + + #region Public + + /// + /// A reference to the Item in ComboBox.Items that this object is extending. + /// + public object ComboBoxItem + { + get => _comboBoxItem; + internal set => _comboBoxItem = value; + } + + #endregion + + #region Implementation + + /// + /// When using Data Binding operations via the DataSource property of the ComboBox. This + /// adds the required Bindings for the CheckBoxes. + /// + public void AddBindings() + { + // Note, the text uses "DisplayMemberSingleItem", not "DisplayMember" (unless its not assigned) + DataBindings.Add( + "Text", + _comboBoxItem, + _checkBoxComboBox.DisplayMemberSingleItem + ); + // The ValueMember must be a bool type property usable by the CheckBox.Checked. + DataBindings.Add( + "Checked", + _comboBoxItem, + _checkBoxComboBox.ValueMember, + false, + // This helps to maintain proper selection state in the Binded object, + // even when the controls are added and removed. + DataSourceUpdateMode.OnPropertyChanged, + false, null, null); + // Helps to maintain the Checked status of this + // checkbox before the control is visible + if (_comboBoxItem is INotifyPropertyChanged) + { + ((INotifyPropertyChanged)_comboBoxItem).PropertyChanged += + new PropertyChangedEventHandler( + CheckBoxComboBoxItem_PropertyChanged); + } + } + + internal void ApplyProperties(KryptonCheckBoxProperties properties) + { + //this.Appearance = properties.Appearance; + AutoCheck = properties.AutoCheck; + //this.AutoEllipsis = properties.AutoEllipsis; + AutoSize = properties.AutoSize; + //this.CheckAlign = properties.CheckAlign; + //this.FlatAppearance.BorderColor = properties.FlatAppearanceBorderColor; + //this.FlatAppearance.BorderSize = properties.FlatAppearanceBorderSize; + //this.FlatAppearance.CheckedBackColor = properties.FlatAppearanceCheckedBackColor; + //this.FlatAppearance.MouseDownBackColor = properties.FlatAppearanceMouseDownBackColor; + //this.FlatAppearance.MouseOverBackColor = properties.FlatAppearanceMouseOverBackColor; + //this.FlatStyle = properties.FlatStyle; + ForeColor = properties.ForeColor; + RightToLeft = properties.RightToLeft; + //this.TextAlign = properties.TextAlign; + ThreeState = properties.ThreeState; + } + + /// + /// Added this handler because the control doesn't seem + /// to initialize correctly until shown for the first + /// time, which also means the summary text value + /// of the combo is out of sync initially. + /// + private void CheckBoxComboBoxItem_PropertyChanged(object sender, PropertyChangedEventArgs e) + { + if (e.PropertyName == _checkBoxComboBox.ValueMember) + { + Checked = + (bool)_comboBoxItem + .GetType() + .GetProperty(_checkBoxComboBox.ValueMember)! + .GetValue(_comboBoxItem, null); + } + } + + #endregion + + #region Protected Overrides + + protected override void OnCheckedChanged(EventArgs e) + { + // Found that when this event is raised, the bool value of the binded item is not yet updated. + if (_checkBoxComboBox.DataSource != null) + { + PropertyInfo? pi = ComboBoxItem.GetType().GetProperty(_checkBoxComboBox.ValueMember); + pi.SetValue(ComboBoxItem, Checked, null); + } + + base.OnCheckedChanged(e); + // Forces a refresh of the Text displayed in the main TextBox of the ComboBox, + // since that Text will most probably represent a concatenation of selected values. + // Also see DisplayMemberSingleItem on the CheckBoxComboBox for more information. + if (_checkBoxComboBox.DataSource != null) + { + string oldDisplayMember = _checkBoxComboBox.DisplayMember; + _checkBoxComboBox.DisplayMember = null; + _checkBoxComboBox.DisplayMember = oldDisplayMember; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonCheckBoxComboBoxListControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonCheckBoxComboBoxListControl.cs new file mode 100644 index 000000000..b4576713a --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonCheckBoxComboBoxListControl.cs @@ -0,0 +1,210 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + /// + /// This ListControl that pops up to the User. It contains the CheckBoxComboBoxItems. + /// The items are docked DockStyle.Top in this control. + /// + [ToolboxItem(false)] + public partial class KryptonCheckBoxComboBoxListControl : ScrollableControl + { + #region Identity + + public KryptonCheckBoxComboBoxListControl(KryptonCheckBoxComboBox owner) + : base() + { + DoubleBuffered = true; + _checkBoxComboBox = owner; + _items = new KryptonCheckBoxComboBoxItemList(_checkBoxComboBox); + BackColor = SystemColors.Window; + // AutoScaleMode = AutoScaleMode.Inherit; + AutoScroll = true; + ResizeRedraw = true; + // if you don't set this, a Resize operation causes an error in the base class. + MinimumSize = new Size(1, 1); + MaximumSize = new Size(500, 500); + } + + #endregion + + #region Instance Fields + + /// + /// Simply a reference to the CheckBoxComboBox. + /// + private readonly KryptonCheckBoxComboBox _checkBoxComboBox; + + /// + /// A Typed list of ComboBoxCheckBoxItems. + /// + private readonly KryptonCheckBoxComboBoxItemList _items; + + #endregion + + #region Public + + public KryptonCheckBoxComboBoxItemList Items => _items; + + #endregion + + #region Protected Overrides + + /// + /// Prescribed by the Popup control to enable Resize operations. + /// + /// + protected override void WndProc(ref Message m) + { + if (((Parent.Parent as Popup)!).ProcessResizing(ref m)) + { + return; + } + + base.WndProc(ref m); + } + + protected override void OnVisibleChanged(EventArgs e) + { + // Synchronises the CheckBox list with the items in the ComboBox. + SynchroniseControlsWithComboBoxItems(); + base.OnVisibleChanged(e); + } + + #endregion + + #region Implementation + + /// + /// Maintains the controls displayed in the list by keeping them in sync with the actual + /// items in the combobox. (e.g. removing and adding as well as ordering) + /// + public void SynchroniseControlsWithComboBoxItems() + { + SuspendLayout(); + if (_checkBoxComboBox.MustAddHiddenItem) + { + _checkBoxComboBox.Items.Insert( + 0, _checkBoxComboBox.GetCsvText(false)); // INVISIBLE ITEM + _checkBoxComboBox.SelectedIndex = 0; + _checkBoxComboBox.MustAddHiddenItem = false; + } + + Controls.Clear(); + + #region Disposes all items that are no longer in the combo box list + + for (int index = _items.Count - 1; index >= 0; index--) + { + KryptonCheckBoxComboBoxItem item = _items[index]; + if (!_checkBoxComboBox.Items.Contains(item.ComboBoxItem)) + { + _items.Remove(item); + item.Dispose(); + } + } + + #endregion + + #region Recreate the list in the same order of the combo box items + + bool hasHiddenItem = + _checkBoxComboBox.DropDownStyle == ComboBoxStyle.DropDownList + && _checkBoxComboBox.DataSource == null + && !DesignMode; + + KryptonCheckBoxComboBoxItemList newList = new KryptonCheckBoxComboBoxItemList(_checkBoxComboBox); + for (int index0 = 0; index0 <= _checkBoxComboBox.Items.Count - 1; index0++) + { + object @object = _checkBoxComboBox.Items[index0]; + KryptonCheckBoxComboBoxItem item = null; + // The hidden item could match any other item when only + // one other item was selected. + if (index0 == 0 && hasHiddenItem && _items.Count > 0) + { + item = _items[0]; + } + else + { + int startIndex = hasHiddenItem + ? 1 // Skip the hidden item, it could match + : 0; + for (int index1 = startIndex; index1 <= _items.Count - 1; index1++) + { + if (_items[index1].ComboBoxItem == @object) + { + item = _items[index1]; + break; + } + } + } + + if (item == null) + { + item = new KryptonCheckBoxComboBoxItem(_checkBoxComboBox, @object); + item.ApplyProperties(_checkBoxComboBox.CheckBoxProperties); + } + + newList.Add(item); + item.Dock = DockStyle.Top; + } + + _items.Clear(); + _items.AddRange(newList); + + #endregion + + #region Add the items to the controls in reversed order to maintain correct docking order + + if (newList.Count > 0) + { + // This reverse helps to maintain correct docking order. + newList.Reverse(); + // If you get an error here that "Cannot convert to the desired + // type, it probably means the controls are not binding correctly. + // The Checked property is binded to the ValueMember property. + // It must be a bool for example. + Controls.AddRange(newList.ToArray()); + } + + #endregion + + // Keep the first item invisible + if (_checkBoxComboBox.DropDownStyle == ComboBoxStyle.DropDownList + && _checkBoxComboBox.DataSource == null + && !DesignMode) + { + _checkBoxComboBox.CheckBoxItems[0].Visible = false; + } + + ResumeLayout(); + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonCheckBoxComboBoxListControlContainer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonCheckBoxComboBoxListControlContainer.cs new file mode 100644 index 000000000..f2375d15c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonCheckBoxComboBoxListControlContainer.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + /// + /// A container control for the ListControl to ensure the ScrollBar on the ListControl does not + /// Paint over the Size grip. Setting the Padding or Margin on the Popup or host control does + /// not work as I expected. + /// + [ToolboxItem(false)] + public class KryptonCheckBoxComboBoxListControlContainer : UserControl + { + #region Identity + + public KryptonCheckBoxComboBoxListControlContainer() + : base() + { + BackColor = SystemColors.Window; + BorderStyle = BorderStyle.FixedSingle; + AutoScaleMode = AutoScaleMode.Inherit; + ResizeRedraw = true; + // If you don't set this, then resize operations cause an error in the base class. + MinimumSize = new Size(1, 1); + MaximumSize = new Size(500, 500); + } + + #endregion + + #region RESIZE OVERRIDE REQUIRED BY THE POPUP CONTROL + + /// + /// Prescribed by the Popup class to ensure Resize operations work correctly. + /// + /// + protected override void WndProc(ref Message m) + { + if ((Parent as Popup).ProcessResizing(ref m)) + { + return; + } + + base.WndProc(ref m); + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonFlowLayoutPanel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonFlowLayoutPanel.cs index 9a2ea9850..4f3040086 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonFlowLayoutPanel.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonFlowLayoutPanel.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonKnobControlVersion1.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonKnobControlVersion1.cs index 318db1c9d..0b777548d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonKnobControlVersion1.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonKnobControlVersion1.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -65,7 +65,7 @@ public class KryptonKnobControlVersion1 : UserControl // declare Off screen image and Offscreen graphics private Image OffScreenImage; - private Graphics gOffScreen; + private System.Drawing.Graphics gOffScreen; // An event that clients can use to be notified whenever // the Value is Changed. @@ -87,7 +87,7 @@ public KryptonKnobControlVersion1() //Create redirection object to the base palette - if (((_palette != null))) + if (_palette != null) { _palette.PalettePaint += new EventHandler(OnPalettePaint); } @@ -369,7 +369,7 @@ protected object OnValueChanged(object sender, KnobValueChangedEventArgs e) protected override void OnPaint(PaintEventArgs e) { - Graphics g = e.Graphics; + System.Drawing.Graphics g = e.Graphics; g.SmoothingMode = SmoothingMode.AntiAlias; @@ -380,7 +380,7 @@ protected override void OnPaint(PaintEventArgs e) bKnobPoint = new LinearGradientBrush(rKnob, KnobIndicatorColourBegin, KnobIndicatorColourEnd, LinearGradientMode.ForwardDiagonal); // Set background color of Image... - e.Graphics.FillRectangle(new SolidBrush(_KnobBackColour), new Rectangle(0, 0, Width, Height)); + e.Graphics.FillRectangle(new System.Drawing.SolidBrush(_KnobBackColour), new Rectangle(0, 0, Width, Height)); //gOffScreen.Clear(BackColor); // Fill knob Background to give knob effect.... gOffScreen.FillEllipse(bKnob, rKnob); @@ -390,12 +390,12 @@ protected override void OnPaint(PaintEventArgs e) gOffScreen.DrawEllipse(new Pen(_KnobBorderColour), rKnob); //if control is focused - if ((_isFocused)) + if (_isFocused) { gOffScreen.DrawEllipse(DottedPen, rKnob); } // get current position of pointer - Point Arrow = getKnobPosition(); + Point Arrow = GetKnobPosition(); // Draw pointer arrow that shows knob position Rectangle rect = new Rectangle(Arrow.X - 3, Arrow.Y - 3, 6, 6); @@ -404,19 +404,19 @@ protected override void OnPaint(PaintEventArgs e) // Draw small and large scale int i = Minimum; - if ((_ShowSmallScale)) + if (_ShowSmallScale) { for (i = Minimum; i <= Maximum; i = i + _SmallChange) { - gOffScreen.DrawLine(new Pen(ForeColor), getMarkerPoint(0, i), getMarkerPoint(_SizeSmallScaleMarker, i)); + gOffScreen.DrawLine(new Pen(ForeColor), GetMarkerPoint(0, i), GetMarkerPoint(_SizeSmallScaleMarker, i)); } } - if ((_ShowLargeScale)) + if (_ShowLargeScale) { for (i = Minimum; i <= Maximum; i = i + _LargeChange) { - gOffScreen.DrawLine(new Pen(ForeColor), getMarkerPoint(0, i), getMarkerPoint(_SizeLargeScaleMarker, i)); + gOffScreen.DrawLine(new Pen(ForeColor), GetMarkerPoint(0, i), GetMarkerPoint(_SizeLargeScaleMarker, i)); } } @@ -428,12 +428,12 @@ protected override void OnPaintBackground(PaintEventArgs e) { //base.OnPaintBackground(e); //e.Graphics.SmoothingMode = SmoothingMode.HighQuality; - e.Graphics.FillRectangle(new SolidBrush(_KnobBackColour), new Rectangle(0, 0, Width, Height)); + e.Graphics.FillRectangle(new System.Drawing.SolidBrush(_KnobBackColour), new Rectangle(0, 0, Width, Height)); } protected override void OnMouseDown(MouseEventArgs e) { - if ((isPointinRectangle(new Point(e.X, e.Y), rKnob))) + if (IsPointinRectangle(new Point(e.X, e.Y), rKnob)) { // Start Rotation of knob isKnobRotating = true; @@ -474,7 +474,7 @@ protected override void OnMouseUp(MouseEventArgs e) { // Stop rotation isKnobRotating = false; - if ((isPointinRectangle(new Point(e.X, e.Y), rKnob))) + if (IsPointinRectangle(new Point(e.X, e.Y), rKnob)) { // get value Value = getValueFromPosition(new Point(e.X, e.Y)); @@ -487,7 +487,7 @@ protected override void OnMouseMove(MouseEventArgs e) // -------------------------------------- // Following Handles Knob Rotating // -------------------------------------- - if ((isKnobRotating == true)) + if (isKnobRotating == true) { Cursor = Cursors.Hand; Point p = new Point(e.X, e.Y); @@ -520,17 +520,17 @@ protected override void OnKeyDown(KeyEventArgs e) // -------------------------------------------------------- // Handles knob rotation with up,down,left and right keys // -------------------------------------------------------- - if ((e.KeyCode == Keys.Up | e.KeyCode == Keys.Right)) + if (e.KeyCode == Keys.Up | e.KeyCode == Keys.Right) { - if ((_Value < Maximum)) + if (_Value < Maximum) { Value = _Value + 1; Invalidate(); } } - else if ((e.KeyCode == Keys.Down | e.KeyCode == Keys.Left)) + else if (e.KeyCode == Keys.Down | e.KeyCode == Keys.Left) { - if ((_Value > Minimum)) + if (_Value > Minimum) { Value = _Value - 1; Invalidate(); @@ -542,21 +542,21 @@ private void setDimensions() { // get smaller from height and width int size = Width; - if ((Width > Height)) + if (Width > Height) { size = Height; } // allow 10% gap on all side to determine size of knob rKnob = new Rectangle((int)Math.Round((double)(size * 0.1)), (int)Math.Round((double)(size * 0.1)), (int)Math.Round((double)(size * 0.8)), (int)Math.Round((double)(size * 0.8))); rScale = new Rectangle(2, 2, size - 4, size - 4); - pKnob = new Point((int)Math.Round((double)(rKnob.X + (((double)rKnob.Width) / 2.0))), (int)Math.Round((double)(rKnob.Y + (((double)rKnob.Height) / 2.0)))); + pKnob = new Point((int)Math.Round((double)(rKnob.X + (double)rKnob.Width / 2.0)), (int)Math.Round((double)(rKnob.Y + (double)rKnob.Height / 2.0))); // create offscreen image OffScreenImage = new Bitmap(Width, Height); // create offscreen graphics - gOffScreen = Graphics.FromImage(OffScreenImage); + gOffScreen = System.Drawing.Graphics.FromImage(OffScreenImage); } - private void Knob_Resize(object sender, System.EventArgs e) + private void Knob_Resize(object sender, EventArgs e) { setDimensions(); Invalidate(); @@ -564,15 +564,15 @@ private void Knob_Resize(object sender, System.EventArgs e) // gets knob position that is to be drawn on control. - private Point getKnobPosition() + private Point GetKnobPosition() { double degree = 270 * Value / (Maximum - Minimum); degree = (degree + 135) * Math.PI / 180; - Point Pos = (new Point(0, 0)); - Pos.X = (int)Math.Round((double)(((Math.Cos(degree) * ((((double)rKnob.Width) / 2.0) - 10.0)) + rKnob.X) + (((double)rKnob.Width) / 2.0))); - Pos.Y = (int)Math.Round((double)(((Math.Sin(degree) * ((((double)rKnob.Width) / 2.0) - 10.0)) + rKnob.Y) + (((double)rKnob.Height) / 2.0))); - return Pos; + Point pos = new Point(0, 0); + pos.X = (int)Math.Round(Math.Cos(degree) * (rKnob.Width / 2.0 - 10.0) + rKnob.X + rKnob.Width / 2.0); + pos.Y = (int)Math.Round(Math.Sin(degree) * (rKnob.Width / 2.0 - 10.0) + rKnob.Y + rKnob.Height / 2.0); + return pos; } @@ -580,14 +580,14 @@ private Point getKnobPosition() // distance from center // value that is to be marked // Point that describes marker position - private Point getMarkerPoint(int length, int Value) + private Point GetMarkerPoint(int length, int Value) { double degree = 270 * Value / (Maximum - Minimum); degree = (degree + 135) * Math.PI / 180; Point Pos = new Point(0, 0); - Pos.X = (int)Math.Round((double)(((Math.Cos(degree) * (((((double)rKnob.Width) / 2.0) - length) + 7.0)) + rKnob.X) + (((double)rKnob.Width) / 2.0))); - Pos.Y = (int)Math.Round((double)(((Math.Sin(degree) * (((((double)rKnob.Width) / 2.0) - length) + 7.0)) + rKnob.Y) + (((double)rKnob.Height) / 2.0))); + Pos.X = (int)Math.Round((double)(Math.Cos(degree) * ((double)rKnob.Width / 2.0 - length + 7.0) + rKnob.X + (double)rKnob.Width / 2.0)); + Pos.Y = (int)Math.Round((double)(Math.Sin(degree) * ((double)rKnob.Width / 2.0 - length + 7.0) + rKnob.Y + (double)rKnob.Height / 2.0)); return Pos; } @@ -603,27 +603,27 @@ private int getValueFromPosition(Point p) int v = 0; try { - if ((p.X <= pKnob.X)) + if (p.X <= pKnob.X) { degree = (pKnob.Y - p.Y) / (pKnob.X - p.X); degree = Math.Atan(degree); - degree = (degree) * (180 / Math.PI) + 45; - v = (int)Math.Round((double)((degree * (Maximum - Minimum)) / 270.0)); + degree = degree * (180 / Math.PI) + 45; + v = (int)Math.Round((double)(degree * (Maximum - Minimum) / 270.0)); } - else if ((p.X > pKnob.X)) + else if (p.X > pKnob.X) { degree = (p.Y - pKnob.Y) / (p.X - pKnob.X); degree = Math.Atan(degree); - degree = 225 + (degree) * (180 / Math.PI); - v = (int)Math.Round((double)((degree * (Maximum - Minimum)) / 270.0)); + degree = 225 + degree * (180 / Math.PI); + v = (int)Math.Round((double)(degree * (Maximum - Minimum) / 270.0)); } - if ((v > Maximum)) + if (v > Maximum) { v = Maximum; } - if ((v < Minimum)) + if (v < Minimum) { v = Minimum; } @@ -642,17 +642,17 @@ public Color getDarkColor(Color c, byte d) byte g = 0; byte b = 0; - if ((c.R > d)) + if (c.R > d) { r = (byte)(c.R - d); } - if ((c.G > d)) + if (c.G > d) { g = (byte)(c.G - d); } - if ((c.B > d)) + if (c.B > d) { b = (byte)(c.B - d); } @@ -667,17 +667,17 @@ public Color getLightColor(Color c, byte d) byte g = 255; byte b = 255; - if (((int)c.R + (int)d <= 255)) + if ((int)c.R + (int)d <= 255) { r = (byte)(c.R + d); } - if (((int)c.G + (int)d <= 255)) + if ((int)c.G + (int)d <= 255) { g = (byte)(c.G + d); } - if (((int)c.B + (int)d <= 255)) + if ((int)c.B + (int)d <= 255) { b = (byte)(c.B + d); } @@ -690,17 +690,13 @@ public Color getLightColor(Color c, byte d) // Point to be Chaecked // Rectangle // true is Point is in rectangle, else false - public bool isPointinRectangle(Point p, Rectangle r) + public bool IsPointinRectangle(Point p, Rectangle r) { - bool flag = false; - if ((p.X > r.X & p.X < r.X + r.Width & p.Y > r.Y & p.Y < r.Y + r.Height)) - { - flag = true; - } + bool flag = p.X > r.X & p.X < r.X + r.Width & p.Y > r.Y & p.Y < r.Y + r.Height; return flag; } - public void DrawInsetCircle(ref Graphics g, ref Rectangle r, Pen p) + public void DrawInsetCircle(ref System.Drawing.Graphics g, ref Rectangle r, Pen p) { int i; Pen p1 = new Pen(getDarkColor(p.Color, 50)); @@ -724,13 +720,13 @@ private void OnPalettePaint(object sender, PaletteLayoutEventArgs e) private void OnGlobalPaletteChanged(object sender, EventArgs e) { - if (((_palette != null))) + if (_palette != null) { _palette.PalettePaint -= new EventHandler(OnPalettePaint); } _palette = KryptonManager.CurrentGlobalPalette; _paletteRedirect.Target = _palette; - if (((_palette != null))) + if (_palette != null) { _palette.PalettePaint += new EventHandler(OnPalettePaint); InitColours(); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonKnobControlVersion2.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonKnobControlVersion2.cs index 723e2af99..665c90ee3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonKnobControlVersion2.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonKnobControlVersion2.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -68,7 +68,7 @@ public enum KnobPointerStyles private Image _offScreenImage; - private Graphics _gOffScreen; + private System.Drawing.Graphics _gOffScreen; private KnobPointerStyles _pointerStyle = KnobPointerStyles.CIRCLE; @@ -519,7 +519,7 @@ public KryptonKnobControlVersion2() SetDimensions(); - if (((_palette != null))) + if (_palette != null) { _palette.PalettePaint += OnPalettePaint; } @@ -543,7 +543,7 @@ public KryptonKnobControlVersion2() #region Overrides protected override void OnPaint(PaintEventArgs e) { - Graphics g = e.Graphics; + System.Drawing.Graphics g = e.Graphics; // Set background color of Image... _gOffScreen.Clear(BackColor); // Fill knob Background to give knob effect.... @@ -654,7 +654,7 @@ protected override void OnMouseWheel(MouseEventArgs e) if (_isFocused && _isKnobRotating && KryptonKnobUtilities.IsPointinRectangle(new Point(e.X, e.Y), _rKnob)) { // the Delta value is always 120, as explained in MSDN - int v = (e.Delta / 120) * (_maximum - _minimum) / _mouseWheelBarPartitions; + int v = e.Delta / 120 * (_maximum - _minimum) / _mouseWheelBarPartitions; SetProperValue(Value + v); // Avoid to send MouseWheel event to the parent container @@ -679,7 +679,7 @@ protected override void OnKeyDown(KeyEventArgs e) //-------------------------------------------------------- // Handles knob rotation with up,down,left and right keys //-------------------------------------------------------- - if (e.KeyCode == Keys.Up || e.KeyCode == Keys.Right) + if (e.KeyCode is Keys.Up or Keys.Right) { if (_value < _maximum) { @@ -688,7 +688,7 @@ protected override void OnKeyDown(KeyEventArgs e) this.Refresh(); } - else if (e.KeyCode == Keys.Down || e.KeyCode == Keys.Left) + else if (e.KeyCode is Keys.Down or Keys.Left) { if (_value > _minimum) { @@ -735,21 +735,21 @@ private void InitializeComponent() /// /// Draw the pointer of the knob (a small button inside the main button) /// - /// - private void DrawPointer(Graphics Gr) + /// + private void DrawPointer(System.Drawing.Graphics g) { try { - float radius = (float)(_rKnob.Width / 2); + float radius = _rKnob.Width / 2; // Draw a line if (_pointerStyle == KnobPointerStyles.LINE) { int l = (int)radius / 2; int w = l / 4; - Point[] pt = GetKnobLine(Gr, l); + Point[] pt = GetKnobLine(g, l); - Gr.DrawLine(new Pen(_pointerColour, w), pt[0], pt[1]); + g.DrawLine(new Pen(_pointerColour, w), pt[0], pt[1]); } else @@ -770,19 +770,19 @@ private void DrawPointer(Graphics Gr) if (_scaleTypefaceAutoSize) { // Use font family = _scaleTypeface, but size = automatic - fSize = (float)(6F * _drawRatio); + fSize = 6F * _drawRatio; if (fSize < 6) { fSize = 6; } - strsize = Gr.MeasureString(str, new Font(_scaleTypeface.FontFamily, fSize)); + strsize = g.MeasureString(str, new Font(_scaleTypeface.FontFamily, fSize)); } else { // Use font family = _scaleTypeface, but size = fixed fSize = _scaleTypeface.Size; - strsize = Gr.MeasureString(str, _scaleTypeface); + strsize = g.MeasureString(str, _scaleTypeface); } int strw = (int)strsize.Width; @@ -800,9 +800,9 @@ private void DrawPointer(Graphics Gr) //KryptonKnobUtilities.DrawInsetCircle(ref Gr, rPointer, new Pen(_pointerColour)); - KryptonKnobUtilities.DrawInsetCircle(ref Gr, rPointer, new Pen(KryptonKnobUtilities.GetLightColour(_pointerColour, 55))); + KryptonKnobUtilities.DrawInsetCircle(ref g, rPointer, new Pen(KryptonKnobUtilities.GetLightColour(_pointerColour, 55))); - Gr.FillEllipse(_brushKnobPointer, rPointer); + g.FillEllipse(_brushKnobPointer, rPointer); } } @@ -815,10 +815,10 @@ private void DrawPointer(Graphics Gr) /// /// Draw graduations /// - /// + /// /// Knob rectangle /// - private bool DrawDivisions(Graphics Gr, RectangleF rc) + private bool DrawDivisions(Graphics g, RectangleF rc) { if (this == null) { @@ -842,8 +842,8 @@ private bool DrawDivisions(Graphics Gr, RectangleF rc) Font font; - Pen penL = new Pen(_scaleColour, (2 * _drawRatio)); - Pen penS = new Pen(_scaleColour, (1 * _drawRatio)); + Pen penL = new Pen(_scaleColour, 2 * _drawRatio); + Pen penS = new Pen(_scaleColour, 1 * _drawRatio); SolidBrush br = new SolidBrush(_scaleColour); @@ -859,7 +859,7 @@ private bool DrawDivisions(Graphics Gr, RectangleF rc) string strval = strvalmax.Length > strvalmin.Length ? strvalmax : strvalmin; double val = Convert.ToDouble(strval); //double val = _maximum; - String str = String.Format("{0,0:D}", (int)val); + string str = $"{(int)val,0:D}"; float fSize; SizeF strsize; @@ -877,7 +877,7 @@ private bool DrawDivisions(Graphics Gr, RectangleF rc) } font = new Font(_scaleTypeface.FontFamily, fSize); - strsize = Gr.MeasureString(str, font); + strsize = g.MeasureString(str, font); int strw = (int)strsize.Width; int strh = (int)strsize.Height; @@ -889,13 +889,13 @@ private bool DrawDivisions(Graphics Gr, RectangleF rc) for (; n < _scaleDivisions; n++) { // draw divisions - ptStart.X = (float)(cx + (radius) * Math.Cos(currentAngle)); - ptStart.Y = (float)(cy + (radius) * Math.Sin(currentAngle)); + ptStart.X = (float)(cx + radius * Math.Cos(currentAngle)); + ptStart.Y = (float)(cy + radius * Math.Sin(currentAngle)); ptEnd.X = (float)(cx + (radius + _gradLength) * Math.Cos(currentAngle)); ptEnd.Y = (float)(cy + (radius + _gradLength) * Math.Sin(currentAngle)); - Gr.DrawLine(penL, ptStart, ptEnd); + g.DrawLine(penL, ptStart, ptEnd); //Draw graduation values @@ -905,18 +905,18 @@ private bool DrawDivisions(Graphics Gr, RectangleF rc) // If autosize if (_scaleTypefaceAutoSize) { - strsize = Gr.MeasureString(str, new Font(_scaleTypeface.FontFamily, fSize)); + strsize = g.MeasureString(str, new Font(_scaleTypeface.FontFamily, fSize)); } else { - strsize = Gr.MeasureString(str, new Font(_scaleTypeface.FontFamily, _scaleTypeface.Size)); + strsize = g.MeasureString(str, new Font(_scaleTypeface.FontFamily, _scaleTypeface.Size)); } if (_drawDivInside) { // graduations values inside the knob - l = (int)radius - (wmax / 2) - 2; + l = (int)radius - wmax / 2 - 2; tx = (float)(cx + l * Math.Cos(currentAngle)); ty = (float)(cy + l * Math.Sin(currentAngle)); @@ -932,7 +932,7 @@ private bool DrawDivisions(Graphics Gr, RectangleF rc) ty = (float)(cy + l * Math.Sin(currentAngle)); } - Gr.DrawString(str, + g.DrawString(str, font, br, tx - (float)(strsize.Width * 0.5), @@ -970,7 +970,7 @@ private bool DrawDivisions(Graphics Gr, RectangleF rc) ptEnd.X = (float)(cx + (radius + _gradLength / 2) * Math.Cos(currentAngle)); ptEnd.Y = (float)(cy + (radius + _gradLength / 2) * Math.Sin(currentAngle)); - Gr.DrawLine(penS, ptStart, ptEnd); + g.DrawLine(penS, ptStart, ptEnd); } } } @@ -1005,7 +1005,7 @@ private void SetDimensions() if (_showLargeScale) { - Graphics Gr = this.CreateGraphics(); + System.Drawing.Graphics Gr = this.CreateGraphics(); string strvalmax = _maximum.ToString(); string strvalmin = _minimum.ToString(); string strval = strvalmax.Length > strvalmin.Length ? strvalmax : strvalmin; @@ -1081,7 +1081,7 @@ private void SetDimensions() // create offscreen image this._offScreenImage = new Bitmap(this.Width, this.Height); // create offscreen graphics - this._gOffScreen = Graphics.FromImage(_offScreenImage); + this._gOffScreen = System.Drawing.Graphics.FromImage(_offScreenImage); // Depends on retangle dimensions @@ -1144,7 +1144,7 @@ private Point GetKnobPosition(int l) /// /// /// - private Point[] GetKnobLine(Graphics g, int l) + private Point[] GetKnobLine(System.Drawing.Graphics g, int l) { Point[] pret = new Point[2]; @@ -1192,8 +1192,8 @@ private Point[] GetKnobLine(Graphics g, int l) if (_drawDivInside) { // Center (from) - Pos.X = (int)(cx + (radius / 10) * Math.Cos(degree)); - Pos.Y = (int)(cy + (radius / 10) * Math.Sin(degree)); + Pos.X = (int)(cx + radius / 10 * Math.Cos(degree)); + Pos.Y = (int)(cy + radius / 10 * Math.Sin(degree)); pret[0] = new Point(Pos.X, Pos.Y); // External (to) @@ -1234,7 +1234,7 @@ private int GetValueFromPosition(Point p) degree = (float)(_pKnob.Y - p.Y) / (float)(_pKnob.X - p.X); degree = (float)Math.Atan(degree); - degree = (degree) * (float)(180 / Math.PI) + (180 - _startAngle); + degree = degree * (float)(180 / Math.PI) + (180 - _startAngle); } else if (p.X > _pKnob.X) @@ -1242,7 +1242,7 @@ private int GetValueFromPosition(Point p) degree = (float)(p.Y - _pKnob.Y) / (float)(p.X - _pKnob.X); degree = (float)Math.Atan(degree); - degree = (degree) * (float)(180 / Math.PI) + 360 - _startAngle; + degree = degree * (float)(180 / Math.PI) + 360 - _startAngle; } // round to the nearest value (when you click just before or after a graduation!) @@ -1287,7 +1287,7 @@ private void KryptonKnobControlEnhanced_Resize(object sender, EventArgs e) private void OnGlobalPaletteChanged(object sender, EventArgs e) { - if (((_palette != null))) + if (_palette != null) { _palette.PalettePaint -= OnPalettePaint; } @@ -1296,7 +1296,7 @@ private void OnGlobalPaletteChanged(object sender, EventArgs e) _paletteRedirect.Target = _palette; - if (((_palette != null))) + if (_palette != null) { _palette.PalettePaint += OnPalettePaint; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonMarqueeLabel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonMarqueeLabel.cs index 2f4e9a1b9..978c25679 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonMarqueeLabel.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonMarqueeLabel.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -64,7 +64,7 @@ public KryptonMarqueeLabel() /// The instance containing the event data. private void MarqueeTimer_Tick(object sender, EventArgs e) { - offset = (offset - Speed); + offset = offset - Speed; if (offset < -ClientSize.Width) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonPasswordTextBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonPasswordTextBox.cs new file mode 100644 index 000000000..3904039ae --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonPasswordTextBox.cs @@ -0,0 +1,609 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +#region Original MIT License + +/* + * Source code for _PasswordTextBox Control_ is Copyright © 2016 + * [Nils Jonsson][mail] and [contributors][contributors]. + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 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. + * + * [mail]: mailto:passwordtextbox@nilsjonsson.com "send email to Nils Jonsson" + * [contributors]: https://github.com/njonsson/PasswordTextBox-Control/contributors "PasswordTextBox Control contributors at GitHub" + */ + +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + [DefaultProperty("PasswordCharDelay")] + [Description("Enables the user to enter password input, momentarily showing each character entered.")] + [ToolboxBitmap(typeof(KryptonTextBox))] + [ToolboxItem(true)] + public class KryptonPasswordTextBox : KryptonTextBox + { + #region Instance Fields + + private char _passwordChar; + private int _passwordCharDelay; + private string _textPrevious; + private ITimer? _timer; + + #endregion + + #region Functions + + [EditorBrowsable(EditorBrowsableState.Never)] + public static Func IsFontSmoothingEnabled = () => SystemInformation.IsFontSmoothingEnabled; + + [EditorBrowsable(EditorBrowsableState.Never)] + public static Func NewGraphics = self => new GraphicsExtended(self); + + [EditorBrowsable(EditorBrowsableState.Never)] + public static Func NewSolidBrush = color => new SolidBrushExtended(color); + + [EditorBrowsable(EditorBrowsableState.Never)] + public static Func NewTimer = (autoReset, interval, synchronizingObject) => new TimerExtended(autoReset, interval, synchronizingObject); + + #endregion + + #region Constants + + + /// + /// The default value of . + /// + public const char DefaultPasswordChar = '\0'; + + /// + /// The default value of . + /// + public const int DefaultPasswordCharDelay = 1000; + + /// + /// The default value of . + /// + public const bool DefaultUseSystemPasswordChar = true; + + #endregion + + #region Identity + + public KryptonPasswordTextBox() + { + _passwordChar = DefaultPasswordChar; + + _passwordCharDelay = DefaultPasswordCharDelay; + + base.UseSystemPasswordChar = DefaultUseSystemPasswordChar; + + SetUpTimer(true); + } + + #endregion + + #region Events + + /// + /// Occurs before the property value changes. + /// + public event EventHandler> PasswordCharChanging; + + /// + /// Occurs when the property value changes. + /// + public event EventHandler> PasswordCharChanged; + + /// + /// Occurs before the property value + /// changes. + /// + public event EventHandler> PasswordCharDelayChanging; + + /// + /// Occurs when the property value + /// changes. + /// + public event EventHandler> PasswordCharDelayChanged; + + /// + /// Occurs before the property value + /// changes. + /// + public event EventHandler> UseSystemPasswordCharChanging; + + /// + /// Occurs when the property value + /// changes. + /// + public event EventHandler> UseSystemPasswordCharChanged; + + #endregion + + #region Hidden Properties + + /*[Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Multiline + { + get { return base.Multiline; } + + set + { + if (value) + { + throw new ArgumentException($"{GetType().FullName} does not support Multiline."); + } + } + }*/ + + #endregion + + #region Public + + /// + /// Gets or sets the character used to mask characters of a password in + /// a control. + /// + /// A . Set the value of this property to + /// '\0' (character value) if you do not want the control to mask + /// characters as they are typed. Equals 0 (character value) by default. + [DefaultValue(DefaultPasswordChar)] + [Description("Indicates the character to display for password input in a KryptonPasswordTextBox control.")] + public new char PasswordChar + { + get => _passwordChar; + + set + { + if ((_passwordChar == value) && (base.PasswordChar == value)) + { + return; + } + + var eventArgs = CancelChangeEventArgs.DoIf(this, + PasswordCharChanging, + OnPasswordCharChanging, + PasswordChar, + value); + if (eventArgs.Cancel) + { + return; + } + + var oldValue = PasswordChar; + _passwordChar = base.PasswordChar = value; + ChangeEventArgs.DoIf(this, + PasswordCharChanged, + OnPasswordCharChanged, + oldValue, + PasswordChar); + } + } + + /// + /// Gets or sets the time in milliseconds during which password input is + /// legible before appearing as the password character. + /// + /// Value is less than or + /// equal to zero. + [Category("Behavior")] + [DefaultValue(DefaultPasswordCharDelay)] + [Description("Indicates the time in milliseconds during which password input is legible before appearing as the password character.")] + public int PasswordCharDelay + { + get => _passwordCharDelay; + + set + { + var t = _timer; + if (ReferenceEquals(t, null)) + { + System.Diagnostics.Debug.WriteLine($"Ignoring {GetType().FullName}#PasswordCharDelay property setting {value} at:"); +#if DEBUG + Utilities.DebugWithIndentation(() => Utilities.DebugStackTrace()); +#endif + return; + } + + if ((_passwordCharDelay == value) && ((int)t.Interval == value)) + { + return; + } + + var eventArgs = CancelChangeEventArgs.DoIf(this, + PasswordCharDelayChanging, + OnPasswordCharDelayChanging, + PasswordCharDelay, + value); + if (eventArgs.Cancel) + { + return; + } + + try + { + t.Interval = value; + } + catch (ArgumentException) + { + throw new ArgumentOutOfRangeException(null, + value, + @"Must be greater than zero."); + } + + var oldValue = PasswordCharDelay; + _passwordCharDelay = value; + ChangeEventArgs.DoIf(this, + PasswordCharDelayChanged, + OnPasswordCharDelayChanged, + oldValue, + PasswordCharDelay); + } + } + + /// + /// Computes the password character actually in effect, based on the + /// values of and + /// . + /// + /// A . + [Browsable(false)] + public char PasswordCharEffective => + // ReSharper disable once ConvertPropertyToExpressionBody + UseSystemPasswordChar ? base.PasswordChar : _passwordChar; + + /// + /// Gets or sets a value indicating whether the text in the + /// control should appear as the default + /// password character. + /// + [DefaultValue(DefaultUseSystemPasswordChar)] + [Description("Indicates if the text in the KryptonPasswordTextBox control should appear as the default password character.")] + public new bool UseSystemPasswordChar + { + get => base.UseSystemPasswordChar; + + set + { + if (base.UseSystemPasswordChar == value) + { + return; + } + + var eventArgs = CancelChangeEventArgs.DoIf(this, + UseSystemPasswordCharChanging, + OnUseSystemPasswordCharChanging, + UseSystemPasswordChar, + value); + if (eventArgs.Cancel) + { + return; + } + + var oldValue = UseSystemPasswordChar; + base.UseSystemPasswordChar = value; + ChangeEventArgs.DoIf(this, + UseSystemPasswordCharChanged, + OnUseSystemPasswordCharChanged, + oldValue, + UseSystemPasswordChar); + } + } + + #endregion + + #region Overrides + + /// + /// Disposes unmanaged resources and, optionally, managed resources. + /// + /// If true, managed resources will be + /// disposed. + protected override void Dispose(bool disposing) + { + if (disposing) + { + SetUpTimer(false); + } + + base.Dispose(disposing); + } + + #endregion + + #region Virtuals + + /// + /// Raises the event with the + /// specified of . + /// + /// A of + /// . + /// is + /// null.> + protected virtual void OnPasswordCharChanged(ChangeEventArgs e) + { + if (ReferenceEquals(e, null)) + { + throw new ArgumentNullException(nameof(e)); + } + + if (!ReferenceEquals(PasswordCharChanged, null)) + { + PasswordCharChanged(this, e); + } + } + + /// + /// Raises the event with the + /// specified of + /// . + /// + /// A of + /// . + /// is + /// null.> + protected virtual void OnPasswordCharChanging(CancelChangeEventArgs e) + { + if (ReferenceEquals(e, null)) + { + throw new ArgumentNullException(nameof(e)); + } + + if (!ReferenceEquals(PasswordCharChanging, null)) + { + PasswordCharChanging(this, e); + } + } + + /// + /// Raises the event with the + /// specified of . + /// + /// A of + /// . + /// is + /// null.> + protected virtual void OnPasswordCharDelayChanged(ChangeEventArgs e) + { + if (ReferenceEquals(e, null)) + { + throw new ArgumentNullException(nameof(e)); + } + + if (!ReferenceEquals(PasswordCharDelayChanged, null)) + { + PasswordCharDelayChanged(this, e); + } + } + + /// + /// Raises the event with the + /// specified of + /// . + /// + /// A of + /// . + /// is + /// null.> + protected virtual void OnPasswordCharDelayChanging(CancelChangeEventArgs e) + { + if (ReferenceEquals(e, null)) + { + throw new ArgumentNullException(nameof(e)); + } + + if (!ReferenceEquals(PasswordCharDelayChanging, null)) + { + PasswordCharDelayChanging(this, e); + } + } + + /// + /// Raises the event with the + /// specified of . + /// + /// A of + /// . + /// is + /// null.> + protected virtual void OnUseSystemPasswordCharChanged(ChangeEventArgs e) + { + if (ReferenceEquals(e, null)) + { + throw new ArgumentNullException(nameof(e)); + } + + if (!ReferenceEquals(UseSystemPasswordCharChanged, null)) + { + UseSystemPasswordCharChanged(this, e); + } + } + + /// + /// Raises the event with + /// the specified of + /// . + /// + /// A of + /// . + /// is + /// null.> + protected virtual void OnUseSystemPasswordCharChanging(CancelChangeEventArgs e) + { + if (ReferenceEquals(e, null)) + { + throw new ArgumentNullException(nameof(e)); + } + + if (!ReferenceEquals(UseSystemPasswordCharChanging, null)) + { + UseSystemPasswordCharChanging(this, e); + } + } + + #endregion + + #region Overrides + + /// + /// Raises the event with the + /// specified . + /// + /// An . + /// is + /// null.> + protected override void OnTextChanged(EventArgs e) + { + if (ReferenceEquals(e, null)) + { + throw new ArgumentNullException(nameof(e)); + } + + _timer?.Stop(); + _timer?.Start(); + + var text = Text; + if ((0 < text.Length) && + (text.Length <= SelectionStart) && + ((_textPrevious).Length < text.Length)) + { + PaintUnobscured(text.Substring(text.Length - 1, 1), + text.Length - 1); + } + _textPrevious = text; + + base.OnTextChanged(e); + } + + #endregion + + #region Protected + + /// + /// Paints the specified at the specified + /// . + /// + /// A . + /// + /// + /// is less than zero or not less than + /// . + protected void PaintUnobscured(string @string, int position) + { + if ((position < 0) || (TextLength <= position)) + { + throw new ArgumentOutOfRangeException(nameof(position), + position, + @"Must be greater than or equal to 0 and less than the value of TextLength."); + } + + // If we're not obscuring the text at all then there's no need + // to paint unobscured text over it. + if (PasswordCharEffective == '\0') + { + return; + } + + if (string.IsNullOrEmpty(@string)) + { + return; + } + + using (var graphics = NewGraphics(this)) + { + if (IsFontSmoothingEnabled()) + { + graphics.TextRenderingHint = TextRenderingHint.AntiAlias; + } + using (var foreBrush = NewSolidBrush(ForeColor)) + { + using (var backBrush = NewSolidBrush(BackColor)) + { + var obscuredNewText = new string(PasswordCharEffective, + @string.Length); + var sizeOfObscuredNewText = graphics.MeasureString(obscuredNewText, + Font); + var point = GetPositionFromCharIndex(position); + point.Offset(-(int)Math.Round(Math.Pow(Font.SizeInPoints, 0.15)), + (int)Math.Round(Math.Pow(Font.SizeInPoints, 0.05))); + + graphics.FillRectangle(backBrush, + new RectangleF(point, + sizeOfObscuredNewText)); + graphics.DrawString(@string, Font, foreBrush, point); + } + } + } + } + + #endregion + + #region Implementation + + private void SetUpTimer(bool settingUp) + { + if (settingUp) + { + System.Diagnostics.Debug.Assert(ReferenceEquals(_timer, null)); + + _timer = NewTimer(false, PasswordCharDelay, this); + _timer.Elapsed += timer_Elapsed; + } + else + { + _timer?.Dispose(); + _timer = null; + } + } + + // ReSharper disable once InconsistentNaming + private void timer_Elapsed(object sender, ElapsedEventArgs e) + { + Invalidate(); + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonPopupComboBox.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonPopupComboBox.Designer.cs new file mode 100644 index 000000000..806729189 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonPopupComboBox.Designer.cs @@ -0,0 +1,41 @@ +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + partial class KryptonPopupComboBox + { + /// + /// 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(); + } + + if (_dropDown != null) + { + _dropDown.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + + #endregion + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonPopupComboBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonPopupComboBox.cs new file mode 100644 index 000000000..564567db0 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonPopupComboBox.cs @@ -0,0 +1,167 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + [ToolboxBitmap(typeof(KryptonComboBox)), ToolboxItem(true), Description("Displays an editable text box with a drop-down list of permitted values.")] + public partial class KryptonPopupComboBox : KryptonComboBox + { + #region Instance Fields + + private Control _dropDownControl; + + protected Popup? _dropDown; + + #endregion + + #region Identity + + public KryptonPopupComboBox() + { + InitializeComponent(); + + base.DropDownHeight = base.DropDownWidth = 1; + + IntegralHeight = false; + } + + #endregion + + #region Public + + public Control DropDownControl + { + get => _dropDownControl; + + set + { + if (_dropDownControl == value) + { + return; + } + + _dropDownControl = value; + + _dropDown = new Popup(value); + } + } + + #endregion + + #region Implementation + + /// + /// Shows the drop down. + /// + public void ShowDropDown() + { + _dropDown?.Show(this); + } + + /// + /// Hides the drop down. + /// + public void HideDropDown() + { + _dropDown?.Hide(); + } + + #endregion + + #region Protected Overrides + + [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] + protected override void WndProc(ref Message m) + { + if (NativeMethods.HIWORD(m.WParam) == NativeMethods.CBN_DROPDOWN) + { + // Blocks a redisplay when the user closes the control by clicking + // on the combobox. + TimeSpan timeSpan = DateTime.Now.Subtract(_dropDown!.LastClosedTimeStamp); + if (timeSpan.TotalMilliseconds > 500) + { + ShowDropDown(); + } + + return; + } + + base.WndProc(ref m); + } + + #endregion + + #region Removed Designer + + /// This property is not relevant for this class. + /// This property is not relevant for this class. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), EditorBrowsable(EditorBrowsableState.Never)] + public new int DropDownWidth + { + get => base.DropDownWidth; + set => base.DropDownWidth = value; + } + + /// This property is not relevant for this class. + /// This property is not relevant for this class. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), EditorBrowsable(EditorBrowsableState.Never)] + public new int DropDownHeight + { + get => base.DropDownHeight; + set + { + _dropDown!.Height = value; + base.DropDownHeight = value; + } + } + + /// This property is not relevant for this class. + /// This property is not relevant for this class. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), EditorBrowsable(EditorBrowsableState.Never)] + public new bool IntegralHeight + { + get => base.IntegralHeight; + set => base.IntegralHeight = value; + } + + /// This property is not relevant for this class. + /// This property is not relevant for this class. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), EditorBrowsable(EditorBrowsableState.Never)] + public new ComboBox.ObjectCollection Items => base.Items; + + /// This property is not relevant for this class. + /// This property is not relevant for this class. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), EditorBrowsable(EditorBrowsableState.Never)] + public new int ItemHeight + { + get => base.ItemHeight; + set => base.ItemHeight = value; + } + + #endregion + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonProgressBarExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonProgressBarExtended.cs index 898e5f1ee..b6d44f661 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonProgressBarExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonProgressBarExtended.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -59,22 +59,22 @@ public class KryptonProgressBarExtended : ProgressBar private int _fade = 150; - private SolidBrush _fadeBrush; + private SolidBrush? _fadeBrush; #endregion #region Public Properties - // + /// /// Gets or sets the opacity of the white overlay brush which fades - /// the background colors of the . + /// the background colors of the . /// - /// An representing the alpha + /// An representing the alpha /// value of the overlay color. The default is 150. /// /// You can use this property to manipulate the density of the background coloring of this control, - /// to allow for better readability of any text within the . You can use - /// the and properties + /// to allow for better readability of any text within the . You can use + /// the and properties /// to further optimize the display of text. /// /// Acceptable values for this property are between 0 and 255 inclusive. The default is 150; @@ -89,7 +89,7 @@ public int Fade get => _fade; set { - if (value < 0 || value > 255) + if (value is < 0 or > 255) { object[] str = new object[] { value }; throw new ArgumentOutOfRangeException("value", $"A value of '{str}' is not valid for 'Fade'. 'Fade' must be between 0 and 255."); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonProgressBarExtendedVersion1.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonProgressBarExtendedVersion1.cs index 115f96a43..7e4128d26 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonProgressBarExtendedVersion1.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonProgressBarExtendedVersion1.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,6 +25,8 @@ */ #endregion +using Timer = System.Windows.Forms.Timer; + namespace Krypton.Toolkit.Suite.Extended.Controls { [Obsolete(@"Please use the native KryptonProgressBar instead.")] @@ -337,7 +339,7 @@ public KryptonProgressBarExtendedVersion1() BackColor = Color.Transparent; - if (!(InDesignMode())) + if (!InDesignMode()) { _glowAnimationTimer.Tick += GlowAnimationTimer_Tick; @@ -396,7 +398,7 @@ private void DrawBarShadows(Graphics g) g.FillRectangle(lg, lr); Rectangle rr = new Rectangle(this.Width - 3, 2, 15, this.Height - 3); - rr.X = System.Convert.ToInt32((int)((Value * 1.0F / (MaximumValue - MinimumValue) * this.Width) - 14)); + rr.X = System.Convert.ToInt32((int)(Value * 1.0F / (MaximumValue - MinimumValue) * this.Width - 14)); LinearGradientBrush rg = new LinearGradientBrush(rr, Color.Black, Color.Black, LinearGradientMode.Horizontal); ColorBlend rc = new ColorBlend(3); @@ -481,10 +483,10 @@ private void DrawOuterStroke(Graphics g) private GraphicsPath RoundRect(RectangleF r, float r1, float r2, float r3, float r4) { - float x = (float)(r.X); - float y = (float)(r.Y); - float w = (float)(r.Width); - float h = (float)(r.Height); + float x = (float)r.X; + float y = (float)r.Y; + float w = (float)r.Width; + float h = (float)r.Height; GraphicsPath rr = new GraphicsPath(); rr.AddBezier(x, y + r1, x, y, x + r1, y, x + r1, y); rr.AddLine(x + r1, y, x + w - r2, y); @@ -497,7 +499,7 @@ private GraphicsPath RoundRect(RectangleF r, float r1, float r2, float r3, float return rr; } - private bool InDesignMode() => (LicenseManager.UsageMode == LicenseUsageMode.Designtime); + private bool InDesignMode() => LicenseManager.UsageMode == LicenseUsageMode.Designtime; private Color GetIntermediateColor() { @@ -515,10 +517,10 @@ private Color GetIntermediateColor() int c2g = c2.G; int c2b = c2.B; - int a = System.Convert.ToInt32((int)(Math.Abs(ca + (ca - c2a) * pc))); - int r = System.Convert.ToInt32((int)(Math.Abs(cr - ((cr - c2r) * pc)))); - int g = System.Convert.ToInt32((int)(Math.Abs(cg - ((cg - c2g) * pc)))); - int b = System.Convert.ToInt32((int)(Math.Abs(cb - ((cb - c2b) * pc)))); + int a = System.Convert.ToInt32((int)Math.Abs(ca + (ca - c2a) * pc)); + int r = System.Convert.ToInt32((int)Math.Abs(cr - (cr - c2r) * pc)); + int g = System.Convert.ToInt32((int)Math.Abs(cg - (cg - c2g) * pc)); + int b = System.Convert.ToInt32((int)Math.Abs(cb - (cb - c2b) * pc)); if (a > 255) { @@ -537,7 +539,7 @@ private Color GetIntermediateColor() b = 255; } - return (Color.FromArgb(a, r, g, b)); + return Color.FromArgb(a, r, g, b); } private void KryptonProgressBarExtended_Paint(object sender, PaintEventArgs e) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonRichTextBoxExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonRichTextBoxExtended.cs index 086a5fa0a..5f48b07a9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonRichTextBoxExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonRichTextBoxExtended.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonScrollingLabel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonScrollingLabel.cs index 21a2e7d0a..b1c9fa492 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonScrollingLabel.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonScrollingLabel.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonSecureTextBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonSecureTextBox.cs index 55a8bafcf..997e88877 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonSecureTextBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonSecureTextBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -124,7 +124,7 @@ protected override void OnKeyPress(KeyPressEventArgs e) int startPos = SelectionStart; /* Handle backspace */ - if (((Keys)e.KeyChar) == Keys.Back) + if ((Keys)e.KeyChar == Keys.Back) { if (SelectionLength == 0 && startPos > 0 && startPos <= _secureString.Length) { @@ -199,7 +199,7 @@ protected override bool IsInputKey(Keys keyData) try { /* Handle the delete key */ - bool allowedToDelete = ((keyData & Keys.Delete) == Keys.Delete); + bool allowedToDelete = (keyData & Keys.Delete) == Keys.Delete; if (allowedToDelete) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonStarRatingControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonStarRatingControl.cs index 92bf0f188..516f5d85e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonStarRatingControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonStarRatingControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,8 +25,6 @@ */ #endregion -using System.Collections.Generic; - namespace Krypton.Toolkit.Suite.Extended.Controls { [ToolboxBitmap(typeof(Panel))] diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonToolkitExtendedPoweredByControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonToolkitExtendedPoweredByControl.cs index f0fd051b2..8bb227776 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonToolkitExtendedPoweredByControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonToolkitExtendedPoweredByControl.cs @@ -105,7 +105,7 @@ private void klwlblDescription_LinkClicked(object sender, LinkLabelLinkClickedEv } catch (Exception exception) { - ExceptionCapture.CaptureException(exception); + DebugUtilities.NotImplemented(exception.ToString()); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonValidationBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonValidationBox.cs index 1637b1512..d6fdef7a2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonValidationBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Controls Toolkit/KryptonValidationBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -190,7 +190,7 @@ protected override void OnValidating(CancelEventArgs e) } catch (Exception ex) { - ExceptionCapture.CaptureException(ex); + DebugUtilities.NotImplemented(ex.ToString()); } base.OnValidating(e); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Designers/Designers/KryptonProgressBarExtendedVersion2Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Designers/Designers/KryptonProgressBarExtendedVersion2Designer.cs index 5ff68c8ff..506c53ed1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Designers/Designers/KryptonProgressBarExtendedVersion2Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Designers/Designers/KryptonProgressBarExtendedVersion2Designer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -35,18 +35,18 @@ public KryptonProgressBarExtendedVersion2Designer() /* Gets a list of System.Windows.Forms.Design.Behavior.SnapLine objects, representing alignment points for the edited control. */ - public override IList SnapLines + public override IList? SnapLines { get { // Get the SnapLines collection from the base class - ArrayList snapList = base.SnapLines as ArrayList; + ArrayList? snapList = base.SnapLines as ArrayList; // Calculate the Baseline for the Font used by the Control and add it to the SnapLines int textBaseline = GetBaseline(base.Control, ContentAlignment.MiddleCenter); if (textBaseline > 0) { - snapList.Add(new SnapLine(SnapLineType.Baseline, textBaseline, SnapLinePriority.Medium)); + snapList?.Add(new SnapLine(SnapLineType.Baseline, textBaseline, SnapLinePriority.Medium)); } return snapList; @@ -65,7 +65,7 @@ private static int GetBaseline(Control ctrl, ContentAlignment alignment) using (Graphics graphics = ctrl.CreateGraphics()) { // Retrieve the device context Handle - IntPtr hDC = graphics.GetHdc(); + IntPtr hDc = graphics.GetHdc(); // Create a wrapper for the Font of the Control Font controlFont = ctrl.Font; @@ -74,17 +74,17 @@ private static int GetBaseline(Control ctrl, ContentAlignment alignment) try { // Create a wrapper for the device context - HandleRef deviceContextHandle = new HandleRef(ctrl, hDC); + HandleRef deviceContextHandle = new HandleRef(ctrl, hDc); // Select the Font into the device context IntPtr originalFont = SafeNativeMethods.SelectObject(deviceContextHandle, tempFontHandle); // Create a TEXTMETRIC and calculate metrics for the selected Font - NativeMethods.TEXTMETRIC tEXTMETRIC = new NativeMethods.TEXTMETRIC(); - if (SafeNativeMethods.GetTextMetrics(deviceContextHandle, ref tEXTMETRIC) != 0) + NativeMethods.TEXTMETRIC textmetric = new NativeMethods.TEXTMETRIC(); + if (SafeNativeMethods.GetTextMetrics(deviceContextHandle, ref textmetric) != 0) { - textAscent = (tEXTMETRIC.tmAscent + 1); - textHeight = tEXTMETRIC.tmHeight; + textAscent = textmetric.tmAscent + 1; + textHeight = textmetric.tmHeight; } // Restore original Font @@ -97,24 +97,24 @@ private static int GetBaseline(Control ctrl, ContentAlignment alignment) SafeNativeMethods.DeleteObject(tempFontHandle); // Release device context - graphics.ReleaseHdc(hDC); + graphics.ReleaseHdc(hDc); } } // Calculate return value based on the specified alignment; first check top alignment if ((alignment & (ContentAlignment.TopLeft | ContentAlignment.TopCenter | ContentAlignment.TopRight)) != 0) { - return (clientRect.Top + textAscent); + return clientRect.Top + textAscent; } // Check middle alignment if ((alignment & (ContentAlignment.MiddleLeft | ContentAlignment.MiddleCenter | ContentAlignment.MiddleRight)) == 0) { - return ((clientRect.Bottom - textHeight) + textAscent); + return clientRect.Bottom - textHeight + textAscent; } // Assume bottom alignment - return ((int)Math.Round((double)clientRect.Top + (double)clientRect.Height / 2 - (double)textHeight / 2 + (double)textAscent)); + return (int)Math.Round((double)clientRect.Top + (double)clientRect.Height / 2 - (double)textHeight / 2 + (double)textAscent); } } } \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Enumerations/TextAlignment.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Enumerations/TextAlignment.cs index c20da3927..6ce8879d5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Enumerations/TextAlignment.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Enumerations/TextAlignment.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Events/KnobValueChangedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Events/KnobValueChangedEventArgs.cs index a81342e40..e74f8d29d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Events/KnobValueChangedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Events/KnobValueChangedEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/ComponentModel/CancelChangeEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/ComponentModel/CancelChangeEventArgs.cs new file mode 100644 index 000000000..f23e7b55d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/ComponentModel/CancelChangeEventArgs.cs @@ -0,0 +1,200 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +#region Original MIT License + +/* + * Source code for _PasswordTextBox Control_ is Copyright © 2016 + * [Nils Jonsson][mail] and [contributors][contributors]. + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 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. + * + * [mail]: mailto:passwordtextbox@nilsjonsson.com "send email to Nils Jonsson" + * [contributors]: https://github.com/njonsson/PasswordTextBox-Control/contributors "PasswordTextBox Control contributors at GitHub" + */ + +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + /// + /// Provides data for a cancelable value-change event. + /// + /// The type of value being changed. + public class CancelChangeEventArgs : CancelEventArgs + { + public static bool operator ==(CancelChangeEventArgs left, + CancelChangeEventArgs right) + { + return Equals(left, right); + } + + public static bool operator !=(CancelChangeEventArgs left, + CancelChangeEventArgs right) + { + return !Equals(left, right); + } + + /// + /// Invokes the specified (unless + /// is strictly an instance of + /// and is + /// null) with a new + /// having the specified and + /// . + /// + /// This can be used for safely avoiding the needless + /// construction of objects and + /// needless calls to event-raising OnVALUEChanging + /// methods. + /// The type of + /// ignored. + /// The sender. + /// An of + /// . + /// An of + /// > that calls an event-raising + /// method. + /// The desired value of + /// . + /// The desired value of + /// . + /// A new if + /// is invoked, otherwise + /// null. + /// + /// is null. + /// -or- + /// is + /// null. + public static CancelChangeEventArgs DoIf(TSender sender, + EventHandler> @event, + Action> callEventRaisingMethod, + T oldValue, + T newValue) + { + if (ReferenceEquals(callEventRaisingMethod, null)) + { + throw new ArgumentNullException(nameof(callEventRaisingMethod)); + } + + return Event.DoIf(sender, @event, delegate + { + var eventArgs = new CancelChangeEventArgs(oldValue, newValue); + callEventRaisingMethod(eventArgs); + return eventArgs; + }); + } + + /// + /// A of that + /// persists and . + /// + protected readonly ChangeEventArgs ChangeEventArgs; + + /// + /// Instantiates a new with the + /// specified properties. + /// + /// The desired value of + /// . + /// The desired value of + /// . + public CancelChangeEventArgs(T oldValue, T newValue) + { + ChangeEventArgs = new ChangeEventArgs(oldValue, newValue); + } + + /// + /// Instantiates a new with the + /// specified properties. + /// + /// The desired value of + /// . + /// The desired value of + /// . + /// The desired value of + /// . + public CancelChangeEventArgs(T oldValue, T newValue, bool cancel) : + base(cancel) + { + ChangeEventArgs = new ChangeEventArgs(oldValue, newValue); + } + + /// + /// The value after the change. + /// + public T NewValue => ChangeEventArgs.NewValue; + + /// + /// The value before the change. + /// + public T OldValue => ChangeEventArgs.OldValue; + + public override bool Equals(object? other) + { + return Equals(other as CancelChangeEventArgs); + } + + public bool Equals(CancelChangeEventArgs other) + { + if (ReferenceEquals(null, other)) return false; + + if (ReferenceEquals(this, other)) return true; + + return EqualityComparer.Default.Equals(NewValue, + other.NewValue) && + EqualityComparer.Default.Equals(OldValue, other.OldValue); + } + + [SuppressMessage("ReSharper", "NonReadonlyMemberInGetHashCode")] + public override int GetHashCode() + { + unchecked + { + return (EqualityComparer.Default.GetHashCode(NewValue) * + 397) ^ + EqualityComparer.Default.GetHashCode(OldValue); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/ComponentModel/ChangeEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/ComponentModel/ChangeEventArgs.cs new file mode 100644 index 000000000..e0b8332ff --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/ComponentModel/ChangeEventArgs.cs @@ -0,0 +1,179 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +#region Original MIT License + +/* + * Source code for _PasswordTextBox Control_ is Copyright © 2016 + * [Nils Jonsson][mail] and [contributors][contributors]. + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 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. + * + * [mail]: mailto:passwordtextbox@nilsjonsson.com "send email to Nils Jonsson" + * [contributors]: https://github.com/njonsson/PasswordTextBox-Control/contributors "PasswordTextBox Control contributors at GitHub" + */ + +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + /// + /// Provides data for a value-change event. + /// + /// The type of value being changed. + public class ChangeEventArgs : EventArgs, IEquatable> + { + public static bool operator ==(ChangeEventArgs left, + ChangeEventArgs right) + { + return Equals(left, right); + } + + public static bool operator !=(ChangeEventArgs left, + ChangeEventArgs right) + { + return !Equals(left, right); + } + + /// + /// Invokes the specified + /// (unless is strictly an instance of + /// and is + /// null) with a new having + /// the specified and + /// . + /// + /// This can be used for safely avoiding the needless + /// construction of objects and + /// needless calls to event-raising OnVALUEChanged + /// methods. + /// The type of + /// required. + /// The sender. + /// An of + /// . + /// An of + /// > that calls an event-raising + /// method. + /// The desired value of + /// . + /// The desired value of + /// . + /// A new if + /// is invoked, otherwise + /// null. + /// + /// is null. + /// -or- + /// is + /// null. + public static ChangeEventArgs DoIf(TSender sender, + EventHandler> @event, + Action> callEventRaisingMethod, + T oldValue, + T newValue) + { + if (ReferenceEquals(callEventRaisingMethod, null)) + { + throw new ArgumentNullException(nameof(callEventRaisingMethod)); + } + + return Event.DoIf(sender, @event, delegate + { + var eventArgs = new ChangeEventArgs(oldValue, newValue); + callEventRaisingMethod(eventArgs); + return eventArgs; + }); + } + + /// + /// Instantiates a new with the + /// specified properties. + /// + /// The desired value of + /// . + /// The desired value of + /// . + public ChangeEventArgs(T oldValue, T newValue) + { + OldValue = oldValue; + NewValue = newValue; + } + + /// + /// The value after the change. + /// + public T NewValue { get; protected set; } + + /// + /// The value before the change. + /// + public T OldValue { get; protected set; } + + public override bool Equals(object other) + { + return Equals(other as ChangeEventArgs); + } + + public bool Equals(ChangeEventArgs other) + { + if (ReferenceEquals(null, other)) return false; + + if (ReferenceEquals(this, other)) return true; + + return EqualityComparer.Default.Equals(NewValue, + other.NewValue) && + EqualityComparer.Default.Equals(OldValue, other.OldValue); + } + + [SuppressMessage("ReSharper", "NonReadonlyMemberInGetHashCode")] + public override int GetHashCode() + { + unchecked + { + return (EqualityComparer.Default.GetHashCode(NewValue) * + 397) ^ + EqualityComparer.Default.GetHashCode(OldValue); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/ComponentModel/Event.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/ComponentModel/Event.cs new file mode 100644 index 000000000..49b0cfbb7 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/ComponentModel/Event.cs @@ -0,0 +1,129 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +#region Original MIT License + +/* + * Source code for _PasswordTextBox Control_ is Copyright © 2016 + * [Nils Jonsson][mail] and [contributors][contributors]. + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 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. + * + * [mail]: mailto:passwordtextbox@nilsjonsson.com "send email to Nils Jonsson" + * [contributors]: https://github.com/njonsson/PasswordTextBox-Control/contributors "PasswordTextBox Control contributors at GitHub" + */ + +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + /// + /// Provides methods for safely avoiding the needless construction of + /// descendent objects and needless calls to + /// event-raising OnEVENTNAME methods. + /// + public static class Event + { + /// + /// Invokes the specified + /// + /// function (unless is strictly an instance of + /// and is + /// null). + /// + /// The type of for + /// which not to invoke the + /// + /// function. + /// The type of + /// . + /// The sender. + /// An of + /// . + /// A + /// of that + /// constructs a and calls an + /// event-raising method with it. + /// The return value of + /// , if + /// invoked, otherwise, null. + /// + /// is null. + /// -or- + /// + /// is null. + public static TEventArgs DoIf(TSender sender, + EventHandler @event, + Func constructEventArgsAndCallEventRaisingMethod) + where TEventArgs : EventArgs + { + if (ReferenceEquals(sender, null)) + { + throw new ArgumentNullException(nameof(sender)); + } + + if (ReferenceEquals(constructEventArgsAndCallEventRaisingMethod, + null)) + { + throw new ArgumentNullException(nameof(constructEventArgsAndCallEventRaisingMethod)); + } + + // ReSharper disable ArrangeRedundantParentheses + return ((sender.GetType() == typeof(TSender)) ? + DoIf(@event, constructEventArgsAndCallEventRaisingMethod) : + constructEventArgsAndCallEventRaisingMethod())!; + // ReSharper restore ArrangeRedundantParentheses + } + + private static TEventArgs DoIf(EventHandler @event, + Func constructEventArgsAndCallEventRaisingMethod) + where TEventArgs : EventArgs? + { + System.Diagnostics.Debug.Assert(!ReferenceEquals(constructEventArgsAndCallEventRaisingMethod, + null)); + + return ReferenceEquals(@event, null) ? + default(TEventArgs) : + constructEventArgsAndCallEventRaisingMethod?.Invoke(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/Facades/GraphicsExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/Facades/GraphicsExtended.cs new file mode 100644 index 000000000..825ea8486 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/Facades/GraphicsExtended.cs @@ -0,0 +1,202 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +#region Original MIT License + +/* + * Source code for _PasswordTextBox Control_ is Copyright © 2016 + * [Nils Jonsson][mail] and [contributors][contributors]. + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 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. + * + * [mail]: mailto:passwordtextbox@nilsjonsson.com "send email to Nils Jonsson" + * [contributors]: https://github.com/njonsson/PasswordTextBox-Control/contributors "PasswordTextBox Control contributors at GitHub" + */ + +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + /// + /// An abstraction of . + /// + /// Exists in order to make test assertions on usage of + /// . + public class GraphicsExtended : IGraphics + { + /// + /// Converts the specified object to a + /// object. + /// + /// A object. + /// The object of which + /// is an abstraction. + public static explicit operator System.Drawing.Graphics(GraphicsExtended graphics) + { + return graphics.native; + } + + private readonly System.Drawing.Graphics native; + + /// + /// Instantiates a new object with the specified + /// . + /// + /// The desired value of + /// . + /// + /// is null. + public GraphicsExtended(Control control) + { + if (ReferenceEquals(control, null)) + { + throw new ArgumentNullException(nameof(control)); + } + + Control = control; + native = Control.CreateGraphics(); + } + + /// + /// Finalizes a object. + /// + ~GraphicsExtended() + { + Dispose(false); + System.Diagnostics.Debug.Fail($"{GetType().FullName} was not disposed!"); + } + + /// + /// The which the + /// object used to create a + /// object. + /// + public Control Control { get; } + + /// + /// Gets or sets the rendering mode for text associated with the + /// object. + /// + public TextRenderingHint TextRenderingHint + { + get { return native.TextRenderingHint; } + + set { native.TextRenderingHint = value; } + } + + /// + /// Disposes resources acquired by the object. + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + /// Disposes unmanaged resources acquired by the + /// object, optionally disposing managed resources, as well. + /// + /// If true, managed resources are + /// disposed along with unmanaged resources. + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + native.Dispose(); + } + } + + /// + /// Draws the specified at the specified + /// with the specified + /// and . + /// + /// The to draw. + /// A that determines the + /// appearance of the . + /// An that + /// determines the appearance of the . + /// A that defines the top-left + /// position of the . + /// An argument is + /// null. + public void DrawString(string @string, + Font font, + ISolidBrush solidBrush, + PointF point) + { + native.DrawString(@string, font, solidBrush.Native, point); + } + + /// + /// Fills the interior of the specified + /// using the specified . + /// + /// An that + /// determines the appearance of the + /// . + /// A describing the + /// area to be filled. + /// An argument is + /// null. + public void FillRectangle(ISolidBrush solidBrush, RectangleF rectangle) + { + native.FillRectangle(solidBrush.Native, rectangle); + } + + /// + /// Measures the specified when drawn with the + /// specified . + /// + /// The to measure. + /// A that determines the + /// appearance of the . + /// The measured . + /// An argument is + /// null. + public SizeF MeasureString(string @string, Font font) + { + return native.MeasureString(@string, font); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/Facades/IGraphics.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/Facades/IGraphics.cs new file mode 100644 index 000000000..5026d4001 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/Facades/IGraphics.cs @@ -0,0 +1,112 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +#region Original MIT License + +/* + * Source code for _PasswordTextBox Control_ is Copyright © 2016 + * [Nils Jonsson][mail] and [contributors][contributors]. + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 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. + * + * [mail]: mailto:passwordtextbox@nilsjonsson.com "send email to Nils Jonsson" + * [contributors]: https://github.com/njonsson/PasswordTextBox-Control/contributors "PasswordTextBox Control contributors at GitHub" + */ + +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + /// + /// An abstraction of . + /// + /// Exists in order to make test assertions on usage of + /// . + public interface IGraphics : IDisposable + { + /// + /// Gets or sets the rendering mode for text associated with the + /// object. + /// + TextRenderingHint TextRenderingHint { get; set; } + + /// + /// Draws the specified at the specified + /// with the specified + /// and . + /// + /// The to draw. + /// A that determines the + /// appearance of the . + /// An that + /// determines the appearance of the . + /// A that defines the top-left + /// position of the . + void DrawString(string @string, + Font font, + ISolidBrush solidBrush, + PointF point); + + /// + /// Fills the interior of the specified + /// using the specified . + /// + /// An that + /// determines the appearance of the + /// . + /// A describing the + /// area to be filled. + void FillRectangle(ISolidBrush solidBrush, RectangleF rectangle); + + /// + /// Measures the specified when drawn with the + /// specified . + /// + /// The to measure. + /// A that determines the + /// appearance of the . + /// The measured . + /// An argument is + /// null. + SizeF MeasureString(string @string, Font font); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/Facades/ISolidBrush.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/Facades/ISolidBrush.cs new file mode 100644 index 000000000..1bf5df65e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/Facades/ISolidBrush.cs @@ -0,0 +1,72 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +#region Original MIT License + +/* + * Source code for _PasswordTextBox Control_ is Copyright © 2016 + * [Nils Jonsson][mail] and [contributors][contributors]. + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 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. + * + * [mail]: mailto:passwordtextbox@nilsjonsson.com "send email to Nils Jonsson" + * [contributors]: https://github.com/njonsson/PasswordTextBox-Control/contributors "PasswordTextBox Control contributors at GitHub" + */ + +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + /// + /// An abstraction of . + /// + /// Exists in order to make test assertions on usage of + /// . + public interface ISolidBrush : IDisposable + { + /// + /// The of which the + /// is an abstraction. + /// + System.Drawing.SolidBrush Native { get; } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/Facades/ITimer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/Facades/ITimer.cs new file mode 100644 index 000000000..cd11bc1e3 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/Facades/ITimer.cs @@ -0,0 +1,89 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +#region Original MIT License + +/* + * Source code for _PasswordTextBox Control_ is Copyright © 2016 + * [Nils Jonsson][mail] and [contributors][contributors]. + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 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. + * + * [mail]: mailto:passwordtextbox@nilsjonsson.com "send email to Nils Jonsson" + * [contributors]: https://github.com/njonsson/PasswordTextBox-Control/contributors "PasswordTextBox Control contributors at GitHub" + */ + +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + /// + /// An abstraction of . + /// + /// Exists in order to make test assertions on usage of + /// . + public interface ITimer : IDisposable + { + /// + /// Occurs when elapses. + /// + event ElapsedEventHandler Elapsed; + + /// + /// Gets or sets the interval, in milliseconds, at which to raise the + /// event. + /// + double Interval { get; set; } + + /// + /// Starts counting down to raise + /// . + /// + void Start(); + + /// + /// Stops counting down to raise + /// . + /// + void Stop(); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/Facades/SolidBrushExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/Facades/SolidBrushExtended.cs new file mode 100644 index 000000000..331a7f19b --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/Facades/SolidBrushExtended.cs @@ -0,0 +1,117 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +#region Original MIT License + +/* + * Source code for _PasswordTextBox Control_ is Copyright © 2016 + * [Nils Jonsson][mail] and [contributors][contributors]. + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 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. + * + * [mail]: mailto:passwordtextbox@nilsjonsson.com "send email to Nils Jonsson" + * [contributors]: https://github.com/njonsson/PasswordTextBox-Control/contributors "PasswordTextBox Control contributors at GitHub" + */ + +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + /// + /// An abstraction of . + /// + /// Exists in order to make test assertions on usage of + /// . + public sealed class SolidBrushExtended : ISolidBrush + { + private readonly System.Drawing.SolidBrush native; + + /// + /// Instantiates a new with the specified + /// . + /// + /// The desired value of + /// . + public SolidBrushExtended(Color color) + { + native = new System.Drawing.SolidBrush(color); + } + + /// + /// Finalizes the . + /// + ~SolidBrushExtended() + { + Dispose(false); + System.Diagnostics.Debug.Fail($"{GetType().FullName} was not disposed!"); + } + + /// + /// The of the + /// . + /// + public Color Color => native.Color; + + /// + /// The of which the + /// is an abstraction. + /// + System.Drawing.SolidBrush ISolidBrush.Native => native; + + /// + /// Disposes resources acquired by the . + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + private void Dispose(bool disposing) + { + if (disposing) + { + native.Dispose(); + } + } + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/Facades/TimerExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/Facades/TimerExtended.cs new file mode 100644 index 000000000..cbf562a4b --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/Facades/TimerExtended.cs @@ -0,0 +1,186 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +#region Original MIT License + +/* + * Source code for _PasswordTextBox Control_ is Copyright © 2016 + * [Nils Jonsson][mail] and [contributors][contributors]. + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 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. + * + * [mail]: mailto:passwordtextbox@nilsjonsson.com "send email to Nils Jonsson" + * [contributors]: https://github.com/njonsson/PasswordTextBox-Control/contributors "PasswordTextBox Control contributors at GitHub" + */ + +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + /// + /// An abstraction of . + /// + /// Exists in order to make test assertions on usage of + /// . + public class TimerExtended : ITimer + { + /// + /// Converts the specified object to a + /// . + /// + /// A . + /// The of which + /// is an abstraction. + public static explicit operator System.Timers.Timer(TimerExtended timer) + { + return timer.native; + } + + private readonly System.Timers.Timer native; + + /// + /// Instantiates a new with the specified + /// properties. + /// + /// The desired value of + /// . + /// The desired value of + /// . + /// The desired value of + /// ; optional. + public TimerExtended(bool autoReset, + double interval, + ISynchronizeInvoke synchronizingObject) + { + native = new System.Timers.Timer + { + AutoReset = autoReset, + Interval = interval, + SynchronizingObject = synchronizingObject + }; + } + + /// + /// Finalizes a . + /// + ~TimerExtended() + { + Dispose(false); + System.Diagnostics.Debug.Fail($"{GetType().FullName} was not disposed!"); + } + + /// + /// Occurs when elapses. + /// + public event ElapsedEventHandler Elapsed + { + add { native.Elapsed += value; } + + remove { native.Elapsed -= value; } + } + + /// + /// Indicates whether the should raise the + /// event each time elapses + /// or only after the first time it elapses. + /// + public bool AutoReset => native.AutoReset; + + /// + /// Gets or sets the interval, in milliseconds, at which to raise the + /// event. + /// + public double Interval + { + get { return native.Interval; } + + set { native.Interval = value; } + } + + /// + /// Gets the object used to marshal events raised by the + /// . + /// + public ISynchronizeInvoke SynchronizingObject => native.SynchronizingObject; + + /// + /// Disposes resources acquired by the . + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + /// Disposes unmanaged resources acquired by the , + /// optionally disposing managed resources, as well. + /// + /// If true, managed resources are + /// disposed along with unmanaged resources. + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + native.Dispose(); + } + } + + /// + /// Starts counting down to raise + /// . + /// + public void Start() + { + native.Start(); + } + + /// + /// Stops counting down to raise + /// . + /// + public void Stop() + { + native.Stop(); + } + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/GripBounds.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/GripBounds.cs new file mode 100644 index 000000000..803eaa4e6 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/General/GripBounds.cs @@ -0,0 +1,113 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Krypton.Toolkit.Suite.Extended.Controls +{ + internal struct GripBounds + { + private const int GripSize = 6; + private const int CornerGripSize = GripSize << 1; + + public GripBounds(Rectangle clientRectangle) + { + _clientRectangle = clientRectangle; + } + + private Rectangle _clientRectangle; + public Rectangle ClientRectangle => _clientRectangle; + + //set { clientRectangle = value; } + public Rectangle Bottom + { + get + { + Rectangle rect = ClientRectangle; + rect.Y = rect.Bottom - GripSize + 1; + rect.Height = GripSize; + return rect; + } + } + + public Rectangle BottomRight + { + get + { + Rectangle rect = ClientRectangle; + rect.Y = rect.Bottom - CornerGripSize + 1; + rect.Height = CornerGripSize; + rect.X = rect.Width - CornerGripSize + 1; + rect.Width = CornerGripSize; + return rect; + } + } + + public Rectangle Top + { + get + { + Rectangle rect = ClientRectangle; + rect.Height = GripSize; + return rect; + } + } + + public Rectangle TopRight + { + get + { + Rectangle rect = ClientRectangle; + rect.Height = CornerGripSize; + rect.X = rect.Width - CornerGripSize + 1; + rect.Width = CornerGripSize; + return rect; + } + } + + public Rectangle Left + { + get + { + Rectangle rect = ClientRectangle; + rect.Width = GripSize; + return rect; + } + } + + public Rectangle BottomLeft + { + get + { + Rectangle rect = ClientRectangle; + rect.Width = CornerGripSize; + rect.Y = rect.Height - CornerGripSize + 1; + rect.Height = CornerGripSize; + return rect; + } + } + + public Rectangle Right + { + get + { + Rectangle rect = ClientRectangle; + rect.X = rect.Right - GripSize + 1; + rect.Width = GripSize; + return rect; + } + } + + public Rectangle TopLeft + { + get + { + Rectangle rect = ClientRectangle; + rect.Width = CornerGripSize; + rect.Height = CornerGripSize; + return rect; + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Globals/GlobalDeclarations.cs index d97818372..e0c3176f2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -27,21 +27,28 @@ global using System; global using System.Collections; +global using System.Collections.Generic; global using System.ComponentModel; +global using System.Data; global using System.Diagnostics; +global using System.Diagnostics.CodeAnalysis; global using System.Drawing; global using System.Drawing.Drawing2D; global using System.Drawing.Printing; +global using System.Drawing.Text; global using System.Globalization; global using System.IO; +global using System.Reflection; global using System.Runtime.InteropServices; global using System.Security; +global using System.Security.Permissions; global using System.Text; +global using System.Timers; global using System.Windows.Forms; global using System.Windows.Forms.Design; global using System.Windows.Forms.Design.Behavior; -global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; global using Krypton.Toolkit.Suite.Extended.Controls.Properties; +global using Krypton.Toolkit.Suite.Extended.Debug.Tools; global using Microsoft.WindowsAPICodePack.Dialogs; \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Krypton.Toolkit.Suite.Extended.Controls 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Krypton.Toolkit.Suite.Extended.Controls 2022.csproj index 2b0c17149..9423c294b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Krypton.Toolkit.Suite.Extended.Controls 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Krypton.Toolkit.Suite.Extended.Controls 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package holds numerous controls that complement the standard toolkit. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package holds numerous controls that complement the standard toolkit. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,74 +69,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + @@ -180,6 +130,7 @@ + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Krypton.Toolkit.Suite.Extended.Controls.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Krypton.Toolkit.Suite.Extended.Controls.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Krypton.Toolkit.Suite.Extended.Controls.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Krypton.Toolkit.Suite.Extended.Controls.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Attributes/AuthorAttribute.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Attributes/AuthorAttribute.cs index 14d09f588..bf379464b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Attributes/AuthorAttribute.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Attributes/AuthorAttribute.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/AdobeColourTablePaletteSerialiser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/AdobeColourTablePaletteSerialiser.cs index d2b2221e7..3dfbf4219 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/AdobeColourTablePaletteSerialiser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/AdobeColourTablePaletteSerialiser.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -83,7 +83,7 @@ public override bool CanReadFrom(Stream stream) try { - result = stream.Length == 768 || stream.Length == 772; + result = stream.Length is 768 or 772; } catch { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/AdobePhotoshopColourSwatchSerialiser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/AdobePhotoshopColourSwatchSerialiser.cs index 6b565858c..7097ee8a1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/AdobePhotoshopColourSwatchSerialiser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/AdobePhotoshopColourSwatchSerialiser.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -74,7 +74,7 @@ public override bool CanReadFrom(Stream stream) //version = this.ReadShort(stream); version = stream.ReadByte() + stream.ReadByte(); - result = version == 1 || version == 2; + result = version is 1 or 2; } catch { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourCollection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourCollection.cs index 0315c0c3f..19890c4af 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourCollection.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourCollection.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourCollectionEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourCollectionEventArgs.cs index 196fcbfc4..cf8f595c3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourCollectionEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourCollectionEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourComparer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourComparer.cs index 599cdd65c..aa8ea04db 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourComparer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourComparer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourControlManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourControlManager.cs index a9e3fff18..721694bca 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourControlManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourControlManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourExtensions.cs index f96894a49..612df5eff 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourExtensions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourExtensions.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourFormatting.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourFormatting.cs index 0f8b8eec8..6882a975c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourFormatting.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourFormatting.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourHitTestInfo.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourHitTestInfo.cs index 869e1588f..b65139a2d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourHitTestInfo.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourHitTestInfo.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourInformation.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourInformation.cs index f368d536d..0a88e7928 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourInformation.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourInformation.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourManager.cs index 5a2edb1ce..2301e90fb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourPalettes.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourPalettes.cs index 37caacda4..48e56d32d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourPalettes.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourPalettes.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourSettingsManagementEngine.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourSettingsManagementEngine.cs index 041f005aa..44329ef51 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourSettingsManagementEngine.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourSettingsManagementEngine.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourUtilities.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourUtilities.cs index 8174d1477..1632f24d5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourUtilities.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourUtilities.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -41,19 +41,19 @@ public static class ColourUtilities /// public static Color FromHsl(int alpha, float hue, float saturation, float lighting) { - if (0 > alpha || 255 < alpha) + if (alpha is < 0 or > 255) { throw new ArgumentOutOfRangeException("alpha"); } - if (0f > hue || 360f < hue) + if (hue is < 0f or > 360f) { throw new ArgumentOutOfRangeException("hue"); } - if (0f > saturation || 1f < saturation) + if (saturation is < 0f or > 1f) { throw new ArgumentOutOfRangeException("saturation"); } - if (0f > lighting || 1f < lighting) + if (lighting is < 0f or > 1f) { throw new ArgumentOutOfRangeException("lighting"); } @@ -68,13 +68,13 @@ public static Color FromHsl(int alpha, float hue, float saturation, float lighti if (0.5 < lighting) { - fMax = lighting - (lighting * saturation) + saturation; - fMin = lighting + (lighting * saturation) - saturation; + fMax = lighting - lighting * saturation + saturation; + fMin = lighting + lighting * saturation - saturation; } else { - fMax = lighting + (lighting * saturation); - fMin = lighting - (lighting * saturation); + fMax = lighting + lighting * saturation; + fMin = lighting - lighting * saturation; } iSextant = (int)Math.Floor(hue / 60f); @@ -83,7 +83,7 @@ public static Color FromHsl(int alpha, float hue, float saturation, float lighti hue -= 360f; } hue /= 60f; - hue -= 2f * (float)Math.Floor(((iSextant + 1f) % 6f) / 2f); + hue -= 2f * (float)Math.Floor((iSextant + 1f) % 6f / 2f); if (0 == iSextant % 2) { fMid = hue * (fMax - fMin) + fMin; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourUtility.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourUtility.cs index 5e18f1236..5fda3d690 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourUtility.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/ColourUtility.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/CombineColourSettings.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/CombineColourSettings.cs index cc6dafa7d..e69c06d17 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/CombineColourSettings.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/CombineColourSettings.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/GimpPaletteSerialiser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/GimpPaletteSerialiser.cs index 5067484a4..9581e82ee 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/GimpPaletteSerialiser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/GimpPaletteSerialiser.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/HSLColour.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/HSLColour.cs index 2516aa6ac..bc6ce7f14 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/HSLColour.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/HSLColour.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -164,7 +164,7 @@ private static double GetColourComponent(double temp1, double temp2, double temp } else if (temp3 < 2.0 / 3.0) { - return temp1 + ((temp2 - temp1) * ((2.0 / 3.0) - temp3) * 6.0); + return temp1 + (temp2 - temp1) * (2.0 / 3.0 - temp3) * 6.0; } else { @@ -195,7 +195,7 @@ private static double GetTemp2(HSLColour hslColour) } else { - temp2 = hslColour._luminosity + hslColour._saturation - (hslColour._luminosity * hslColour._saturation); + temp2 = hslColour._luminosity + hslColour._saturation - hslColour._luminosity * hslColour._saturation; } return temp2; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/InterleavedBitmapPaletteSerialiser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/InterleavedBitmapPaletteSerialiser.cs index 9d5e576fb..a9423ff3c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/InterleavedBitmapPaletteSerialiser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/InterleavedBitmapPaletteSerialiser.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -88,7 +88,7 @@ public override bool CanReadFrom(Stream stream) formHeader = Encoding.ASCII.GetString(formHeaderData); imageHeader = Encoding.ASCII.GetString(imageHeaderData); - result = formHeader == "FORM" && (imageHeader == "PBM " || imageHeader == "ILBM"); + result = formHeader == "FORM" && imageHeader is "PBM " or "ILBM"; } catch { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/JascPaletteSerialiser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/JascPaletteSerialiser.cs index 4e4eebacf..0bb2dbd67 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/JascPaletteSerialiser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/JascPaletteSerialiser.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/KryptonPaletteDebugManagement.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/KryptonPaletteDebugManagement.cs index 0c6de4694..a8e292ffd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/KryptonPaletteDebugManagement.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/KryptonPaletteDebugManagement.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/PaintNetPaletteSerialiser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/PaintNetPaletteSerialiser.cs index 2c1772cc1..3cae8544c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/PaintNetPaletteSerialiser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/PaintNetPaletteSerialiser.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/PaletteSerialiser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/PaletteSerialiser.cs index 807c3b4f5..cf909e15b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/PaletteSerialiser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/PaletteSerialiser.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/RawPaletteSerialiser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/RawPaletteSerialiser.cs index 5e7a0e78f..db8f1c87c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/RawPaletteSerialiser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/RawPaletteSerialiser.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/SettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/SettingsManager.cs index d12741ed2..8209a342d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/SettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/SettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/WIN32.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/WIN32.cs index 11308aa4c..67e7cb2b7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/WIN32.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Colours/WIN32.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/ControlHelper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/ControlHelper.cs index 1c0bf2a86..f210a24f5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/ControlHelper.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/ControlHelper.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/ExceptionHandler.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/ExceptionHandler.cs index 01257e2a5..12a7c95e4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/ExceptionHandler.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/ExceptionHandler.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/ToolstripNonClientRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/ToolstripNonClientRenderer.cs index 165e23780..111768402 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/ToolstripNonClientRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/ToolstripNonClientRenderer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/Typeface.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/Typeface.cs index ce9ad7c0e..10d6dd258 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/Typeface.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/Typeface.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/VisualControlBaseExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/VisualControlBaseExtended.cs index f2fa10abf..6f65f44a2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/VisualControlBaseExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/VisualControlBaseExtended.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -281,7 +281,7 @@ public void CheckPerformLayout() // Ask the view to perform a layout ViewManager.Layout(Renderer); - } while (_layoutDirty && (max-- > 0)); + } while (_layoutDirty && max-- > 0); } } } @@ -328,7 +328,7 @@ public PaletteMode PaletteMode private bool ShouldSerializePaletteMode() { - return (PaletteMode != PaletteMode.Global); + return PaletteMode != PaletteMode.Global; } /// @@ -719,7 +719,7 @@ protected virtual bool EvalTransparentPaint() /// protected virtual void OnButtonSpecChanged(object sender, EventArgs e) { - Debug.Assert(e != null); + System.Diagnostics.Debug.Assert(e != null); // Validate incoming reference if (e == null) @@ -766,7 +766,7 @@ protected virtual void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e) /// protected virtual void OnNeedPaint(object sender, NeedLayoutEventArgs e) { - Debug.Assert(e != null); + System.Diagnostics.Debug.Assert(e != null); // Validate incoming reference if (e == null) @@ -879,7 +879,7 @@ protected override void OnLayout(LayoutEventArgs levent) // Ask the view to perform a layout ViewManager.Layout(Renderer); - } while (_layoutDirty && (max-- > 0)); + } while (_layoutDirty && max-- > 0); } } @@ -907,8 +907,8 @@ protected override void OnPaint(PaintEventArgs e) PerformLayout(); // Did the layout cause a change in the size of the control? - if ((beforeSize.Width < ClientSize.Width) || - (beforeSize.Height < ClientSize.Height)) + if (beforeSize.Width < ClientSize.Width || + beforeSize.Height < ClientSize.Height) { // Have to reset the _refresh before calling need paint otherwise // it will not create another invalidate or invoke call as necessary @@ -1200,7 +1200,7 @@ protected override void WndProc(ref Message m) Point mousePt = new(PlatformInvoke.LOWORD(m.LParam), PlatformInvoke.HIWORD(m.LParam)); // If keyboard activated, the menu position is centered - if (((int)((long)m.LParam)) == -1) + if ((int)(long)m.LParam == -1) { mousePt = new(Width / 2, Height / 2); } @@ -1280,7 +1280,7 @@ private void PaintTransparentBackground(PaintEventArgs e) Control parent = TransparentParent; // Do we have a parent control and we need to paint background? - if ((parent != null) && NeedTransparentPaint) + if (parent != null && NeedTransparentPaint) { // Only grab the required reference once if (_miPTB == null) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/VisualPopupToolTip.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/VisualPopupToolTip.cs index f9fd174f6..21f2bc811 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/VisualPopupToolTip.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/General/VisualPopupToolTip.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -74,10 +74,10 @@ public VisualPopupToolTip(PaletteRedirect redirector, PaletteContentStyle contentStyle) : base(renderer, true) { - Debug.Assert(contentValues != null); + System.Diagnostics.Debug.Assert(contentValues != null); // Remember references needed later - _contentValues = contentValues; + _contentValues = contentValues!; // Create the triple redirector needed by view elements _palette = new(redirector, backStyle, borderStyle, contentStyle, NeedPaintDelegate); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/IO/FileDialogHandler.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/IO/FileDialogHandler.cs index 1aee70bb8..9b040fe0c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/IO/FileDialogHandler.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/IO/FileDialogHandler.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/IO/Helpers.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/IO/Helpers.cs index 894fef7b2..dc5b62cb0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/IO/Helpers.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/IO/Helpers.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/IO/Path.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/IO/Path.cs index f9a5b058f..7c52c8a7e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/IO/Path.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/IO/Path.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Message Boxes/CoreExtendedKryptonMessageBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Message Boxes/CoreExtendedKryptonMessageBox.cs index af160c8e5..dbd0d7c31 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Message Boxes/CoreExtendedKryptonMessageBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Message Boxes/CoreExtendedKryptonMessageBox.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -308,28 +308,28 @@ private static IWin32Window ValidateOptions(IWin32Window owner, MessageBoxOption { // 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)) + (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)) + 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)) + 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 (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(PlatformInvoke.GetActiveWindow()); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/ConversionMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/ConversionMethods.cs index f63fb5856..6b1cb7400 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/ConversionMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/ConversionMethods.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -340,7 +340,7 @@ public void SetRed(int redValue) /// public int GetRed() { - if (Red < MINIMUM_COLOUR_CHANNEL_VALUE || Red > MAXIMUM_COLOUR_CHANNEL_VALUE) + if (Red is < MINIMUM_COLOUR_CHANNEL_VALUE or > MAXIMUM_COLOUR_CHANNEL_VALUE) { return Red; } @@ -365,7 +365,7 @@ public void SetGreen(int greenValue) /// public int GetGreen() { - if (Green < MINIMUM_COLOUR_CHANNEL_VALUE || Green > MAXIMUM_COLOUR_CHANNEL_VALUE) + if (Green is < MINIMUM_COLOUR_CHANNEL_VALUE or > MAXIMUM_COLOUR_CHANNEL_VALUE) { return Green; } @@ -390,7 +390,7 @@ public void SetBlue(int blueValue) /// public int GetBlue() { - if (Blue < MINIMUM_COLOUR_CHANNEL_VALUE || Blue > MAXIMUM_COLOUR_CHANNEL_VALUE) + if (Blue is < MINIMUM_COLOUR_CHANNEL_VALUE or > MAXIMUM_COLOUR_CHANNEL_VALUE) { return Blue; } @@ -415,7 +415,7 @@ public void SetAlpha(double alphaValue) /// public double GetAlpha() { - if (Alpha < MINIMUM_ALPHA_CHANNEL_VALUE || Alpha > MAXIMUM_ALPHA_CHANNEL_VALUE) + if (Alpha is < MINIMUM_ALPHA_CHANNEL_VALUE or > MAXIMUM_ALPHA_CHANNEL_VALUE) { return Alpha; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/FileCreator.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/FileCreator.cs index 03fbdd701..36a5f1322 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/FileCreator.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/FileCreator.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/GlobalUtilityMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/GlobalUtilityMethods.cs index 3e6075fd5..fa89a2e72 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/GlobalUtilityMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/GlobalUtilityMethods.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/HelpInfo.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/HelpInfo.cs index 51794b625..68e73bb0f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/HelpInfo.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/HelpInfo.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/InformationControlManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/InformationControlManager.cs index 42a4590bd..306b2c1e3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/InformationControlManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/InformationControlManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/MessageButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/MessageButton.cs index fd9cb8ebb..dc7114a6f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/MessageButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/MessageButton.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/PaletteImportManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/PaletteImportManager.cs index 34dbe6a54..4ece42d1b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/PaletteImportManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/PaletteImportManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -92,7 +92,7 @@ public void ImportColourScheme(KryptonCustomPaletteBase palette) _colourSettingsManager.SaveAllMergedColourSettings(); - _globalStringSettingsManager.SetBasePaletteMode(palette.BasePaletteMode.ToString()); + _globalStringSettingsManager.SetBasePaletteMode(palette.BasePaletteType.ToString()); _globalStringSettingsManager.SetFeedbackText("The import was successful."); @@ -100,7 +100,7 @@ public void ImportColourScheme(KryptonCustomPaletteBase palette) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); _globalStringSettingsManager.SetFeedbackText("Failed to import colours!"); @@ -150,7 +150,7 @@ public void ImportColourScheme() _colourSettingsManager.SaveAllMergedColourSettings(); - _globalStringSettingsManager.SetBasePaletteMode(_palette.BasePaletteMode.ToString()); + _globalStringSettingsManager.SetBasePaletteMode(_palette.BasePaletteType.ToString()); _globalStringSettingsManager.SetFeedbackText("The import was successful."); @@ -160,7 +160,7 @@ public void ImportColourScheme() { //CoreExtendedKryptonMessageBox.Show($"Error: { exc.Message }", "_palette Import Failed", ExtendedMessageBoxButtons.OK, ExtendedKryptonMessageBoxIcon.Error); - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); _globalStringSettingsManager.SetFeedbackText("Failed to import colours!"); @@ -237,7 +237,7 @@ public static void ImportPaletteColourScheme(KryptonCustomPaletteBase palette) ColourSettingsManagementEngine.SaveSettings(SettingTypes.Colour); - globalStringSettingsManager.SetBasePaletteMode(palette.BasePaletteMode.ToString()); + globalStringSettingsManager.SetBasePaletteMode(palette.BasePaletteType.ToString()); globalStringSettingsManager.SetFeedbackText("The import was successful."); @@ -245,7 +245,7 @@ public static void ImportPaletteColourScheme(KryptonCustomPaletteBase palette) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); globalStringSettingsManager.SetFeedbackText("Failed to import colours!"); @@ -325,7 +325,7 @@ public static void ImportPaletteColourScheme() ColourSettingsManagementEngine.SaveSettings(SettingTypes.Colour); - globalStringSettingsManager.SetBasePaletteMode(palette.BasePaletteMode.ToString()); + globalStringSettingsManager.SetBasePaletteMode(palette.BasePaletteType.ToString()); globalStringSettingsManager.SetFeedbackText("The import was successful."); @@ -333,7 +333,7 @@ public static void ImportPaletteColourScheme() } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); globalStringSettingsManager.SetFeedbackText("Failed to import colours!"); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/RandomNumberGenerator.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/RandomNumberGenerator.cs index 4fc01c922..b42d7841f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/RandomNumberGenerator.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/RandomNumberGenerator.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/SettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/SettingsManager.cs index 2f49beca1..b72ade32f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/SettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/SettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/ToolTipManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/ToolTipManager.cs index 9b3d46f61..2d5b1e910 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/ToolTipManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/ToolTipManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -375,8 +375,8 @@ private void OnStopTimerTick(object sender, EventArgs e) _stopTimer.Stop(); // Is the target is not the same as the currently showing tooltip - if ((_currentTarget != _startTarget) - || (_startTarget == null) // SKC: Default tooltip not using a viewbase ?? + if (_currentTarget != _startTarget + || _startTarget == null // SKC: Default tooltip not using a viewbase ?? ) { // Leave tooltips mode diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/TypefaceHelper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/TypefaceHelper.cs index 7553e2063..111006d46 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/TypefaceHelper.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Misc/TypefaceHelper.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Options/Theming/ThemingLogic.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Options/Theming/ThemingLogic.cs index 6e62e4cf0..642f4357c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Options/Theming/ThemingLogic.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Options/Theming/ThemingLogic.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Palette/PaletteCompisitionEngine.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Palette/PaletteCompisitionEngine.cs deleted file mode 100644 index b549b0752..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Palette/PaletteCompisitionEngine.cs +++ /dev/null @@ -1,880 +0,0 @@ -#region MIT License -/* - * - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Core -{ - public class PaletteCompisitionEngine - { - #region Variables - private PaletteMode _paletteMode; - #endregion - - #region Properties - public PaletteMode PaletteMode - { - get => _paletteMode; - set => _paletteMode = value; - } - #endregion - - #region Constructors - public PaletteCompisitionEngine() - { - - } - #endregion - - #region Methods - /// - /// Creates a new palette. - /// - /// The palette. - /// The palette mode. - /// The base colour. - /// The dark colour. - /// The middle colour. - /// The light colour. - /// The lightest colour. - /// The border colour preview. - /// The alternative normal text colour preview. - /// The normal text colour preview. - /// The disabled text colour preview. - /// The focused text colour preview. - /// The pressed text colour preview. - /// The disabled colour preview. - /// The link normal colour preview. - /// The link hover colour preview. - /// The link visited colour preview. - /// The custom colour one. - /// The custom colour two. - /// The custom colour three. - /// The custom colour four. - /// The custom colour five. - /// The custom text colour one. - /// The custom text colour two. - /// The custom text colour three. - /// The custom text colour four. - /// The custom text colour five. - /// The menu text colour. - /// The status text colour. - /// The ribbon tab text colour. - /// State of the status. - /// if set to true [invert colours]. - public static void CreatePalette(KryptonCustomPaletteBase palette, PaletteMode paletteMode, Color baseColour, Color darkColour, Color middleColour, Color lightColour, Color lightestColour, Color borderColourPreview, Color alternativeNormalTextColourPreview, Color normalTextColourPreview, Color disabledTextColourPreview, Color focusedTextColourPreview, Color pressedTextColourPreview, Color disabledControlColourPreview, Color linkDisabledColourPreview, Color linkFocusedColour, Color linkNormalColourPreview, Color linkHoverColourPreview, Color linkVisitedColourPreview, Color customColourOne, Color customColourTwo, Color customColourThree, Color customColourFour, Color customColourFive, Color customTextColourOne, Color customTextColourTwo, Color customTextColourThree, Color customTextColourFour, Color customTextColourFive, Color menuTextColour, Color statusTextColour, Color ribbonTabTextColour, ToolStripLabel statusState = null, bool invertColours = false) - { - palette = new(); - - try - { - palette.BasePaletteMode = paletteMode; - - if (lightestColour == Color.Transparent) - { - lightestColour = lightColour; - } - - if (invertColours) - { - #region Button Cluster - palette.ButtonStyles.ButtonCluster.OverrideDefault.Back.Color1 = darkColour; - - palette.ButtonStyles.ButtonCluster.OverrideFocus.Back.Color1 = darkColour; - - palette.ButtonStyles.ButtonCluster.StateCheckedNormal.Back.Color1 = darkColour; - - palette.ButtonStyles.ButtonCluster.StateCommon.Back.ColorStyle = PaletteColorStyle.GlassNormalFull; - - palette.ButtonStyles.ButtonCluster.StateNormal.Back.Color1 = middleColour; - - palette.ButtonStyles.ButtonCluster.StatePressed.Back.Color1 = baseColour; - - palette.ButtonStyles.ButtonCluster.StateTracking.Back.Color1 = darkColour; - #endregion - - #region Button Common - palette.ButtonStyles.ButtonCommon.OverrideDefault.Back.Color1 = lightColour; - - palette.ButtonStyles.ButtonCommon.OverrideDefault.Content.LongText.Color1 = normalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.OverrideDefault.Content.ShortText.Color1 = normalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.Color1 = darkColour; - - palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.Color2 = baseColour; - - palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.ColorStyle = PaletteColorStyle.GlassCheckedFull; - - palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Content.LongText.Color1 = alternativeNormalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Content.ShortText.Color1 = alternativeNormalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.Color1 = darkColour; - - palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.Color2 = baseColour; - - palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.ColorStyle = PaletteColorStyle.GlassCheckedStump; - - palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Border.DrawBorders = PaletteDrawBorders.All; - - palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Content.LongText.Color1 = alternativeNormalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Content.ShortText.Color1 = alternativeNormalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Back.Color1 = baseColour; - - palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Back.Color2 = baseColour; - - palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Border.DrawBorders = PaletteDrawBorders.All; - - palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Content.LongText.Color1 = alternativeNormalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Content.ShortText.Color1 = alternativeNormalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateCommon.Back.Color1 = lightColour; - - palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color1 = disabledControlColourPreview; - - palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color2 = disabledControlColourPreview; - - /* - palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color1 = lightColour; - - palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color2 = lightColour; - */ - - palette.ButtonStyles.ButtonCommon.StateDisabled.Content.LongText.Color1 = disabledTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateDisabled.Content.ShortText.Color1 = disabledTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateNormal.Back.Color1 = lightColour; - - palette.ButtonStyles.ButtonCommon.StateNormal.Back.Color2 = lightColour; - - palette.ButtonStyles.ButtonCommon.StateNormal.Content.LongText.Color1 = normalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateNormal.Content.LongText.Color2 = normalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateNormal.Content.ShortText.Color1 = normalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateNormal.Content.ShortText.Color2 = normalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StatePressed.Back.Color1 = darkColour; - - palette.ButtonStyles.ButtonCommon.StatePressed.Back.Color2 = baseColour; - - palette.ButtonStyles.ButtonCommon.StatePressed.Content.LongText.Color1 = alternativeNormalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StatePressed.Content.ShortText.Color1 = alternativeNormalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateTracking.Back.Color1 = lightColour; - - palette.ButtonStyles.ButtonCommon.StateTracking.Back.Color2 = lightestColour; - - palette.ButtonStyles.ButtonCommon.StateTracking.Content.LongText.Color1 = normalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateTracking.Content.ShortText.Color1 = normalTextColourPreview; - #endregion - - #region Common - palette.Common.StateCommon.Back.Color1 = darkColour; - - palette.Common.StateCommon.Back.Color2 = middleColour; - - palette.Common.StateCommon.Border.Color1 = middleColour; - - palette.Common.StateCommon.Border.Color2 = lightestColour; - - palette.Common.StateCommon.Border.DrawBorders = PaletteDrawBorders.All; - - palette.Common.StateCommon.Content.LongText.Color1 = normalTextColourPreview; - - palette.Common.StateCommon.Content.LongText.Color2 = normalTextColourPreview; - - palette.Common.StateCommon.Content.ShortText.Color1 = normalTextColourPreview; - - palette.Common.StateCommon.Content.ShortText.Color2 = normalTextColourPreview; - #endregion - - #region Form Styles - palette.FormStyles.FormCommon.StateActive.Back.Color1 = middleColour; - - palette.FormStyles.FormCommon.StateActive.Border.DrawBorders = PaletteDrawBorders.All; - #endregion - - #region Grid Styles - palette.GridStyles.GridSheet.StateCommon.HeaderColumn.Content.Color1 = darkColour; - - palette.GridStyles.GridSheet.StateCommon.HeaderRow.Content.Color1 = darkColour; - - palette.GridStyles.GridSheet.StateNormal.HeaderColumn.Content.Color1 = lightestColour; - - palette.GridStyles.GridSheet.StateNormal.HeaderColumn.Content.Color2 = baseColour; - - palette.GridStyles.GridSheet.StateNormal.HeaderRow.Content.Color1 = lightestColour; - - palette.GridStyles.GridSheet.StateTracking.HeaderColumn.Content.Color1 = middleColour; - #endregion - } - else - { - #region Button Cluster - palette.ButtonStyles.ButtonCluster.OverrideDefault.Back.Color1 = baseColour; - - palette.ButtonStyles.ButtonCluster.OverrideFocus.Back.Color1 = baseColour; - - palette.ButtonStyles.ButtonCluster.StateCheckedNormal.Back.Color1 = baseColour; - - palette.ButtonStyles.ButtonCluster.StateCommon.Back.ColorStyle = PaletteColorStyle.GlassNormalFull; - - palette.ButtonStyles.ButtonCluster.StateNormal.Back.Color1 = middleColour; - - palette.ButtonStyles.ButtonCluster.StatePressed.Back.Color1 = darkColour; - - palette.ButtonStyles.ButtonCluster.StateTracking.Back.Color1 = baseColour; - #endregion - - #region Button Common - palette.ButtonStyles.ButtonCommon.OverrideDefault.Back.Color1 = baseColour; - - palette.ButtonStyles.ButtonCommon.OverrideDefault.Content.LongText.Color1 = alternativeNormalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.OverrideDefault.Content.ShortText.Color1 = alternativeNormalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.Color1 = lightestColour; - - palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.Color2 = lightColour; - - palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.ColorStyle = PaletteColorStyle.GlassCheckedFull; - - palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Content.LongText.Color1 = normalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Content.ShortText.Color1 = normalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.Color1 = lightestColour; - - palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.Color2 = lightColour; - - palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.ColorStyle = PaletteColorStyle.GlassCheckedStump; - - palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Border.DrawBorders = PaletteDrawBorders.All; - - palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Content.LongText.Color1 = normalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Content.ShortText.Color1 = normalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Back.Color1 = lightestColour; - - palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Back.Color2 = lightColour; - - palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Border.DrawBorders = PaletteDrawBorders.All; - - palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Content.LongText.Color1 = normalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Content.ShortText.Color1 = normalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateCommon.Back.Color1 = baseColour; - - palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color1 = disabledControlColourPreview; - - palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color2 = disabledControlColourPreview; - - /* - palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color1 = baseColour; - - palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color2 = baseColour; - */ - - palette.ButtonStyles.ButtonCommon.StateDisabled.Content.LongText.Color1 = disabledTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateDisabled.Content.ShortText.Color1 = disabledTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateNormal.Back.Color1 = baseColour; - - palette.ButtonStyles.ButtonCommon.StateNormal.Back.Color2 = baseColour; - - palette.ButtonStyles.ButtonCommon.StateNormal.Content.LongText.Color1 = alternativeNormalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateNormal.Content.LongText.Color2 = alternativeNormalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateNormal.Content.ShortText.Color1 = alternativeNormalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateNormal.Content.ShortText.Color2 = alternativeNormalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StatePressed.Back.Color1 = lightestColour; - - palette.ButtonStyles.ButtonCommon.StatePressed.Back.Color2 = lightColour; - - palette.ButtonStyles.ButtonCommon.StatePressed.Content.LongText.Color1 = normalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StatePressed.Content.ShortText.Color1 = normalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateTracking.Back.Color1 = baseColour; - - palette.ButtonStyles.ButtonCommon.StateTracking.Back.Color2 = darkColour; - - palette.ButtonStyles.ButtonCommon.StateTracking.Content.LongText.Color1 = alternativeNormalTextColourPreview; - - palette.ButtonStyles.ButtonCommon.StateTracking.Content.ShortText.Color1 = alternativeNormalTextColourPreview; - #endregion - - #region Common - palette.Common.StateCommon.Back.Color1 = lightestColour; - - palette.Common.StateCommon.Back.Color2 = baseColour; - - palette.Common.StateCommon.Border.Color1 = baseColour; - - palette.Common.StateCommon.Border.Color2 = darkColour; - - palette.Common.StateCommon.Border.DrawBorders = PaletteDrawBorders.All; - - palette.Common.StateCommon.Content.LongText.Color1 = alternativeNormalTextColourPreview; - - palette.Common.StateCommon.Content.LongText.Color2 = alternativeNormalTextColourPreview; - - palette.Common.StateCommon.Content.ShortText.Color1 = alternativeNormalTextColourPreview; - - palette.Common.StateCommon.Content.ShortText.Color2 = alternativeNormalTextColourPreview; - #endregion - - #region Form Styles - palette.FormStyles.FormCommon.StateActive.Back.Color1 = baseColour; - - palette.FormStyles.FormCommon.StateActive.Border.DrawBorders = PaletteDrawBorders.All; - #endregion - - #region Grid Styles - palette.GridStyles.GridSheet.StateCommon.HeaderColumn.Content.Color1 = lightestColour; - - palette.GridStyles.GridSheet.StateCommon.HeaderRow.Content.Color1 = lightestColour; - - palette.GridStyles.GridSheet.StateNormal.HeaderColumn.Content.Color1 = darkColour; - - palette.GridStyles.GridSheet.StateNormal.HeaderColumn.Content.Color2 = middleColour; - - palette.GridStyles.GridSheet.StateNormal.HeaderRow.Content.Color1 = darkColour; - - palette.GridStyles.GridSheet.StateTracking.HeaderColumn.Content.Color1 = baseColour; - #endregion - - #region Header Styles - palette.HeaderStyles.HeaderCommon.StateCommon.Back.Color1 = middleColour; - - palette.HeaderStyles.HeaderCommon.StateCommon.Back.Color2 = lightColour; - - palette.HeaderStyles.HeaderCommon.StateDisabled.Back.Color1 = lightColour; - - palette.HeaderStyles.HeaderCommon.StateDisabled.Back.Color2 = lightestColour; - - palette.HeaderStyles.HeaderCommon.StateDisabled.Content.LongText.Color1 = disabledTextColourPreview; - - palette.HeaderStyles.HeaderCommon.StateDisabled.Content.LongText.Color2 = baseColour; - - palette.HeaderStyles.HeaderCommon.StateDisabled.Content.ShortText.Color1 = disabledTextColourPreview; - - palette.HeaderStyles.HeaderCommon.StateDisabled.Content.ShortText.Color2 = baseColour; - - palette.HeaderStyles.HeaderForm.StateCommon.Back.Color1 = middleColour; - - palette.HeaderStyles.HeaderForm.StateCommon.Back.Color2 = lightColour; - - palette.HeaderStyles.HeaderForm.StateDisabled.Back.Color1 = disabledControlColourPreview; - - palette.HeaderStyles.HeaderForm.StateDisabled.Back.Color2 = baseColour; - - palette.HeaderStyles.HeaderForm.StateDisabled.Content.LongText.Color1 = disabledTextColourPreview; - - palette.HeaderStyles.HeaderForm.StateDisabled.Content.ShortText.Color1 = disabledTextColourPreview; - #endregion - - #region Label Styles - palette.LabelStyles.LabelNormalControl.OverrideNotVisited.LongText.Color1 = linkNormalColourPreview; - - palette.LabelStyles.LabelNormalControl.OverrideNotVisited.ShortText.Color1 = linkNormalColourPreview; - - palette.LabelStyles.LabelNormalControl.OverridePressed.LongText.Color1 = linkHoverColourPreview; - - palette.LabelStyles.LabelNormalControl.OverridePressed.ShortText.Color1 = linkHoverColourPreview; - - palette.LabelStyles.LabelNormalControl.OverrideVisited.LongText.Color1 = linkVisitedColourPreview; - - palette.LabelStyles.LabelNormalControl.OverrideVisited.ShortText.Color1 = linkVisitedColourPreview; - - palette.LabelStyles.LabelNormalControl.StateDisabled.LongText.Color1 = linkDisabledColourPreview; - - palette.LabelStyles.LabelNormalControl.StateDisabled.ShortText.Color1 = linkDisabledColourPreview; - - palette.LabelStyles.LabelNormalControl.StateNormal.LongText.Color1 = normalTextColourPreview; - - palette.LabelStyles.LabelNormalControl.StateNormal.ShortText.Color1 = normalTextColourPreview; - - palette.LabelStyles.LabelNormalControl.OverrideFocus.LongText.Color1 = linkFocusedColour; - - palette.LabelStyles.LabelNormalControl.OverrideFocus.ShortText.Color1 = linkFocusedColour; - #endregion - - #region Ribbon - palette.Ribbon.RibbonAppButton.StateCommon.BackColor2 = baseColour; - - palette.Ribbon.RibbonAppButton.StateCommon.BackColor3 = customColourThree; - - palette.Ribbon.RibbonAppButton.StateCommon.BackColor5 = baseColour; - - palette.Ribbon.RibbonAppButton.StatePressed.BackColor5 = darkColour; - - palette.Ribbon.RibbonAppButton.StateTracking.BackColor5 = customColourFive; - - palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor1 = baseColour; - - palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor2 = customColourTwo; - - palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor3 = baseColour; - - palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor4 = baseColour; - - palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor5 = baseColour; - - palette.Ribbon.RibbonGroupButtonText.StateCommon.TextColor = customTextColourTwo; - - palette.Ribbon.RibbonGroupCheckBoxText.StateCommon.TextColor = customTextColourTwo; - - palette.Ribbon.RibbonGroupCollapsedBack.StateNormal.BackColor1 = SystemColors.Window; - - palette.Ribbon.RibbonGroupCollapsedBack.StateNormal.BackColor2 = baseColour; - - palette.Ribbon.RibbonGroupCollapsedBack.StateNormal.BackColor3 = lightColour; - - palette.Ribbon.RibbonGroupCollapsedBack.StateNormal.BackColor4 = baseColour; - - palette.Ribbon.RibbonGroupCollapsedBack.StateTracking.BackColor1 = SystemColors.Window; - - palette.Ribbon.RibbonGroupCollapsedBack.StateTracking.BackColor2 = lightColour; - - palette.Ribbon.RibbonGroupCollapsedBack.StateTracking.BackColor3 = lightestColour; // Or 230, 230, 230 - - palette.Ribbon.RibbonGroupCollapsedBack.StateTracking.BackColor4 = baseColour; - - palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor1 = baseColour; - - palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor2 = middleColour; - - palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor3 = lightColour; - - palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor4 = baseColour; - - palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor5 = baseColour; - - palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor1 = baseColour; - - palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor2 = baseColour; - - palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor3 = lightColour; - - palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor4 = lightColour; - - palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor5 = baseColour; - - palette.Ribbon.RibbonGroupCollapsedFrameBorder.StateCommon.BackColor1 = lightColour; - - palette.Ribbon.RibbonGroupCollapsedFrameBorder.StateCommon.BackColor2 = lightestColour; // Or 230, 230, 230 - - palette.Ribbon.RibbonGroupCollapsedText.StateCommon.TextColor = alternativeNormalTextColourPreview; - - palette.Ribbon.RibbonGroupNormalBorder.StateCommon.BackColor1 = baseColour; - - palette.Ribbon.RibbonGroupNormalBorder.StateCommon.BackColor2 = middleColour; - - palette.Ribbon.RibbonGroupNormalTitle.StateCommon.BackColor1 = lightestColour; // Or 230, 230, 230 - - palette.Ribbon.RibbonGroupNormalTitle.StateCommon.BackColor2 = middleColour; - - palette.Ribbon.RibbonGroupNormalTitle.StateCommon.TextColor = customTextColourFive; - - palette.Ribbon.RibbonGroupNormalTitle.StateTracking.BackColor1 = lightestColour; - - palette.Ribbon.RibbonGroupNormalTitle.StateTracking.BackColor2 = middleColour; - - palette.Ribbon.RibbonQATFullbar.BackColor1 = middleColour; - - palette.Ribbon.RibbonQATFullbar.BackColor2 = middleColour; - - palette.Ribbon.RibbonQATFullbar.BackColor3 = middleColour; - - palette.Ribbon.RibbonQATMinibar.StateCommon.BackColor1 = middleColour; - - palette.Ribbon.RibbonQATMinibar.StateCommon.BackColor2 = middleColour; - - palette.Ribbon.RibbonQATMinibar.StateCommon.BackColor3 = middleColour; - - palette.Ribbon.RibbonQATMinibar.StateCommon.BackColor4 = middleColour; - - palette.Ribbon.RibbonQATOverflow.BackColor1 = middleColour; - - palette.Ribbon.RibbonQATOverflow.BackColor2 = middleColour; - - palette.Ribbon.RibbonTab.StateCheckedTracking.BackColor1 = middleColour; - - palette.Ribbon.RibbonTab.StateCheckedTracking.BackColor2 = lightColour; - - palette.Ribbon.RibbonTab.StateCheckedTracking.BackColor3 = darkColour; - - palette.Ribbon.RibbonTab.StateCheckedTracking.BackColor4 = middleColour; - - palette.Ribbon.RibbonTab.StateCommon.BackColor1 = middleColour; - - palette.Ribbon.RibbonTab.StateCommon.BackColor3 = middleColour; - - palette.Ribbon.RibbonTab.StateCommon.BackColor4 = lightColour; - - palette.Ribbon.RibbonTab.StateCommon.BackColor5 = lightColour; - - palette.Ribbon.RibbonTab.StateCommon.TextColor = normalTextColourPreview; - - palette.Ribbon.RibbonTab.StateContextCheckedTracking.BackColor2 = middleColour; - - palette.Ribbon.RibbonTab.StateTracking.BackColor2 = middleColour; - - palette.Ribbon.RibbonTab.StateCommon.TextColor = ribbonTabTextColour; - #endregion - - #region Separator Styles - palette.SeparatorStyles.SeparatorCommon.StateCommon.Back.Color1 = baseColour; - - palette.SeparatorStyles.SeparatorCommon.StateCommon.Back.Color2 = baseColour; - - palette.SeparatorStyles.SeparatorCommon.StateCommon.Border.Color1 = baseColour; - - palette.SeparatorStyles.SeparatorCommon.StateCommon.Border.Color1 = baseColour; - - palette.SeparatorStyles.SeparatorCommon.StateCommon.Border.DrawBorders = PaletteDrawBorders.All; - #endregion - - #region Tool Menu Status - palette.ToolMenuStatus.Button.ButtonPressedBorder = baseColour; - - palette.ToolMenuStatus.Button.ButtonSelectedBorder = baseColour; - - palette.ToolMenuStatus.Button.OverflowButtonGradientBegin = darkColour; - - palette.ToolMenuStatus.Button.OverflowButtonGradientEnd = baseColour; - - palette.ToolMenuStatus.Button.OverflowButtonGradientMiddle = middleColour; - - palette.ToolMenuStatus.Grip.GripDark = baseColour; - - palette.ToolMenuStatus.Grip.GripLight = customColourFive; - - palette.ToolMenuStatus.Menu.ImageMarginGradientBegin = baseColour; - - palette.ToolMenuStatus.Menu.ImageMarginGradientEnd = darkColour; - - palette.ToolMenuStatus.Menu.ImageMarginGradientMiddle = middleColour; - - palette.ToolMenuStatus.Menu.ImageMarginRevealedGradientBegin = baseColour; - - palette.ToolMenuStatus.Menu.ImageMarginRevealedGradientEnd = darkColour; - - palette.ToolMenuStatus.Menu.ImageMarginRevealedGradientMiddle = middleColour; - - palette.ToolMenuStatus.Menu.MenuBorder = baseColour; - - palette.ToolMenuStatus.Menu.MenuItemBorder = darkColour; - - palette.ToolMenuStatus.Menu.MenuItemPressedGradientBegin = baseColour; - - palette.ToolMenuStatus.Menu.MenuItemPressedGradientEnd = darkColour; - - palette.ToolMenuStatus.Menu.MenuItemPressedGradientMiddle = middleColour; - - palette.ToolMenuStatus.Menu.MenuItemSelected = middleColour; - - palette.ToolMenuStatus.Menu.MenuItemSelectedGradientBegin = darkColour; - - palette.ToolMenuStatus.Menu.MenuItemSelectedGradientEnd = baseColour; - - palette.ToolMenuStatus.Menu.MenuItemText = menuTextColour; - - palette.ToolMenuStatus.MenuStrip.MenuStripGradientBegin = baseColour; - - palette.ToolMenuStatus.MenuStrip.MenuStripGradientEnd = darkColour; - - palette.ToolMenuStatus.MenuStrip.MenuStripText = normalTextColourPreview; - - palette.ToolMenuStatus.Rafting.RaftingContainerGradientBegin = middleColour; - - palette.ToolMenuStatus.Rafting.RaftingContainerGradientEnd = darkColour; - - palette.ToolMenuStatus.Separator.SeparatorDark = baseColour; - - palette.ToolMenuStatus.Separator.SeparatorLight = lightColour; - - palette.ToolMenuStatus.StatusStrip.StatusStripGradientBegin = baseColour; - - palette.ToolMenuStatus.StatusStrip.StatusStripGradientEnd = lightColour; - - palette.ToolMenuStatus.StatusStrip.StatusStripText = normalTextColourPreview; - - palette.ToolMenuStatus.ToolStrip.ToolStripBorder = darkColour; - - palette.ToolMenuStatus.ToolStrip.ToolStripContentPanelGradientBegin = lightColour; - - palette.ToolMenuStatus.ToolStrip.ToolStripContentPanelGradientEnd = darkColour; - - palette.ToolMenuStatus.ToolStrip.ToolStripDropDownBackground = middleColour; - - palette.ToolMenuStatus.ToolStrip.ToolStripGradientBegin = darkColour; - - palette.ToolMenuStatus.ToolStrip.ToolStripGradientEnd = lightColour; - - palette.ToolMenuStatus.ToolStrip.ToolStripGradientMiddle = middleColour; - - palette.ToolMenuStatus.ToolStrip.ToolStripPanelGradientBegin = lightColour; - - palette.ToolMenuStatus.ToolStrip.ToolStripPanelGradientEnd = darkColour; - - palette.ToolMenuStatus.ToolStrip.ToolStripText = normalTextColourPreview; - #endregion - } - - palette.Export(); - - statusState.Text = $"Palette exported to: {palette.GetCustomisedKryptonPaletteFilePath()}"; - } - catch (Exception exc) - { - ExceptionHandler.CaptureException(exc, icon: ExtendedKryptonMessageBoxIcon.Error, methodSignature: Helpers.GetCurrentMethod()); - } - } - - public static void ChangeTheme(KryptonComboBox themeChoice, KryptonCustomPaletteBase palette) - { - if (themeChoice.Text == "Global") - { - palette.BasePaletteMode = PaletteMode.Global; - - SwitchPaletteMode(PaletteMode.Global); - } - else if (themeChoice.Text == "Professional System") - { - palette.BasePaletteMode = PaletteMode.ProfessionalSystem; - - SwitchPaletteMode(PaletteMode.ProfessionalSystem); - } - else if (themeChoice.Text == "Professional Office 2003") - { - palette.BasePaletteMode = PaletteMode.ProfessionalOffice2003; - - SwitchPaletteMode(PaletteMode.ProfessionalOffice2003); - } - else if (themeChoice.Text == "Office 2007 Blue") - { - palette.BasePaletteMode = PaletteMode.Office2007Blue; - - SwitchPaletteMode(PaletteMode.Office2007Blue); - } - else if (themeChoice.Text == "Office 2007 Black") - { - palette.BasePaletteMode = PaletteMode.Office2007Black; - - SwitchPaletteMode(PaletteMode.Office2007Black); - } - else if (themeChoice.Text == "Office 2007 Silver") - { - palette.BasePaletteMode = PaletteMode.Office2007Silver; - - SwitchPaletteMode(PaletteMode.Office2007Silver); - } - else if (themeChoice.Text == "Office 2010 Blue") - { - palette.BasePaletteMode = PaletteMode.Office2010Blue; - - SwitchPaletteMode(PaletteMode.Office2010Blue); - } - else if (themeChoice.Text == "Office 2010 Black") - { - palette.BasePaletteMode = PaletteMode.Office2010Black; - - SwitchPaletteMode(PaletteMode.Office2010Black); - } - else if (themeChoice.Text == "Office 2010 Silver") - { - palette.BasePaletteMode = PaletteMode.Office2010Silver; - - SwitchPaletteMode(PaletteMode.Office2010Silver); - } - else if (themeChoice.Text == "Office 2013 White") - { - palette.BasePaletteMode = PaletteMode.Office2013White; - - SwitchPaletteMode(PaletteMode.Office2013White); - } - else if (themeChoice.Text == "Sparkle Blue") - { - palette.BasePaletteMode = PaletteMode.SparkleBlue; - - SwitchPaletteMode(PaletteMode.SparkleBlue); - } - else if (themeChoice.Text == "Sparkle Orange") - { - palette.BasePaletteMode = PaletteMode.SparkleOrange; - - SwitchPaletteMode(PaletteMode.SparkleOrange); - } - else if (themeChoice.Text == "Sparkle Purple") - { - palette.BasePaletteMode = PaletteMode.SparklePurple; - - SwitchPaletteMode(PaletteMode.SparklePurple); - } - else if (themeChoice.Text == "Custom") - { - palette.BasePaletteMode = PaletteMode.Custom; - - SwitchPaletteMode(PaletteMode.Custom); - } - } - - private static void SwitchPaletteMode(PaletteMode mode) - { - PaletteCompisitionEngine pce = new(); - - pce.SetPaletteMode(mode); - } - - public static void PropagateThemes(KryptonComboBox themeList, bool sort = true) - { - ArrayList themeCollection = new(15); - - themeCollection.Add("Global"); - - themeCollection.Add("Professional System"); - - themeCollection.Add("Professional Office 2003"); - - themeCollection.Add("Office 2007 Blue"); - - themeCollection.Add("Office 2007 Black"); - - themeCollection.Add("Office 2007 Silver"); - - themeCollection.Add("Office 2010 Blue"); - - themeCollection.Add("Office 2010 Black"); - - themeCollection.Add("Office 2010 Silver"); - - themeCollection.Add("Office 2013"); - - themeCollection.Add("Office 2013 White"); - - themeCollection.Add("Sparkle Blue"); - - themeCollection.Add("Sparkle Orange"); - - themeCollection.Add("Sparkle Purple"); - - themeCollection.Add("Custom"); - - if (sort) - { - themeCollection.Sort(); - } - - foreach (string item in themeCollection) - { - themeList.Items.Add(item); - } - } - - public static void PropagateThemes(KryptonRibbonGroupComboBox themeList, bool sort = true) - { - ArrayList themeCollection = new(15); - - themeCollection.Add("Global"); - - themeCollection.Add("Professional System"); - - themeCollection.Add("Professional Office 2003"); - - themeCollection.Add("Office 2007 Blue"); - - themeCollection.Add("Office 2007 Black"); - - themeCollection.Add("Office 2007 Silver"); - - themeCollection.Add("Office 2010 Blue"); - - themeCollection.Add("Office 2010 Black"); - - themeCollection.Add("Office 2010 Silver"); - - themeCollection.Add("Office 2013"); - - themeCollection.Add("Office 2013 White"); - - themeCollection.Add("Sparkle Blue"); - - themeCollection.Add("Sparkle Orange"); - - themeCollection.Add("Sparkle Purple"); - - themeCollection.Add("Custom"); - - if (sort) - { - themeCollection.Sort(); - } - - foreach (string item in themeCollection) - { - themeList.Items.Add(item); - } - } - #endregion - - #region Setters and Getters - /// - /// Sets the PaletteMode to the value of mode. - /// - /// The value of mode. - public void SetPaletteMode(PaletteMode mode) - { - PaletteMode = mode; - } - - /// - /// Gets the PaletteMode value. - /// - /// The value of mode. - public PaletteMode GetPaletteMode() - { - return PaletteMode; - } - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Palette/PaletteCompositionEngine.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Palette/PaletteCompositionEngine.cs new file mode 100644 index 000000000..2062e4da8 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Palette/PaletteCompositionEngine.cs @@ -0,0 +1,860 @@ +#region MIT License +/* + * + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Core +{ + public class PaletteCompositionEngine + { + #region Variables + private BasePaletteType _paletteType; + #endregion + + #region Properties + public BasePaletteType PaletteType + { + get => _paletteType; + set => _paletteType = value; + } + #endregion + + #region Constructors + public PaletteCompositionEngine() + { + + } + #endregion + + #region Methods + /// + /// Creates a new palette. + /// + /// The palette. + /// The palette type. + /// The base colour. + /// The dark colour. + /// The middle colour. + /// The light colour. + /// The lightest colour. + /// The border colour preview. + /// The alternative normal text colour preview. + /// The normal text colour preview. + /// The disabled text colour preview. + /// The focused text colour preview. + /// The pressed text colour preview. + /// The disabled colour preview. + /// The link normal colour preview. + /// The link hover colour preview. + /// The link visited colour preview. + /// The custom colour one. + /// The custom colour two. + /// The custom colour three. + /// The custom colour four. + /// The custom colour five. + /// The custom text colour one. + /// The custom text colour two. + /// The custom text colour three. + /// The custom text colour four. + /// The custom text colour five. + /// The menu text colour. + /// The status text colour. + /// The ribbon tab text colour. + /// State of the status. + /// if set to true [invert colours]. + public static void CreatePalette(KryptonCustomPaletteBase palette, BasePaletteType paletteType, Color baseColour, Color darkColour, Color middleColour, Color lightColour, Color lightestColour, Color borderColourPreview, Color alternativeNormalTextColourPreview, Color normalTextColourPreview, Color disabledTextColourPreview, Color focusedTextColourPreview, Color pressedTextColourPreview, Color disabledControlColourPreview, Color linkDisabledColourPreview, Color linkFocusedColour, Color linkNormalColourPreview, Color linkHoverColourPreview, Color linkVisitedColourPreview, Color customColourOne, Color customColourTwo, Color customColourThree, Color customColourFour, Color customColourFive, Color customTextColourOne, Color customTextColourTwo, Color customTextColourThree, Color customTextColourFour, Color customTextColourFive, Color menuTextColour, Color statusTextColour, Color ribbonTabTextColour, ToolStripLabel statusState = null, bool invertColours = false) + { + palette = new(); + + try + { + palette.BasePalette.BasePaletteType = paletteType; + + if (lightestColour == Color.Transparent) + { + lightestColour = lightColour; + } + + if (invertColours) + { + #region Button Cluster + palette.ButtonStyles.ButtonCluster.OverrideDefault.Back.Color1 = darkColour; + + palette.ButtonStyles.ButtonCluster.OverrideFocus.Back.Color1 = darkColour; + + palette.ButtonStyles.ButtonCluster.StateCheckedNormal.Back.Color1 = darkColour; + + palette.ButtonStyles.ButtonCluster.StateCommon.Back.ColorStyle = PaletteColorStyle.GlassNormalFull; + + palette.ButtonStyles.ButtonCluster.StateNormal.Back.Color1 = middleColour; + + palette.ButtonStyles.ButtonCluster.StatePressed.Back.Color1 = baseColour; + + palette.ButtonStyles.ButtonCluster.StateTracking.Back.Color1 = darkColour; + #endregion + + #region Button Common + palette.ButtonStyles.ButtonCommon.OverrideDefault.Back.Color1 = lightColour; + + palette.ButtonStyles.ButtonCommon.OverrideDefault.Content.LongText.Color1 = normalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.OverrideDefault.Content.ShortText.Color1 = normalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.Color1 = darkColour; + + palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.Color2 = baseColour; + + palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.ColorStyle = PaletteColorStyle.GlassCheckedFull; + + palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Content.LongText.Color1 = alternativeNormalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Content.ShortText.Color1 = alternativeNormalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.Color1 = darkColour; + + palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.Color2 = baseColour; + + palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.ColorStyle = PaletteColorStyle.GlassCheckedStump; + + palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Border.DrawBorders = PaletteDrawBorders.All; + + palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Content.LongText.Color1 = alternativeNormalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Content.ShortText.Color1 = alternativeNormalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Back.Color1 = baseColour; + + palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Back.Color2 = baseColour; + + palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Border.DrawBorders = PaletteDrawBorders.All; + + palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Content.LongText.Color1 = alternativeNormalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Content.ShortText.Color1 = alternativeNormalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateCommon.Back.Color1 = lightColour; + + palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color1 = disabledControlColourPreview; + + palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color2 = disabledControlColourPreview; + + /* + palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color1 = lightColour; + + palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color2 = lightColour; + */ + + palette.ButtonStyles.ButtonCommon.StateDisabled.Content.LongText.Color1 = disabledTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateDisabled.Content.ShortText.Color1 = disabledTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateNormal.Back.Color1 = lightColour; + + palette.ButtonStyles.ButtonCommon.StateNormal.Back.Color2 = lightColour; + + palette.ButtonStyles.ButtonCommon.StateNormal.Content.LongText.Color1 = normalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateNormal.Content.LongText.Color2 = normalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateNormal.Content.ShortText.Color1 = normalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateNormal.Content.ShortText.Color2 = normalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StatePressed.Back.Color1 = darkColour; + + palette.ButtonStyles.ButtonCommon.StatePressed.Back.Color2 = baseColour; + + palette.ButtonStyles.ButtonCommon.StatePressed.Content.LongText.Color1 = alternativeNormalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StatePressed.Content.ShortText.Color1 = alternativeNormalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateTracking.Back.Color1 = lightColour; + + palette.ButtonStyles.ButtonCommon.StateTracking.Back.Color2 = lightestColour; + + palette.ButtonStyles.ButtonCommon.StateTracking.Content.LongText.Color1 = normalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateTracking.Content.ShortText.Color1 = normalTextColourPreview; + #endregion + + #region Common + palette.Common.StateCommon.Back.Color1 = darkColour; + + palette.Common.StateCommon.Back.Color2 = middleColour; + + palette.Common.StateCommon.Border.Color1 = middleColour; + + palette.Common.StateCommon.Border.Color2 = lightestColour; + + palette.Common.StateCommon.Border.DrawBorders = PaletteDrawBorders.All; + + palette.Common.StateCommon.Content.LongText.Color1 = normalTextColourPreview; + + palette.Common.StateCommon.Content.LongText.Color2 = normalTextColourPreview; + + palette.Common.StateCommon.Content.ShortText.Color1 = normalTextColourPreview; + + palette.Common.StateCommon.Content.ShortText.Color2 = normalTextColourPreview; + #endregion + + #region Form Styles + palette.FormStyles.FormCommon.StateActive.Back.Color1 = middleColour; + + palette.FormStyles.FormCommon.StateActive.Border.DrawBorders = PaletteDrawBorders.All; + #endregion + + #region Grid Styles + palette.GridStyles.GridSheet.StateCommon.HeaderColumn.Content.Color1 = darkColour; + + palette.GridStyles.GridSheet.StateCommon.HeaderRow.Content.Color1 = darkColour; + + palette.GridStyles.GridSheet.StateNormal.HeaderColumn.Content.Color1 = lightestColour; + + palette.GridStyles.GridSheet.StateNormal.HeaderColumn.Content.Color2 = baseColour; + + palette.GridStyles.GridSheet.StateNormal.HeaderRow.Content.Color1 = lightestColour; + + palette.GridStyles.GridSheet.StateTracking.HeaderColumn.Content.Color1 = middleColour; + #endregion + } + else + { + #region Button Cluster + palette.ButtonStyles.ButtonCluster.OverrideDefault.Back.Color1 = baseColour; + + palette.ButtonStyles.ButtonCluster.OverrideFocus.Back.Color1 = baseColour; + + palette.ButtonStyles.ButtonCluster.StateCheckedNormal.Back.Color1 = baseColour; + + palette.ButtonStyles.ButtonCluster.StateCommon.Back.ColorStyle = PaletteColorStyle.GlassNormalFull; + + palette.ButtonStyles.ButtonCluster.StateNormal.Back.Color1 = middleColour; + + palette.ButtonStyles.ButtonCluster.StatePressed.Back.Color1 = darkColour; + + palette.ButtonStyles.ButtonCluster.StateTracking.Back.Color1 = baseColour; + #endregion + + #region Button Common + palette.ButtonStyles.ButtonCommon.OverrideDefault.Back.Color1 = baseColour; + + palette.ButtonStyles.ButtonCommon.OverrideDefault.Content.LongText.Color1 = alternativeNormalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.OverrideDefault.Content.ShortText.Color1 = alternativeNormalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.Color1 = lightestColour; + + palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.Color2 = lightColour; + + palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.ColorStyle = PaletteColorStyle.GlassCheckedFull; + + palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Content.LongText.Color1 = normalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Content.ShortText.Color1 = normalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.Color1 = lightestColour; + + palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.Color2 = lightColour; + + palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.ColorStyle = PaletteColorStyle.GlassCheckedStump; + + palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Border.DrawBorders = PaletteDrawBorders.All; + + palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Content.LongText.Color1 = normalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Content.ShortText.Color1 = normalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Back.Color1 = lightestColour; + + palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Back.Color2 = lightColour; + + palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Border.DrawBorders = PaletteDrawBorders.All; + + palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Content.LongText.Color1 = normalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Content.ShortText.Color1 = normalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateCommon.Back.Color1 = baseColour; + + palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color1 = disabledControlColourPreview; + + palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color2 = disabledControlColourPreview; + + /* + palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color1 = baseColour; + + palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color2 = baseColour; + */ + + palette.ButtonStyles.ButtonCommon.StateDisabled.Content.LongText.Color1 = disabledTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateDisabled.Content.ShortText.Color1 = disabledTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateNormal.Back.Color1 = baseColour; + + palette.ButtonStyles.ButtonCommon.StateNormal.Back.Color2 = baseColour; + + palette.ButtonStyles.ButtonCommon.StateNormal.Content.LongText.Color1 = alternativeNormalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateNormal.Content.LongText.Color2 = alternativeNormalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateNormal.Content.ShortText.Color1 = alternativeNormalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateNormal.Content.ShortText.Color2 = alternativeNormalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StatePressed.Back.Color1 = lightestColour; + + palette.ButtonStyles.ButtonCommon.StatePressed.Back.Color2 = lightColour; + + palette.ButtonStyles.ButtonCommon.StatePressed.Content.LongText.Color1 = normalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StatePressed.Content.ShortText.Color1 = normalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateTracking.Back.Color1 = baseColour; + + palette.ButtonStyles.ButtonCommon.StateTracking.Back.Color2 = darkColour; + + palette.ButtonStyles.ButtonCommon.StateTracking.Content.LongText.Color1 = alternativeNormalTextColourPreview; + + palette.ButtonStyles.ButtonCommon.StateTracking.Content.ShortText.Color1 = alternativeNormalTextColourPreview; + #endregion + + #region Common + palette.Common.StateCommon.Back.Color1 = lightestColour; + + palette.Common.StateCommon.Back.Color2 = baseColour; + + palette.Common.StateCommon.Border.Color1 = baseColour; + + palette.Common.StateCommon.Border.Color2 = darkColour; + + palette.Common.StateCommon.Border.DrawBorders = PaletteDrawBorders.All; + + palette.Common.StateCommon.Content.LongText.Color1 = alternativeNormalTextColourPreview; + + palette.Common.StateCommon.Content.LongText.Color2 = alternativeNormalTextColourPreview; + + palette.Common.StateCommon.Content.ShortText.Color1 = alternativeNormalTextColourPreview; + + palette.Common.StateCommon.Content.ShortText.Color2 = alternativeNormalTextColourPreview; + #endregion + + #region Form Styles + palette.FormStyles.FormCommon.StateActive.Back.Color1 = baseColour; + + palette.FormStyles.FormCommon.StateActive.Border.DrawBorders = PaletteDrawBorders.All; + #endregion + + #region Grid Styles + palette.GridStyles.GridSheet.StateCommon.HeaderColumn.Content.Color1 = lightestColour; + + palette.GridStyles.GridSheet.StateCommon.HeaderRow.Content.Color1 = lightestColour; + + palette.GridStyles.GridSheet.StateNormal.HeaderColumn.Content.Color1 = darkColour; + + palette.GridStyles.GridSheet.StateNormal.HeaderColumn.Content.Color2 = middleColour; + + palette.GridStyles.GridSheet.StateNormal.HeaderRow.Content.Color1 = darkColour; + + palette.GridStyles.GridSheet.StateTracking.HeaderColumn.Content.Color1 = baseColour; + #endregion + + #region Header Styles + palette.HeaderStyles.HeaderCommon.StateCommon.Back.Color1 = middleColour; + + palette.HeaderStyles.HeaderCommon.StateCommon.Back.Color2 = lightColour; + + palette.HeaderStyles.HeaderCommon.StateDisabled.Back.Color1 = lightColour; + + palette.HeaderStyles.HeaderCommon.StateDisabled.Back.Color2 = lightestColour; + + palette.HeaderStyles.HeaderCommon.StateDisabled.Content.LongText.Color1 = disabledTextColourPreview; + + palette.HeaderStyles.HeaderCommon.StateDisabled.Content.LongText.Color2 = baseColour; + + palette.HeaderStyles.HeaderCommon.StateDisabled.Content.ShortText.Color1 = disabledTextColourPreview; + + palette.HeaderStyles.HeaderCommon.StateDisabled.Content.ShortText.Color2 = baseColour; + + palette.HeaderStyles.HeaderForm.StateCommon.Back.Color1 = middleColour; + + palette.HeaderStyles.HeaderForm.StateCommon.Back.Color2 = lightColour; + + palette.HeaderStyles.HeaderForm.StateDisabled.Back.Color1 = disabledControlColourPreview; + + palette.HeaderStyles.HeaderForm.StateDisabled.Back.Color2 = baseColour; + + palette.HeaderStyles.HeaderForm.StateDisabled.Content.LongText.Color1 = disabledTextColourPreview; + + palette.HeaderStyles.HeaderForm.StateDisabled.Content.ShortText.Color1 = disabledTextColourPreview; + #endregion + + #region Label Styles + palette.LabelStyles.LabelNormalControl.OverrideNotVisited.LongText.Color1 = linkNormalColourPreview; + + palette.LabelStyles.LabelNormalControl.OverrideNotVisited.ShortText.Color1 = linkNormalColourPreview; + + palette.LabelStyles.LabelNormalControl.OverridePressed.LongText.Color1 = linkHoverColourPreview; + + palette.LabelStyles.LabelNormalControl.OverridePressed.ShortText.Color1 = linkHoverColourPreview; + + palette.LabelStyles.LabelNormalControl.OverrideVisited.LongText.Color1 = linkVisitedColourPreview; + + palette.LabelStyles.LabelNormalControl.OverrideVisited.ShortText.Color1 = linkVisitedColourPreview; + + palette.LabelStyles.LabelNormalControl.StateDisabled.LongText.Color1 = linkDisabledColourPreview; + + palette.LabelStyles.LabelNormalControl.StateDisabled.ShortText.Color1 = linkDisabledColourPreview; + + palette.LabelStyles.LabelNormalControl.StateNormal.LongText.Color1 = normalTextColourPreview; + + palette.LabelStyles.LabelNormalControl.StateNormal.ShortText.Color1 = normalTextColourPreview; + + palette.LabelStyles.LabelNormalControl.OverrideFocus.LongText.Color1 = linkFocusedColour; + + palette.LabelStyles.LabelNormalControl.OverrideFocus.ShortText.Color1 = linkFocusedColour; + #endregion + + #region Ribbon + palette.Ribbon.RibbonAppButton.StateCommon.BackColor2 = baseColour; + + palette.Ribbon.RibbonAppButton.StateCommon.BackColor3 = customColourThree; + + palette.Ribbon.RibbonAppButton.StateCommon.BackColor5 = baseColour; + + palette.Ribbon.RibbonAppButton.StatePressed.BackColor5 = darkColour; + + palette.Ribbon.RibbonAppButton.StateTracking.BackColor5 = customColourFive; + + palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor1 = baseColour; + + palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor2 = customColourTwo; + + palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor3 = baseColour; + + palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor4 = baseColour; + + palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor5 = baseColour; + + palette.Ribbon.RibbonGroupButtonText.StateCommon.TextColor = customTextColourTwo; + + palette.Ribbon.RibbonGroupCheckBoxText.StateCommon.TextColor = customTextColourTwo; + + palette.Ribbon.RibbonGroupCollapsedBack.StateNormal.BackColor1 = SystemColors.Window; + + palette.Ribbon.RibbonGroupCollapsedBack.StateNormal.BackColor2 = baseColour; + + palette.Ribbon.RibbonGroupCollapsedBack.StateNormal.BackColor3 = lightColour; + + palette.Ribbon.RibbonGroupCollapsedBack.StateNormal.BackColor4 = baseColour; + + palette.Ribbon.RibbonGroupCollapsedBack.StateTracking.BackColor1 = SystemColors.Window; + + palette.Ribbon.RibbonGroupCollapsedBack.StateTracking.BackColor2 = lightColour; + + palette.Ribbon.RibbonGroupCollapsedBack.StateTracking.BackColor3 = lightestColour; // Or 230, 230, 230 + + palette.Ribbon.RibbonGroupCollapsedBack.StateTracking.BackColor4 = baseColour; + + palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor1 = baseColour; + + palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor2 = middleColour; + + palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor3 = lightColour; + + palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor4 = baseColour; + + palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor5 = baseColour; + + palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor1 = baseColour; + + palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor2 = baseColour; + + palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor3 = lightColour; + + palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor4 = lightColour; + + palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor5 = baseColour; + + palette.Ribbon.RibbonGroupCollapsedFrameBorder.StateCommon.BackColor1 = lightColour; + + palette.Ribbon.RibbonGroupCollapsedFrameBorder.StateCommon.BackColor2 = lightestColour; // Or 230, 230, 230 + + palette.Ribbon.RibbonGroupCollapsedText.StateCommon.TextColor = alternativeNormalTextColourPreview; + + palette.Ribbon.RibbonGroupNormalBorder.StateCommon.BackColor1 = baseColour; + + palette.Ribbon.RibbonGroupNormalBorder.StateCommon.BackColor2 = middleColour; + + palette.Ribbon.RibbonGroupNormalTitle.StateCommon.BackColor1 = lightestColour; // Or 230, 230, 230 + + palette.Ribbon.RibbonGroupNormalTitle.StateCommon.BackColor2 = middleColour; + + palette.Ribbon.RibbonGroupNormalTitle.StateCommon.TextColor = customTextColourFive; + + palette.Ribbon.RibbonGroupNormalTitle.StateTracking.BackColor1 = lightestColour; + + palette.Ribbon.RibbonGroupNormalTitle.StateTracking.BackColor2 = middleColour; + + palette.Ribbon.RibbonQATFullbar.BackColor1 = middleColour; + + palette.Ribbon.RibbonQATFullbar.BackColor2 = middleColour; + + palette.Ribbon.RibbonQATFullbar.BackColor3 = middleColour; + + palette.Ribbon.RibbonQATMinibar.StateCommon.BackColor1 = middleColour; + + palette.Ribbon.RibbonQATMinibar.StateCommon.BackColor2 = middleColour; + + palette.Ribbon.RibbonQATMinibar.StateCommon.BackColor3 = middleColour; + + palette.Ribbon.RibbonQATMinibar.StateCommon.BackColor4 = middleColour; + + palette.Ribbon.RibbonQATOverflow.BackColor1 = middleColour; + + palette.Ribbon.RibbonQATOverflow.BackColor2 = middleColour; + + palette.Ribbon.RibbonTab.StateCheckedTracking.BackColor1 = middleColour; + + palette.Ribbon.RibbonTab.StateCheckedTracking.BackColor2 = lightColour; + + palette.Ribbon.RibbonTab.StateCheckedTracking.BackColor3 = darkColour; + + palette.Ribbon.RibbonTab.StateCheckedTracking.BackColor4 = middleColour; + + palette.Ribbon.RibbonTab.StateCommon.BackColor1 = middleColour; + + palette.Ribbon.RibbonTab.StateCommon.BackColor3 = middleColour; + + palette.Ribbon.RibbonTab.StateCommon.BackColor4 = lightColour; + + palette.Ribbon.RibbonTab.StateCommon.BackColor5 = lightColour; + + palette.Ribbon.RibbonTab.StateCommon.TextColor = normalTextColourPreview; + + palette.Ribbon.RibbonTab.StateContextCheckedTracking.BackColor2 = middleColour; + + palette.Ribbon.RibbonTab.StateTracking.BackColor2 = middleColour; + + palette.Ribbon.RibbonTab.StateCommon.TextColor = ribbonTabTextColour; + #endregion + + #region Separator Styles + palette.SeparatorStyles.SeparatorCommon.StateCommon.Back.Color1 = baseColour; + + palette.SeparatorStyles.SeparatorCommon.StateCommon.Back.Color2 = baseColour; + + palette.SeparatorStyles.SeparatorCommon.StateCommon.Border.Color1 = baseColour; + + palette.SeparatorStyles.SeparatorCommon.StateCommon.Border.Color1 = baseColour; + + palette.SeparatorStyles.SeparatorCommon.StateCommon.Border.DrawBorders = PaletteDrawBorders.All; + #endregion + + #region Tool Menu Status + palette.ToolMenuStatus.Button.ButtonPressedBorder = baseColour; + + palette.ToolMenuStatus.Button.ButtonSelectedBorder = baseColour; + + palette.ToolMenuStatus.Button.OverflowButtonGradientBegin = darkColour; + + palette.ToolMenuStatus.Button.OverflowButtonGradientEnd = baseColour; + + palette.ToolMenuStatus.Button.OverflowButtonGradientMiddle = middleColour; + + palette.ToolMenuStatus.Grip.GripDark = baseColour; + + palette.ToolMenuStatus.Grip.GripLight = customColourFive; + + palette.ToolMenuStatus.Menu.ImageMarginGradientBegin = baseColour; + + palette.ToolMenuStatus.Menu.ImageMarginGradientEnd = darkColour; + + palette.ToolMenuStatus.Menu.ImageMarginGradientMiddle = middleColour; + + palette.ToolMenuStatus.Menu.ImageMarginRevealedGradientBegin = baseColour; + + palette.ToolMenuStatus.Menu.ImageMarginRevealedGradientEnd = darkColour; + + palette.ToolMenuStatus.Menu.ImageMarginRevealedGradientMiddle = middleColour; + + palette.ToolMenuStatus.Menu.MenuBorder = baseColour; + + palette.ToolMenuStatus.Menu.MenuItemBorder = darkColour; + + palette.ToolMenuStatus.Menu.MenuItemPressedGradientBegin = baseColour; + + palette.ToolMenuStatus.Menu.MenuItemPressedGradientEnd = darkColour; + + palette.ToolMenuStatus.Menu.MenuItemPressedGradientMiddle = middleColour; + + palette.ToolMenuStatus.Menu.MenuItemSelected = middleColour; + + palette.ToolMenuStatus.Menu.MenuItemSelectedGradientBegin = darkColour; + + palette.ToolMenuStatus.Menu.MenuItemSelectedGradientEnd = baseColour; + + palette.ToolMenuStatus.Menu.MenuItemText = menuTextColour; + + palette.ToolMenuStatus.MenuStrip.MenuStripGradientBegin = baseColour; + + palette.ToolMenuStatus.MenuStrip.MenuStripGradientEnd = darkColour; + + palette.ToolMenuStatus.MenuStrip.MenuStripText = normalTextColourPreview; + + palette.ToolMenuStatus.Rafting.RaftingContainerGradientBegin = middleColour; + + palette.ToolMenuStatus.Rafting.RaftingContainerGradientEnd = darkColour; + + palette.ToolMenuStatus.Separator.SeparatorDark = baseColour; + + palette.ToolMenuStatus.Separator.SeparatorLight = lightColour; + + palette.ToolMenuStatus.StatusStrip.StatusStripGradientBegin = baseColour; + + palette.ToolMenuStatus.StatusStrip.StatusStripGradientEnd = lightColour; + + palette.ToolMenuStatus.StatusStrip.StatusStripText = normalTextColourPreview; + + palette.ToolMenuStatus.ToolStrip.ToolStripBorder = darkColour; + + palette.ToolMenuStatus.ToolStrip.ToolStripContentPanelGradientBegin = lightColour; + + palette.ToolMenuStatus.ToolStrip.ToolStripContentPanelGradientEnd = darkColour; + + palette.ToolMenuStatus.ToolStrip.ToolStripDropDownBackground = middleColour; + + palette.ToolMenuStatus.ToolStrip.ToolStripGradientBegin = darkColour; + + palette.ToolMenuStatus.ToolStrip.ToolStripGradientEnd = lightColour; + + palette.ToolMenuStatus.ToolStrip.ToolStripGradientMiddle = middleColour; + + palette.ToolMenuStatus.ToolStrip.ToolStripPanelGradientBegin = lightColour; + + palette.ToolMenuStatus.ToolStrip.ToolStripPanelGradientEnd = darkColour; + + palette.ToolMenuStatus.ToolStrip.ToolStripText = normalTextColourPreview; + #endregion + } + + palette.Export(); + + statusState.Text = $"Palette exported to: {palette.GetCustomisedKryptonPaletteFilePath()}"; + } + catch (Exception exc) + { + ExceptionHandler.CaptureException(exc, icon: ExtendedKryptonMessageBoxIcon.Error, methodSignature: Helpers.GetCurrentMethod()); + } + } + + public static void ChangeTheme(KryptonComboBox themeChoice, KryptonCustomPaletteBase palette) + { + if (themeChoice.Text == "Professional System") + { + palette.BasePalette.BasePaletteType = BasePaletteType.Professional; + + SwitchPaletteType(BasePaletteType.Professional); + } + else if (themeChoice.Text == "Professional Office 2003") + { + palette.BasePalette.BasePaletteType = BasePaletteType.Professional; + + SwitchPaletteType(BasePaletteType.Professional); + } + else if (themeChoice.Text == "Office 2007 Blue") + { + palette.BasePalette.BasePaletteType = BasePaletteType.Office2007; + + SwitchPaletteType(BasePaletteType.Office2007); + } + else if (themeChoice.Text == "Office 2007 Black") + { + palette.BasePalette.BasePaletteType = BasePaletteType.Office2007; + + SwitchPaletteType(BasePaletteType.Office2007); + } + else if (themeChoice.Text == "Office 2007 Silver") + { + palette.BasePalette.BasePaletteType = BasePaletteType.Office2007; + + SwitchPaletteType(BasePaletteType.Office2007); + } + else if (themeChoice.Text == "Office 2010 Blue") + { + palette.BasePalette.BasePaletteType = BasePaletteType.Office2010; + + SwitchPaletteType(BasePaletteType.Office2010); + } + else if (themeChoice.Text == "Office 2010 Black") + { + palette.BasePalette.BasePaletteType = BasePaletteType.Office2010; + + SwitchPaletteType(BasePaletteType.Office2010); + } + else if (themeChoice.Text == "Office 2010 Silver") + { + palette.BasePalette.BasePaletteType = BasePaletteType.Office2010; + + SwitchPaletteType(BasePaletteType.Office2010); + } + else if (themeChoice.Text == "Office 2013 White") + { + palette.BasePalette.BasePaletteType = BasePaletteType.Office2013; + + SwitchPaletteType(BasePaletteType.Office2013); + } + else if (themeChoice.Text == "Sparkle Blue") + { + palette.BasePalette.BasePaletteType = BasePaletteType.Sparkle; + + SwitchPaletteType(BasePaletteType.Sparkle); + } + else if (themeChoice.Text == "Sparkle Orange") + { + palette.BasePalette.BasePaletteType = BasePaletteType.Sparkle; + + SwitchPaletteType(BasePaletteType.Sparkle); + } + else if (themeChoice.Text == "Sparkle Purple") + { + palette.BasePalette.BasePaletteType = BasePaletteType.Sparkle; + + SwitchPaletteType(BasePaletteType.Sparkle); + } + else if (themeChoice.Text == "Custom") + { + palette.BasePalette.BasePaletteType = BasePaletteType.Custom; + + SwitchPaletteType(BasePaletteType.Custom); + } + } + + private static void SwitchPaletteType(BasePaletteType paletteType) + { + PaletteCompositionEngine pce = new(); + + pce.SetPaletteType(paletteType); + } + + public static void PropagateThemes(KryptonComboBox themeList, bool sort = true) + { + ArrayList themeCollection = new(15); + + themeCollection.Add("Professional System"); + + themeCollection.Add("Professional Office 2003"); + + themeCollection.Add("Office 2007 Blue"); + + themeCollection.Add("Office 2007 Black"); + + themeCollection.Add("Office 2007 Silver"); + + themeCollection.Add("Office 2010 Blue"); + + themeCollection.Add("Office 2010 Black"); + + themeCollection.Add("Office 2010 Silver"); + + themeCollection.Add("Office 2013"); + + themeCollection.Add("Office 2013 White"); + + themeCollection.Add("Sparkle Blue"); + + themeCollection.Add("Sparkle Orange"); + + themeCollection.Add("Sparkle Purple"); + + themeCollection.Add("Custom"); + + if (sort) + { + themeCollection.Sort(); + } + + foreach (string item in themeCollection) + { + themeList.Items.Add(item); + } + } + + public static void PropagateThemes(KryptonRibbonGroupComboBox themeList, bool sort = true) + { + ArrayList themeCollection = new(15); + + themeCollection.Add("Professional System"); + + themeCollection.Add("Professional Office 2003"); + + themeCollection.Add("Office 2007 Blue"); + + themeCollection.Add("Office 2007 Black"); + + themeCollection.Add("Office 2007 Silver"); + + themeCollection.Add("Office 2010 Blue"); + + themeCollection.Add("Office 2010 Black"); + + themeCollection.Add("Office 2010 Silver"); + + themeCollection.Add("Office 2013"); + + themeCollection.Add("Office 2013 White"); + + themeCollection.Add("Sparkle Blue"); + + themeCollection.Add("Sparkle Orange"); + + themeCollection.Add("Sparkle Purple"); + + themeCollection.Add("Custom"); + + if (sort) + { + themeCollection.Sort(); + } + + foreach (string item in themeCollection) + { + themeList.Items.Add(item); + } + } + #endregion + + #region Setters and Getters + + /// Sets the type of the palette. + /// Type of the palette. + public void SetPaletteType(BasePaletteType paletteType) => PaletteType = paletteType; + + public BasePaletteType GetPaletteType() => PaletteType; + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Security/HashingAlgorithms.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Security/HashingAlgorithms.cs index 4378e4d07..520a54419 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Security/HashingAlgorithms.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Security/HashingAlgorithms.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Security/RandomPassword.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Security/RandomPassword.cs index 7fecd4d9b..99ff143f5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Security/RandomPassword.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Security/RandomPassword.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Security/SecurityAssistant.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Security/SecurityAssistant.cs index 983da7e25..2f042742d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Security/SecurityAssistant.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Security/SecurityAssistant.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Security/SecurityMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Security/SecurityMethods.cs index 4f3c345f1..6b8a7fc98 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Security/SecurityMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Security/SecurityMethods.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Settings/AllMergedPaletteColourSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Settings/AllMergedPaletteColourSettingsManager.cs index 7418d1d5d..a13defc5c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Settings/AllMergedPaletteColourSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Settings/AllMergedPaletteColourSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Theming/PaletteColourManagementEngine.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Theming/PaletteColourManagementEngine.cs index cd69b496e..377992ddb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Theming/PaletteColourManagementEngine.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Theming/PaletteColourManagementEngine.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -85,7 +85,7 @@ public static void SetBasicPaletteColours(CircularPictureBox baseColour, Circula } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); basicPaletteColourManager.ResetToDefaults(); } @@ -130,7 +130,7 @@ public static void SetBasicPaletteColours(PictureBox baseColour, PictureBox dark } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); basicPaletteColourManager.ResetToDefaults(); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Theming/ThemeManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Theming/ThemeManager.cs index 1c156f22d..efc3e8707 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Theming/ThemeManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Theming/ThemeManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/UAC/UACUtilityMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/UAC/UACUtilityMethods.cs index eeb934c6f..a14d0f283 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/UAC/UACUtilityMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/UAC/UACUtilityMethods.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -57,7 +57,7 @@ public static void ElevateProcessWithAdministrativeRights(string processName) } catch (Win32Exception wexc) { - ExceptionCapture.CaptureException(wexc); + DebugUtilities.NotImplemented(wexc.ToString()); } return; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Utilities/Utility.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Utilities/Utility.cs index 724f78762..2244108ef 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Utilities/Utility.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Utilities/Utility.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Utilities/WIN32.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Utilities/WIN32.cs index eb0272655..262f77ca5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Utilities/WIN32.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Classes/Utilities/WIN32.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -426,14 +426,14 @@ public void CallDefaultWndProc(ref Message m) #region HiWord Message Cracker public int HiWord(int Number) { - return ((Number >> 16) & 0xffff); + return (Number >> 16) & 0xffff; } #endregion #region LoWord Message Cracker public int LoWord(int Number) { - return (Number & 0xffff); + return Number & 0xffff; } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls Visuals/CoreKryptonMessageBoxExtendedForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls Visuals/CoreKryptonMessageBoxExtendedForm.cs index 04692640e..04f2fc1f3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls Visuals/CoreKryptonMessageBoxExtendedForm.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls Visuals/CoreKryptonMessageBoxExtendedForm.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -43,7 +43,7 @@ internal partial class CoreKryptonMessageBoxExtendedForm : KryptonForm /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { - if (disposing && (components != null)) + if (disposing && components != null) { components.Dispose(); } @@ -149,7 +149,6 @@ private void InitializeComponent() // this._button4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this._button4.AutoSize = true; - this._button4.CornerRoundingRadius = -1F; this._button4.Enabled = false; this._button4.IgnoreAltF4 = false; this._button4.Location = new System.Drawing.Point(188, 0); @@ -165,7 +164,6 @@ private void InitializeComponent() // this._button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this._button3.AutoSize = true; - this._button3.CornerRoundingRadius = -1F; this._button3.Enabled = false; this._button3.IgnoreAltF4 = false; this._button3.Location = new System.Drawing.Point(151, 0); @@ -181,7 +179,6 @@ private void InitializeComponent() // this._button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this._button1.AutoSize = true; - this._button1.CornerRoundingRadius = -1F; this._button1.Enabled = false; this._button1.IgnoreAltF4 = false; this._button1.Location = new System.Drawing.Point(75, 0); @@ -197,7 +194,6 @@ private void InitializeComponent() // this._button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this._button2.AutoSize = true; - this._button2.CornerRoundingRadius = -1F; this._button2.Enabled = false; this._button2.IgnoreAltF4 = false; this._button2.Location = new System.Drawing.Point(113, 0); @@ -356,10 +352,10 @@ internal CoreKryptonMessageBoxExtendedForm(IWin32Window showOwner, string text, _buttonTwoCustomDialogResult = buttonTwoCustomDialogResult ?? DialogResult.No; _buttonThreeCustomDialogResult = buttonThreeCustomDialogResult ?? DialogResult.Cancel; _buttonFourDialogResult = buttonFourDialogResult ?? DialogResult.Retry; - _buttonOneCustomText = buttonOneCustomText ?? KryptonLanguageManager.GeneralToolkitStrings.Yes; - _buttonTwoCustomText = buttonTwoCustomText ?? KryptonLanguageManager.GeneralToolkitStrings.No; - _buttonThreeCustomText = buttonThreeCustomText ?? KryptonLanguageManager.GeneralToolkitStrings.Cancel; - _buttonFourCustomText = buttonFourCustomText ?? KryptonLanguageManager.GeneralToolkitStrings.Retry; + _buttonOneCustomText = buttonOneCustomText ?? KryptonManager.Strings.GeneralStrings.Yes; + _buttonTwoCustomText = buttonTwoCustomText ?? KryptonManager.Strings.GeneralStrings.No; + _buttonThreeCustomText = buttonThreeCustomText ?? KryptonManager.Strings.GeneralStrings.Cancel; + _buttonFourCustomText = buttonFourCustomText ?? KryptonManager.Strings.GeneralStrings.Retry; // Create the form contents InitializeComponent(); @@ -497,7 +493,7 @@ private void UpdateIcon() break; } - _messageIcon.Visible = (_kryptonMessageBoxIcon != ExtendedKryptonMessageBoxIcon.None); + _messageIcon.Visible = _kryptonMessageBoxIcon != ExtendedKryptonMessageBoxIcon.None; } @@ -506,15 +502,15 @@ private void UpdateButtons() switch (_buttons) { case ExtendedMessageBoxButtons.OK: - _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + _button1.Text = KryptonManager.Strings.GeneralStrings.OK; _button1.DialogResult = DialogResult.OK; _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; _button1.Visible = true; _button1.Enabled = true; break; case ExtendedMessageBoxButtons.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.StateCommon.Content.ShortText.Font = _messageBoxTypeface; @@ -525,8 +521,8 @@ private void UpdateButtons() _button2.Enabled = true; break; case ExtendedMessageBoxButtons.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.StateCommon.Content.ShortText.Font = _messageBoxTypeface; @@ -538,9 +534,9 @@ private void UpdateButtons() ControlBox = false; break; case ExtendedMessageBoxButtons.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; @@ -555,8 +551,8 @@ private void UpdateButtons() _button3.Enabled = true; break; case ExtendedMessageBoxButtons.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.StateCommon.Content.ShortText.Font = _messageBoxTypeface; @@ -567,9 +563,9 @@ private void UpdateButtons() _button2.Enabled = true; break; case ExtendedMessageBoxButtons.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; @@ -652,7 +648,7 @@ private void UpdateHelp() { helpButton.Visible = true; helpButton.Enabled = true; - helpButton.Text = KryptonLanguageManager.GeneralToolkitStrings.Help; + helpButton.Text = KryptonManager.Strings.GeneralStrings.Help; helpButton.KeyPress += (_, _) => LaunchHelp(); helpButton.Click += (_, _) => LaunchHelp(); } @@ -808,23 +804,23 @@ private Size UpdateButtonsSizing() _button1.Size = maxButtonSize; // Size the panel for the buttons - _panelButtons.Size = new((maxButtonSize.Width * numButtons) + (GAP * (numButtons + 1)), maxButtonSize.Height + (GAP * 2)); + _panelButtons.Size = new(maxButtonSize.Width * numButtons + GAP * (numButtons + 1), maxButtonSize.Height + GAP * 2); // Button area is the number of buttons with gaps between them and 10 pixels around all edges - return new((maxButtonSize.Width * numButtons) + (GAP * (numButtons + 1)), maxButtonSize.Height + (GAP * 2)); + return new(maxButtonSize.Width * numButtons + GAP * (numButtons + 1), maxButtonSize.Height + GAP * 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) + && e.KeyCode == Keys.Escape ) { Close(); } else if (!e.Control - || (e.KeyCode != Keys.C) + || e.KeyCode != Keys.C ) { return; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ColourEditorManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ColourEditorManager.cs index f5324c624..cf6c9c35a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ColourEditorManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ColourEditorManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ColourGridControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ColourGridControl.cs index 076613dac..82fbd0235 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ColourGridControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ColourGridControl.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -1143,7 +1143,7 @@ protected override bool IsInputKey(Keys keyData) { bool result; - if (keyData == Keys.Left || keyData == Keys.Up || keyData == Keys.Down || keyData == Keys.Right || keyData == Keys.Enter || keyData == Keys.Home || keyData == Keys.End) + if (keyData is Keys.Left or Keys.Up or Keys.Down or Keys.Right or Keys.Enter or Keys.Home or Keys.End) { result = true; } @@ -1297,7 +1297,7 @@ private void SetScaledCellSize() _scaledCellSize = _cellSize; } - Debug.WriteLine(_scaledCellSize); + DebugUtilities.WriteLine(_scaledCellSize); } /// @@ -1605,7 +1605,7 @@ protected override void OnPaint(PaintEventArgs e) colorCount = Colours.Count; - Debug.Print(e.ClipRectangle.Size == ClientSize ? "Performing full paint!" : "Performing partial paint!"); + System.Diagnostics.Debug.Print(e.ClipRectangle.Size == ClientSize ? "Performing full paint!" : "Performing partial paint!"); OnPaintBackground(e); // HACK: Easiest way of supporting things like BackgroundImage, BackgroundImageLayout etc as the PaintBackground event is no longer being called @@ -1922,7 +1922,7 @@ protected virtual void RefreshColours() { if (AllowPainting) { - Debug.Print("Calculating colours..."); + System.Diagnostics.Debug.Print("Calculating colours..."); CalculateGridSize(); if (AutoFit) @@ -2007,7 +2007,7 @@ private void ColoursCollectionItemReplacedHandler(object sender, ColourCollectio if (index >= 0 && index < collection.Count && collection[index] != Colour) { - Debug.Print("Replacing index {0} with {1}", index, collection[index]); + System.Diagnostics.Debug.Print("Replacing index {0} with {1}", index, collection[index]); _previousColourIndex = index; _colorIndex = -1; @@ -2058,10 +2058,8 @@ private void RemoveEventHandlers(ColourCollection value) private void SetToolTip() { - if (ShowToolTips) + if (ShowToolTips is true and true) { - if (ShowToolTips) - { #if USENAMEHACK string name; @@ -2081,9 +2079,8 @@ private void SetToolTip() _toolTip.SetToolTip(this, name); #else - _toolTip.SetToolTip(this, HotIndex != InvalidIndex ? GetColour(HotIndex).Name : null); + _toolTip.SetToolTip(this, HotIndex != InvalidIndex ? GetColour(HotIndex).Name : null); #endif - } } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ColourSliderControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ColourSliderControl.cs index 56db9edc2..0f628edc5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ColourSliderControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ColourSliderControl.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ColourWheelControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ColourWheelControl.cs index 202c09d1e..560b33390 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ColourWheelControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ColourWheelControl.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -152,7 +152,7 @@ public virtual int ColourStep get => _colourStep; set { - if (value < 1 || value > 359) + if (value is < 1 or > 359) { throw new ArgumentOutOfRangeException(nameof(value), value, "Value must be between 1 and 359"); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/HueColourSliderControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/HueColourSliderControl.cs index dd927d32a..41e76f2a0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/HueColourSliderControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/HueColourSliderControl.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/LightnessColourSliderControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/LightnessColourSliderControl.cs index db74a43eb..ef469cf81 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/LightnessColourSliderControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/LightnessColourSliderControl.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/RGBAColourSliderControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/RGBAColourSliderControl.cs index e5d02495c..dc0fe9d72 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/RGBAColourSliderControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/RGBAColourSliderControl.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/SaturationColourSliderControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/SaturationColourSliderControl.cs index 1c22c7276..814db441d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/SaturationColourSliderControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/SaturationColourSliderControl.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ScreenColourPickerControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ScreenColourPickerControl.cs index 9038d66e9..0551606ae 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ScreenColourPickerControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Colour Controls/ScreenColourPickerControl.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Internal/CircularPictureBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Internal/CircularPictureBox.cs index 36a9e3034..2939f9376 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Internal/CircularPictureBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Internal/CircularPictureBox.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Internal/CoreInternalKryptonMessageBoxExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Internal/CoreInternalKryptonMessageBoxExtended.cs index b532fd046..962589368 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Internal/CoreInternalKryptonMessageBoxExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Internal/CoreInternalKryptonMessageBoxExtended.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -48,14 +48,14 @@ private void InitialiseComponent() this._button1 = new(); this._button2 = new(); this._doNotShowAgainOption = new(); - ((System.ComponentModel.ISupportInitialize)(this._panelMessage)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this._panelMessage).BeginInit(); this._panelMessage.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this._panelMessageText)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this._panelMessageText).BeginInit(); this._panelMessageText.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this._panelMessageIcon)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this._panelMessageIcon).BeginInit(); this._panelMessageIcon.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this._messageIcon)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this._panelButtons)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this._messageIcon).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this._panelButtons).BeginInit(); this._panelButtons.SuspendLayout(); this.SuspendLayout(); // @@ -86,7 +86,7 @@ private void InitialiseComponent() // this._messageText.AutoSize = false; this._messageText.Font = new("Segoe UI", 9F); - this._messageText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this._messageText.ForeColor = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this._messageText.LabelStyle = Krypton.Toolkit.LabelStyle.NormalPanel; this._messageText.Location = new(5, 18); this._messageText.Margin = new(0); @@ -143,7 +143,7 @@ private void InitialiseComponent() // // _button3 // - this._button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this._button3.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right); this._button3.AutoSize = true; this._button3.IgnoreAltF4 = false; this._button3.Location = new(106, 0); @@ -156,7 +156,7 @@ private void InitialiseComponent() // // _button1 // - this._button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this._button1.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right); this._button1.AutoSize = true; this._button1.IgnoreAltF4 = false; this._button1.Location = new(6, 0); @@ -169,7 +169,7 @@ private void InitialiseComponent() // // _button2 // - this._button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this._button2.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right); this._button2.AutoSize = true; this._button2.IgnoreAltF4 = false; this._button2.Location = new(56, 0); @@ -206,15 +206,15 @@ private void InitialiseComponent() this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.TopMost = true; - ((System.ComponentModel.ISupportInitialize)(this._panelMessage)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this._panelMessage).EndInit(); this._panelMessage.ResumeLayout(false); this._panelMessage.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this._panelMessageText)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this._panelMessageText).EndInit(); this._panelMessageText.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this._panelMessageIcon)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this._panelMessageIcon).EndInit(); this._panelMessageIcon.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this._messageIcon)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this._panelButtons)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this._messageIcon).EndInit(); + ((System.ComponentModel.ISupportInitialize)this._panelButtons).EndInit(); this._panelButtons.ResumeLayout(false); this._panelButtons.PerformLayout(); this.ResumeLayout(false); @@ -447,10 +447,10 @@ protected override void WndProc(ref Message m) if (IgnoreAltF4) { // Extract the keys being pressed - Keys keys = ((Keys)((int)m.WParam.ToInt64())); + Keys keys = (Keys)(int)m.WParam.ToInt64(); // If the user standard combination ALT + F4 - if ((keys == Keys.F4) && ((ModifierKeys & Keys.Alt) == Keys.Alt)) + if (keys == Keys.F4 && (ModifierKeys & Keys.Alt) == Keys.Alt) { // Eat the message, so standard window proc does not close the window return; @@ -960,26 +960,26 @@ private static DialogResult InternalShow(IWin32Window owner, string button1Text = null, string button2Text = null, string button3Text = null) { // 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)) + 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)) + 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 ((helpInformation != null) && ((options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) != 0)) + if (helpInformation != null && (options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) != 0) { throw new ArgumentException(@"Cannot show message box from a service with help specified", nameof(options)); } // If help information provided or we are not a service/default desktop application then grab an owner for showing the message box IWin32Window showOwner = null; - if ((helpInformation != null) || ((options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) == 0)) + if (helpInformation != 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 ?? FromHandle(PlatformInvoke.GetActiveWindow()); @@ -996,7 +996,7 @@ private static DialogResult InternalShow(IWin32Window owner, private void UpdateText() { - Text = (string.IsNullOrEmpty(_caption) ? string.Empty : _caption.Split(Environment.NewLine.ToCharArray())[0]); + Text = string.IsNullOrEmpty(_caption) ? string.Empty : _caption.Split(Environment.NewLine.ToCharArray())[0]; _messageText.StateCommon.Font = MessageBoxTypeface; _messageText.Text = _text; } @@ -1066,14 +1066,14 @@ private void UpdateButtons() switch (_buttons) { case ExtendedMessageBoxButtons.OK: - _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + _button1.Text = KryptonManager.Strings.GeneralStrings.OK; _button1.DialogResult = DialogResult.OK; _button1.StateCommon.Content.ShortText.Font = MessageBoxTypeface; _button2.Visible = _button3.Visible = false; break; case ExtendedMessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -1081,8 +1081,8 @@ private void UpdateButtons() _button3.Visible = false; break; case ExtendedMessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -1091,9 +1091,9 @@ private void UpdateButtons() ControlBox = false; break; case ExtendedMessageBoxButtons.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; @@ -1102,8 +1102,8 @@ private void UpdateButtons() _button3.StateCommon.Content.ShortText.Font = MessageBoxTypeface; break; case ExtendedMessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -1111,9 +1111,9 @@ private void UpdateButtons() _button3.Visible = false; break; case ExtendedMessageBoxButtons.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; @@ -1138,14 +1138,14 @@ private void UpdateButtons(bool timeOutTimerEnabled, int timeOut, DialogResult d switch (_buttons) { case ExtendedMessageBoxButtons.OK: - _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + _button1.Text = KryptonManager.Strings.GeneralStrings.OK; _button1.DialogResult = DialogResult.OK; _button1.StateCommon.Content.ShortText.Font = MessageBoxTypeface; _button2.Visible = _button3.Visible = false; break; case ExtendedMessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -1153,8 +1153,8 @@ private void UpdateButtons(bool timeOutTimerEnabled, int timeOut, DialogResult d _button3.Visible = false; break; case ExtendedMessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -1163,9 +1163,9 @@ private void UpdateButtons(bool timeOutTimerEnabled, int timeOut, DialogResult d ControlBox = false; break; case ExtendedMessageBoxButtons.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; @@ -1174,8 +1174,8 @@ private void UpdateButtons(bool timeOutTimerEnabled, int timeOut, DialogResult d _button3.StateCommon.Content.ShortText.Font = MessageBoxTypeface; break; case ExtendedMessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -1183,9 +1183,9 @@ private void UpdateButtons(bool timeOutTimerEnabled, int timeOut, DialogResult d _button3.Visible = false; break; case ExtendedMessageBoxButtons.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; @@ -1356,7 +1356,7 @@ private Size UpdateMessageSizing(IWin32Window showOwner) // 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.Width *= 2 / 3.0f; scaledMonitorSize.Height *= 0.95f; _messageText.UpdateFont(); SizeF messageSize = g.MeasureString(_text, _messageText.Font, scaledMonitorSize); @@ -1365,8 +1365,8 @@ private Size UpdateMessageSizing(IWin32Window showOwner) float messageXSize = Math.Max(messageSize.Width, captionSize.Width); // Work out DPI adjustment factor - float factorX = g.DpiX > 96 ? ((1.0f * g.DpiX) / 96) : 1.0f; - float factorY = g.DpiY > 96 ? ((1.0f * g.DpiY) / 96) : 1.0f; + float factorX = g.DpiX > 96 ? 1.0f * g.DpiX / 96 : 1.0f; + float factorY = g.DpiY > 96 ? 1.0f * g.DpiY / 96 : 1.0f; messageSize.Width = messageXSize * factorX; messageSize.Height = messageSize.Height * factorY; @@ -1475,23 +1475,23 @@ private Size UpdateButtonsSizing() _button1.Size = maxButtonSize; // Size the panel for the buttons - _panelButtons.Size = new((maxButtonSize.Width * numButtons) + (GAP * (numButtons + 1)), maxButtonSize.Height + (GAP * 2)); + _panelButtons.Size = new(maxButtonSize.Width * numButtons + GAP * (numButtons + 1), maxButtonSize.Height + GAP * 2); // Button area is the number of buttons with gaps between them and 10 pixels around all edges - return new((maxButtonSize.Width * numButtons) + (GAP * (numButtons + 1)), maxButtonSize.Height + (GAP * 2)); + return new(maxButtonSize.Width * numButtons + GAP * (numButtons + 1), maxButtonSize.Height + GAP * 2); } private void button_keyDown(object sender, KeyEventArgs e) { // Escape key kills the dialog if we allow it to be closed - if ((e.KeyCode == Keys.Escape) && ControlBox) + if (e.KeyCode == Keys.Escape && ControlBox) { Close(); } else { // Pressing Ctrl+C should copy message text into the clipboard - if ((e.Modifiers == Keys.Control) && (e.KeyCode == Keys.C)) + if (e.Modifiers == Keys.Control && e.KeyCode == Keys.C) { StringBuilder sb = new(); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Internal/KryptonUACElevatedButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Internal/KryptonUACElevatedButton.cs index eb13389d7..ea4d79bb0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Internal/KryptonUACElevatedButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Internal/KryptonUACElevatedButton.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -136,7 +136,7 @@ public KryptonUACElevatedButton() : base() { //CoreInternalKryptonMessageBoxExtended.Show($"Your platform is unsupported. Please contact the software vendor for details.\nFor reference, your system is running: { _globalMethods.GetOSFriendlyName() }.\nException message: { exc.Message }.", "Unsupported Software", MessageBoxButtons.OK, MessageBoxIcon.Error); - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); _isSystemAbleToLoadShield = false; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Utilities/ToolStripControlHostFixed.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Utilities/ToolStripControlHostFixed.cs index 515e8fd5b..2fd5eb393 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Utilities/ToolStripControlHostFixed.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Utilities/ToolStripControlHostFixed.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Enumerations/RGBAChannel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Enumerations/RGBAChannel.cs index 1a4ec27b7..135ad2a3e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Enumerations/RGBAChannel.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Enumerations/RGBAChannel.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Events/EditColourCancelEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Events/EditColourCancelEventArgs.cs index cd5741e79..9e08bb6a4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Events/EditColourCancelEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Events/EditColourCancelEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Events/ExecuteProcessAsAdministratorEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Events/ExecuteProcessAsAdministratorEventArgs.cs index 6e51f7f86..01713fa90 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Events/ExecuteProcessAsAdministratorEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Events/ExecuteProcessAsAdministratorEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -71,7 +71,7 @@ private void ElevateProcessWithAdministrativeRights(string processName) } catch (Win32Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } return; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Events/OwnerWindowChangedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Events/OwnerWindowChangedEventArgs.cs index 7c2cdad8a..95b78c6d5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Events/OwnerWindowChangedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Events/OwnerWindowChangedEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Globals/GlobalDeclarations.cs index a77a60959..728630a33 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Globals/GlobalDeclarations.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -52,6 +52,7 @@ global using Krypton.Toolkit.Suite.Extended.Common; global using Krypton.Toolkit.Suite.Extended.Core.Resources; global using Krypton.Toolkit.Suite.Extended.Core.Settings; +global using Krypton.Toolkit.Suite.Extended.Debug.Tools; global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; global using Krypton.Toolkit.Suite.Extended.Global.Utilities; global using Krypton.Toolkit.Suite.Extended.Settings; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/Colours/IColourPalette.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/Colours/IColourPalette.cs index b53b77f35..bef4672ba 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/Colours/IColourPalette.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/Colours/IColourPalette.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/General/IAbout.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/General/IAbout.cs index 3e261fc1f..c18915dfd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/General/IAbout.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/General/IAbout.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/General/IColourEditor.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/General/IColourEditor.cs index d2f8059df..de7729096 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/General/IColourEditor.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/General/IColourEditor.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/General/IPaletteSerialiser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/General/IPaletteSerialiser.cs index 0ee87b53c..259f4a768 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/General/IPaletteSerialiser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/General/IPaletteSerialiser.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/Theming/IThemeOptions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/Theming/IThemeOptions.cs index 0debb1100..0364e12a9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/Theming/IThemeOptions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Intefaces/Theming/IThemeOptions.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Krypton.Toolkit.Suite.Extended.Core 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Krypton.Toolkit.Suite.Extended.Core 2022.csproj index 4c0545e14..d589d51c9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Krypton.Toolkit.Suite.Extended.Core 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Krypton.Toolkit.Suite.Extended.Core 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - + - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -70,9 +58,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements core utilities that are fundamental to the extended toolkit. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements core utilities that are fundamental to the extended toolkit. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -86,13 +74,13 @@ - + - + - + - + @@ -102,13 +90,13 @@ - + - + - + - + @@ -118,13 +106,13 @@ - + - + - + - + @@ -134,13 +122,13 @@ - + - + - + - + @@ -183,13 +171,13 @@ - + - + - + - + @@ -205,7 +193,8 @@ - + + @@ -248,19 +237,19 @@ - 23.5.0-preview.1 + 24.4.0 - 23.5.0-preview.1 + 23.9.0-preview.3 - 23.5.0-preview.1 + 24.4.0 diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Krypton.Toolkit.Suite.Extended.Core.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Krypton.Toolkit.Suite.Extended.Core.licenseheader index c890e86c0..a0e5e0a62 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Krypton.Toolkit.Suite.Extended.Core.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Krypton.Toolkit.Suite.Extended.Core.licenseheader @@ -4,7 +4,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Resources/ImageResources.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Resources/ImageResources.Designer.cs index 917b8e11b..cdc121900 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Resources/ImageResources.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Resources/ImageResources.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Resources/MiscellaneousResources.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Resources/MiscellaneousResources.Designer.cs index b146e80b5..3e24e018f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Resources/MiscellaneousResources.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Resources/MiscellaneousResources.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/STRUCTS/HSLColour.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/STRUCTS/HSLColour.cs index 9f884007c..c17a94509 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/STRUCTS/HSLColour.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/STRUCTS/HSLColour.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Settings/CoreSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Settings/CoreSettings.Designer.cs index 0524bc8c8..9212f3488 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Settings/CoreSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Settings/CoreSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Settings/PaletteColourSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Settings/PaletteColourSettings.Designer.cs index 1e047441f..8d6f9d1d2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Settings/PaletteColourSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Settings/PaletteColourSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/ColourConverter.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/ColourConverter.Designer.cs index ad7e84976..b5691bd22 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/ColourConverter.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/ColourConverter.Designer.cs @@ -86,7 +86,6 @@ private void InitializeComponent() // // kbtnConvertToRGB // - this.kbtnConvertToRGB.CornerRoundingRadius = -1F; this.kbtnConvertToRGB.Location = new System.Drawing.Point(236, 90); this.kbtnConvertToRGB.Name = "kbtnConvertToRGB"; this.kbtnConvertToRGB.Size = new System.Drawing.Size(154, 25); @@ -96,7 +95,6 @@ private void InitializeComponent() // // kbtnConvertToHexadecimal // - this.kbtnConvertToHexadecimal.CornerRoundingRadius = -1F; this.kbtnConvertToHexadecimal.Location = new System.Drawing.Point(236, 48); this.kbtnConvertToHexadecimal.Name = "kbtnConvertToHexadecimal"; this.kbtnConvertToHexadecimal.Size = new System.Drawing.Size(154, 25); @@ -211,7 +209,6 @@ private void InitializeComponent() // kbtnUseColour // this.kbtnUseColour.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnUseColour.CornerRoundingRadius = -1F; this.kbtnUseColour.Location = new System.Drawing.Point(405, 13); this.kbtnUseColour.Name = "kbtnUseColour"; this.kbtnUseColour.Size = new System.Drawing.Size(90, 25); @@ -221,7 +218,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(501, 13); this.kbtnCancel.Name = "kbtnCancel"; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/ColourConverter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/ColourConverter.cs index b1bea9129..f33f6f86b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/ColourConverter.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/ColourConverter.cs @@ -25,7 +25,7 @@ private void kbtnConvertToRGB_Click(object sender, EventArgs e) } catch (Exception exception) { - ExceptionCapture.CaptureException(exception); + DebugUtilities.NotImplemented(exception.ToString()); } } @@ -38,7 +38,7 @@ private void kbtnConvertToHexadecimal_Click(object sender, EventArgs e) } catch (Exception exception) { - ExceptionCapture.CaptureException(exception); + DebugUtilities.NotImplemented(exception.ToString()); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/ColourMixer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/ColourMixer.cs index a9dbe456e..fa02daa3d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/ColourMixer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/ColourMixer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -115,7 +115,6 @@ private void InitializeComponent() // // kbtnConvertToRGB // - this.kbtnConvertToRGB.CornerRoundingRadius = -1F; this.kbtnConvertToRGB.Enabled = false; this.kbtnConvertToRGB.Location = new System.Drawing.Point(254, 227); this.kbtnConvertToRGB.Name = "kbtnConvertToRGB"; @@ -147,7 +146,6 @@ private void InitializeComponent() // // kbtnGenerateBlueValue // - this.kbtnGenerateBlueValue.CornerRoundingRadius = -1F; this.kbtnGenerateBlueValue.Location = new System.Drawing.Point(1012, 150); this.kbtnGenerateBlueValue.Name = "kbtnGenerateBlueValue"; this.kbtnGenerateBlueValue.Size = new System.Drawing.Size(101, 25); @@ -157,7 +155,6 @@ private void InitializeComponent() // // kbtnGenerateGreenValue // - this.kbtnGenerateGreenValue.CornerRoundingRadius = -1F; this.kbtnGenerateGreenValue.Location = new System.Drawing.Point(1012, 104); this.kbtnGenerateGreenValue.Name = "kbtnGenerateGreenValue"; this.kbtnGenerateGreenValue.Size = new System.Drawing.Size(101, 25); @@ -167,7 +164,6 @@ private void InitializeComponent() // // kbtnGenerateRedValue // - this.kbtnGenerateRedValue.CornerRoundingRadius = -1F; this.kbtnGenerateRedValue.Location = new System.Drawing.Point(1012, 58); this.kbtnGenerateRedValue.Name = "kbtnGenerateRedValue"; this.kbtnGenerateRedValue.Size = new System.Drawing.Size(101, 25); @@ -349,7 +345,6 @@ private void InitializeComponent() // // kbtnGenerateColour // - this.kbtnGenerateColour.CornerRoundingRadius = -1F; this.kbtnGenerateColour.Location = new System.Drawing.Point(436, 8); this.kbtnGenerateColour.Name = "kbtnGenerateColour"; this.kbtnGenerateColour.Size = new System.Drawing.Size(162, 25); @@ -360,7 +355,6 @@ private void InitializeComponent() // // kbtnGenerate // - this.kbtnGenerate.CornerRoundingRadius = -1F; this.kbtnGenerate.Location = new System.Drawing.Point(149, 8); this.kbtnGenerate.Name = "kbtnGenerate"; this.kbtnGenerate.Size = new System.Drawing.Size(126, 25); @@ -370,7 +364,6 @@ private void InitializeComponent() // // kbtnUtiliseAsBaseColour // - this.kbtnUtiliseAsBaseColour.CornerRoundingRadius = -1F; this.kbtnUtiliseAsBaseColour.Location = new System.Drawing.Point(13, 8); this.kbtnUtiliseAsBaseColour.Name = "kbtnUtiliseAsBaseColour"; this.kbtnUtiliseAsBaseColour.Size = new System.Drawing.Size(130, 25); @@ -412,7 +405,6 @@ private void InitializeComponent() // // kbtnOptions // - this.kbtnOptions.CornerRoundingRadius = -1F; this.kbtnOptions.Location = new System.Drawing.Point(604, 8); this.kbtnOptions.Name = "kbtnOptions"; this.kbtnOptions.Size = new System.Drawing.Size(90, 25); @@ -433,7 +425,6 @@ private void InitializeComponent() // // kbtnDefineOtherColours // - this.kbtnDefineOtherColours.CornerRoundingRadius = -1F; this.kbtnDefineOtherColours.Location = new System.Drawing.Point(281, 8); this.kbtnDefineOtherColours.Name = "kbtnDefineOtherColours"; this.kbtnDefineOtherColours.Size = new System.Drawing.Size(149, 25); @@ -444,7 +435,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.Location = new System.Drawing.Point(1023, 8); this.kbtnOk.Name = "kbtnOk"; this.kbtnOk.Size = new System.Drawing.Size(90, 25); @@ -816,7 +806,7 @@ private string DeciamlToHexadeciaml(int number) while (true) { - rem = (number % 16); + rem = number % 16; result += hexvalues[rem].ToString(); @@ -825,11 +815,11 @@ private string DeciamlToHexadeciaml(int number) break; } - number = (number / 16); + number = number / 16; } - for (int i = (result.Length - 1); i >= 0; i--) + for (int i = result.Length - 1; i >= 0; i--) { final += result[i]; } @@ -966,7 +956,7 @@ private bool IsNumber(string number) for (int i = 0; i < number.Length; i++) { - if (!(Char.IsDigit(number[i]))) + if (!Char.IsDigit(number[i])) { return false; } @@ -984,7 +974,7 @@ private bool IsHexadecimal(string hexadecimal) for (int i = 0; i < hexadecimal.Length; i++) { - if (!((Char.IsDigit(hexadecimal[i])) || (hexadecimal[i] == 'A') || (hexadecimal[i] == 'B') || (hexadecimal[i] == 'C') || (hexadecimal[i] == 'D') || (hexadecimal[i] == 'E') || (hexadecimal[i] == 'F'))) + if (!(Char.IsDigit(hexadecimal[i]) || hexadecimal[i] == 'A' || hexadecimal[i] == 'B' || hexadecimal[i] == 'C' || hexadecimal[i] == 'D' || hexadecimal[i] == 'E' || hexadecimal[i] == 'F')) { return false; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/ContrastColourGenerator.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/ContrastColourGenerator.cs index b15ba0d04..f8602b757 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/ContrastColourGenerator.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/ContrastColourGenerator.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -124,7 +124,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.Location = new System.Drawing.Point(777, 15); this.kbtnOk.Name = "kbtnOk"; this.kbtnOk.Size = new System.Drawing.Size(90, 25); @@ -172,7 +171,6 @@ private void InitializeComponent() // // kbtnUtiliseContrastColour // - this.kbtnUtiliseContrastColour.CornerRoundingRadius = -1F; this.kbtnUtiliseContrastColour.Location = new System.Drawing.Point(580, 516); this.kbtnUtiliseContrastColour.Name = "kbtnUtiliseContrastColour"; this.kbtnUtiliseContrastColour.Size = new System.Drawing.Size(203, 25); @@ -182,7 +180,6 @@ private void InitializeComponent() // // kbtnUtiliseBaseColour // - this.kbtnUtiliseBaseColour.CornerRoundingRadius = -1F; this.kbtnUtiliseBaseColour.Location = new System.Drawing.Point(57, 516); this.kbtnUtiliseBaseColour.Name = "kbtnUtiliseBaseColour"; this.kbtnUtiliseBaseColour.Size = new System.Drawing.Size(227, 25); @@ -193,7 +190,6 @@ private void InitializeComponent() // // kryptonButton1 // - this.kryptonButton1.CornerRoundingRadius = -1F; this.kryptonButton1.Location = new System.Drawing.Point(713, 470); this.kryptonButton1.Name = "kryptonButton1"; this.kryptonButton1.Size = new System.Drawing.Size(117, 25); @@ -202,7 +198,6 @@ private void InitializeComponent() // // kryptonButton3 // - this.kryptonButton3.CornerRoundingRadius = -1F; this.kryptonButton3.Location = new System.Drawing.Point(713, 437); this.kryptonButton3.Name = "kryptonButton3"; this.kryptonButton3.Size = new System.Drawing.Size(117, 25); @@ -211,7 +206,6 @@ private void InitializeComponent() // // kryptonButton4 // - this.kryptonButton4.CornerRoundingRadius = -1F; this.kryptonButton4.Location = new System.Drawing.Point(713, 393); this.kryptonButton4.Name = "kryptonButton4"; this.kryptonButton4.Size = new System.Drawing.Size(117, 25); @@ -220,7 +214,6 @@ private void InitializeComponent() // // kbtnGenerateBaseAlphaValue // - this.kbtnGenerateBaseAlphaValue.CornerRoundingRadius = -1F; this.kbtnGenerateBaseAlphaValue.Location = new System.Drawing.Point(222, 348); this.kbtnGenerateBaseAlphaValue.Name = "kbtnGenerateBaseAlphaValue"; this.kbtnGenerateBaseAlphaValue.Size = new System.Drawing.Size(135, 25); @@ -230,7 +223,6 @@ private void InitializeComponent() // // kbtnInvertColours // - this.kbtnInvertColours.CornerRoundingRadius = -1F; this.kbtnInvertColours.Location = new System.Drawing.Point(430, 173); this.kbtnInvertColours.Name = "kbtnInvertColours"; this.kbtnInvertColours.Size = new System.Drawing.Size(90, 25); @@ -241,7 +233,6 @@ private void InitializeComponent() // // kbtnGenerateComplementaryColour // - this.kbtnGenerateComplementaryColour.CornerRoundingRadius = -1F; this.kbtnGenerateComplementaryColour.Location = new System.Drawing.Point(430, 109); this.kbtnGenerateComplementaryColour.Name = "kbtnGenerateComplementaryColour"; this.kbtnGenerateComplementaryColour.Size = new System.Drawing.Size(90, 25); @@ -252,7 +243,6 @@ private void InitializeComponent() // // kbtnGenerateBlueValue // - this.kbtnGenerateBlueValue.CornerRoundingRadius = -1F; this.kbtnGenerateBlueValue.Location = new System.Drawing.Point(222, 470); this.kbtnGenerateBlueValue.Name = "kbtnGenerateBlueValue"; this.kbtnGenerateBlueValue.Size = new System.Drawing.Size(135, 25); @@ -262,7 +252,6 @@ private void InitializeComponent() // // kbtnGenerateGreenValue // - this.kbtnGenerateGreenValue.CornerRoundingRadius = -1F; this.kbtnGenerateGreenValue.Location = new System.Drawing.Point(222, 437); this.kbtnGenerateGreenValue.Name = "kbtnGenerateGreenValue"; this.kbtnGenerateGreenValue.Size = new System.Drawing.Size(135, 25); @@ -272,7 +261,6 @@ private void InitializeComponent() // // kbtnGenerateRedValue // - this.kbtnGenerateRedValue.CornerRoundingRadius = -1F; this.kbtnGenerateRedValue.Location = new System.Drawing.Point(222, 393); this.kbtnGenerateRedValue.Name = "kbtnGenerateRedValue"; this.kbtnGenerateRedValue.Size = new System.Drawing.Size(135, 25); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/CustomColours.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/CustomColours.cs index 40159b864..e5552795c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/CustomColours.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/CustomColours.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -77,13 +77,13 @@ private void InitializeComponent() this.knumRedChannelValue = new(); this.kryptonLabel2 = new(); this.kryptonBorderEdge1 = new(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbxColourPreview)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbNormalTextSystemColours)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbNormalTextColour)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.pbxColourPreview).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbNormalTextSystemColours).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbNormalTextColour).BeginInit(); this.SuspendLayout(); // // kryptonPanel1 @@ -101,7 +101,6 @@ private void InitializeComponent() // // kbtnUtiliseAsBaseColour // - this.kbtnUtiliseAsBaseColour.CornerRoundingRadius = -1F; this.kbtnUtiliseAsBaseColour.Location = new(155, 12); this.kbtnUtiliseAsBaseColour.Name = "kbtnUtiliseAsBaseColour"; this.kbtnUtiliseAsBaseColour.Size = new(142, 25); @@ -111,8 +110,7 @@ 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.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnOk.Location = new(921, 12); this.kbtnOk.Name = "kbtnOk"; this.kbtnOk.Size = new(90, 25); @@ -122,7 +120,6 @@ private void InitializeComponent() // // kbtnSaveColour // - this.kbtnSaveColour.CornerRoundingRadius = -1F; this.kbtnSaveColour.Enabled = false; this.kbtnSaveColour.Location = new(12, 12); this.kbtnSaveColour.Name = "kbtnSaveColour"; @@ -201,7 +198,6 @@ private void InitializeComponent() // // kcmbNormalTextSystemColours // - this.kcmbNormalTextSystemColours.CornerRoundingRadius = -1F; this.kcmbNormalTextSystemColours.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.kcmbNormalTextSystemColours.DropDownWidth = 173; this.kcmbNormalTextSystemColours.IntegralHeight = false; @@ -222,7 +218,6 @@ private void InitializeComponent() // // kcmbNormalTextColour // - this.kcmbNormalTextColour.CornerRoundingRadius = -1F; this.kcmbNormalTextColour.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.kcmbNormalTextColour.DropDownWidth = 173; this.kcmbNormalTextColour.IntegralHeight = false; @@ -243,7 +238,6 @@ private void InitializeComponent() // // kbtnGenerateNormalTextBlueValue // - this.kbtnGenerateNormalTextBlueValue.CornerRoundingRadius = -1F; this.kbtnGenerateNormalTextBlueValue.Location = new(780, 282); this.kbtnGenerateNormalTextBlueValue.Name = "kbtnGenerateNormalTextBlueValue"; this.kbtnGenerateNormalTextBlueValue.Size = new(90, 25); @@ -277,7 +271,6 @@ private void InitializeComponent() // // kbtnGenerateNormalTextGreenValue // - this.kbtnGenerateNormalTextGreenValue.CornerRoundingRadius = -1F; this.kbtnGenerateNormalTextGreenValue.Location = new(463, 282); this.kbtnGenerateNormalTextGreenValue.Name = "kbtnGenerateNormalTextGreenValue"; this.kbtnGenerateNormalTextGreenValue.Size = new(106, 25); @@ -310,7 +303,6 @@ private void InitializeComponent() // // kbtnGenerateNormalTextRedValue // - this.kbtnGenerateNormalTextRedValue.CornerRoundingRadius = -1F; this.kbtnGenerateNormalTextRedValue.Location = new(140, 282); this.kbtnGenerateNormalTextRedValue.Name = "kbtnGenerateNormalTextRedValue"; this.kbtnGenerateNormalTextRedValue.Size = new(90, 25); @@ -365,15 +357,15 @@ private void InitializeComponent() this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Define Custom Colours"; this.Load += new(this.CustomColours_Load); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); this.kryptonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbxColourPreview)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbNormalTextSystemColours)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbNormalTextColour)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.pbxColourPreview).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbNormalTextSystemColours).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbNormalTextColour).EndInit(); this.ResumeLayout(false); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/DefineIndividualColoursDialog.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/DefineIndividualColoursDialog.cs index 5470ccd76..f713de6e7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/DefineIndividualColoursDialog.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/DefineIndividualColoursDialog.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -103,12 +103,11 @@ private void InitializeComponent() // // kManager // - this.kManager.GlobalPalette = this.kPal; + this.kManager.GlobalCustomPalette = this.kPal; this.kManager.GlobalPaletteMode = Krypton.Toolkit.PaletteMode.Custom; // // kPal // - this.kPal.BaseFontSize = 9F; this.kPal.BasePaletteType = Krypton.Toolkit.BasePaletteType.Custom; this.kPal.ThemeName = null; // @@ -125,7 +124,6 @@ private void InitializeComponent() // // kbtnOk // - this.kbtnOk.CornerRoundingRadius = -1F; this.kbtnOk.Location = new System.Drawing.Point(652, 13); this.kbtnOk.Name = "kbtnOk"; this.kbtnOk.Size = new System.Drawing.Size(90, 25); @@ -206,7 +204,6 @@ private void InitializeComponent() // // kbtnGenerateAlpha // - this.kbtnGenerateAlpha.CornerRoundingRadius = -1F; this.kbtnGenerateAlpha.Location = new System.Drawing.Point(13, 14); this.kbtnGenerateAlpha.Name = "kbtnGenerateAlpha"; this.kbtnGenerateAlpha.Size = new System.Drawing.Size(124, 25); @@ -216,7 +213,6 @@ private void InitializeComponent() // // kbtnGenerateRedValue // - this.kbtnGenerateRedValue.CornerRoundingRadius = -1F; this.kbtnGenerateRedValue.Location = new System.Drawing.Point(13, 52); this.kbtnGenerateRedValue.Name = "kbtnGenerateRedValue"; this.kbtnGenerateRedValue.Size = new System.Drawing.Size(124, 25); @@ -226,7 +222,6 @@ private void InitializeComponent() // // kbtnGenerateGreenValue // - this.kbtnGenerateGreenValue.CornerRoundingRadius = -1F; this.kbtnGenerateGreenValue.Location = new System.Drawing.Point(13, 90); this.kbtnGenerateGreenValue.Name = "kbtnGenerateGreenValue"; this.kbtnGenerateGreenValue.Size = new System.Drawing.Size(124, 25); @@ -236,7 +231,6 @@ private void InitializeComponent() // // kbtnGenerateBlueValue // - this.kbtnGenerateBlueValue.CornerRoundingRadius = -1F; this.kbtnGenerateBlueValue.Location = new System.Drawing.Point(13, 128); this.kbtnGenerateBlueValue.Name = "kbtnGenerateBlueValue"; this.kbtnGenerateBlueValue.Size = new System.Drawing.Size(124, 25); @@ -252,7 +246,6 @@ private void InitializeComponent() "Middle Colour", "Light Colour", "Lightest Colour"}); - this.kcmbDefinedColour.CornerRoundingRadius = -1F; this.kcmbDefinedColour.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.kcmbDefinedColour.DropDownWidth = 173; this.kcmbDefinedColour.IntegralHeight = false; @@ -281,7 +274,6 @@ private void InitializeComponent() // // kbtnExportSelectedColour // - this.kbtnExportSelectedColour.CornerRoundingRadius = -1F; this.kbtnExportSelectedColour.Enabled = false; this.kbtnExportSelectedColour.Location = new System.Drawing.Point(584, 525); this.kbtnExportSelectedColour.Name = "kbtnExportSelectedColour"; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/HexadecimalToRGBConverter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/HexadecimalToRGBConverter.cs index 8f4779b41..187417b1c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/HexadecimalToRGBConverter.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/HexadecimalToRGBConverter.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -62,9 +62,9 @@ private void InitializeComponent() this.ktxtHexValue = new(); this.kryptonLabel5 = new(); this.kryptonBorderEdge1 = new(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); this.ctxColourList.SuspendLayout(); this.SuspendLayout(); @@ -85,9 +85,8 @@ private void InitializeComponent() // // kbtnLoadFromFile // - this.kbtnLoadFromFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.kbtnLoadFromFile.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnLoadFromFile.AutoSize = true; - this.kbtnLoadFromFile.CornerRoundingRadius = -1F; this.kbtnLoadFromFile.Location = new(108, 14); this.kbtnLoadFromFile.Name = "kbtnLoadFromFile"; this.kbtnLoadFromFile.Size = new(90, 25); @@ -97,9 +96,8 @@ private void InitializeComponent() // // kbtnExport // - this.kbtnExport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.kbtnExport.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); this.kbtnExport.AutoSize = true; - this.kbtnExport.CornerRoundingRadius = -1F; this.kbtnExport.Enabled = false; this.kbtnExport.Location = new(12, 14); this.kbtnExport.Name = "kbtnExport"; @@ -110,9 +108,8 @@ private void InitializeComponent() // // kbtnOk // - this.kbtnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.kbtnOk.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnOk.AutoSize = true; - this.kbtnOk.CornerRoundingRadius = -1F; this.kbtnOk.Location = new(618, 14); this.kbtnOk.Name = "kbtnOk"; this.kbtnOk.Size = new(90, 25); @@ -122,9 +119,8 @@ private void InitializeComponent() // // kbtnCancel // - this.kbtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.kbtnCancel.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnCancel.AutoSize = true; - this.kbtnCancel.CornerRoundingRadius = -1F; this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kbtnCancel.Location = new(714, 14); this.kbtnCancel.Name = "kbtnCancel"; @@ -147,7 +143,6 @@ private void InitializeComponent() // // kbtnConvertToRGB // - this.kbtnConvertToRGB.CornerRoundingRadius = -1F; this.kbtnConvertToRGB.Enabled = false; this.kbtnConvertToRGB.Location = new(277, 577); this.kbtnConvertToRGB.Name = "kbtnConvertToRGB"; @@ -223,10 +218,10 @@ private void InitializeComponent() this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Hexadecimal to RGB Converter"; this.Load += new(this.HexadecimalToRGBConverter_Load); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); this.kryptonPanel2.PerformLayout(); this.ctxColourList.ResumeLayout(false); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/InternalBasicPaletteCreator.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/InternalBasicPaletteCreator.cs index cb43e75b7..6b6f246df 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/InternalBasicPaletteCreator.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/InternalBasicPaletteCreator.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -118,15 +118,15 @@ private void InitializeComponent() this.kryptonBorderEdge1 = new(); this.kryptonTableLayoutPanel1 = new(); this.statusStrip1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.cpbxLightestColour)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.cpbxLightColour)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.cpbxMediumColour)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.cpbxDarkestColour)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.cpbxBaseColour)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cpbxLightestColour).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cpbxLightColour).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cpbxMediumColour).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cpbxDarkestColour).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cpbxBaseColour).BeginInit(); this.kryptonTableLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // @@ -166,7 +166,6 @@ private void InitializeComponent() // // kbtnDebugConsole // - this.kbtnDebugConsole.CornerRoundingRadius = -1F; this.kbtnDebugConsole.Location = new(432, 13); this.kbtnDebugConsole.Name = "kbtnDebugConsole"; this.kbtnDebugConsole.Size = new(96, 25); @@ -176,7 +175,6 @@ private void InitializeComponent() // // kbtnOptions // - this.kbtnOptions.CornerRoundingRadius = -1F; this.kbtnOptions.Location = new(335, 13); this.kbtnOptions.Name = "kbtnOptions"; this.kbtnOptions.Size = new(90, 25); @@ -185,7 +183,6 @@ private void InitializeComponent() // // kbtnImportColours // - this.kbtnImportColours.CornerRoundingRadius = -1F; this.kbtnImportColours.Location = new(224, 13); this.kbtnImportColours.Name = "kbtnImportColours"; this.kbtnImportColours.Size = new(104, 25); @@ -194,7 +191,6 @@ private void InitializeComponent() // // kbtnExportColours // - this.kbtnExportColours.CornerRoundingRadius = -1F; this.kbtnExportColours.Enabled = false; this.kbtnExportColours.Location = new(128, 13); this.kbtnExportColours.Name = "kbtnExportColours"; @@ -204,7 +200,6 @@ private void InitializeComponent() // // kbtnGenerateColours // - this.kbtnGenerateColours.CornerRoundingRadius = -1F; this.kbtnGenerateColours.Location = new(13, 13); this.kbtnGenerateColours.Name = "kbtnGenerateColours"; this.kbtnGenerateColours.Size = new(109, 25); @@ -213,8 +208,7 @@ private void InitializeComponent() // // kryptonButton1 // - this.kryptonButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kryptonButton1.CornerRoundingRadius = -1F; + this.kryptonButton1.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kryptonButton1.DialogResult = System.Windows.Forms.DialogResult.OK; this.kryptonButton1.Location = new(752, 13); this.kryptonButton1.Name = "kryptonButton1"; @@ -257,7 +251,7 @@ private void InitializeComponent() this.ktxtHexadecimalValue.MaxLength = 6; this.ktxtHexadecimalValue.Name = "ktxtHexadecimalValue"; this.ktxtHexadecimalValue.Size = new(100, 24); - this.ktxtHexadecimalValue.StateCommon.Content.Font = new("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ktxtHexadecimalValue.StateCommon.Content.Font = new("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.ktxtHexadecimalValue.TabIndex = 107; this.ktxtHexadecimalValue.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // @@ -272,7 +266,6 @@ private void InitializeComponent() // // kbtnGenerateRandomColour // - this.kbtnGenerateRandomColour.CornerRoundingRadius = -1F; this.kbtnGenerateRandomColour.Location = new(493, 537); this.kbtnGenerateRandomColour.Name = "kbtnGenerateRandomColour"; this.kbtnGenerateRandomColour.Size = new(177, 25); @@ -286,13 +279,12 @@ private void InitializeComponent() this.kcbtnChooseBaseColour.Name = "kcbtnChooseBaseColour"; this.kcbtnChooseBaseColour.Size = new(197, 25); this.kcbtnChooseBaseColour.TabIndex = 103; - this.kcbtnChooseBaseColour.Values.Image = ((System.Drawing.Image)(resources.GetObject("kcbtnChooseBaseColour.Values.Image"))); + this.kcbtnChooseBaseColour.Values.Image = (System.Drawing.Image)resources.GetObject("kcbtnChooseBaseColour.Values.Image"); this.kcbtnChooseBaseColour.Values.RoundedCorners = 8; this.kcbtnChooseBaseColour.Values.Text = "Ch&oose a Base Colour"; // // kbtnGenerateGreen // - this.kbtnGenerateGreen.CornerRoundingRadius = -1F; this.kbtnGenerateGreen.Location = new(589, 409); this.kbtnGenerateGreen.Name = "kbtnGenerateGreen"; this.kbtnGenerateGreen.Size = new(120, 25); @@ -301,7 +293,6 @@ private void InitializeComponent() // // kbtnGenerateBlue // - this.kbtnGenerateBlue.CornerRoundingRadius = -1F; this.kbtnGenerateBlue.Location = new(725, 409); this.kbtnGenerateBlue.Name = "kbtnGenerateBlue"; this.kbtnGenerateBlue.Size = new(119, 25); @@ -310,7 +301,6 @@ private void InitializeComponent() // // kbtnGenerateRed // - this.kbtnGenerateRed.CornerRoundingRadius = -1F; this.kbtnGenerateRed.Location = new(445, 409); this.kbtnGenerateRed.Name = "kbtnGenerateRed"; this.kbtnGenerateRed.Size = new(120, 25); @@ -329,7 +319,7 @@ private void InitializeComponent() this.knudBlueValue.Size = new(74, 23); this.knudBlueValue.StateCommon.Back.Color1 = System.Drawing.Color.Blue; this.knudBlueValue.StateCommon.Content.Color1 = System.Drawing.Color.White; - this.knudBlueValue.StateCommon.Content.Font = new("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.knudBlueValue.StateCommon.Content.Font = new("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.knudBlueValue.TabIndex = 99; // // knudGreenValue @@ -344,7 +334,7 @@ private void InitializeComponent() this.knudGreenValue.Size = new(74, 23); this.knudGreenValue.StateCommon.Back.Color1 = System.Drawing.Color.Green; this.knudGreenValue.StateCommon.Content.Color1 = System.Drawing.Color.White; - this.knudGreenValue.StateCommon.Content.Font = new("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.knudGreenValue.StateCommon.Content.Font = new("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.knudGreenValue.TabIndex = 98; // // knudRedValue @@ -359,7 +349,7 @@ private void InitializeComponent() this.knudRedValue.Size = new(74, 23); this.knudRedValue.StateCommon.Back.Color1 = System.Drawing.Color.Red; this.knudRedValue.StateCommon.Content.Color1 = System.Drawing.Color.White; - this.knudRedValue.StateCommon.Content.Font = new("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.knudRedValue.StateCommon.Content.Font = new("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.knudRedValue.TabIndex = 97; // // knudAlphaValue @@ -372,7 +362,7 @@ private void InitializeComponent() 0}); this.knudAlphaValue.Name = "knudAlphaValue"; this.knudAlphaValue.Size = new(74, 23); - this.knudAlphaValue.StateCommon.Content.Font = new("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.knudAlphaValue.StateCommon.Content.Font = new("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.knudAlphaValue.TabIndex = 96; this.knudAlphaValue.Value = new(new int[] { 255, @@ -583,7 +573,7 @@ private void InitializeComponent() // // kryptonTableLayoutPanel1 // - this.kryptonTableLayoutPanel1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("kryptonTableLayoutPanel1.BackgroundImage"))); + this.kryptonTableLayoutPanel1.BackgroundImage = (System.Drawing.Image)resources.GetObject("kryptonTableLayoutPanel1.BackgroundImage"); this.kryptonTableLayoutPanel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.kryptonTableLayoutPanel1.ColumnCount = 1; this.kryptonTableLayoutPanel1.ColumnStyles.Add(new(System.Windows.Forms.SizeType.Percent, 100F)); @@ -628,17 +618,17 @@ private void InitializeComponent() this.Load += new(this.InternalBasicPaletteCreator_Load); this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); this.kryptonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.cpbxLightestColour)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.cpbxLightColour)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.cpbxMediumColour)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.cpbxDarkestColour)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.cpbxBaseColour)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cpbxLightestColour).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cpbxLightColour).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cpbxMediumColour).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cpbxDarkestColour).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cpbxBaseColour).EndInit(); this.kryptonTableLayoutPanel1.ResumeLayout(false); this.kryptonTableLayoutPanel1.PerformLayout(); this.ResumeLayout(false); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/InternalKryptonPaletteBasicColourCreator.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/InternalKryptonPaletteBasicColourCreator.cs index 28bc48142..d583550d3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/InternalKryptonPaletteBasicColourCreator.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/InternalKryptonPaletteBasicColourCreator.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/PaletteColourCreator.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/PaletteColourCreator.cs index 407a1cf65..93b166186 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/PaletteColourCreator.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/PaletteColourCreator.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -326,7 +326,6 @@ private void InitializeComponent() // // kbtnDefineCustomColours // - this.kbtnDefineCustomColours.CornerRoundingRadius = -1F; this.kbtnDefineCustomColours.Location = new System.Drawing.Point(183, 372); this.kbtnDefineCustomColours.Name = "kbtnDefineCustomColours"; this.kbtnDefineCustomColours.Size = new System.Drawing.Size(177, 25); @@ -347,7 +346,6 @@ private void InitializeComponent() // this.kbtnFileExport.AutoSize = true; this.kbtnFileExport.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnFileExport.CornerRoundingRadius = -1F; this.kbtnFileExport.Location = new System.Drawing.Point(14, 582); this.kbtnFileExport.Name = "kbtnFileExport"; this.kbtnFileExport.Size = new System.Drawing.Size(88, 30); @@ -381,7 +379,6 @@ private void InitializeComponent() // // kbtnGenerateBlueValue // - this.kbtnGenerateBlueValue.CornerRoundingRadius = -1F; this.kbtnGenerateBlueValue.Location = new System.Drawing.Point(845, 325); this.kbtnGenerateBlueValue.Name = "kbtnGenerateBlueValue"; this.kbtnGenerateBlueValue.Size = new System.Drawing.Size(105, 25); @@ -391,7 +388,6 @@ private void InitializeComponent() // // kbtnGenerateGreenValue // - this.kbtnGenerateGreenValue.CornerRoundingRadius = -1F; this.kbtnGenerateGreenValue.Location = new System.Drawing.Point(845, 282); this.kbtnGenerateGreenValue.Name = "kbtnGenerateGreenValue"; this.kbtnGenerateGreenValue.Size = new System.Drawing.Size(105, 25); @@ -401,7 +397,6 @@ private void InitializeComponent() // // kbtnGenerateRedValue // - this.kbtnGenerateRedValue.CornerRoundingRadius = -1F; this.kbtnGenerateRedValue.Location = new System.Drawing.Point(845, 238); this.kbtnGenerateRedValue.Name = "kbtnGenerateRedValue"; this.kbtnGenerateRedValue.Size = new System.Drawing.Size(105, 25); @@ -548,7 +543,6 @@ private void InitializeComponent() // // kbtnExport // - this.kbtnExport.CornerRoundingRadius = -1F; this.kbtnExport.Enabled = false; this.kbtnExport.Location = new System.Drawing.Point(133, 7); this.kbtnExport.Name = "kbtnExport"; @@ -559,7 +553,6 @@ private void InitializeComponent() // // kbtnGenerate // - this.kbtnGenerate.CornerRoundingRadius = -1F; this.kbtnGenerate.Location = new System.Drawing.Point(14, 7); this.kbtnGenerate.Name = "kbtnGenerate"; this.kbtnGenerate.Size = new System.Drawing.Size(113, 25); @@ -603,7 +596,6 @@ private void InitializeComponent() // // kbtnDebugConsole // - this.kbtnDebugConsole.CornerRoundingRadius = -1F; this.kbtnDebugConsole.Location = new System.Drawing.Point(576, 7); this.kbtnDebugConsole.Name = "kbtnDebugConsole"; this.kbtnDebugConsole.Size = new System.Drawing.Size(108, 25); @@ -613,7 +605,6 @@ private void InitializeComponent() // // kbtnOptions // - this.kbtnOptions.CornerRoundingRadius = -1F; this.kbtnOptions.Location = new System.Drawing.Point(480, 7); this.kbtnOptions.Name = "kbtnOptions"; this.kbtnOptions.Size = new System.Drawing.Size(90, 25); @@ -623,7 +614,6 @@ private void InitializeComponent() // // kbtnDefineIndividualColours // - this.kbtnDefineIndividualColours.CornerRoundingRadius = -1F; this.kbtnDefineIndividualColours.Location = new System.Drawing.Point(325, 7); this.kbtnDefineIndividualColours.Name = "kbtnDefineIndividualColours"; this.kbtnDefineIndividualColours.Size = new System.Drawing.Size(149, 25); @@ -633,7 +623,6 @@ private void InitializeComponent() // // kbtnImportColours // - this.kbtnImportColours.CornerRoundingRadius = -1F; this.kbtnImportColours.Location = new System.Drawing.Point(229, 7); this.kbtnImportColours.Name = "kbtnImportColours"; this.kbtnImportColours.Size = new System.Drawing.Size(90, 25); @@ -661,7 +650,6 @@ private void InitializeComponent() // // kbtnOk // - this.kbtnOk.CornerRoundingRadius = -1F; this.kbtnOk.Location = new System.Drawing.Point(924, 7); this.kbtnOk.Name = "kbtnOk"; this.kbtnOk.Size = new System.Drawing.Size(90, 25); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/PaletteFileEditor.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/PaletteFileEditor.cs index b7e6bd762..6403c1525 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/PaletteFileEditor.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Colours/PaletteFileEditor.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -79,20 +79,18 @@ private void InitializeComponent() // kbtnClose // this.kbtnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnClose.CornerRoundingRadius = -1F; this.kbtnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kbtnClose.Location = new System.Drawing.Point(529, 15); this.kbtnClose.Name = "kbtnClose"; this.kbtnClose.Size = new System.Drawing.Size(90, 25); this.kbtnClose.TabIndex = 31; - this.kbtnClose.UseAsADialogButton = true; + this.kbtnClose.Values.UseAsADialogButton = true; this.kbtnClose.Values.Text = "Cance&l"; // // kbtnGenerateColours // this.kbtnGenerateColours.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.kbtnGenerateColours.AutoSize = true; - this.kbtnGenerateColours.CornerRoundingRadius = -1F; this.kbtnGenerateColours.Location = new System.Drawing.Point(318, 15); this.kbtnGenerateColours.Name = "kbtnGenerateColours"; this.kbtnGenerateColours.Size = new System.Drawing.Size(105, 25); @@ -103,7 +101,6 @@ private void InitializeComponent() // this.kbtnSaveFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.kbtnSaveFile.AutoSize = true; - this.kbtnSaveFile.CornerRoundingRadius = -1F; this.kbtnSaveFile.Location = new System.Drawing.Point(222, 15); this.kbtnSaveFile.Name = "kbtnSaveFile"; this.kbtnSaveFile.Size = new System.Drawing.Size(90, 25); @@ -114,7 +111,6 @@ private void InitializeComponent() // this.kbtnOpenFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.kbtnOpenFile.AutoSize = true; - this.kbtnOpenFile.CornerRoundingRadius = -1F; this.kbtnOpenFile.Location = new System.Drawing.Point(126, 15); this.kbtnOpenFile.Name = "kbtnOpenFile"; this.kbtnOpenFile.Size = new System.Drawing.Size(90, 25); @@ -125,7 +121,6 @@ private void InitializeComponent() // this.kbtnGenerateNewFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.kbtnGenerateNewFile.AutoSize = true; - this.kbtnGenerateNewFile.CornerRoundingRadius = -1F; this.kbtnGenerateNewFile.Location = new System.Drawing.Point(12, 15); this.kbtnGenerateNewFile.Name = "kbtnGenerateNewFile"; this.kbtnGenerateNewFile.Size = new System.Drawing.Size(110, 25); @@ -222,7 +217,7 @@ public PaletteFileEditor(string paletteFilePath) } catch (Exception error) { - ExceptionCapture.CaptureException(error); + DebugUtilities.NotImplemented(error.ToString()); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Debugging/ColourSettingsViewer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Debugging/ColourSettingsViewer.cs index 3d97485b3..2868a116f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Debugging/ColourSettingsViewer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Debugging/ColourSettingsViewer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -62,11 +62,11 @@ private void InitializeComponent() this.klblRGBValues = new(); this.klbHexValues = new(); this.kryptonBorderEdge1 = new(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbxColourPreviewer)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.pbxColourPreviewer).BeginInit(); this.SuspendLayout(); // // kryptonPanel1 @@ -91,8 +91,7 @@ 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.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnOk.Location = new(909, 12); this.kbtnOk.Name = "kbtnOk"; this.kbtnOk.Size = new(90, 25); @@ -126,7 +125,6 @@ private void InitializeComponent() // // kbtnLoadFromFile // - this.kbtnLoadFromFile.CornerRoundingRadius = -1F; this.kbtnLoadFromFile.Location = new(13, 681); this.kbtnLoadFromFile.Name = "kbtnLoadFromFile"; this.kbtnLoadFromFile.Size = new(137, 30); @@ -135,7 +133,6 @@ private void InitializeComponent() // // kbtnExport // - this.kbtnExport.CornerRoundingRadius = -1F; this.kbtnExport.Enabled = false; this.kbtnExport.Location = new(13, 637); this.kbtnExport.Name = "kbtnExport"; @@ -154,7 +151,6 @@ private void InitializeComponent() // // kbtnResetValues // - this.kbtnResetValues.CornerRoundingRadius = -1F; this.kbtnResetValues.Enabled = false; this.kbtnResetValues.Location = new(13, 593); this.kbtnResetValues.Name = "kbtnResetValues"; @@ -164,7 +160,6 @@ private void InitializeComponent() // // kbtnAllColoursAsRGB // - this.kbtnAllColoursAsRGB.CornerRoundingRadius = -1F; this.kbtnAllColoursAsRGB.Location = new(13, 549); this.kbtnAllColoursAsRGB.Name = "kbtnAllColoursAsRGB"; this.kbtnAllColoursAsRGB.Size = new(292, 30); @@ -174,7 +169,6 @@ private void InitializeComponent() // // kbtnAllColoursAsHex // - this.kbtnAllColoursAsHex.CornerRoundingRadius = -1F; this.kbtnAllColoursAsHex.Location = new(13, 505); this.kbtnAllColoursAsHex.Name = "kbtnAllColoursAsHex"; this.kbtnAllColoursAsHex.Size = new(292, 30); @@ -216,13 +210,13 @@ private void InitializeComponent() this.Name = "ColourSettingsViewer"; this.ShowInTaskbar = false; this.Text = "Palette Debug Console"; - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); this.kryptonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbxColourPreviewer)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.pbxColourPreviewer).EndInit(); this.ResumeLayout(false); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Options/ColourBlendingOptions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Options/ColourBlendingOptions.cs index 1a3a04c94..98f936c91 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Options/ColourBlendingOptions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Options/ColourBlendingOptions.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -148,25 +148,25 @@ private void InitializeComponent() this.bsaBrowse = new(); this.kryptonLabel10 = new(); this.kryptonBorderEdge1 = new(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonDockableNavigator1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonDockableNavigator1).BeginInit(); this.kryptonDockableNavigator1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage1).BeginInit(); this.kryptonPage1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage2).BeginInit(); this.kryptonPage2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage3).BeginInit(); this.kryptonPage3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.cbxLightestColourPreview)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.cbxLightColourPreview)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.cbxMediumColourPreview)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.cbxDarkColourPreview)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.cbxCircular)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbxStandard)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbDisplayType)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxLightestColourPreview).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxLightColourPreview).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxMediumColourPreview).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxDarkColourPreview).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxCircular).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.pbxStandard).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbDisplayType).BeginInit(); this.SuspendLayout(); // // kryptonPanel1 @@ -185,8 +185,7 @@ private void InitializeComponent() // // kbtnResetValues // - this.kbtnResetValues.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.kbtnResetValues.CornerRoundingRadius = -1F; + this.kbtnResetValues.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); this.kbtnResetValues.Enabled = false; this.kbtnResetValues.Location = new(12, 16); this.kbtnResetValues.Name = "kbtnResetValues"; @@ -197,8 +196,7 @@ 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.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnOk.Location = new(370, 16); this.kbtnOk.Name = "kbtnOk"; this.kbtnOk.Size = new(90, 25); @@ -207,8 +205,7 @@ 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.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnCancel.Location = new(466, 16); this.kbtnCancel.Name = "kbtnCancel"; this.kbtnCancel.Size = new(90, 25); @@ -217,8 +214,7 @@ private void InitializeComponent() // // kbtnApply // - this.kbtnApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnApply.CornerRoundingRadius = -1F; + this.kbtnApply.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnApply.Enabled = false; this.kbtnApply.Location = new(562, 16); this.kbtnApply.Name = "kbtnApply"; @@ -370,7 +366,7 @@ private void InitializeComponent() this.kcbBaseColour.Name = "kcbBaseColour"; this.kcbBaseColour.Size = new(179, 25); this.kcbBaseColour.TabIndex = 90; - this.kcbBaseColour.Values.Image = ((System.Drawing.Image)(resources.GetObject("kcbBaseColour.Values.Image"))); + this.kcbBaseColour.Values.Image = (System.Drawing.Image)resources.GetObject("kcbBaseColour.Values.Image"); this.kcbBaseColour.Values.RoundedCorners = 8; this.kcbBaseColour.Values.Text = "&Choose a Base Colour"; // @@ -537,81 +533,73 @@ private void InitializeComponent() // // kbtnDarkColourIntensityValueMinus // - this.kbtnDarkColourIntensityValueMinus.CornerRoundingRadius = -1F; this.kbtnDarkColourIntensityValueMinus.Location = new(364, 13); this.kbtnDarkColourIntensityValueMinus.Name = "kbtnDarkColourIntensityValueMinus"; this.kbtnDarkColourIntensityValueMinus.Size = new(18, 30); - this.kbtnDarkColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kbtnDarkColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kbtnDarkColourIntensityValueMinus.TabIndex = 74; this.kbtnDarkColourIntensityValueMinus.Values.Text = "-"; // // kbtnLightestColourIntensityValuePlus // - this.kbtnLightestColourIntensityValuePlus.CornerRoundingRadius = -1F; this.kbtnLightestColourIntensityValuePlus.Location = new(400, 305); this.kbtnLightestColourIntensityValuePlus.Name = "kbtnLightestColourIntensityValuePlus"; this.kbtnLightestColourIntensityValuePlus.Size = new(23, 30); - this.kbtnLightestColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kbtnLightestColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kbtnLightestColourIntensityValuePlus.TabIndex = 81; this.kbtnLightestColourIntensityValuePlus.Values.Text = "+"; // // kbnDarkestColourIntensityValuePlus // - this.kbnDarkestColourIntensityValuePlus.CornerRoundingRadius = -1F; this.kbnDarkestColourIntensityValuePlus.Location = new(400, 13); this.kbnDarkestColourIntensityValuePlus.Name = "kbnDarkestColourIntensityValuePlus"; this.kbnDarkestColourIntensityValuePlus.Size = new(23, 30); - this.kbnDarkestColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kbnDarkestColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kbnDarkestColourIntensityValuePlus.TabIndex = 75; this.kbnDarkestColourIntensityValuePlus.Values.Text = "+"; // // kbtnLightestColourIntensityValueMinus // - this.kbtnLightestColourIntensityValueMinus.CornerRoundingRadius = -1F; this.kbtnLightestColourIntensityValueMinus.Location = new(364, 305); this.kbtnLightestColourIntensityValueMinus.Name = "kbtnLightestColourIntensityValueMinus"; this.kbtnLightestColourIntensityValueMinus.Size = new(18, 30); - this.kbtnLightestColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kbtnLightestColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kbtnLightestColourIntensityValueMinus.TabIndex = 80; this.kbtnLightestColourIntensityValueMinus.Values.Text = "-"; // // kbtnMiddleColourIntensityValueMinus // - this.kbtnMiddleColourIntensityValueMinus.CornerRoundingRadius = -1F; this.kbtnMiddleColourIntensityValueMinus.Location = new(364, 115); this.kbtnMiddleColourIntensityValueMinus.Name = "kbtnMiddleColourIntensityValueMinus"; this.kbtnMiddleColourIntensityValueMinus.Size = new(18, 30); - this.kbtnMiddleColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kbtnMiddleColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kbtnMiddleColourIntensityValueMinus.TabIndex = 76; this.kbtnMiddleColourIntensityValueMinus.Values.Text = "-"; // // kbtLightColourIntensityValuePlus // - this.kbtLightColourIntensityValuePlus.CornerRoundingRadius = -1F; this.kbtLightColourIntensityValuePlus.Location = new(400, 210); this.kbtLightColourIntensityValuePlus.Name = "kbtLightColourIntensityValuePlus"; this.kbtLightColourIntensityValuePlus.Size = new(23, 30); - this.kbtLightColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kbtLightColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kbtLightColourIntensityValuePlus.TabIndex = 79; this.kbtLightColourIntensityValuePlus.Values.Text = "+"; // // kbtnMiddleColourIntensityValuePlus // - this.kbtnMiddleColourIntensityValuePlus.CornerRoundingRadius = -1F; this.kbtnMiddleColourIntensityValuePlus.Location = new(400, 115); this.kbtnMiddleColourIntensityValuePlus.Name = "kbtnMiddleColourIntensityValuePlus"; this.kbtnMiddleColourIntensityValuePlus.Size = new(23, 30); - this.kbtnMiddleColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kbtnMiddleColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kbtnMiddleColourIntensityValuePlus.TabIndex = 77; this.kbtnMiddleColourIntensityValuePlus.Values.Text = "+"; // // kbtnLightColourIntensityValueMinus // - this.kbtnLightColourIntensityValueMinus.CornerRoundingRadius = -1F; this.kbtnLightColourIntensityValueMinus.Location = new(364, 210); this.kbtnLightColourIntensityValueMinus.Name = "kbtnLightColourIntensityValueMinus"; this.kbtnLightColourIntensityValueMinus.Size = new(18, 30); - this.kbtnLightColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kbtnLightColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kbtnLightColourIntensityValueMinus.TabIndex = 78; this.kbtnLightColourIntensityValueMinus.Values.Text = "-"; // @@ -661,7 +649,6 @@ private void InitializeComponent() // // kcmbDisplayType // - this.kcmbDisplayType.CornerRoundingRadius = -1F; this.kcmbDisplayType.DropDownWidth = 203; this.kcmbDisplayType.IntegralHeight = false; this.kcmbDisplayType.Items.AddRange(new object[] { @@ -701,7 +688,7 @@ private void InitializeComponent() // // bsaReset // - this.bsaReset.Image = ((System.Drawing.Image)(resources.GetObject("bsaReset.Image"))); + this.bsaReset.Image = (System.Drawing.Image)resources.GetObject("bsaReset.Image"); this.bsaReset.UniqueName = "e5d4e65c1b2f460a80f02567f0a10106"; // // bsaBrowse @@ -740,29 +727,29 @@ private void InitializeComponent() this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Colour Blending Options"; this.Load += new(this.ColourBlendingOptions_Load); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonDockableNavigator1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonDockableNavigator1).EndInit(); this.kryptonDockableNavigator1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage1).EndInit(); this.kryptonPage1.ResumeLayout(false); this.kryptonPage1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage2).EndInit(); this.kryptonPage2.ResumeLayout(false); this.kryptonPage2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage3).EndInit(); this.kryptonPage3.ResumeLayout(false); this.kryptonPage3.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.cbxLightestColourPreview)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.cbxLightColourPreview)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.cbxMediumColourPreview)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.cbxDarkColourPreview)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.cbxCircular)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbxStandard)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbDisplayType)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxLightestColourPreview).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxLightColourPreview).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxMediumColourPreview).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxDarkColourPreview).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxCircular).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.pbxStandard).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbDisplayType).EndInit(); this.ResumeLayout(false); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Options/GlobalOptionsMenu.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Options/GlobalOptionsMenu.cs index 432098837..6f78ac89a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Options/GlobalOptionsMenu.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Options/GlobalOptionsMenu.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -182,33 +182,33 @@ private void InitializeComponent() this.kbtnResetColourIntegerSettings = new(); this.kbtnResetColourBlendingSettings = new(); this.kbtnNukeAllSettings = new(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonNavigator1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonNavigator1).BeginInit(); this.kryptonNavigator1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage1).BeginInit(); this.kryptonPage1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonDockableNavigator1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonDockableNavigator1).BeginInit(); this.kryptonDockableNavigator1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage3).BeginInit(); this.kryptonPage3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.cbxLightestColourPreview)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.cbxLightColourPreview)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.cbxMediumColourPreview)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.cbxDarkColourPreview)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxLightestColourPreview).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxLightColourPreview).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxMediumColourPreview).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxDarkColourPreview).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage4).BeginInit(); this.kryptonPage4.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.cbxCircular)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbxStandard)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbDisplayType)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage5)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxCircular).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.pbxStandard).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbDisplayType).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage5).BeginInit(); this.kryptonPage5.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kpTheme)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kpTheme).BeginInit(); this.kpTheme.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.ktcmbTheme)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kpSettings)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.ktcmbTheme).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kpSettings).BeginInit(); this.kpSettings.SuspendLayout(); this.SuspendLayout(); // @@ -238,8 +238,7 @@ private void InitializeComponent() // // kbtnResetThemeValues // - this.kbtnResetThemeValues.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.kbtnResetThemeValues.CornerRoundingRadius = -1F; + this.kbtnResetThemeValues.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); this.kbtnResetThemeValues.Enabled = false; this.kbtnResetThemeValues.Location = new(12, 15); this.kbtnResetThemeValues.Name = "kbtnResetThemeValues"; @@ -249,8 +248,7 @@ private void InitializeComponent() // // kbtnResetColourBlendingValues // - this.kbtnResetColourBlendingValues.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.kbtnResetColourBlendingValues.CornerRoundingRadius = -1F; + this.kbtnResetColourBlendingValues.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); this.kbtnResetColourBlendingValues.Enabled = false; this.kbtnResetColourBlendingValues.Location = new(12, 15); this.kbtnResetColourBlendingValues.Name = "kbtnResetColourBlendingValues"; @@ -260,8 +258,7 @@ 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.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnOk.Location = new(396, 15); this.kbtnOk.Name = "kbtnOk"; this.kbtnOk.Size = new(90, 25); @@ -270,8 +267,7 @@ 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.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnCancel.Location = new(492, 15); this.kbtnCancel.Name = "kbtnCancel"; this.kbtnCancel.Size = new(90, 25); @@ -280,8 +276,7 @@ private void InitializeComponent() // // kbtnUACApply // - this.kbtnUACApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnUACApply.CornerRoundingRadius = -1F; + this.kbtnUACApply.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnUACApply.Enabled = false; this.kbtnUACApply.Location = new(588, 15); this.kbtnUACApply.Name = "kbtnUACApply"; @@ -440,7 +435,7 @@ private void InitializeComponent() this.kcbBaseColour.Name = "kcbBaseColour"; this.kcbBaseColour.Size = new(179, 25); this.kcbBaseColour.TabIndex = 61; - this.kcbBaseColour.Values.Image = ((System.Drawing.Image)(resources.GetObject("kcbBaseColour.Values.Image"))); + this.kcbBaseColour.Values.Image = (System.Drawing.Image)resources.GetObject("kcbBaseColour.Values.Image"); this.kcbBaseColour.Values.RoundedCorners = 8; this.kcbBaseColour.Values.Text = "&Choose a Base Colour"; // @@ -607,81 +602,73 @@ private void InitializeComponent() // // kbtnDarkColourIntensityValueMinus // - this.kbtnDarkColourIntensityValueMinus.CornerRoundingRadius = -1F; this.kbtnDarkColourIntensityValueMinus.Location = new(293, 20); this.kbtnDarkColourIntensityValueMinus.Name = "kbtnDarkColourIntensityValueMinus"; this.kbtnDarkColourIntensityValueMinus.Size = new(18, 30); - this.kbtnDarkColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kbtnDarkColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kbtnDarkColourIntensityValueMinus.TabIndex = 45; this.kbtnDarkColourIntensityValueMinus.Values.Text = "-"; // // kbtnLightestColourIntensityValuePlus // - this.kbtnLightestColourIntensityValuePlus.CornerRoundingRadius = -1F; this.kbtnLightestColourIntensityValuePlus.Location = new(329, 312); this.kbtnLightestColourIntensityValuePlus.Name = "kbtnLightestColourIntensityValuePlus"; this.kbtnLightestColourIntensityValuePlus.Size = new(23, 30); - this.kbtnLightestColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kbtnLightestColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kbtnLightestColourIntensityValuePlus.TabIndex = 52; this.kbtnLightestColourIntensityValuePlus.Values.Text = "+"; // // kbnDarkestColourIntensityValuePlus // - this.kbnDarkestColourIntensityValuePlus.CornerRoundingRadius = -1F; this.kbnDarkestColourIntensityValuePlus.Location = new(329, 20); this.kbnDarkestColourIntensityValuePlus.Name = "kbnDarkestColourIntensityValuePlus"; this.kbnDarkestColourIntensityValuePlus.Size = new(23, 30); - this.kbnDarkestColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kbnDarkestColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kbnDarkestColourIntensityValuePlus.TabIndex = 46; this.kbnDarkestColourIntensityValuePlus.Values.Text = "+"; // // kbtnLightestColourIntensityValueMinus // - this.kbtnLightestColourIntensityValueMinus.CornerRoundingRadius = -1F; this.kbtnLightestColourIntensityValueMinus.Location = new(293, 312); this.kbtnLightestColourIntensityValueMinus.Name = "kbtnLightestColourIntensityValueMinus"; this.kbtnLightestColourIntensityValueMinus.Size = new(18, 30); - this.kbtnLightestColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kbtnLightestColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kbtnLightestColourIntensityValueMinus.TabIndex = 51; this.kbtnLightestColourIntensityValueMinus.Values.Text = "-"; // // kbtnMiddleColourIntensityValueMinus // - this.kbtnMiddleColourIntensityValueMinus.CornerRoundingRadius = -1F; this.kbtnMiddleColourIntensityValueMinus.Location = new(293, 122); this.kbtnMiddleColourIntensityValueMinus.Name = "kbtnMiddleColourIntensityValueMinus"; this.kbtnMiddleColourIntensityValueMinus.Size = new(18, 30); - this.kbtnMiddleColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kbtnMiddleColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kbtnMiddleColourIntensityValueMinus.TabIndex = 47; this.kbtnMiddleColourIntensityValueMinus.Values.Text = "-"; // // kbtLightColourIntensityValuePlus // - this.kbtLightColourIntensityValuePlus.CornerRoundingRadius = -1F; this.kbtLightColourIntensityValuePlus.Location = new(329, 217); this.kbtLightColourIntensityValuePlus.Name = "kbtLightColourIntensityValuePlus"; this.kbtLightColourIntensityValuePlus.Size = new(23, 30); - this.kbtLightColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kbtLightColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kbtLightColourIntensityValuePlus.TabIndex = 50; this.kbtLightColourIntensityValuePlus.Values.Text = "+"; // // kbtnMiddleColourIntensityValuePlus // - this.kbtnMiddleColourIntensityValuePlus.CornerRoundingRadius = -1F; this.kbtnMiddleColourIntensityValuePlus.Location = new(329, 122); this.kbtnMiddleColourIntensityValuePlus.Name = "kbtnMiddleColourIntensityValuePlus"; this.kbtnMiddleColourIntensityValuePlus.Size = new(23, 30); - this.kbtnMiddleColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kbtnMiddleColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kbtnMiddleColourIntensityValuePlus.TabIndex = 48; this.kbtnMiddleColourIntensityValuePlus.Values.Text = "+"; // // kbtnLightColourIntensityValueMinus // - this.kbtnLightColourIntensityValueMinus.CornerRoundingRadius = -1F; this.kbtnLightColourIntensityValueMinus.Location = new(293, 217); this.kbtnLightColourIntensityValueMinus.Name = "kbtnLightColourIntensityValueMinus"; this.kbtnLightColourIntensityValueMinus.Size = new(18, 30); - this.kbtnLightColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kbtnLightColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kbtnLightColourIntensityValueMinus.TabIndex = 49; this.kbtnLightColourIntensityValueMinus.Values.Text = "-"; // @@ -751,7 +738,6 @@ private void InitializeComponent() // // kcmbDisplayType // - this.kcmbDisplayType.CornerRoundingRadius = -1F; this.kcmbDisplayType.DropDownWidth = 203; this.kcmbDisplayType.IntegralHeight = false; this.kcmbDisplayType.Items.AddRange(new object[] { @@ -805,7 +791,7 @@ private void InitializeComponent() // // bsaReset // - this.bsaReset.Image = ((System.Drawing.Image)(resources.GetObject("bsaReset.Image"))); + this.bsaReset.Image = (System.Drawing.Image)resources.GetObject("bsaReset.Image"); this.bsaReset.UniqueName = "e5d4e65c1b2f460a80f02567f0a10106"; // // bsaBrowse @@ -841,7 +827,6 @@ private void InitializeComponent() // // ktcmbTheme // - this.ktcmbTheme.CornerRoundingRadius = -1F; this.ktcmbTheme.DropDownWidth = 198; this.ktcmbTheme.IntegralHeight = false; this.ktcmbTheme.Location = new(118, 22); @@ -852,7 +837,6 @@ private void InitializeComponent() // // kbtnLoadTheme // - this.kbtnLoadTheme.CornerRoundingRadius = -1F; this.kbtnLoadTheme.Enabled = false; this.kbtnLoadTheme.Location = new(554, 97); this.kbtnLoadTheme.Name = "kbtnLoadTheme"; @@ -873,7 +857,7 @@ private void InitializeComponent() // // buttonSpecAny1 // - this.buttonSpecAny1.Image = ((System.Drawing.Image)(resources.GetObject("buttonSpecAny1.Image"))); + this.buttonSpecAny1.Image = (System.Drawing.Image)resources.GetObject("buttonSpecAny1.Image"); this.buttonSpecAny1.UniqueName = "1f0247d059a64ff792fa7879355b8bf1"; // // buttonSpecAny2 @@ -932,7 +916,6 @@ private void InitializeComponent() // // kbtnResetPaletteTypefaceSettings // - this.kbtnResetPaletteTypefaceSettings.CornerRoundingRadius = -1F; this.kbtnResetPaletteTypefaceSettings.Location = new(18, 370); this.kbtnResetPaletteTypefaceSettings.Name = "kbtnResetPaletteTypefaceSettings"; this.kbtnResetPaletteTypefaceSettings.Size = new(256, 25); @@ -941,7 +924,6 @@ private void InitializeComponent() // // kbtnResetGlobalStringSettings // - this.kbtnResetGlobalStringSettings.CornerRoundingRadius = -1F; this.kbtnResetGlobalStringSettings.Location = new(18, 312); this.kbtnResetGlobalStringSettings.Name = "kbtnResetGlobalStringSettings"; this.kbtnResetGlobalStringSettings.Size = new(256, 25); @@ -950,7 +932,6 @@ private void InitializeComponent() // // kbtnResetGlobalBooleanSettings // - this.kbtnResetGlobalBooleanSettings.CornerRoundingRadius = -1F; this.kbtnResetGlobalBooleanSettings.Location = new(18, 254); this.kbtnResetGlobalBooleanSettings.Name = "kbtnResetGlobalBooleanSettings"; this.kbtnResetGlobalBooleanSettings.Size = new(256, 25); @@ -959,7 +940,6 @@ private void InitializeComponent() // // kbtnResetColourStringSettings // - this.kbtnResetColourStringSettings.CornerRoundingRadius = -1F; this.kbtnResetColourStringSettings.Location = new(18, 196); this.kbtnResetColourStringSettings.Name = "kbtnResetColourStringSettings"; this.kbtnResetColourStringSettings.Size = new(256, 25); @@ -968,7 +948,6 @@ private void InitializeComponent() // // kbtnResetColourSettings // - this.kbtnResetColourSettings.CornerRoundingRadius = -1F; this.kbtnResetColourSettings.Location = new(18, 138); this.kbtnResetColourSettings.Name = "kbtnResetColourSettings"; this.kbtnResetColourSettings.Size = new(256, 25); @@ -977,7 +956,6 @@ private void InitializeComponent() // // kbtnResetColourIntegerSettings // - this.kbtnResetColourIntegerSettings.CornerRoundingRadius = -1F; this.kbtnResetColourIntegerSettings.Location = new(18, 80); this.kbtnResetColourIntegerSettings.Name = "kbtnResetColourIntegerSettings"; this.kbtnResetColourIntegerSettings.Size = new(256, 25); @@ -986,7 +964,6 @@ private void InitializeComponent() // // kbtnResetColourBlendingSettings // - this.kbtnResetColourBlendingSettings.CornerRoundingRadius = -1F; this.kbtnResetColourBlendingSettings.Location = new(18, 22); this.kbtnResetColourBlendingSettings.Name = "kbtnResetColourBlendingSettings"; this.kbtnResetColourBlendingSettings.Size = new(256, 25); @@ -995,7 +972,6 @@ private void InitializeComponent() // // kbtnNukeAllSettings // - this.kbtnNukeAllSettings.CornerRoundingRadius = -1F; this.kbtnNukeAllSettings.Location = new(18, 428); this.kbtnNukeAllSettings.Name = "kbtnNukeAllSettings"; this.kbtnNukeAllSettings.Size = new(256, 25); @@ -1016,38 +992,38 @@ private void InitializeComponent() this.Text = "Global Options Menu"; this.TextExtra = "(For Development Use Only)"; this.Load += new(this.GlobalOptionsMenu_Load); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonNavigator1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonNavigator1).EndInit(); this.kryptonNavigator1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage1).EndInit(); this.kryptonPage1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonDockableNavigator1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonDockableNavigator1).EndInit(); this.kryptonDockableNavigator1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage3).EndInit(); this.kryptonPage3.ResumeLayout(false); this.kryptonPage3.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.cbxLightestColourPreview)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.cbxLightColourPreview)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.cbxMediumColourPreview)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.cbxDarkColourPreview)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage4)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxLightestColourPreview).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxLightColourPreview).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxMediumColourPreview).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxDarkColourPreview).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage4).EndInit(); this.kryptonPage4.ResumeLayout(false); this.kryptonPage4.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.cbxCircular)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbxStandard)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbDisplayType)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage5)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cbxCircular).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.pbxStandard).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbDisplayType).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage5).EndInit(); this.kryptonPage5.ResumeLayout(false); this.kryptonPage5.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kpTheme)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kpTheme).EndInit(); this.kpTheme.ResumeLayout(false); this.kpTheme.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.ktcmbTheme)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kpSettings)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.ktcmbTheme).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kpSettings).EndInit(); this.kpSettings.ResumeLayout(false); this.kpSettings.PerformLayout(); this.ResumeLayout(false); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Options/SettingsManagementOptions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Options/SettingsManagementOptions.cs index add7cc893..a5a2c01ca 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Options/SettingsManagementOptions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Options/SettingsManagementOptions.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -70,9 +70,9 @@ private void InitializeComponent() this.kryptonBorderEdge1 = new(); this.kbtnCancel = new(); this.kchkAskForConfirmation = new(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); this.SuspendLayout(); // @@ -94,7 +94,6 @@ private void InitializeComponent() // // kbtnResetPaletteTypefaceSettings // - this.kbtnResetPaletteTypefaceSettings.CornerRoundingRadius = -1F; this.kbtnResetPaletteTypefaceSettings.Location = new(12, 360); this.kbtnResetPaletteTypefaceSettings.Name = "kbtnResetPaletteTypefaceSettings"; this.kbtnResetPaletteTypefaceSettings.Size = new(226, 25); @@ -104,7 +103,6 @@ private void InitializeComponent() // // kbtnResetGlobalStringSettings // - this.kbtnResetGlobalStringSettings.CornerRoundingRadius = -1F; this.kbtnResetGlobalStringSettings.Location = new(12, 302); this.kbtnResetGlobalStringSettings.Name = "kbtnResetGlobalStringSettings"; this.kbtnResetGlobalStringSettings.Size = new(226, 25); @@ -114,7 +112,6 @@ private void InitializeComponent() // // kbtnResetGlobalBooleanSettings // - this.kbtnResetGlobalBooleanSettings.CornerRoundingRadius = -1F; this.kbtnResetGlobalBooleanSettings.Location = new(12, 244); this.kbtnResetGlobalBooleanSettings.Name = "kbtnResetGlobalBooleanSettings"; this.kbtnResetGlobalBooleanSettings.Size = new(226, 25); @@ -124,7 +121,6 @@ private void InitializeComponent() // // kbtnResetColourStringSettings // - this.kbtnResetColourStringSettings.CornerRoundingRadius = -1F; this.kbtnResetColourStringSettings.Location = new(12, 186); this.kbtnResetColourStringSettings.Name = "kbtnResetColourStringSettings"; this.kbtnResetColourStringSettings.Size = new(226, 25); @@ -134,7 +130,6 @@ private void InitializeComponent() // // kbtnResetColourSettings // - this.kbtnResetColourSettings.CornerRoundingRadius = -1F; this.kbtnResetColourSettings.Location = new(12, 128); this.kbtnResetColourSettings.Name = "kbtnResetColourSettings"; this.kbtnResetColourSettings.Size = new(226, 25); @@ -144,7 +139,6 @@ private void InitializeComponent() // // kbtnResetColourIntegerSettings // - this.kbtnResetColourIntegerSettings.CornerRoundingRadius = -1F; this.kbtnResetColourIntegerSettings.Location = new(12, 70); this.kbtnResetColourIntegerSettings.Name = "kbtnResetColourIntegerSettings"; this.kbtnResetColourIntegerSettings.Size = new(226, 25); @@ -154,7 +148,6 @@ private void InitializeComponent() // // kbtnResetColourBlendingSettings // - this.kbtnResetColourBlendingSettings.CornerRoundingRadius = -1F; this.kbtnResetColourBlendingSettings.Location = new(12, 12); this.kbtnResetColourBlendingSettings.Name = "kbtnResetColourBlendingSettings"; this.kbtnResetColourBlendingSettings.Size = new(226, 25); @@ -164,7 +157,6 @@ private void InitializeComponent() // // kbtnNukeAllSettings // - this.kbtnNukeAllSettings.CornerRoundingRadius = -1F; this.kbtnNukeAllSettings.Location = new(12, 418); this.kbtnNukeAllSettings.Name = "kbtnNukeAllSettings"; this.kbtnNukeAllSettings.Size = new(226, 25); @@ -195,9 +187,8 @@ private void InitializeComponent() // // kbtnCancel // - this.kbtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.kbtnCancel.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnCancel.AutoSize = true; - this.kbtnCancel.CornerRoundingRadius = -1F; this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kbtnCancel.Location = new(612, 15); this.kbtnCancel.Name = "kbtnCancel"; @@ -228,9 +219,9 @@ private void InitializeComponent() this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Reset Settings"; this.Load += new(this.SettingsManagementOptions_Load); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); this.kryptonPanel2.PerformLayout(); this.ResumeLayout(false); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Options/ThemeOptions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Options/ThemeOptions.cs index 8737eac1a..f05a75583 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Options/ThemeOptions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Options/ThemeOptions.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -83,11 +83,11 @@ private void InitializeComponent() this.bsaBrowse = new(); this.klblCustomTheme = new(); this.kryptonLabel1 = new(); - ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kpnlButtons).BeginInit(); this.kpnlButtons.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kpnlContent).BeginInit(); this.kpnlContent.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.ktcmbTheme)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.ktcmbTheme).BeginInit(); this.SuspendLayout(); // // kpnlButtons @@ -115,8 +115,7 @@ private void InitializeComponent() // // kbtnRestoreToDefaults // - this.kbtnRestoreToDefaults.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnRestoreToDefaults.CornerRoundingRadius = -1F; + this.kbtnRestoreToDefaults.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnRestoreToDefaults.Enabled = false; this.kbtnRestoreToDefaults.Location = new(12, 13); this.kbtnRestoreToDefaults.Name = "kbtnRestoreToDefaults"; @@ -127,8 +126,7 @@ 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.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kbtnCancel.Location = new(501, 13); this.kbtnCancel.Name = "kbtnCancel"; @@ -139,8 +137,7 @@ 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.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnOk.Location = new(405, 13); this.kbtnOk.Name = "kbtnOk"; this.kbtnOk.Size = new(90, 25); @@ -150,8 +147,7 @@ private void InitializeComponent() // // kbtnApply // - this.kbtnApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnApply.CornerRoundingRadius = -1F; + this.kbtnApply.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnApply.Enabled = false; this.kbtnApply.Location = new(597, 13); this.kbtnApply.Name = "kbtnApply"; @@ -175,7 +171,6 @@ private void InitializeComponent() // // ktcmbTheme // - this.ktcmbTheme.CornerRoundingRadius = -1F; this.ktcmbTheme.DropDownWidth = 198; this.ktcmbTheme.IntegralHeight = false; this.ktcmbTheme.Location = new(116, 10); @@ -187,7 +182,6 @@ private void InitializeComponent() // // kbtnLoadTheme // - this.kbtnLoadTheme.CornerRoundingRadius = -1F; this.kbtnLoadTheme.Enabled = false; this.kbtnLoadTheme.Location = new(598, 84); this.kbtnLoadTheme.Name = "kbtnLoadTheme"; @@ -210,7 +204,7 @@ private void InitializeComponent() // // bsaReset // - this.bsaReset.Image = ((System.Drawing.Image)(resources.GetObject("bsaReset.Image"))); + this.bsaReset.Image = (System.Drawing.Image)resources.GetObject("bsaReset.Image"); this.bsaReset.UniqueName = "1f0247d059a64ff792fa7879355b8bf1"; this.bsaReset.Click += new(this.bsaReset_Click); // @@ -254,13 +248,13 @@ private void InitializeComponent() this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Palette Theme Options"; this.Load += new(this.ThemeOptions_Load); - ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kpnlButtons).EndInit(); this.kpnlButtons.ResumeLayout(false); this.kpnlButtons.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kpnlContent).EndInit(); this.kpnlContent.ResumeLayout(false); this.kpnlContent.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.ktcmbTheme)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.ktcmbTheme).EndInit(); this.ResumeLayout(false); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/System Information/SystemInformationWindow.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/System Information/SystemInformationWindow.cs index 6d565c865..f439e17ac 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/System Information/SystemInformationWindow.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/System Information/SystemInformationWindow.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -100,7 +100,6 @@ private void InitializeComponent() // // kbtnClose // - this.kbtnClose.CornerRoundingRadius = -1F; this.kbtnClose.Location = new System.Drawing.Point(697, 13); this.kbtnClose.Name = "kbtnClose"; this.kbtnClose.Size = new System.Drawing.Size(90, 25); @@ -255,7 +254,6 @@ private void InitializeComponent() // // kbtnSave // - this.kbtnSave.CornerRoundingRadius = -1F; this.kbtnSave.Enabled = false; this.kbtnSave.Location = new System.Drawing.Point(326, 15); this.kbtnSave.Name = "kbtnSave"; @@ -265,7 +263,6 @@ private void InitializeComponent() // // kcmbClass // - this.kcmbClass.CornerRoundingRadius = -1F; this.kcmbClass.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.kcmbClass.DropDownWidth = 121; this.kcmbClass.IntegralHeight = false; @@ -916,7 +913,7 @@ private string GetSystemDetails() } catch (Exception error) { - ExceptionCapture.CaptureException(error); + DebugUtilities.NotImplemented(error.ToString()); } return sb.ToString(); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Utilities/KryptonFadeForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Utilities/KryptonFadeForm.cs index ade8db383..68c170b4c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Utilities/KryptonFadeForm.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/UX/Utilities/KryptonFadeForm.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Version Framework/Classes/AssemblyInformation.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Version Framework/Classes/AssemblyInformation.cs index f62176fef..12ead712b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Version Framework/Classes/AssemblyInformation.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Version Framework/Classes/AssemblyInformation.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Version Framework/Classes/AssemblyVersion.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Version Framework/Classes/AssemblyVersion.cs index 12faac189..3eba14151 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Version Framework/Classes/AssemblyVersion.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Version Framework/Classes/AssemblyVersion.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -77,7 +77,7 @@ public bool GetReferenceAssembly(Assembly assembly) if (assemblyNameList.Length > 0) { - AssemblyInformation information = null; + AssemblyInformation? information = null; ReferenceAssembly = new(); @@ -97,7 +97,7 @@ public bool GetReferenceAssembly(Assembly assembly) } catch (Exception error) { - ExceptionCapture.CaptureException(error); + DebugUtilities.NotImplemented(error.ToString()); return false; } @@ -120,7 +120,7 @@ public bool GetVersion(string fileName) } catch (Exception error) { - ExceptionCapture.CaptureException(error); + DebugUtilities.NotImplemented(error.ToString()); return false; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Globals/GlobalDeclarations.cs index 81e9d4557..b512eaf4a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -44,4 +44,11 @@ global using System.Text; global using System.Threading.Tasks; global using System.Linq; -global using System.Windows.Forms; \ No newline at end of file +global using System.Linq.Expressions; +global using System.Runtime.CompilerServices; +global using System.Threading; +global using System.Windows.Forms; + +global using Krypton.Toolkit.Suite.Extended.Debug.Tools; +global using SkiaSharp; +global using SkiaSharp.Views.Desktop; \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Krypton.Toolkit.Suite.Extended.Data.Visualisation 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Krypton.Toolkit.Suite.Extended.Data.Visualisation 2022.csproj index d7fbb4183..6e84d30a6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Krypton.Toolkit.Suite.Extended.Data.Visualisation 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Krypton.Toolkit.Suite.Extended.Data.Visualisation 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements charts, graphs and other additional data visualisation tools. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements charts, graphs and other additional data visualisation tools. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,80 +69,47 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + - + + + + + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Krypton.Toolkit.Suite.Extended.Data.Visualisation.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Krypton.Toolkit.Suite.Extended.Data.Visualisation.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Krypton.Toolkit.Suite.Extended.Data.Visualisation.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Krypton.Toolkit.Suite.Extended.Data.Visualisation.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/AxisLimits.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/AxisLimits.cs deleted file mode 100644 index 15dd8dbcf..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/AxisLimits.cs +++ /dev/null @@ -1,56 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public struct AxisLimits : IEquatable - { - public readonly double XMin; - public readonly double XMax; - public readonly double YMin; - public readonly double YMax; - public override string ToString() => $"AxisLimits: x=[{XMin}, {XMax}] y=[{YMin}, {YMax}]"; - - public readonly double XSpan; - public readonly double YSpan; - public readonly double XCenter; - public readonly double YCenter; - - public AxisLimits(double xMin, double xMax, double yMin, double yMax) - { - (XMin, XMax, YMin, YMax) = (xMin, xMax, yMin, yMax); - (XSpan, YSpan) = (XMax - XMin, YMax - YMin); - (XCenter, YCenter) = (XMin + XSpan / 2, YMin + YSpan / 2); - } - - public bool Equals(AxisLimits other) => - other.XMin == XMin && - other.XMax == XMax && - other.YMin == YMin && - other.YMax == YMax; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Coordinate.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Coordinate.cs deleted file mode 100644 index 17c789d1a..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Coordinate.cs +++ /dev/null @@ -1,66 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Describes an X/Y position in coordinate space - /// - public class Coordinate - { - public double X; - public double Y; - - public Coordinate(double x, double y) - { - X = x; - Y = y; - } - - /// - /// True as lone as neither coordinate is NaN or Infinity - /// - public bool IsFinite() - { - return - !double.IsNaN(X) && - !double.IsNaN(Y) && - !double.IsInfinity(X) && - !double.IsInfinity(Y); - } - - /// - /// Return the distance to another coordinate (in coordinate units) - /// - public double Distance(Coordinate other) - { - double dX = Math.Abs(other.X - X); - double dY = Math.Abs(other.Y - Y); - return Math.Sqrt(dX * dX + dY * dY); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/DataGen.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/DataGen.cs deleted file mode 100644 index 357771b2b..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/DataGen.cs +++ /dev/null @@ -1,1076 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public static class DataGen - { - /// - /// Generates an array of numbers with constant spacing. - /// - /// The number of points - /// The space between points. Default 1. - /// The first point. Default 0 - /// An array of numbers with constant spacing. - public static double[] Consecutive(int pointCount, double spacing = 1, double offset = 0) - { - double[] ys = new double[pointCount]; - for (int i = 0; i < ys.Length; i++) - { - ys[i] = i * spacing + offset; - } - - return ys; - } - - /// - /// Generates an array of sine values of an input array. - /// - /// The arguments to the sine function. - /// A number to multiply the output by. Default 1. - /// An array of sine values - public static double[] Sin(double[] xs, double mult = 1) - { - double[] ys = new double[xs.Length]; - for (int i = 0; i < xs.Length; i++) - { - ys[i] = Math.Sin(xs[i]) * mult; - } - - return ys; - } - - /// - /// Generates an array of sine values. - /// - /// The number of values to generate. - /// The number of periods. Default 1. - /// The number to increment the output by. Default 0. - /// The number to multiply the output by. Default 1. - /// The fraction of a period to offset by. Default 0. - /// An array of sine values - public static double[] Sin(int pointCount, double oscillations = 1, double offset = 0, double mult = 1, double phase = 0) - { - double sinScale = 2 * Math.PI * oscillations / (pointCount - 1); - double[] ys = new double[pointCount]; - for (int i = 0; i < ys.Length; i++) - { - ys[i] = Math.Sin(i * sinScale + phase * Math.PI * 2) * mult + offset; - } - - return ys; - } - - /// - /// Return data for a sine wave that increases frequency toward the end of an array. - /// This function may be useful for inspecting rendering artifacts when data is displayed at different densities. - /// - /// The number of values to generate. - /// Increasing this value increases maximum frequency. - /// An array of values - public static double[] SinSweep(int pointCount, double density = 50.0) - { - double[] data = new double[pointCount]; - for (int i = 0; i < data.Length; i++) - { - double t = (double)i / pointCount * density; - double tSquared = Math.Pow(t, 2); - data[i] = Math.Sin(tSquared); - } - return data; - } - - /// - /// Generates an array of cosine values of an input array. - /// - /// The arguments to the cosine function. - /// A number to multiply the output by. Default 1. - /// An array of cosine values - public static double[] Cos(double[] xs, double mult = 1) - { - double[] ys = new double[xs.Length]; - for (int i = 0; i < xs.Length; i++) - { - ys[i] = Math.Cos(xs[i]) * mult; - } - - return ys; - } - - /// - /// Generates an array of cosine values. - /// - /// The number of values to generate. - /// The number of periods. Default 1. - /// The number to increment the output by. Default 0. - /// The number to multiply the output by. Default 1. - /// The fraction of a period to offset by. Default 0. - /// An array of cosine values - public static double[] Cos(int pointCount, double oscillations = 1, double offset = 0, double mult = 1, double phase = 0) - { - double sinScale = 2 * Math.PI * oscillations / (pointCount - 1); - double[] ys = new double[pointCount]; - for (int i = 0; i < ys.Length; i++) - { - ys[i] = Math.Cos(i * sinScale + phase * Math.PI * 2) * mult + offset; - } - - return ys; - } - - /// - /// Generates an array of tangent values of an input array. - /// - /// The arguments to the tangent function. - /// A number to multiply the output by. Default 1. - /// An array of tangent values - public static double[] Tan(double[] xs, double mult = 1) - { - double[] ys = new double[xs.Length]; - for (int i = 0; i < xs.Length; i++) - { - ys[i] = Math.Tan(xs[i]) * mult; - } - - return ys; - } - - /// - /// Generates an array of random numbers following a uniform distribution on the interval [offset, multiplier]. - /// - /// The Random object to use. - /// The number of random points to generate. - /// The maximum number above offset that may be generated. - /// The minimum number that may be generated. - /// An array of random numbers. - public static double[] Random(Random rand, int pointCount, double multiplier = 1, double offset = 0) - { - if (rand is null) - { - rand = new Random(); - } - - double[] ys = new double[pointCount]; - for (int i = 0; i < pointCount; i++) - { - ys[i] = rand.NextDouble() * multiplier + offset; - } - - return ys; - } - - /// - /// Generates a 2D array of random numbers between 0 and 1 (uniform distribution) - /// - /// The Random object to use. - /// number of rows (dimension 0) - /// number of columns (dimension 1) - /// Multiply values by this number after generation - /// Add to values after multiplication - /// 2D array filled with random numbers - public static double[,] Random2D(Random rand, int rows, int columns, double multiplier = 1, double offset = 0) - { - if (rand is null) - { - throw new ArgumentNullException(); - } - - double[,] data = new double[rows, columns]; - - for (int y = 0; y < data.GetLength(0); y++) - { - for (int x = 0; x < data.GetLength(1); x++) - { - data[y, x] = rand.NextDouble() * multiplier + offset; - } - } - - return data; - } - - /// - /// Generates an array of random numbers following a uniform distribution on the interval [offset, multiplier]. - /// - /// The Random object to use. - /// The number of random points to generate. - /// The maximum number above offset that may be generated. - /// The minimum number that may be generated. - /// An array of random numbers. - public static int[] RandomInts(Random rand, int pointCount, double multiplier = 1, double offset = 0) - { - if (rand is null) - { - rand = new Random(); - } - - int[] ys = new int[pointCount]; - for (int i = 0; i < pointCount; i++) - { - ys[i] = (int)(rand.NextDouble() * multiplier + offset); - } - - return ys; - } - - /// - /// Generates a single value from a normal distribution. - /// - /// The Random object to use. - /// The mean of the distribution. - /// The standard deviation of the distribution. - /// The maximum distance from the mean to generate, given as a multiple of the standard deviation. - /// A single value from a normal distribution. - public static double RandomNormalValue(Random rand, double mean, double stdDev, double maxSdMultiple = 10) - { - while (true) - { - double u1 = 1.0 - rand.NextDouble(); - double u2 = 1.0 - rand.NextDouble(); - double randStdNormal = Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.PI * u2); - if (Math.Abs(randStdNormal) < maxSdMultiple) - { - return mean + stdDev * randStdNormal; - } - } - } - - /// - /// Generates an array of values from a normal distribution. - /// - /// The number to seed the random number generator with. - /// The number of points to generate. - /// The mean of the distribution. - /// The standard deviation of the distribution. - /// The maximum distance from the mean to generate, given as a multiple of the standard deviation. - /// An array of values from a normal distribution. - public static double[] RandomNormal(int seed, int pointCount, double mean = .5, double stdDev = .5, double maxSdMultiple = 10) => - RandomNormal(new Random(seed), pointCount, mean, stdDev, maxSdMultiple); - - /// - /// Generates an array of values from a normal distribution. - /// - /// The Random object to use. - /// The number of points to generate. - /// The mean of the distribution. - /// The standard deviation of the distribution. - /// The maximum distance from the mean to generate, given as a multiple of the standard deviation. - /// An array of values from a normal distribution. - public static double[] RandomNormal(Random rand, int pointCount, double mean = .5, double stdDev = .5, double maxSdMultiple = 10) - { - if (rand == null) - { - rand = new Random(0); - } - - double[] values = new double[pointCount]; - for (int i = 0; i < values.Length; i++) - { - values[i] = RandomNormalValue(rand, mean, stdDev, maxSdMultiple); - } - - return values; - } - - /// - /// Generates an array of data with normally distributed residuals about a line. - /// - /// The Random object to use. - /// The number of points to generate. Default 100. - /// The slope of the line. Default 1. - /// The y-intercept of the line. Default 0. - /// The standard deviation of the residuals. Default 0.1 - /// An array of approximately linear data. - public static double[] NoisyLinear(Random rand, int pointCount = 100, double slope = 1, double offset = 0, double noise = 0.1) - { - if (rand is null) - { - rand = new Random(0); - } - - double[] data = new double[pointCount]; - for (int i = 0; i < data.Length; i++) - { - data[i] = slope * i + offset + RandomNormalValue(rand, 0, noise); - } - - return data; - } - - /// - /// Generates an array of data with uniformally distributed residuals about a sinusoidal curve. - /// - /// The Random object to use. - /// The number of points to generate. - /// The number of periods. Default 1. - /// Twice the maximum residual, in units of mult. Default 0.5 - /// The number to multiply the residuals by. Default 1. - /// An array of approximately sinusoidal data. - public static double[] NoisySin(Random rand, int pointCount, double oscillations = 1, double noiseLevel = .5, double mult = 1) - { - if (rand is null) - { - rand = new Random(0); - } - - double[] values = Sin(pointCount, oscillations); - for (int i = 0; i < values.Length; i++) - { - values[i] += (rand.NextDouble() - .5) * noiseLevel * mult; - } - - return values; - } - - /// - /// Generates a random color. - /// - /// The Random object to use. - /// The min of each component. Default 0. - /// The max of each component. Default 255. - /// A random color. - public static Color RandomColor(Random rand, int min = 0, int max = 255) - { - if (rand is null) - { - rand = new Random(); - } - - int r = rand.Next(min, max); - int g = rand.Next(min, max); - int b = rand.Next(min, max); - return Color.FromArgb(r, g, b); - } - - /// - /// Return the cumulative sum of a random set of numbers using a fixed seed - /// - /// The number of points to generate. - /// The max difference between points in the walk. Default 1. - /// The first point in the walk. Default 0. - /// The cumulative sum of a random set of numbers. - public static double[] RandomWalk(int pointCount, double mult = 1, double offset = 0) => - RandomWalk(new Random(0), pointCount, mult, offset); - - /// - /// Return the cumulative sum of a random set of numbers. - /// - /// The random object to use. - /// The number of points to generate. - /// The max difference between points in the walk. Default 1. - /// The first point in the walk. Default 0. - /// The cumulative sum of a random set of numbers. - public static double[] RandomWalk(Random rand, int pointCount, double mult = 1, double offset = 0) - { - if (rand is null) - { - rand = new Random(0); - } - - var data = new double[pointCount]; - data[0] = offset; - for (int i = 1; i < data.Length; i++) - { - data[i] = data[i - 1] + (rand.NextDouble() * 2 - 1) * mult; - } - - return data; - } - - /// - /// Generate unevenly-spaced X/Y points. - /// X values walk upward (by values from 0 to 1) - /// Y values walk randomly (by values from -1 to 1) - /// - public static (double[] xs, double[] ys) RandomWalk2D(Random rand, int pointCount) - { - double[] ys = new double[pointCount]; - double[] xs = new double[pointCount]; - for (int i = 1; i < ys.Length; i++) - { - ys[i] = ys[i - 1] + (rand.NextDouble() - .5) * 2; - xs[i] = xs[i - 1] + rand.NextDouble(); - } - return (xs, ys); - } - - /// - /// Return OHLC array with random prices X positions as DateTime.ToOATime() values using the given time delta - /// - /// The random object to use. - /// The number of prices to generate. - /// The difference in time between prices. - /// The max difference between base prices around which that day's prices independently vary. Default 10. - /// The initial base price. Default 123.45 - /// OHLC array with random prices - public static OHLC[] RandomStockPrices(Random rand, int pointCount, TimeSpan delta, double mult = 10, double startingPrice = 123.45) - { - OHLC[] ohlcs = RandomStockPrices(rand, pointCount, mult, startingPrice); - - DateTime dt = new DateTime(1985, 9, 24, 9, 30, 0); - - for (int i = 0; i < ohlcs.Length; i++) - { - dt = dt + delta; - - while ((dt.DayOfWeek == DayOfWeek.Saturday) || (dt.DayOfWeek == DayOfWeek.Sunday)) - dt = dt + TimeSpan.FromDays(1); - - ohlcs[i].DateTime = dt; - ohlcs[i].TimeSpan = delta; - } - - return ohlcs; - } - - /// - /// Return OHLC array with random prices X positions as sequential numbers (0, 1, 2, etc.) - /// - /// The random object to use. - /// The number of prices to generate. - /// The max difference between base prices around which that day's prices independently vary. Default 10. - /// The initial base price. Default 123.45 - /// OHLC array with random prices - private static OHLC[] RandomStockPrices(Random rand, int pointCount, double mult = 10, double startingPrice = 123.45) - { - if (rand is null) - { - rand = new Random(0); - } - - double[] basePrices = RandomWalk(rand, pointCount, mult, startingPrice); - - OHLC[] ohlcs = new OHLC[pointCount]; - for (int i = 0; i < ohlcs.Length; i++) - { - double basePrice = basePrices[i]; - double open = rand.NextDouble() * 10 + 50; - double close = rand.NextDouble() * 10 + 50; - double high = Math.Max(open, close) + rand.NextDouble() * 10; - double low = Math.Min(open, close) - rand.NextDouble() * 10; - - open += basePrice; - close += basePrice; - high += basePrice; - low += basePrice; - - ohlcs[i] = new OHLC(open, high, low, close, i); - } - - return ohlcs; - } - - /// - /// Return OHLC array with random prices X positions as sequential numbers (0, 1, 2, etc.) - /// - /// The random object to use. - /// The number of prices to generate. - /// The max difference between base prices around which that day's prices independently vary. Default 10. - /// The initial base price. Default 123.45 - /// The minutes between prices. Cumulative with deltaDays. Default 0. - /// The days between prices. Cumulative with deltaMinutes. Default 1. - /// Whether to use TimeSpan or integer x axis. - /// OHLC array with random prices - public static OHLC[] RandomStockPrices(Random rand, int pointCount, double mult = 10, double startingPrice = 123.45, int deltaMinutes = 0, int deltaDays = 1, bool sequential = true) - { - TimeSpan ts = TimeSpan.FromMinutes(deltaMinutes) + TimeSpan.FromDays(deltaDays); - if (sequential) - { - return RandomStockPrices(rand, pointCount, mult, startingPrice); - } - else - { - return RandomStockPrices(rand, pointCount, ts, mult, startingPrice); - } - } - - /// - /// Generates a random span. - /// - /// The random object to use. - /// The minimum of the span. Default 0. - /// Tge naximum of the span. Default 100. - /// The minimum length of the span. Default 10. - /// A random span. - public static (double, double) RandomSpan(Random rand = null, double low = 0, double high = 100, double minimumSpacing = 10) - { - if (rand is null) - { - rand = new Random(); - } - - double span = Math.Abs(high - low); - - for (int attempts = 0; attempts < 10_000; attempts++) - { - double valA = rand.NextDouble() * span + low; - double valB = rand.NextDouble() * span + low; - if (Math.Abs(valA - valB) >= minimumSpacing) - { - if (valA < valB) - { - return (valA, valB); - } - else - { - return (valB, valA); - } - } - } - - throw new ArgumentException(); - } - - /// - /// Generates a range of values starting at 0 and separated by 1. - /// - /// The end of the range. - /// A range of values. - public static double[] Range(int stop) - { - return Range(0, stop, 1); - } - - /// - /// Generates a range of values separated by 1. - /// - /// The start of the range. - /// The end of the range. - /// A range of values. - public static double[] Range(int start, int stop) - { - return Range(start, stop, 1); - } - - /// - /// Generates a range of values. - /// - /// The start of the range. - /// The end of the range. - /// The space between values. - /// Indicates whether to include the stop point in the range. Default false. - /// A range of values. - public static double[] Range(double start, double stop, double step, bool includeStop = false) - { - if (step <= 0) - { - throw new ArgumentException("step must be >0. To make a descending series make stop < start."); - } - - double valueSpan = Math.Abs(start - stop); - int valueCount = (int)(valueSpan / step); - double stepSize = (stop > start) ? step : -step; - if (includeStop) - { - valueCount += 1; - } - - double[] values = new double[valueCount]; - - for (int i = 0; i < valueCount; i++) - { - values[i] = start + i * stepSize; - } - - return values; - } - - /// - /// Generates an array of zeros - /// - /// The number of zeroes to generate - /// An array of zeros - public static double[] Zeros(int pointCount) - { - double[] values = new double[pointCount]; - return values; - } - - /// - /// Generates an array of ones - /// - /// The number of ones to generate - /// An array of ones - public static double[] Ones(int pointCount) - { - double[] values = new double[pointCount]; - for (int i = 0; i < pointCount; i++) - { - values[i] = 1; - } - - return values; - } - - /// - /// Generates a Bitmap from data on the range [0, 255] - /// - /// The data to use. - /// The colormap to use. - /// A Bitmap - public static Bitmap BitmapFrom2dArray(double[,] data, ColourMap cmap) - { - int width = data.GetLength(1); - int height = data.GetLength(0); - - Bitmap bmp = new Bitmap(width, height, PixelFormat.Format8bppIndexed); - Rectangle rect = new Rectangle(0, 0, width, height); - BitmapData bmpData = bmp.LockBits(rect, ImageLockMode.ReadWrite, bmp.PixelFormat); - - byte[] bytes = new byte[bmpData.Stride * height]; - for (int y = 0; y < height; y++) - { - for (int x = 0; x < width; x++) - { - bytes[y * bmpData.Stride + x] = (byte)data[y, x]; - } - } - - Marshal.Copy(bytes, 0, bmpData.Scan0, bytes.Length); - bmp.UnlockBits(bmpData); - - cmap.Apply(bmp); - Bitmap bmp2 = new Bitmap(width, height, PixelFormat.Format32bppPArgb); - - using (Graphics gfx = Graphics.FromImage(bmp2)) - { - gfx.DrawImage(bmp, 0, 0); - } - return bmp2; - } - - /// - /// Generates a sample Bitmap. - /// - /// A sample Bitmap - public static Bitmap SampleImage() => BitmapFrom2dArray(SampleImageData(), ColourMap.Viridis); - - /// - /// Returns a sample 2D array of grayscale values. - /// - /// 2D array of grayscale values. - public static double[,] SampleImageData() - { - double[,] imageData = { - { 95, 113, 117, 118, 120, 126, 135, 125, 120, 117, 120, 122, 124, 125, 118, 114, 113, 109, 108, 111, 113, 114, 113, 116, 114, 111, 113, 114, 111, 108, 111, 114, 116, 118, 114, 112, 116, 120, 116, 113, 109, 111, 108, 105, 104, 104, 108, 108, 109, 108, 107, 107, 108, 111, 111, 111, 111, 117, 116, 116, 117, 114, 112, 107, 100 }, - { 99, 117, 121, 122, 120, 125, 133, 125, 114, 117, 122, 125, 126, 129, 121, 117, 117, 111, 112, 112, 113, 114, 118, 122, 122, 118, 116, 116, 114, 112, 113, 116, 122, 124, 121, 120, 120, 121, 117, 116, 118, 117, 116, 117, 113, 111, 111, 113, 117, 118, 120, 116, 117, 116, 112, 116, 118, 118, 120, 118, 121, 124, 121, 122, 117}, - { 100, 116, 126, 126, 124, 128, 125, 125, 124, 126, 130, 133, 126, 121, 121, 121, 116, 111, 114, 113, 112, 112, 118, 121, 121, 121, 120, 113, 113, 114, 116, 118, 120, 118, 117, 121, 122, 125, 125, 125, 128, 124, 125, 124, 116, 117, 117, 118, 121, 122, 122, 117, 121, 116, 116, 117, 126, 121, 120, 121, 124, 121, 114, 114, 107}, - { 103, 121, 134, 134, 133, 133, 131, 130, 128, 128, 130, 130, 125, 125, 126, 118, 116, 116, 116, 116, 116, 117, 120, 122, 126, 129, 124, 121, 121, 121, 120, 120, 126, 125, 124, 125, 126, 125, 125, 130, 134, 134, 134, 134, 126, 129, 129, 125, 124, 125, 125, 125, 124, 124, 125, 131, 137, 131, 128, 129, 129, 128, 124, 114, 101}, - { 107, 131, 137, 137, 143, 142, 137, 134, 135, 142, 141, 138, 137, 138, 134, 126, 124, 118, 120, 122, 121, 126, 126, 129, 129, 129, 124, 125, 128, 133, 131, 133, 134, 133, 131, 125, 125, 128, 126, 130, 133, 133, 138, 137, 137, 134, 133, 128, 129, 133, 135, 130, 129, 129, 134, 139, 143, 138, 130, 128, 128, 131, 125, 120, 107}, - { 108, 133, 134, 141, 142, 139, 141, 144, 146, 152, 152, 150, 141, 135, 133, 129, 134, 129, 129, 130, 126, 129, 126, 135, 135, 131, 129, 130, 134, 137, 141, 144, 147, 151, 143, 137, 137, 133, 129, 130, 133, 138, 148, 144, 141, 137, 135, 131, 137, 139, 138, 133, 134, 134, 141, 142, 141, 138, 135, 133, 129, 129, 124, 120, 108}, - { 113, 133, 138, 139, 138, 142, 139, 144, 154, 154, 151, 152, 151, 146, 144, 141, 138, 135, 135, 134, 133, 134, 135, 141, 137, 138, 138, 141, 141, 141, 147, 143, 148, 152, 155, 151, 146, 139, 138, 137, 141, 148, 155, 150, 146, 141, 138, 138, 143, 141, 141, 138, 141, 138, 141, 143, 138, 137, 137, 135, 130, 129, 128, 122, 111}, - { 121, 134, 139, 141, 143, 148, 150, 155, 158, 154, 150, 151, 154, 154, 155, 148, 142, 142, 142, 138, 134, 138, 141, 139, 141, 147, 147, 146, 147, 150, 148, 143, 146, 146, 150, 150, 147, 143, 141, 144, 150, 151, 154, 151, 146, 141, 138, 137, 141, 139, 139, 141, 144, 139, 142, 146, 141, 142, 144, 138, 131, 129, 130, 128, 118}, - { 126, 139, 147, 154, 158, 156, 155, 159, 156, 152, 151, 154, 152, 150, 148, 150, 150, 151, 143, 142, 138, 139, 139, 143, 150, 155, 154, 150, 142, 122, 103, 84, 79, 83, 95, 111, 126, 137, 141, 143, 147, 150, 148, 150, 147, 139, 138, 135, 141, 143, 139, 141, 144, 144, 143, 150, 143, 146, 151, 142, 134, 128, 130, 126, 124}, - { 128, 141, 152, 160, 168, 158, 151, 155, 158, 155, 155, 154, 150, 151, 154, 158, 158, 155, 150, 143, 143, 142, 143, 148, 158, 154, 143, 105, 65, 54, 37, 28, 27, 32, 36, 44, 56, 77, 112, 137, 148, 152, 155, 152, 150, 141, 141, 138, 139, 144, 144, 146, 148, 146, 148, 152, 148, 151, 155, 148, 139, 131, 131, 130, 122}, - { 126, 147, 151, 158, 160, 151, 152, 160, 163, 159, 159, 156, 155, 156, 160, 164, 161, 156, 156, 154, 155, 150, 152, 158, 155, 133, 75, 37, 45, 67, 37, 24, 19, 18, 19, 23, 36, 43, 40, 82, 138, 152, 158, 155, 148, 143, 144, 144, 144, 151, 152, 156, 156, 148, 150, 152, 151, 152, 155, 148, 143, 138, 137, 133, 125}, - { 125, 144, 151, 155, 159, 160, 161, 169, 172, 164, 163, 163, 163, 164, 167, 164, 159, 152, 155, 159, 158, 158, 163, 164, 138, 75, 45, 52, 67, 73, 45, 37, 27, 23, 22, 16, 14, 23, 27, 23, 71, 141, 158, 161, 160, 155, 148, 146, 148, 158, 159, 163, 164, 156, 155, 155, 152, 151, 151, 150, 144, 146, 139, 135, 122}, - { 121, 150, 168, 169, 169, 168, 172, 171, 173, 172, 172, 164, 167, 169, 169, 169, 164, 156, 156, 161, 161, 165, 169, 161, 87, 41, 56, 78, 103, 96, 70, 54, 35, 26, 26, 19, 15, 14, 15, 19, 22, 83, 152, 167, 165, 158, 148, 151, 151, 156, 161, 161, 161, 161, 165, 163, 158, 156, 151, 150, 143, 147, 139, 135, 128}, - { 118, 151, 173, 180, 177, 173, 182, 175, 173, 172, 167, 165, 167, 173, 176, 172, 165, 161, 159, 164, 168, 177, 175, 131, 56, 83, 128, 159, 172, 167, 146, 124, 97, 58, 36, 27, 18, 16, 15, 16, 15, 26, 112, 163, 167, 169, 164, 161, 158, 161, 164, 164, 165, 167, 172, 164, 160, 159, 151, 151, 147, 144, 139, 137, 130}, - { 118, 147, 165, 177, 176, 176, 181, 177, 175, 175, 172, 171, 175, 178, 176, 173, 167, 165, 164, 171, 181, 182, 159, 80, 82, 143, 186, 205, 207, 205, 190, 169, 142, 101, 70, 44, 23, 18, 14, 15, 18, 16, 48, 146, 173, 175, 171, 171, 167, 168, 169, 171, 172, 167, 167, 165, 161, 160, 156, 154, 148, 148, 142, 139, 129}, - { 133, 154, 167, 168, 168, 180, 182, 188, 186, 185, 180, 180, 176, 181, 178, 175, 176, 175, 169, 177, 185, 177, 112, 50, 118, 186, 214, 216, 218, 215, 208, 192, 167, 129, 88, 57, 35, 22, 14, 14, 18, 18, 22, 105, 177, 173, 172, 169, 175, 175, 175, 176, 173, 168, 171, 176, 173, 171, 167, 158, 152, 150, 142, 143, 138}, - { 142, 164, 180, 173, 173, 181, 190, 199, 197, 194, 188, 186, 185, 184, 181, 180, 186, 180, 173, 188, 198, 167, 65, 50, 135, 193, 214, 212, 214, 214, 208, 195, 173, 137, 96, 67, 44, 26, 23, 15, 13, 14, 14, 54, 161, 168, 164, 171, 172, 172, 177, 178, 175, 168, 172, 177, 181, 178, 171, 163, 158, 150, 143, 148, 144}, - { 139, 164, 182, 178, 168, 171, 193, 199, 201, 202, 199, 201, 194, 185, 178, 181, 185, 176, 171, 188, 189, 130, 53, 60, 141, 189, 203, 202, 203, 206, 201, 186, 159, 135, 111, 86, 61, 37, 22, 15, 14, 10, 10, 27, 125, 143, 152, 159, 151, 158, 168, 164, 168, 171, 171, 172, 176, 180, 173, 168, 163, 152, 147, 152, 144}, - { 118, 144, 163, 161, 144, 150, 182, 194, 201, 197, 185, 197, 197, 192, 181, 182, 189, 177, 181, 192, 158, 87, 39, 78, 148, 188, 199, 203, 203, 202, 201, 186, 163, 147, 133, 114, 94, 60, 26, 19, 15, 11, 10, 14, 78, 113, 130, 131, 131, 150, 158, 155, 154, 165, 168, 175, 173, 175, 172, 165, 163, 155, 144, 147, 143}, - { 94, 114, 117, 131, 122, 126, 161, 177, 178, 161, 156, 169, 193, 195, 194, 192, 195, 192, 198, 192, 131, 65, 32, 92, 160, 186, 194, 203, 206, 203, 197, 182, 172, 163, 147, 133, 108, 65, 28, 16, 11, 13, 10, 10, 58, 94, 101, 101, 112, 139, 141, 143, 137, 163, 173, 178, 175, 171, 171, 168, 163, 151, 134, 139, 137}, - { 79, 94, 87, 105, 117, 114, 128, 141, 141, 139, 130, 133, 150, 163, 190, 199, 198, 198, 203, 184, 111, 53, 27, 90, 156, 165, 167, 190, 199, 188, 146, 129, 134, 138, 129, 112, 91, 56, 22, 13, 9, 11, 13, 10, 45, 75, 82, 99, 111, 114, 118, 126, 117, 148, 168, 175, 171, 172, 180, 177, 155, 138, 121, 121, 101}, - { 49, 73, 77, 95, 111, 112, 121, 116, 109, 113, 105, 108, 108, 120, 139, 185, 193, 198, 195, 158, 90, 56, 30, 65, 101, 104, 100, 144, 178, 133, 73, 86, 99, 82, 66, 61, 65, 53, 23, 15, 10, 9, 13, 13, 33, 60, 70, 80, 99, 101, 108, 113, 105, 126, 156, 173, 176, 175, 186, 181, 159, 143, 130, 112, 96}, - { 40, 69, 82, 94, 100, 104, 109, 100, 96, 97, 87, 87, 99, 118, 114, 176, 193, 186, 181, 141, 75, 52, 32, 50, 65, 79, 56, 113, 172, 100, 75, 118, 78, 50, 49, 61, 91, 70, 33, 22, 15, 7, 11, 11, 26, 60, 61, 64, 82, 91, 97, 80, 82, 111, 147, 175, 176, 169, 175, 163, 147, 135, 124, 112, 116}, - { 41, 71, 90, 99, 97, 107, 97, 95, 97, 95, 74, 82, 92, 104, 111, 163, 148, 114, 133, 131, 67, 47, 26, 90, 125, 131, 104, 143, 180, 105, 109, 154, 133, 105, 112, 143, 131, 82, 32, 16, 14, 10, 11, 13, 22, 53, 57, 61, 71, 78, 77, 73, 77, 94, 141, 176, 177, 172, 168, 155, 141, 131, 111, 109, 111}, - { 44, 71, 84, 97, 94, 99, 94, 87, 88, 83, 71, 77, 77, 80, 80, 108, 97, 86, 79, 99, 65, 39, 22, 117, 173, 169, 164, 175, 178, 125, 137, 173, 173, 172, 172, 160, 126, 73, 24, 10, 10, 9, 10, 15, 16, 43, 52, 62, 77, 82, 74, 69, 73, 83, 122, 165, 167, 164, 154, 147, 143, 133, 112, 108, 100}, - { 50, 64, 75, 78, 84, 88, 78, 75, 78, 67, 71, 71, 60, 65, 57, 65, 71, 75, 54, 69, 60, 33, 19, 105, 173, 192, 192, 185, 184, 137, 150, 190, 199, 197, 181, 143, 105, 58, 20, 10, 10, 10, 10, 14, 15, 45, 64, 66, 74, 74, 69, 62, 62, 67, 99, 143, 154, 154, 147, 143, 143, 129, 118, 112, 87}, - { 50, 43, 57, 64, 64, 69, 66, 70, 82, 70, 69, 62, 53, 53, 53, 56, 58, 57, 44, 48, 45, 40, 26, 86, 176, 192, 186, 186, 184, 134, 141, 178, 189, 185, 163, 120, 84, 45, 18, 13, 11, 11, 9, 13, 18, 47, 71, 86, 99, 97, 96, 96, 96, 100, 105, 122, 134, 134, 129, 121, 113, 107, 107, 99, 75}, - { 39, 33, 47, 61, 58, 61, 64, 69, 82, 79, 74, 66, 56, 54, 58, 53, 49, 41, 31, 30, 33, 39, 23, 66, 156, 184, 173, 178, 172, 121, 126, 175, 181, 167, 137, 100, 70, 37, 16, 15, 13, 11, 7, 10, 16, 28, 39, 49, 65, 73, 77, 79, 83, 96, 105, 116, 120, 114, 99, 91, 73, 75, 92, 73, 49}, - { 31, 31, 40, 58, 61, 56, 62, 60, 61, 67, 75, 71, 64, 60, 58, 53, 50, 40, 28, 24, 27, 32, 19, 43, 121, 159, 168, 146, 103, 58, 86, 171, 171, 144, 114, 84, 58, 35, 19, 13, 10, 9, 7, 11, 15, 19, 27, 35, 40, 45, 52, 50, 50, 54, 67, 80, 77, 75, 69, 71, 53, 45, 44, 35, 28}, - { 24, 28, 35, 52, 60, 57, 61, 57, 58, 54, 66, 67, 57, 56, 57, 53, 48, 37, 33, 28, 24, 23, 19, 31, 97, 131, 171, 168, 82, 58, 97, 137, 135, 128, 104, 80, 60, 33, 19, 13, 10, 7, 11, 15, 16, 22, 30, 35, 41, 45, 47, 41, 43, 47, 49, 49, 50, 56, 60, 62, 52, 41, 40, 30, 27}, - { 24, 31, 35, 52, 61, 57, 54, 54, 60, 54, 60, 57, 53, 53, 53, 49, 43, 36, 33, 31, 23, 30, 28, 23, 87, 126, 126, 142, 120, 86, 83, 90, 122, 126, 105, 80, 57, 32, 16, 13, 10, 7, 9, 11, 16, 26, 36, 40, 47, 48, 49, 43, 40, 40, 41, 45, 56, 65, 70, 61, 50, 36, 32, 28, 26}, - { 27, 30, 41, 57, 60, 54, 53, 57, 62, 57, 52, 48, 47, 48, 43, 43, 41, 39, 40, 37, 31, 36, 24, 16, 58, 125, 154, 159, 131, 101, 88, 113, 129, 122, 97, 73, 49, 28, 18, 14, 13, 10, 7, 9, 15, 22, 37, 43, 47, 47, 47, 43, 41, 43, 47, 53, 64, 67, 62, 54, 40, 35, 33, 28, 22}, - { 24, 28, 43, 49, 49, 48, 50, 52, 49, 47, 44, 45, 44, 44, 47, 47, 49, 50, 50, 44, 37, 31, 22, 18, 23, 75, 135, 160, 134, 113, 108, 108, 112, 100, 77, 60, 44, 28, 16, 15, 13, 9, 7, 9, 13, 24, 43, 44, 43, 47, 45, 44, 41, 41, 45, 48, 52, 47, 40, 43, 44, 45, 37, 28, 27}, - { 23, 28, 33, 39, 45, 49, 53, 49, 43, 44, 45, 45, 48, 54, 57, 58, 60, 60, 62, 54, 45, 28, 24, 24, 16, 20, 78, 161, 193, 172, 129, 108, 94, 73, 56, 49, 36, 23, 18, 16, 11, 7, 7, 7, 13, 23, 45, 48, 44, 50, 54, 54, 44, 41, 47, 48, 48, 44, 44, 52, 50, 50, 39, 24, 23}, - { 20, 28, 27, 28, 27, 41, 53, 50, 43, 44, 40, 43, 43, 49, 48, 52, 54, 57, 61, 57, 41, 33, 33, 33, 22, 10, 20, 91, 150, 138, 107, 78, 58, 49, 44, 37, 26, 19, 18, 16, 14, 11, 10, 9, 14, 22, 36, 49, 52, 58, 61, 54, 45, 49, 49, 54, 53, 47, 47, 52, 45, 41, 30, 22, 23}, - { 22, 28, 36, 36, 28, 36, 50, 52, 49, 43, 36, 40, 43, 52, 52, 60, 67, 80, 87, 66, 37, 36, 26, 23, 15, 9, 7, 19, 52, 60, 52, 44, 39, 33, 28, 23, 27, 24, 19, 19, 16, 15, 11, 9, 13, 16, 27, 40, 40, 43, 48, 47, 43, 47, 45, 45, 45, 37, 37, 44, 43, 50, 43, 30, 22}, - { 22, 27, 32, 22, 32, 33, 48, 54, 54, 54, 54, 58, 64, 71, 74, 84, 88, 95, 94, 75, 39, 27, 22, 24, 18, 9, 6, 6, 10, 35, 31, 26, 22, 20, 26, 33, 37, 37, 35, 23, 16, 11, 10, 10, 14, 13, 20, 33, 36, 41, 48, 48, 41, 39, 39, 40, 32, 28, 30, 35, 43, 40, 35, 35, 22}, - { 22, 23, 22, 16, 33, 30, 40, 54, 58, 61, 66, 73, 75, 84, 88, 99, 103, 100, 91, 77, 45, 26, 26, 24, 20, 11, 10, 7, 13, 69, 74, 54, 37, 36, 44, 52, 60, 61, 49, 28, 19, 11, 10, 13, 22, 16, 26, 39, 43, 44, 52, 54, 47, 43, 41, 40, 31, 31, 39, 40, 40, 35, 24, 31, 27}, - { 23, 24, 27, 22, 23, 33, 48, 53, 71, 78, 80, 84, 86, 92, 90, 94, 99, 95, 90, 73, 50, 28, 27, 24, 20, 13, 11, 9, 11, 80, 116, 94, 71, 62, 64, 70, 82, 83, 65, 39, 23, 15, 11, 13, 22, 18, 23, 37, 47, 61, 73, 62, 65, 60, 60, 61, 60, 62, 71, 77, 66, 44, 32, 37, 31}, - { 26, 32, 39, 44, 48, 58, 61, 67, 77, 69, 70, 70, 64, 78, 84, 83, 87, 86, 79, 58, 43, 26, 24, 20, 16, 14, 14, 11, 14, 70, 128, 122, 105, 91, 91, 95, 105, 104, 86, 50, 31, 19, 15, 19, 27, 15, 14, 27, 36, 49, 54, 58, 70, 77, 79, 71, 86, 94, 91, 86, 66, 58, 39, 28, 30}, - { 27, 44, 54, 62, 67, 78, 80, 84, 82, 67, 52, 50, 52, 40, 53, 62, 53, 57, 43, 37, 23, 15, 15, 14, 14, 14, 14, 19, 44, 91, 126, 135, 126, 118, 117, 121, 125, 122, 101, 64, 33, 27, 26, 27, 33, 13, 10, 11, 11, 19, 28, 27, 49, 50, 32, 60, 101, 107, 90, 74, 67, 62, 32, 16, 14}, - { 28, 49, 60, 62, 64, 77, 71, 74, 77, 61, 52, 54, 64, 32, 22, 26, 24, 28, 18, 18, 15, 14, 15, 14, 13, 16, 31, 67, 113, 142, 148, 150, 141, 139, 142, 146, 143, 141, 121, 79, 41, 35, 41, 35, 33, 13, 10, 10, 13, 18, 24, 26, 30, 28, 26, 45, 91, 103, 79, 69, 69, 64, 32, 11, 15}, - { 23, 40, 58, 54, 44, 56, 66, 73, 64, 48, 54, 57, 54, 30, 18, 15, 14, 24, 23, 11, 10, 15, 16, 18, 19, 50, 96, 126, 159, 176, 175, 169, 161, 163, 169, 171, 164, 154, 137, 94, 53, 40, 50, 43, 32, 15, 14, 13, 18, 30, 40, 53, 73, 82, 87, 95, 109, 97, 65, 62, 61, 53, 27, 15, 22}, - { 27, 36, 43, 41, 35, 57, 69, 66, 60, 56, 66, 71, 54, 22, 23, 27, 9, 26, 22, 14, 14, 16, 16, 19, 48, 114, 152, 175, 188, 190, 192, 186, 182, 186, 190, 185, 175, 159, 133, 86, 49, 49, 62, 45, 27, 16, 18, 15, 15, 26, 41, 56, 90, 124, 121, 104, 94, 83, 75, 69, 58, 47, 37, 31, 23}, - { 28, 44, 40, 37, 36, 64, 69, 67, 67, 75, 84, 71, 50, 24, 32, 35, 11, 23, 26, 18, 15, 19, 19, 37, 87, 158, 182, 195, 203, 203, 206, 199, 192, 194, 197, 190, 178, 160, 138, 91, 62, 53, 58, 39, 19, 15, 20, 19, 22, 20, 27, 32, 60, 104, 109, 108, 96, 94, 86, 77, 71, 79, 64, 41, 22}, - { 26, 43, 47, 58, 49, 69, 78, 79, 75, 82, 77, 61, 49, 39, 37, 44, 26, 33, 32, 15, 14, 22, 36, 64, 125, 182, 195, 205, 214, 211, 205, 199, 197, 201, 203, 194, 184, 165, 137, 96, 67, 54, 56, 33, 14, 15, 22, 33, 31, 24, 22, 28, 49, 73, 86, 95, 96, 97, 86, 87, 90, 86, 60, 44, 24}, - { 27, 47, 47, 64, 48, 61, 99, 97, 94, 95, 82, 70, 53, 48, 50, 52, 40, 33, 19, 10, 13, 37, 67, 91, 151, 194, 207, 211, 212, 210, 205, 202, 201, 207, 205, 194, 184, 167, 134, 83, 61, 53, 53, 28, 13, 19, 41, 62, 53, 44, 26, 19, 37, 52, 73, 88, 94, 96, 83, 96, 91, 87, 82, 67, 26}, - { 32, 37, 40, 53, 37, 47, 74, 97, 114, 107, 94, 88, 64, 54, 61, 57, 32, 15, 11, 13, 18, 66, 103, 120, 175, 201, 208, 215, 215, 212, 207, 206, 203, 208, 205, 192, 178, 165, 133, 92, 74, 56, 50, 32, 35, 53, 69, 74, 65, 52, 33, 15, 16, 31, 49, 62, 78, 96, 101, 107, 117, 122, 121, 96, 50}, - { 31, 44, 47, 45, 36, 47, 52, 47, 73, 103, 99, 87, 77, 61, 60, 43, 16, 13, 15, 13, 30, 94, 133, 163, 194, 206, 208, 212, 212, 215, 216, 214, 208, 208, 205, 198, 186, 167, 134, 92, 70, 52, 58, 71, 84, 92, 96, 95, 83, 65, 45, 20, 15, 10, 16, 27, 32, 50, 64, 60, 69, 79, 84, 71, 61}, - { 37, 52, 60, 67, 60, 56, 52, 40, 48, 66, 91, 86, 90, 86, 57, 19, 11, 15, 16, 14, 48, 118, 163, 189, 202, 210, 210, 211, 212, 215, 222, 219, 215, 212, 211, 205, 186, 163, 128, 95, 78, 70, 78, 90, 108, 114, 99, 83, 62, 45, 28, 14, 10, 9, 7, 11, 24, 26, 24, 27, 40, 60, 75, 80, 66}, - { 32, 50, 60, 66, 57, 57, 62, 56, 53, 64, 73, 67, 87, 101, 41, 11, 13, 16, 15, 18, 50, 116, 185, 205, 210, 207, 205, 205, 210, 220, 224, 227, 222, 216, 215, 210, 192, 164, 131, 104, 83, 84, 103, 100, 80, 57, 43, 33, 23, 18, 13, 10, 6, 7, 9, 6, 18, 26, 22, 19, 23, 52, 86, 109, 80}, - { 35, 49, 49, 52, 57, 67, 77, 67, 71, 82, 87, 95, 96, 69, 20, 13, 14, 20, 16, 27, 53, 83, 152, 192, 207, 206, 194, 198, 211, 223, 228, 228, 225, 222, 219, 211, 194, 159, 125, 91, 80, 79, 60, 39, 31, 30, 23, 15, 11, 9, 6, 6, 6, 6, 6, 6, 7, 22, 23, 23, 22, 27, 41, 61, 48}, - { 31, 50, 57, 73, 80, 92, 96, 83, 91, 103, 101, 88, 53, 23, 15, 13, 18, 24, 23, 37, 60, 75, 92, 111, 150, 169, 168, 197, 216, 219, 222, 222, 220, 218, 208, 198, 163, 116, 88, 67, 47, 33, 27, 24, 18, 13, 11, 10, 6, 6, 5, 5, 6, 6, 5, 7, 7, 18, 36, 36, 32, 27, 32, 28, 20}, - { 26, 52, 69, 83, 95, 87, 79, 79, 83, 77, 70, 50, 19, 18, 15, 13, 22, 20, 35, 50, 64, 64, 71, 77, 84, 86, 103, 137, 168, 185, 194, 202, 206, 201, 185, 148, 100, 75, 66, 40, 28, 24, 20, 14, 10, 15, 15, 16, 10, 6, 5, 5, 6, 6, 6, 7, 9, 10, 35, 45, 50, 37, 31, 31, 14}, - { 23, 52, 71, 78, 90, 86, 75, 80, 86, 79, 65, 30, 16, 19, 15, 14, 18, 20, 44, 60, 61, 56, 52, 64, 65, 73, 78, 83, 88, 97, 105, 112, 121, 124, 108, 84, 67, 53, 48, 28, 19, 13, 13, 23, 31, 35, 24, 20, 13, 5, 5, 5, 6, 6, 5, 7, 7, 7, 20, 35, 44, 32, 27, 35, 19}, - { 16, 39, 67, 74, 86, 94, 94, 95, 101, 103, 90, 30, 19, 16, 14, 13, 15, 23, 47, 49, 53, 41, 47, 53, 52, 69, 73, 70, 75, 78, 77, 75, 74, 78, 73, 64, 43, 41, 24, 11, 10, 10, 15, 32, 49, 32, 26, 18, 10, 6, 6, 6, 6, 5, 6, 5, 5, 6, 10, 18, 24, 22, 19, 31, 22}, - { 14, 22, 45, 58, 70, 82, 88, 87, 84, 80, 67, 24, 16, 15, 14, 13, 14, 20, 44, 39, 48, 32, 39, 33, 50, 65, 69, 66, 69, 66, 61, 57, 56, 61, 60, 43, 31, 19, 13, 13, 14, 19, 24, 35, 45, 28, 30, 22, 26, 27, 22, 22, 11, 7, 9, 5, 5, 6, 10, 28, 30, 27, 24, 18, 7}, - { 13, 18, 36, 53, 60, 67, 70, 64, 64, 65, 49, 20, 13, 13, 11, 11, 13, 23, 36, 28, 30, 31, 32, 28, 44, 58, 64, 64, 60, 50, 45, 45, 52, 50, 37, 20, 13, 11, 11, 15, 19, 26, 27, 31, 28, 32, 39, 58, 60, 43, 39, 31, 22, 13, 10, 9, 7, 9, 11, 28, 48, 43, 32, 13, 5}, - { 15, 19, 37, 54, 60, 61, 58, 60, 65, 58, 44, 18, 11, 9, 7, 9, 11, 22, 28, 27, 20, 31, 31, 26, 40, 43, 50, 49, 45, 35, 36, 47, 40, 32, 20, 10, 7, 7, 7, 13, 16, 23, 19, 19, 26, 36, 52, 64, 57, 41, 40, 33, 23, 10, 7, 10, 7, 7, 9, 15, 41, 48, 30, 9, 5}, - { 18, 23, 57, 77, 86, 86, 80, 80, 82, 54, 31, 14, 11, 7, 7, 9, 13, 19, 22, 22, 16, 28, 23, 20, 32, 23, 31, 35, 33, 28, 39, 37, 33, 28, 15, 9, 6, 6, 7, 10, 14, 15, 10, 14, 32, 39, 56, 62, 57, 52, 44, 22, 11, 6, 7, 9, 10, 7, 7, 6, 11, 15, 15, 6, 5}, - { 19, 37, 79, 92, 97, 96, 94, 99, 96, 69, 33, 18, 11, 7, 9, 10, 13, 14, 15, 16, 16, 24, 18, 16, 19, 19, 20, 22, 22, 35, 36, 36, 27, 11, 9, 7, 6, 7, 9, 9, 14, 14, 10, 20, 37, 44, 60, 61, 58, 41, 20, 6, 6, 5, 6, 6, 13, 11, 9, 7, 20, 32, 30, 10, 5}, - { 20, 61, 88, 96, 101, 103, 105, 105, 99, 50, 19, 15, 10, 9, 10, 9, 11, 13, 13, 15, 16, 22, 13, 15, 16, 20, 15, 13, 22, 35, 37, 28, 15, 11, 9, 5, 6, 9, 7, 7, 10, 10, 13, 30, 39, 43, 60, 52, 43, 19, 6, 5, 5, 6, 6, 6, 15, 18, 10, 9, 19, 40, 43, 27, 7}, - { 39, 70, 79, 87, 90, 91, 101, 94, 78, 28, 18, 14, 13, 11, 11, 11, 9, 11, 13, 11, 13, 19, 11, 13, 14, 15, 10, 11, 24, 31, 27, 18, 16, 14, 7, 5, 6, 7, 6, 7, 10, 11, 20, 35, 40, 40, 49, 36, 14, 9, 6, 5, 5, 6, 5, 5, 13, 18, 11, 7, 14, 41, 44, 43, 23}, - { 28, 41, 48, 58, 62, 65, 67, 58, 36, 18, 15, 15, 19, 22, 16, 11, 7, 9, 11, 9, 10, 16, 11, 10, 10, 13, 10, 16, 20, 23, 18, 18, 15, 11, 5, 3, 5, 6, 6, 7, 7, 11, 22, 37, 31, 27, 23, 14, 7, 10, 9, 6, 6, 6, 5, 5, 9, 13, 10, 6, 6, 19, 23, 20, 16}, - { 20, 28, 39, 49, 56, 50, 41, 30, 19, 15, 11, 15, 22, 28, 23, 16, 11, 9, 9, 9, 9, 14, 10, 9, 9, 9, 10, 16, 19, 20, 18, 16, 14, 7, 6, 5, 5, 6, 6, 6, 6, 9, 20, 22, 18, 14, 10, 7, 6, 13, 9, 6, 6, 5, 5, 5, 6, 7, 6, 5, 3, 6, 9, 9, 10}, - { 24, 36, 44, 50, 54, 44, 30, 19, 18, 15, 14, 20, 28, 32, 31, 20, 15, 13, 13, 10, 9, 13, 11, 10, 9, 7, 13, 15, 20, 18, 19, 14, 9, 9, 7, 6, 6, 5, 5, 5, 6, 9, 19, 18, 11, 7, 6, 6, 9, 11, 9, 6, 6, 6, 5, 3, 6, 6, 6, 6, 7, 13, 13, 11, 9}, - { 24, 36, 41, 47, 40, 22, 16, 18, 19, 16, 16, 26, 35, 36, 37, 28, 18, 15, 14, 10, 10, 14, 13, 13, 9, 6, 11, 15, 20, 19, 18, 7, 7, 11, 11, 9, 7, 5, 5, 5, 6, 6, 18, 13, 5, 5, 6, 7, 13, 13, 7, 6, 5, 5, 3, 5, 6, 7, 6, 7, 13, 15, 20, 18, 11}, - { 22, 28, 37, 30, 16, 14, 14, 19, 19, 24, 26, 33, 41, 44, 39, 26, 19, 16, 14, 11, 13, 14, 13, 13, 9, 9, 11, 20, 23, 14, 9, 6, 7, 10, 11, 9, 6, 5, 5, 5, 6, 6, 9, 5, 3, 3, 6, 10, 11, 9, 6, 5, 3, 3, 3, 5, 6, 6, 6, 6, 13, 14, 18, 15, 7}, - { 22, 28, 32, 16, 14, 13, 19, 22, 30, 35, 30, 24, 28, 30, 32, 24, 26, 19, 14, 11, 13, 13, 9, 9, 9, 10, 16, 26, 16, 7, 6, 6, 6, 7, 7, 6, 5, 5, 5, 5, 6, 7, 5, 3, 3, 3, 7, 13, 14, 11, 9, 7, 3, 5, 3, 3, 6, 7, 6, 7, 13, 15, 19, 18, 7}, - { 19, 27, 19, 16, 14, 18, 15, 15, 23, 23, 16, 16, 22, 23, 18, 14, 18, 18, 11, 9, 10, 10, 7, 7, 9, 14, 20, 15, 9, 6, 6, 6, 5, 6, 6, 6, 5, 6, 5, 6, 6, 7, 5, 3, 3, 5, 9, 13, 16, 15, 18, 15, 7, 3, 3, 3, 6, 7, 9, 11, 14, 14, 18, 20, 7}, - { 14, 18, 14, 16, 22, 20, 11, 14, 16, 19, 16, 20, 24, 19, 14, 10, 18, 15, 10, 7, 9, 9, 6, 6, 10, 13, 11, 9, 7, 7, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 6, 5, 5, 3, 5, 5, 7, 10, 13, 14, 22, 18, 11, 5, 3, 5, 3, 7, 11, 14, 14, 11, 14, 20, 9}, - { 9, 10, 9, 14, 16, 13, 18, 24, 44, 52, 49, 44, 43, 40, 33, 14, 13, 15, 10, 10, 9, 11, 7, 6, 7, 7, 9, 7, 7, 6, 6, 6, 6, 6, 5, 5, 5, 6, 5, 5, 5, 5, 5, 5, 5, 6, 9, 14, 11, 13, 14, 13, 7, 3, 3, 5, 3, 6, 10, 13, 11, 7, 9, 14, 10}, - { 9, 10, 13, 14, 15, 14, 31, 41, 56, 67, 37, 41, 48, 52, 40, 19, 13, 11, 10, 13, 14, 16, 10, 10, 6, 6, 9, 7, 6, 6, 7, 6, 6, 6, 5, 6, 7, 7, 7, 6, 5, 3, 5, 6, 6, 7, 11, 13, 10, 9, 7, 7, 7, 5, 3, 3, 2, 5, 10, 9, 5, 3, 2, 5, 3}, - { 11, 9, 11, 16, 16, 15, 33, 43, 52, 53, 74, 75, 56, 61, 50, 52, 39, 16, 22, 35, 37, 32, 16, 13, 9, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 9, 10, 7, 6, 5, 5, 9, 10, 9, 9, 7, 11, 13, 15, 11, 9, 9, 6, 3, 3, 2, 5, 10, 9, 5, 2, 2, 1, 0}, - { 11, 9, 13, 16, 14, 19, 33, 52, 74, 87, 82, 50, 69, 65, 67, 77, 54, 84, 137, 165, 158, 133, 92, 52, 23, 10, 6, 6, 6, 7, 6, 6, 6, 7, 9, 9, 7, 7, 6, 6, 6, 6, 7, 6, 6, 7, 7, 10, 15, 18, 13, 6, 6, 3, 3, 2, 2, 5, 7, 10, 10, 3, 2, 1, 0}, - { 9, 9, 13, 15, 14, 19, 30, 60, 77, 62, 56, 80, 56, 61, 64, 58, 96, 158, 194, 202, 192, 177, 156, 144, 113, 71, 39, 18, 9, 7, 6, 6, 6, 7, 7, 7, 5, 5, 5, 6, 6, 6, 6, 5, 6, 7, 9, 13, 16, 16, 10, 6, 5, 3, 2, 2, 2, 6, 6, 7, 9, 3, 1, 1, 0}, - { 10, 10, 13, 15, 14, 15, 26, 54, 65, 50, 69, 56, 44, 50, 41, 56, 111, 171, 186, 194, 186, 184, 173, 167, 152, 143, 142, 114, 52, 10, 6, 6, 6, 7, 7, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 9, 10, 11, 11, 7, 6, 3, 3, 3, 3, 3, 5, 5, 3, 2, 2, 2, 1, 0}, - { 13, 11, 11, 14, 13, 14, 23, 41, 37, 57, 56, 33, 37, 47, 39, 61, 107, 154, 165, 169, 167, 175, 176, 173, 165, 158, 158, 150, 120, 71, 37, 11, 6, 6, 6, 6, 5, 5, 5, 5, 6, 5, 6, 5, 5, 5, 6, 7, 10, 11, 7, 6, 5, 6, 5, 3, 3, 3, 3, 2, 2, 3, 2, 1, 0}, - { 15, 15, 15, 14, 13, 14, 18, 26, 26, 49, 36, 35, 40, 48, 39, 50, 86, 126, 135, 139, 142, 158, 168, 169, 171, 165, 161, 158, 151, 148, 128, 86, 36, 11, 7, 6, 5, 6, 5, 6, 6, 5, 6, 5, 5, 5, 5, 5, 7, 11, 7, 6, 5, 5, 3, 5, 3, 3, 3, 3, 2, 3, 2, 1, 0}, - { 15, 16, 18, 15, 16, 15, 15, 23, 24, 28, 23, 28, 27, 32, 28, 44, 54, 90, 96, 101, 116, 135, 150, 159, 165, 164, 164, 168, 165, 165, 164, 151, 104, 53, 19, 6, 6, 10, 11, 9, 10, 19, 37, 41, 30, 23, 20, 14, 7, 7, 7, 7, 6, 5, 6, 6, 3, 5, 3, 3, 2, 2, 2, 1, 0}, - { 14, 15, 15, 15, 18, 18, 18, 18, 19, 19, 14, 15, 18, 23, 19, 30, 32, 49, 57, 71, 100, 121, 134, 144, 152, 150, 148, 159, 151, 126, 146, 175, 155, 84, 56, 45, 50, 77, 71, 56, 44, 45, 69, 73, 57, 53, 52, 41, 22, 7, 5, 9, 6, 6, 6, 6, 5, 5, 3, 3, 3, 2, 2, 1, 1}, - { 13, 14, 13, 11, 13, 15, 14, 13, 14, 14, 10, 10, 19, 20, 18, 18, 26, 30, 44, 73, 95, 114, 124, 131, 138, 135, 134, 146, 143, 100, 70, 113, 143, 126, 87, 75, 77, 90, 90, 67, 70, 62, 58, 69, 67, 48, 40, 33, 31, 14, 6, 5, 5, 5, 6, 6, 5, 3, 3, 3, 3, 3, 2, 1, 1}, - { 10, 11, 10, 9, 9, 11, 11, 11, 10, 10, 10, 11, 14, 15, 16, 26, 54, 88, 117, 125, 95, 97, 107, 114, 118, 122, 125, 118, 133, 142, 84, 41, 66, 97, 90, 75, 73, 61, 57, 58, 56, 60, 48, 54, 67, 62, 37, 32, 31, 20, 9, 5, 5, 3, 5, 5, 3, 3, 3, 3, 3, 3, 2, 1, 1}, - { 11, 13, 10, 9, 9, 10, 11, 11, 11, 10, 13, 14, 11, 13, 36, 90, 105, 105, 139, 146, 112, 83, 86, 97, 103, 116, 126, 105, 92, 129, 139, 91, 44, 48, 69, 80, 73, 65, 47, 52, 56, 57, 57, 40, 33, 44, 40, 33, 32, 27, 14, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3}, - { 10, 10, 10, 9, 7, 9, 10, 11, 13, 13, 11, 14, 11, 15, 71, 91, 84, 111, 137, 144, 137, 97, 67, 75, 87, 95, 117, 137, 99, 77, 109, 121, 83, 47, 40, 56, 70, 53, 45, 37, 45, 49, 62, 48, 31, 26, 32, 24, 24, 26, 19, 5, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 6}, - { 9, 9, 10, 9, 10, 11, 11, 11, 14, 13, 11, 13, 14, 19, 73, 74, 96, 118, 118, 150, 141, 116, 79, 61, 75, 78, 74, 109, 138, 96, 61, 86, 99, 73, 39, 32, 33, 35, 31, 32, 32, 23, 45, 44, 24, 27, 26, 20, 14, 14, 9, 3, 3, 2, 3, 2, 3, 3, 3, 5, 3, 5, 3, 3, 7}, - { 10, 10, 11, 13, 13, 13, 11, 14, 15, 15, 14, 15, 15, 24, 73, 84, 104, 88, 111, 137, 138, 113, 87, 58, 53, 74, 64, 60, 101, 120, 70, 47, 75, 90, 69, 33, 33, 30, 19, 26, 24, 15, 24, 24, 19, 18, 24, 18, 11, 10, 7, 3, 3, 2, 2, 3, 3, 2, 3, 5, 5, 5, 5, 3, 6}, - { 10, 10, 11, 13, 13, 13, 13, 14, 16, 15, 15, 15, 16, 30, 67, 82, 78, 80, 112, 129, 118, 88, 69, 53, 37, 39, 56, 49, 50, 71, 66, 48, 39, 61, 86, 54, 26, 23, 15, 19, 15, 11, 15, 14, 11, 13, 15, 14, 9, 6, 5, 3, 3, 3, 3, 3, 3, 3, 5, 3, 5, 5, 5, 2, 3}, - { 10, 10, 11, 11, 11, 11, 11, 13, 13, 13, 14, 16, 18, 24, 48, 64, 69, 91, 114, 113, 79, 58, 41, 32, 24, 20, 26, 32, 33, 31, 35, 43, 37, 24, 41, 48, 15, 11, 10, 14, 10, 9, 10, 9, 7, 7, 9, 9, 6, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 1, 1}, - { 9, 10, 11, 13, 11, 11, 11, 10, 11, 13, 14, 15, 18, 20, 28, 47, 64, 94, 109, 73, 39, 31, 31, 32, 31, 35, 35, 28, 30, 33, 30, 24, 22, 15, 10, 11, 6, 7, 7, 7, 6, 6, 7, 6, 6, 6, 6, 5, 5, 3, 3, 3, 3, 3, 5, 5, 3, 3, 3, 5, 6, 3, 3, 1, 1}, - { 10, 10, 11, 13, 14, 14, 13, 13, 14, 14, 15, 14, 15, 18, 19, 26, 47, 84, 73, 40, 22, 30, 30, 28, 23, 26, 23, 22, 26, 28, 26, 16, 13, 11, 10, 9, 9, 9, 6, 6, 6, 6, 6, 6, 5, 6, 5, 5, 5, 5, 5, 3, 3, 3, 5, 5, 3, 5, 5, 6, 5, 2, 2, 1, 1}, - { 11, 13, 13, 14, 16, 15, 14, 13, 13, 15, 18, 16, 15, 15, 14, 16, 24, 61, 50, 26, 18, 26, 23, 19, 16, 15, 16, 18, 19, 16, 14, 11, 10, 10, 9, 9, 9, 9, 7, 7, 7, 6, 6, 6, 5, 5, 5, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 7, 5, 6, 5, 3, 2, 1, 1}, - { 11, 13, 14, 15, 16, 13, 11, 11, 11, 15, 18, 16, 15, 14, 14, 16, 20, 47, 40, 24, 20, 23, 19, 18, 18, 20, 23, 20, 18, 14, 13, 11, 11, 13, 11, 10, 9, 9, 7, 7, 6, 6, 6, 7, 9, 6, 5, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 5, 5, 5, 2, 3, 2, 1, 1}, - { 9, 10, 13, 14, 14, 14, 14, 14, 11, 15, 18, 16, 15, 14, 15, 18, 18, 27, 26, 18, 15, 15, 15, 15, 16, 18, 16, 14, 13, 11, 10, 9, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 9, 11, 9, 6, 5, 3, 3, 3, 2, 3, 3, 5, 3, 3, 7, 5, 2, 2, 5, 3, 1, 0}, - { 9, 10, 11, 13, 13, 14, 14, 13, 14, 15, 15, 14, 16, 15, 16, 16, 16, 18, 15, 11, 10, 11, 11, 9, 10, 9, 9, 7, 7, 7, 6, 6, 6, 6, 7, 7, 6, 5, 5, 6, 6, 5, 5, 6, 9, 7, 6, 5, 5, 3, 2, 2, 2, 2, 3, 3, 2, 9, 6, 3, 3, 11, 6, 2, 0}, - { 9, 9, 10, 13, 14, 14, 15, 13, 13, 15, 15, 15, 15, 15, 16, 18, 15, 16, 14, 11, 9, 9, 13, 10, 9, 7, 7, 6, 5, 6, 7, 6, 6, 9, 10, 11, 7, 6, 6, 5, 5, 5, 5, 6, 7, 6, 5, 5, 5, 3, 2, 3, 2, 2, 3, 3, 2, 5, 5, 2, 3, 10, 6, 2, 0}, - { 9, 9, 11, 13, 13, 14, 14, 13, 11, 13, 14, 13, 14, 14, 14, 14, 10, 11, 11, 10, 9, 10, 14, 15, 15, 9, 9, 6, 6, 6, 9, 7, 6, 7, 7, 7, 6, 5, 5, 6, 6, 6, 6, 7, 7, 5, 5, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 1, 7, 5, 1, 0}, - { 10, 10, 11, 11, 11, 11, 13, 13, 13, 14, 15, 18, 16, 15, 14, 13, 11, 10, 9, 9, 10, 11, 11, 14, 15, 10, 9, 9, 9, 9, 11, 9, 6, 6, 5, 6, 6, 6, 5, 6, 7, 6, 6, 6, 5, 3, 3, 3, 2, 3, 2, 2, 2, 2, 2, 2, 1, 2, 2, 3, 1, 3, 3, 0, 0}, - { 10, 11, 11, 13, 13, 11, 11, 13, 14, 15, 16, 16, 16, 16, 14, 14, 11, 10, 10, 10, 11, 14, 14, 14, 18, 14, 11, 11, 13, 10, 10, 10, 7, 6, 6, 6, 7, 7, 7, 10, 10, 6, 6, 6, 3, 3, 3, 3, 3, 5, 3, 2, 2, 2, 2, 2, 2, 2, 2, 5, 2, 3, 2, 1, 0}, - { 11, 13, 13, 13, 13, 14, 11, 14, 14, 15, 16, 16, 16, 15, 13, 13, 11, 11, 11, 13, 14, 15, 14, 14, 19, 18, 15, 13, 13, 11, 13, 11, 11, 7, 7, 7, 10, 10, 10, 11, 13, 9, 9, 10, 6, 5, 5, 5, 5, 7, 5, 5, 5, 5, 3, 3, 2, 3, 3, 3, 2, 2, 3, 1, 0} - }; - return imageData; - } - - /// - /// Recording of a neuronal action potential (100 ms, 20 kHz sample rate, mV units) - /// - /// Recording of a neuronal action potential - public static double[] ActionPotential() - { - /* originated from 17o05027_ic_ramp.abf as part of the pyABF project */ - - double firstValue = -40.83252; - - sbyte[] raw = { - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, - -1, 1, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, -1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, -1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - -1, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, - 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, - 0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, -1, 1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 2, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, -1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 2, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, - 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -1, 0, - 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, -1, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 1, - 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 0, 0, 0, 0, 2, 1, 0, 0, 0, 2, 1, 1, 0, 1, 0, - 1, 0, 0, 2, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 2, 0, 2, 0, 0, - 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 2, 0, 3, 0, 0, 1, 0, 0, 1, 0, - 3, 0, 0, 1, 2, 0, 0, 0, 1, 1, 0, 0, 0, 1, 2, 0, 2, 1, 2, 0, - 1, 0, 2, 2, 1, 3, 1, 3, 1, 2, 2, 2, 3, 1, 3, 1, 3, 3, 3, 5, - 3, 4, 5, 6, 8, 12, 17, 25, 30, 38, 43, 47, 56, 65, 75, 86, 99, 104, 106, 100, - 93, 83, 73, 61, 53, 41, 34, 26, 18, 12, 5, -1, -9, -14, -21, -27, -32, -35, -38, -41, - -45, -47, -49, -50, -53, -52, -51, -52, -54, -54, -53, -54, -51, -51, -49, -49, -48, -48, -44, -43, - -41, -41, -38, -38, -34, -32, -33, -29, -28, -25, -25, -25, -20, -22, -17, -18, -16, -16, -16, -13, - -13, -12, -12, -10, -10, -9, -9, -7, -9, -7, -6, -6, -6, -6, -5, -4, -5, -3, -4, -3, - -3, 0, -4, -3, -1, -3, -1, 0, -2, -1, -1, -2, -1, -1, 0, -1, 0, 0, -1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, - 1, -1, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, - -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 1, -1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -1, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, - 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, - 0, 0, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, - -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, -1, 1, -1, 0, 1, 0, - 0, 0, -1, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1, 1, - 0, 0, 0, -1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, - }; - - double rawScale = 25; - double[] waveform = new double[raw.Length + 1]; - waveform[0] = firstValue; - for (int i = 0; i < raw.Length; i++) - { - waveform[i + 1] = waveform[i] + raw[i] / rawScale; - } - - return waveform; - } - - public class Electrocardiogram - { - /* - * The aim of the ECG simulator is to produce the typical ECG waveforms of different leads and - * as many arrhythmias as possible. My ECG simulator is able To produce normal lead II ECG - * waveform. The use Of a simulator has many advantages In the simulation Of ECG waveforms. - * First one Is saving Of time And another one Is removing the difficulties Of taking real ECG - * signals With invasive And noninvasive methods. The ECG simulator enables us To analyze And - * study normal And abnormal ECG waveforms without actually Using the ECG machine. One can - * simulate any given ECG waveform Using the ECG simulator. The way by which my simulator - * differs from other typical ECG simulators Is that i have used the principle Of Fourier - * series. The calculations used And other necessary descriptions are included In the file - * attached. - * - * https://www.mathworks.com/matlabcentral/fileexchange/10858-ecg-simulation-using-matlab - * (c) 2019 karthik raviprakash. All rights reserved. MIT license. - */ - - public double PWaveAmplitude { get; set; } = 0.25d; - public double PWaveDuration { get; set; } = 0.09d; - public double PWavePRInterval { get; set; } = 0.16d; - public double QWaveAmplitude { get; set; } = 0.025d; - public double QwaveDuration { get; set; } = 0.066d; - public double QWaveTime { get; set; } = 0.166d; - public double QRSWaveAmplitude { get; set; } = 1.6d; - public double QRSwaveDuration { get; set; } = 0.11d; - public double SWaveAmplitude { get; set; } = 0.25d; - public double SWaveDuration { get; set; } = 0.066d; - public double SWaveTime { get; set; } = 0.09d; - public double TWaveAmplitude { get; set; } = 0.35d; - public double TWaveDuration { get; set; } = 0.142d; - public double TWaveSTInterval { get; set; } = 0.2d; - public double UWaveAmplitude { get; set; } = 0.035d; - public double UWaveDuration { get; set; } = 0.0476d; - public double UWaveTime { get; set; } = 0.433d; - - private double _HeartRate; - public double HeartRate { get => _HeartRate; set => (_HeartRate, _Period) = (value, 60d / value); } - - private double _Period; - public double Period { get => _Period; set => (_Period, _HeartRate) = (value, 60d / value); } - - public Electrocardiogram(double heartRate = 72) => HeartRate = heartRate; - - public double GetVoltage(double elapsedSeconds) - { - elapsedSeconds %= (2d * Period); - double value = -0.9d; - value += PWave(elapsedSeconds, PWaveAmplitude, PWaveDuration, PWavePRInterval, Period); - value += QWave(elapsedSeconds, QWaveAmplitude, QwaveDuration, QWaveTime, Period); - value += QRSwave(elapsedSeconds, QRSWaveAmplitude, QRSwaveDuration, Period); - value += SWave(elapsedSeconds, SWaveAmplitude, SWaveDuration, SWaveTime, Period); - value += TWave(elapsedSeconds, TWaveAmplitude, TWaveDuration, TWaveSTInterval, Period); - value += UWave(elapsedSeconds, UWaveAmplitude, UWaveDuration, UWaveTime, Period); - return value; - } - - private static double QRSwave(double x, double amplitude, double duration, double period) - { - double l = 0.5d * period; - double a = amplitude; - double b = 2d * l / duration; - int n = 100; - double qrs1 = a / (2d * b) * (2d - b); - double qrs2 = 0d; - for (int i = 1, loopTo = n; i <= loopTo; i++) - { - double harm = 2d * b * a / (i * i * Math.PI * Math.PI) * (1d - Math.Cos(i * Math.PI / b)) * Math.Cos(i * Math.PI * x / l); - qrs2 += harm; - } - - return qrs1 + qrs2; - } - - private static double PWave(double x, double amplitude, double duration, double time, double period) - { - double l = 0.5d * period; - double a = amplitude; - double b = 2d * l / duration; - x += time; - int n = 100; - double p1 = 1d / l; - double p2 = 0d; - double harm1; - for (int i = 1, loopTo = n; i <= loopTo; i++) - { - harm1 = (Math.Sin(Math.PI / (2d * b) * (b - 2 * i)) / (b - 2 * i) + Math.Sin(Math.PI / (2d * b) * (b + 2 * i)) / (b + 2 * i)) * (2d / Math.PI) * Math.Cos(i * Math.PI * x / l); - p2 += harm1; - } - - return a * (p1 + p2); - } - - private static double QWave(double x, double amplitude, double duration, double time, double period) - { - double l = 0.5d * period; - double a = amplitude; - double b = 2d * l / duration; - x += time; - int n = 100; - double q1 = a / (2d * b) * (2d - b); - double q2 = 0d; - double harm5; - for (int i = 1, loopTo = n; i <= loopTo; i++) - { - harm5 = 2d * b * a / (i * i * Math.PI * Math.PI) * (1d - Math.Cos(i * Math.PI / b)) * Math.Cos(i * Math.PI * x / l); - q2 += harm5; - } - - return -1 * (q1 + q2); - } - - private static double SWave(double x, double amplitude, double duration, double time, double period) - { - double l = 0.5d * period; - double a = amplitude; - double b = 2d * l / duration; - x -= time; - int n = 100; - double s1 = a / (2d * b) * (2d - b); - double s2 = 0d; - double harm3; - for (int i = 1, loopTo = n; i <= loopTo; i++) - { - harm3 = 2d * b * a / (i * i * Math.PI * Math.PI) * (1d - Math.Cos(i * Math.PI / b)) * Math.Cos(i * Math.PI * x / l); - s2 += harm3; - } - - return -1 * (s1 + s2); - } - - private static double TWave(double x, double amplitude, double duration, double time, double period) - { - double l = 0.5d * period; - double a = amplitude; - double b = 2d * l / duration; - x = x - time - 0.045d; - int n = 100; - double t1 = 1d / l; - double t2 = 0d; - double harm2; - for (int i = 1, loopTo = n; i <= loopTo; i++) - { - harm2 = (Math.Sin(Math.PI / (2d * b) * (b - 2 * i)) / (b - 2 * i) + Math.Sin(Math.PI / (2d * b) * (b + 2 * i)) / (b + 2 * i)) * (2d / Math.PI) * Math.Cos(i * Math.PI * x / l); - t2 += harm2; - } - - return a * (t1 + t2); - } - - private static double UWave(double x, double amplitude, double duration, double time, double period) - { - double l = 0.5d * period; - double a = amplitude; - double b = 2d * l / duration; - x -= time; - int n = 100; - double u1 = 1d / l; - double u2 = 0d; - double harm4; - for (int i = 1, loopTo = n; i <= loopTo; i++) - { - harm4 = (Math.Sin(Math.PI / (2d * b) * (b - 2 * i)) / (b - 2 * i) + Math.Sin(Math.PI / (2d * b) * (b + 2 * i)) / (b + 2 * i)) * (2d / Math.PI) * Math.Cos(i * Math.PI * x / l); - u2 += harm4; - } - - return a * (u1 + u2); - } - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Marker.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Marker.cs deleted file mode 100644 index 1de275def..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Marker.cs +++ /dev/null @@ -1,57 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public static class Marker - { - // TODO: refactor this in the next major version of ScottPlot to add support for LineWidth, etc - public static MarkerShape None => MarkerShape.None; - public static MarkerShape FilledCircle => MarkerShape.FilledCircle; - public static MarkerShape OpenCircle => MarkerShape.OpenCircle; - public static MarkerShape FilledSquare => MarkerShape.FilledSquare; - public static MarkerShape OpenSquare => MarkerShape.OpenSquare; - public static MarkerShape FilledDiamond => MarkerShape.FilledDiamond; - public static MarkerShape OpenDiamond => MarkerShape.OpenDiamond; - public static MarkerShape Asterisk => MarkerShape.Asterisk; - public static MarkerShape HashTag => MarkerShape.HashTag; - public static MarkerShape Cross => MarkerShape.Cross; - public static MarkerShape Eks => MarkerShape.Eks; - public static MarkerShape VerticalBar => MarkerShape.VerticalBar; - public static MarkerShape TriangleUp => MarkerShape.TriUp; - public static MarkerShape TriangleDown => MarkerShape.TriDown; - - public static MarkerShape Random() => Random(new Random()); - - public static MarkerShape Random(Random rand) - { - Array members = Enum.GetValues(typeof(MarkerShape)); - object randomMember = members.GetValue(rand.Next(members.Length)); - return (MarkerShape)randomMember; - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Markers.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Markers.cs deleted file mode 100644 index 2d15d74ca..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Markers.cs +++ /dev/null @@ -1,161 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class MarkerTools - { - public static void DrawMarker(Graphics gfx, PointF pixelLocation, MarkerShape shape, float size, Color color) - { - if (size == 0 || shape == MarkerShape.None) - { - return; - } - - Pen pen = new Pen(color); - - Brush brush = new SolidBrush(color); - - PointF corner1 = new PointF(pixelLocation.X - size / 2, pixelLocation.Y - size / 2); - PointF corner2 = new PointF(pixelLocation.X + size / 2, pixelLocation.Y + size / 2); - SizeF bounds = new SizeF(size, size); - RectangleF rect = new RectangleF(corner1, bounds); - - switch (shape) - { - case MarkerShape.FilledCircle: - gfx.FillEllipse(brush, rect); - break; - case MarkerShape.OpenCircle: - gfx.DrawEllipse(pen, rect); - break; - case MarkerShape.FilledSquare: - gfx.FillRectangle(brush, rect); - break; - case MarkerShape.OpenSquare: - gfx.DrawRectangle(pen, corner1.X, corner1.Y, size, size); - break; - case MarkerShape.FilledDiamond: - - // Create points that define polygon. - PointF point1 = new PointF(pixelLocation.X, pixelLocation.Y + size / 2); - PointF point2 = new PointF(pixelLocation.X - size / 2, pixelLocation.Y); - PointF point3 = new PointF(pixelLocation.X, pixelLocation.Y - size / 2); - PointF point4 = new PointF(pixelLocation.X + size / 2, pixelLocation.Y); - - PointF[] curvePoints = { point1, point2, point3, point4 }; - - //Draw polygon to screen - gfx.FillPolygon(brush, curvePoints); - break; - case MarkerShape.OpenDiamond: - - // Create points that define polygon. - PointF point5 = new PointF(pixelLocation.X, pixelLocation.Y + size / 2); - PointF point6 = new PointF(pixelLocation.X - size / 2, pixelLocation.Y); - PointF point7 = new PointF(pixelLocation.X, pixelLocation.Y - size / 2); - PointF point8 = new PointF(pixelLocation.X + size / 2, pixelLocation.Y); - - PointF[] curvePoints2 = { point5, point6, point7, point8 }; - - //Draw polygon to screen - gfx.DrawPolygon(pen, curvePoints2); - - break; - case MarkerShape.Asterisk: - System.Drawing.Font drawFont = new System.Drawing.Font("CourierNew", size * 3); - SizeF textSize = GDI.MeasureString(gfx, "*", drawFont); - PointF asteriskPoint = new PointF(pixelLocation.X - textSize.Width / 2, pixelLocation.Y - textSize.Height / 4); - gfx.DrawString("*", drawFont, brush, asteriskPoint); - - break; - case MarkerShape.HashTag: - System.Drawing.Font drawFont2 = new System.Drawing.Font("CourierNew", size * 2); - SizeF textSize2 = GDI.MeasureString(gfx, "#", drawFont2); - PointF asteriskPoint2 = new PointF(pixelLocation.X - textSize2.Width / 2, pixelLocation.Y - textSize2.Height / 3); - gfx.DrawString("#", drawFont2, brush, asteriskPoint2); - - break; - case MarkerShape.Cross: - System.Drawing.Font drawFont3 = new System.Drawing.Font("CourierNew", size * 2); - SizeF textSize3 = GDI.MeasureString(gfx, "+", drawFont3); - PointF asteriskPoint3 = new PointF(pixelLocation.X - textSize3.Width / (5 / 2), pixelLocation.Y - textSize3.Height / 2); - gfx.DrawString("+", drawFont3, brush, asteriskPoint3); - - break; - case MarkerShape.Eks: - System.Drawing.Font drawFont4 = new System.Drawing.Font("CourierNew", size * 2); - SizeF textSize4 = GDI.MeasureString(gfx, "x", drawFont4); - PointF asteriskPoint4 = new PointF(pixelLocation.X - textSize4.Width / (5 / 2), pixelLocation.Y - textSize4.Height / 2); - gfx.DrawString("x", drawFont4, brush, asteriskPoint4); - - break; - case MarkerShape.VerticalBar: - System.Drawing.Font drawFont5 = new System.Drawing.Font("CourierNew", size * 2); - SizeF textSize5 = GDI.MeasureString(gfx, "|", drawFont5); - PointF asteriskPoint5 = new PointF(pixelLocation.X - textSize5.Width / (5 / 2), pixelLocation.Y - textSize5.Height / 2); - gfx.DrawString("|", drawFont5, brush, asteriskPoint5); - - break; - case MarkerShape.TriUp: - // Create points that define polygon. - PointF point9 = new PointF(pixelLocation.X, pixelLocation.Y - size); - PointF point10 = new PointF(pixelLocation.X, pixelLocation.Y); - PointF point11 = new PointF(pixelLocation.X - size * (float)0.866, pixelLocation.Y + size * (float)0.5); - PointF point12 = new PointF(pixelLocation.X, pixelLocation.Y); - PointF point13 = new PointF(pixelLocation.X + size * (float)0.866, (pixelLocation.Y + size * (float)0.5)); - - - PointF[] curvePoints3 = { point12, point9, point10, point11, point12, point13 }; - - //Draw polygon to screen - gfx.DrawPolygon(pen, curvePoints3); - - break; - case MarkerShape.TriDown: - // Create points that define polygon. - PointF point14 = new PointF(pixelLocation.X, pixelLocation.Y + size); - PointF point15 = new PointF(pixelLocation.X, pixelLocation.Y); - PointF point16 = new PointF(pixelLocation.X - size * (float)0.866, pixelLocation.Y - size * (float)0.5); - PointF point17 = new PointF(pixelLocation.X, pixelLocation.Y); - PointF point18 = new PointF(pixelLocation.X + size * (float)0.866, (pixelLocation.Y - size * (float)0.5)); - - - PointF[] curvePoints4 = { point17, point14, point15, point16, point17, point18 }; - - //Draw polygon to screen - gfx.DrawPolygon(pen, curvePoints4); - - break; - case MarkerShape.None: - break; - default: - throw new NotImplementedException($"unsupported marker type: {shape}"); - } - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/MultiPlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/MultiPlot.cs deleted file mode 100644 index 73a5c5ecc..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/MultiPlot.cs +++ /dev/null @@ -1,139 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - [Obsolete("This class will be deleted in a future version. See ScottPlot FAQ for details.")] - public class MultiPlot - { - public readonly Plot[] subplots; - public readonly int rows, cols; - public readonly int width, height; - - private readonly Bitmap bmp; - private readonly Graphics gfx; - - public int subplotCount => rows * cols; - public int subplotWidth => width / cols; - public int subplotHeight => height / rows; - - public MultiPlot(int width = 800, int height = 600, int rows = 1, int cols = 1) - { - if (rows < 1 || cols < 1) - { - throw new ArgumentException("must have at least 1 row and column"); - } - - this.width = width; - this.height = height; - this.rows = rows; - this.cols = cols; - - bmp = new Bitmap(width, height); - gfx = Graphics.FromImage(bmp); - - subplots = new Plot[subplotCount]; - for (int i = 0; i < subplotCount; i++) - { - subplots[i] = new Plot(subplotWidth, subplotHeight); - } - } - - private void Render() - { - gfx.Clear(Color.White); - int subplotIndex = 0; - for (int row = 0; row < rows; row++) - { - for (int col = 0; col < cols; col++) - { - Bitmap subplotBmp = subplots[subplotIndex++].Render(subplotWidth, subplotHeight, false); - Point pt = new Point(col * subplotWidth, row * subplotHeight); - gfx.DrawImage(subplotBmp, pt); - } - } - } - - public Bitmap GetBitmap() - { - Render(); - return bmp; - } - - public void SaveFig(string filePath) - { - filePath = Path.GetFullPath(filePath); - string fileFolder = Path.GetDirectoryName(filePath); - if (!Directory.Exists(fileFolder)) - { - throw new Exception($"ERROR: folder does not exist: {fileFolder}"); - } - - ImageFormat imageFormat; - string extension = Path.GetExtension(filePath).ToUpper(); - if (extension == ".JPG" || extension == ".JPEG") - { - imageFormat = ImageFormat.Jpeg; // TODO: use jpgEncoder to set custom compression level - } - else if (extension == ".PNG") - { - imageFormat = ImageFormat.Png; - } - else if (extension == ".TIF" || extension == ".TIFF") - { - imageFormat = ImageFormat.Tiff; - } - else if (extension == ".BMP") - { - imageFormat = ImageFormat.Bmp; - } - else - { - throw new NotImplementedException($"Extension not supported: {extension}"); - } - - Render(); - bmp.Save(filePath, imageFormat); - } - - public Plot GetSubplot(int rowIndex, int columnIndex) - { - if (rowIndex < 0 || rowIndex >= rows) - { - throw new ArgumentException("invalid row index"); - } - - if (columnIndex < 0 || columnIndex >= cols) - { - throw new ArgumentException("invalid column index"); - } - - int subplotIndex = rowIndex * cols + columnIndex; - return subplots[subplotIndex]; - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Palette.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Palette.cs deleted file mode 100644 index a0f2bb942..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Palette.cs +++ /dev/null @@ -1,75 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /* This module will be expanded in ScottPlot 5 */ - public static class Palette - { - public static ScottPlotPalette Amber => new(new Amber()); - public static ScottPlotPalette Aurora => new(new Aurora()); - public static ScottPlotPalette Category10 => new(new Category10()); - public static ScottPlotPalette Category20 => new(new Category20()); - public static ScottPlotPalette ColorblindFriendly => new(new ColourBlindFriendly()); - public static ScottPlotPalette Dark => new(new Dark()); - public static ScottPlotPalette DarkPastel => new(new DarkPastel()); - public static ScottPlotPalette Frost => new(new Frost()); - public static ScottPlotPalette Microcharts => new(new Microcharts()); - public static ScottPlotPalette Nero => new(new Nero()); - public static ScottPlotPalette Nord => new(new Nord()); - public static ScottPlotPalette OneHalf => new(new OneHalf()); - public static ScottPlotPalette OneHalfDark => new(new OneHalfDark()); - public static ScottPlotPalette PolarNight => new(new PolarNight()); - public static ScottPlotPalette Redness => new(new Redness()); - public static ScottPlotPalette SnowStorm => new(new Snowstorm()); - public static ScottPlotPalette Tsitsulin => new(new Tsitsulin()); - - /// - /// Create a new color palette from an array of HTML colors - /// - public static ScottPlotPalette FromHtmlColors(string[] htmlColors) - { - return new ScottPlotPalette(htmlColors); - } - - /// - /// Return an array containing every available style - /// - public static ScottPlotPalette[] GetPalettes() - { - return Assembly.GetExecutingAssembly() - .GetTypes() - .Where(x => x.IsClass) - .Where(x => !x.IsAbstract) - .Where(x => x.GetInterfaces().Contains(typeof(IPalette))) - .Select(x => FormatterServices.GetUninitializedObject(x) as IPalette) - .Select(x => new ScottPlotPalette(x)) - .Where(x => x.Count() > 0) - .ToArray(); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Pixel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Pixel.cs deleted file mode 100644 index b0e713d29..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Pixel.cs +++ /dev/null @@ -1,66 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Describes an X/Y position in pixel space - /// - public class Pixel - { - public float X; - public float Y; - - public Pixel(float x, float y) - { - X = x; - Y = y; - } - - /// - /// True as lone as neither coordinate is NaN or Infinity - /// - public bool IsFinite() - { - return - !double.IsNaN(X) && - !double.IsNaN(Y) && - !double.IsInfinity(X) && - !double.IsInfinity(Y); - } - - /// - /// Return the distance to another pixel (in pixel units) - /// - public float Distance(Pixel other) - { - double dX = Math.Abs(other.X - X); - double dY = Math.Abs(other.Y - Y); - return (float)Math.Sqrt(dX * dX + dY * dY); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/PlotDimensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/PlotDimensions.cs deleted file mode 100644 index 1af40c73e..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/PlotDimensions.cs +++ /dev/null @@ -1,88 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// PlotDimensions supplies figure dimensions and pixel/coordinate lookup methods for a single 2D plane - /// - public class PlotDimensions - { - // plot dimensions - public readonly float Width; - public readonly float Height; - public readonly float DataWidth; - public readonly float DataHeight; - public readonly float DataOffsetX; - public readonly float DataOffsetY; - - // rendering options - public readonly double ScaleFactor; - - // axis limits - public readonly double XMin; - public readonly double XMax; - public readonly double YMin; - public readonly double YMax; - public readonly double XSpan; - public readonly double YSpan; - public readonly double XCenter; - public readonly double YCenter; - - // pixel/coordinate conversions - public readonly double PxPerUnitX; - public readonly double PxPerUnitY; - public readonly double UnitsPerPxX; - public readonly double UnitsPerPxY; - - public Pixel GetPixel(Coordinate coordinate) => new Pixel(GetPixelX(coordinate.X), GetPixelY(coordinate.Y)); - public float GetPixelX(double position) => (float)(DataOffsetX + ((position - XMin) * PxPerUnitX)); - public float GetPixelY(double position) => (float)(DataOffsetY + ((YMax - position) * PxPerUnitY)); - - public Coordinate GetCoordinate(Pixel pixel) => new Coordinate(GetCoordinateX(pixel.X), GetCoordinateY(pixel.Y)); - public double GetCoordinateX(float pixel) => (pixel - DataOffsetX) / PxPerUnitX + XMin; - public double GetCoordinateY(float pixel) => DataHeight - ((pixel - YMin) * PxPerUnitY); - - public PlotDimensions(SizeF figureSize, SizeF dataSize, PointF dataOffset, - (double xMin, double xMax, double yMin, double yMax) axisLimits, - double scaleFactor) - { - (Width, Height) = (figureSize.Width, figureSize.Height); - (DataWidth, DataHeight) = (dataSize.Width, dataSize.Height); - (DataOffsetX, DataOffsetY) = (dataOffset.X, dataOffset.Y); - (XMin, XMax, YMin, YMax) = (axisLimits.xMin, axisLimits.xMax, axisLimits.yMin, axisLimits.yMax); - (XSpan, YSpan) = (XMax - XMin, YMax - YMin); - (XCenter, YCenter) = ((XMin + XMax) / 2, (YMin + YMax) / 2); - (PxPerUnitX, PxPerUnitY) = (DataWidth / XSpan, DataHeight / YSpan); - (UnitsPerPxX, UnitsPerPxY) = (XSpan / DataWidth, YSpan / DataHeight); - ScaleFactor = scaleFactor; - } - - public override string ToString() => - $"Dimensions for figure ({Width}x{Height}), data area ({DataWidth}x{DataHeight}), and axes ({XMin}, {XMax}, {YMin}, {YMax})"; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Settings.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Settings.cs deleted file mode 100644 index 5522f72f2..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Settings.cs +++ /dev/null @@ -1,686 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// This module holds state for figure dimensions, axis limits, plot contents, and styling options. - /// A plot can be duplicated by copying the full state of this settings module. - /// - public class Settings - { - /// - /// This List contains all plottables managed by this Plot. - /// Render order is from lowest (first) to highest (last). - /// - public readonly ObservableCollection Plottables = new(); - - /// - /// Unique value that changes any time the list of plottables is modified. - /// - public int PlottablesIdentifier { get; private set; } = 0; - - /// - /// Return the next color from PlottablePalette based on the current number of plottables - /// - public Color GetNextColor() => PlottablePalette.GetColour(Plottables.Count); - - public readonly FigureBackground FigureBackground = new FigureBackground(); - public readonly DataBackground DataBackground = new DataBackground(); - public readonly BenchmarkMessage BenchmarkMessage = new BenchmarkMessage(); - public readonly ErrorMessage ErrorMessage = new ErrorMessage(); - public readonly Legend CornerLegend = new Legend(); - public readonly ZoomRectangle ZoomRectangle = new ZoomRectangle(); - public ScottPlotPalette PlottablePalette = Palette.Category10; - - /// - /// List of all axes used in this plot. - /// Axes can be added, but existing ones should not be removed. - /// - public List Axes = new() - { - new DefaultLeftAxis(), - new DefaultRightAxis(), - new DefaultBottomAxis(), - new DefaultTopAxis() - }; - - /// - /// Get an array containing just horizontal axes - /// - public Axis[] HorizontalAxes => Axes.Where(x => x.IsHorizontal).Distinct().ToArray(); - - /// - /// Get an array containing just vertical axes - /// - public Axis[] VerticalAxes => Axes.Where(x => x.IsVertical).Distinct().ToArray(); - - /// - /// Return the first horizontal axis with the given axis index - /// - public Axis GetXAxis(int xAxisIndex) - { - Axis[] axes = Axes.Where(x => x.IsHorizontal && x.AxisIndex == xAxisIndex).ToArray(); - if (axes.Length == 0) - { - throw new InvalidOperationException($"There no X axes with an axis index of {xAxisIndex}"); - } - - return axes[0]; - } - - /// - /// Return the first vertical axis with the given axis index - /// - public Axis GetYAxis(int yAxisIndex) - { - Axis[] axes = Axes.Where(x => x.IsVertical && x.AxisIndex == yAxisIndex).ToArray(); - if (axes.Length == 0) - { - throw new InvalidOperationException($"There no Y axes with an axis index of {yAxisIndex}"); - } - - return axes[0]; - } - - /// - /// Indicates whether unset axes are present. - /// If true, the user may want to call AxisAuto() or SetAxisLimits(). - /// - public bool AllAxesHaveBeenSet => Axes.All(x => x.Dims.HasBeenSet); - - /// - /// Controls relationship between X and Y axis scales. - /// See documentation for enumeration members. - /// - public EqualScaleMode EqualScaleMode { get; set; } = EqualScaleMode.Disabled; - - /// - /// Primary vertical axis (on the left of the plot) - /// - public Axis YAxis => Axes[0]; - - /// - /// Secondary vertical axis (on the right of the plot) - /// - public Axis YAxis2 => Axes[1]; - - /// - /// Primary horizontal axis (on the bottom of the plot) - /// - public Axis XAxis => Axes[2]; - - /// - /// Secondary horizontal axis (on the top of the plot) - /// - public Axis XAxis2 => Axes[3]; - - /// - /// Width of the figure (in pixels) - /// - public int Width => (int)XAxis.Dims.FigureSizePx; - - /// - /// Height of the figure (in pixels) - /// - public int Height => (int)YAxis.Dims.FigureSizePx; - - /// - /// Default padding to use when AxisAuto() or Margins() is called without a specified margin - /// - public double MarginsX = .05; - - /// - /// Default padding to use when AxisAuto() or Margins() is called without a specified margin - /// - public double MarginsY = .1; - - public Settings() - { - Plottables.CollectionChanged += (object sender, NotifyCollectionChangedEventArgs e) => PlottablesIdentifier++; - } - - /// - /// Return figure dimensions for the specified X and Y axes - /// - public PlotDimensions GetPlotDimensions(int xAxisIndex, int yAxisIndex, double scaleFactor) - { - var xAxis = GetXAxis(xAxisIndex); - var yAxis = GetYAxis(yAxisIndex); - - // determine figure dimensions based on primary X and Y axis - var figureSize = new SizeF(XAxis.Dims.FigureSizePx, YAxis.Dims.FigureSizePx); - var dataSize = new SizeF(XAxis.Dims.DataSizePx, YAxis.Dims.DataSizePx); - var dataOffset = new PointF(XAxis.Dims.DataOffsetPx, YAxis.Dims.DataOffsetPx); - - // determine axis limits based on specific X and Y axes - (double xMin, double xMax) = xAxis.Dims.RationalLimits(); - (double yMin, double yMax) = yAxis.Dims.RationalLimits(); - var limits = (xMin, xMax, yMin, yMax); - - return new PlotDimensions(figureSize, dataSize, dataOffset, limits, scaleFactor); - } - - /// - /// Set the default size for rendering images - /// - public void Resize(float width, float height) - { - foreach (Axis axis in Axes) - { - axis.Dims.Resize(axis.IsHorizontal ? width : height); - } - } - - /// - /// Reset axis limits to their defauts - /// - public void ResetAxisLimits() - { - foreach (Axis axis in Axes) - { - axis.Dims.ResetLimits(); - } - } - - /// - /// Define axis limits for a particuar axis - /// - public void AxisSet(double? xMin, double? xMax, double? yMin, double? yMax, int xAxisIndex = 0, int yAxisIndex = 0) - { - GetXAxis(xAxisIndex).Dims.SetAxis(xMin, xMax); - GetYAxis(yAxisIndex).Dims.SetAxis(yMin, yMax); - } - - /// - /// Define axis limits for a particuar axis - /// - public void AxisSet(AxisLimits limits, int xAxisIndex = 0, int yAxisIndex = 0) - { - GetXAxis(xAxisIndex).Dims.SetAxis(limits.XMin, limits.XMax); - GetYAxis(yAxisIndex).Dims.SetAxis(limits.YMin, limits.YMax); - } - - /// - /// Return X and Y axis limits - /// - public AxisLimits AxisLimits(int xAxisIndex, int yAxisIndex) - { - var xAxis = GetXAxis(xAxisIndex); - var yAxis = GetYAxis(yAxisIndex); - return new AxisLimits(xAxis.Dims.Min, xAxis.Dims.Max, yAxis.Dims.Min, yAxis.Dims.Max); - } - - /// - /// Pan all axes by the given pixel distance - /// - public void AxesPanPx(float dxPx, float dyPx) - { - foreach (Axis axis in Axes) - { - if (axis.IsHorizontal) - { - axis.Dims.PanPx(dxPx); - } - else - { - axis.Dims.PanPx(dyPx); - } - } - } - - /// - /// Zoom all axes by the given pixel distance - /// - public void AxesZoomPx(float xPx, float yPx, bool lockRatio = false) - { - if (lockRatio) - { - (xPx, yPx) = (Math.Max(xPx, yPx), Math.Max(xPx, yPx)); - } - - foreach (Axis axis in Axes) - { - double deltaPx = axis.IsHorizontal ? xPx : yPx; - double delta = deltaPx * axis.Dims.UnitsPerPx; - double deltaFrac = delta / (Math.Abs(delta) + axis.Dims.Span); - axis.Dims.Zoom(Math.Pow(10, deltaFrac)); - } - } - - /// - /// Zoom all axes by the given fraction - /// - public void AxesZoomTo(double xFrac, double yFrac, float xPixel, float yPixel) - { - foreach (Axis axis in Axes) - { - double frac = axis.IsHorizontal ? xFrac : yFrac; - float centerPixel = axis.IsHorizontal ? xPixel : yPixel; - double center = axis.Dims.GetUnit(centerPixel); - axis.Dims.Zoom(frac, center); - } - } - - /// - /// Automatically adjust X and Y axis limits of all axes to fit the data - /// - public void AxisAutoAll(double horizontalMargin = .1, double verticalMargin = .1) - { - AxisAutoAllX(horizontalMargin); - AxisAutoAllY(verticalMargin); - } - - /// - /// Automatically adjust axis limits for all axes which have not yet been set - /// - public void AxisAutoUnsetAxes() - { - Axis[] unsetAxesX = HorizontalAxes - .Where(x => !x.Dims.HasBeenSet && x.Dims.IsNan) - .Select(x => x.AxisIndex) - .Distinct() - .Select(x => GetXAxis(x)) - .ToArray(); - - Axis[] unsetAxesY = VerticalAxes - .Where(x => !x.Dims.HasBeenSet && x.Dims.IsNan) - .Select(x => x.AxisIndex) - .Distinct() - .Select(x => GetYAxis(x)) - .ToArray(); - - foreach (Axis xAxis in unsetAxesX) - { - AxisAutoX(xAxis.AxisIndex); - } - - foreach (Axis yAxis in unsetAxesY) - { - AxisAutoY(yAxis.AxisIndex); - } - } - - /// - /// If a scale lock mode is in use, modify the axis limits accordingly - /// - public void EnforceEqualAxisScales() - { - EqualScaleMode mode = EqualScaleMode; - - if (mode is EqualScaleMode.PreserveLargest) - { - mode = XAxis.Dims.DataSizePx > YAxis.Dims.DataSizePx - ? EqualScaleMode.PreserveX - : EqualScaleMode.PreserveY; - } - - if (mode is EqualScaleMode.PreserveSmallest) - { - mode = XAxis.Dims.DataSizePx < YAxis.Dims.DataSizePx - ? EqualScaleMode.PreserveX - : EqualScaleMode.PreserveY; - } - - switch (mode) - { - case EqualScaleMode.Disabled: - return; - - case EqualScaleMode.PreserveX: - double yHalfSize = (YAxis.Dims.DataSizePx / 2) * XAxis.Dims.UnitsPerPx; - AxisSet(null, null, YAxis.Dims.Center - yHalfSize, YAxis.Dims.Center + yHalfSize); - return; - - case EqualScaleMode.PreserveY: - double xHalfSize = (XAxis.Dims.DataSizePx / 2) * YAxis.Dims.UnitsPerPx; - AxisSet(XAxis.Dims.Center - xHalfSize, XAxis.Dims.Center + xHalfSize, null, null); - return; - - case EqualScaleMode.ZoomOut: - double maxUnitsPerPx = Math.Max(XAxis.Dims.UnitsPerPx, YAxis.Dims.UnitsPerPx); - double halfX = (XAxis.Dims.DataSizePx / 2) * maxUnitsPerPx; - double halfY = (YAxis.Dims.DataSizePx / 2) * maxUnitsPerPx; - AxisSet(XAxis.Dims.Center - halfX, XAxis.Dims.Center + halfX, YAxis.Dims.Center - halfY, YAxis.Dims.Center + halfY); - return; - - case EqualScaleMode.PreserveLargest: - throw new InvalidOperationException("this mode should have been converted to preserve X or Y"); - - case EqualScaleMode.PreserveSmallest: - throw new InvalidOperationException("this mode should have been converted to preserve X or Y"); - - default: - throw new InvalidOperationException("unknown scale lock mode"); - } - } - - /// - /// Automatically adjust X axis limits to fit the data - /// - public void AxisAutoAllX(double margin = .1) - { - int[] xAxisIndexes = Axes.Where(x => x.IsHorizontal).Select(x => x.AxisIndex).Distinct().ToArray(); - foreach (int i in xAxisIndexes) - { - AxisAutoX(i, margin); - } - } - - /// - /// Automatically adjust Y axis limits to fit the data - /// - public void AxisAutoAllY(double margin = .1) - { - int[] yAxisIndexes = Axes.Where(x => x.IsVertical).Select(x => x.AxisIndex).Distinct().ToArray(); - foreach (int i in yAxisIndexes) - { - AxisAutoY(i, margin); - } - } - - public void AxisAutoX(int xAxisIndex, double margin = .1) - { - double min = double.NaN; - double max = double.NaN; - double zoomFrac = 1 - margin; - - var plottableLimits = Plottables.Where(x => x is IPlottable) - .Select(x => (IPlottable)x) - .Where(x => x.IsVisible) - .Where(x => x.XAxisIndex == xAxisIndex) - .Select(x => x.GetAxisLimits()) - .ToArray(); - - foreach (var limits in plottableLimits) - { - if (!double.IsNaN(limits.XMin)) - { - min = double.IsNaN(min) ? limits.XMin : Math.Min(min, limits.XMin); - } - - if (!double.IsNaN(limits.XMax)) - { - max = double.IsNaN(max) ? limits.XMax : Math.Max(max, limits.XMax); - } - } - - if (double.IsNaN(min) && double.IsNaN(max)) - { - return; - } - - var xAxis = GetXAxis(xAxisIndex); - xAxis.Dims.SetAxis(min, max); - xAxis.Dims.Zoom(zoomFrac); - } - - public void AxisAutoY(int yAxisIndex, double margin = .1) - { - double min = double.NaN; - double max = double.NaN; - double zoomFrac = 1 - margin; - - var plottableLimits = Plottables.Where(x => x is IPlottable) - .Select(x => (IPlottable)x) - .Where(x => x.IsVisible) - .Where(x => x.YAxisIndex == yAxisIndex) - .Select(x => x.GetAxisLimits()) - .ToArray(); - - foreach (var limits in plottableLimits) - { - if (!double.IsNaN(limits.YMin)) - { - min = double.IsNaN(min) ? limits.YMin : Math.Min(min, limits.YMin); - } - - if (!double.IsNaN(limits.YMax)) - { - max = double.IsNaN(max) ? limits.YMax : Math.Max(max, limits.YMax); - } - } - - if (double.IsNaN(min) && double.IsNaN(max)) - { - return; - } - - var yAxis = GetYAxis(yAxisIndex); - yAxis.Dims.SetAxis(min, max); - yAxis.Dims.Zoom(zoomFrac); - } - - /// - /// Store axis limits (useful for storing state upon a MouseDown event) - /// - public void RememberAxisLimits() - { - AxisAutoUnsetAxes(); - foreach (Axis axis in Axes) - { - axis.Dims.Remember(); - } - } - - /// - /// Recall axis limits (useful for recalling state from a previous MouseDown event) - /// - public void RecallAxisLimits() - { - foreach (Axis axis in Axes) - { - axis.Dims.Recall(); - } - } - - public float MouseDownX { get; private set; } - public float MouseDownY { get; private set; } - - /// - /// Remember mouse position (do this before calling MousePan or MouseZoom) - /// - public void MouseDown(float mouseDownX, float mouseDownY) - { - RememberAxisLimits(); - MouseDownX = mouseDownX; - MouseDownY = mouseDownY; - } - - /// - /// Pan all axes based on the mouse position now vs that last given to MouseDown() - /// - public void MousePan(float mouseNowX, float mouseNowY) - { - RecallAxisLimits(); - AxesPanPx(MouseDownX - mouseNowX, mouseNowY - MouseDownY); - } - - /// - /// Zoom all axes based on the mouse position now vs that last given to MouseDown() - /// - public void MouseZoom(float mouseNowX, float mouseNowY) - { - RecallAxisLimits(); - AxesZoomPx(mouseNowX - MouseDownX, MouseDownY - mouseNowY); - } - - public void MouseZoomRect(float mouseNowX, float mouseNowY, bool finalize = false) - { - float left = Math.Min(MouseDownX, mouseNowX); - float right = Math.Max(MouseDownX, mouseNowX); - float top = Math.Min(MouseDownY, mouseNowY); - float bottom = Math.Max(MouseDownY, mouseNowY); - float width = right - left; - float height = bottom - top; - - if (finalize) - { - double x1 = XAxis.Dims.GetUnit(left); - double x2 = XAxis.Dims.GetUnit(right); - double y1 = YAxis.Dims.GetUnit(bottom); - double y2 = YAxis.Dims.GetUnit(top); - ZoomRectangle.Clear(); - AxisSet(x1, x2, y1, y2); - } - else - { - // TODO: dont require data offset shifting prior to calling this - ZoomRectangle.Set(left - XAxis.Dims.DataOffsetPx, top - YAxis.Dims.DataOffsetPx, width, height); - } - } - - /// - /// Ensure all axes have the same size and offset as the primary X and Y axis - /// - public void CopyPrimaryLayoutToAllAxes() - { - foreach (Axis axis in Axes) - { - if (axis.IsHorizontal) - { - axis.Dims.Resize(Width, XAxis.Dims.DataSizePx, XAxis.Dims.DataOffsetPx); - } - else - { - axis.Dims.Resize(Height, YAxis.Dims.DataSizePx, YAxis.Dims.DataOffsetPx); - } - } - } - - /// - /// Automatically adjust the layout for every axis - /// - public void LayoutAuto() - { - int[] xIndexes = HorizontalAxes.Select(x => x.AxisIndex).Distinct().ToArray(); - int[] yIndexes = VerticalAxes.Select(x => x.AxisIndex).Distinct().ToArray(); - - foreach (int xAxisIndex in xIndexes) - { - LayoutAuto(xAxisIndex, 0); - } - - foreach (int yAxisIndex in yIndexes) - { - LayoutAuto(0, yAxisIndex); - } - } - - private void LayoutAuto(int xAxisIndex, int yAxisIndex) - { - // TODO: separate this into distinct X and Y functions (requires refactoring plottable interface) - bool atLeastOneAxisIsZero = xAxisIndex == 0 || yAxisIndex == 0; - if (!atLeastOneAxisIsZero) - { - throw new InvalidOperationException(); - } - - // Adjust padding around the data area to accommodate title and tick labels. - // - // This is a chicken-and-egg problem: - // * TICK DENSITY depends on the DATA AREA SIZE - // * DATA AREA SIZE depends on LAYOUT PADDING - // * LAYOUT PADDING depends on MAXIMUM LABEL SIZE - // * MAXIMUM LABEL SIZE depends on TICK DENSITY - // - // To solve this, start by assuming data area size == figure size and layout padding == 0, - // then calculate ticks, then set padding based on the largest tick, then re-calculate ticks. - - // axis limits shall not change - var dims = GetPlotDimensions(xAxisIndex, yAxisIndex, scaleFactor: 1.0); - var limits = (dims.XMin, dims.XMax, dims.YMin, dims.YMax); - var figSize = new SizeF(Width, Height); - - // first-pass tick calculation based on full image size - var dimsFull = new PlotDimensions(figSize, figSize, new PointF(0, 0), limits, scaleFactor: 1); - - foreach (var axis in Axes) - { - bool isMatchingXAxis = axis.IsHorizontal && axis.AxisIndex == xAxisIndex; - bool isMatchingYAxis = axis.IsVertical && axis.AxisIndex == yAxisIndex; - if (isMatchingXAxis || isMatchingYAxis) - { - axis.RecalculateTickPositions(dimsFull); - axis.RecalculateAxisSize(); - } - } - - // now adjust our layout based on measured axis sizes - RecalculateDataPadding(); - - // now recalculate ticks based on new layout - var dataSize = new SizeF(XAxis.Dims.DataSizePx, YAxis.Dims.DataSizePx); - var dataOffset = new PointF(XAxis.Dims.DataOffsetPx, YAxis.Dims.DataOffsetPx); - - var dims3 = new PlotDimensions(figSize, dataSize, dataOffset, limits, scaleFactor: 1.0); - foreach (var axis in Axes) - { - bool isMatchingXAxis = axis.IsHorizontal && axis.AxisIndex == xAxisIndex; - bool isMatchingYAxis = axis.IsVertical && axis.AxisIndex == yAxisIndex; - if (isMatchingXAxis || isMatchingYAxis) - { - axis.RecalculateTickPositions(dims3); - } - } - - // adjust the layout based on measured tick label sizes - RecalculateDataPadding(); - } - - private void RecalculateDataPadding() - { - Edge[] edges = { Edge.Left, Edge.Right, Edge.Top, Edge.Bottom }; - foreach (var edge in edges) - { - float offset = 0; - foreach (var axis in Axes.Where(x => x.Edge == edge)) - { - axis.SetOffset(offset); - offset += axis.GetSize(); - } - } - - float padLeft = Axes.Where(x => x.Edge == Edge.Left).Select(x => x.GetSize()).Sum(); - float padRight = Axes.Where(x => x.Edge == Edge.Right).Select(x => x.GetSize()).Sum(); - float padBottom = Axes.Where(x => x.Edge == Edge.Bottom).Select(x => x.GetSize()).Sum(); - float padTop = Axes.Where(x => x.Edge == Edge.Top).Select(x => x.GetSize()).Sum(); - - foreach (Axis axis in Axes) - { - if (axis.IsHorizontal) - { - axis.Dims.SetPadding(padLeft, padRight); - } - else - { - axis.Dims.SetPadding(padTop, padBottom); - } - } - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/StarAxis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/StarAxis.cs deleted file mode 100644 index 971042f60..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/StarAxis.cs +++ /dev/null @@ -1,242 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class StarAxis - { - /// - /// The ticks for each spoke. - /// - public StarAxisTick[] Ticks { get; set; } - - /// - /// The number of spokes to draw. - /// - public int NumberOfSpokes { get; set; } - - /// - /// Labels for each category. - /// Length must be equal to the number of columns (categories) in the original data. - /// - public string[] CategoryLabels; - - /// - /// Icons for each category. - /// Length must be equal to the number of columns (categories) in the original data. - /// - public System.Drawing.Image[] CategoryImages; - - /// - /// Controls rendering style of the concentric circles (ticks) of the web - /// - public RadarAxis AxisType { get; set; } - - /// - /// Indicates the type of axis chart to render - /// - public ImagePlacement ImagePlacement { get; set; } - - /// - /// Color of the axis lines and concentric circles representing ticks - /// - public Color WebColor { get; set; } = Color.Gray; - - /// - /// If true, each value will be written in text on the plot. - /// - public bool ShowAxisValues { get; set; } = true; - - /// - /// If true, category labels will be written in text on the plot (provided they exist) - /// - public bool ShowCategoryLabels { get; set; } = true; - - /// - /// Determines whether each spoke should be labeled, or just the first - /// - public bool LabelEachSpoke { get; set; } = false; - - /// - /// The drawing surface to use. - /// - public Graphics Graphics { get; set; } - - /// - /// Font used for labeling values on the plot - /// - public Font Font = new(); - - /// - /// Determines the width of each spoke and the axis lines. - /// - public int LineWidth { get; set; } = 1; - - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - double sweepAngle = 2 * Math.PI / NumberOfSpokes; - double minScale = new double[] { dims.PxPerUnitX, dims.PxPerUnitX }.Min(); - PointF origin = new(dims.GetPixelX(0), dims.GetPixelY(0)); - - RenderRings(origin, minScale, sweepAngle); - RenderSpokes(origin, minScale, sweepAngle); - - if (CategoryImages is not null) - { - RenderImages(origin, minScale, sweepAngle); - } - else if (ShowCategoryLabels && CategoryLabels is not null) - { - RenderLabels(dims, origin, minScale, sweepAngle); - } - } - - private void RenderRings(PointF origin, double minScale, double sweepAngle) - { - using Pen pen = GDI.Pen(WebColor, LineWidth); - - foreach (var tick in Ticks) - { - double tickDistancePx = tick.Location * minScale; - - if (AxisType == RadarAxis.Circle) - { - Graphics.DrawEllipse(pen, - x: (int)(origin.X - tickDistancePx), - y: (int)(origin.Y - tickDistancePx), - width: (int)(tickDistancePx * 2), - height: (int)(tickDistancePx * 2)); - } - else if (AxisType == RadarAxis.Polygon) - { - PointF[] points = new PointF[NumberOfSpokes]; - for (int j = 0; j < NumberOfSpokes; j++) - { - float x = (float)(tickDistancePx * Math.Cos(sweepAngle * j - Math.PI / 2) + origin.X); - float y = (float)(tickDistancePx * Math.Sin(sweepAngle * j - Math.PI / 2) + origin.Y); - points[j] = new PointF(x, y); - } - Graphics.DrawPolygon(pen, points); - } - } - } - - private void RenderSpokes(PointF origin, double minScale, double sweepAngle) - { - using Pen pen = GDI.Pen(WebColor, LineWidth); - using System.Drawing.Font font = GDI.Font(Font); - using Brush fontBrush = GDI.Brush(Font.Color); - using StringFormat sf = new(); - - for (int i = 0; i < NumberOfSpokes; i++) - { - PointF destination = new( - x: (float)(1.1 * Math.Cos(sweepAngle * i - Math.PI / 2) * minScale + origin.X), - y: (float)(1.1 * Math.Sin(sweepAngle * i - Math.PI / 2) * minScale + origin.Y)); - - Graphics.DrawLine(pen, origin, destination); - - for (int j = 0; j < Ticks.Length; j++) - { - double tickDistancePx = Ticks[j].Location * minScale; - - if (ShowAxisValues) - { - if (LabelEachSpoke) - { - float x = (float)(tickDistancePx * Math.Cos(sweepAngle * i - Math.PI / 2) + origin.X); - float y = (float)(tickDistancePx * Math.Sin(sweepAngle * i - Math.PI / 2) + origin.Y); - - sf.Alignment = x < origin.X ? StringAlignment.Far : StringAlignment.Near; - sf.LineAlignment = y < origin.Y ? StringAlignment.Far : StringAlignment.Near; - - double val = Ticks[j].Labels[i]; - Graphics.DrawString($"{val:f1}", font, fontBrush, x, y, sf); - } - else if (i == 0) - { - double val = Ticks[j].Labels[0]; - Graphics.DrawString($"{val:f1}", font, fontBrush, origin.X, (float)(-tickDistancePx + origin.Y), sf); - } - } - } - } - } - - private void RenderImages(PointF origin, double minScale, double sweepAngle) - { - for (int i = 0; i < NumberOfSpokes; i++) - { - double sweepOffset = ImagePlacement == ImagePlacement.Inside ? sweepAngle / 2 : 0; - double cosinus = Math.Cos(sweepAngle * i + sweepOffset - Math.PI / 2); - double sinus = Math.Sin(sweepAngle * i + sweepOffset - Math.PI / 2); - int imageWidth = CategoryImages[i].Width; - int imageHeight = CategoryImages[i].Height; - - PointF imageDestination = new( - (float)(1.45 * cosinus * minScale + origin.X - imageWidth / 2 * cosinus), - (float)(1.45 * sinus * minScale + origin.Y - imageHeight / 2 * sinus)); - - RectangleF rect = new( - x: imageDestination.X - CategoryImages[i].Width / 2, - y: imageDestination.Y - CategoryImages[i].Height / 2, - width: CategoryImages[i].Width, - height: CategoryImages[i].Height); - - Graphics.DrawImage(CategoryImages[i], rect); - } - } - - private void RenderLabels(PlotDimensions dims, PointF origin, double minScale, double sweepAngle) - { - using System.Drawing.Font font = GDI.Font(Font); - using Brush fontBrush = GDI.Brush(Font.Color); - using StringFormat sf = GDI.StringFormat(HorizontalAlignment.Center, VerticalAlignment.Middle); - - for (int i = 0; i < NumberOfSpokes; i++) - { - PointF textDestination = new( - (float)(1.3 * Math.Cos(sweepAngle * i - Math.PI / 2) * minScale + origin.X), - (float)(1.3 * Math.Sin(sweepAngle * i - Math.PI / 2) * minScale + origin.Y)); - - if (Math.Abs(textDestination.X - origin.X) < 0.1) - { - sf.Alignment = StringAlignment.Center; - } - else - { - sf.Alignment = dims.GetCoordinateX(textDestination.X) < 0 ? StringAlignment.Far : StringAlignment.Near; - } - - Graphics.DrawString(CategoryLabels[i], font, fontBrush, textDestination, sf); - } - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/StarAxisTick.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/StarAxisTick.cs deleted file mode 100644 index f71852cb3..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/StarAxisTick.cs +++ /dev/null @@ -1,47 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public struct StarAxisTick - { - public readonly double Location; - public readonly double[] Labels; - - public StarAxisTick(double location, double[] labels) - { - Location = location; - Labels = labels; - } - - public StarAxisTick(double location, double max) - { - Location = location; - Labels = new double[] { location * max }; - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Style.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Style.cs deleted file mode 100644 index c9ce5548b..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Style.cs +++ /dev/null @@ -1,63 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public static class Style - { - public static IStyle Black => new Black(); - public static IStyle Blue1 => new Blue1(); - public static IStyle Blue2 => new Blue2(); - public static IStyle Blue3 => new Blue3(); - public static IStyle Burgundy => new Burgundy(); - public static IStyle Control => new Control(); - public static IStyle Default => new Default(); - public static IStyle Gray1 => new Gray1(); - public static IStyle Gray2 => new Gray2(); - public static IStyle Hazel => new Hazel(); - public static IStyle Light1 => new Light1(); - public static IStyle Light2 => new Light2(); - public static IStyle Monospace => new Monospace(); - public static IStyle Pink => new Pink(); - public static IStyle Seaborn => new Seaborn(); - - /// - /// Return an array containing every available style - /// - public static IStyle[] GetStyles() - { - return Assembly.GetExecutingAssembly() - .GetTypes() - .Where(x => x.IsClass) - .Where(x => !x.IsAbstract) - .Where(x => x.GetInterfaces().Contains(typeof(IStyle))) - .Select(x => (IStyle)FormatterServices.GetUninitializedObject(x)) - .ToArray(); - } - } - -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Tools.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Tools.cs deleted file mode 100644 index 249d5c266..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Tools.cs +++ /dev/null @@ -1,531 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public static class Tools - { - public static Color GetRandomColor(Random rand = null) - { - if (rand is null) - { - rand = new Random(); - } - - Color randomColor = Color.FromArgb(rand.Next(256), rand.Next(256), rand.Next(256)); - return randomColor; - } - - public static Brush GetRandomBrush() - { - return new SolidBrush(GetRandomColor()); - } - - public static Color Blend(this Color colorA, Color colorB, double fractionA) - { - fractionA = Math.Max(fractionA, 0); - fractionA = Math.Min(fractionA, 1); - byte r = (byte)((colorA.R * fractionA) + colorB.R * (1 - fractionA)); - byte g = (byte)((colorA.G * fractionA) + colorB.G * (1 - fractionA)); - byte b = (byte)((colorA.B * fractionA) + colorB.B * (1 - fractionA)); - return Color.FromArgb(r, g, b); - } - - [Obsolete("use ScottPlot.Plot.Version", true)] - public static string GetVersionString(bool justThreeDigits = true) - { - Version ver = typeof(Plot).Assembly.GetName().Version; - if (justThreeDigits) - { - return $"{ver.Major}.{ver.Minor}.{ver.Build}"; - } - else - { - return ver.ToString(); - } - } - - public static string GetFrameworkVersionString() - { - return $".NET {Environment.Version.ToString()}"; - } - - public static string BitmapHash(Bitmap bmp) - { - byte[] bmpBytes = BitmapToBytes(bmp); - var md5 = MD5.Create(); - StringBuilder hashString = new StringBuilder(); - byte[] hashBytes = md5.ComputeHash(bmpBytes); - for (int i = 0; i < hashBytes.Length; i++) - { - hashString.Append(hashBytes[i].ToString("X2")); - } - - return hashString.ToString(); - } - - public static Bitmap BitmapFromBytes(byte[] bytes, Size size, PixelFormat format = PixelFormat.Format8bppIndexed) - { - Bitmap bmp = new Bitmap(size.Width, size.Height, format); - Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height); - BitmapData bmpData = bmp.LockBits(rect, ImageLockMode.ReadWrite, bmp.PixelFormat); - Marshal.Copy(bytes, 0, bmpData.Scan0, bytes.Length); - bmp.UnlockBits(bmpData); - return bmp; - } - - public static byte[] BitmapToBytes(Bitmap bmp) - { - int bytesPerPixel = System.Drawing.Image.GetPixelFormatSize(bmp.PixelFormat) / 8; - byte[] bytes = new byte[bmp.Width * bmp.Height * bytesPerPixel]; - Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height); - BitmapData bmpData = bmp.LockBits(rect, ImageLockMode.ReadOnly, bmp.PixelFormat); - //byte[] bytes = new byte[bmpData.Stride * bmp.Height * bytesPerPixel]; - Marshal.Copy(bmpData.Scan0, bytes, 0, bytes.Length); - bmp.UnlockBits(bmpData); - return bytes; - } - - [Obsolete("use ScottPlot.Config.Fonts.GetValidFontName()", error: true)] - public static string VerifyFont(string fontName) - { - return null; - } - - public static string ScientificNotation(double value, int decimalPlaces = 2, bool preceedWithPlus = true) - { - string output; - - if ((Math.Abs(value) > .0001) && (Math.Abs(value) < 10000)) - { - value = Math.Round(value, decimalPlaces); - output = value.ToString(); - } - else - { - int exponent = (int)Math.Log10(value); - double multiplier = Math.Pow(10, exponent); - double mantissa = value / multiplier; - mantissa = Math.Round(mantissa, decimalPlaces); - output = $"{mantissa}e{exponent}"; - } - - if (preceedWithPlus && !output.StartsWith("-")) - { - output = $"+{output}"; - } - - return output; - } - - public static void DesignerModeDemoPlot(Plot plt) - { - int pointCount = 101; - double pointSpacing = .01; - double[] dataXs = DataGen.Consecutive(pointCount, pointSpacing); - double[] dataSin = DataGen.Sin(pointCount); - double[] dataCos = DataGen.Cos(pointCount); - - plt.AddScatter(dataXs, dataSin); - plt.AddScatter(dataXs, dataCos); - plt.AxisAuto(0); - plt.Title("ScottPlot User Control"); - plt.YLabel("Sample Data"); - } - - public static double[] DateTimesToDoubles(DateTime[] dateTimeArray) - { - double[] positions = new double[dateTimeArray.Length]; - for (int i = 0; i < positions.Length; i++) - { - positions[i] = dateTimeArray[i].ToOADate(); - } - - return positions; - } - - private static double[] DoubleArray(T[] dataIn) - { - double[] dataOut = new double[dataIn.Length]; - for (int i = 0; i < dataIn.Length; i++) - { - dataOut[i] = Convert.ToDouble(dataIn[i]); - } - - return dataOut; - } - - public static double[] DoubleArray(byte[] dataIn) - { - return DoubleArray(dataIn); - } - - public static double[] DoubleArray(int[] dataIn) - { - return DoubleArray(dataIn); - } - - public static double[] DoubleArray(float[] dataIn) - { - return DoubleArray(dataIn); - } - - public static void ApplyBaselineSubtraction(double[] data, int index1, int index2) - { - double baselineSum = 0; - for (int i = index1; i < index2; i++) - { - baselineSum += data[i]; - } - - double baselineAverage = baselineSum / (index2 - index1); - for (int i = 0; i < data.Length; i++) - { - data[i] -= baselineAverage; - } - } - - public static double[] Log10(double[] dataIn) - { - double[] dataOut = new double[dataIn.Length]; - for (int i = 0; i < dataOut.Length; i++) - { - dataOut[i] = dataIn[i] > 0 ? Math.Log10(dataIn[i]) : 0; - } - - return dataOut; - } - - public static (double[] xs, double[] ys) ConvertPolarCoordinates(double[] rs, double[] thetas) - { - double[] xs = new double[rs.Length]; - double[] ys = new double[rs.Length]; - - for (int i = 0; i < rs.Length; i++) - { - double x = rs[i]; - double y = thetas[i]; - - xs[i] = x * Math.Cos(y); - ys[i] = x * Math.Sin(y); - } - - return (xs, ys); - } - - public static void LaunchBrowser(string url = "https://ScottPlot.NET") - { - // A cross-platform .NET-Core-safe function to launch a URL in the browser - Debug.WriteLine($"Launching URL: {url}"); - try - { - Process.Start(url); - } - catch - { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") { CreateNoWindow = true }); - } - else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - Process.Start("xdg-open", url); - } - else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - { - Process.Start("open", url); - } - else - { - throw; - } - } - } - - public static double[] Round(double[] data, int decimals = 2) - { - double[] rounded = new double[data.Length]; - for (int i = 0; i < data.Length; i++) - { - rounded[i] = Math.Round(data[i], decimals); - } - - return rounded; - } - - /// - /// return a copy of the given array padded with the given value at both sidees - /// - public static double[] Pad(double[] values, int padCount = 1, double padWithLeft = 0, double padWithRight = 0, bool cloneEdges = false) - { - double[] padded = new double[values.Length + padCount * 2]; - - Array.Copy(values, 0, padded, padCount, values.Length); - - if (cloneEdges) - { - padWithLeft = values[0]; - padWithRight = values[values.Length - 1]; - } - - for (int i = 0; i < padCount; i++) - { - padded[i] = padWithLeft; - padded[padded.Length - 1 - i] = padWithRight; - } - - return padded; - } - - public static string GetOsName(bool details = true) - { - string name = "Unknown"; - - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - name = "Linux"; - } - else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - { - name = "MacOS"; - } - else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - name = "Windows"; - } - - if (details) - { - name += $" ({Environment.OSVersion})"; - } - - return name; - } - - public static int SimpleHash(double[] input) - { - byte[] bytes = input.SelectMany(n => { return BitConverter.GetBytes(n); }).ToArray(); - int hash = 0; - foreach (byte b in bytes) - { - hash = (hash * 31) ^ b; - } - - return hash; - } - - public static double[,] XYToIntensitiesGaussian(int[] xs, int[] ys, int width, int height, int sigma) - { - static double NormPDF(double x, double mu, double sigma) => - (1 / (sigma * Math.Sqrt(2 * Math.PI))) * Math.Exp(-0.5 * (x - mu / sigma) * (x - mu / sigma)); - - double[,] output = new double[height, width]; - double[,] intermediate = new double[height, width]; // Each cell has the number of hits. This is the array before any blurring - - int radius = 2; // 2 Standard deviations is ~0.95, i.e. close enough - for (int i = 0; i < xs.Length; i++) - { - if (xs[i] >= 0 && xs[i] < width && ys[i] >= 0 && ys[i] < height) - { - intermediate[ys[i], xs[i]] += 1; - } - } - - double[] kernel = new double[2 * radius * sigma + 1]; - for (int i = 0; i < kernel.Length; i++) - { - kernel[i] = NormPDF(i - kernel.Length / 2, 0, sigma); - } - - for (int i = 0; i < height; i++) // Blurs up and down, i.e. a vertical kernel. Gaussian Blurs are special in that it can be decomposed this way, saving time - { - for (int j = 0; j < width; j++) - { - double sum = 0; - double kernelSum = 0; // The kernelSum can be precomputed, but this gives incorrect output at the edges of the image - for (int k = -radius * sigma; k <= radius * sigma; k++) - { - if (i + k >= 0 && i + k < height) - { - sum += intermediate[i + k, j] * kernel[k + kernel.Length / 2]; - kernelSum += kernel[k + kernel.Length / 2]; - } - } - - output[i, j] = sum / kernelSum; - } - } - - for (int i = 0; i < height; i++) // Blurs left and right, i.e. a horizontal kernel - { - for (int j = 0; j < width; j++) - { - double sum = 0; - double kernelSum = 0; - for (int k = -radius * sigma; k <= radius * sigma; k++) - { - if (j + k >= 0 && j + k < width) - { - sum += output[i, j + k] * kernel[k + kernel.Length / 2]; - kernelSum += kernel[k + kernel.Length / 2]; - } - } - - output[i, j] = sum / kernelSum; - } - } - - return output; - } - - public static double[,] XYToIntensitiesDensity(int[] xs, int[] ys, int width, int height, int sampleWidth) - { - double[,] output = new double[height, width]; - (int x, int y)[] points = xs.Zip(ys, (x, y) => (x, y)).ToArray(); - points = points.OrderBy(p => p.x).ToArray(); - int[] xs_sorted = points.Select(p => p.x).ToArray(); - - for (int i = 0; i < height - height % sampleWidth; i += sampleWidth) - { - for (int j = 0; j < width - width % sampleWidth; j += sampleWidth) - { - int count = 0; - for (int k = 0; k < sampleWidth; k++) - { - for (int l = 0; l < sampleWidth; l++) - { - int index = Array.BinarySearch(xs_sorted, j + l); - if (index > 0) - { - for (int m = index; m < xs.Length; m++) - { //Multiple points w/ same x value - if (points[m].x == j + l && points[m].y == i + k) - { - count++; // Increments number of hits in sampleWidth sized square - } - } - } - } - } - - for (int k = 0; k < sampleWidth; k++) - { - for (int l = 0; l < sampleWidth; l++) - { - output[i + k, j + l] = count; - } - } - } - } - - return output; - } - - public static double[,] XYToIntensities(IntensityMode mode, int[] xs, int[] ys, int width, int height, int sampleWidth) - { - return mode switch - { - IntensityMode.Gaussian => XYToIntensitiesGaussian(xs, ys, width, height, sampleWidth), - IntensityMode.Density => XYToIntensitiesDensity(xs, ys, width, height, sampleWidth), - _ => throw new NotImplementedException($"{nameof(mode)} is not a supported {nameof(IntensityMode)}"), - }; - } - - public static string ToDifferentBase(double number, int radix = 16, int decimalPlaces = 3, int padInteger = 0, bool dropTrailingZeroes = true, char decimalSymbol = '.') - { - if (number < 0) - { - return - $"-{ToDifferentBase(Math.Abs(number), radix, decimalPlaces, padInteger, dropTrailingZeroes, decimalSymbol)}"; - } - else if (number == 0) - { - return "0"; - } - - char[] symbols = "0123456789ABCDEF".ToCharArray(); - if (radix > symbols.Length || radix <= 1) - { - throw new ArgumentOutOfRangeException(nameof(radix)); - } - - double epsilon = Math.Pow(radix, -decimalPlaces); - - if (radix > symbols.Length) - { - throw new ArgumentOutOfRangeException(nameof(radix)); - } - - int integerLength = (int)Math.Ceiling(Math.Log(number, radix)); - int decimalLength = number % 1 > epsilon ? decimalPlaces : 0; - double decimalPart = number % 1; - string output = ""; - - for (int i = 0; i < integerLength; i++) - { - if (number == radix && padInteger == 0) - { - output = $"10{output}"; - } - else - { - output = symbols[(int)(number % radix)] + output; - } - number /= radix; - } - - while (output.Length < padInteger) - { - output = $"0{output}"; - } - - if (decimalLength != 0) - { - if (output == "") - { - output += "0"; - } - output += decimalSymbol; - output += ToDifferentBase(Math.Round(decimalPart * Math.Pow(radix, decimalPlaces)), radix, decimalPlaces, decimalPlaces, dropTrailingZeroes, decimalSymbol); - if (dropTrailingZeroes) - { - while (output.Last() == '0') - { - output = output.Substring(0, output.Length - 1); - } - - if (output.Last() == decimalSymbol) - { - output = output.Substring(0, output.Length - 1); - } - } - } - - return output; - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Validate.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Validate.cs deleted file mode 100644 index 55b3cf6fa..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Classes/Validate.cs +++ /dev/null @@ -1,287 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public static class Validate - { - private static string ValidLabel(string label) => - string.IsNullOrWhiteSpace(label) ? "[unknown variable]" : label; - - /// - /// Throw an exception if the value is NaN or infinity - /// - public static void AssertIsReal(string label, double value) - { - label = ValidLabel(label); - - if (double.IsNaN(value)) - { - throw new InvalidOperationException($"{label} is NaN"); - } - - if (double.IsInfinity(value)) - { - throw new InvalidOperationException($"{label} is infinity"); - } - } - - /// - /// Throw an exception if the array is null or contains NaN or infinity - /// - public static void AssertAllReal(string label, double[] values) - { - label = ValidLabel(label); - - if (values is null) - { - throw new InvalidOperationException($"{label} must not be null"); - } - - for (int i = 0; i < values.Length; i++) - { - if (double.IsNaN(values[i]) || double.IsInfinity(values[i])) - { - throw new InvalidOperationException($"{label} index {i} is invalid ({values[i]})"); - } - } - } - - /// - /// Throw an exception if the array is null or contains NaN or infinity - /// - public static void AssertAllReal(string label, T[] values) - { - if (typeof(T) == typeof(double)) - { - AssertAllReal(label, (double[])(object)values); - } - else if (typeof(T) == typeof(float)) - { - AssertAllReal(label, (float[])(object)values); - } - else - { - throw new InvalidOperationException("values must be float[] or double[]"); - } - } - - /// - /// Throw an exception if one elemnt is equal to or less than the previous element - /// - public static void AssertAscending(string label, double[] values) - { - label = ValidLabel(label); - - if (values is null) - { - throw new InvalidOperationException($"{label} must not be null"); - } - - for (int i = 0; i < values.Length - 1; i++) - { - if (values[i] >= values[i + 1]) - { - throw new InvalidOperationException($"{label} must be ascending values (index {i} >= {i + 1}"); - } - } - } - - /// - /// Throw an exception if one elemnt is equal to or less than the previous element - /// - public static void AssertAscending(string label, T[] values) - { - label = ValidLabel(label); - - if (values is null) - { - throw new InvalidOperationException($"{label} must not be null"); - } - - for (int i = 0; i < values.Length - 1; i++) - { - if (Convert.ToDouble(values[i]) >= Convert.ToDouble(values[i + 1])) - { - throw new InvalidOperationException($"{label} must be ascending values (index {i} >= {i + 1}"); - } - } - } - - /// - /// Throw an exception if the array does not contain at least one element - /// - public static void AssertHasElements(string label, double[] values) - { - label = ValidLabel(label); - - if (values is null) - { - throw new InvalidOperationException($"{label} must not be null"); - } - - if (values.Length == 0) - { - throw new InvalidOperationException($"{label} must contain at least one element"); - } - } - - /// - /// Throw an exception if the array does not contain at least one element - /// - public static void AssertHasElements(string label, T[] values) - { - label = ValidLabel(label); - - if (values is null) - { - throw new InvalidOperationException($"{label} must not be null"); - } - - if (values.Length == 0) - { - throw new InvalidOperationException($"{label} must contain at least one element"); - } - } - - /// - /// Throw an exception if the array does not contain at least one element - /// - public static void AssertHasElements(string label, Color[] values) - { - label = ValidLabel(label); - - if (values is null) - { - throw new InvalidOperationException($"{label} must not be null"); - } - - if (values.Length == 0) - { - throw new InvalidOperationException($"{label} must contain at least one element"); - } - } - - /// - /// Throw an exception if the array does not contain at least one element - /// - public static void AssertHasElements(string label, string[] values) - { - label = ValidLabel(label); - - if (values is null) - { - throw new InvalidOperationException($"{label} must not be null"); - } - - if (values.Length == 0) - { - throw new InvalidOperationException($"{label} must contain at least one element"); - } - } - - /// - /// Throw an exception if non-null arrays have different lengths - /// - public static void AssertEqualLength(string label, - double[] a, double[] b = null, double[] c = null, - double[] d = null, double[] e = null, double[] f = null) - { - label = ValidLabel(label); - - if (!IsEqualLength(a, b, c, d, e, f)) - { - throw new InvalidOperationException($"{label} must all have same length"); - } - } - - /// - /// Throw an exception if non-null arrays have different lengths - /// - public static void AssertEqualLength(string label, T1[] a, T2[] b) - { - label = ValidLabel(label); - - if (a.Length != b.Length) - { - throw new InvalidOperationException($"{label} must all have same length"); - } - } - - /// - /// Returns true if all non-null arguments have equal length - /// - public static bool IsEqualLength(double[] a, double[] b = null, double[] c = null, - double[] d = null, double[] e = null, double[] f = null) - { - if (a is null) - { - throw new InvalidOperationException($"first array must not be null"); - } - - if (b is object && b.Length != a.Length) - { - return false; - } - - if (c is object && c.Length != a.Length) - { - return false; - } - - if (d is object && d.Length != a.Length) - { - return false; - } - - if (e is object && e.Length != a.Length) - { - return false; - } - - if (f is object && f.Length != a.Length) - { - return false; - } - - return true; - } - - /// - /// Throws an exception if the string is null, empty, or only contains whitespace - /// - public static void AssertHasText(string label, string value) - { - label = ValidLabel(label); - - if (string.IsNullOrWhiteSpace(value)) - { - throw new InvalidOperationException($"{label} must contain text"); - } - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/Backend.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/Backend.cs deleted file mode 100644 index 969f001f2..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/Backend.cs +++ /dev/null @@ -1,796 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -/* This file describes the ScottPlot back-end control module. - * - * Goals for this module: - * - Interact with the Plot object so controls don't have to. - * - Wrap/abstract mouse interaction logic so controls don't have to implement it. - * - Use events to tell controls when to update the image or change the mouse cursor. - * - Render calls are non-blocking so GUI/controls aren't slowed by render requests. - * - Delayed high quality renders are possible after mouse interaction stops. - * - * Default Controls: - * - * - Left-click-drag: pan - * - Right-click-drag: zoom - * - Middle-click-drag: zoom region - * - ALT+Left-click-drag: zoom region - * - Scroll wheel: zoom to cursor - * - * - Right-click: show menu - * - Middle-click: auto-axis - * - Double-click: show benchmark - * - * - CTRL+Left-click-drag to pan horizontally - * - SHIFT+Left-click-drag to pan vertically - * - CTRL+Right-click-drag to zoom horizontally - * - SHIFT+Right-click-drag to zoom vertically - * - CTRL+SHIFT+Right-click-drag to zoom evenly - * - SHIFT+click-drag draggables for fixed-size dragging - * - * Configurable options: - * - * - left-click-drag pan - * - right-click-drag zoom - * - lock vertical or horizontal axis - * - middle-click auto-axis margin - * - double-click benchmark toggle - * - scrollwheel zoom - * - quality (anti-aliasing on/off) for various actions - * - delayed high quality render after low-quality interactive renders - * - */ - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// The control back end module contains all the logic required to manage a mouse-interactive - /// plot to display in a user control. However, this module contains no control-specific dependencies. - /// User controls can instantiate this object, pass mouse and resize event information in, and have - /// renders triggered using events. - /// - public class ControlBackEnd - { - /// - /// This event is invoked when an existing Bitmap is redrawn. - /// e.g., after rendering following a click-drag-pan mouse event. - /// - public event EventHandler BitmapUpdated = delegate { }; - - /// - /// This event is invoked after a new Bitmap was created. - /// e.g., after resizing the control, requiring a new Bitmap of a different size - /// - public event EventHandler BitmapChanged = delegate { }; - - /// - /// This event is invoked when the cursor is supposed to change. - /// Cursor changes may be required when hovering over draggable plottable objects. - /// - public event EventHandler CursorChanged = delegate { }; - - /// - /// This event is invoked when the axis limts change. - /// This is typically the result of a pan or zoom operation. - /// - public event EventHandler AxesChanged = delegate { }; - - /// - /// This event is invoked when the user right-clicks the control with the mouse. - /// It is typically used to deploy a context menu. - /// - public event EventHandler RightClicked = delegate { }; - - /// - /// This event is invoked after the mouse moves while dragging a draggable plottable. - /// - public event EventHandler PlottableDragged = delegate { }; - - /// - /// This event is invoked after the mouse moves while dragging a draggable plottable. - /// - public event EventHandler PlottableDropped = delegate { }; - - /// - /// The control configuration object stores advanced customization and behavior settings - /// for mouse-interactive plots. - /// - public readonly Configuration Configuration = new(); - - /// - /// True if the middle mouse button is pressed - /// - private bool IsMiddleDown; - - /// - /// True if the right mouse button is pressed - /// - private bool IsRightDown; - - /// - /// True if the left mouse button is pressed - /// - private bool IsLeftDown; - - /// - /// Current position of the mouse in pixels - /// - private float MouseLocationX; - - /// - /// Current position of the mouse in pixels - /// - private float MouseLocationY; - - /// - /// Holds the plottable actively being dragged with the mouse. - /// Contains null if no plottable is being dragged. - /// - private IDraggable PlottableBeingDragged = null; - - /// - /// True when a zoom rectangle is being drawn and the mouse button is still down - /// - private bool IsZoomingRectangle; - - /// - /// True if a zoom rectangle is being actively drawn using ALT + left click - /// - private bool IsZoomingWithAlt; - - /// - /// The plot underlying this control. - /// - public Plot Plot { get; private set; } - - /// - /// The settings object underlying the plot. - /// - private Settings Settings; - - /// - /// The latest render is stored in this bitmap. - /// New renders may be performed on this existing bitmap. - /// When a new bitmap is created, this bitmap will be stored in OldBitmaps and eventually disposed. - /// - private Bitmap Bmp; - - /// - /// Bitmaps that are created are stored here so they can be kept track of and - /// disposed properly when new bitmaps are created. - /// - private readonly Queue OldBitmaps = new(); - - /// - /// Store last render limits so new renders can know whether the axis limits - /// have changed and decide whether to invoke the AxesChanged event or not. - /// - private AxisLimits LimitsOnLastRender = new(); - - /// - /// Unique identifier of the plottables list that was last rendered. - /// This value is used to determine if the plottables list was modified (requiring a re-render). - /// - private int PlottablesIdentifierAtLastRender = 0; - - /// - /// This is set to True while the render loop is running. - /// This prevents multiple renders from occurring at the same time. - /// - private bool currentlyRendering = false; - - /// - /// The style of cursor the control should display - /// - public Cursor Cursor { get; private set; } = Cursor.Arrow; - - /// - /// The events processor invokes renders in response to custom events - /// - private readonly EventsProcessor EventsProcessor; - - /// - /// The event factor creates event objects to be handled by the event processor - /// - private UIEventFactory EventFactory; - - /// - /// Number of times the current bitmap has been rendered on. - /// - private int BitmapRenderCount = 0; - - /// - /// Total number of renders performed. - /// Note that at least one render occurs before the first request to measure the layout and calculate data area. - /// This means the first render increments this number twice. - /// - public int RenderCount { get; private set; } = 0; - - /// - /// Tracks the total distance the mouse was click-dragged (rectangular pixel units) - /// - private float MouseDownTravelDistance; - - /// - /// True if the mouse was dragged (with a button down) long enough to quality as a drag instead of a click - /// - private bool MouseDownDragged => MouseDownTravelDistance > Configuration.IgnoreMouseDragDistance; - - - /// - /// Indicates whether Render() has been explicitly called by the user. - /// Renders requested by resize events do not count. - /// - public bool WasManuallyRendered; - - /// - /// Variable name for the user control tied to this backend. - /// - public readonly string ControlName; - - /// - /// Create a back-end for a user control - /// - /// initial bitmap size (pixels) - /// initial bitmap size (pixels) - /// variable name of the user control using this backend - public ControlBackEnd(float width, float height, string name = "UnamedControl") - { - EventFactory = new UIEventFactory(Configuration, Settings, Plot); - EventsProcessor = new EventsProcessor( - renderAction: (lowQuality) => Render(lowQuality), - renderDelay: (int)Configuration.ScrollWheelZoomHighQualityDelay); - ControlName = name; - Reset(width, height); - } - - /// - /// The host control may instantiate the back-end and start sending it events - /// before it has fully connected its event handlers. To prevent processing events before - /// the host is control is ready, the processor will be stopped until is called by the host control. - /// - public void StartProcessingEvents() => EventsProcessor.Enable = true; - - /// - /// Reset the back-end by creating an entirely new plot of the given dimensions - /// - public void Reset(float width, float height) => Reset(width, height, new Plot()); - - /// - /// Reset the back-end by replacing the existing plot with one that has already been created - /// - public void Reset(float width, float height, Plot newPlot) - { - Plot = newPlot; - Settings = Plot.GetSettings(false); - EventFactory = new UIEventFactory(Configuration, Settings, Plot); - WasManuallyRendered = false; - Resize(width, height, useDelayedRendering: false); - } - - /// - /// Return a copy of the list of draggable plottables - /// - private IDraggable[] GetDraggables() => - Settings.Plottables.Where(x => x is IDraggable).Select(x => (IDraggable)x).ToArray(); - - /// - /// Return the draggable plottable under the mouse cursor (or null if there isn't one) - /// - private IDraggable GetDraggableUnderMouse(double pixelX, double pixelY, int snapDistancePixels = 5) - { - double snapWidth = Settings.XAxis.Dims.UnitsPerPx * snapDistancePixels; - double snapHeight = Settings.YAxis.Dims.UnitsPerPx * snapDistancePixels; - - foreach (IDraggable draggable in GetDraggables()) - { - if (draggable.IsUnderMouse(Plot.GetCoordinateX((float)pixelX), Plot.GetCoordinateY((float)pixelY), snapWidth, snapHeight)) - { - if (draggable.DragEnabled) - { - return draggable; - } - } - } - - return null; - } - - /// - /// Return a multi-line string describing the default mouse interactions. - /// This can be useful for displaying a help message in a user control. - /// - public static string GetHelpMessage() - { - var sb = new StringBuilder(); - sb.AppendLine("Left-click-drag: pan"); - sb.AppendLine("Right-click-drag: zoom"); - sb.AppendLine("Middle-click-drag: zoom region"); - sb.AppendLine("ALT+Left-click-drag: zoom region"); - sb.AppendLine("Scroll wheel: zoom to cursor"); - sb.AppendLine(""); - sb.AppendLine("Right-click: show menu"); - sb.AppendLine("Middle-click: auto-axis"); - sb.AppendLine("Double-click: show benchmark"); - sb.AppendLine(""); - sb.AppendLine("CTRL+Left-click-drag to pan horizontally"); - sb.AppendLine("SHIFT+Left-click-drag to pan vertically"); - sb.AppendLine("CTRL+Right-click-drag to zoom horizontally"); - sb.AppendLine("SHIFT+Right-click-drag to zoom vertically"); - sb.AppendLine("CTRL+SHIFT+Right-click-drag to zoom evenly"); - sb.AppendLine("SHIFT+click-drag draggables for fixed-size dragging"); - return sb.ToString(); - } - - /// - /// Return the most recently rendered Bitmap. - /// This method also disposes old Bitmaps if they exist. - /// - public Bitmap GetLatestBitmap() - { - while (OldBitmaps.Count > 3) - OldBitmaps.Dequeue()?.Dispose(); - return Bmp; - } - - /// - /// Render onto the existing Bitmap. - /// Quality describes whether anti-aliasing will be used. - /// - public void Render(bool lowQuality = false, bool skipIfCurrentlyRendering = false) - { - if (Bmp is null) - { - return; - } - - if (currentlyRendering && skipIfCurrentlyRendering) - { - return; - } - - currentlyRendering = true; - - if (Configuration.Quality == QualityMode.High) - { - lowQuality = false; - } - else if (Configuration.Quality == QualityMode.Low) - { - lowQuality = true; - } - - Plot.Render(Bmp, lowQuality); - BitmapRenderCount += 1; - RenderCount += 1; - PlottablesIdentifierAtLastRender = Settings.PlottablesIdentifier; - - if (WasManuallyRendered == false && - Settings.Plottables.Count > 0 && - Configuration.WarnIfRenderNotCalledManually && - Debugger.IsAttached) - { - string message = - $"ScottPlot {Plot.Version} WARNING:\n{ControlName}.Refresh() must be called\nafter modifying the plot or its data."; - Debug.WriteLine(message.Replace("\n", " ")); - AddErrorMessage(Bmp, message); - } - - AxisLimits newLimits = Plot.GetAxisLimits(); - if (!newLimits.Equals(LimitsOnLastRender) && Configuration.AxesChangedEventEnabled) - { - AxesChanged(null, EventArgs.Empty); - } - - LimitsOnLastRender = newLimits; - - if (BitmapRenderCount == 1) - { - // a new bitmap was rendered on for the first time - BitmapChanged(this, EventArgs.Empty); - } - else - { - // an existing bitmap was re-rendered onto - BitmapUpdated(null, EventArgs.Empty); - } - - currentlyRendering = false; - } - - /// - /// Add error text on top of the rendered plot - /// - private static void AddErrorMessage(Bitmap bmp, string message) - { - Color foreColor = Color.Red; - Color backColor = Color.Yellow; - Color shadowColor = Color.FromArgb(50, Color.Black); - int padding = 10; - int shadowOffset = 7; - - using var gfx = Graphics.FromImage(bmp); - gfx.TextRenderingHint = TextRenderingHint.AntiAlias; - - using StringFormat sf = GDI.StringFormat(HorizontalAlignment.Center, VerticalAlignment.Middle); - using System.Drawing.Font font = new(FontFamily.GenericSansSerif, 16, FontStyle.Bold); - SizeF messageSize = gfx.MeasureString(message, font); - RectangleF messageRect = new( - x: bmp.Width / 2 - messageSize.Width / 2 - padding, - y: bmp.Height / 2 - messageSize.Height / 2 - padding, - width: messageSize.Width + padding * 2, - height: messageSize.Height + padding * 2); - RectangleF shadowRect = new( - x: messageRect.X + shadowOffset, - y: messageRect.Y + shadowOffset, - width: messageRect.Width, - height: messageRect.Height); - - using SolidBrush foreBrush = new(foreColor); - using Pen forePen = new(foreColor, width: 5); - using SolidBrush backBrush = new(backColor); - using SolidBrush shadowBrush = new(shadowColor); - - if (messageSize.Width > bmp.Width || messageSize.Height > bmp.Height) - { - RectangleF plotRect = new(0, 0, bmp.Width, bmp.Height); - sf.Alignment = StringAlignment.Near; - sf.LineAlignment = StringAlignment.Near; - message = message.Replace("\n", " "); - - using System.Drawing.Font fontSmall = new(FontFamily.GenericSansSerif, 12, FontStyle.Bold); - gfx.Clear(backColor); - gfx.DrawString(message, fontSmall, foreBrush, plotRect, sf); - } - else - { - gfx.FillRectangle(shadowBrush, shadowRect); - gfx.FillRectangle(backBrush, messageRect); - gfx.DrawRectangle(forePen, Rectangle.Round(messageRect)); - gfx.DrawString(message, font, foreBrush, messageRect, sf); - } - } - - /// - /// Request a render using the render queue. - /// This method does not block the calling thread. - /// - public void RenderRequest(RenderType renderType) - { - switch (renderType) - { - case RenderType.LowQuality: - ProcessEvent(EventFactory.CreateManualLowQualityRender()); - return; - - case RenderType.HighQuality: - ProcessEvent(EventFactory.CreateManualHighQualityRender()); - return; - - case RenderType.HighQualityDelayed: - ProcessEvent(EventFactory.CreateManualDelayedHighQualityRender()); - return; - - case RenderType.LowQualityThenHighQuality: - ProcessEvent(EventFactory.CreateManualLowQualityRender()); - ProcessEvent(EventFactory.CreateManualHighQualityRender()); - return; - - case RenderType.LowQualityThenHighQualityDelayed: - ProcessEvent(EventFactory.CreateManualDelayedHighQualityRender()); - return; - - case RenderType.ProcessMouseEventsOnly: - return; - - default: - throw new InvalidOperationException($"unsupported render type {renderType}"); - } - } - - /// - /// Check if the number of plottibles has changed and if so request a render. - /// This is typically called by a continuously running timer in the user control. - /// - [Obsolete("Automatic render timer has been removed. Call Render() manually.", true)] - public void RenderIfPlottableListChanged() - { - if (Configuration.RenderIfPlottableListChanges == false) - { - return; - } - - if (Bmp is null) - { - return; - } - - if (Settings.PlottablesIdentifier != PlottablesIdentifierAtLastRender) - { - Render(); - } - } - - /// - /// Resize the control (creates a new Bitmap and requests a render) - /// - /// new width (pixels) - /// new height (pixels) - /// Render using the queue (best for mouse events), otherwise render immediately. - public void Resize(float width, float height, bool useDelayedRendering) - { - // don't render if the requested size cannot produce a valid bitmap - if (width < 1 || height < 1) - { - return; - } - - // don't render if the request is so early that the processor hasn't started - if (EventsProcessor is null) - { - return; - } - - // Disposing a Bitmap the GUI is displaying will cause an exception. - // Keep track of old bitmaps so they can be disposed of later. - OldBitmaps.Enqueue(Bmp); - Bmp = new Bitmap((int)width, (int)height); - BitmapRenderCount = 0; - - if (useDelayedRendering) - { - RenderRequest(RenderType.HighQualityDelayed); - } - else - { - Render(); - } - } - - /// - /// Indicate a mouse button has just been pressed - /// - public void MouseDown(InputState input) - { - if (!Settings.AllAxesHaveBeenSet) - { - Plot.SetAxisLimits(Plot.GetAxisLimits()); - } - - IsMiddleDown = input.MiddleWasJustPressed; - IsRightDown = input.RightWasJustPressed; - IsLeftDown = input.LeftWasJustPressed; - PlottableBeingDragged = GetDraggableUnderMouse(input.X, input.Y); - Settings.MouseDown(input.X, input.Y); - MouseDownTravelDistance = 0; - } - - /// - /// Return the mouse position on the plot (in coordinate space) for the latest X and Y coordinates - /// - public (double x, double y) GetMouseCoordinates() - { - (double x, double y) = Plot.GetCoordinate(MouseLocationX, MouseLocationY); - return (double.IsNaN(x) ? 0 : x, double.IsNaN(y) ? 0 : y); - } - - /// - /// Return the mouse position (in pixel space) for the last observed mouse position - /// - public (float x, float y) GetMousePixel() => (MouseLocationX, MouseLocationY); - - /// - /// Indicate the mouse has moved to a new position - /// - public void MouseMove(InputState input) - { - bool altWasLifted = IsZoomingWithAlt && !input.AltDown; - bool middleButtonLifted = IsZoomingRectangle && !input.MiddleWasJustPressed; - if (IsZoomingRectangle && (altWasLifted || middleButtonLifted)) - { - Settings.ZoomRectangle.Clear(); - } - - IsZoomingWithAlt = IsLeftDown && input.AltDown; - bool isMiddleClickDragZooming = IsMiddleDown && !middleButtonLifted; - bool isZooming = IsZoomingWithAlt || isMiddleClickDragZooming; - IsZoomingRectangle = isZooming && Configuration.MiddleClickDragZoom && MouseDownDragged; - - MouseDownTravelDistance += Math.Abs(input.X - MouseLocationX); - MouseDownTravelDistance += Math.Abs(input.Y - MouseLocationY); - - MouseLocationX = input.X; - MouseLocationY = input.Y; - - IUIEvent mouseMoveEvent = null; - if (PlottableBeingDragged != null) - { - mouseMoveEvent = EventFactory.CreatePlottableDrag(input.X, input.Y, input.ShiftDown, PlottableBeingDragged); - } - else if (IsLeftDown && !input.AltDown && Configuration.LeftClickDragPan) - { - mouseMoveEvent = EventFactory.CreateMousePan(input); - } - else if (IsRightDown && Configuration.RightClickDragZoom) - { - mouseMoveEvent = EventFactory.CreateMouseZoom(input); - } - else if (IsZoomingRectangle) - { - mouseMoveEvent = EventFactory.CreateMouseMovedToZoomRectangle(input.X, input.Y); - } - - if (mouseMoveEvent != null) - { - ProcessEvent(mouseMoveEvent); - } - else - { - MouseMovedWithoutInteraction(input); - } - } - - /// - /// Process an event using the render queue (non-blocking) or traditional rendering (blocking) - /// based on the UseRenderQueue flag in the Configuration module. - /// - private void ProcessEvent(IUIEvent uiEvent) - { - if (Configuration.UseRenderQueue) - { - // TODO: refactor to better support async - // TODO: document that draggable events aren't supported by the render queue - _ = EventsProcessor.ProcessAsync(uiEvent); - } - else - { - //Console.WriteLine($"[{DateTime.Now:ss.ffff}] PROCESSING: {uiEvent}"); - uiEvent.ProcessEvent(); - - if (uiEvent.RenderType == RenderType.ProcessMouseEventsOnly) - { - return; - } - - bool lowQuality = - uiEvent is MouseMovedToZoomRectangle || - uiEvent is MousePanEvent || - uiEvent is MouseZoomEvent || - uiEvent is PlottableDragEvent || - uiEvent is RenderLowQuality; - - bool allowSkip = lowQuality && Configuration.AllowDroppedFramesWhileDragging; - - Render(lowQuality: lowQuality, skipIfCurrentlyRendering: allowSkip); - - if (uiEvent is PlottableDragEvent) - { - PlottableDragged(PlottableBeingDragged, EventArgs.Empty); - } - } - } - - /// - /// Call this when the mouse moves without any buttons being down. - /// It will only update the cursor based on what's beneath the cursor. - /// - private void MouseMovedWithoutInteraction(InputState input) - { - UpdateCursor(input); - } - - /// - /// Set the cursor based on whether a draggable is engaged or not, - /// then invoke the CursorChanged event. - /// - private void UpdateCursor(InputState input) - { - var draggableUnderCursor = GetDraggableUnderMouse(input.X, input.Y); - Cursor = (draggableUnderCursor is null) ? Cursor.Arrow : draggableUnderCursor.DragCursor; - CursorChanged(null, EventArgs.Empty); - } - - /// - /// Indicate a mouse button has been released. - /// This may initiate a render (and/or a delayed render). - /// - /// - public void MouseUp(InputState input) - { - var droppedPlottable = PlottableBeingDragged; - - IUIEvent mouseEvent; - if (IsZoomingRectangle && MouseDownDragged && Configuration.MiddleClickDragZoom) - { - mouseEvent = EventFactory.CreateApplyZoomRectangleEvent(input.X, input.Y); - } - else if (IsMiddleDown && Configuration.MiddleClickAutoAxis && MouseDownDragged == false) - { - mouseEvent = EventFactory.CreateMouseAutoAxis(); - } - else - { - mouseEvent = EventFactory.CreateMouseUpClearRender(); - } - - ProcessEvent(mouseEvent); - - if (IsRightDown && MouseDownDragged == false) - { - RightClicked(null, EventArgs.Empty); - } - - IsMiddleDown = false; - IsRightDown = false; - IsLeftDown = false; - - UpdateCursor(input); - - if (droppedPlottable != null) - { - PlottableDropped(droppedPlottable, EventArgs.Empty); - } - - PlottableBeingDragged = null; - if (droppedPlottable != null) - { - ProcessEvent(EventFactory.CreateMouseUpClearRender()); - } - } - - /// - /// Indicate the left mouse button has been double-clicked. - /// The default action of a double-click is to toggle the benchmark. - /// - public void DoubleClick() - { - if (Configuration.DoubleClickBenchmark) - { - IUIEvent mouseEvent = EventFactory.CreateBenchmarkToggle(); - ProcessEvent(mouseEvent); - } - } - - /// - /// Apply a scroll wheel action, perform a low quality render, and later re-render in high quality. - /// - public void MouseWheel(InputState input) - { - if (!Settings.AllAxesHaveBeenSet) - { - Plot.SetAxisLimits(Plot.GetAxisLimits()); - } - - if (Configuration.ScrollWheelZoom) - { - IUIEvent mouseEvent = EventFactory.CreateMouseScroll(input.X, input.Y, input.WheelScrolledUp); - ProcessEvent(mouseEvent); - } - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/Configuration.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/Configuration.cs deleted file mode 100644 index 073cc906b..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/Configuration.cs +++ /dev/null @@ -1,223 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Configuration - { - /// - /// Control whether panning is enabled - /// - public bool Pan { get => LeftClickDragPan; set => LeftClickDragPan = value; } - - /// - /// Control whether zooming is enabled (via left-click-drag, middle-click-drag, and scrollwheel) - /// - public bool Zoom - { - get => RightClickDragZoom; - set => (RightClickDragZoom, MiddleClickDragZoom, ScrollWheelZoom) = (value, value, value); - } - - /// - /// Manual override to set anti-aliasing (high quality) behavior for all renders. - /// Refer to the QualityConfiguration field for more control over quality in response to specific interactions. - /// - public QualityMode Quality = QualityMode.LowWhileDragging; - - /// - /// This module customizes anti-aliasing (high quality) behavior in response to interactive events. - /// - public readonly QualityConfiguration QualityConfiguration = new(); - - /// - /// Control whether left-click-drag panning is enabled - /// - public bool LeftClickDragPan = true; - - /// - /// Control whether right-click-drag zooming is enabled - /// - public bool RightClickDragZoom = true; - - /// - /// Control whether scroll wheel zooming is enabled - /// - public bool ScrollWheelZoom = true; - - private double _scrollWheelZoomFraction = 0.15; - - /// - /// Fractional amount to zoom in or out when the mouse wheel is scrolled. - /// Value must be between 0 and 1 (default is 0.15). - /// - public double ScrollWheelZoomFraction - { - get => _scrollWheelZoomFraction; - set - { - if (value <= 0) - { - throw new ArgumentOutOfRangeException("ScrollWheelZoomFraction", "must be positive"); - } - - if (value >= 1) - { - throw new ArgumentOutOfRangeException("ScrollWheelZoomFraction", "must be less than 1"); - } - - _scrollWheelZoomFraction = value; - } - } - - /// - /// Number of milliseconds after low quality scroll wheel zoom to re-render using high quality - /// - public double ScrollWheelZoomHighQualityDelay = 500; - - /// - /// Control whether middle-click-drag zooming to a rectangle is enabled - /// - public bool MiddleClickDragZoom = true; - - /// - /// Control whether middle-click can be used to reset axis limits - /// - public bool MiddleClickAutoAxis = true; - - /// - /// Horizontal margin between the edge of the data and the edge of the plot when middle-click AutoAxis is called - /// - [Obsolete("Set default margins with Plot.Margins()", error: true)] - public double MiddleClickAutoAxisMarginX = .05; - - /// - /// Vertical margin between the edge of the data and the edge of the plot when middle-click AutoAxis is called - /// - [Obsolete("Set default margins with Plot.Margins()", error: true)] - public double MiddleClickAutoAxisMarginY = .1; - - /// - /// If enabled, double-clicking the plot will toggle benchmark visibility - /// - public bool DoubleClickBenchmark = true; - - /// - /// If enabled, the vertical axis limits cannot be modified by mouse actions - /// - public bool LockVerticalAxis = false; - - /// - /// If enabled, the horizontal axis limits cannot be modified by mouse actions - /// - public bool LockHorizontalAxis = false; - - /// - /// If enabled the control will automatically re-render as plottables are added and removed - /// - [Obsolete("Automatic render timer has been removed. Call Render() manually.", true)] - public bool RenderIfPlottableListChanges = true; - - /// - /// Controls whether or not a render event will be triggered if a change in the axis limits is detected - /// - public bool AxesChangedEventEnabled = true; - - /// - /// Permitting dropped frames makes interactive mouse manipulation feel faster - /// - public bool AllowDroppedFramesWhileDragging = true; - - /// - /// If true, control interactions will be non-blocking and renders will occur after interactions. - /// If false, control interactions will be blocking while renders are drawn. - /// - public bool UseRenderQueue = false; - - /// - /// Distance (in pixels) the mouse can travel with a button held-down for it to be treated as a click (not a drag). - /// A number slightly above zero allows middle-click to call AxisAuto() even if it was draged a few pixels by accident. - /// - public int IgnoreMouseDragDistance = 5; - - /// - /// Now that the timer-based auto-render functionality has been removed users must manually call Render() at least once. - /// This option controls whether a warning message is shown if the user did not call Render() manually. - /// - public bool WarnIfRenderNotCalledManually { get; set; } = true; - - private bool _dpiStretch = true; - - /// - /// Control whether the plot should be stretched when DPI scaling is in use. - /// Enabling stretching may result in blurry plots. - /// Disabling stretching may results in plots with text that is too small. - /// - public bool DpiStretch - { - get => _dpiStretch; - set - { - if (_dpiStretch != value) - { - _dpiStretch = value; - ScaleChanged?.Invoke(null, null); - } - } - } - - private float _dpiStretchRatio = GDI.GetScaleRatio(); - - /// - /// DPI scaling ratio to use for plot size and mouse tracking. - /// Will return 1.0 if is enabled. - /// - public float DpiStretchRatio - { - get => DpiStretch ? 1.0f : _dpiStretchRatio; - set - { - if (_dpiStretchRatio != value) - { - _dpiStretchRatio = value; - ScaleChanged?.Invoke(null, null); - } - } - } - - /// - /// This event is invoked whenever the display scale is changed. - /// - public event EventHandler ScaleChanged = delegate { }; - - /// - /// Set the DpiStretchRatio to that of the active display. - /// Call this if you suspect DPI scaling has changed. - /// - public void DpiMeasure() => DpiStretchRatio = GDI.GetScaleRatio(); - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/DisplayScale.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/DisplayScale.cs deleted file mode 100644 index 80a46bdde..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/DisplayScale.cs +++ /dev/null @@ -1,97 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// This class detects and stores display scale. - /// The scale ratio is used to calculate plot size and - /// translate mouse coordinates to real pixel coordinates. - /// - public class DisplayScale - { - /// - /// Scale ratio in use by the active display. - /// This ratio is used when scaling is enabled. - /// - public float SystemScaleRatio { get; private set; } = 1.0f; - - /// - /// Scale ratio to use if scaling is disabled. - /// - public float ManualScaleRatio { get; private set; } = 1.0f; - - private bool _enabled = true; - - /// - /// Control whether the plot bitmap should be stretched if display scaling is active. - /// When enabled text will be large but may be blurry. - /// When disabled text will be sharp but may be too small to read on high-resolution displays. - /// - public bool Enabled - { - get => _enabled; - set - { - if (value != _enabled) - { - _enabled = value; - ScaleChanged?.Invoke(this, EventArgs.Empty); - } - } - } - - /// - /// Current display scale ratio. - /// - public float ScaleRatio => Enabled ? SystemScaleRatio : ManualScaleRatio; - - /// - /// This event is invoked whenever the display scale is changed. - /// - public event EventHandler ScaleChanged = delegate { }; - - public DisplayScale() - { - Measure(); - } - - /// - /// Update the scale ratio using that of the active display. - /// Call this method if you expect the display scale has changed. - /// - public void Measure() - { - double ratio = GDI.GetScaleRatio(); - if (SystemScaleRatio != ratio) - { - SystemScaleRatio = (float)ratio; - ScaleChanged?.Invoke(this, EventArgs.Empty); - } - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/EventFactory.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/EventFactory.cs deleted file mode 100644 index 473cfd367..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/EventFactory.cs +++ /dev/null @@ -1,80 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// This class takes details about interactions and builds them into event objects which can - /// be passed into the event processor for processing/rendering when the render queue is free. - /// - public class UIEventFactory - { - public readonly Plot Plot; - public readonly Configuration Configuration; - public readonly Settings Settings; - - public UIEventFactory(Configuration config, Settings settings, Plot plt) - { - Configuration = config; - Settings = settings; - Plot = plt; - } - - public IUIEvent CreateBenchmarkToggle() => - new BenchmarkToggleEvent(Plot, Configuration); - - public IUIEvent CreateApplyZoomRectangleEvent(float x, float y) => - new ApplyZoomRectangleEvent(x, y, Configuration, Settings, Plot); - - public IUIEvent CreateMouseAutoAxis() => - new MouseAxisAutoEvent(Configuration, Settings, Plot); - - public IUIEvent CreateMouseMovedToZoomRectangle(float x, float y) => - new MouseMovedToZoomRectangle(x, y, Settings, Configuration); - - public IUIEvent CreateMousePan(InputState input) => - new MousePanEvent(input, Configuration, Settings); - - public IUIEvent CreateMouseScroll(float x, float y, bool scroolUp) => - new MouseScrollEvent(x, y, scroolUp, Configuration, Settings); - - public IUIEvent CreateMouseUpClearRender() => - new MouseUpClearRenderEvent(Configuration); - - public IUIEvent CreateMouseZoom(InputState input) => - new MouseZoomEvent(input, Configuration, Settings, Plot); - - public IUIEvent CreatePlottableDrag(float x, float y, bool shiftDown, IDraggable draggable) => - new PlottableDragEvent(x, y, shiftDown, draggable, Plot, Configuration); - - public IUIEvent CreateManualLowQualityRender() => new RenderLowQuality(); - - public IUIEvent CreateManualHighQualityRender() => new RenderHighQuality(); - - public IUIEvent CreateManualDelayedHighQualityRender() => new RenderDelayedHighQuality(); - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/ApplyZoomRectangleEvent.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/ApplyZoomRectangleEvent.cs deleted file mode 100644 index 8030c5104..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/ApplyZoomRectangleEvent.cs +++ /dev/null @@ -1,72 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// This event describes what happens when the mouse button is lifted after - /// middle-click-dragging a rectangle to zoom into. The coordinates of that rectangle - /// are calculated, and the plot's axis limits are adjusted accordingly. - /// - public class ApplyZoomRectangleEvent : IUIEvent - { - private readonly float X; - private readonly float Y; - private readonly Configuration Configuration; - private readonly Settings Settings; - private readonly Plot Plot; - public RenderType RenderType => Configuration.QualityConfiguration.MouseInteractiveDropped; - - public ApplyZoomRectangleEvent(float x, float y, Configuration config, Settings settings, Plot plt) - { - X = x; - Y = y; - Configuration = config; - Settings = settings; - Plot = plt; - } - - public void ProcessEvent() - { - Settings.RecallAxisLimits(); - - var originalLimits = Plot.GetAxisLimits(); - - Settings.MouseZoomRect(X, Y, finalize: true); - - if (Configuration.LockHorizontalAxis) - { - Plot.SetAxisLimitsX(originalLimits.XMin, originalLimits.XMax); - } - - if (Configuration.LockVerticalAxis) - { - Plot.SetAxisLimitsY(originalLimits.YMin, originalLimits.YMax); - } - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/BenchmarkToggleEvent.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/BenchmarkToggleEvent.cs deleted file mode 100644 index 7b65e6e97..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/BenchmarkToggleEvent.cs +++ /dev/null @@ -1,51 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// This event toggles visibility of the benchmark. - /// This event is typically called after double-clicking the plot. - /// - public class BenchmarkToggleEvent : IUIEvent - { - private readonly Plot Plot; - private readonly Configuration Configuration; - public RenderType RenderType => Configuration.QualityConfiguration.BenchmarkToggle; - - public BenchmarkToggleEvent(Plot plt, Configuration config) - { - Plot = plt; - Configuration = config; - } - - public void ProcessEvent() - { - Plot.Benchmark(!Plot.Benchmark(null)); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/MouseAxisAutoEvent.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/MouseAxisAutoEvent.cs deleted file mode 100644 index 270a81b78..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/MouseAxisAutoEvent.cs +++ /dev/null @@ -1,60 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// This event calls AxisAuto() on all axes. - /// This is typically called after middle-clicking. - /// - public class MouseAxisAutoEvent : IUIEvent - { - private readonly Configuration Configuration; - private readonly Settings Settings; - private readonly Plot Plot; - public RenderType RenderType => Configuration.QualityConfiguration.AutoAxis; - - public MouseAxisAutoEvent(Configuration config, Settings settings, Plot plt) - { - Configuration = config; - Settings = settings; - Plot = plt; - } - - public void ProcessEvent() - { - Settings.ZoomRectangle.Clear(); - - if (Configuration.LockVerticalAxis) - { - return; - } - - Plot.AxisAuto(); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/MouseMovedToZoomRectangle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/MouseMovedToZoomRectangle.cs deleted file mode 100644 index 71f91480f..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/MouseMovedToZoomRectangle.cs +++ /dev/null @@ -1,55 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// This event occurs when the user is actively middle-click-dragging to zoom. - /// A zoom window is drawn on the screen, but axis limits have not yet been changed. - /// - public class MouseMovedToZoomRectangle : IUIEvent - { - private readonly float X; - private readonly float Y; - private readonly Settings Settings; - private readonly Configuration Configuration; - public RenderType RenderType => Configuration.QualityConfiguration.MouseInteractiveDragged; - - public MouseMovedToZoomRectangle(float x, float y, Settings settings, Configuration configuration) - { - X = x; - Y = y; - Settings = settings; - Configuration = configuration; - } - - public void ProcessEvent() - { - Settings.MouseZoomRect(X, Y); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/MousePanEvent.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/MousePanEvent.cs deleted file mode 100644 index 92fa33d4a..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/MousePanEvent.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// This event describes represents interactive panning. - /// It is assume the plot has already been reset to the pre-mouse-interaction state, - /// and processing of this event pans the plot on the axes according to the distance - /// the mouse has moved. - /// This is typically called on MouseMove events when the left button is held down. - /// - public class MousePanEvent : IUIEvent - { - private readonly InputState Input; - private readonly Configuration Configuration; - private readonly Settings Settings; - public RenderType RenderType => Configuration.QualityConfiguration.MouseInteractiveDragged; - - public MousePanEvent(InputState input, Configuration config, Settings settings) - { - Input = input; - Configuration = config; - Settings = settings; - } - - public void ProcessEvent() - { - float x = (Input.ShiftDown || Configuration.LockHorizontalAxis) ? Settings.MouseDownX : Input.X; - float y = (Input.CtrlDown || Configuration.LockVerticalAxis) ? Settings.MouseDownY : Input.Y; - Settings.MousePan(x, y); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/MouseScrollEvent.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/MouseScrollEvent.cs deleted file mode 100644 index 2159dbf24..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/MouseScrollEvent.cs +++ /dev/null @@ -1,72 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// This event describes a zoom operation performed by scrolling the mouse wheel. - /// - public class MouseScrollEvent : IUIEvent - { - private readonly float X; - private readonly float Y; - private readonly bool ScrolledUp; - private readonly Configuration Configuration; - private readonly Settings Settings; - public RenderType RenderType => Configuration.QualityConfiguration.MouseWheelScrolled; - - public MouseScrollEvent(float x, float y, bool scrolledUp, Configuration config, Settings settings) - { - X = x; - Y = y; - ScrolledUp = scrolledUp; - Configuration = config; - Settings = settings; - } - - public void ProcessEvent() - { - double increment = 1.0 + Configuration.ScrollWheelZoomFraction; - double decrement = 1.0 - Configuration.ScrollWheelZoomFraction; - - double xFrac = ScrolledUp ? increment : decrement; - double yFrac = ScrolledUp ? increment : decrement; - - if (Configuration.LockHorizontalAxis) - { - xFrac = 1; - } - - if (Configuration.LockVerticalAxis) - { - yFrac = 1; - } - - Settings.AxesZoomTo(xFrac, yFrac, X, Y); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/MouseUpClearRenderEvent.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/MouseUpClearRenderEvent.cs deleted file mode 100644 index 564c5dca7..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/MouseUpClearRenderEvent.cs +++ /dev/null @@ -1,49 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// This event is called after the mouse button is lifted (typically following panning and zooming). - /// It assumes all the axis manipulation (panning/zooming) has already been performed, - /// and the purpose of this event is only to request an immediate high quality render. - /// - public class MouseUpClearRenderEvent : IUIEvent - { - private readonly Configuration Configuration; - public RenderType RenderType => Configuration.QualityConfiguration.MouseInteractiveDropped; - - public MouseUpClearRenderEvent(Configuration config) - { - Configuration = config; - } - - public void ProcessEvent() - { - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/MouseZoomEvent.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/MouseZoomEvent.cs deleted file mode 100644 index 7b2688d9f..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/MouseZoomEvent.cs +++ /dev/null @@ -1,82 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// This event describes represents interactive zooming. - /// It is assume the plot has already been reset to the pre-mouse-interaction state, - /// and processing of this event zooms the plot on the axes according to the distance - /// the mouse has moved. - /// This is typically called on MouseMove events when the right button is held down. - /// - public class MouseZoomEvent : IUIEvent - { - private readonly InputState Input; - private readonly Configuration Configuration; - private readonly Settings Settings; - private readonly Plot Plot; - public RenderType RenderType => Configuration.QualityConfiguration.MouseInteractiveDragged; - - public MouseZoomEvent(InputState input, Configuration config, Settings settings, Plot plt) - { - Input = input; - Configuration = config; - Settings = settings; - Plot = plt; - } - - public void ProcessEvent() - { - var originalLimits = Plot.GetAxisLimits(); - - if (Input.ShiftDown && Input.CtrlDown) - { - float dx = Input.X - Settings.MouseDownX; - float dy = Settings.MouseDownY - Input.Y; - float delta = Math.Max(dx, dy); - Settings.MouseZoom(Settings.MouseDownX + delta, Settings.MouseDownY - delta); - } - else - { - float x = Input.ShiftDown ? Settings.MouseDownX : Input.X; - float y = Input.CtrlDown ? Settings.MouseDownY : Input.Y; - Settings.MouseZoom(x, y); - } - - if (Configuration.LockHorizontalAxis) - { - Plot.SetAxisLimitsX(originalLimits.XMin, originalLimits.XMax); - } - - if (Configuration.LockVerticalAxis) - { - Plot.SetAxisLimitsY(originalLimits.YMin, originalLimits.YMax); - } - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/PlottableDragEvent.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/PlottableDragEvent.cs deleted file mode 100644 index 731017184..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/PlottableDragEvent.cs +++ /dev/null @@ -1,63 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// This event describes what happens when a draggable plottable (like an axis line) - /// has been moved from its initial position. This event places the plottable of interest - /// at the current mouse position. - /// This is typically called on MouseMove events while left-click-dragging a draggable plottable. - /// - public class PlottableDragEvent : IUIEvent - { - private readonly float X; - private readonly float Y; - private readonly IDraggable PlottableBeingDragged; - private readonly Plot Plot; - private readonly bool ShiftDown; - private readonly Configuration Configuration; - public RenderType RenderType => Configuration.QualityConfiguration.MouseInteractiveDragged; - - public PlottableDragEvent(float x, float y, bool shiftDown, IDraggable plottable, Plot plt, Configuration config) - { - X = x; - Y = y; - ShiftDown = shiftDown; - Plot = plt; - PlottableBeingDragged = plottable; - Configuration = config; - } - - public void ProcessEvent() - { - double xCoord = Plot.GetCoordinateX(X); - double yCoord = Plot.GetCoordinateY(Y); - PlottableBeingDragged.DragTo(xCoord, yCoord, fixedSize: ShiftDown); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/RenderDelayedHighQuality.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/RenderDelayedHighQuality.cs deleted file mode 100644 index 5edf0713a..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/RenderDelayedHighQuality.cs +++ /dev/null @@ -1,38 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - class RenderDelayedHighQuality : IUIEvent - { - public RenderType RenderType => RenderType.LowQualityThenHighQualityDelayed; - - public void ProcessEvent() - { - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/RenderHighQuality.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/RenderHighQuality.cs deleted file mode 100644 index 7f252758d..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/RenderHighQuality.cs +++ /dev/null @@ -1,38 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - class RenderHighQuality : IUIEvent - { - public RenderType RenderType => RenderType.HighQuality; - - public void ProcessEvent() - { - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/RenderLowQuality.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/RenderLowQuality.cs deleted file mode 100644 index 3aa6ee0ac..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/Events/RenderLowQuality.cs +++ /dev/null @@ -1,38 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - class RenderLowQuality : IUIEvent - { - public RenderType RenderType => RenderType.LowQuality; - - public void ProcessEvent() - { - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/EventsProcessor.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/EventsProcessor.cs deleted file mode 100644 index 7b37b9691..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/EventsProcessor.cs +++ /dev/null @@ -1,220 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// This event processor process incoming events and invokes renders as needed. - /// This class contains logic to optionally display a fast preview render and a delayed high quality render. - /// - public class EventsProcessor - { - /// - /// List of events that have not yet been processed - /// - private readonly Queue Queue = new(); - - /// - /// The event processor loop will hang infinitely until this is set to True - /// - public bool Enable = false; - - /// - /// This timer is used for delayed rendering. - /// It is restarted whenever an event is processed which requests a delayed render. - /// - private readonly Stopwatch RenderDelayTimer = new Stopwatch(); - - /// - /// This is true while the processor is processing events and/or waiting for a delayed render. - /// - private bool QueueProcessorIsRunning = false; - - /// - /// Time to wait after a low-quality render to invoke a high quality render - /// - public int RenderDelayMilliseconds { get; set; } - - /// - /// When a render is required this Action will be invoked. - /// Its argument indicates whether low quality should be used. - /// - public Action RenderAction { get; set; } - - /// - /// Create a processor to invoke renders in response to incoming events - /// - /// Action to invoke to perform a render. Bool argument is LowQuality. - /// Milliseconds after low-quality render to re-render using high quality. - public EventsProcessor(Action renderAction, int renderDelay) - { - RenderAction = renderAction; - RenderDelayMilliseconds = renderDelay; - } - - /// - /// Perform a high quality render. - /// Call this instead of the action itself because this has better-documented arguments. - /// - private void RenderHighQuality() => RenderAction.Invoke(false); - - /// - /// Perform a low quality render. - /// Call this instead of the action itself because this has better-documented arguments. - /// - private void RenderLowQuality() => RenderAction.Invoke(true); - - /// - /// Add an event to the queue and process it when it is ready. - /// After all events are processed a render will be called automatically by the queue processor. - /// - public async Task ProcessAsync(IUIEvent uiEvent) - { - Queue.Enqueue(uiEvent); - - // start a new processor only if one is not already running - if (!QueueProcessorIsRunning) - { - await RunQueueProcessor(); - } - } - - /// - /// Perform a low quality preview render if the render type allows it - /// - private void RenderPreview(RenderType renderType) - { - if (renderType == RenderType.HighQuality) - { - return; - } - - RenderLowQuality(); - } - - /// - /// Perform a final high quality render if the render type allows it. - /// - /// Return False if the final render needs to happen later - private bool RenderFinal(RenderType renderType) - { - switch (renderType) - { - case RenderType.LowQuality: - // we don't need a HQ render if the type is LQ only - return true; - - case RenderType.HighQuality: - // A HQ version is always needed - RenderHighQuality(); - return true; - - case RenderType.LowQualityThenHighQuality: - // A LQ version has been rendered, but we need a HQ version now - RenderHighQuality(); - return true; - - case RenderType.LowQualityThenHighQualityDelayed: - // A LQ version has been rendered, but we need a HQ version after a delay - - if (RenderDelayTimer.IsRunning == false) - { - RenderDelayTimer.Restart(); - } - - if (RenderDelayTimer.ElapsedMilliseconds > RenderDelayMilliseconds) - { - RenderHighQuality(); - RenderDelayTimer.Stop(); - return true; - } - else - { - return false; - } - - default: - throw new ArgumentException($"Unknown quality: {renderType}"); - } - } - - /// - /// Process every event in the queue. - /// A render will be executed after each event is processed. - /// A slight delay will be added between queue checks. - /// - private async Task RunQueueProcessor() - { - while (Enable == false) - { - await Task.Delay(1); - } - - RenderType lastEventRenderType = RenderType.ProcessMouseEventsOnly; - while (true) - { - QueueProcessorIsRunning = true; - bool eventRenderRequested = false; - while (Queue.Count > 0) - { - var uiEvent = Queue.Dequeue(); - uiEvent.ProcessEvent(); - - if (uiEvent.RenderType == RenderType.LowQualityThenHighQualityDelayed) - { - RenderDelayTimer.Restart(); - } - - if (uiEvent.RenderType != RenderType.ProcessMouseEventsOnly) - { - lastEventRenderType = uiEvent.RenderType; - eventRenderRequested = true; - } - } - - if (eventRenderRequested) - { - RenderPreview(lastEventRenderType); - } - - await Task.Delay(1); - - // if all events were processed, consider performing a final render and exiting - if (Queue.Count == 0) - { - bool finalRenderExecuted = RenderFinal(lastEventRenderType); - if (finalRenderExecuted) - { - break; - } - } - }; - - QueueProcessorIsRunning = false; - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/IUIEvent.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/IUIEvent.cs deleted file mode 100644 index e7c1bf254..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/EventProcess/IUIEvent.cs +++ /dev/null @@ -1,35 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public interface IUIEvent - { - public RenderType RenderType { get; } - void ProcessEvent(); - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlot.cs index 3c3916793..9e6db7f6a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlot.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlot.cs @@ -1,541 +1,37 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot { - public class FormsPlot : UserControl + public class FormsPlot : FormsPlotBase { - #region Designer Code - private PictureBox pictureBox1; - private KryptonRichTextBox krtbErrorMessage; - private ContextMenuStrip DefaultRightClickMenu; - private IContainer components; - private ToolStripMenuItem copyMenuItem; - private ToolStripMenuItem saveImageMenuItem; - private ToolStripSeparator toolStripSeparator1; - private ToolStripMenuItem autoAxisMenuItem; - private ToolStripSeparator toolStripSeparator2; - private ToolStripMenuItem helpMenuItem; - private ToolStripSeparator toolStripSeparator3; - private ToolStripMenuItem openInNewWindowMenuItem; - - private void InitializeComponent() - { - components = new Container(); - pictureBox1 = new PictureBox(); - krtbErrorMessage = new KryptonRichTextBox(); - DefaultRightClickMenu = new ContextMenuStrip(components); - copyMenuItem = new ToolStripMenuItem(); - saveImageMenuItem = new ToolStripMenuItem(); - toolStripSeparator1 = new ToolStripSeparator(); - autoAxisMenuItem = new ToolStripMenuItem(); - toolStripSeparator2 = new ToolStripSeparator(); - helpMenuItem = new ToolStripMenuItem(); - toolStripSeparator3 = new ToolStripSeparator(); - openInNewWindowMenuItem = new ToolStripMenuItem(); - ((ISupportInitialize)(pictureBox1)).BeginInit(); - DefaultRightClickMenu.SuspendLayout(); - SuspendLayout(); - // - // pictureBox1 - // - pictureBox1.BackColor = Color.Navy; - pictureBox1.Dock = DockStyle.Fill; - pictureBox1.Location = new Point(0, 0); - pictureBox1.Name = "pictureBox1"; - pictureBox1.Size = new Size(400, 300); - pictureBox1.TabIndex = 1; - pictureBox1.TabStop = false; - // - // krtbErrorMessage - // - krtbErrorMessage.Location = new Point(21, 24); - krtbErrorMessage.Name = "krtbErrorMessage"; - krtbErrorMessage.Size = new Size(186, 84); - krtbErrorMessage.StateCommon.Back.Color1 = Color.Maroon; - krtbErrorMessage.StateCommon.Content.Color1 = Color.White; - krtbErrorMessage.StateCommon.Content.Font = new System.Drawing.Font("Cascadia Code", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); - krtbErrorMessage.TabIndex = 2; - krtbErrorMessage.Text = "Error Message"; - // - // DefaultRightClickMenu - // - DefaultRightClickMenu.Font = new System.Drawing.Font("Segoe UI", 9F); - DefaultRightClickMenu.ImageScalingSize = new Size(20, 20); - DefaultRightClickMenu.Items.AddRange(new ToolStripItem[] { - copyMenuItem, - saveImageMenuItem, - toolStripSeparator1, - autoAxisMenuItem, - toolStripSeparator2, - helpMenuItem, - toolStripSeparator3, - openInNewWindowMenuItem}); - DefaultRightClickMenu.Name = "contextMenuStrip1"; - DefaultRightClickMenu.Size = new Size(191, 132); - // - // copyMenuItem - // - copyMenuItem.Name = "copyMenuItem"; - copyMenuItem.Size = new Size(190, 22); - copyMenuItem.Text = "Copy Image"; - copyMenuItem.Click += new EventHandler(copyMenuItem_Click); - // - // saveImageMenuItem - // - saveImageMenuItem.Name = "saveImageMenuItem"; - saveImageMenuItem.Size = new Size(190, 22); - saveImageMenuItem.Text = "Save Image As..."; - saveImageMenuItem.Click += new EventHandler(saveImageMenuItem_Click); - // - // toolStripSeparator1 - // - toolStripSeparator1.Name = "toolStripSeparator1"; - toolStripSeparator1.Size = new Size(187, 6); - // - // autoAxisMenuItem - // - autoAxisMenuItem.Name = "autoAxisMenuItem"; - autoAxisMenuItem.Size = new Size(190, 22); - autoAxisMenuItem.Text = "Zoom to Fit Data"; - autoAxisMenuItem.Click += new EventHandler(autoAxisMenuItem_Click); - // - // toolStripSeparator2 - // - toolStripSeparator2.Name = "toolStripSeparator2"; - toolStripSeparator2.Size = new Size(187, 6); - // - // helpMenuItem - // - helpMenuItem.Name = "helpMenuItem"; - helpMenuItem.Size = new Size(190, 22); - helpMenuItem.Text = "Help"; - helpMenuItem.Click += new EventHandler(helpMenuItem_Click); - // - // toolStripSeparator3 - // - toolStripSeparator3.Name = "toolStripSeparator3"; - toolStripSeparator3.Size = new Size(187, 6); - // - // openInNewWindowMenuItem - // - openInNewWindowMenuItem.Name = "openInNewWindowMenuItem"; - openInNewWindowMenuItem.Size = new Size(190, 22); - openInNewWindowMenuItem.Text = "Open in New Window"; - openInNewWindowMenuItem.Click += new EventHandler(openInNewWindowMenuItem_Click); - // - // FormsPlot - // - Controls.Add(krtbErrorMessage); - Controls.Add(pictureBox1); - Name = "FormsPlot"; - Size = new Size(400, 300); - Load += new EventHandler(FormsPlot_Load); - SizeChanged += new EventHandler(OnSizeChanged); - ((ISupportInitialize)(pictureBox1)).EndInit(); - DefaultRightClickMenu.ResumeLayout(false); - ResumeLayout(false); - - } - #endregion - - #region Fields - - /// - /// This is the plot displayed by the user control. - /// After modifying it you may need to call Refresh() to request the plot be redrawn on the screen. - /// - public Plot Plot => Backend.Plot; - - /// - /// This object can be used to modify advanced behaior and customization of this user control. - /// - public readonly Configuration Configuration; - - private readonly ControlBackEnd Backend; - private readonly Dictionary Cursors; - private readonly bool IsDesignerMode = Process.GetCurrentProcess().ProcessName == "devenv"; - - private bool _showContextMenu; - - #endregion - - #region Properties - public bool ShowContextMenu - { - get => _showContextMenu; - - set - { - _showContextMenu = value; - - Invalidate(); - } - } - #endregion - - #region Events - - /// - /// This event is invoked any time the axis limits are modified. - /// - public event EventHandler AxesChanged; + private readonly SKControl _skElement; - /// - /// This event is invoked any time the plot is right-clicked. - /// By default it contains DefaultRightClickEvent(), but you can remove this and add your own method. - /// - public event EventHandler RightClicked; - - /// - /// This event is invoked after the mouse moves while dragging a draggable plottable. - /// The object passed is the plottable being dragged. - /// - public event EventHandler PlottableDragged; - - /// - /// This event is invoked right after a draggable plottable was dropped. - /// The object passed is the plottable that was just dropped. - /// - public event EventHandler PlottableDropped; - #endregion - - #region Constructor + public override GRContext GrContext => null!; public FormsPlot() { - Backend = new ControlBackEnd(1, 1, "FormsPlot"); - - Backend.Resize(Width, Height, false); - - Backend.BitmapChanged += Backend_BitmapChanged; - - Backend.BitmapUpdated += Backend_BitmapUpdated; - - Backend.CursorChanged += Backend_CursorChanged; - - Backend.RightClicked += Backend_RightClicked; - - Backend.AxesChanged += Backend_AxesChanged; - - Backend.PlottableDragged += Backend_PlottableDragged; - - Backend.PlottableDropped += Backend_PlottableDropped; - - Configuration = Backend.Configuration; - - if (IsDesignerMode) - { - try - { - Configuration.WarnIfRenderNotCalledManually = false; - - Plot.Title($"ScottPlot {Plot.Version}"); - - Plot.Render(); - } - catch (Exception e) - { - InitializeComponent(); - - pictureBox1.Visible = false; - - krtbErrorMessage.Visible = true; - - krtbErrorMessage.Dock = DockStyle.Fill; - - krtbErrorMessage.Text = - $@"ERROR: ScottPlot failed to render in design mode.\n\nThis may be due to incompatible System.Drawing.Common versions or a 32-bit/64-bit mismatch.\n\nAlthough rendering failed at design time, it may still function normally at runtime.\n\nException details:\n{e}"; - - return; - } - } - - Cursors = new Dictionary() - { - [ScottPlot.Cursor.Arrow] = System.Windows.Forms.Cursors.Arrow, - [ScottPlot.Cursor.WE] = System.Windows.Forms.Cursors.SizeWE, - [ScottPlot.Cursor.NS] = System.Windows.Forms.Cursors.SizeNS, - [ScottPlot.Cursor.All] = System.Windows.Forms.Cursors.SizeAll, - [ScottPlot.Cursor.CrossHair] = System.Windows.Forms.Cursors.Cross, - [ScottPlot.Cursor.Hand] = System.Windows.Forms.Cursors.Hand, - [ScottPlot.Cursor.Question] = System.Windows.Forms.Cursors.Help, - }; - - InitializeComponent(); - - krtbErrorMessage.Visible = false; - - pictureBox1.BackColor = Color.Transparent; - - BackColor = Color.Transparent; - - Plot.Style(BackColor); - - pictureBox1.MouseWheel += PictureBox1_MouseWheel; - - pictureBox1.MouseDown += PictureBox1_MouseDown; - - pictureBox1.MouseUp += PictureBox1_MouseUp; - - pictureBox1.DoubleClick += PictureBox1_DoubleClick; - - pictureBox1.MouseMove += PictureBox1_MouseMove; - - pictureBox1.MouseEnter += PictureBox1_MouseEnter; - - pictureBox1.MouseLeave += PictureBox1_MouseLeave; - - RightClicked += DefaultRightClickedEvent; - - ShowContextMenu = true; - - Backend.StartProcessingEvents(); - } - #endregion - - #region Event Handlers - /// - /// Return the mouse position on the plot (in coordinate space) for the latest X and Y coordinates - /// - public (double x, double y) GetMouseCoordinates() => Backend.GetMouseCoordinates(); - - /// - /// Return the mouse position (in pixel space) for the last observed mouse position - /// - public (float x, float y) GetMousePixel() => Backend.GetMousePixel(); - - /// - /// Reset this control by replacing the current plot with a new empty plot - /// - public void Reset() => Backend.Reset(Width, Height); - - /// - /// Reset this control by replacing the current plot with an existing plot - /// - public void Reset(Plot newPlot) => Backend.Reset(Width, Height, newPlot); - - /// - /// Re-render the plot and update the image displayed by this control. - /// - /// disable anti-aliasing to produce faster (but lower quality) plots - /// - public void Refresh(bool lowQuality = false, bool skipIfCurrentlyRendering = false) - { - Application.DoEvents(); - Backend.WasManuallyRendered = true; - Backend.Render(lowQuality, skipIfCurrentlyRendering); - } - - /// - /// Request the control to refresh the next time it is available. - /// This method does not block the calling thread. - /// - public void RefreshRequest(RenderType renderType = RenderType.LowQualityThenHighQualityDelayed) - { - Backend.WasManuallyRendered = true; - Backend.RenderRequest(renderType); - } - - public void DefaultRightClickedEvent(object sender, EventArgs e) - { - DefaultRightClickMenu.Show(System.Windows.Forms.Cursor.Position); - } - - private void PictureBox1_MouseWheel(object sender, MouseEventArgs e) - { - Backend.MouseWheel(GetInputState(e)); - - base.OnMouseWheel(e); - } - - private void PictureBox1_MouseLeave(object sender, EventArgs e) - { - base.OnMouseLeave(e); - } - - private void PictureBox1_MouseEnter(object sender, EventArgs e) - { - base.OnMouseEnter(e); - } - - private void PictureBox1_MouseMove(object sender, MouseEventArgs e) - { - Backend.MouseMove(GetInputState(e)); - - base.OnMouseMove(e); - } - - private void PictureBox1_DoubleClick(object sender, EventArgs e) - { - Backend.DoubleClick(); - - base.OnDoubleClick(e); - } - - private void PictureBox1_MouseUp(object sender, MouseEventArgs e) - { - Backend.MouseUp(GetInputState(e)); - - base.OnMouseUp(e); - } - - private void PictureBox1_MouseDown(object sender, MouseEventArgs e) - { - Backend.MouseMove(GetInputState(e)); - - base.OnMouseMove(e); - } - - private void Backend_PlottableDropped(object sender, EventArgs e) - { - PlottableDropped?.Invoke(sender, e); - } - - private void Backend_PlottableDragged(object sender, EventArgs e) - { - PlottableDragged?.Invoke(sender, e); - } + _skElement = new SKControl() { Dock = DockStyle.Fill }; + _skElement.PaintSurface += SKElement_PaintSurface; ; + _skElement.MouseDown += SKElement_MouseDown; + _skElement.MouseUp += SKElement_MouseUp; + _skElement.MouseMove += SKElement_MouseMove; + _skElement.DoubleClick += SKElement_DoubleClick; + _skElement.MouseWheel += SKElement_MouseWheel; + _skElement.KeyDown += SKElement_KeyDown; + _skElement.KeyUp += SKElement_KeyUp; - private void Backend_AxesChanged(object sender, EventArgs e) - { - AxesChanged?.Invoke(this, e); - } + Controls.Add(_skElement); - private void Backend_RightClicked(object sender, EventArgs e) - { - RightClicked?.Invoke(this, e); + HandleDestroyed += (s, e) => _skElement.Dispose(); } - private void Backend_CursorChanged(object sender, EventArgs e) + private void SKElement_PaintSurface(object? sender, SKPaintSurfaceEventArgs e) { - Cursor = Cursors[Backend.Cursor]; + Plot.Render(e.Surface.Canvas, (int)e.Surface.Canvas.LocalClipBounds.Width, (int)e.Surface.Canvas.LocalClipBounds.Height); } - private void Backend_BitmapUpdated(object sender, EventArgs e) + public override void Refresh() { - Application.DoEvents(); - - pictureBox1.Invalidate(); + _skElement.Invalidate(); + base.Refresh(); } - - private void OnSizeChanged(object sender, EventArgs e) => Backend.Resize(Width, Height, true); - - private void Backend_BitmapChanged(object sender, EventArgs e) - { - pictureBox1.Image = Backend.GetLatestBitmap(); - } - - private void FormsPlot_Load(object sender, EventArgs e) - { - OnSizeChanged(null, null); - } - - #endregion - - #region Methods - - private InputState GetInputState(MouseEventArgs mea) => new InputState() - { - X = mea.X, - Y = mea.Y, - LeftWasJustPressed = mea.Button == MouseButtons.Left, - RightWasJustPressed = mea.Button == MouseButtons.Right, - MiddleWasJustPressed = mea.Button == MouseButtons.Middle, - ShiftDown = ModifierKeys.HasFlag(Keys.Shift), - CtrlDown = ModifierKeys.HasFlag(Keys.Control), - AltDown = ModifierKeys.HasFlag(Keys.Alt), - WheelScrolledUp = mea.Delta > 0, - WheelScrolledDown = mea.Delta < 0 - }; - - #endregion - - private void copyMenuItem_Click(object sender, EventArgs e) - { - Clipboard.SetImage(Plot.Render()); - } - - private void saveImageMenuItem_Click(object sender, EventArgs e) - { - var sfd = new SaveFileDialog - { - FileName = "ScottPlot.png", - Filter = "PNG Files (*.png)|*.png;*.png" + - "|JPG Files (*.jpg, *.jpeg)|*.jpg;*.jpeg" + - "|BMP Files (*.bmp)|*.bmp;*.bmp" + - "|All files (*.*)|*.*" - }; - - if (sfd.ShowDialog() == DialogResult.OK) - { - Plot.SaveFig(sfd.FileName); - } - } - - private void autoAxisMenuItem_Click(object sender, EventArgs e) - { - Plot.AxisAuto(); - - Refresh(); - } - - private void helpMenuItem_Click(object sender, EventArgs e) - { - ScottPlotHelp help = new ScottPlotHelp(); - - help.ShowDialog(); - } - - private void openInNewWindowMenuItem_Click(object sender, EventArgs e) - { - new PlotViewer(Plot).Show(); - } - - #region Overrides - - protected override void OnPaint(PaintEventArgs e) - { - if (_showContextMenu) - { - ContextMenuStrip = DefaultRightClickMenu; - - pictureBox1.ContextMenuStrip = DefaultRightClickMenu; - } - else - { - ContextMenuStrip = null; - - pictureBox1.ContextMenuStrip = null; - } - - base.OnPaint(e); - } - - #endregion } -} +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlot.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlot.resx deleted file mode 100644 index f36e636b9..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlot.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlotBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlotBase.cs new file mode 100644 index 000000000..ef978eca2 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlotBase.cs @@ -0,0 +1,128 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public abstract class FormsPlotBase : UserControl, IPlotControl + { + #region Public + + public Plot Plot { get; internal set; } + + public IPlotInteraction Interaction { get; set; } + + public IPlotMenu Menu { get; set; } + + public abstract GRContext? GrContext { get; } + + public float DisplayScale { get; set; } + + #endregion + + #region Identity + + public FormsPlotBase() + { + DisplayScale = DetectDisplayScale(); + Interaction = new Interaction(this); + Menu = new FormsPlotMenu(this); + Plot = Reset(); + + // TODO: replace this with an annotation instead of title + bool isDesignMode = Process.GetCurrentProcess().ProcessName == "devenv"; + Plot.Title(isDesignMode ? $"ScottPlot {Version.VersionString}" : string.Empty); + } + + #endregion + + #region Implementation + + public Plot Reset() + { + Plot newPlot = new() + { + FigureBackground = this.BackColor.ToColor(), + }; + + return Reset(newPlot); + } + + public Plot Reset(Plot newPlot) + { + Plot oldPlot = Plot; + Plot = newPlot; + oldPlot?.Dispose(); + return newPlot; + } + + public void ShowContextMenu(Pixel position) => Menu.ShowContextMenu(position); + + public float DetectDisplayScale() + { + using var g = CreateGraphics(); + const int DEFAULT_DPI = 96; + var ratio = g.DpiX / DEFAULT_DPI; + return ratio; + } + + internal void SKElement_MouseDown(object? sender, MouseEventArgs e) + { + Interaction.MouseDown(e.Pixel(), e.Button()); + base.OnMouseDown(e); + } + + internal void SKElement_MouseUp(object? sender, MouseEventArgs e) + { + Interaction.MouseUp(e.Pixel(), e.Button()); + base.OnMouseUp(e); + } + + internal void SKElement_MouseMove(object? sender, MouseEventArgs e) + { + Interaction.OnMouseMove(e.Pixel()); + base.OnMouseMove(e); + } + + internal void SKElement_DoubleClick(object? sender, EventArgs e) + { + Interaction.DoubleClick(); + base.OnDoubleClick(e); + } + + internal void SKElement_MouseWheel(object? sender, MouseEventArgs e) + { + Interaction.MouseWheelVertical(e.Pixel(), e.Delta); + base.OnMouseWheel(e); + } + + internal void SKElement_KeyDown(object? sender, KeyEventArgs e) + { + Interaction.KeyDown(e.Key()); + base.OnKeyDown(e); + } + + internal void SKElement_KeyUp(object? sender, KeyEventArgs e) + { + Interaction.KeyUp(e.Key()); + base.OnKeyUp(e); + } + + #endregion + + #region Public Overrides + + public override System.Drawing.Color BackColor + { + get => base.BackColor; + + set + { + base.BackColor = value; + + if (Plot != null) + { + Plot.FigureBackground = value.ToColor(); + } + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/UX/ScottPlotHelp.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlotBase.resx similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/UX/ScottPlotHelp.resx rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlotBase.resx diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlotExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlotExtensions.cs new file mode 100644 index 000000000..e0d0f568f --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlotExtensions.cs @@ -0,0 +1,42 @@ +using StandardKeys = System.Windows.Forms.Keys; + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal static class FormsPlotExtensions + { + internal static Pixel Pixel(this MouseEventArgs e) + { + return new Pixel(e.X, e.Y); + } + + internal static MouseButton Button(this MouseEventArgs e) + { + return e.Button switch + { + MouseButtons.Left => MouseButton.Left, + MouseButtons.Right => MouseButton.Right, + MouseButtons.Middle => MouseButton.Middle, + _ => MouseButton.Unknown, + }; + } + + internal static Key Key(this KeyEventArgs e) + { + return e.KeyCode switch + { + StandardKeys.ControlKey => ScottPlot.Key.Ctrl, + StandardKeys.Menu => ScottPlot.Key.Alt, + StandardKeys.ShiftKey => ScottPlot.Key.Shift, + _ => ScottPlot.Key.Unknown, + }; + } + + internal static Bitmap GetBitmap(this Plot plot, int width, int height) + { + byte[] bytes = plot.GetImage(width, height).GetImageBytes(); + using MemoryStream ms = new(bytes); + Bitmap bmp = new(ms); + return bmp; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlotGL.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlotGL.cs new file mode 100644 index 000000000..19f69a461 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlotGL.cs @@ -0,0 +1,55 @@ +using System.Xml.Linq; + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class FormsPlotGL : FormsPlotBase + { + #region Instance Fields + + private readonly SKGLControl _skElement; + + #endregion + + #region Public + + public override GRContext? GrContext => _skElement.GRContext; + + #endregion + + #region Identity + + public FormsPlotGL() + { + _skElement = new SKGLControl() { Dock = DockStyle.Fill, VSync = true }; + _skElement.PaintSurface += SKControl_PaintSurface; + _skElement.MouseDown += SKElement_MouseDown; + _skElement.MouseUp += SKElement_MouseUp; + _skElement.MouseMove += SKElement_MouseMove; + _skElement.DoubleClick += SKElement_DoubleClick; + _skElement.MouseWheel += SKElement_MouseWheel; + _skElement.KeyDown += SKElement_KeyDown; + _skElement.KeyUp += SKElement_KeyUp; + + Controls.Add(_skElement); + + HandleDestroyed += (s, e) => _skElement.Dispose(); + } + + #endregion + + #region Implementation + + private void SKControl_PaintSurface(object? sender, SKPaintGLSurfaceEventArgs e) + { + Plot.Render(e.Surface.Canvas, (int)e.Surface.Canvas.LocalClipBounds.Width, (int)e.Surface.Canvas.LocalClipBounds.Height); + } + + public override void Refresh() + { + _skElement.Invalidate(); + base.Refresh(); + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlotMenu.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlotMenu.cs new file mode 100644 index 000000000..ac8faa0ff --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlotMenu.cs @@ -0,0 +1,123 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class FormsPlotMenu : IPlotMenu + { + public string DefaultSaveImageFilename { get; set; } = "Plot.png"; + public List ContextMenuItems { get; set; } = new(); + private readonly FormsPlotBase _thisControl; + + public FormsPlotMenu(FormsPlotBase control) + { + _thisControl = control; + Reset(); + } + + public List StandardContextMenuItems() + { + ContextMenuItem saveImage = new() + { + Label = "Save Image", + OnInvoke = OpenSaveImageDialog, + }; + + ContextMenuItem copyImage = new() + { + Label = "Copy to Clipboard", + OnInvoke = CopyImageToClipboard + }; + + return new List() { + saveImage, + copyImage, + }; + } + + public void CopyImageToClipboard(IPlotControl plotControl) + { + PixelSize lastRenderSize = plotControl.Plot.RenderManager.LastRender.FigureRect.Size; + Bitmap bmp = plotControl.Plot.GetBitmap((int)lastRenderSize.Width, (int)lastRenderSize.Height); + Clipboard.SetImage(bmp); + } + + public ContextMenuStrip GetContextMenu() + { + ContextMenuStrip menu = new(); + + foreach (ContextMenuItem item in ContextMenuItems) + { + ToolStripMenuItem menuItem = new(item.Label); + menuItem.Click += (s, e) => item.OnInvoke(_thisControl); + + menu.Items.Add(menuItem); + } + + return menu; + } + + public void OpenSaveImageDialog(IPlotControl plotControl) + { + SaveFileDialog dialog = new() + { + FileName = DefaultSaveImageFilename, + Filter = "PNG Files (*.png)|*.png" + + "|JPEG Files (*.jpg, *.jpeg)|*.jpg;*.jpeg" + + "|BMP Files (*.bmp)|*.bmp" + + "|WebP Files (*.webp)|*.webp" + + "|SVG Files (*.svg)|*.svg" + + "|All files (*.*)|*.*" + }; + + if (dialog.ShowDialog() == DialogResult.OK) + { + if (string.IsNullOrEmpty(dialog.FileName)) + return; + + ImageFormat format; + + try + { + format = ImageFormatLookup.FromFilePath(dialog.FileName); + } + catch (ArgumentException) + { + MessageBox.Show("Unsupported image file format", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + try + { + PixelSize lastRenderSize = plotControl.Plot.RenderManager.LastRender.FigureRect.Size; + plotControl.Plot.Save(dialog.FileName, (int)lastRenderSize.Width, (int)lastRenderSize.Height, format); + } + catch (Exception) + { + MessageBox.Show("Image save failed", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + } + + public void ShowContextMenu(Pixel pixel) + { + DebugUtilities.WriteLine("Showing Context Menu"); + ContextMenuStrip menu = GetContextMenu(); + menu.Show(_thisControl, new Point((int)pixel.X, (int)pixel.Y)); + } + + public void Reset() + { + Clear(); + ContextMenuItems.AddRange(StandardContextMenuItems()); + } + + public void Clear() + { + ContextMenuItems.Clear(); + } + + public void Add(string label, Action action) + { + ContextMenuItems.Add(new ContextMenuItem() { Label = label, OnInvoke = action }); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlotViewer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlotViewer.cs new file mode 100644 index 000000000..b165de563 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/FormsPlotViewer.cs @@ -0,0 +1,21 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public static class FormsPlotViewer + { + public static void Launch(Plot plot, string title = "", int width = 600, int height = 400) + { + FormsPlot formsPlot = new() { Dock = DockStyle.Fill }; + formsPlot.Reset(plot); + + KryptonForm form = new KryptonForm() + { + StartPosition = FormStartPosition.CenterScreen, + Width = width, + Height = height, + Text = title, + }; + form.Controls.Add(formsPlot); + form.ShowDialog(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/InputState.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/InputState.cs deleted file mode 100644 index 790e16277..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/InputState.cs +++ /dev/null @@ -1,44 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class InputState - { - public float X { get; set; } = float.NaN; - public float Y { get; set; } = float.NaN; - public bool LeftWasJustPressed { get; set; } = false; - public bool RightWasJustPressed { get; set; } = false; - public bool MiddleWasJustPressed { get; set; } = false; - public bool ButtonDown => LeftWasJustPressed || RightWasJustPressed || MiddleWasJustPressed; - public bool ShiftDown { get; set; } = false; - public bool CtrlDown { get; set; } = false; - public bool AltDown { get; set; } = false; - public bool WheelScrolledUp { get; set; } = false; - public bool WheelScrolledDown { get; set; } = false; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/QualityConfiguration.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/QualityConfiguration.cs deleted file mode 100644 index fd68d7525..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Controls/QualityConfiguration.cs +++ /dev/null @@ -1,44 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// This class defines the quality to use for renders after different interactive events occur. - /// Programmatically-triggered events typically use high quality mode (anti-aliasing enabled). - /// Real-time mouse-interactive events like zooming and panning typically use low quality mode. - /// It is possible to automatically render using high quality after a period of inactivity. - /// - public class QualityConfiguration - { - public RenderType BenchmarkToggle = RenderType.HighQuality; - public RenderType AutoAxis = RenderType.LowQualityThenHighQualityDelayed; - public RenderType MouseInteractiveDragged = RenderType.LowQuality; - public RenderType MouseInteractiveDropped = RenderType.HighQuality; - public RenderType MouseWheelScrolled = RenderType.LowQualityThenHighQualityDelayed; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AutoScalers/FractionalAutoScaler.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AutoScalers/FractionalAutoScaler.cs new file mode 100644 index 000000000..34fd0e792 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AutoScalers/FractionalAutoScaler.cs @@ -0,0 +1,116 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class FractionalAutoScaler : IAutoScaler + { + public readonly double LeftFraction; + public readonly double RightFraction; + public readonly double BottomFraction; + public readonly double TopFraction; + + /// + /// Pad the data area with the given fractions of whitespace. + /// A value of 0.1 means 10% padding (5% on each side of the data area). + /// + public FractionalAutoScaler(double horizontal = .1, double vertical = .15) + { + LeftFraction = horizontal / 2; + RightFraction = horizontal / 2; + BottomFraction = vertical / 2; + TopFraction = vertical / 2; + } + + /// + /// Pad each side of the data area with the exact fraction of whitespace. + /// 0.05 means 5% whitespace on that side of the data area. + /// + public FractionalAutoScaler(double left, double right, double bottom, double top) + { + LeftFraction = left; + RightFraction = right; + BottomFraction = bottom; + TopFraction = top; + } + + public bool InvertedX { get; set; } = false; + public bool InvertedY { get; set; } = false; + + public void AutoScaleAll(IEnumerable plottables) + { + // TODO: this should call the GetAxisLimits() below + + IEnumerable xAxes = plottables.Select(x => x.Axes.XAxis).Distinct(); + IEnumerable yAxes = plottables.Select(x => x.Axes.YAxis).Distinct(); + + xAxes.ToList().ForEach(x => x.Range.Reset()); + yAxes.ToList().ForEach(x => x.Range.Reset()); + + foreach (IPlottable plottable in plottables) + { + AxisLimits limits = plottable.GetAxisLimits(); + plottable.Axes.XAxis.Range.Expand(limits.XRange); + plottable.Axes.YAxis.Range.Expand(limits.YRange); + } + + foreach (IAxis xAxis in xAxes) + { + var left = xAxis.Range.Min - xAxis.Range.Span * LeftFraction; + var right = xAxis.Range.Max + xAxis.Range.Span * RightFraction; + if (NumericConversion.IsReal(left) && NumericConversion.IsReal(right)) + { + xAxis.Range.Set(left, right); + } + } + + foreach (IYAxis yAxis in yAxes) + { + var bottom = yAxis.Range.Min - yAxis.Range.Span * BottomFraction; + var top = yAxis.Range.Max + yAxis.Range.Span * TopFraction; + if (NumericConversion.IsReal(bottom) && NumericConversion.IsReal(top)) + { + yAxis.Range.Set(bottom, top); + } + } + } + + public AxisLimits GetAxisLimits(Plot plot, IXAxis xAxis, IYAxis yAxis) + { + ExpandingAxisLimits limits = new(); + + foreach (IPlottable plottable in plot.PlottableList.Where(x => x.Axes.XAxis == xAxis && x.Axes.YAxis == yAxis)) + { + limits.Expand(plottable.GetAxisLimits()); + } + + if (!limits.IsRealX) + { + limits.SetX(-10, 10); + } + + if (!limits.IsRealY) + { + limits.SetY(-10, 10); + } + + if (limits.Left == limits.Right) + { + limits.SetX(limits.Left - 1, limits.Right + 1); + } + + if (limits.Bottom == limits.Top) + { + limits.SetY(limits.Bottom - 1, limits.Top + 1); + } + + AxisLimits newLimits = new( + left: limits.Left - limits.HorizontalSpan * LeftFraction, + right: limits.Right + limits.HorizontalSpan * RightFraction, + bottom: limits.Bottom - limits.VerticalSpan * BottomFraction, + top: limits.Top + limits.VerticalSpan * TopFraction); + + return !newLimits.IsReal || !newLimits.HasArea + ? throw new InvalidOperationException( + "limits returned by the autoscaler must always be in a good state") + : newLimits; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisManagers/FixedWidth.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisManagers/FixedWidth.cs new file mode 100644 index 000000000..57f861bfa --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisManagers/FixedWidth.cs @@ -0,0 +1,23 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class FixedWidth : IAxisManager + { + /// + /// Fractional amount to expand the axis vertically if data runs outside the current view + /// + public double ExpandFractionY = 0.5; + + public AxisLimits GetAxisLimits(AxisLimits viewLimits, AxisLimits dataLimits) + { + double xMin = dataLimits.Left; + double xMax = dataLimits.Right; + + var expandY = ExpandFractionY * dataLimits.VerticalSpan; + + var yMin = dataLimits.Bottom < viewLimits.Bottom ? dataLimits.Bottom - expandY : viewLimits.Bottom; + var yMax = dataLimits.Top > viewLimits.Top ? dataLimits.Top + expandY : viewLimits.Top; + + return new AxisLimits(xMin, xMax, yMin, yMax); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisManagers/Full.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisManagers/Full.cs new file mode 100644 index 000000000..62cb03f2e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisManagers/Full.cs @@ -0,0 +1,42 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Show the entire range of data, changing the axis limits only + /// when the data extends otuside the current view. + /// + public class Full : IAxisManager + { + /// + /// Defines the amount of whitespace added to the right of the data when data runs outside the current view. + /// 1.0 for a view that tightly fits the data and is always changing. + /// 2.0 for a view that doubles the horizontal span when new data runs outside the current view. + /// + public double ExpansionRatio { get; set; } = .25; + + public AxisLimits GetAxisLimits(AxisLimits viewLimits, AxisLimits dataLimits) + { + bool rightEdgeIsTooClose = viewLimits.Right < dataLimits.Right; + bool rightEdgeIsTooFar = viewLimits.Right > dataLimits.Right + dataLimits.HorizontalSpan; + var replaceRight = rightEdgeIsTooClose || rightEdgeIsTooFar; + var xMax = replaceRight + ? dataLimits.Right + dataLimits.HorizontalSpan * ExpansionRatio + : viewLimits.Right; + + bool topEdgeIsTooClose = viewLimits.Top < dataLimits.Top; + bool topEdgeIsTooFar = viewLimits.Top < dataLimits.Top + dataLimits.VerticalSpan; + var replaceTop = topEdgeIsTooClose || topEdgeIsTooFar; + var yMax = replaceTop + ? dataLimits.Top + dataLimits.VerticalSpan * ExpansionRatio + : viewLimits.Top; + + bool bottomEdgeIsTooClose = viewLimits.Bottom > dataLimits.Bottom; + bool bottomEdgeIsTooFar = viewLimits.Bottom > dataLimits.Bottom - dataLimits.VerticalSpan; + var replaceBottom = bottomEdgeIsTooClose || bottomEdgeIsTooFar; + var yMin = replaceBottom + ? dataLimits.Bottom - dataLimits.VerticalSpan * ExpansionRatio + : viewLimits.Bottom; + + return new AxisLimits(dataLimits.Left, xMax, yMin, yMax); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisManagers/IAxisManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisManagers/IAxisManager.cs new file mode 100644 index 000000000..e97895cdd --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisManagers/IAxisManager.cs @@ -0,0 +1,13 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// An axis manager contains logic to suggest axis limits given the current view and size of the data. + /// + public interface IAxisManager + { + /// + /// Return recommended axis limits given the current view and size of the data + /// + AxisLimits GetAxisLimits(AxisLimits viewLimits, AxisLimits dataLimits); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisManagers/Slide.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisManagers/Slide.cs new file mode 100644 index 000000000..e89e3c86d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisManagers/Slide.cs @@ -0,0 +1,43 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Slide the view to the right to keep the newest data points in view + /// + public class Slide : IAxisManager + { + /// + /// Amount of horizontal area to display (in axis units) + /// + public double Width { get; set; } = 1000; + + /// + /// Defines the amount of whitespace added to the right of the data when data runs outside the current view. + /// 0 for a view that slides every time new data is added + /// 1 for a view that only slides forward when new data runs off the screen + /// + public double PaddingFractionX = 0; + + /// + /// Defines the amount of whitespace added to the top or bottom of the data when data runs outside the current view. + /// 0 sets axis limits to tightly fit the data height + /// 1 sets axis limits to double the vertical span in the direction of the vertical overflow + /// + public double PaddingFractionY = .5; + + public AxisLimits GetAxisLimits(AxisLimits viewLimits, AxisLimits dataLimits) + { + var padHorizontal = Width * PaddingFractionX; + var padVertical = viewLimits.VerticalSpan * PaddingFractionY; + + var xOverflow = dataLimits.Right > viewLimits.Right || dataLimits.Right < viewLimits.Left; + var xMax = xOverflow ? dataLimits.Right + padHorizontal : viewLimits.Right; + var xMin = xOverflow ? xMax - Width : viewLimits.Left; + + var yOverflow = dataLimits.Bottom < viewLimits.Bottom || dataLimits.Top > viewLimits.Top; + var yMin = yOverflow ? dataLimits.Bottom - padVertical : viewLimits.Bottom; + var yMax = yOverflow ? dataLimits.Top + padVertical : viewLimits.Top; + + return new AxisLimits(xMin, xMax, yMin, yMax); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/AxisBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/AxisBase.cs new file mode 100644 index 000000000..7f696d97e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/AxisBase.cs @@ -0,0 +1,185 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public abstract class AxisBase + { + public bool IsVisible { get; set; } = true; + + public abstract Edge Edge { get; } + + public virtual CoordinateRangeMutable Range { get; private set; } = CoordinateRangeMutable.NotSet; + public float MinimumSize { get; set; } = 0; + public float MaximumSize { get; set; } = float.MaxValue; + + public double Min + { + get => Range.Min; + set => Range.Min = value; + } + + public double Max + { + get => Range.Max; + set => Range.Max = value; + } + + public override string ToString() + { + return base.ToString() + " " + Range.ToString(); + } + + public virtual ITickGenerator TickGenerator { get; set; } = null!; + + public Label Label { get; private set; } = new() + { + Text = string.Empty, + FontSize = 16, + Bold = true, + Rotation = -90, + }; + + public bool ShowDebugInformation { get; set; } = false; + + public LineStyle FrameLineStyle { get; } = new(); + + public TickMarkStyle MajorTickStyle { get; set; } = new() + { + Length = 4, + Width = 1, + Color = Colors.Black + }; + + public TickMarkStyle MinorTickStyle { get; set; } = new() + { + Length = 2, + Width = 1, + Color = Colors.Black + }; + + public Label TickLabelStyle { get; set; } = new() + { + Alignment = Alignment.MiddleCenter + }; + + /// + /// Apply a single color to all axis components: label, tick labels, tick marks, and frame + /// + public void Color(Color color) + { + Label.ForeColor = color; + TickLabelStyle.ForeColor = color; + MajorTickStyle.Color = color; + MinorTickStyle.Color = color; + FrameLineStyle.Color = color; + } + + /// + /// Draw a line along the edge of an axis on the side of the data area + /// + public static void DrawFrame(RenderPack rp, PixelRect panelRect, Edge edge, LineStyle lineStyle) + { + PixelLine pxLine = edge switch + { + Edge.Left => new(panelRect.Right, panelRect.Bottom, panelRect.Right, panelRect.Top), + Edge.Right => new(panelRect.Left, panelRect.Bottom, panelRect.Left, panelRect.Top), + Edge.Bottom => new(panelRect.Left, panelRect.Top, panelRect.Right, panelRect.Top), + Edge.Top => new(panelRect.Left, panelRect.Bottom, panelRect.Right, panelRect.Bottom), + _ => throw new NotImplementedException(edge.ToString()), + }; + + using SKPaint paint = new(); + Drawing.DrawLine(rp.Canvas, paint, pxLine, lineStyle); + } + + private static void DrawTicksHorizontalAxis(RenderPack rp, Label label, PixelRect panelRect, IEnumerable ticks, IAxis axis, TickMarkStyle majorStyle, TickMarkStyle minorStyle) + { + if (axis.Edge != Edge.Bottom && axis.Edge != Edge.Top) + { + throw new InvalidOperationException(); + } + + using SKPaint paint = new(); + label.ApplyToPaint(paint); + + paint.TextAlign = SKTextAlign.Center; + + foreach (Tick tick in ticks) + { + // draw tick + paint.Color = tick.IsMajor ? majorStyle.Color.ToSkColor() : minorStyle.Color.ToSkColor(); + paint.StrokeWidth = tick.IsMajor ? majorStyle.Width : minorStyle.Width; + float tickLength = tick.IsMajor ? majorStyle.Length : minorStyle.Length; + float xPx = axis.GetPixel(tick.Position, panelRect); + float y = axis.Edge == Edge.Bottom ? panelRect.Top : panelRect.Bottom; + var yEdge = axis.Edge == Edge.Bottom ? y + tickLength : y - tickLength; + PixelLine pxLine = new(xPx, y, xPx, yEdge); + Drawing.DrawLine(rp.Canvas, paint, pxLine); + + // draw label + if (!string.IsNullOrWhiteSpace(tick.Label)) + { + var fontSpacing = axis.Edge == Edge.Bottom ? paint.TextSize : -4; + foreach (string line in tick.Label.Split('\n')) + { + label.Text = line; + Pixel px = new(xPx, yEdge + fontSpacing); + label.Render(rp.Canvas, px); + fontSpacing += paint.TextSize; + } + } + } + } + + private static void DrawTicksVerticalAxis(RenderPack rp, Label label, PixelRect panelRect, IEnumerable ticks, IAxis axis, TickMarkStyle majorStyle, TickMarkStyle minorStyle) + { + if (axis.Edge != Edge.Left && axis.Edge != Edge.Right) + { + throw new InvalidOperationException(); + } + + using SKPaint paint = new(); + label.ApplyToPaint(paint); + label.Alignment = axis.Edge == Edge.Left ? Alignment.MiddleRight : Alignment.MiddleLeft; + + foreach (Tick tick in ticks) + { + // draw tick + paint.Color = tick.IsMajor ? majorStyle.Color.ToSkColor() : minorStyle.Color.ToSkColor(); + paint.StrokeWidth = tick.IsMajor ? majorStyle.Width : minorStyle.Width; + float tickLength = tick.IsMajor ? majorStyle.Length : minorStyle.Length; + float x = axis.Edge == Edge.Left ? panelRect.Right : panelRect.Left; + float y = axis.GetPixel(tick.Position, panelRect); + var xEdge = axis.Edge == Edge.Left ? x - tickLength : x + tickLength; + PixelLine pxLine = new(x, y, xEdge, y); + Drawing.DrawLine(rp.Canvas, paint, pxLine); + + // draw label + float majorTickLabelPadding = 7; + var labelPos = axis.Edge == Edge.Left ? x - majorTickLabelPadding : x + majorTickLabelPadding; + if (!string.IsNullOrWhiteSpace(tick.Label)) + { + string[] lines = tick.Label.Split('\n'); + double fontSpacing = -paint.TextSize * (lines.Length - 1) / 2; + foreach (var line in lines) + { + label.Text = line; + Pixel px = new(labelPos, y + fontSpacing); + label.Render(rp.Canvas, px); + fontSpacing += paint.TextSize; + } + } + } + } + + public static void DrawTicks(RenderPack rp, Label label, PixelRect panelRect, IEnumerable ticks, IAxis axis, TickMarkStyle majorStyle, TickMarkStyle minorStyle) + { + if (axis.Edge.IsVertical()) + { + DrawTicksVerticalAxis(rp, label, panelRect, ticks, axis, majorStyle, minorStyle); + } + else + { + DrawTicksHorizontalAxis(rp, label, panelRect, ticks, axis, majorStyle, minorStyle); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/BottomAxis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/BottomAxis.cs new file mode 100644 index 000000000..859afd092 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/BottomAxis.cs @@ -0,0 +1,12 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class BottomAxis : XAxisBase, IXAxis + { + public override Edge Edge => Edge.Bottom; + + public BottomAxis() + { + TickGenerator = new NumericAutomatic(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/DateTimeXAxis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/DateTimeXAxis.cs new file mode 100644 index 000000000..588891451 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/DateTimeXAxis.cs @@ -0,0 +1,28 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class DateTimeXAxis : XAxisBase, IXAxis + { + public override Edge Edge { get; } = Edge.Bottom; + + private IDateTimeTickGenerator _tickGenerator = new DateTimeAutomatic(); + + public override ITickGenerator TickGenerator + { + get => _tickGenerator; + set + { + if (value is not IDateTimeTickGenerator) + { + throw new ArgumentException($"Date axis must have a {nameof(ITickGenerator)} generator"); + } + + _tickGenerator = (IDateTimeTickGenerator)value; + } + } + + public IEnumerable ConvertToCoordinateSpace(IEnumerable dates) => + TickGenerator is IDateTimeTickGenerator dateTickGenerator + ? dateTickGenerator.ConvertToCoordinateSpace(dates) + : throw new InvalidOperationException("Date axis configured with non-date tick generator"); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/LeftAxis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/LeftAxis.cs new file mode 100644 index 000000000..cde7927d2 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/LeftAxis.cs @@ -0,0 +1,13 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class LeftAxis : YAxisBase, IYAxis + { + public override Edge Edge { get; } = Edge.Left; + + public LeftAxis() + { + TickGenerator = new NumericAutomatic(); + Label.Rotation = -90; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/MirroredXAxis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/MirroredXAxis.cs new file mode 100644 index 000000000..ae9338fba --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/MirroredXAxis.cs @@ -0,0 +1,17 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public sealed class MirroredXAxis : XAxisBase, IXAxis + { + private readonly Edge _edge; + private readonly IXAxis _axis; + public override Edge Edge => _edge; + public override CoordinateRangeMutable Range => new(_axis.Min, _axis.Max); + + public MirroredXAxis(IXAxis axis, Edge? edge) + { + _axis = axis; + _edge = edge ?? axis.Edge; + TickGenerator = axis.TickGenerator; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/MirroredYAxis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/MirroredYAxis.cs new file mode 100644 index 000000000..954a9482a --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/MirroredYAxis.cs @@ -0,0 +1,17 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public sealed class MirroredYAxis : YAxisBase, IYAxis + { + private readonly Edge _edge; + private readonly IYAxis _axis; + public override Edge Edge => _edge; + public override CoordinateRangeMutable Range => new(_axis.Min, _axis.Max); + + public MirroredYAxis(IYAxis axis, Edge? edge) + { + _axis = axis; + _edge = edge ?? axis.Edge; + TickGenerator = axis.TickGenerator; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/RightAxis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/RightAxis.cs new file mode 100644 index 000000000..d906e27c4 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/RightAxis.cs @@ -0,0 +1,13 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class RightAxis : YAxisBase, IYAxis + { + public override Edge Edge { get; } = Edge.Right; + + public RightAxis() + { + TickGenerator = new NumericAutomatic(); + Label.Rotation = 90; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/TopAxis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/TopAxis.cs new file mode 100644 index 000000000..4df5d1e42 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/TopAxis.cs @@ -0,0 +1,12 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class TopAxis : XAxisBase, IXAxis + { + public override Edge Edge => Edge.Top; + + public TopAxis() + { + TickGenerator = new NumericAutomatic(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/XAxisBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/XAxisBase.cs new file mode 100644 index 000000000..bd734e539 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/XAxisBase.cs @@ -0,0 +1,116 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public abstract class XAxisBase : AxisBase, IAxis + { + public double Width => Range.Span; + + public XAxisBase() + { + Label.Rotation = 0; + } + + public float Measure() + { + if (!IsVisible) + { + return 0; + } + + var largestTickSize = MeasureTicks(); + float largestTickLabelSize = Label.Measure().Height; + float spaceBetweenTicksAndAxisLabel = 15; + return largestTickSize + largestTickLabelSize + spaceBetweenTicksAndAxisLabel; + } + + private float MeasureTicks() + { + using SKPaint paint = new(); + TickLabelStyle.ApplyToPaint(paint); + + float largestTickHeight = 0; + + foreach (Tick tick in TickGenerator.Ticks) + { + PixelSize tickLabelSize = Drawing.MeasureString(tick.Label, paint); + largestTickHeight = Math.Max(largestTickHeight, tickLabelSize.Height + 10); + } + + return largestTickHeight; + } + + public float GetPixel(double position, PixelRect dataArea) + { + var pxPerUnit = dataArea.Width / Width; + var unitsFromLeftEdge = position - Min; + var pxFromEdge = (float)(unitsFromLeftEdge * pxPerUnit); + return dataArea.Left + pxFromEdge; + } + + public double GetCoordinate(float pixel, PixelRect dataArea) + { + var pxPerUnit = dataArea.Width / Width; + var pxFromLeftEdge = pixel - dataArea.Left; + var unitsFromEdge = pxFromLeftEdge / pxPerUnit; + return Min + unitsFromEdge; + } + + private PixelRect GetPanelRectangleBottom(PixelRect dataRect, float size, float offset) + { + return new PixelRect( + left: dataRect.Left, + right: dataRect.Right, + bottom: dataRect.Bottom + offset + size, + top: dataRect.Bottom + offset); + } + + private PixelRect GetPanelRectangleTop(PixelRect dataRect, float size, float offset) + { + return new PixelRect( + left: dataRect.Left, + right: dataRect.Right, + bottom: dataRect.Top - offset, + top: dataRect.Top - offset - size); + } + + public PixelRect GetPanelRect(PixelRect dataRect, float size, float offset) + { + return Edge == Edge.Bottom + ? GetPanelRectangleBottom(dataRect, size, offset) + : GetPanelRectangleTop(dataRect, size, offset); + } + + public void Render(RenderPack rp, float size, float offset) + { + if (!IsVisible) + { + return; + } + + PixelRect panelRect = GetPanelRect(rp.DataRect, size, offset); + + float textDistanceFromEdge = 10; + Pixel labelPoint = new(panelRect.HorizontalCenter, panelRect.Bottom - textDistanceFromEdge); + + if (ShowDebugInformation) + { + Drawing.DrawDebugRectangle(rp.Canvas, panelRect, labelPoint, Label.ForeColor); + } + + Label.Alignment = Alignment.LowerCenter; + Label.Render(rp.Canvas, labelPoint); + + DrawTicks(rp, TickLabelStyle, panelRect, TickGenerator.Ticks, this, MajorTickStyle, MinorTickStyle); + DrawFrame(rp, panelRect, Edge, FrameLineStyle); + } + + public double GetPixelDistance(double distance, PixelRect dataArea) + { + return distance * dataArea.Width / Width; + } + + public double GetCoordinateDistance(float distance, PixelRect dataArea) + { + return distance / (dataArea.Width / Width); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/YAxisBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/YAxisBase.cs new file mode 100644 index 000000000..06c0f0fe8 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisPanels/YAxisBase.cs @@ -0,0 +1,112 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public abstract class YAxisBase : AxisBase, IAxis + { + public double Height => Range.Span; + + public float GetPixel(double position, PixelRect dataArea) + { + var pxPerUnit = dataArea.Height / Height; + var unitsFromMinValue = position - Min; + var pxFromEdge = (float)(unitsFromMinValue * pxPerUnit); + return dataArea.Bottom - pxFromEdge; + } + + public double GetCoordinate(float pixel, PixelRect dataArea) + { + var pxPerUnit = dataArea.Height / Height; + var pxFromMinValue = pixel - dataArea.Bottom; + var unitsFromMinValue = pxFromMinValue / pxPerUnit; + return Min - unitsFromMinValue; + } + + public float Measure() + { + if (!IsVisible) + { + return 0; + } + + var largestTickSize = MeasureTicks(); + float largestTickLabelSize = Label.Measure().Height; + float spaceBetweenTicksAndAxisLabel = 15; + return largestTickSize + largestTickLabelSize + spaceBetweenTicksAndAxisLabel; + } + + private float MeasureTicks() + { + using SKPaint paint = new(); + TickLabelStyle.ApplyToPaint(paint); + + float largestTickWidth = 0; + + foreach (Tick tick in TickGenerator.Ticks) + { + PixelSize tickLabelSize = Drawing.MeasureString(tick.Label, paint); + largestTickWidth = Math.Max(largestTickWidth, tickLabelSize.Width + 10); + } + + return largestTickWidth; + } + + private PixelRect GetPanelRectangleLeft(PixelRect dataRect, float size, float offset) + { + return new PixelRect( + left: dataRect.Left - offset - size, + right: dataRect.Left - offset, + bottom: dataRect.Bottom, + top: dataRect.Top); + } + + private PixelRect GetPanelRectangleRight(PixelRect dataRect, float size, float offset) + { + return new PixelRect( + left: dataRect.Right + offset, + right: dataRect.Right + offset + size, + bottom: dataRect.Bottom, + top: dataRect.Top); + } + + public PixelRect GetPanelRect(PixelRect dataRect, float size, float offset) + { + return Edge == Edge.Left + ? GetPanelRectangleLeft(dataRect, size, offset) + : GetPanelRectangleRight(dataRect, size, offset); + } + + public void Render(RenderPack rp, float size, float offset) + { + if (!IsVisible) + { + return; + } + + PixelRect panelRect = GetPanelRect(rp.DataRect, size, offset); + + float textDistanceFromEdge = 10; + var labelX = Edge == Edge.Left ? panelRect.Left + textDistanceFromEdge : panelRect.Right - textDistanceFromEdge; + Pixel labelPoint = new(labelX, rp.DataRect.VerticalCenter); + + if (ShowDebugInformation) + { + Drawing.DrawDebugRectangle(rp.Canvas, panelRect, labelPoint, Label.ForeColor); + } + + Label.Alignment = Alignment.UpperCenter; + Label.Render(rp.Canvas, labelPoint); + + DrawTicks(rp, TickLabelStyle, panelRect, TickGenerator.Ticks, this, MajorTickStyle, MinorTickStyle); + DrawFrame(rp, panelRect, Edge, FrameLineStyle); + } + + public double GetPixelDistance(double distance, PixelRect dataArea) + { + return distance * dataArea.Height / Height; + } + + public double GetCoordinateDistance(float distance, PixelRect dataArea) + { + return distance / (dataArea.Height / Height); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/LockedHorizontal.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/LockedHorizontal.cs new file mode 100644 index 000000000..50a883ecb --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/LockedHorizontal.cs @@ -0,0 +1,26 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class LockedHorizontal : IAxisRule + { + readonly IXAxis _xAxis; + + public LockedHorizontal(IXAxis xAxis) + { + _xAxis = xAxis; + } + + public void Apply(RenderPack rp, bool beforeLayout) + { + // rules that refer to the last render must wait for a render to occur + if (rp.Plot.LastRender.Count == 0) + { + return; + } + + // TODO: reference the correct axis from the previous render + double xMin = rp.Plot.LastRender.AxisLimits.Left; + double xMax = rp.Plot.LastRender.AxisLimits.Right; + _xAxis.Range.Set(xMin, xMax); + } + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/LockedVertical.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/LockedVertical.cs new file mode 100644 index 000000000..ff7fffd23 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/LockedVertical.cs @@ -0,0 +1,26 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class LockedVertical : IAxisRule + { + private readonly IYAxis _yAxis; + + public LockedVertical(IYAxis yAxis) + { + _yAxis = yAxis; + } + + public void Apply(RenderPack rp, bool beforeLayout) + { + // rules that refer to the last render must wait for a render to occur + if (rp.Plot.LastRender.Count == 0) + { + return; + } + + // TODO: reference the correct axis from the previous render + double yMin = rp.Plot.LastRender.AxisLimits.Bottom; + double yTop = rp.Plot.LastRender.AxisLimits.Top; + _yAxis.Range.Set(yMin, yTop); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/MaximumBoundary.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/MaximumBoundary.cs new file mode 100644 index 000000000..6668854fa --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/MaximumBoundary.cs @@ -0,0 +1,46 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class MaximumBoundary : IAxisRule + { + private readonly IXAxis _xAxis; + private readonly IYAxis _yAxis; + public AxisLimits Limits { get; set; } + + public MaximumBoundary(IXAxis xAxis, IYAxis yAxis, AxisLimits limits) + { + _xAxis = xAxis; + _yAxis = yAxis; + Limits = limits; + } + + public void Apply(RenderPack rp, bool beforeLayout) + { + double xSpan = Math.Min(_xAxis.Range.Span, Limits.HorizontalSpan); + double ySpan = Math.Min(_yAxis.Range.Span, Limits.VerticalSpan); + + if (_xAxis.Range.Max > Limits.Right) + { + _xAxis.Range.Max = Limits.Right; + _xAxis.Range.Min = Limits.Right - xSpan; + } + + if (_xAxis.Range.Min < Limits.Left) + { + _xAxis.Range.Min = Limits.Left; + _xAxis.Range.Max = Limits.Left + xSpan; + } + + if (_yAxis.Range.Max > Limits.Top) + { + _yAxis.Range.Max = Limits.Top; + _yAxis.Range.Min = Limits.Top - ySpan; + } + + if (_yAxis.Range.Min < Limits.Bottom) + { + _yAxis.Range.Min = Limits.Bottom; + _yAxis.Range.Max = Limits.Bottom + ySpan; + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/MaximumSpan.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/MaximumSpan.cs new file mode 100644 index 000000000..254b08b07 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/MaximumSpan.cs @@ -0,0 +1,36 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class MaximumSpan : IAxisRule + { + private readonly IXAxis _xAxis; + private readonly IYAxis _yAxis; + + public double XSpan; + public double YSpan; + + public MaximumSpan(IXAxis xAxis, IYAxis yAxis, double xSpan = double.Epsilon, double ySpan = double.Epsilon) + { + _xAxis = xAxis; + _yAxis = yAxis; + XSpan = xSpan; + YSpan = ySpan; + } + + public void Apply(RenderPack rp, bool beforeLayout) + { + if (_xAxis.Range.Span > XSpan) + { + var xMin = _xAxis.Range.Center - XSpan / 2; + var xMax = _xAxis.Range.Center + XSpan / 2; + _xAxis.Range.Set(xMin, xMax); + } + + if (_yAxis.Range.Span > YSpan) + { + var yMin = _yAxis.Range.Center - YSpan / 2; + var yMax = _yAxis.Range.Center + YSpan / 2; + _yAxis.Range.Set(yMin, yMax); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/MinimumBoundary.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/MinimumBoundary.cs new file mode 100644 index 000000000..e8b6f76c0 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/MinimumBoundary.cs @@ -0,0 +1,46 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class MinimumBoundary : IAxisRule + { + private readonly IXAxis _xAxis; + private readonly IYAxis _yAxis; + public AxisLimits Limits { get; set; } + + public MinimumBoundary(IXAxis xAxis, IYAxis yAxis, AxisLimits limits) + { + _xAxis = xAxis; + _yAxis = yAxis; + Limits = limits; + } + + public void Apply(RenderPack rp, bool beforeLayout) + { + double xSpan = Math.Max(_xAxis.Range.Span, Limits.HorizontalSpan); + double ySpan = Math.Max(_yAxis.Range.Span, Limits.VerticalSpan); + + if (_xAxis.Range.Max < Limits.Right) + { + _xAxis.Range.Max = Limits.Right; + _xAxis.Range.Min = Limits.Right - xSpan; + } + + if (_xAxis.Range.Min > Limits.Left) + { + _xAxis.Range.Min = Limits.Left; + _xAxis.Range.Max = Limits.Left + xSpan; + } + + if (_yAxis.Range.Max < Limits.Top) + { + _yAxis.Range.Max = Limits.Top; + _yAxis.Range.Min = Limits.Top - ySpan; + } + + if (_yAxis.Range.Min > Limits.Bottom) + { + _yAxis.Range.Min = Limits.Bottom; + _yAxis.Range.Max = Limits.Bottom + ySpan; + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/MinimumSpan.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/MinimumSpan.cs new file mode 100644 index 000000000..2a6df1912 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/MinimumSpan.cs @@ -0,0 +1,36 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class MinimumSpan : IAxisRule + { + private readonly IXAxis _xAxis; + private readonly IYAxis _yAxis; + + public double XSpan; + public double YSpan; + + public MinimumSpan(IXAxis xAxis, IYAxis yAxis, double xSpan = double.Epsilon, double ySpan = double.Epsilon) + { + _xAxis = xAxis; + _yAxis = yAxis; + XSpan = xSpan; + YSpan = ySpan; + } + + public void Apply(RenderPack rp, bool beforeLayout) + { + if (_xAxis.Range.Span < XSpan) + { + var xMin = _xAxis.Range.Center - XSpan / 2; + var xMax = _xAxis.Range.Center + XSpan / 2; + _xAxis.Range.Set(xMin, xMax); + } + + if (_yAxis.Range.Span < YSpan) + { + var yMin = _yAxis.Range.Center - YSpan / 2; + var yMax = _yAxis.Range.Center + YSpan / 2; + _yAxis.Range.Set(yMin, yMax); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/SquarePreserveX.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/SquarePreserveX.cs new file mode 100644 index 000000000..e5781147c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/SquarePreserveX.cs @@ -0,0 +1,29 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class SquarePreserveX : IAxisRule + { + private readonly IXAxis _xAxis; + private readonly IYAxis _yAxis; + + public SquarePreserveX(IXAxis xAxis, IYAxis yAxis) + { + _xAxis = xAxis; + _yAxis = yAxis; + } + + public void Apply(RenderPack rp, bool beforeLayout) + { + // rules that refer to the datarect must wait for the layout to occur + if (beforeLayout) + { + return; + } + + double unitsPerPxX = _xAxis.Width / rp.DataRect.Width; + var halfHeight = rp.DataRect.Height / 2 * unitsPerPxX; + var yMin = _yAxis.Range.Center - halfHeight; + var yMax = _yAxis.Range.Center + halfHeight; + _yAxis.Range.Set(yMin, yMax); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/SquarePreserveY.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/SquarePreserveY.cs new file mode 100644 index 000000000..2351b53f8 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/SquarePreserveY.cs @@ -0,0 +1,29 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class SquarePreserveY : IAxisRule + { + private readonly IXAxis _xAxis; + private readonly IYAxis _yAxis; + + public SquarePreserveY(IXAxis xAxis, IYAxis yAxis) + { + _xAxis = xAxis; + _yAxis = yAxis; + } + + public void Apply(RenderPack rp, bool beforeLayout) + { + // rules that refer to the datarect must wait for the layout to occur + if (beforeLayout) + { + return; + } + + double unitsPerPxY = _yAxis.Height / rp.DataRect.Height; + var halfWidth = rp.DataRect.Width / 2 * unitsPerPxY; + var xMin = _xAxis.Range.Center - halfWidth; + var xMax = _xAxis.Range.Center + halfWidth; + _xAxis.Range.Set(xMin, xMax); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/SquareZoomOut.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/SquareZoomOut.cs new file mode 100644 index 000000000..acea6cb63 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/AxisRules/SquareZoomOut.cs @@ -0,0 +1,37 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class SquareZoomOut : IAxisRule + { + private readonly IXAxis _xAxis; + private readonly IYAxis _yAxis; + + public SquareZoomOut(IXAxis xAxis, IYAxis yAxis) + { + _xAxis = xAxis; + _yAxis = yAxis; + } + + public void Apply(RenderPack rp, bool beforeLayout) + { + // rules that refer to the datarect must wait for the layout to occur + if (beforeLayout) + { + return; + } + + double unitsPerPxX = _xAxis.Width / rp.DataRect.Width; + double unitsPerPxY = _yAxis.Height / rp.DataRect.Height; + var maxUnitsPerPx = Math.Max(unitsPerPxX, unitsPerPxY); + + var halfHeight = rp.DataRect.Height / 2 * maxUnitsPerPx; + var yMin = _yAxis.Range.Center - halfHeight; + var yMax = _yAxis.Range.Center + halfHeight; + _yAxis.Range.Set(yMin, yMax); + + var halfWidth = rp.DataRect.Width / 2 * maxUnitsPerPx; + var xMin = _xAxis.Range.Center - halfWidth; + var xMax = _xAxis.Range.Center + halfWidth; + _xAxis.Range.Set(xMin, xMax); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Algae.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Algae.cs new file mode 100644 index 000000000..e59dfb08e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Algae.cs @@ -0,0 +1,274 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Algae : ByteColormapBase + { + public override string Name => "Algae"; + public override (byte, byte, byte)[] Rgbs => _rgbs; + + private static readonly (byte r, byte g, byte b)[] _rgbs = new (byte, byte, byte)[] { + ( 215, 249, 208 ), + ( 214, 248, 206 ), + ( 212, 247, 205 ), + ( 211, 246, 203 ), + ( 210, 245, 202 ), + ( 209, 244, 200 ), + ( 207, 244, 199 ), + ( 206, 243, 197 ), + ( 205, 242, 196 ), + ( 204, 241, 195 ), + ( 202, 240, 193 ), + ( 201, 239, 192 ), + ( 200, 238, 190 ), + ( 199, 237, 189 ), + ( 197, 236, 187 ), + ( 196, 235, 186 ), + ( 195, 235, 185 ), + ( 194, 234, 183 ), + ( 192, 233, 182 ), + ( 191, 232, 180 ), + ( 190, 231, 179 ), + ( 189, 230, 177 ), + ( 187, 229, 176 ), + ( 186, 228, 175 ), + ( 185, 228, 173 ), + ( 184, 227, 172 ), + ( 182, 226, 171 ), + ( 181, 225, 169 ), + ( 180, 224, 168 ), + ( 178, 223, 166 ), + ( 177, 222, 165 ), + ( 176, 222, 164 ), + ( 175, 221, 162 ), + ( 173, 220, 161 ), + ( 172, 219, 160 ), + ( 171, 218, 158 ), + ( 170, 218, 157 ), + ( 168, 217, 156 ), + ( 167, 216, 154 ), + ( 166, 215, 153 ), + ( 164, 214, 152 ), + ( 163, 213, 150 ), + ( 162, 213, 149 ), + ( 160, 212, 148 ), + ( 159, 211, 146 ), + ( 158, 210, 145 ), + ( 157, 209, 144 ), + ( 155, 209, 143 ), + ( 154, 208, 141 ), + ( 153, 207, 140 ), + ( 151, 206, 139 ), + ( 150, 205, 138 ), + ( 149, 205, 136 ), + ( 147, 204, 135 ), + ( 146, 203, 134 ), + ( 145, 202, 133 ), + ( 143, 202, 131 ), + ( 142, 201, 130 ), + ( 140, 200, 129 ), + ( 139, 199, 128 ), + ( 138, 199, 126 ), + ( 136, 198, 125 ), + ( 135, 197, 124 ), + ( 133, 196, 123 ), + ( 132, 196, 122 ), + ( 131, 195, 121 ), + ( 129, 194, 119 ), + ( 128, 193, 118 ), + ( 126, 193, 117 ), + ( 125, 192, 116 ), + ( 123, 191, 115 ), + ( 122, 190, 114 ), + ( 120, 190, 113 ), + ( 119, 189, 111 ), + ( 117, 188, 110 ), + ( 116, 187, 109 ), + ( 114, 187, 108 ), + ( 113, 186, 107 ), + ( 111, 185, 106 ), + ( 110, 185, 105 ), + ( 108, 184, 104 ), + ( 107, 183, 103 ), + ( 105, 182, 102 ), + ( 103, 182, 101 ), + ( 102, 181, 100 ), + ( 100, 180, 99 ), + ( 98, 180, 98 ), + ( 97, 179, 97 ), + ( 95, 178, 96 ), + ( 93, 178, 95 ), + ( 91, 177, 94 ), + ( 90, 176, 93 ), + ( 88, 175, 93 ), + ( 86, 175, 92 ), + ( 84, 174, 91 ), + ( 82, 173, 90 ), + ( 80, 173, 89 ), + ( 78, 172, 89 ), + ( 76, 171, 88 ), + ( 74, 171, 87 ), + ( 72, 170, 87 ), + ( 70, 169, 86 ), + ( 68, 168, 85 ), + ( 66, 168, 85 ), + ( 63, 167, 84 ), + ( 61, 166, 84 ), + ( 59, 166, 84 ), + ( 57, 165, 83 ), + ( 55, 164, 83 ), + ( 52, 163, 83 ), + ( 50, 163, 82 ), + ( 48, 162, 82 ), + ( 46, 161, 82 ), + ( 44, 160, 82 ), + ( 42, 160, 82 ), + ( 40, 159, 81 ), + ( 38, 158, 81 ), + ( 36, 157, 81 ), + ( 34, 156, 81 ), + ( 32, 156, 81 ), + ( 30, 155, 81 ), + ( 28, 154, 81 ), + ( 27, 153, 81 ), + ( 25, 152, 81 ), + ( 24, 151, 80 ), + ( 22, 150, 80 ), + ( 21, 150, 80 ), + ( 19, 149, 80 ), + ( 18, 148, 80 ), + ( 16, 147, 80 ), + ( 15, 146, 80 ), + ( 14, 145, 80 ), + ( 13, 144, 79 ), + ( 12, 143, 79 ), + ( 11, 143, 79 ), + ( 10, 142, 79 ), + ( 9, 141, 79 ), + ( 9, 140, 79 ), + ( 8, 139, 78 ), + ( 8, 138, 78 ), + ( 7, 137, 78 ), + ( 7, 136, 78 ), + ( 7, 135, 77 ), + ( 7, 134, 77 ), + ( 7, 134, 77 ), + ( 7, 133, 77 ), + ( 7, 132, 77 ), + ( 7, 131, 76 ), + ( 7, 130, 76 ), + ( 8, 129, 76 ), + ( 8, 128, 75 ), + ( 8, 127, 75 ), + ( 9, 126, 75 ), + ( 9, 125, 75 ), + ( 10, 124, 74 ), + ( 10, 124, 74 ), + ( 11, 123, 74 ), + ( 11, 122, 73 ), + ( 12, 121, 73 ), + ( 12, 120, 73 ), + ( 13, 119, 72 ), + ( 13, 118, 72 ), + ( 14, 117, 72 ), + ( 14, 116, 71 ), + ( 15, 115, 71 ), + ( 15, 115, 71 ), + ( 16, 114, 70 ), + ( 16, 113, 70 ), + ( 17, 112, 69 ), + ( 17, 111, 69 ), + ( 18, 110, 69 ), + ( 18, 109, 68 ), + ( 18, 108, 68 ), + ( 19, 107, 67 ), + ( 19, 106, 67 ), + ( 20, 106, 67 ), + ( 20, 105, 66 ), + ( 20, 104, 66 ), + ( 21, 103, 65 ), + ( 21, 102, 65 ), + ( 21, 101, 64 ), + ( 22, 100, 64 ), + ( 22, 99, 64 ), + ( 22, 98, 63 ), + ( 23, 98, 63 ), + ( 23, 97, 62 ), + ( 23, 96, 62 ), + ( 23, 95, 61 ), + ( 24, 94, 61 ), + ( 24, 93, 60 ), + ( 24, 92, 60 ), + ( 24, 91, 59 ), + ( 24, 91, 59 ), + ( 25, 90, 58 ), + ( 25, 89, 58 ), + ( 25, 88, 57 ), + ( 25, 87, 57 ), + ( 25, 86, 56 ), + ( 25, 85, 56 ), + ( 25, 84, 55 ), + ( 25, 84, 55 ), + ( 26, 83, 54 ), + ( 26, 82, 53 ), + ( 26, 81, 53 ), + ( 26, 80, 52 ), + ( 26, 79, 52 ), + ( 26, 78, 51 ), + ( 26, 77, 51 ), + ( 26, 77, 50 ), + ( 26, 76, 50 ), + ( 26, 75, 49 ), + ( 26, 74, 48 ), + ( 26, 73, 48 ), + ( 26, 72, 47 ), + ( 26, 71, 47 ), + ( 26, 71, 46 ), + ( 26, 70, 46 ), + ( 26, 69, 45 ), + ( 26, 68, 44 ), + ( 26, 67, 44 ), + ( 25, 66, 43 ), + ( 25, 65, 43 ), + ( 25, 64, 42 ), + ( 25, 64, 41 ), + ( 25, 63, 41 ), + ( 25, 62, 40 ), + ( 25, 61, 39 ), + ( 25, 60, 39 ), + ( 24, 59, 38 ), + ( 24, 59, 38 ), + ( 24, 58, 37 ), + ( 24, 57, 36 ), + ( 24, 56, 36 ), + ( 24, 55, 35 ), + ( 23, 54, 34 ), + ( 23, 53, 34 ), + ( 23, 53, 33 ), + ( 23, 52, 32 ), + ( 23, 51, 32 ), + ( 22, 50, 31 ), + ( 22, 49, 30 ), + ( 22, 48, 30 ), + ( 22, 47, 29 ), + ( 21, 47, 28 ), + ( 21, 46, 28 ), + ( 21, 45, 27 ), + ( 20, 44, 26 ), + ( 20, 43, 26 ), + ( 20, 42, 25 ), + ( 20, 41, 24 ), + ( 19, 41, 24 ), + ( 19, 40, 23 ), + ( 19, 39, 22 ), + ( 18, 38, 22 ), + ( 18, 37, 21 ), + ( 18, 36, 20 ) + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Amp.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Amp.cs new file mode 100644 index 000000000..4cae3a31e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Amp.cs @@ -0,0 +1,274 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Amp : ByteColormapBase + { + public override string Name => "Amp"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + + private static readonly (byte, byte, byte)[] _rgbs = { + ( 241, 237, 236 ), + ( 241, 236, 235 ), + ( 240, 235, 233 ), + ( 239, 233, 232 ), + ( 239, 232, 231 ), + ( 238, 231, 229 ), + ( 238, 230, 228 ), + ( 237, 229, 227 ), + ( 237, 227, 225 ), + ( 236, 226, 224 ), + ( 236, 225, 222 ), + ( 235, 224, 221 ), + ( 235, 223, 220 ), + ( 234, 221, 218 ), + ( 234, 220, 217 ), + ( 233, 219, 215 ), + ( 233, 218, 214 ), + ( 233, 217, 212 ), + ( 232, 216, 211 ), + ( 232, 214, 210 ), + ( 231, 213, 208 ), + ( 231, 212, 207 ), + ( 230, 211, 205 ), + ( 230, 210, 204 ), + ( 230, 209, 202 ), + ( 229, 207, 201 ), + ( 229, 206, 200 ), + ( 228, 205, 198 ), + ( 228, 204, 197 ), + ( 228, 203, 195 ), + ( 227, 201, 194 ), + ( 227, 200, 192 ), + ( 226, 199, 191 ), + ( 226, 198, 189 ), + ( 226, 197, 188 ), + ( 225, 196, 187 ), + ( 225, 195, 185 ), + ( 225, 193, 184 ), + ( 224, 192, 182 ), + ( 224, 191, 181 ), + ( 223, 190, 179 ), + ( 223, 189, 178 ), + ( 223, 188, 176 ), + ( 222, 186, 175 ), + ( 222, 185, 174 ), + ( 222, 184, 172 ), + ( 221, 183, 171 ), + ( 221, 182, 169 ), + ( 221, 181, 168 ), + ( 220, 180, 166 ), + ( 220, 178, 165 ), + ( 220, 177, 163 ), + ( 219, 176, 162 ), + ( 219, 175, 161 ), + ( 219, 174, 159 ), + ( 218, 173, 158 ), + ( 218, 172, 156 ), + ( 217, 170, 155 ), + ( 217, 169, 153 ), + ( 217, 168, 152 ), + ( 216, 167, 150 ), + ( 216, 166, 149 ), + ( 216, 165, 148 ), + ( 215, 164, 146 ), + ( 215, 162, 145 ), + ( 215, 161, 143 ), + ( 214, 160, 142 ), + ( 214, 159, 140 ), + ( 214, 158, 139 ), + ( 213, 157, 137 ), + ( 213, 156, 136 ), + ( 213, 154, 135 ), + ( 212, 153, 133 ), + ( 212, 152, 132 ), + ( 212, 151, 130 ), + ( 211, 150, 129 ), + ( 211, 149, 127 ), + ( 211, 148, 126 ), + ( 210, 146, 125 ), + ( 210, 145, 123 ), + ( 210, 144, 122 ), + ( 209, 143, 120 ), + ( 209, 142, 119 ), + ( 209, 141, 118 ), + ( 208, 140, 116 ), + ( 208, 139, 115 ), + ( 208, 137, 113 ), + ( 207, 136, 112 ), + ( 207, 135, 111 ), + ( 207, 134, 109 ), + ( 206, 133, 108 ), + ( 206, 132, 106 ), + ( 205, 131, 105 ), + ( 205, 129, 104 ), + ( 205, 128, 102 ), + ( 204, 127, 101 ), + ( 204, 126, 100 ), + ( 204, 125, 98 ), + ( 203, 124, 97 ), + ( 203, 122, 96 ), + ( 203, 121, 94 ), + ( 202, 120, 93 ), + ( 202, 119, 91 ), + ( 201, 118, 90 ), + ( 201, 117, 89 ), + ( 201, 116, 87 ), + ( 200, 114, 86 ), + ( 200, 113, 85 ), + ( 200, 112, 84 ), + ( 199, 111, 82 ), + ( 199, 110, 81 ), + ( 198, 109, 80 ), + ( 198, 107, 78 ), + ( 198, 106, 77 ), + ( 197, 105, 76 ), + ( 197, 104, 74 ), + ( 197, 103, 73 ), + ( 196, 101, 72 ), + ( 196, 100, 71 ), + ( 195, 99, 70 ), + ( 195, 98, 68 ), + ( 195, 97, 67 ), + ( 194, 95, 66 ), + ( 194, 94, 65 ), + ( 193, 93, 63 ), + ( 193, 92, 62 ), + ( 192, 91, 61 ), + ( 192, 89, 60 ), + ( 192, 88, 59 ), + ( 191, 87, 58 ), + ( 191, 86, 57 ), + ( 190, 84, 56 ), + ( 190, 83, 54 ), + ( 189, 82, 53 ), + ( 189, 81, 52 ), + ( 189, 79, 51 ), + ( 188, 78, 50 ), + ( 188, 77, 49 ), + ( 187, 76, 48 ), + ( 187, 74, 48 ), + ( 186, 73, 47 ), + ( 186, 72, 46 ), + ( 185, 70, 45 ), + ( 185, 69, 44 ), + ( 184, 68, 43 ), + ( 184, 66, 43 ), + ( 183, 65, 42 ), + ( 183, 64, 41 ), + ( 182, 63, 41 ), + ( 181, 61, 40 ), + ( 181, 60, 39 ), + ( 180, 59, 39 ), + ( 180, 57, 38 ), + ( 179, 56, 38 ), + ( 178, 55, 38 ), + ( 178, 53, 37 ), + ( 177, 52, 37 ), + ( 176, 51, 37 ), + ( 176, 49, 37 ), + ( 175, 48, 36 ), + ( 174, 47, 36 ), + ( 174, 45, 36 ), + ( 173, 44, 36 ), + ( 172, 43, 36 ), + ( 171, 42, 36 ), + ( 170, 40, 36 ), + ( 170, 39, 36 ), + ( 169, 38, 36 ), + ( 168, 37, 36 ), + ( 167, 36, 36 ), + ( 166, 34, 37 ), + ( 165, 33, 37 ), + ( 164, 32, 37 ), + ( 163, 31, 37 ), + ( 162, 30, 37 ), + ( 161, 29, 37 ), + ( 160, 28, 38 ), + ( 159, 27, 38 ), + ( 158, 26, 38 ), + ( 157, 25, 38 ), + ( 156, 24, 39 ), + ( 155, 23, 39 ), + ( 154, 22, 39 ), + ( 153, 21, 39 ), + ( 152, 21, 39 ), + ( 151, 20, 40 ), + ( 149, 19, 40 ), + ( 148, 19, 40 ), + ( 147, 18, 40 ), + ( 146, 17, 40 ), + ( 145, 17, 41 ), + ( 144, 16, 41 ), + ( 142, 16, 41 ), + ( 141, 16, 41 ), + ( 140, 15, 41 ), + ( 139, 15, 41 ), + ( 137, 15, 41 ), + ( 136, 15, 41 ), + ( 135, 14, 41 ), + ( 133, 14, 41 ), + ( 132, 14, 41 ), + ( 131, 14, 41 ), + ( 129, 14, 41 ), + ( 128, 14, 41 ), + ( 127, 14, 41 ), + ( 125, 14, 41 ), + ( 124, 14, 41 ), + ( 123, 14, 41 ), + ( 121, 14, 41 ), + ( 120, 14, 40 ), + ( 119, 14, 40 ), + ( 117, 14, 40 ), + ( 116, 14, 40 ), + ( 115, 14, 39 ), + ( 113, 14, 39 ), + ( 112, 14, 39 ), + ( 111, 14, 38 ), + ( 109, 14, 38 ), + ( 108, 15, 38 ), + ( 107, 15, 37 ), + ( 105, 15, 37 ), + ( 104, 15, 37 ), + ( 103, 15, 36 ), + ( 101, 15, 36 ), + ( 100, 14, 35 ), + ( 99, 14, 35 ), + ( 97, 14, 34 ), + ( 96, 14, 34 ), + ( 95, 14, 33 ), + ( 93, 14, 33 ), + ( 92, 14, 33 ), + ( 91, 14, 32 ), + ( 90, 14, 31 ), + ( 88, 14, 31 ), + ( 87, 14, 30 ), + ( 86, 14, 30 ), + ( 84, 13, 29 ), + ( 83, 13, 29 ), + ( 82, 13, 28 ), + ( 81, 13, 28 ), + ( 79, 13, 27 ), + ( 78, 13, 26 ), + ( 77, 12, 26 ), + ( 75, 12, 25 ), + ( 74, 12, 25 ), + ( 73, 12, 24 ), + ( 72, 11, 23 ), + ( 70, 11, 23 ), + ( 69, 11, 22 ), + ( 68, 11, 22 ), + ( 67, 10, 21 ), + ( 65, 10, 20 ), + ( 64, 10, 20 ), + ( 63, 10, 19 ), + ( 61, 9, 18 ), + ( 60, 9, 18 ) + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/ArgbColormapBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/ArgbColormapBase.cs new file mode 100644 index 000000000..01c515aa8 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/ArgbColormapBase.cs @@ -0,0 +1,12 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot; + +public abstract class ArgbColormapBase : ColormapBase +{ + public abstract uint[] Argbs { get; } + + public override Color GetColor(double normalizedIntensity) + { + var argb = Argbs[(int)(normalizedIntensity * (Argbs.Length - 1))]; + return Color.FromArgb(argb); + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Balance.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Balance.cs new file mode 100644 index 000000000..7acd78f8c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Balance.cs @@ -0,0 +1,274 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Balance : ByteColormapBase + { + public override string Name => "Balance"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + + private static readonly (byte, byte, byte)[] _rgbs = { + ( 24, 28, 67 ), + ( 25, 30, 70 ), + ( 26, 31, 73 ), + ( 27, 33, 76 ), + ( 28, 34, 79 ), + ( 29, 35, 82 ), + ( 30, 37, 85 ), + ( 31, 38, 88 ), + ( 32, 39, 91 ), + ( 33, 41, 95 ), + ( 33, 42, 98 ), + ( 34, 43, 101 ), + ( 35, 45, 105 ), + ( 36, 46, 108 ), + ( 37, 47, 111 ), + ( 37, 48, 115 ), + ( 38, 50, 118 ), + ( 39, 51, 122 ), + ( 39, 52, 125 ), + ( 40, 54, 129 ), + ( 40, 55, 132 ), + ( 41, 56, 136 ), + ( 41, 58, 140 ), + ( 41, 59, 143 ), + ( 41, 60, 147 ), + ( 41, 62, 151 ), + ( 41, 63, 154 ), + ( 41, 64, 158 ), + ( 41, 66, 162 ), + ( 40, 67, 165 ), + ( 39, 69, 169 ), + ( 38, 71, 172 ), + ( 37, 72, 176 ), + ( 35, 74, 179 ), + ( 33, 76, 182 ), + ( 31, 78, 184 ), + ( 28, 80, 186 ), + ( 25, 82, 188 ), + ( 22, 85, 189 ), + ( 19, 87, 190 ), + ( 16, 89, 190 ), + ( 13, 91, 190 ), + ( 12, 94, 190 ), + ( 10, 96, 190 ), + ( 10, 98, 190 ), + ( 10, 100, 190 ), + ( 11, 102, 189 ), + ( 13, 104, 189 ), + ( 15, 106, 189 ), + ( 17, 108, 188 ), + ( 19, 110, 188 ), + ( 22, 112, 188 ), + ( 25, 114, 187 ), + ( 27, 116, 187 ), + ( 30, 118, 187 ), + ( 33, 120, 187 ), + ( 35, 122, 186 ), + ( 38, 123, 186 ), + ( 41, 125, 186 ), + ( 43, 127, 186 ), + ( 46, 129, 186 ), + ( 48, 131, 186 ), + ( 51, 132, 186 ), + ( 54, 134, 186 ), + ( 56, 136, 186 ), + ( 59, 137, 186 ), + ( 62, 139, 186 ), + ( 64, 141, 186 ), + ( 67, 143, 186 ), + ( 70, 144, 186 ), + ( 72, 146, 186 ), + ( 75, 148, 186 ), + ( 78, 149, 186 ), + ( 81, 151, 186 ), + ( 83, 153, 186 ), + ( 86, 154, 187 ), + ( 89, 156, 187 ), + ( 92, 157, 187 ), + ( 95, 159, 187 ), + ( 98, 160, 187 ), + ( 101, 162, 188 ), + ( 104, 164, 188 ), + ( 107, 165, 188 ), + ( 110, 167, 189 ), + ( 113, 168, 189 ), + ( 117, 170, 190 ), + ( 120, 171, 190 ), + ( 123, 172, 191 ), + ( 126, 174, 191 ), + ( 129, 175, 192 ), + ( 133, 177, 192 ), + ( 136, 178, 193 ), + ( 139, 180, 194 ), + ( 142, 181, 195 ), + ( 145, 183, 195 ), + ( 148, 184, 196 ), + ( 152, 186, 197 ), + ( 155, 187, 198 ), + ( 158, 188, 199 ), + ( 161, 190, 200 ), + ( 164, 191, 201 ), + ( 167, 193, 202 ), + ( 170, 194, 203 ), + ( 173, 196, 204 ), + ( 176, 197, 205 ), + ( 179, 199, 206 ), + ( 182, 201, 207 ), + ( 185, 202, 208 ), + ( 188, 204, 210 ), + ( 191, 205, 211 ), + ( 193, 207, 212 ), + ( 196, 208, 213 ), + ( 199, 210, 215 ), + ( 202, 212, 216 ), + ( 205, 213, 217 ), + ( 208, 215, 218 ), + ( 211, 217, 220 ), + ( 213, 218, 221 ), + ( 216, 220, 222 ), + ( 219, 222, 224 ), + ( 222, 224, 225 ), + ( 225, 225, 227 ), + ( 227, 227, 228 ), + ( 230, 229, 230 ), + ( 233, 231, 231 ), + ( 235, 233, 233 ), + ( 238, 234, 234 ), + ( 241, 236, 236 ), + ( 241, 236, 235 ), + ( 240, 234, 233 ), + ( 239, 232, 230 ), + ( 238, 229, 227 ), + ( 237, 227, 224 ), + ( 236, 224, 222 ), + ( 235, 222, 219 ), + ( 234, 220, 216 ), + ( 233, 217, 213 ), + ( 232, 215, 210 ), + ( 231, 213, 207 ), + ( 230, 210, 205 ), + ( 229, 208, 202 ), + ( 229, 206, 199 ), + ( 228, 203, 196 ), + ( 227, 201, 193 ), + ( 226, 199, 190 ), + ( 225, 196, 187 ), + ( 225, 194, 184 ), + ( 224, 192, 181 ), + ( 223, 189, 178 ), + ( 223, 187, 176 ), + ( 222, 185, 173 ), + ( 221, 182, 170 ), + ( 220, 180, 167 ), + ( 220, 178, 164 ), + ( 219, 175, 161 ), + ( 218, 173, 158 ), + ( 218, 171, 155 ), + ( 217, 169, 152 ), + ( 216, 166, 150 ), + ( 216, 164, 147 ), + ( 215, 162, 144 ), + ( 214, 159, 141 ), + ( 214, 157, 138 ), + ( 213, 155, 135 ), + ( 212, 153, 132 ), + ( 211, 150, 129 ), + ( 211, 148, 127 ), + ( 210, 146, 124 ), + ( 209, 143, 121 ), + ( 209, 141, 118 ), + ( 208, 139, 115 ), + ( 207, 137, 112 ), + ( 207, 134, 110 ), + ( 206, 132, 107 ), + ( 205, 130, 104 ), + ( 205, 127, 101 ), + ( 204, 125, 99 ), + ( 203, 123, 96 ), + ( 202, 121, 93 ), + ( 202, 118, 91 ), + ( 201, 116, 88 ), + ( 200, 114, 85 ), + ( 199, 111, 83 ), + ( 199, 109, 80 ), + ( 198, 107, 77 ), + ( 197, 104, 75 ), + ( 196, 102, 72 ), + ( 195, 99, 70 ), + ( 195, 97, 67 ), + ( 194, 95, 65 ), + ( 193, 92, 63 ), + ( 192, 90, 60 ), + ( 191, 87, 58 ), + ( 190, 85, 56 ), + ( 190, 82, 54 ), + ( 189, 80, 52 ), + ( 188, 77, 50 ), + ( 187, 75, 48 ), + ( 186, 72, 46 ), + ( 185, 69, 44 ), + ( 184, 67, 43 ), + ( 183, 64, 41 ), + ( 182, 61, 40 ), + ( 180, 59, 39 ), + ( 179, 56, 38 ), + ( 178, 53, 37 ), + ( 177, 51, 37 ), + ( 175, 48, 36 ), + ( 174, 46, 36 ), + ( 172, 43, 36 ), + ( 171, 41, 36 ), + ( 169, 38, 36 ), + ( 167, 36, 36 ), + ( 165, 33, 37 ), + ( 163, 31, 37 ), + ( 161, 29, 37 ), + ( 159, 27, 38 ), + ( 157, 25, 38 ), + ( 155, 23, 39 ), + ( 153, 22, 39 ), + ( 151, 20, 40 ), + ( 148, 19, 40 ), + ( 146, 18, 40 ), + ( 144, 16, 41 ), + ( 141, 16, 41 ), + ( 139, 15, 41 ), + ( 136, 15, 41 ), + ( 134, 14, 41 ), + ( 131, 14, 41 ), + ( 128, 14, 41 ), + ( 126, 14, 41 ), + ( 123, 14, 41 ), + ( 120, 14, 40 ), + ( 118, 14, 40 ), + ( 115, 14, 39 ), + ( 112, 14, 39 ), + ( 109, 14, 38 ), + ( 107, 15, 37 ), + ( 104, 15, 37 ), + ( 101, 15, 36 ), + ( 99, 14, 35 ), + ( 96, 14, 34 ), + ( 94, 14, 33 ), + ( 91, 14, 32 ), + ( 88, 14, 31 ), + ( 86, 14, 30 ), + ( 83, 13, 29 ), + ( 81, 13, 28 ), + ( 78, 13, 27 ), + ( 75, 12, 25 ), + ( 73, 12, 24 ), + ( 70, 11, 23 ), + ( 68, 11, 22 ), + ( 65, 10, 20 ), + ( 63, 10, 19 ), + ( 60, 9, 18 ) + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Blues.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Blues.cs new file mode 100644 index 000000000..86997c830 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Blues.cs @@ -0,0 +1,46 @@ +// This colormap was created by Scott Harden on 2020-06-16 and is released under a MIT license. + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Blues : ArgbColormapBase + { + public override string Name => "Blues"; + + public override uint[] Argbs => _argbs; + + private static readonly uint[] _argbs = new int[] { + -16767403, -16767402, -16767144, -16766887, -16701093, -16700835, -16700578, -16634784, + -16634527, -16634269, -16568476, -16568218, -16568216, -16567959, -16502165, -16501908, + -16501650, -16435856, -16435599, -16435341, -16369548, -16369290, -16369033, -16303495, + -16303238, -16302980, -16237186, -16236929, -16236671, -16236414, -16170620, -16170363, + -16170105, -16104312, -16104054, -16103797, -16038259, -16038002, -16037745, -15971951, + -15971694, -15971436, -15905643, -15905385, -15905128, -15839335, -15839077, -15838820, + -15773027, -15772769, -15772512, -15706718, -15706717, -15706460, -15706203, -15640409, + -15640152, -15574359, -15574101, -15573844, -15508051, -15507794, -15507537, -15441743, + -15441486, -15441229, -15375436, -15375179, -15309386, -15309128, -15308871, -15243078, + -15242821, -15177284, -15177027, -15111234, -15110977, -15045184, -15044927, -14979134, + -14978877, -14913084, -14912827, -14847034, -14781241, -14780984, -14715191, -14715190, + -14649397, -14583605, -14517812, -14517555, -14451762, -14385969, -14320176, -14319920, + -14254383, -14188590, -14122797, -14057005, -13991212, -13925419, -13859626, -13859626, + -13793833, -13662505, -13596712, -13530919, -13465383, -13399590, -13333797, -13268005, + -13202212, -13136676, -13005347, -12939555, -12873762, -12808226, -12676897, -12611105, + -12545312, -12414240, -12348447, -12282655, -12151327, -12085790, -12019998, -11888669, + -11822877, -11757341, -11626012, -11560220, -11429148, -11363355, -11232027, -11166235, + -11035162, -10969370, -10903578, -10772505, -10706713, -10575385, -10509592, -10378520, + -10312728, -10181400, -10115863, -09984535, -09918743, -09787414, -09721878, -09590550, + -09524758, -09393429, -09327893, -09262101, -09130773, -09065237, -08933908, -08868116, + -08736788, -08671252, -08605459, -08474131, -08408339, -08277267, -08211475, -08145682, + -08014354, -07948818, -07817490, -07751698, -07685905, -07554833, -07489041, -07357713, + -07291921, -07226128, -07095056, -07029264, -06897936, -06832144, -06766351, -06635279, + -06569487, -06503695, -06372367, -06306575, -06175502, -06109710, -06043918, -05912590, + -05846798, -05781261, -05649933, -05584141, -05518349, -05387021, -05321485, -05190156, + -05124364, -05058572, -04927244, -04861452, -04730123, -04664587, -04598795, -04467467, + -04401675, -04335883, -04204554, -04139018, -04007690, -03941898, -03876106, -03744777, + -03678985, -03547657, -03481865, -03416329, -03285000, -03219208, -03087880, -03022088, + -02956296, -02824968, -02759175, -02628103, -02562311, -02430983, -02365191, -02299398, + -02168070, -02102278, -01970950, -01905158, -01839621, -01708293, -01642501, -01511173, + -01445381, -01314052, -01248260, -01182468, -01051140, -00985604, -00854275, -00788483, + -00657155, -00591363, -00525571, -00394242, -00328450, -00197122, -00131330, -00000001, + }.Select(argb => (uint)argb).ToArray(); + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/ByteColormapBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/ByteColormapBase.cs new file mode 100644 index 000000000..f4a6d3d63 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/ByteColormapBase.cs @@ -0,0 +1,12 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public abstract class ByteColormapBase : ColormapBase + { + public abstract (byte r, byte g, byte b)[] Rgbs { get; } + public override Color GetColor(double normalizedIntensity) + { + var rgb = Rgbs?[(int)(normalizedIntensity * (Rgbs.Length - 1))] ?? (0, 0, 0); + return new(rgb.r, rgb.g, rgb.b); + } + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/ColormapBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/ColormapBase.cs new file mode 100644 index 000000000..cebf8aa7f --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/ColormapBase.cs @@ -0,0 +1,36 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot; + +public abstract class ColormapBase : IColormap +{ + public abstract string Name { get; } + + public abstract Color GetColor(double position); + + public Color GetColor(double position, Range range) + { + if (double.IsNaN(position)) + { + return Colors.Transparent; + } + + if (range.Min == range.Max) + { + return GetColor(0); + } + + double normalizedPosition = range.Normalize(position, true); + + return GetColor(normalizedPosition); + } + + public IColormap Reversed() + { + var colors = Enumerable + .Range(0, 255) + .Select(x => GetColor(x / 255.0)) + .Reverse() + .ToArray(); + + return new Custom(colors, $"{Name} Reversed"); + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Curl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Curl.cs new file mode 100644 index 000000000..abfc3a834 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Curl.cs @@ -0,0 +1,274 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Curl : ByteColormapBase + { + public override string Name => "Curl"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + + private static readonly (byte, byte, byte)[] _rgbs = { + ( 21, 29, 68 ), + ( 21, 31, 69 ), + ( 22, 33, 70 ), + ( 22, 35, 71 ), + ( 23, 37, 72 ), + ( 23, 39, 73 ), + ( 24, 41, 74 ), + ( 24, 43, 75 ), + ( 24, 45, 76 ), + ( 25, 47, 77 ), + ( 25, 49, 79 ), + ( 26, 51, 80 ), + ( 26, 53, 81 ), + ( 26, 54, 82 ), + ( 27, 56, 83 ), + ( 27, 58, 84 ), + ( 27, 60, 86 ), + ( 27, 62, 87 ), + ( 28, 64, 88 ), + ( 28, 66, 89 ), + ( 28, 67, 90 ), + ( 28, 69, 91 ), + ( 28, 71, 93 ), + ( 28, 73, 94 ), + ( 28, 75, 95 ), + ( 28, 76, 96 ), + ( 28, 78, 97 ), + ( 28, 80, 98 ), + ( 28, 82, 99 ), + ( 28, 84, 101 ), + ( 27, 86, 102 ), + ( 27, 88, 103 ), + ( 27, 89, 104 ), + ( 26, 91, 105 ), + ( 26, 93, 106 ), + ( 26, 95, 107 ), + ( 25, 97, 108 ), + ( 25, 99, 109 ), + ( 24, 101, 110 ), + ( 23, 102, 111 ), + ( 23, 104, 112 ), + ( 22, 106, 113 ), + ( 21, 108, 114 ), + ( 20, 110, 115 ), + ( 20, 112, 116 ), + ( 19, 114, 117 ), + ( 18, 116, 118 ), + ( 18, 118, 118 ), + ( 17, 119, 119 ), + ( 17, 121, 120 ), + ( 17, 123, 121 ), + ( 17, 125, 121 ), + ( 17, 127, 122 ), + ( 18, 129, 123 ), + ( 19, 131, 123 ), + ( 20, 132, 124 ), + ( 22, 134, 124 ), + ( 23, 136, 125 ), + ( 26, 138, 125 ), + ( 28, 140, 126 ), + ( 31, 141, 126 ), + ( 34, 143, 126 ), + ( 37, 145, 127 ), + ( 41, 147, 127 ), + ( 44, 148, 127 ), + ( 48, 150, 128 ), + ( 52, 152, 128 ), + ( 56, 153, 129 ), + ( 59, 155, 129 ), + ( 63, 156, 129 ), + ( 67, 158, 130 ), + ( 71, 159, 130 ), + ( 75, 161, 131 ), + ( 80, 162, 132 ), + ( 84, 164, 132 ), + ( 87, 165, 133 ), + ( 91, 166, 134 ), + ( 95, 168, 135 ), + ( 99, 169, 136 ), + ( 103, 171, 137 ), + ( 107, 172, 138 ), + ( 111, 173, 139 ), + ( 114, 175, 140 ), + ( 118, 176, 141 ), + ( 122, 177, 142 ), + ( 125, 179, 144 ), + ( 129, 180, 145 ), + ( 133, 181, 147 ), + ( 136, 183, 148 ), + ( 139, 184, 150 ), + ( 143, 186, 151 ), + ( 146, 187, 153 ), + ( 150, 188, 155 ), + ( 153, 190, 157 ), + ( 156, 191, 159 ), + ( 160, 192, 160 ), + ( 163, 194, 162 ), + ( 166, 195, 164 ), + ( 169, 197, 166 ), + ( 172, 198, 169 ), + ( 176, 200, 171 ), + ( 179, 201, 173 ), + ( 182, 203, 175 ), + ( 185, 204, 178 ), + ( 188, 206, 180 ), + ( 191, 207, 182 ), + ( 194, 209, 185 ), + ( 197, 210, 187 ), + ( 200, 212, 190 ), + ( 203, 213, 192 ), + ( 206, 215, 195 ), + ( 209, 216, 197 ), + ( 211, 218, 200 ), + ( 214, 220, 203 ), + ( 217, 221, 205 ), + ( 220, 223, 208 ), + ( 223, 225, 211 ), + ( 226, 226, 214 ), + ( 228, 228, 216 ), + ( 231, 230, 219 ), + ( 234, 232, 222 ), + ( 237, 234, 225 ), + ( 240, 235, 228 ), + ( 242, 237, 231 ), + ( 245, 239, 234 ), + ( 248, 241, 237 ), + ( 251, 243, 240 ), + ( 253, 245, 243 ), + ( 254, 246, 245 ), + ( 252, 244, 241 ), + ( 251, 241, 238 ), + ( 250, 239, 235 ), + ( 249, 236, 231 ), + ( 248, 234, 228 ), + ( 246, 231, 225 ), + ( 245, 229, 221 ), + ( 244, 226, 218 ), + ( 243, 224, 214 ), + ( 242, 221, 211 ), + ( 242, 219, 208 ), + ( 241, 216, 204 ), + ( 240, 214, 201 ), + ( 239, 211, 198 ), + ( 238, 209, 195 ), + ( 237, 207, 191 ), + ( 236, 204, 188 ), + ( 236, 202, 185 ), + ( 235, 199, 182 ), + ( 234, 197, 179 ), + ( 233, 194, 175 ), + ( 233, 192, 172 ), + ( 232, 189, 169 ), + ( 231, 187, 166 ), + ( 231, 184, 163 ), + ( 230, 182, 160 ), + ( 229, 179, 157 ), + ( 229, 177, 154 ), + ( 228, 174, 152 ), + ( 227, 172, 149 ), + ( 227, 169, 146 ), + ( 226, 167, 143 ), + ( 225, 164, 141 ), + ( 225, 162, 138 ), + ( 224, 159, 136 ), + ( 224, 157, 133 ), + ( 223, 154, 131 ), + ( 222, 152, 128 ), + ( 222, 149, 126 ), + ( 221, 147, 124 ), + ( 220, 144, 122 ), + ( 219, 142, 120 ), + ( 219, 139, 118 ), + ( 218, 137, 116 ), + ( 217, 134, 114 ), + ( 216, 132, 113 ), + ( 215, 129, 111 ), + ( 214, 127, 110 ), + ( 214, 124, 108 ), + ( 213, 122, 107 ), + ( 212, 119, 106 ), + ( 211, 117, 105 ), + ( 210, 114, 104 ), + ( 208, 112, 103 ), + ( 207, 110, 102 ), + ( 206, 107, 101 ), + ( 205, 105, 100 ), + ( 204, 103, 100 ), + ( 202, 100, 99 ), + ( 201, 98, 99 ), + ( 200, 96, 98 ), + ( 198, 93, 98 ), + ( 197, 91, 97 ), + ( 195, 89, 97 ), + ( 194, 87, 97 ), + ( 192, 85, 97 ), + ( 191, 83, 96 ), + ( 189, 81, 96 ), + ( 187, 78, 96 ), + ( 186, 76, 96 ), + ( 184, 74, 96 ), + ( 182, 72, 96 ), + ( 180, 70, 96 ), + ( 179, 68, 96 ), + ( 177, 66, 96 ), + ( 175, 65, 96 ), + ( 173, 63, 96 ), + ( 171, 61, 96 ), + ( 169, 59, 96 ), + ( 167, 57, 96 ), + ( 165, 55, 96 ), + ( 163, 54, 96 ), + ( 161, 52, 96 ), + ( 159, 50, 96 ), + ( 157, 48, 96 ), + ( 155, 47, 96 ), + ( 153, 45, 97 ), + ( 151, 43, 97 ), + ( 149, 42, 97 ), + ( 146, 40, 97 ), + ( 144, 39, 96 ), + ( 142, 37, 96 ), + ( 140, 36, 96 ), + ( 137, 34, 96 ), + ( 135, 33, 96 ), + ( 133, 32, 96 ), + ( 130, 31, 96 ), + ( 128, 29, 95 ), + ( 125, 28, 95 ), + ( 123, 27, 94 ), + ( 120, 26, 94 ), + ( 118, 25, 93 ), + ( 115, 25, 93 ), + ( 113, 24, 92 ), + ( 110, 23, 91 ), + ( 108, 23, 90 ), + ( 105, 22, 89 ), + ( 102, 22, 88 ), + ( 100, 21, 87 ), + ( 97, 21, 86 ), + ( 94, 20, 85 ), + ( 92, 20, 83 ), + ( 89, 20, 82 ), + ( 87, 19, 80 ), + ( 84, 19, 78 ), + ( 81, 19, 77 ), + ( 79, 18, 75 ), + ( 76, 18, 73 ), + ( 73, 18, 71 ), + ( 71, 17, 69 ), + ( 68, 17, 67 ), + ( 66, 16, 65 ), + ( 63, 16, 63 ), + ( 61, 15, 61 ), + ( 58, 15, 59 ), + ( 56, 14, 57 ), + ( 53, 13, 54 ) + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Custom.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Custom.cs new file mode 100644 index 000000000..8661ae2e3 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Custom.cs @@ -0,0 +1,20 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot; + +public class Custom : ColormapBase +{ + public override string Name { get; } + + private readonly Color[] _colors; + + public Custom(Color[] colors, string name = "custom") + { + _colors = colors; + Name = name; + } + + public override Color GetColor(double position) + { + var index = (int)((_colors.Length - 1) * position); + return _colors[index]; + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Deep.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Deep.cs new file mode 100644 index 000000000..0ff893cc2 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Deep.cs @@ -0,0 +1,273 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Deep : ByteColormapBase + { + public override string Name => "Deep"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + private static readonly (byte, byte, byte)[] _rgbs = { + ( 253, 254, 204 ), + ( 251, 253, 203 ), + ( 249, 252, 202 ), + ( 247, 251, 200 ), + ( 245, 250, 199 ), + ( 243, 250, 198 ), + ( 241, 249, 197 ), + ( 239, 248, 196 ), + ( 237, 247, 195 ), + ( 235, 247, 193 ), + ( 233, 246, 192 ), + ( 231, 245, 191 ), + ( 229, 244, 190 ), + ( 227, 244, 189 ), + ( 225, 243, 188 ), + ( 223, 242, 187 ), + ( 221, 242, 186 ), + ( 219, 241, 185 ), + ( 217, 240, 184 ), + ( 215, 239, 183 ), + ( 212, 239, 182 ), + ( 210, 238, 181 ), + ( 208, 237, 180 ), + ( 206, 236, 179 ), + ( 204, 236, 179 ), + ( 202, 235, 178 ), + ( 200, 234, 177 ), + ( 198, 234, 176 ), + ( 196, 233, 175 ), + ( 193, 232, 175 ), + ( 191, 231, 174 ), + ( 189, 231, 173 ), + ( 187, 230, 172 ), + ( 185, 229, 172 ), + ( 183, 229, 171 ), + ( 181, 228, 170 ), + ( 178, 227, 170 ), + ( 176, 226, 169 ), + ( 174, 226, 169 ), + ( 172, 225, 168 ), + ( 170, 224, 168 ), + ( 167, 224, 167 ), + ( 165, 223, 167 ), + ( 163, 222, 166 ), + ( 161, 221, 166 ), + ( 159, 221, 165 ), + ( 156, 220, 165 ), + ( 154, 219, 165 ), + ( 152, 218, 164 ), + ( 150, 218, 164 ), + ( 148, 217, 164 ), + ( 146, 216, 164 ), + ( 144, 215, 164 ), + ( 141, 215, 163 ), + ( 139, 214, 163 ), + ( 137, 213, 163 ), + ( 135, 212, 163 ), + ( 133, 211, 163 ), + ( 131, 211, 163 ), + ( 129, 210, 163 ), + ( 127, 209, 163 ), + ( 125, 208, 163 ), + ( 124, 207, 163 ), + ( 122, 206, 163 ), + ( 120, 206, 163 ), + ( 118, 205, 163 ), + ( 117, 204, 163 ), + ( 115, 203, 163 ), + ( 113, 202, 163 ), + ( 112, 201, 163 ), + ( 110, 200, 163 ), + ( 109, 199, 163 ), + ( 107, 198, 163 ), + ( 106, 197, 164 ), + ( 105, 196, 164 ), + ( 103, 195, 164 ), + ( 102, 194, 164 ), + ( 101, 194, 164 ), + ( 100, 193, 164 ), + ( 99, 192, 164 ), + ( 98, 191, 164 ), + ( 97, 190, 164 ), + ( 96, 189, 164 ), + ( 95, 188, 164 ), + ( 94, 187, 164 ), + ( 93, 186, 164 ), + ( 92, 185, 164 ), + ( 91, 184, 164 ), + ( 90, 183, 164 ), + ( 90, 182, 164 ), + ( 89, 180, 164 ), + ( 88, 179, 164 ), + ( 88, 178, 164 ), + ( 87, 177, 164 ), + ( 86, 176, 164 ), + ( 86, 175, 164 ), + ( 85, 174, 163 ), + ( 85, 173, 163 ), + ( 84, 172, 163 ), + ( 83, 171, 163 ), + ( 83, 170, 163 ), + ( 82, 169, 163 ), + ( 82, 168, 163 ), + ( 81, 167, 163 ), + ( 81, 166, 162 ), + ( 81, 165, 162 ), + ( 80, 164, 162 ), + ( 80, 163, 162 ), + ( 79, 162, 162 ), + ( 79, 161, 162 ), + ( 79, 160, 162 ), + ( 78, 159, 161 ), + ( 78, 158, 161 ), + ( 77, 157, 161 ), + ( 77, 156, 161 ), + ( 77, 155, 161 ), + ( 76, 154, 160 ), + ( 76, 153, 160 ), + ( 75, 152, 160 ), + ( 75, 151, 160 ), + ( 75, 150, 160 ), + ( 74, 149, 159 ), + ( 74, 148, 159 ), + ( 74, 147, 159 ), + ( 73, 146, 159 ), + ( 73, 145, 158 ), + ( 73, 144, 158 ), + ( 72, 143, 158 ), + ( 72, 142, 158 ), + ( 72, 141, 157 ), + ( 71, 140, 157 ), + ( 71, 139, 157 ), + ( 71, 138, 157 ), + ( 70, 137, 157 ), + ( 70, 136, 156 ), + ( 70, 135, 156 ), + ( 69, 134, 156 ), + ( 69, 133, 156 ), + ( 69, 132, 155 ), + ( 68, 131, 155 ), + ( 68, 130, 155 ), + ( 68, 129, 155 ), + ( 68, 128, 155 ), + ( 67, 127, 154 ), + ( 67, 126, 154 ), + ( 67, 125, 154 ), + ( 66, 124, 154 ), + ( 66, 123, 153 ), + ( 66, 122, 153 ), + ( 66, 121, 153 ), + ( 65, 120, 153 ), + ( 65, 119, 153 ), + ( 65, 118, 152 ), + ( 64, 117, 152 ), + ( 64, 116, 152 ), + ( 64, 115, 152 ), + ( 64, 114, 152 ), + ( 64, 113, 151 ), + ( 63, 112, 151 ), + ( 63, 111, 151 ), + ( 63, 110, 151 ), + ( 63, 109, 151 ), + ( 63, 108, 150 ), + ( 62, 107, 150 ), + ( 62, 106, 150 ), + ( 62, 105, 150 ), + ( 62, 104, 150 ), + ( 62, 103, 149 ), + ( 62, 102, 149 ), + ( 62, 101, 149 ), + ( 62, 100, 149 ), + ( 62, 99, 148 ), + ( 62, 98, 148 ), + ( 62, 97, 148 ), + ( 62, 96, 148 ), + ( 62, 95, 147 ), + ( 62, 94, 147 ), + ( 62, 92, 147 ), + ( 62, 91, 147 ), + ( 62, 90, 146 ), + ( 62, 89, 146 ), + ( 62, 88, 146 ), + ( 62, 87, 145 ), + ( 62, 86, 145 ), + ( 63, 85, 144 ), + ( 63, 84, 144 ), + ( 63, 83, 143 ), + ( 63, 82, 143 ), + ( 63, 80, 142 ), + ( 64, 79, 141 ), + ( 64, 78, 141 ), + ( 64, 77, 140 ), + ( 64, 76, 139 ), + ( 65, 75, 138 ), + ( 65, 74, 137 ), + ( 65, 73, 136 ), + ( 65, 72, 135 ), + ( 65, 71, 133 ), + ( 65, 70, 132 ), + ( 65, 69, 131 ), + ( 65, 68, 129 ), + ( 66, 67, 128 ), + ( 65, 66, 126 ), + ( 65, 65, 125 ), + ( 65, 64, 123 ), + ( 65, 64, 122 ), + ( 65, 63, 120 ), + ( 65, 62, 118 ), + ( 65, 61, 117 ), + ( 64, 60, 115 ), + ( 64, 60, 113 ), + ( 64, 59, 112 ), + ( 64, 58, 110 ), + ( 63, 57, 108 ), + ( 63, 56, 107 ), + ( 63, 56, 105 ), + ( 62, 55, 103 ), + ( 62, 54, 102 ), + ( 61, 53, 100 ), + ( 61, 53, 98 ), + ( 61, 52, 97 ), + ( 60, 51, 95 ), + ( 60, 50, 93 ), + ( 59, 50, 92 ), + ( 59, 49, 90 ), + ( 58, 48, 88 ), + ( 58, 48, 87 ), + ( 57, 47, 85 ), + ( 57, 46, 84 ), + ( 56, 45, 82 ), + ( 56, 45, 81 ), + ( 55, 44, 79 ), + ( 54, 43, 77 ), + ( 54, 42, 76 ), + ( 53, 42, 74 ), + ( 53, 41, 73 ), + ( 52, 40, 71 ), + ( 52, 40, 70 ), + ( 51, 39, 68 ), + ( 50, 38, 67 ), + ( 50, 37, 65 ), + ( 49, 37, 64 ), + ( 48, 36, 62 ), + ( 48, 35, 61 ), + ( 47, 34, 59 ), + ( 47, 34, 58 ), + ( 46, 33, 57 ), + ( 45, 32, 55 ), + ( 45, 31, 54 ), + ( 44, 31, 52 ), + ( 43, 30, 51 ), + ( 43, 29, 50 ), + ( 42, 28, 48 ), + ( 41, 28, 47 ), + ( 40, 27, 45 ), + ( 40, 26, 44 ) + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Delta.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Delta.cs new file mode 100644 index 000000000..cd83d974f --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Delta.cs @@ -0,0 +1,274 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Delta : ByteColormapBase + { + public override string Name => "Delta"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + + private static readonly (byte, byte, byte)[] _rgbs = { + ( 17, 32, 64 ), + ( 18, 33, 67 ), + ( 20, 34, 70 ), + ( 21, 36, 73 ), + ( 22, 37, 76 ), + ( 23, 38, 79 ), + ( 25, 40, 83 ), + ( 26, 41, 86 ), + ( 27, 42, 89 ), + ( 28, 44, 93 ), + ( 30, 45, 96 ), + ( 31, 46, 100 ), + ( 32, 48, 103 ), + ( 33, 49, 107 ), + ( 34, 50, 111 ), + ( 35, 51, 114 ), + ( 36, 53, 118 ), + ( 37, 54, 122 ), + ( 37, 55, 126 ), + ( 38, 56, 130 ), + ( 38, 58, 134 ), + ( 39, 59, 137 ), + ( 39, 61, 141 ), + ( 38, 62, 145 ), + ( 37, 64, 148 ), + ( 36, 66, 150 ), + ( 35, 68, 152 ), + ( 33, 70, 154 ), + ( 32, 73, 155 ), + ( 31, 75, 155 ), + ( 30, 77, 156 ), + ( 29, 79, 156 ), + ( 28, 82, 157 ), + ( 28, 84, 157 ), + ( 27, 86, 157 ), + ( 27, 88, 158 ), + ( 27, 90, 158 ), + ( 27, 92, 158 ), + ( 27, 94, 159 ), + ( 27, 96, 159 ), + ( 27, 98, 159 ), + ( 27, 100, 159 ), + ( 28, 102, 160 ), + ( 28, 104, 160 ), + ( 29, 106, 160 ), + ( 30, 108, 161 ), + ( 30, 110, 161 ), + ( 31, 112, 162 ), + ( 32, 114, 162 ), + ( 33, 116, 162 ), + ( 34, 118, 163 ), + ( 35, 120, 163 ), + ( 36, 122, 164 ), + ( 37, 124, 164 ), + ( 38, 126, 165 ), + ( 39, 128, 165 ), + ( 40, 129, 165 ), + ( 42, 131, 166 ), + ( 43, 133, 166 ), + ( 44, 135, 167 ), + ( 45, 137, 167 ), + ( 47, 139, 168 ), + ( 48, 141, 168 ), + ( 50, 143, 169 ), + ( 51, 145, 169 ), + ( 53, 146, 170 ), + ( 54, 148, 170 ), + ( 56, 150, 171 ), + ( 58, 152, 171 ), + ( 60, 154, 172 ), + ( 62, 156, 172 ), + ( 64, 158, 173 ), + ( 66, 160, 173 ), + ( 68, 161, 174 ), + ( 71, 163, 174 ), + ( 73, 165, 174 ), + ( 76, 167, 175 ), + ( 79, 169, 175 ), + ( 82, 170, 176 ), + ( 86, 172, 176 ), + ( 89, 174, 176 ), + ( 93, 175, 177 ), + ( 96, 177, 177 ), + ( 100, 178, 178 ), + ( 104, 180, 178 ), + ( 108, 181, 179 ), + ( 112, 183, 180 ), + ( 116, 184, 181 ), + ( 120, 186, 181 ), + ( 124, 187, 182 ), + ( 128, 189, 183 ), + ( 132, 190, 184 ), + ( 136, 191, 185 ), + ( 139, 193, 186 ), + ( 143, 194, 187 ), + ( 147, 196, 189 ), + ( 151, 197, 190 ), + ( 154, 199, 191 ), + ( 158, 200, 192 ), + ( 161, 202, 194 ), + ( 165, 203, 195 ), + ( 168, 205, 196 ), + ( 172, 206, 198 ), + ( 175, 208, 199 ), + ( 179, 209, 200 ), + ( 182, 211, 202 ), + ( 185, 212, 203 ), + ( 189, 214, 205 ), + ( 192, 216, 206 ), + ( 195, 217, 208 ), + ( 198, 219, 209 ), + ( 202, 221, 211 ), + ( 205, 222, 212 ), + ( 208, 224, 213 ), + ( 211, 226, 215 ), + ( 214, 227, 216 ), + ( 217, 229, 218 ), + ( 220, 231, 219 ), + ( 223, 233, 220 ), + ( 227, 235, 222 ), + ( 230, 237, 223 ), + ( 233, 238, 224 ), + ( 236, 240, 225 ), + ( 239, 242, 226 ), + ( 242, 244, 227 ), + ( 246, 246, 228 ), + ( 249, 248, 229 ), + ( 252, 250, 230 ), + ( 255, 253, 205 ), + ( 254, 250, 201 ), + ( 252, 248, 197 ), + ( 251, 246, 192 ), + ( 249, 243, 188 ), + ( 248, 241, 184 ), + ( 247, 238, 180 ), + ( 246, 236, 175 ), + ( 244, 234, 171 ), + ( 243, 231, 167 ), + ( 241, 229, 162 ), + ( 240, 227, 158 ), + ( 239, 225, 154 ), + ( 237, 222, 150 ), + ( 236, 220, 145 ), + ( 234, 218, 141 ), + ( 233, 216, 137 ), + ( 231, 214, 132 ), + ( 230, 212, 128 ), + ( 228, 210, 123 ), + ( 227, 207, 119 ), + ( 225, 205, 115 ), + ( 223, 204, 110 ), + ( 221, 202, 106 ), + ( 219, 200, 102 ), + ( 217, 198, 97 ), + ( 215, 196, 93 ), + ( 213, 194, 89 ), + ( 211, 193, 85 ), + ( 209, 191, 81 ), + ( 206, 189, 76 ), + ( 204, 188, 72 ), + ( 201, 186, 69 ), + ( 199, 185, 65 ), + ( 196, 183, 61 ), + ( 193, 182, 57 ), + ( 190, 180, 54 ), + ( 187, 179, 50 ), + ( 184, 178, 47 ), + ( 181, 176, 43 ), + ( 178, 175, 40 ), + ( 175, 174, 37 ), + ( 172, 173, 34 ), + ( 169, 171, 31 ), + ( 165, 170, 28 ), + ( 162, 169, 25 ), + ( 159, 168, 23 ), + ( 155, 166, 20 ), + ( 152, 165, 18 ), + ( 149, 164, 15 ), + ( 145, 163, 13 ), + ( 142, 162, 11 ), + ( 138, 160, 9 ), + ( 135, 159, 8 ), + ( 131, 158, 7 ), + ( 128, 157, 6 ), + ( 124, 156, 6 ), + ( 121, 154, 6 ), + ( 117, 153, 6 ), + ( 113, 152, 6 ), + ( 110, 151, 7 ), + ( 106, 149, 8 ), + ( 102, 148, 9 ), + ( 99, 147, 11 ), + ( 95, 146, 12 ), + ( 92, 144, 14 ), + ( 88, 143, 15 ), + ( 84, 142, 17 ), + ( 81, 140, 18 ), + ( 77, 139, 20 ), + ( 73, 138, 22 ), + ( 70, 136, 23 ), + ( 66, 135, 25 ), + ( 63, 133, 26 ), + ( 59, 132, 28 ), + ( 56, 131, 29 ), + ( 52, 129, 30 ), + ( 49, 127, 32 ), + ( 45, 126, 33 ), + ( 42, 124, 34 ), + ( 39, 123, 35 ), + ( 36, 121, 36 ), + ( 33, 120, 37 ), + ( 30, 118, 38 ), + ( 27, 116, 39 ), + ( 24, 115, 40 ), + ( 22, 113, 41 ), + ( 19, 111, 41 ), + ( 17, 109, 42 ), + ( 15, 108, 43 ), + ( 14, 106, 43 ), + ( 13, 104, 43 ), + ( 12, 102, 44 ), + ( 11, 100, 44 ), + ( 11, 99, 44 ), + ( 11, 97, 45 ), + ( 11, 95, 45 ), + ( 12, 93, 45 ), + ( 12, 91, 45 ), + ( 13, 89, 45 ), + ( 14, 87, 45 ), + ( 15, 85, 44 ), + ( 16, 84, 44 ), + ( 17, 82, 44 ), + ( 18, 80, 43 ), + ( 19, 78, 43 ), + ( 20, 76, 42 ), + ( 20, 74, 42 ), + ( 21, 72, 41 ), + ( 22, 70, 41 ), + ( 23, 68, 40 ), + ( 23, 66, 39 ), + ( 24, 64, 38 ), + ( 24, 63, 37 ), + ( 25, 61, 36 ), + ( 25, 59, 35 ), + ( 25, 57, 34 ), + ( 25, 55, 33 ), + ( 25, 53, 32 ), + ( 25, 51, 31 ), + ( 25, 49, 30 ), + ( 25, 47, 28 ), + ( 25, 45, 27 ), + ( 25, 44, 25 ), + ( 25, 42, 24 ), + ( 24, 40, 23 ), + ( 24, 38, 21 ), + ( 23, 36, 19 ) + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Dense.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Dense.cs new file mode 100644 index 000000000..83ab0cd33 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Dense.cs @@ -0,0 +1,274 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Dense : ByteColormapBase + { + public override string Name => "Dense"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + + private static readonly (byte, byte, byte)[] _rgbs = { + ( 230, 241, 241 ), + ( 228, 240, 240 ), + ( 227, 239, 239 ), + ( 225, 238, 239 ), + ( 223, 237, 238 ), + ( 221, 237, 237 ), + ( 220, 236, 237 ), + ( 218, 235, 236 ), + ( 216, 234, 236 ), + ( 215, 233, 235 ), + ( 213, 233, 235 ), + ( 211, 232, 234 ), + ( 209, 231, 234 ), + ( 208, 230, 233 ), + ( 206, 229, 233 ), + ( 204, 228, 232 ), + ( 203, 228, 232 ), + ( 201, 227, 232 ), + ( 199, 226, 231 ), + ( 198, 225, 231 ), + ( 196, 224, 230 ), + ( 194, 223, 230 ), + ( 193, 223, 230 ), + ( 191, 222, 230 ), + ( 190, 221, 229 ), + ( 188, 220, 229 ), + ( 186, 219, 229 ), + ( 185, 218, 228 ), + ( 183, 218, 228 ), + ( 182, 217, 228 ), + ( 180, 216, 228 ), + ( 178, 215, 228 ), + ( 177, 214, 227 ), + ( 175, 213, 227 ), + ( 174, 212, 227 ), + ( 172, 212, 227 ), + ( 171, 211, 227 ), + ( 169, 210, 227 ), + ( 168, 209, 227 ), + ( 166, 208, 227 ), + ( 165, 207, 226 ), + ( 163, 206, 226 ), + ( 162, 206, 226 ), + ( 160, 205, 226 ), + ( 159, 204, 226 ), + ( 158, 203, 226 ), + ( 156, 202, 226 ), + ( 155, 201, 226 ), + ( 154, 200, 226 ), + ( 152, 199, 226 ), + ( 151, 198, 226 ), + ( 150, 197, 226 ), + ( 148, 197, 226 ), + ( 147, 196, 226 ), + ( 146, 195, 226 ), + ( 144, 194, 226 ), + ( 143, 193, 226 ), + ( 142, 192, 226 ), + ( 141, 191, 226 ), + ( 140, 190, 226 ), + ( 138, 189, 227 ), + ( 137, 188, 227 ), + ( 136, 187, 227 ), + ( 135, 186, 227 ), + ( 134, 185, 227 ), + ( 133, 184, 227 ), + ( 132, 183, 227 ), + ( 131, 182, 227 ), + ( 130, 181, 227 ), + ( 129, 180, 227 ), + ( 128, 179, 227 ), + ( 127, 178, 227 ), + ( 127, 177, 228 ), + ( 126, 176, 228 ), + ( 125, 175, 228 ), + ( 124, 174, 228 ), + ( 123, 173, 228 ), + ( 123, 172, 228 ), + ( 122, 171, 228 ), + ( 121, 170, 228 ), + ( 121, 169, 228 ), + ( 120, 168, 228 ), + ( 120, 167, 228 ), + ( 119, 166, 228 ), + ( 119, 165, 228 ), + ( 118, 164, 229 ), + ( 118, 163, 229 ), + ( 117, 161, 229 ), + ( 117, 160, 229 ), + ( 117, 159, 229 ), + ( 117, 158, 229 ), + ( 116, 157, 229 ), + ( 116, 156, 228 ), + ( 116, 155, 228 ), + ( 116, 154, 228 ), + ( 116, 152, 228 ), + ( 115, 151, 228 ), + ( 115, 150, 228 ), + ( 115, 149, 228 ), + ( 115, 148, 228 ), + ( 115, 147, 227 ), + ( 115, 145, 227 ), + ( 115, 144, 227 ), + ( 115, 143, 227 ), + ( 115, 142, 226 ), + ( 116, 141, 226 ), + ( 116, 139, 226 ), + ( 116, 138, 226 ), + ( 116, 137, 225 ), + ( 116, 136, 225 ), + ( 116, 135, 224 ), + ( 116, 133, 224 ), + ( 117, 132, 223 ), + ( 117, 131, 223 ), + ( 117, 130, 222 ), + ( 117, 129, 222 ), + ( 117, 127, 221 ), + ( 117, 126, 221 ), + ( 118, 125, 220 ), + ( 118, 124, 220 ), + ( 118, 123, 219 ), + ( 118, 121, 218 ), + ( 118, 120, 218 ), + ( 119, 119, 217 ), + ( 119, 118, 216 ), + ( 119, 117, 215 ), + ( 119, 115, 215 ), + ( 119, 114, 214 ), + ( 120, 113, 213 ), + ( 120, 112, 212 ), + ( 120, 111, 211 ), + ( 120, 110, 210 ), + ( 120, 108, 210 ), + ( 120, 107, 209 ), + ( 120, 106, 208 ), + ( 121, 105, 207 ), + ( 121, 104, 206 ), + ( 121, 102, 205 ), + ( 121, 101, 204 ), + ( 121, 100, 203 ), + ( 121, 99, 202 ), + ( 121, 98, 201 ), + ( 121, 97, 200 ), + ( 121, 96, 199 ), + ( 121, 94, 197 ), + ( 121, 93, 196 ), + ( 121, 92, 195 ), + ( 121, 91, 194 ), + ( 121, 90, 193 ), + ( 121, 89, 192 ), + ( 121, 88, 191 ), + ( 121, 87, 189 ), + ( 121, 86, 188 ), + ( 121, 84, 187 ), + ( 121, 83, 186 ), + ( 121, 82, 184 ), + ( 121, 81, 183 ), + ( 121, 80, 182 ), + ( 121, 79, 181 ), + ( 120, 78, 179 ), + ( 120, 77, 178 ), + ( 120, 76, 177 ), + ( 120, 75, 175 ), + ( 120, 74, 174 ), + ( 120, 73, 173 ), + ( 119, 72, 171 ), + ( 119, 71, 170 ), + ( 119, 70, 169 ), + ( 119, 69, 167 ), + ( 119, 67, 166 ), + ( 118, 66, 165 ), + ( 118, 65, 163 ), + ( 118, 64, 162 ), + ( 118, 63, 160 ), + ( 117, 62, 159 ), + ( 117, 61, 157 ), + ( 117, 60, 156 ), + ( 116, 59, 155 ), + ( 116, 59, 153 ), + ( 116, 58, 152 ), + ( 115, 57, 150 ), + ( 115, 56, 149 ), + ( 115, 55, 147 ), + ( 114, 54, 146 ), + ( 114, 53, 144 ), + ( 114, 52, 143 ), + ( 113, 51, 141 ), + ( 113, 50, 140 ), + ( 112, 49, 138 ), + ( 112, 48, 136 ), + ( 111, 47, 135 ), + ( 111, 46, 133 ), + ( 110, 45, 132 ), + ( 110, 45, 130 ), + ( 109, 44, 129 ), + ( 109, 43, 127 ), + ( 108, 42, 126 ), + ( 108, 41, 124 ), + ( 107, 40, 122 ), + ( 107, 40, 121 ), + ( 106, 39, 119 ), + ( 106, 38, 117 ), + ( 105, 37, 116 ), + ( 104, 36, 114 ), + ( 104, 36, 113 ), + ( 103, 35, 111 ), + ( 103, 34, 109 ), + ( 102, 33, 108 ), + ( 101, 33, 106 ), + ( 101, 32, 104 ), + ( 100, 31, 103 ), + ( 99, 31, 101 ), + ( 98, 30, 99 ), + ( 98, 29, 98 ), + ( 97, 29, 96 ), + ( 96, 28, 94 ), + ( 95, 27, 93 ), + ( 95, 27, 91 ), + ( 94, 26, 89 ), + ( 93, 26, 88 ), + ( 92, 25, 86 ), + ( 91, 25, 84 ), + ( 90, 24, 83 ), + ( 90, 24, 81 ), + ( 89, 23, 80 ), + ( 88, 23, 78 ), + ( 87, 22, 76 ), + ( 86, 22, 75 ), + ( 85, 22, 73 ), + ( 84, 21, 72 ), + ( 83, 21, 70 ), + ( 82, 21, 68 ), + ( 81, 20, 67 ), + ( 80, 20, 65 ), + ( 79, 20, 64 ), + ( 78, 19, 62 ), + ( 77, 19, 61 ), + ( 75, 19, 59 ), + ( 74, 19, 58 ), + ( 73, 18, 56 ), + ( 72, 18, 55 ), + ( 71, 18, 54 ), + ( 70, 18, 52 ), + ( 69, 17, 51 ), + ( 68, 17, 50 ), + ( 66, 17, 48 ), + ( 65, 17, 47 ), + ( 64, 16, 46 ), + ( 63, 16, 45 ), + ( 62, 16, 43 ), + ( 60, 16, 42 ), + ( 59, 15, 41 ), + ( 58, 15, 40 ), + ( 57, 15, 39 ), + ( 56, 15, 37 ), + ( 54, 14, 36 ) + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Diff.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Diff.cs new file mode 100644 index 000000000..f8619395a --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Diff.cs @@ -0,0 +1,273 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Diff : ByteColormapBase + { + public override string Name => "Diff"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + private static readonly (byte, byte, byte)[] _rgbs = { + ( 8, 35, 64 ), + ( 9, 37, 66 ), + ( 10, 38, 68 ), + ( 11, 40, 69 ), + ( 12, 42, 71 ), + ( 12, 44, 73 ), + ( 13, 45, 75 ), + ( 14, 47, 77 ), + ( 15, 49, 79 ), + ( 16, 50, 81 ), + ( 17, 52, 83 ), + ( 17, 54, 85 ), + ( 18, 55, 86 ), + ( 19, 57, 88 ), + ( 20, 59, 90 ), + ( 20, 61, 92 ), + ( 21, 62, 94 ), + ( 22, 64, 95 ), + ( 23, 66, 97 ), + ( 24, 67, 99 ), + ( 25, 69, 100 ), + ( 26, 71, 102 ), + ( 27, 72, 103 ), + ( 29, 74, 104 ), + ( 31, 76, 105 ), + ( 33, 77, 106 ), + ( 36, 79, 107 ), + ( 38, 80, 108 ), + ( 40, 82, 109 ), + ( 43, 83, 110 ), + ( 45, 85, 111 ), + ( 47, 86, 112 ), + ( 49, 88, 113 ), + ( 52, 89, 115 ), + ( 54, 91, 116 ), + ( 56, 92, 117 ), + ( 58, 94, 118 ), + ( 60, 95, 119 ), + ( 62, 97, 120 ), + ( 65, 98, 121 ), + ( 67, 100, 122 ), + ( 69, 101, 123 ), + ( 71, 103, 125 ), + ( 73, 104, 126 ), + ( 75, 106, 127 ), + ( 77, 107, 128 ), + ( 79, 109, 129 ), + ( 81, 110, 130 ), + ( 83, 112, 132 ), + ( 85, 113, 133 ), + ( 88, 115, 134 ), + ( 90, 116, 135 ), + ( 92, 118, 136 ), + ( 94, 120, 138 ), + ( 96, 121, 139 ), + ( 98, 123, 140 ), + ( 100, 124, 141 ), + ( 102, 126, 142 ), + ( 104, 127, 144 ), + ( 106, 129, 145 ), + ( 108, 130, 146 ), + ( 110, 132, 148 ), + ( 112, 134, 149 ), + ( 114, 135, 150 ), + ( 116, 137, 151 ), + ( 118, 138, 153 ), + ( 120, 140, 154 ), + ( 123, 141, 155 ), + ( 125, 143, 157 ), + ( 127, 145, 158 ), + ( 129, 146, 159 ), + ( 131, 148, 161 ), + ( 133, 150, 162 ), + ( 135, 151, 163 ), + ( 137, 153, 165 ), + ( 139, 154, 166 ), + ( 141, 156, 167 ), + ( 143, 158, 169 ), + ( 146, 159, 170 ), + ( 148, 161, 172 ), + ( 150, 163, 173 ), + ( 152, 165, 175 ), + ( 154, 166, 176 ), + ( 156, 168, 177 ), + ( 158, 170, 179 ), + ( 160, 171, 180 ), + ( 163, 173, 182 ), + ( 165, 175, 183 ), + ( 167, 177, 185 ), + ( 169, 178, 186 ), + ( 171, 180, 188 ), + ( 174, 182, 189 ), + ( 176, 184, 191 ), + ( 178, 186, 192 ), + ( 180, 187, 194 ), + ( 182, 189, 196 ), + ( 185, 191, 197 ), + ( 187, 193, 199 ), + ( 189, 195, 200 ), + ( 191, 197, 202 ), + ( 194, 198, 204 ), + ( 196, 200, 205 ), + ( 198, 202, 207 ), + ( 200, 204, 209 ), + ( 203, 206, 210 ), + ( 205, 208, 212 ), + ( 207, 210, 214 ), + ( 210, 212, 215 ), + ( 212, 214, 217 ), + ( 214, 216, 219 ), + ( 217, 218, 221 ), + ( 219, 220, 222 ), + ( 221, 222, 224 ), + ( 224, 224, 226 ), + ( 226, 226, 227 ), + ( 228, 227, 229 ), + ( 230, 229, 231 ), + ( 232, 231, 232 ), + ( 235, 233, 234 ), + ( 236, 234, 235 ), + ( 238, 236, 236 ), + ( 240, 237, 238 ), + ( 241, 238, 239 ), + ( 243, 239, 239 ), + ( 244, 240, 240 ), + ( 245, 241, 240 ), + ( 245, 241, 240 ), + ( 246, 241, 240 ), + ( 246, 241, 240 ), + ( 245, 241, 239 ), + ( 245, 240, 238 ), + ( 244, 239, 237 ), + ( 243, 238, 235 ), + ( 242, 237, 233 ), + ( 241, 235, 232 ), + ( 239, 234, 229 ), + ( 238, 232, 227 ), + ( 236, 230, 225 ), + ( 234, 229, 223 ), + ( 232, 227, 220 ), + ( 231, 225, 218 ), + ( 229, 223, 215 ), + ( 227, 221, 212 ), + ( 225, 219, 210 ), + ( 223, 217, 207 ), + ( 221, 215, 205 ), + ( 219, 213, 202 ), + ( 217, 211, 199 ), + ( 215, 209, 197 ), + ( 213, 207, 194 ), + ( 211, 205, 192 ), + ( 210, 203, 189 ), + ( 208, 201, 187 ), + ( 206, 199, 184 ), + ( 204, 197, 181 ), + ( 202, 195, 179 ), + ( 200, 193, 176 ), + ( 199, 191, 174 ), + ( 197, 189, 171 ), + ( 195, 187, 169 ), + ( 193, 185, 166 ), + ( 191, 183, 164 ), + ( 190, 181, 161 ), + ( 188, 179, 159 ), + ( 186, 177, 157 ), + ( 185, 176, 154 ), + ( 183, 174, 152 ), + ( 181, 172, 149 ), + ( 179, 170, 147 ), + ( 178, 168, 144 ), + ( 176, 166, 142 ), + ( 174, 165, 140 ), + ( 173, 163, 137 ), + ( 171, 161, 135 ), + ( 169, 159, 133 ), + ( 168, 157, 130 ), + ( 166, 156, 128 ), + ( 164, 154, 125 ), + ( 163, 152, 123 ), + ( 161, 150, 121 ), + ( 160, 149, 118 ), + ( 158, 147, 116 ), + ( 156, 145, 114 ), + ( 155, 143, 112 ), + ( 153, 142, 109 ), + ( 152, 140, 107 ), + ( 150, 138, 105 ), + ( 149, 137, 103 ), + ( 147, 135, 100 ), + ( 145, 133, 98 ), + ( 144, 132, 96 ), + ( 142, 130, 94 ), + ( 141, 128, 91 ), + ( 139, 127, 89 ), + ( 138, 125, 87 ), + ( 136, 123, 85 ), + ( 135, 122, 83 ), + ( 133, 120, 80 ), + ( 131, 118, 78 ), + ( 130, 117, 76 ), + ( 128, 115, 74 ), + ( 127, 114, 72 ), + ( 125, 112, 70 ), + ( 124, 110, 67 ), + ( 122, 109, 65 ), + ( 121, 107, 63 ), + ( 119, 106, 61 ), + ( 118, 104, 59 ), + ( 116, 102, 57 ), + ( 114, 101, 55 ), + ( 113, 99, 53 ), + ( 111, 98, 51 ), + ( 110, 96, 48 ), + ( 108, 95, 46 ), + ( 106, 93, 44 ), + ( 104, 92, 43 ), + ( 103, 90, 41 ), + ( 101, 89, 39 ), + ( 99, 88, 38 ), + ( 97, 86, 37 ), + ( 95, 85, 36 ), + ( 93, 84, 35 ), + ( 91, 82, 34 ), + ( 89, 81, 33 ), + ( 87, 79, 32 ), + ( 85, 78, 32 ), + ( 83, 77, 31 ), + ( 81, 75, 30 ), + ( 79, 74, 29 ), + ( 77, 72, 29 ), + ( 75, 71, 28 ), + ( 73, 69, 27 ), + ( 71, 68, 26 ), + ( 69, 67, 26 ), + ( 67, 65, 25 ), + ( 66, 64, 24 ), + ( 64, 62, 23 ), + ( 62, 61, 22 ), + ( 60, 59, 22 ), + ( 58, 58, 21 ), + ( 56, 57, 20 ), + ( 54, 55, 19 ), + ( 52, 54, 18 ), + ( 51, 52, 18 ), + ( 49, 51, 17 ), + ( 47, 49, 16 ), + ( 45, 48, 15 ), + ( 43, 46, 14 ), + ( 41, 45, 13 ), + ( 39, 43, 12 ), + ( 38, 42, 11 ), + ( 36, 40, 10 ), + ( 34, 39, 9 ), + ( 32, 37, 9 ), + ( 30, 36, 8 ), + ( 28, 34, 7 ) + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Grayscale.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Grayscale.cs new file mode 100644 index 000000000..fdd69ade3 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Grayscale.cs @@ -0,0 +1,13 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Grayscale : ColormapBase + { + public override string Name => "Grayscale"; + + public override Color GetColor(double normalizedIntensity) + { + var value = (byte)(255 * normalizedIntensity); + return Color.Gray(value); + } + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/GrayscaleReversed.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/GrayscaleReversed.cs new file mode 100644 index 000000000..8a09c0e63 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/GrayscaleReversed.cs @@ -0,0 +1,13 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class GrayscaleReversed : ColormapBase + { + public override string Name => "Grayscale Reversed"; + + public override Color GetColor(double normalizedIntensity) + { + var value = (byte)(255 - (byte)(255 * normalizedIntensity)); + return Color.Gray(value); + } + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Greens.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Greens.cs new file mode 100644 index 000000000..f39337241 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Greens.cs @@ -0,0 +1,49 @@ +// This colormap was created by Scott Harden on 2020-06-16 and is released under a MIT license. + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Greens : ArgbColormapBase + { + public override string Name => "Greens"; + + public override uint[] Argbs => _argbs; + + private static readonly int[] _rgbs = + { + -16761088, -16760832, -16760575, -16760318, -16760061, -16759804, -16759547, -16759290, + -16759033, -16758776, -16758519, -16758006, -16757749, -16757492, -16757235, -16756979, + -16756722, -16756465, -16756208, -16755951, -16755694, -16755437, -16755180, -16754667, + -16754410, -16688617, -16688360, -16688104, -16687847, -16687590, -16687333, -16687076, + -16621283, -16621026, -16620769, -16620512, -16620256, -16554463, -16554206, -16553949, + -16553692, -16487899, -16487642, -16487385, -16421336, -16421080, -16420823, -16355030, + -16354773, -16288980, -16288723, -16222930, -16222930, -16222673, -16156880, -16156623, + -16090830, -16025038, -16024781, -15958988, -15958731, -15892938, -15827145, -15826889, + -15761096, -15695303, -15695046, -15629254, -15563461, -15497924, -15497667, -15431875, + -15366082, -15300289, -15234496, -15234240, -15168447, -15102654, -15037118, -14971325, + -14905532, -14839740, -14773947, -14708154, -14642618, -14576825, -14511033, -14445240, + -14379447, -14313655, -14248118, -14182326, -14116533, -14050741, -13985204, -13919412, + -13853619, -13722291, -13656498, -13590962, -13525169, -13459377, -13328048, -13262512, + -13196720, -13130927, -13065391, -12934063, -12868270, -12802478, -12671406, -12605613, + -12539821, -12408749, -12342957, -12277164, -12146092, -12080300, -12014508, -11883435, + -11817643, -11686315, -11620779, -11554986, -11423914, -11358122, -11226794, -11161258, + -11029929, -10964137, -10833065, -10767273, -10636201, -10570408, -10439080, -10373544, + -10242216, -10176680, -10045351, -09914023, -09848487, -09717159, -09651623, -09520294, + -09389222, -09323430, -09192102, -09061029, -08995237, -08864165, -08798372, -08667300, + -08535972, -08404643, -08339107, -08207779, -08076706, -08010914, -07879842, -07748513, + -07682977, -07551648, -07420576, -07289248, -07223711, -07092383, -06961054, -06895518, + -06764189, -06633116, -06501788, -06436251, -06304923, -06173850, -06108057, -05976984, + -05845656, -05714583, -05648790, -05517717, -05386389, -05320596, -05189523, -05123730, + -04992657, -04861328, -04795791, -04664462, -04598925, -04467596, -04336523, -04270730, + -04139400, -04073863, -03942534, -03876997, -03745667, -03680130, -03614337, -03483007, + -03417470, -03286140, -03220603, -03154809, -03023479, -02957942, -02892148, -02826610, + -02760817, -02629487, -02563949, -02498155, -02432617, -02366823, -02301029, -02235491, + -02169697, -02103903, -02038365, -01972571, -01906777, -01841239, -01775444, -01709650, + -01644112, -01578318, -01512523, -01446985, -01381191, -01315396, -01249858, -01249599, + -01183805, -01118266, -01052472, -00986678, -00986675, -00920880, -00855086, -00789547, + -00723753, -00723494, -00657956, -00592161, -00526367, -00526108, -00460569, -00394775, + -00394516, -00328977, -00263183, -00197388, -00197385, -00131591, -00065796, -00000001, + }; + + private static readonly uint[] _argbs = _rgbs.Select(rgb => unchecked((uint)(0xFF << 24) | (uint)rgb)).ToArray(); + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Haline.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Haline.cs new file mode 100644 index 000000000..b548ac379 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Haline.cs @@ -0,0 +1,274 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Haline : ByteColormapBase + { + public override string Name => "Haline"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + + private static readonly (byte, byte, byte)[] _rgbs = { + ( 42, 24, 108 ), + ( 42, 25, 110 ), + ( 42, 25, 113 ), + ( 43, 25, 115 ), + ( 43, 25, 117 ), + ( 44, 26, 120 ), + ( 44, 26, 122 ), + ( 45, 26, 125 ), + ( 45, 26, 127 ), + ( 45, 27, 130 ), + ( 46, 27, 132 ), + ( 46, 27, 135 ), + ( 46, 28, 137 ), + ( 46, 28, 140 ), + ( 46, 28, 142 ), + ( 46, 29, 145 ), + ( 46, 29, 147 ), + ( 46, 30, 149 ), + ( 46, 30, 152 ), + ( 46, 31, 154 ), + ( 45, 32, 156 ), + ( 45, 33, 157 ), + ( 44, 34, 159 ), + ( 43, 36, 160 ), + ( 42, 37, 161 ), + ( 41, 39, 162 ), + ( 40, 41, 163 ), + ( 38, 43, 163 ), + ( 37, 45, 163 ), + ( 36, 46, 163 ), + ( 34, 48, 163 ), + ( 33, 50, 162 ), + ( 32, 52, 162 ), + ( 30, 53, 161 ), + ( 29, 55, 161 ), + ( 28, 57, 160 ), + ( 27, 58, 160 ), + ( 25, 60, 159 ), + ( 24, 61, 158 ), + ( 23, 63, 158 ), + ( 22, 64, 157 ), + ( 21, 65, 156 ), + ( 20, 67, 156 ), + ( 19, 68, 155 ), + ( 18, 69, 155 ), + ( 17, 71, 154 ), + ( 16, 72, 153 ), + ( 15, 73, 153 ), + ( 15, 74, 152 ), + ( 14, 76, 151 ), + ( 13, 77, 151 ), + ( 13, 78, 150 ), + ( 13, 79, 150 ), + ( 12, 80, 149 ), + ( 12, 81, 149 ), + ( 12, 82, 148 ), + ( 12, 83, 148 ), + ( 12, 84, 147 ), + ( 13, 85, 147 ), + ( 13, 86, 146 ), + ( 13, 87, 146 ), + ( 14, 88, 145 ), + ( 14, 89, 145 ), + ( 15, 90, 145 ), + ( 15, 91, 144 ), + ( 16, 92, 144 ), + ( 17, 93, 143 ), + ( 17, 94, 143 ), + ( 18, 95, 143 ), + ( 19, 96, 142 ), + ( 20, 97, 142 ), + ( 20, 98, 142 ), + ( 21, 99, 142 ), + ( 22, 99, 141 ), + ( 23, 100, 141 ), + ( 24, 101, 141 ), + ( 24, 102, 140 ), + ( 25, 103, 140 ), + ( 26, 104, 140 ), + ( 27, 105, 140 ), + ( 28, 106, 140 ), + ( 29, 107, 139 ), + ( 29, 107, 139 ), + ( 30, 108, 139 ), + ( 31, 109, 139 ), + ( 32, 110, 139 ), + ( 33, 111, 139 ), + ( 34, 112, 138 ), + ( 34, 113, 138 ), + ( 35, 113, 138 ), + ( 36, 114, 138 ), + ( 37, 115, 138 ), + ( 38, 116, 138 ), + ( 38, 117, 138 ), + ( 39, 118, 138 ), + ( 40, 118, 137 ), + ( 41, 119, 137 ), + ( 41, 120, 137 ), + ( 42, 121, 137 ), + ( 43, 122, 137 ), + ( 43, 123, 137 ), + ( 44, 124, 137 ), + ( 45, 124, 137 ), + ( 45, 125, 137 ), + ( 46, 126, 137 ), + ( 47, 127, 137 ), + ( 47, 128, 137 ), + ( 48, 129, 137 ), + ( 49, 130, 137 ), + ( 49, 130, 136 ), + ( 50, 131, 136 ), + ( 51, 132, 136 ), + ( 51, 133, 136 ), + ( 52, 134, 136 ), + ( 52, 135, 136 ), + ( 53, 136, 136 ), + ( 53, 137, 136 ), + ( 54, 137, 136 ), + ( 55, 138, 136 ), + ( 55, 139, 136 ), + ( 56, 140, 136 ), + ( 56, 141, 136 ), + ( 57, 142, 136 ), + ( 57, 143, 136 ), + ( 58, 144, 135 ), + ( 58, 144, 135 ), + ( 59, 145, 135 ), + ( 59, 146, 135 ), + ( 60, 147, 135 ), + ( 60, 148, 135 ), + ( 61, 149, 135 ), + ( 61, 150, 135 ), + ( 62, 151, 135 ), + ( 62, 152, 134 ), + ( 63, 153, 134 ), + ( 63, 153, 134 ), + ( 64, 154, 134 ), + ( 65, 155, 134 ), + ( 65, 156, 133 ), + ( 66, 157, 133 ), + ( 66, 158, 133 ), + ( 67, 159, 133 ), + ( 67, 160, 132 ), + ( 68, 161, 132 ), + ( 68, 162, 132 ), + ( 69, 163, 132 ), + ( 70, 164, 131 ), + ( 70, 164, 131 ), + ( 71, 165, 131 ), + ( 72, 166, 130 ), + ( 72, 167, 130 ), + ( 73, 168, 130 ), + ( 74, 169, 129 ), + ( 74, 170, 129 ), + ( 75, 171, 129 ), + ( 76, 172, 128 ), + ( 76, 173, 128 ), + ( 77, 174, 127 ), + ( 78, 174, 127 ), + ( 79, 175, 126 ), + ( 80, 176, 126 ), + ( 81, 177, 125 ), + ( 81, 178, 125 ), + ( 82, 179, 124 ), + ( 83, 180, 124 ), + ( 84, 181, 123 ), + ( 85, 182, 123 ), + ( 86, 183, 122 ), + ( 87, 184, 121 ), + ( 88, 184, 121 ), + ( 90, 185, 120 ), + ( 91, 186, 119 ), + ( 92, 187, 119 ), + ( 93, 188, 118 ), + ( 94, 189, 117 ), + ( 95, 190, 117 ), + ( 97, 191, 116 ), + ( 98, 191, 115 ), + ( 99, 192, 114 ), + ( 101, 193, 114 ), + ( 102, 194, 113 ), + ( 104, 195, 112 ), + ( 105, 196, 111 ), + ( 107, 196, 110 ), + ( 108, 197, 110 ), + ( 110, 198, 109 ), + ( 112, 199, 108 ), + ( 113, 200, 107 ), + ( 115, 200, 106 ), + ( 117, 201, 105 ), + ( 119, 202, 104 ), + ( 120, 203, 104 ), + ( 122, 203, 103 ), + ( 124, 204, 102 ), + ( 126, 205, 101 ), + ( 128, 206, 100 ), + ( 130, 206, 99 ), + ( 132, 207, 98 ), + ( 134, 208, 98 ), + ( 137, 208, 97 ), + ( 139, 209, 96 ), + ( 141, 210, 95 ), + ( 143, 210, 95 ), + ( 146, 211, 94 ), + ( 148, 211, 93 ), + ( 151, 212, 93 ), + ( 153, 212, 93 ), + ( 155, 213, 92 ), + ( 158, 214, 92 ), + ( 160, 214, 92 ), + ( 163, 215, 92 ), + ( 165, 215, 92 ), + ( 168, 216, 92 ), + ( 170, 216, 92 ), + ( 173, 216, 92 ), + ( 175, 217, 93 ), + ( 177, 217, 93 ), + ( 180, 218, 94 ), + ( 182, 218, 95 ), + ( 184, 219, 96 ), + ( 187, 219, 97 ), + ( 189, 220, 98 ), + ( 191, 220, 99 ), + ( 193, 221, 100 ), + ( 196, 221, 101 ), + ( 198, 222, 102 ), + ( 200, 222, 103 ), + ( 202, 223, 105 ), + ( 204, 223, 106 ), + ( 206, 224, 108 ), + ( 208, 224, 109 ), + ( 210, 225, 111 ), + ( 212, 225, 112 ), + ( 214, 226, 114 ), + ( 216, 226, 115 ), + ( 218, 227, 117 ), + ( 220, 227, 119 ), + ( 222, 228, 121 ), + ( 224, 229, 122 ), + ( 225, 229, 124 ), + ( 227, 230, 126 ), + ( 229, 230, 128 ), + ( 231, 231, 129 ), + ( 233, 231, 131 ), + ( 235, 232, 133 ), + ( 236, 233, 135 ), + ( 238, 233, 137 ), + ( 240, 234, 138 ), + ( 242, 234, 140 ), + ( 243, 235, 142 ), + ( 245, 236, 144 ), + ( 247, 236, 146 ), + ( 248, 237, 148 ), + ( 250, 238, 150 ), + ( 252, 238, 152 ), + ( 253, 239, 154 ) + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Ice.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Ice.cs new file mode 100644 index 000000000..4ce283b14 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Ice.cs @@ -0,0 +1,274 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Ice : ByteColormapBase + { + public override string Name => "Ice"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + + private static readonly (byte, byte, byte)[] _rgbs = { + ( 4, 6, 19 ), + ( 5, 6, 20 ), + ( 5, 7, 21 ), + ( 6, 8, 23 ), + ( 7, 9, 24 ), + ( 8, 10, 26 ), + ( 9, 11, 27 ), + ( 10, 12, 29 ), + ( 11, 13, 30 ), + ( 12, 13, 31 ), + ( 13, 14, 33 ), + ( 14, 15, 34 ), + ( 15, 16, 36 ), + ( 16, 17, 37 ), + ( 17, 18, 39 ), + ( 18, 19, 40 ), + ( 19, 19, 42 ), + ( 20, 20, 43 ), + ( 21, 21, 44 ), + ( 22, 22, 46 ), + ( 23, 23, 47 ), + ( 23, 24, 49 ), + ( 24, 24, 50 ), + ( 25, 25, 52 ), + ( 26, 26, 53 ), + ( 27, 27, 55 ), + ( 28, 28, 56 ), + ( 29, 28, 58 ), + ( 30, 29, 59 ), + ( 31, 30, 61 ), + ( 31, 31, 62 ), + ( 32, 31, 64 ), + ( 33, 32, 65 ), + ( 34, 33, 67 ), + ( 35, 34, 68 ), + ( 36, 34, 70 ), + ( 37, 35, 71 ), + ( 37, 36, 73 ), + ( 38, 37, 74 ), + ( 39, 37, 76 ), + ( 40, 38, 78 ), + ( 41, 39, 79 ), + ( 41, 40, 81 ), + ( 42, 40, 82 ), + ( 43, 41, 84 ), + ( 44, 42, 85 ), + ( 44, 43, 87 ), + ( 45, 43, 89 ), + ( 46, 44, 90 ), + ( 47, 45, 92 ), + ( 47, 46, 94 ), + ( 48, 47, 95 ), + ( 49, 47, 97 ), + ( 49, 48, 98 ), + ( 50, 49, 100 ), + ( 51, 50, 102 ), + ( 51, 50, 103 ), + ( 52, 51, 105 ), + ( 53, 52, 107 ), + ( 53, 53, 108 ), + ( 54, 53, 110 ), + ( 54, 54, 112 ), + ( 55, 55, 113 ), + ( 56, 56, 115 ), + ( 56, 57, 117 ), + ( 57, 57, 118 ), + ( 57, 58, 120 ), + ( 58, 59, 122 ), + ( 58, 60, 123 ), + ( 58, 61, 125 ), + ( 59, 62, 127 ), + ( 59, 62, 128 ), + ( 60, 63, 130 ), + ( 60, 64, 132 ), + ( 60, 65, 133 ), + ( 61, 66, 135 ), + ( 61, 67, 137 ), + ( 61, 68, 138 ), + ( 62, 69, 140 ), + ( 62, 70, 141 ), + ( 62, 71, 143 ), + ( 62, 72, 144 ), + ( 62, 73, 146 ), + ( 62, 73, 147 ), + ( 63, 74, 149 ), + ( 63, 75, 150 ), + ( 63, 76, 151 ), + ( 63, 78, 153 ), + ( 63, 79, 154 ), + ( 63, 80, 155 ), + ( 63, 81, 157 ), + ( 63, 82, 158 ), + ( 63, 83, 159 ), + ( 63, 84, 160 ), + ( 63, 85, 161 ), + ( 63, 86, 162 ), + ( 63, 87, 163 ), + ( 63, 88, 164 ), + ( 63, 89, 165 ), + ( 62, 90, 166 ), + ( 62, 92, 167 ), + ( 62, 93, 168 ), + ( 62, 94, 169 ), + ( 62, 95, 170 ), + ( 62, 96, 171 ), + ( 62, 97, 171 ), + ( 62, 98, 172 ), + ( 62, 99, 173 ), + ( 62, 101, 173 ), + ( 62, 102, 174 ), + ( 62, 103, 175 ), + ( 62, 104, 175 ), + ( 62, 105, 176 ), + ( 62, 106, 176 ), + ( 63, 107, 177 ), + ( 63, 108, 178 ), + ( 63, 110, 178 ), + ( 63, 111, 179 ), + ( 63, 112, 179 ), + ( 63, 113, 180 ), + ( 64, 114, 180 ), + ( 64, 115, 180 ), + ( 64, 116, 181 ), + ( 64, 117, 181 ), + ( 65, 118, 182 ), + ( 65, 120, 182 ), + ( 66, 121, 183 ), + ( 66, 122, 183 ), + ( 66, 123, 183 ), + ( 67, 124, 184 ), + ( 67, 125, 184 ), + ( 68, 126, 185 ), + ( 68, 127, 185 ), + ( 69, 128, 185 ), + ( 69, 129, 186 ), + ( 70, 130, 186 ), + ( 70, 132, 187 ), + ( 71, 133, 187 ), + ( 71, 134, 187 ), + ( 72, 135, 188 ), + ( 73, 136, 188 ), + ( 73, 137, 188 ), + ( 74, 138, 189 ), + ( 75, 139, 189 ), + ( 75, 140, 189 ), + ( 76, 141, 190 ), + ( 77, 142, 190 ), + ( 78, 143, 191 ), + ( 78, 144, 191 ), + ( 79, 145, 191 ), + ( 80, 146, 192 ), + ( 81, 148, 192 ), + ( 81, 149, 192 ), + ( 82, 150, 193 ), + ( 83, 151, 193 ), + ( 84, 152, 194 ), + ( 85, 153, 194 ), + ( 85, 154, 194 ), + ( 86, 155, 195 ), + ( 87, 156, 195 ), + ( 88, 157, 195 ), + ( 89, 158, 196 ), + ( 90, 159, 196 ), + ( 91, 160, 197 ), + ( 92, 161, 197 ), + ( 93, 162, 197 ), + ( 94, 163, 198 ), + ( 95, 164, 198 ), + ( 95, 166, 199 ), + ( 96, 167, 199 ), + ( 97, 168, 199 ), + ( 98, 169, 200 ), + ( 99, 170, 200 ), + ( 100, 171, 201 ), + ( 101, 172, 201 ), + ( 103, 173, 201 ), + ( 104, 174, 202 ), + ( 105, 175, 202 ), + ( 106, 176, 203 ), + ( 107, 177, 203 ), + ( 108, 178, 203 ), + ( 109, 179, 204 ), + ( 110, 180, 204 ), + ( 111, 181, 205 ), + ( 113, 182, 205 ), + ( 114, 184, 206 ), + ( 115, 185, 206 ), + ( 116, 186, 206 ), + ( 117, 187, 207 ), + ( 119, 188, 207 ), + ( 120, 189, 208 ), + ( 121, 190, 208 ), + ( 123, 191, 208 ), + ( 124, 192, 209 ), + ( 125, 193, 209 ), + ( 127, 194, 210 ), + ( 128, 195, 210 ), + ( 130, 196, 211 ), + ( 131, 197, 211 ), + ( 133, 198, 211 ), + ( 134, 199, 212 ), + ( 136, 200, 212 ), + ( 137, 201, 213 ), + ( 139, 202, 213 ), + ( 140, 203, 214 ), + ( 142, 204, 214 ), + ( 144, 205, 215 ), + ( 146, 206, 215 ), + ( 147, 207, 216 ), + ( 149, 208, 216 ), + ( 151, 209, 217 ), + ( 153, 210, 217 ), + ( 154, 211, 218 ), + ( 156, 212, 218 ), + ( 158, 213, 219 ), + ( 160, 214, 220 ), + ( 162, 214, 220 ), + ( 164, 215, 221 ), + ( 166, 216, 222 ), + ( 168, 217, 222 ), + ( 169, 218, 223 ), + ( 171, 219, 224 ), + ( 173, 220, 224 ), + ( 175, 221, 225 ), + ( 177, 222, 226 ), + ( 179, 223, 227 ), + ( 181, 224, 227 ), + ( 183, 225, 228 ), + ( 185, 226, 229 ), + ( 186, 227, 230 ), + ( 188, 228, 231 ), + ( 190, 229, 231 ), + ( 192, 230, 232 ), + ( 194, 230, 233 ), + ( 196, 231, 234 ), + ( 198, 232, 235 ), + ( 200, 233, 236 ), + ( 201, 234, 237 ), + ( 203, 235, 238 ), + ( 205, 236, 239 ), + ( 207, 237, 239 ), + ( 209, 238, 240 ), + ( 211, 239, 241 ), + ( 213, 240, 242 ), + ( 214, 241, 243 ), + ( 216, 242, 244 ), + ( 218, 243, 245 ), + ( 220, 244, 246 ), + ( 222, 245, 247 ), + ( 224, 246, 248 ), + ( 225, 247, 249 ), + ( 227, 249, 250 ), + ( 229, 250, 251 ), + ( 231, 251, 251 ), + ( 232, 252, 252 ), + ( 234, 253, 253 ) + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Inferno.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Inferno.cs new file mode 100644 index 000000000..72c038568 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Inferno.cs @@ -0,0 +1,55 @@ +/* Inferno is a colormap by Nathaniel J. Smith and Stefan van der Walt + * https://bids.github.io/colormap/ + * https://github.com/BIDS/colormap/blob/master/colormaps.py + * + * This colormap is provided under the CC0 license / public domain dedication + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Inferno : ArgbColormapBase + { + public override string Name => "Inferno"; + + public override uint[] Argbs => _argbs; + + private static readonly int[] _rgbs = + { + 00000003, 00000004, 00000006, 00065543, 00065801, 00065803, 00131342, 00131600, + 00197138, 00262932, 00262934, 00328728, 00394267, 00460061, 00525855, 00591393, + 00657187, 00722726, 00854056, 00919594, 00985389, 01050927, 01182258, 01247796, + 01313590, 01444665, 01510203, 01641278, 01706816, 01838147, 01903685, 02034759, + 02100298, 02231116, 02362190, 02493264, 02558802, 02689876, 02820694, 02951768, + 03017306, 03148380, 03279197, 03410271, 03475808, 03606881, 03737954, 03869028, + 03934565, 04065638, 04196710, 04262247, 04393576, 04524649, 04590185, 04721514, + 04852586, 04918379, 05049451, 05180780, 05246316, 05377644, 05443181, 05574509, + 05705581, 05771373, 05902701, 05968238, 06099566, 06230638, 06296430, 06427758, + 06493294, 06624622, 06690158, 06821486, 06952814, 07018350, 07149678, 07215214, + 07346542, 07477613, 07543405, 07674733, 07740269, 07871597, 08002669, 08068460, + 08199532, 08265324, 08396651, 08462187, 08593515, 08724586, 08790378, 08921450, + 08987241, 09118313, 09249641, 09315432, 09446504, 09512295, 09643367, 09774694, + 09840230, 09971557, 10037348, 10168420, 10234211, 10365283, 10496610, 10562401, + 10693473, 10759264, 10890335, 10956127, 11087454, 11218525, 11284316, 11415643, + 11481435, 11612506, 11678297, 11809624, 11875159, 12006486, 12072278, 12203605, + 12269396, 12400467, 12466258, 12532049, 12663376, 12729167, 12860494, 12926285, + 13057612, 13123147, 13188938, 13320265, 13386056, 13451847, 13583430, 13649220, + 13715011, 13780802, 13912129, 13977920, 14043711, 14109502, 14241085, 14306875, + 14372666, 14438457, 14504504, 14570295, 14636086, 14702132, 14833459, 14899250, + 14965297, 15031088, 15096878, 15097389, 15163180, 15229227, 15295018, 15361064, + 15426855, 15492902, 15558693, 15559203, 15625250, 15691041, 15757087, 15757342, + 15823389, 15889436, 15889690, 15955737, 15956248, 16022038, 16088085, 16088596, + 16154642, 16154897, 16220944, 16221454, 16287501, 16287756, 16288267, 16354313, + 16354824, 16355336, 16421127, 16421638, 16422150, 16422662, 16488710, 16489222, + 16489734, 16489991, 16490503, 16491016, 16491530, 16492043, 16492557, 16493070, + 16493584, 16494098, 16494612, 16494870, 16495384, 16495898, 16496412, 16496926, + 16431905, 16432419, 16432933, 16433448, 16368426, 16368940, 16369455, 16304433, + 16304948, 16305463, 16240442, 16240956, 16175935, 16176450, 16111429, 16111944, + 16046923, 16047183, 15982162, 15982678, 15983193, 15918173, 15918688, 15853668, + 15853928, 15854444, 15854960, 15855220, 15855737, 15856253, 15922049, 15922309, + 15988361, 16054157, 16119953, 16186005, 16251801, 16383133, 16448928, 16580260, + }; + + private static readonly uint[] _argbs = _rgbs.Select(rgb => unchecked((uint)(0xFF << 24) | (uint)rgb)).ToArray(); + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Jet.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Jet.cs new file mode 100644 index 000000000..116a481aa --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Jet.cs @@ -0,0 +1,54 @@ +/* The Jet colormap is provided under a MIT license. + * Do not use this colormap for heatmap data! See references: + * https://jakevdp.github.io/blog/2014/10/16/how-bad-is-your-colormap/ + * https://bids.github.io/colormap/ + * https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Jet : ArgbColormapBase + { + public override string Name => "Jet"; + + public override uint[] Argbs => _argbs; + + private static readonly int[] _rgbs = + { + 00000127, 00000132, 00000136, 00000141, 00000145, 00000150, 00000154, 00000159, + 00000163, 00000168, 00000172, 00000177, 00000182, 00000186, 00000191, 00000195, + 00000200, 00000204, 00000209, 00000213, 00000218, 00000222, 00000227, 00000232, + 00000236, 00000241, 00000245, 00000250, 00000254, 00000255, 00000255, 00000255, + 00000255, 00001279, 00002303, 00003327, 00004351, 00005375, 00006399, 00007423, + 00008447, 00009471, 00010495, 00011519, 00012543, 00013567, 00014591, 00015615, + 00016639, 00017663, 00018687, 00019711, 00020735, 00021759, 00022783, 00023807, + 00024831, 00025855, 00026879, 00027903, 00028927, 00029951, 00030975, 00031999, + 00033023, 00034047, 00035071, 00036095, 00037119, 00038143, 00039167, 00040191, + 00041215, 00042239, 00043263, 00044287, 00045311, 00046335, 00047359, 00048383, + 00049407, 00050431, 00051455, 00052479, 00053503, 00054527, 00055551, 00056574, + 00057594, 00058615, 00190708, 00388337, 00585965, 00849130, 01046759, 01244388, + 01441761, 01638365, 01900506, 02097111, 02293716, 02490320, 02752461, 02949066, + 03145671, 03342275, 03604416, 03801021, 03997626, 04194231, 04390835, 04652976, + 04849581, 05046186, 05242790, 05504931, 05701536, 05898141, 06094746, 06291350, + 06553491, 06750096, 06946701, 07143305, 07405446, 07602051, 07798656, 07995261, + 08191865, 08454006, 08650611, 08847216, 09043820, 09305961, 09502566, 09699171, + 09895775, 10157916, 10354521, 10551126, 10747731, 10944335, 11206476, 11403081, + 11599686, 11796290, 12058431, 12255036, 12451641, 12648246, 12844850, 13106991, + 13303596, 13500201, 13696805, 13958946, 14155551, 14352156, 14548760, 14745365, + 15007506, 15204111, 15400716, 15597320, 15858693, 16054274, 16249856, 16445440, + 16706816, 16771328, 16770304, 16769536, 16768512, 16767488, 16766720, 16765696, + 16764672, 16763648, 16762880, 16761856, 16760832, 16760064, 16759040, 16758016, + 16756992, 16756224, 16755200, 16754176, 16753408, 16752384, 16751360, 16750592, + 16749568, 16748544, 16747520, 16746752, 16745728, 16744704, 16743936, 16742912, + 16741888, 16741120, 16740096, 16739072, 16738048, 16737280, 16736256, 16735232, + 16734464, 16733440, 16732416, 16731392, 16730624, 16729600, 16728576, 16727808, + 16726784, 16725760, 16724992, 16723968, 16722944, 16721920, 16721152, 16720128, + 16719104, 16718336, 16717312, 16650752, 16387840, 16059136, 15795968, 15467264, + 15204352, 14876672, 14548992, 14286848, 13959168, 13697024, 13369344, 13107200, + 12779520, 12517376, 12189696, 11927552, 11599872, 11272192, 11010048, 10682368, + 10420224, 10092544, 09830400, 09502720, 09240576, 08912896, 08650752, 08323072, + }; + + private static readonly uint[] _argbs = _rgbs.Select(rgb => unchecked((uint)(0xFF << 24) | (uint)rgb)).ToArray(); + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Magma.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Magma.cs new file mode 100644 index 000000000..91ac4ab0d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Magma.cs @@ -0,0 +1,55 @@ +/* Magma is a colormap by Nathaniel J. Smith and Stefan van der Walt + * https://bids.github.io/colormap/ + * https://github.com/BIDS/colormap/blob/master/colormaps.py + * + * This colormap is provided under the CC0 license / public domain dedication + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Magma : ArgbColormapBase + { + public override string Name => "Magma"; + + public override uint[] Argbs => _argbs; + + private static readonly int[] _rgbs = + { + 00000003, 00000004, 00000006, 00065543, 00065801, 00065803, 00131597, 00131599, + 00197393, 00262931, 00263189, 00328727, 00394521, 00460059, 00525853, 00591647, + 00657186, 00722980, 00788774, 00854568, 00920106, 00985900, 01051695, 01117233, + 01183027, 01314101, 01379896, 01445434, 01511228, 01576767, 01708097, 01773636, + 01839174, 01970249, 02036043, 02101581, 02232656, 02298194, 02429269, 02494807, + 02625881, 02756956, 02822494, 02953312, 03084386, 03149925, 03280999, 03412072, + 03477354, 03608428, 03739502, 03870575, 03936113, 04067186, 04198259, 04329332, + 04394869, 04525942, 04657015, 04722808, 04853881, 04919417, 05050746, 05181819, + 05247611, 05378684, 05444476, 05575549, 05706877, 05772670, 05903742, 05969534, + 06100862, 06166399, 06297727, 06363263, 06494591, 06625920, 06691456, 06822784, + 06888576, 07019648, 07085440, 07216769, 07282305, 07413633, 07544705, 07610497, + 07741825, 07807361, 07938689, 08004225, 08135553, 08266881, 08332417, 08463745, + 08529281, 08660609, 08726145, 08857473, 08988801, 09054337, 09185664, 09251200, + 09382528, 09513600, 09579392, 09710464, 09776256, 09907327, 10038655, 10104191, + 10235519, 10366590, 10432382, 10563454, 10694782, 10760317, 10891645, 10957181, + 11088508, 11219836, 11285371, 11416699, 11547771, 11613562, 11744634, 11875961, + 11941497, 12072824, 12138360, 12269687, 12401015, 12466550, 12597877, 12728949, + 12794740, 12926068, 12991603, 13122930, 13254258, 13319793, 13451120, 13516912, + 13648239, 13714030, 13845101, 13910893, 14042220, 14108011, 14239338, 14305129, + 14436457, 14502248, 14568039, 14699366, 14765158, 14830949, 14962276, 15028323, + 15094114, 15159906, 15225953, 15357280, 15423072, 15489119, 15554911, 15620958, + 15621469, 15687261, 15753309, 15819100, 15885148, 15951196, 15951707, 16017499, + 16083547, 16084059, 16150107, 16150619, 16216411, 16216924, 16282972, 16283484, + 16349532, 16350045, 16350557, 16416606, 16416862, 16417375, 16483424, 16483936, + 16484449, 16484962, 16551011, 16551523, 16552036, 16552549, 16552806, 16618855, + 16619368, 16619881, 16620394, 16620907, 16621420, 16621934, 16622191, 16622704, + 16688753, 16689267, 16689780, 16690293, 16690806, 16691064, 16691577, 16692091, + 16692604, 16693117, 16693631, 16694144, 16694402, 16694915, 16695429, 16695942, + 16696456, 16696969, 16697227, 16697741, 16698254, 16633232, 16633746, 16634259, + 16634517, 16635031, 16635544, 16636058, 16636572, 16637085, 16637343, 16637857, + 16638371, 16573349, 16573862, 16574120, 16574634, 16575148, 16575662, 16576176, + 16576689, 16576947, 16577461, 16577975, 16512953, 16513467, 16513725, 16514239, + }; + + private static readonly uint[] _argbs = _rgbs.Select(rgb => unchecked((uint)(0xFF << 24) | (uint)rgb)).ToArray(); + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Matter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Matter.cs new file mode 100644 index 000000000..65e2c4039 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Matter.cs @@ -0,0 +1,274 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Matter : ByteColormapBase + { + public override string Name => "Matter"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + + private static readonly (byte, byte, byte)[] _rgbs = { + ( 254, 237, 176 ), + ( 253, 236, 175 ), + ( 253, 234, 173 ), + ( 253, 233, 172 ), + ( 253, 232, 171 ), + ( 253, 230, 169 ), + ( 253, 229, 168 ), + ( 253, 227, 167 ), + ( 253, 226, 165 ), + ( 252, 225, 164 ), + ( 252, 223, 163 ), + ( 252, 222, 161 ), + ( 252, 220, 160 ), + ( 252, 219, 159 ), + ( 252, 218, 157 ), + ( 252, 216, 156 ), + ( 251, 215, 155 ), + ( 251, 213, 154 ), + ( 251, 212, 152 ), + ( 251, 211, 151 ), + ( 251, 209, 150 ), + ( 251, 208, 148 ), + ( 251, 207, 147 ), + ( 250, 205, 146 ), + ( 250, 204, 145 ), + ( 250, 202, 144 ), + ( 250, 201, 142 ), + ( 250, 200, 141 ), + ( 250, 198, 140 ), + ( 250, 197, 139 ), + ( 249, 195, 138 ), + ( 249, 194, 136 ), + ( 249, 193, 135 ), + ( 249, 191, 134 ), + ( 249, 190, 133 ), + ( 249, 189, 132 ), + ( 248, 187, 131 ), + ( 248, 186, 130 ), + ( 248, 184, 128 ), + ( 248, 183, 127 ), + ( 248, 182, 126 ), + ( 247, 180, 125 ), + ( 247, 179, 124 ), + ( 247, 178, 123 ), + ( 247, 176, 122 ), + ( 247, 175, 121 ), + ( 246, 174, 120 ), + ( 246, 172, 119 ), + ( 246, 171, 118 ), + ( 246, 169, 117 ), + ( 245, 168, 116 ), + ( 245, 167, 115 ), + ( 245, 165, 114 ), + ( 245, 164, 113 ), + ( 245, 163, 112 ), + ( 244, 161, 111 ), + ( 244, 160, 110 ), + ( 244, 159, 109 ), + ( 244, 157, 108 ), + ( 243, 156, 107 ), + ( 243, 154, 106 ), + ( 243, 153, 105 ), + ( 242, 152, 104 ), + ( 242, 150, 104 ), + ( 242, 149, 103 ), + ( 242, 148, 102 ), + ( 241, 146, 101 ), + ( 241, 145, 100 ), + ( 241, 143, 99 ), + ( 240, 142, 99 ), + ( 240, 141, 98 ), + ( 240, 139, 97 ), + ( 239, 138, 96 ), + ( 239, 137, 96 ), + ( 239, 135, 95 ), + ( 238, 134, 94 ), + ( 238, 133, 94 ), + ( 238, 131, 93 ), + ( 237, 130, 92 ), + ( 237, 129, 92 ), + ( 237, 127, 91 ), + ( 236, 126, 90 ), + ( 236, 124, 90 ), + ( 236, 123, 89 ), + ( 235, 122, 89 ), + ( 235, 120, 88 ), + ( 234, 119, 88 ), + ( 234, 118, 87 ), + ( 233, 116, 87 ), + ( 233, 115, 86 ), + ( 233, 114, 86 ), + ( 232, 112, 86 ), + ( 232, 111, 85 ), + ( 231, 110, 85 ), + ( 231, 108, 85 ), + ( 230, 107, 84 ), + ( 230, 106, 84 ), + ( 229, 104, 84 ), + ( 229, 103, 84 ), + ( 228, 102, 83 ), + ( 227, 100, 83 ), + ( 227, 99, 83 ), + ( 226, 98, 83 ), + ( 226, 96, 83 ), + ( 225, 95, 83 ), + ( 224, 94, 83 ), + ( 224, 93, 83 ), + ( 223, 91, 83 ), + ( 223, 90, 83 ), + ( 222, 89, 83 ), + ( 221, 88, 83 ), + ( 220, 86, 83 ), + ( 220, 85, 83 ), + ( 219, 84, 83 ), + ( 218, 83, 83 ), + ( 217, 81, 83 ), + ( 217, 80, 83 ), + ( 216, 79, 84 ), + ( 215, 78, 84 ), + ( 214, 77, 84 ), + ( 213, 76, 84 ), + ( 213, 75, 84 ), + ( 212, 74, 85 ), + ( 211, 72, 85 ), + ( 210, 71, 85 ), + ( 209, 70, 86 ), + ( 208, 69, 86 ), + ( 207, 68, 86 ), + ( 206, 67, 86 ), + ( 205, 66, 87 ), + ( 204, 65, 87 ), + ( 203, 64, 87 ), + ( 202, 63, 88 ), + ( 201, 62, 88 ), + ( 200, 61, 88 ), + ( 199, 61, 89 ), + ( 198, 60, 89 ), + ( 197, 59, 89 ), + ( 196, 58, 90 ), + ( 195, 57, 90 ), + ( 194, 56, 90 ), + ( 193, 55, 91 ), + ( 192, 54, 91 ), + ( 191, 54, 91 ), + ( 190, 53, 92 ), + ( 189, 52, 92 ), + ( 187, 51, 92 ), + ( 186, 50, 93 ), + ( 185, 50, 93 ), + ( 184, 49, 93 ), + ( 183, 48, 94 ), + ( 182, 47, 94 ), + ( 181, 47, 94 ), + ( 179, 46, 95 ), + ( 178, 45, 95 ), + ( 177, 45, 95 ), + ( 176, 44, 95 ), + ( 175, 43, 96 ), + ( 174, 43, 96 ), + ( 172, 42, 96 ), + ( 171, 41, 96 ), + ( 170, 41, 97 ), + ( 169, 40, 97 ), + ( 167, 40, 97 ), + ( 166, 39, 97 ), + ( 165, 38, 98 ), + ( 164, 38, 98 ), + ( 163, 37, 98 ), + ( 161, 37, 98 ), + ( 160, 36, 98 ), + ( 159, 36, 98 ), + ( 158, 35, 99 ), + ( 156, 35, 99 ), + ( 155, 34, 99 ), + ( 154, 34, 99 ), + ( 153, 34, 99 ), + ( 151, 33, 99 ), + ( 150, 33, 99 ), + ( 149, 32, 99 ), + ( 147, 32, 99 ), + ( 146, 31, 99 ), + ( 145, 31, 99 ), + ( 144, 31, 99 ), + ( 142, 30, 99 ), + ( 141, 30, 99 ), + ( 140, 30, 99 ), + ( 138, 29, 99 ), + ( 137, 29, 99 ), + ( 136, 29, 99 ), + ( 134, 29, 99 ), + ( 133, 28, 99 ), + ( 132, 28, 99 ), + ( 130, 28, 99 ), + ( 129, 28, 99 ), + ( 128, 27, 98 ), + ( 126, 27, 98 ), + ( 125, 27, 98 ), + ( 124, 27, 98 ), + ( 122, 27, 98 ), + ( 121, 26, 97 ), + ( 120, 26, 97 ), + ( 118, 26, 97 ), + ( 117, 26, 97 ), + ( 116, 26, 96 ), + ( 114, 26, 96 ), + ( 113, 25, 96 ), + ( 112, 25, 95 ), + ( 110, 25, 95 ), + ( 109, 25, 94 ), + ( 107, 25, 94 ), + ( 106, 25, 94 ), + ( 105, 25, 93 ), + ( 103, 25, 93 ), + ( 102, 24, 92 ), + ( 101, 24, 92 ), + ( 99, 24, 91 ), + ( 98, 24, 91 ), + ( 97, 24, 90 ), + ( 95, 24, 90 ), + ( 94, 24, 89 ), + ( 93, 23, 88 ), + ( 91, 23, 88 ), + ( 90, 23, 87 ), + ( 89, 23, 87 ), + ( 87, 23, 86 ), + ( 86, 23, 85 ), + ( 85, 23, 85 ), + ( 83, 22, 84 ), + ( 82, 22, 83 ), + ( 81, 22, 83 ), + ( 79, 22, 82 ), + ( 78, 22, 81 ), + ( 77, 21, 81 ), + ( 75, 21, 80 ), + ( 74, 21, 79 ), + ( 73, 21, 78 ), + ( 71, 21, 78 ), + ( 70, 20, 77 ), + ( 69, 20, 76 ), + ( 68, 20, 75 ), + ( 66, 20, 75 ), + ( 65, 19, 74 ), + ( 64, 19, 73 ), + ( 62, 19, 72 ), + ( 61, 19, 71 ), + ( 60, 18, 71 ), + ( 59, 18, 70 ), + ( 57, 18, 69 ), + ( 56, 17, 68 ), + ( 55, 17, 67 ), + ( 54, 17, 66 ), + ( 52, 17, 65 ), + ( 51, 16, 65 ), + ( 50, 16, 64 ), + ( 48, 15, 63 ), + ( 47, 15, 62 ) + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Oxy.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Oxy.cs new file mode 100644 index 000000000..26991594c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Oxy.cs @@ -0,0 +1,275 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Oxy : ByteColormapBase + { + public override string Name => "Oxy"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + + private static readonly (byte, byte, byte)[] _rgbs = { + ( 64, 5, 5 ), + ( 65, 5, 5 ), + ( 67, 6, 6 ), + ( 68, 6, 6 ), + ( 71, 6, 7 ), + ( 72, 6, 7 ), + ( 73, 6, 7 ), + ( 75, 6, 8 ), + ( 77, 7, 8 ), + ( 79, 7, 9 ), + ( 80, 7, 9 ), + ( 81, 7, 9 ), + ( 84, 7, 10 ), + ( 85, 7, 11 ), + ( 87, 7, 11 ), + ( 88, 7, 11 ), + ( 91, 7, 12 ), + ( 92, 7, 12 ), + ( 93, 7, 12 ), + ( 95, 7, 13 ), + ( 98, 7, 13 ), + ( 99, 7, 14 ), + ( 100, 7, 14 ), + ( 102, 7, 14 ), + ( 104, 7, 14 ), + ( 106, 6, 15 ), + ( 107, 6, 15 ), + ( 109, 6, 15 ), + ( 111, 6, 15 ), + ( 113, 6, 15 ), + ( 114, 6, 15 ), + ( 115, 5, 15 ), + ( 118, 5, 15 ), + ( 120, 5, 15 ), + ( 121, 5, 15 ), + ( 122, 5, 15 ), + ( 125, 5, 14 ), + ( 126, 5, 14 ), + ( 127, 6, 13 ), + ( 129, 6, 13 ), + ( 131, 8, 12 ), + ( 132, 9, 12 ), + ( 133, 10, 11 ), + ( 134, 12, 11 ), + ( 136, 14, 10 ), + ( 137, 16, 10 ), + ( 138, 17, 9 ), + ( 139, 19, 9 ), + ( 141, 21, 8 ), + ( 142, 23, 8 ), + ( 143, 24, 8 ), + ( 80, 79, 79 ), + ( 80, 80, 80 ), + ( 81, 81, 80 ), + ( 82, 81, 81 ), + ( 83, 83, 83 ), + ( 84, 84, 83 ), + ( 85, 84, 84 ), + ( 86, 85, 85 ), + ( 87, 87, 86 ), + ( 88, 87, 87 ), + ( 89, 88, 88 ), + ( 89, 89, 88 ), + ( 91, 90, 90 ), + ( 92, 91, 91 ), + ( 92, 92, 91 ), + ( 93, 93, 92 ), + ( 95, 94, 94 ), + ( 95, 95, 94 ), + ( 96, 96, 95 ), + ( 97, 96, 96 ), + ( 98, 98, 97 ), + ( 99, 99, 98 ), + ( 100, 99, 99 ), + ( 101, 100, 100 ), + ( 102, 102, 101 ), + ( 103, 102, 102 ), + ( 104, 103, 103 ), + ( 104, 104, 103 ), + ( 106, 105, 105 ), + ( 107, 106, 106 ), + ( 107, 107, 106 ), + ( 108, 108, 107 ), + ( 110, 109, 109 ), + ( 111, 110, 110 ), + ( 111, 111, 110 ), + ( 112, 112, 111 ), + ( 114, 113, 113 ), + ( 114, 114, 113 ), + ( 115, 115, 114 ), + ( 116, 115, 115 ), + ( 118, 117, 116 ), + ( 118, 118, 117 ), + ( 119, 119, 118 ), + ( 120, 119, 119 ), + ( 121, 121, 120 ), + ( 122, 122, 121 ), + ( 123, 123, 122 ), + ( 124, 123, 123 ), + ( 125, 125, 124 ), + ( 126, 126, 125 ), + ( 127, 127, 126 ), + ( 129, 128, 127 ), + ( 129, 129, 128 ), + ( 130, 130, 129 ), + ( 131, 131, 130 ), + ( 133, 132, 131 ), + ( 133, 133, 132 ), + ( 134, 134, 133 ), + ( 135, 135, 134 ), + ( 137, 136, 135 ), + ( 137, 137, 136 ), + ( 138, 138, 137 ), + ( 139, 139, 138 ), + ( 141, 140, 140 ), + ( 141, 141, 140 ), + ( 142, 142, 141 ), + ( 143, 143, 142 ), + ( 145, 144, 144 ), + ( 146, 145, 144 ), + ( 146, 146, 145 ), + ( 147, 147, 146 ), + ( 149, 149, 148 ), + ( 150, 149, 149 ), + ( 151, 150, 149 ), + ( 151, 151, 150 ), + ( 153, 153, 152 ), + ( 154, 154, 153 ), + ( 155, 154, 154 ), + ( 156, 155, 154 ), + ( 157, 157, 156 ), + ( 158, 158, 157 ), + ( 159, 159, 158 ), + ( 160, 160, 159 ), + ( 162, 161, 160 ), + ( 163, 162, 161 ), + ( 163, 163, 162 ), + ( 164, 164, 163 ), + ( 166, 166, 165 ), + ( 167, 166, 166 ), + ( 168, 167, 167 ), + ( 169, 168, 167 ), + ( 170, 170, 169 ), + ( 171, 171, 170 ), + ( 172, 172, 171 ), + ( 173, 173, 172 ), + ( 175, 174, 174 ), + ( 176, 175, 174 ), + ( 177, 176, 175 ), + ( 177, 177, 176 ), + ( 179, 179, 178 ), + ( 180, 180, 179 ), + ( 181, 181, 180 ), + ( 183, 183, 182 ), + ( 184, 183, 183 ), + ( 185, 184, 183 ), + ( 186, 185, 184 ), + ( 187, 187, 186 ), + ( 188, 188, 187 ), + ( 189, 189, 188 ), + ( 190, 190, 189 ), + ( 192, 192, 191 ), + ( 193, 193, 192 ), + ( 194, 194, 193 ), + ( 195, 195, 194 ), + ( 197, 197, 195 ), + ( 198, 197, 196 ), + ( 199, 198, 197 ), + ( 200, 199, 198 ), + ( 202, 201, 200 ), + ( 203, 202, 201 ), + ( 204, 203, 202 ), + ( 204, 204, 203 ), + ( 206, 206, 205 ), + ( 207, 207, 206 ), + ( 208, 208, 207 ), + ( 209, 209, 208 ), + ( 211, 211, 210 ), + ( 212, 212, 211 ), + ( 213, 213, 212 ), + ( 214, 214, 213 ), + ( 216, 216, 215 ), + ( 217, 217, 216 ), + ( 218, 218, 217 ), + ( 219, 219, 218 ), + ( 221, 221, 220 ), + ( 222, 222, 221 ), + ( 223, 223, 222 ), + ( 224, 224, 223 ), + ( 226, 226, 225 ), + ( 227, 227, 226 ), + ( 228, 228, 227 ), + ( 230, 229, 228 ), + ( 232, 231, 230 ), + ( 233, 232, 231 ), + ( 234, 233, 232 ), + ( 235, 235, 233 ), + ( 237, 237, 235 ), + ( 238, 238, 236 ), + ( 239, 239, 238 ), + ( 240, 240, 239 ), + ( 242, 242, 241 ), + ( 243, 243, 242 ), + ( 244, 244, 243 ), + ( 248, 254, 105 ), + ( 246, 253, 103 ), + ( 245, 252, 100 ), + ( 244, 252, 98 ), + ( 241, 250, 93 ), + ( 240, 249, 90 ), + ( 239, 248, 87 ), + ( 238, 247, 84 ), + ( 236, 245, 78 ), + ( 235, 243, 75 ), + ( 235, 242, 72 ), + ( 234, 241, 69 ), + ( 234, 238, 64 ), + ( 234, 237, 62 ), + ( 234, 235, 61 ), + ( 234, 234, 59 ), + ( 234, 231, 56 ), + ( 233, 230, 55 ), + ( 233, 228, 54 ), + ( 233, 227, 52 ), + ( 233, 224, 50 ), + ( 232, 223, 49 ), + ( 232, 221, 48 ), + ( 232, 220, 48 ), + ( 232, 217, 46 ), + ( 231, 216, 45 ), + ( 231, 215, 44 ), + ( 231, 213, 43 ), + ( 230, 211, 42 ), + ( 230, 209, 41 ), + ( 230, 208, 40 ), + ( 229, 207, 40 ), + ( 229, 204, 38 ), + ( 229, 203, 38 ), + ( 228, 201, 37 ), + ( 228, 200, 37 ), + ( 227, 198, 35 ), + ( 227, 196, 35 ), + ( 227, 195, 34 ), + ( 226, 194, 33 ), + ( 226, 191, 32 ), + ( 225, 190, 32 ), + ( 225, 189, 31 ), + ( 224, 187, 31 ), + ( 224, 185, 30 ), + ( 223, 184, 29 ), + ( 223, 182, 29 ), + ( 223, 181, 28 ), + ( 222, 179, 27 ), + ( 221, 177, 26 ), + ( 221, 176, 26 ), + ( 221, 175, 25 ) + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Phase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Phase.cs new file mode 100644 index 000000000..4880ff5f3 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Phase.cs @@ -0,0 +1,274 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Phase : ByteColormapBase + { + public override string Name => "Phase"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + + private static readonly (byte, byte, byte)[] _rgbs = { + ( 168, 120, 13 ), + ( 169, 119, 15 ), + ( 171, 118, 17 ), + ( 172, 117, 19 ), + ( 174, 116, 20 ), + ( 175, 115, 22 ), + ( 177, 114, 24 ), + ( 178, 113, 25 ), + ( 179, 112, 27 ), + ( 181, 111, 29 ), + ( 182, 110, 30 ), + ( 183, 109, 32 ), + ( 185, 108, 34 ), + ( 186, 107, 35 ), + ( 187, 106, 37 ), + ( 189, 105, 38 ), + ( 190, 104, 40 ), + ( 191, 103, 42 ), + ( 192, 102, 43 ), + ( 193, 101, 45 ), + ( 194, 100, 46 ), + ( 196, 98, 48 ), + ( 197, 97, 50 ), + ( 198, 96, 51 ), + ( 199, 95, 53 ), + ( 200, 94, 55 ), + ( 201, 93, 56 ), + ( 202, 92, 58 ), + ( 203, 90, 60 ), + ( 204, 89, 62 ), + ( 205, 88, 63 ), + ( 206, 87, 65 ), + ( 207, 86, 67 ), + ( 208, 84, 69 ), + ( 208, 83, 71 ), + ( 209, 82, 73 ), + ( 210, 81, 75 ), + ( 211, 79, 77 ), + ( 212, 78, 79 ), + ( 213, 77, 81 ), + ( 213, 75, 83 ), + ( 214, 74, 85 ), + ( 215, 73, 87 ), + ( 216, 71, 90 ), + ( 216, 70, 92 ), + ( 217, 69, 94 ), + ( 217, 67, 97 ), + ( 218, 66, 99 ), + ( 219, 64, 102 ), + ( 219, 63, 104 ), + ( 220, 61, 107 ), + ( 220, 60, 109 ), + ( 221, 58, 112 ), + ( 221, 57, 115 ), + ( 221, 56, 118 ), + ( 222, 54, 120 ), + ( 222, 53, 123 ), + ( 222, 51, 126 ), + ( 222, 50, 129 ), + ( 223, 49, 132 ), + ( 223, 47, 135 ), + ( 223, 46, 138 ), + ( 223, 45, 141 ), + ( 223, 43, 144 ), + ( 223, 42, 147 ), + ( 222, 41, 151 ), + ( 222, 40, 154 ), + ( 222, 40, 157 ), + ( 222, 39, 160 ), + ( 221, 38, 163 ), + ( 221, 38, 166 ), + ( 220, 37, 169 ), + ( 220, 37, 173 ), + ( 219, 37, 176 ), + ( 218, 37, 179 ), + ( 218, 38, 182 ), + ( 217, 38, 185 ), + ( 216, 39, 188 ), + ( 215, 39, 190 ), + ( 214, 40, 193 ), + ( 213, 41, 196 ), + ( 212, 42, 199 ), + ( 211, 43, 201 ), + ( 210, 45, 204 ), + ( 209, 46, 206 ), + ( 208, 47, 208 ), + ( 207, 49, 211 ), + ( 205, 50, 213 ), + ( 204, 52, 215 ), + ( 203, 53, 217 ), + ( 201, 55, 219 ), + ( 200, 57, 221 ), + ( 198, 58, 223 ), + ( 197, 60, 225 ), + ( 195, 62, 226 ), + ( 194, 63, 228 ), + ( 192, 65, 229 ), + ( 190, 67, 231 ), + ( 189, 69, 232 ), + ( 187, 70, 233 ), + ( 185, 72, 235 ), + ( 184, 74, 236 ), + ( 182, 75, 237 ), + ( 180, 77, 238 ), + ( 178, 79, 239 ), + ( 176, 80, 239 ), + ( 174, 82, 240 ), + ( 172, 84, 241 ), + ( 170, 85, 241 ), + ( 169, 87, 242 ), + ( 167, 89, 243 ), + ( 164, 90, 243 ), + ( 162, 92, 243 ), + ( 160, 93, 244 ), + ( 158, 95, 244 ), + ( 156, 96, 244 ), + ( 154, 98, 244 ), + ( 152, 99, 244 ), + ( 149, 101, 244 ), + ( 147, 102, 244 ), + ( 145, 104, 244 ), + ( 143, 105, 244 ), + ( 140, 107, 243 ), + ( 138, 108, 243 ), + ( 135, 109, 243 ), + ( 133, 111, 242 ), + ( 130, 112, 241 ), + ( 128, 113, 241 ), + ( 125, 115, 240 ), + ( 123, 116, 239 ), + ( 120, 117, 239 ), + ( 118, 119, 238 ), + ( 115, 120, 237 ), + ( 112, 121, 236 ), + ( 110, 122, 235 ), + ( 107, 123, 233 ), + ( 104, 124, 232 ), + ( 102, 126, 231 ), + ( 99, 127, 230 ), + ( 96, 128, 228 ), + ( 93, 129, 227 ), + ( 90, 130, 225 ), + ( 88, 131, 223 ), + ( 85, 132, 222 ), + ( 82, 133, 220 ), + ( 79, 134, 218 ), + ( 77, 135, 216 ), + ( 74, 135, 215 ), + ( 71, 136, 213 ), + ( 69, 137, 211 ), + ( 66, 138, 209 ), + ( 64, 138, 207 ), + ( 61, 139, 205 ), + ( 59, 140, 203 ), + ( 56, 140, 201 ), + ( 54, 141, 199 ), + ( 52, 142, 196 ), + ( 50, 142, 194 ), + ( 48, 143, 192 ), + ( 46, 143, 190 ), + ( 44, 144, 188 ), + ( 42, 144, 186 ), + ( 40, 145, 184 ), + ( 39, 145, 182 ), + ( 37, 145, 180 ), + ( 36, 146, 178 ), + ( 35, 146, 176 ), + ( 33, 146, 174 ), + ( 32, 147, 172 ), + ( 31, 147, 170 ), + ( 30, 147, 168 ), + ( 29, 148, 166 ), + ( 28, 148, 164 ), + ( 27, 148, 162 ), + ( 26, 148, 160 ), + ( 25, 149, 158 ), + ( 25, 149, 156 ), + ( 24, 149, 154 ), + ( 23, 149, 152 ), + ( 22, 150, 150 ), + ( 21, 150, 148 ), + ( 20, 150, 146 ), + ( 20, 150, 144 ), + ( 19, 151, 142 ), + ( 18, 151, 140 ), + ( 17, 151, 138 ), + ( 16, 151, 136 ), + ( 15, 151, 134 ), + ( 14, 152, 132 ), + ( 13, 152, 130 ), + ( 13, 152, 128 ), + ( 12, 152, 126 ), + ( 12, 152, 124 ), + ( 11, 153, 121 ), + ( 11, 153, 119 ), + ( 11, 153, 117 ), + ( 12, 153, 115 ), + ( 13, 153, 112 ), + ( 14, 153, 110 ), + ( 15, 154, 107 ), + ( 17, 154, 105 ), + ( 19, 154, 102 ), + ( 21, 154, 99 ), + ( 23, 154, 97 ), + ( 25, 154, 94 ), + ( 28, 154, 91 ), + ( 31, 154, 88 ), + ( 33, 154, 85 ), + ( 36, 154, 82 ), + ( 39, 154, 79 ), + ( 43, 154, 76 ), + ( 46, 154, 73 ), + ( 49, 153, 70 ), + ( 53, 153, 67 ), + ( 56, 153, 64 ), + ( 60, 153, 60 ), + ( 64, 152, 57 ), + ( 67, 152, 54 ), + ( 71, 151, 50 ), + ( 75, 151, 47 ), + ( 79, 150, 44 ), + ( 83, 150, 41 ), + ( 86, 149, 38 ), + ( 90, 148, 35 ), + ( 94, 148, 32 ), + ( 97, 147, 30 ), + ( 101, 146, 27 ), + ( 104, 145, 25 ), + ( 107, 144, 23 ), + ( 111, 144, 22 ), + ( 114, 143, 20 ), + ( 116, 142, 19 ), + ( 119, 141, 18 ), + ( 122, 140, 17 ), + ( 125, 139, 16 ), + ( 127, 139, 15 ), + ( 130, 138, 15 ), + ( 132, 137, 14 ), + ( 134, 136, 14 ), + ( 136, 135, 14 ), + ( 139, 134, 13 ), + ( 141, 133, 13 ), + ( 143, 132, 13 ), + ( 145, 131, 13 ), + ( 147, 131, 13 ), + ( 149, 130, 13 ), + ( 151, 129, 13 ), + ( 153, 128, 13 ), + ( 155, 127, 13 ), + ( 157, 126, 13 ), + ( 159, 125, 13 ), + ( 161, 124, 13 ), + ( 162, 123, 13 ), + ( 164, 122, 13 ), + ( 166, 121, 13 ), + ( 168, 120, 13 ) + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Plasma.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Plasma.cs new file mode 100644 index 000000000..b35101f55 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Plasma.cs @@ -0,0 +1,55 @@ +/* Plasma is a colormap by Nathaniel J. Smith and Stefan van der Walt + * https://bids.github.io/colormap/ + * https://github.com/BIDS/colormap/blob/master/colormaps.py + * + * This colormap is provided under the CC0 license / public domain dedication + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Plasma : ArgbColormapBase + { + public override string Name => "Plasma"; + + public override uint[] Argbs => _argbs; + + private static readonly uint[] _rgbs = + { + 00788358, 01050503, 01246857, 01377930, 01574539, 01771148, 01902221, 02033038, + 02164111, 02295184, 02426257, 02557330, 02688403, 02819476, 02950292, 03081365, + 03212438, 03343511, 03409048, 03540120, 03671193, 03802266, 03867546, 03998619, + 04129692, 04195228, 04326301, 04457374, 04522910, 04653727, 04784799, 04850336, + 04981409, 05112481, 05178018, 05308834, 05374371, 05505443, 05636515, 05702052, + 05833124, 05898405, 06029477, 06160549, 06226086, 06357158, 06422694, 06553767, + 06619303, 06750375, 06815911, 06946983, 07078056, 07143592, 07274664, 07340200, + 07471272, 07536808, 07667880, 07733672, 07864744, 07930280, 08061608, 08127143, + 08258471, 08324007, 08455335, 08520871, 08652198, 08717990, 08783782, 08914853, + 08980645, 09111972, 09177764, 09309348, 09375139, 09440931, 09572258, 09638049, + 09769377, 09835168, 09900960, 10032287, 10098078, 10164126, 10295453, 10361244, + 10427035, 10492827, 10624154, 10689945, 10755736, 10821527, 10953111, 11018902, + 11084693, 11150484, 11281811, 11347602, 11413393, 11479184, 11545231, 11611023, + 11676814, 11808141, 11873932, 11939723, 12005514, 12071561, 12137352, 12203143, + 12268934, 12334725, 12400516, 12466307, 12532098, 12598145, 12663936, 12729728, + 12795519, 12861310, 12927101, 12992892, 13058683, 13124730, 13190521, 13256312, + 13322103, 13387894, 13453685, 13519477, 13585268, 13651315, 13717106, 13717361, + 13783152, 13848943, 13914734, 13980525, 14046573, 14112364, 14112619, 14178410, + 14244201, 14309992, 14375783, 14441830, 14442086, 14507877, 14573668, 14639459, + 14639714, 14705761, 14771552, 14837344, 14903135, 14903390, 14969437, 15035228, + 15035483, 15101274, 15167066, 15233113, 15233368, 15299159, 15364950, 15365205, + 15431252, 15497044, 15497299, 15563090, 15563601, 15629392, 15695183, 15695438, + 15761485, 15761741, 15827532, 15893579, 15893834, 15959625, 15959880, 16025927, + 16026183, 16091974, 16092485, 16158276, 16158531, 16159042, 16224833, 16225089, + 16291136, 16291391, 16291902, 16357693, 16357948, 16423995, 16424250, 16424762, + 16425017, 16491064, 16491319, 16491574, 16557621, 16557877, 16558388, 16558643, + 16559154, 16559409, 16625457, 16625712, 16626223, 16626478, 16626989, 16627245, + 16627756, 16628011, 16628523, 16628778, 16629289, 16629801, 16630056, 16630568, + 16630823, 16631334, 16566054, 16566566, 16567077, 16567333, 16567845, 16502820, + 16503076, 16503588, 16438564, 16438820, 16439332, 16374052, 16374564, 16309540, + 16310052, 16244772, 16245285, 16180261, 16180517, 16115494, 16116006, 16050726, + 15985702, 15986214, 15921190, 15921446, 15856422, 15791397, 15791651, 15726625, + }; + + private static readonly uint[] _argbs = _rgbs.Select(rgb => unchecked((uint)(0xFF << 24) | rgb)).ToArray(); + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Rain.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Rain.cs new file mode 100644 index 000000000..5f1ef2297 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Rain.cs @@ -0,0 +1,274 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Rain : ByteColormapBase + { + public override string Name => "Rain"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + + private static readonly (byte, byte, byte)[] _rgbs = { + ( 238, 237, 243 ), + ( 238, 236, 241 ), + ( 237, 235, 240 ), + ( 236, 234, 238 ), + ( 235, 233, 236 ), + ( 235, 232, 235 ), + ( 234, 231, 233 ), + ( 233, 230, 232 ), + ( 232, 229, 230 ), + ( 232, 228, 229 ), + ( 231, 227, 227 ), + ( 230, 226, 226 ), + ( 229, 225, 224 ), + ( 228, 223, 223 ), + ( 228, 222, 221 ), + ( 227, 221, 220 ), + ( 227, 220, 218 ), + ( 226, 219, 216 ), + ( 226, 218, 214 ), + ( 225, 217, 212 ), + ( 224, 216, 211 ), + ( 224, 215, 209 ), + ( 223, 214, 207 ), + ( 223, 213, 205 ), + ( 222, 212, 203 ), + ( 222, 211, 201 ), + ( 221, 209, 199 ), + ( 221, 208, 197 ), + ( 220, 207, 195 ), + ( 220, 206, 193 ), + ( 219, 205, 191 ), + ( 219, 204, 190 ), + ( 219, 203, 188 ), + ( 218, 202, 186 ), + ( 218, 201, 184 ), + ( 217, 200, 182 ), + ( 216, 199, 180 ), + ( 216, 198, 178 ), + ( 215, 197, 176 ), + ( 215, 196, 174 ), + ( 214, 195, 172 ), + ( 213, 194, 170 ), + ( 213, 193, 168 ), + ( 212, 192, 166 ), + ( 211, 191, 164 ), + ( 210, 191, 162 ), + ( 209, 190, 160 ), + ( 208, 189, 158 ), + ( 207, 188, 156 ), + ( 205, 188, 155 ), + ( 204, 187, 153 ), + ( 203, 186, 152 ), + ( 201, 186, 150 ), + ( 200, 185, 149 ), + ( 198, 185, 148 ), + ( 196, 184, 146 ), + ( 195, 183, 145 ), + ( 193, 183, 144 ), + ( 192, 182, 143 ), + ( 190, 182, 142 ), + ( 188, 181, 141 ), + ( 186, 181, 141 ), + ( 185, 180, 140 ), + ( 183, 179, 139 ), + ( 181, 179, 138 ), + ( 180, 178, 137 ), + ( 178, 178, 137 ), + ( 176, 177, 136 ), + ( 174, 177, 135 ), + ( 173, 176, 135 ), + ( 171, 176, 134 ), + ( 169, 175, 133 ), + ( 168, 174, 133 ), + ( 166, 174, 132 ), + ( 164, 173, 132 ), + ( 162, 173, 131 ), + ( 161, 172, 130 ), + ( 159, 172, 130 ), + ( 157, 171, 129 ), + ( 156, 170, 129 ), + ( 154, 170, 128 ), + ( 152, 169, 128 ), + ( 150, 169, 127 ), + ( 149, 168, 126 ), + ( 147, 168, 126 ), + ( 145, 167, 125 ), + ( 144, 167, 125 ), + ( 142, 166, 124 ), + ( 140, 165, 124 ), + ( 138, 165, 123 ), + ( 137, 164, 123 ), + ( 135, 164, 122 ), + ( 133, 163, 122 ), + ( 131, 163, 121 ), + ( 130, 162, 120 ), + ( 128, 161, 120 ), + ( 126, 161, 119 ), + ( 124, 160, 119 ), + ( 122, 160, 118 ), + ( 121, 159, 118 ), + ( 119, 159, 117 ), + ( 117, 158, 117 ), + ( 115, 157, 117 ), + ( 113, 157, 116 ), + ( 111, 156, 116 ), + ( 109, 156, 115 ), + ( 107, 155, 115 ), + ( 105, 155, 114 ), + ( 103, 154, 114 ), + ( 101, 154, 114 ), + ( 100, 153, 113 ), + ( 97, 152, 113 ), + ( 95, 152, 113 ), + ( 93, 151, 112 ), + ( 91, 151, 112 ), + ( 89, 150, 112 ), + ( 87, 149, 111 ), + ( 85, 149, 111 ), + ( 83, 148, 111 ), + ( 81, 148, 111 ), + ( 79, 147, 110 ), + ( 76, 147, 110 ), + ( 74, 146, 110 ), + ( 72, 145, 110 ), + ( 70, 145, 110 ), + ( 67, 144, 110 ), + ( 65, 143, 110 ), + ( 63, 143, 110 ), + ( 61, 142, 110 ), + ( 58, 141, 109 ), + ( 56, 141, 109 ), + ( 54, 140, 109 ), + ( 52, 139, 109 ), + ( 49, 139, 110 ), + ( 47, 138, 110 ), + ( 45, 137, 110 ), + ( 43, 137, 110 ), + ( 41, 136, 110 ), + ( 38, 135, 110 ), + ( 36, 134, 110 ), + ( 34, 134, 110 ), + ( 32, 133, 110 ), + ( 30, 132, 110 ), + ( 28, 131, 110 ), + ( 27, 130, 110 ), + ( 25, 129, 110 ), + ( 23, 129, 110 ), + ( 21, 128, 110 ), + ( 20, 127, 110 ), + ( 18, 126, 110 ), + ( 17, 125, 110 ), + ( 15, 124, 110 ), + ( 14, 124, 110 ), + ( 12, 123, 110 ), + ( 11, 122, 110 ), + ( 10, 121, 110 ), + ( 9, 120, 110 ), + ( 8, 119, 110 ), + ( 7, 118, 110 ), + ( 6, 117, 110 ), + ( 6, 116, 110 ), + ( 5, 116, 110 ), + ( 5, 115, 110 ), + ( 4, 114, 110 ), + ( 4, 113, 110 ), + ( 4, 112, 109 ), + ( 3, 111, 109 ), + ( 3, 110, 109 ), + ( 3, 109, 109 ), + ( 3, 108, 109 ), + ( 4, 107, 109 ), + ( 4, 107, 109 ), + ( 4, 106, 108 ), + ( 4, 105, 108 ), + ( 5, 104, 108 ), + ( 5, 103, 108 ), + ( 6, 102, 108 ), + ( 7, 101, 107 ), + ( 7, 100, 107 ), + ( 8, 99, 107 ), + ( 9, 98, 107 ), + ( 10, 97, 106 ), + ( 11, 96, 106 ), + ( 12, 95, 106 ), + ( 13, 95, 105 ), + ( 14, 94, 105 ), + ( 15, 93, 105 ), + ( 16, 92, 104 ), + ( 17, 91, 104 ), + ( 18, 90, 103 ), + ( 19, 89, 103 ), + ( 20, 88, 103 ), + ( 21, 87, 102 ), + ( 22, 86, 102 ), + ( 22, 85, 101 ), + ( 23, 84, 101 ), + ( 24, 83, 100 ), + ( 25, 82, 100 ), + ( 26, 81, 99 ), + ( 26, 80, 99 ), + ( 27, 79, 98 ), + ( 28, 78, 97 ), + ( 28, 77, 97 ), + ( 29, 76, 96 ), + ( 30, 75, 95 ), + ( 30, 74, 95 ), + ( 31, 73, 94 ), + ( 31, 72, 93 ), + ( 32, 72, 93 ), + ( 33, 71, 92 ), + ( 33, 70, 91 ), + ( 33, 69, 90 ), + ( 34, 68, 90 ), + ( 34, 67, 89 ), + ( 35, 66, 88 ), + ( 35, 65, 87 ), + ( 35, 64, 86 ), + ( 36, 63, 86 ), + ( 36, 62, 85 ), + ( 36, 61, 84 ), + ( 36, 60, 83 ), + ( 36, 59, 82 ), + ( 37, 58, 81 ), + ( 37, 57, 81 ), + ( 37, 56, 80 ), + ( 37, 55, 79 ), + ( 37, 55, 78 ), + ( 37, 54, 77 ), + ( 37, 53, 76 ), + ( 37, 52, 76 ), + ( 37, 51, 75 ), + ( 37, 50, 74 ), + ( 37, 49, 73 ), + ( 37, 48, 72 ), + ( 37, 47, 72 ), + ( 37, 46, 71 ), + ( 37, 45, 70 ), + ( 37, 44, 69 ), + ( 37, 43, 69 ), + ( 37, 42, 68 ), + ( 36, 41, 67 ), + ( 36, 40, 66 ), + ( 36, 39, 66 ), + ( 36, 39, 65 ), + ( 36, 38, 64 ), + ( 36, 37, 63 ), + ( 35, 36, 63 ), + ( 35, 35, 62 ), + ( 35, 34, 61 ), + ( 35, 33, 61 ), + ( 35, 32, 60 ), + ( 34, 31, 59 ), + ( 34, 30, 58 ), + ( 34, 29, 58 ), + ( 34, 28, 57 ), + ( 34, 27, 56 ) + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Solar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Solar.cs new file mode 100644 index 000000000..95040abf8 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Solar.cs @@ -0,0 +1,274 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Solar : ByteColormapBase + { + public override string Name => "Solar"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + + private static readonly (byte, byte, byte)[] _rgbs = { + ( 51, 20, 24 ), + ( 53, 20, 24 ), + ( 54, 21, 25 ), + ( 55, 21, 25 ), + ( 56, 21, 26 ), + ( 58, 22, 26 ), + ( 59, 22, 27 ), + ( 60, 23, 27 ), + ( 61, 23, 28 ), + ( 62, 24, 28 ), + ( 64, 24, 29 ), + ( 65, 24, 29 ), + ( 66, 25, 29 ), + ( 67, 25, 30 ), + ( 69, 26, 30 ), + ( 70, 26, 31 ), + ( 71, 26, 31 ), + ( 72, 27, 31 ), + ( 74, 27, 32 ), + ( 75, 27, 32 ), + ( 76, 28, 32 ), + ( 77, 28, 33 ), + ( 79, 28, 33 ), + ( 80, 29, 33 ), + ( 81, 29, 34 ), + ( 82, 30, 34 ), + ( 84, 30, 34 ), + ( 85, 30, 34 ), + ( 86, 31, 35 ), + ( 87, 31, 35 ), + ( 89, 31, 35 ), + ( 90, 32, 35 ), + ( 91, 32, 35 ), + ( 92, 32, 36 ), + ( 94, 33, 36 ), + ( 95, 33, 36 ), + ( 96, 33, 36 ), + ( 97, 34, 36 ), + ( 99, 34, 36 ), + ( 100, 34, 36 ), + ( 101, 35, 36 ), + ( 102, 35, 37 ), + ( 104, 35, 37 ), + ( 105, 36, 37 ), + ( 106, 36, 37 ), + ( 107, 36, 37 ), + ( 109, 37, 37 ), + ( 110, 37, 37 ), + ( 111, 37, 37 ), + ( 112, 38, 37 ), + ( 114, 38, 37 ), + ( 115, 39, 36 ), + ( 116, 39, 36 ), + ( 117, 39, 36 ), + ( 119, 40, 36 ), + ( 120, 40, 36 ), + ( 121, 41, 36 ), + ( 122, 41, 36 ), + ( 123, 42, 36 ), + ( 124, 42, 35 ), + ( 126, 43, 35 ), + ( 127, 43, 35 ), + ( 128, 44, 35 ), + ( 129, 44, 34 ), + ( 130, 45, 34 ), + ( 131, 45, 34 ), + ( 132, 46, 34 ), + ( 133, 46, 33 ), + ( 135, 47, 33 ), + ( 136, 48, 33 ), + ( 137, 48, 33 ), + ( 138, 49, 32 ), + ( 139, 49, 32 ), + ( 140, 50, 32 ), + ( 141, 51, 31 ), + ( 142, 52, 31 ), + ( 143, 52, 31 ), + ( 144, 53, 30 ), + ( 145, 54, 30 ), + ( 146, 54, 30 ), + ( 147, 55, 29 ), + ( 147, 56, 29 ), + ( 148, 57, 29 ), + ( 149, 58, 29 ), + ( 150, 58, 28 ), + ( 151, 59, 28 ), + ( 152, 60, 28 ), + ( 153, 61, 27 ), + ( 154, 62, 27 ), + ( 154, 63, 27 ), + ( 155, 64, 26 ), + ( 156, 64, 26 ), + ( 157, 65, 26 ), + ( 158, 66, 26 ), + ( 159, 67, 25 ), + ( 159, 68, 25 ), + ( 160, 69, 25 ), + ( 161, 70, 25 ), + ( 162, 71, 24 ), + ( 163, 72, 24 ), + ( 163, 73, 24 ), + ( 164, 74, 24 ), + ( 165, 74, 23 ), + ( 166, 75, 23 ), + ( 166, 76, 23 ), + ( 167, 77, 23 ), + ( 168, 78, 22 ), + ( 168, 79, 22 ), + ( 169, 80, 22 ), + ( 170, 81, 22 ), + ( 171, 82, 22 ), + ( 171, 83, 21 ), + ( 172, 84, 21 ), + ( 173, 85, 21 ), + ( 173, 86, 21 ), + ( 174, 87, 21 ), + ( 175, 88, 20 ), + ( 175, 89, 20 ), + ( 176, 90, 20 ), + ( 177, 91, 20 ), + ( 177, 92, 20 ), + ( 178, 93, 20 ), + ( 178, 94, 20 ), + ( 179, 95, 20 ), + ( 180, 96, 19 ), + ( 180, 97, 19 ), + ( 181, 98, 19 ), + ( 182, 99, 19 ), + ( 182, 100, 19 ), + ( 183, 101, 19 ), + ( 183, 102, 19 ), + ( 184, 104, 19 ), + ( 184, 105, 19 ), + ( 185, 106, 19 ), + ( 186, 107, 19 ), + ( 186, 108, 19 ), + ( 187, 109, 19 ), + ( 187, 110, 19 ), + ( 188, 111, 19 ), + ( 188, 112, 19 ), + ( 189, 113, 19 ), + ( 190, 114, 19 ), + ( 190, 115, 19 ), + ( 191, 116, 19 ), + ( 191, 117, 19 ), + ( 192, 118, 19 ), + ( 192, 119, 20 ), + ( 193, 121, 20 ), + ( 193, 122, 20 ), + ( 194, 123, 20 ), + ( 194, 124, 20 ), + ( 195, 125, 20 ), + ( 195, 126, 21 ), + ( 196, 127, 21 ), + ( 196, 128, 21 ), + ( 197, 129, 21 ), + ( 197, 130, 21 ), + ( 198, 132, 22 ), + ( 198, 133, 22 ), + ( 199, 134, 22 ), + ( 199, 135, 22 ), + ( 199, 136, 23 ), + ( 200, 137, 23 ), + ( 200, 138, 23 ), + ( 201, 139, 24 ), + ( 201, 140, 24 ), + ( 202, 142, 24 ), + ( 202, 143, 25 ), + ( 203, 144, 25 ), + ( 203, 145, 25 ), + ( 203, 146, 26 ), + ( 204, 147, 26 ), + ( 204, 148, 26 ), + ( 205, 150, 27 ), + ( 205, 151, 27 ), + ( 206, 152, 28 ), + ( 206, 153, 28 ), + ( 206, 154, 28 ), + ( 207, 155, 29 ), + ( 207, 156, 29 ), + ( 208, 158, 30 ), + ( 208, 159, 30 ), + ( 208, 160, 31 ), + ( 209, 161, 31 ), + ( 209, 162, 32 ), + ( 209, 164, 32 ), + ( 210, 165, 32 ), + ( 210, 166, 33 ), + ( 211, 167, 33 ), + ( 211, 168, 34 ), + ( 211, 169, 34 ), + ( 212, 171, 35 ), + ( 212, 172, 36 ), + ( 212, 173, 36 ), + ( 213, 174, 37 ), + ( 213, 175, 37 ), + ( 213, 177, 38 ), + ( 214, 178, 38 ), + ( 214, 179, 39 ), + ( 214, 180, 39 ), + ( 215, 181, 40 ), + ( 215, 183, 40 ), + ( 215, 184, 41 ), + ( 215, 185, 42 ), + ( 216, 186, 42 ), + ( 216, 188, 43 ), + ( 216, 189, 43 ), + ( 217, 190, 44 ), + ( 217, 191, 44 ), + ( 217, 193, 45 ), + ( 217, 194, 46 ), + ( 218, 195, 46 ), + ( 218, 196, 47 ), + ( 218, 198, 47 ), + ( 218, 199, 48 ), + ( 219, 200, 49 ), + ( 219, 201, 49 ), + ( 219, 203, 50 ), + ( 219, 204, 50 ), + ( 220, 205, 51 ), + ( 220, 206, 52 ), + ( 220, 208, 52 ), + ( 220, 209, 53 ), + ( 221, 210, 54 ), + ( 221, 212, 54 ), + ( 221, 213, 55 ), + ( 221, 214, 55 ), + ( 221, 215, 56 ), + ( 222, 217, 57 ), + ( 222, 218, 57 ), + ( 222, 219, 58 ), + ( 222, 221, 59 ), + ( 222, 222, 59 ), + ( 222, 223, 60 ), + ( 223, 225, 61 ), + ( 223, 226, 61 ), + ( 223, 227, 62 ), + ( 223, 229, 63 ), + ( 223, 230, 63 ), + ( 223, 231, 64 ), + ( 223, 233, 65 ), + ( 224, 234, 65 ), + ( 224, 235, 66 ), + ( 224, 237, 67 ), + ( 224, 238, 67 ), + ( 224, 240, 68 ), + ( 224, 241, 69 ), + ( 224, 242, 69 ), + ( 224, 244, 70 ), + ( 224, 245, 71 ), + ( 224, 246, 71 ), + ( 224, 248, 72 ), + ( 224, 249, 73 ), + ( 224, 251, 73 ), + ( 225, 252, 74 ), + ( 225, 253, 75 ) + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Speed.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Speed.cs new file mode 100644 index 000000000..f804df963 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Speed.cs @@ -0,0 +1,275 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Speed : ByteColormapBase + { + public override string Name => "Speed"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + + private static readonly (byte, byte, byte)[] _rgbs = { + ( 255, 253, 205 ), + ( 254, 252, 203 ), + ( 254, 250, 201 ), + ( 253, 249, 199 ), + ( 252, 248, 197 ), + ( 252, 247, 194 ), + ( 251, 246, 192 ), + ( 250, 244, 190 ), + ( 249, 243, 188 ), + ( 249, 242, 186 ), + ( 248, 241, 184 ), + ( 247, 240, 182 ), + ( 247, 238, 180 ), + ( 246, 237, 177 ), + ( 246, 236, 175 ), + ( 245, 235, 173 ), + ( 244, 234, 171 ), + ( 243, 233, 169 ), + ( 243, 231, 167 ), + ( 242, 230, 165 ), + ( 241, 229, 162 ), + ( 241, 228, 160 ), + ( 240, 227, 158 ), + ( 239, 226, 156 ), + ( 239, 225, 154 ), + ( 238, 223, 152 ), + ( 237, 222, 150 ), + ( 237, 221, 147 ), + ( 236, 220, 145 ), + ( 235, 219, 143 ), + ( 234, 218, 141 ), + ( 234, 217, 139 ), + ( 233, 216, 137 ), + ( 232, 215, 134 ), + ( 231, 214, 132 ), + ( 231, 213, 130 ), + ( 230, 212, 128 ), + ( 229, 211, 126 ), + ( 228, 210, 123 ), + ( 227, 208, 121 ), + ( 227, 207, 119 ), + ( 226, 206, 117 ), + ( 225, 205, 115 ), + ( 224, 205, 113 ), + ( 223, 204, 110 ), + ( 222, 203, 108 ), + ( 221, 202, 106 ), + ( 220, 201, 104 ), + ( 219, 200, 102 ), + ( 218, 199, 100 ), + ( 217, 198, 97 ), + ( 216, 197, 95 ), + ( 215, 196, 93 ), + ( 214, 195, 91 ), + ( 213, 194, 89 ), + ( 212, 193, 87 ), + ( 211, 193, 85 ), + ( 210, 192, 83 ), + ( 209, 191, 81 ), + ( 208, 190, 79 ), + ( 206, 189, 76 ), + ( 205, 189, 74 ), + ( 204, 188, 72 ), + ( 203, 187, 70 ), + ( 201, 186, 69 ), + ( 200, 185, 67 ), + ( 199, 185, 65 ), + ( 197, 184, 63 ), + ( 196, 183, 61 ), + ( 195, 183, 59 ), + ( 193, 182, 57 ), + ( 192, 181, 55 ), + ( 190, 180, 54 ), + ( 189, 180, 52 ), + ( 187, 179, 50 ), + ( 186, 178, 48 ), + ( 184, 178, 47 ), + ( 183, 177, 45 ), + ( 181, 176, 43 ), + ( 180, 176, 42 ), + ( 178, 175, 40 ), + ( 177, 174, 39 ), + ( 175, 174, 37 ), + ( 173, 173, 35 ), + ( 172, 173, 34 ), + ( 170, 172, 32 ), + ( 169, 171, 31 ), + ( 167, 171, 30 ), + ( 165, 170, 28 ), + ( 164, 169, 27 ), + ( 162, 169, 25 ), + ( 160, 168, 24 ), + ( 159, 168, 23 ), + ( 157, 167, 21 ), + ( 155, 166, 20 ), + ( 154, 166, 19 ), + ( 152, 165, 18 ), + ( 150, 165, 16 ), + ( 149, 164, 15 ), + ( 147, 163, 14 ), + ( 145, 163, 13 ), + ( 143, 162, 12 ), + ( 142, 162, 11 ), + ( 140, 161, 10 ), + ( 138, 160, 9 ), + ( 136, 160, 8 ), + ( 135, 159, 8 ), + ( 133, 159, 7 ), + ( 131, 158, 7 ), + ( 129, 157, 6 ), + ( 128, 157, 6 ), + ( 126, 156, 6 ), + ( 124, 156, 6 ), + ( 122, 155, 6 ), + ( 121, 154, 6 ), + ( 119, 154, 6 ), + ( 117, 153, 6 ), + ( 115, 153, 6 ), + ( 113, 152, 6 ), + ( 112, 151, 7 ), + ( 110, 151, 7 ), + ( 108, 150, 7 ), + ( 106, 149, 8 ), + ( 104, 149, 9 ), + ( 102, 148, 9 ), + ( 101, 148, 10 ), + ( 99, 147, 11 ), + ( 97, 146, 11 ), + ( 95, 146, 12 ), + ( 93, 145, 13 ), + ( 92, 144, 14 ), + ( 90, 144, 15 ), + ( 88, 143, 15 ), + ( 86, 142, 16 ), + ( 84, 142, 17 ), + ( 82, 141, 18 ), + ( 81, 140, 18 ), + ( 79, 140, 19 ), + ( 77, 139, 20 ), + ( 75, 138, 21 ), + ( 73, 138, 22 ), + ( 72, 137, 22 ), + ( 70, 136, 23 ), + ( 68, 136, 24 ), + ( 66, 135, 25 ), + ( 64, 134, 25 ), + ( 63, 133, 26 ), + ( 61, 133, 27 ), + ( 59, 132, 28 ), + ( 57, 131, 28 ), + ( 56, 131, 29 ), + ( 54, 130, 30 ), + ( 52, 129, 30 ), + ( 50, 128, 31 ), + ( 49, 127, 32 ), + ( 47, 127, 32 ), + ( 45, 126, 33 ), + ( 44, 125, 33 ), + ( 42, 124, 34 ), + ( 40, 124, 35 ), + ( 39, 123, 35 ), + ( 37, 122, 36 ), + ( 36, 121, 36 ), + ( 34, 120, 37 ), + ( 33, 120, 37 ), + ( 31, 119, 38 ), + ( 30, 118, 38 ), + ( 28, 117, 39 ), + ( 27, 116, 39 ), + ( 26, 115, 39 ), + ( 24, 115, 40 ), + ( 23, 114, 40 ), + ( 22, 113, 41 ), + ( 21, 112, 41 ), + ( 19, 111, 41 ), + ( 18, 110, 42 ), + ( 17, 109, 42 ), + ( 16, 108, 42 ), + ( 15, 108, 43 ), + ( 15, 107, 43 ), + ( 14, 106, 43 ), + ( 13, 105, 43 ), + ( 13, 104, 43 ), + ( 12, 103, 44 ), + ( 12, 102, 44 ), + ( 11, 101, 44 ), + ( 11, 100, 44 ), + ( 11, 99, 44 ), + ( 11, 99, 44 ), + ( 11, 98, 45 ), + ( 11, 97, 45 ), + ( 11, 96, 45 ), + ( 11, 95, 45 ), + ( 11, 94, 45 ), + ( 12, 93, 45 ), + ( 12, 92, 45 ), + ( 12, 91, 45 ), + ( 13, 90, 45 ), + ( 13, 89, 45 ), + ( 14, 88, 45 ), + ( 14, 87, 45 ), + ( 15, 86, 44 ), + ( 15, 85, 44 ), + ( 16, 84, 44 ), + ( 16, 84, 44 ), + ( 16, 83, 44 ), + ( 17, 82, 44 ), + ( 17, 81, 44 ), + ( 18, 80, 43 ), + ( 18, 79, 43 ), + ( 19, 78, 43 ), + ( 19, 77, 43 ), + ( 20, 76, 42 ), + ( 20, 75, 42 ), + ( 20, 74, 42 ), + ( 21, 73, 42 ), + ( 21, 72, 41 ), + ( 22, 71, 41 ), + ( 22, 70, 41 ), + ( 22, 69, 40 ), + ( 23, 68, 40 ), + ( 23, 67, 39 ), + ( 23, 66, 39 ), + ( 23, 65, 39 ), + ( 24, 64, 38 ), + ( 24, 63, 38 ), + ( 24, 63, 37 ), + ( 24, 62, 37 ), + ( 25, 61, 36 ), + ( 25, 60, 36 ), + ( 25, 59, 35 ), + ( 25, 58, 35 ), + ( 25, 57, 34 ), + ( 25, 56, 34 ), + ( 25, 55, 33 ), + ( 25, 54, 33 ), + ( 25, 53, 32 ), + ( 25, 52, 31 ), + ( 25, 51, 31 ), + ( 25, 50, 30 ), + ( 25, 49, 30 ), + ( 25, 48, 29 ), + ( 25, 47, 28 ), + ( 25, 46, 28 ), + ( 25, 45, 27 ), + ( 25, 44, 26 ), + ( 25, 44, 25 ), + ( 25, 43, 25 ), + ( 25, 42, 24 ), + ( 24, 41, 23 ), + ( 24, 40, 23 ), + ( 24, 39, 22 ), + ( 24, 38, 21 ), + ( 24, 37, 20 ), + ( 23, 36, 19 ), + ( 23, 35, 19 ) + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Tarn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Tarn.cs new file mode 100644 index 000000000..c88eb377b --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Tarn.cs @@ -0,0 +1,275 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Tarn : ByteColormapBase + { + public override string Name => "Tarn"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + + private static readonly (byte, byte, byte)[] _rgbs = { + ( 23, 35, 14 ), + ( 24, 37, 14 ), + ( 25, 39, 14 ), + ( 27, 41, 15 ), + ( 28, 42, 15 ), + ( 29, 44, 15 ), + ( 31, 46, 16 ), + ( 32, 48, 16 ), + ( 33, 49, 16 ), + ( 34, 51, 16 ), + ( 35, 53, 16 ), + ( 37, 55, 16 ), + ( 38, 56, 16 ), + ( 39, 58, 16 ), + ( 40, 60, 16 ), + ( 42, 61, 16 ), + ( 43, 63, 15 ), + ( 44, 65, 15 ), + ( 46, 66, 15 ), + ( 47, 68, 14 ), + ( 48, 70, 14 ), + ( 50, 71, 13 ), + ( 52, 73, 12 ), + ( 54, 74, 12 ), + ( 57, 75, 12 ), + ( 60, 77, 13 ), + ( 63, 78, 14 ), + ( 66, 79, 15 ), + ( 68, 80, 16 ), + ( 71, 81, 17 ), + ( 74, 83, 18 ), + ( 77, 84, 19 ), + ( 79, 85, 20 ), + ( 82, 86, 21 ), + ( 85, 87, 22 ), + ( 87, 88, 23 ), + ( 90, 89, 24 ), + ( 93, 91, 25 ), + ( 96, 92, 26 ), + ( 98, 93, 26 ), + ( 101, 94, 27 ), + ( 104, 95, 28 ), + ( 107, 96, 29 ), + ( 109, 97, 30 ), + ( 112, 98, 31 ), + ( 115, 99, 32 ), + ( 118, 100, 33 ), + ( 120, 102, 33 ), + ( 123, 103, 34 ), + ( 126, 104, 35 ), + ( 129, 105, 36 ), + ( 132, 106, 37 ), + ( 134, 107, 38 ), + ( 137, 108, 39 ), + ( 140, 109, 39 ), + ( 143, 110, 40 ), + ( 146, 111, 41 ), + ( 149, 112, 42 ), + ( 152, 113, 43 ), + ( 155, 114, 44 ), + ( 158, 115, 45 ), + ( 160, 116, 46 ), + ( 163, 117, 47 ), + ( 166, 118, 48 ), + ( 169, 119, 49 ), + ( 172, 120, 50 ), + ( 175, 121, 51 ), + ( 178, 122, 53 ), + ( 181, 123, 54 ), + ( 184, 124, 55 ), + ( 187, 125, 57 ), + ( 190, 126, 58 ), + ( 193, 127, 60 ), + ( 196, 128, 62 ), + ( 198, 129, 65 ), + ( 201, 130, 68 ), + ( 203, 132, 72 ), + ( 204, 134, 76 ), + ( 205, 136, 79 ), + ( 206, 138, 83 ), + ( 207, 140, 87 ), + ( 208, 143, 90 ), + ( 209, 145, 93 ), + ( 210, 147, 97 ), + ( 210, 150, 100 ), + ( 211, 152, 104 ), + ( 212, 154, 107 ), + ( 213, 156, 111 ), + ( 214, 159, 114 ), + ( 215, 161, 117 ), + ( 216, 163, 121 ), + ( 217, 166, 124 ), + ( 218, 168, 128 ), + ( 219, 170, 131 ), + ( 219, 173, 135 ), + ( 220, 175, 138 ), + ( 221, 177, 142 ), + ( 222, 179, 145 ), + ( 223, 182, 149 ), + ( 224, 184, 152 ), + ( 225, 186, 156 ), + ( 226, 189, 159 ), + ( 227, 191, 163 ), + ( 228, 193, 166 ), + ( 229, 196, 170 ), + ( 230, 198, 173 ), + ( 231, 200, 177 ), + ( 232, 203, 180 ), + ( 233, 205, 184 ), + ( 234, 208, 187 ), + ( 235, 210, 191 ), + ( 236, 212, 194 ), + ( 237, 215, 198 ), + ( 239, 217, 201 ), + ( 240, 219, 205 ), + ( 241, 222, 209 ), + ( 242, 224, 212 ), + ( 243, 227, 216 ), + ( 244, 229, 219 ), + ( 246, 232, 223 ), + ( 247, 234, 226 ), + ( 248, 236, 229 ), + ( 249, 239, 233 ), + ( 250, 241, 236 ), + ( 251, 243, 239 ), + ( 252, 245, 242 ), + ( 252, 246, 244 ), + ( 252, 247, 246 ), + ( 252, 247, 246 ), + ( 252, 247, 245 ), + ( 251, 246, 243 ), + ( 251, 245, 240 ), + ( 249, 244, 237 ), + ( 248, 242, 234 ), + ( 246, 240, 231 ), + ( 244, 238, 227 ), + ( 242, 236, 224 ), + ( 240, 234, 220 ), + ( 239, 232, 216 ), + ( 237, 230, 213 ), + ( 235, 228, 209 ), + ( 233, 226, 205 ), + ( 231, 223, 202 ), + ( 229, 221, 198 ), + ( 227, 219, 194 ), + ( 225, 217, 191 ), + ( 223, 215, 187 ), + ( 221, 214, 184 ), + ( 218, 212, 180 ), + ( 215, 210, 178 ), + ( 212, 209, 175 ), + ( 209, 207, 173 ), + ( 206, 206, 171 ), + ( 203, 204, 170 ), + ( 199, 203, 168 ), + ( 196, 201, 167 ), + ( 193, 200, 166 ), + ( 190, 198, 165 ), + ( 186, 196, 164 ), + ( 183, 195, 163 ), + ( 180, 193, 162 ), + ( 177, 192, 161 ), + ( 174, 190, 160 ), + ( 171, 189, 159 ), + ( 168, 187, 158 ), + ( 165, 185, 157 ), + ( 162, 184, 156 ), + ( 159, 182, 155 ), + ( 156, 181, 154 ), + ( 153, 179, 153 ), + ( 151, 178, 152 ), + ( 148, 176, 151 ), + ( 145, 174, 150 ), + ( 142, 173, 149 ), + ( 139, 171, 148 ), + ( 136, 170, 147 ), + ( 133, 168, 146 ), + ( 130, 167, 146 ), + ( 127, 165, 145 ), + ( 124, 164, 144 ), + ( 121, 162, 143 ), + ( 118, 161, 142 ), + ( 115, 159, 141 ), + ( 112, 158, 140 ), + ( 109, 156, 139 ), + ( 106, 155, 138 ), + ( 103, 154, 137 ), + ( 100, 152, 137 ), + ( 97, 151, 136 ), + ( 94, 149, 135 ), + ( 90, 148, 134 ), + ( 87, 146, 133 ), + ( 84, 145, 133 ), + ( 81, 143, 132 ), + ( 78, 142, 131 ), + ( 74, 140, 131 ), + ( 71, 139, 130 ), + ( 68, 137, 130 ), + ( 65, 136, 129 ), + ( 61, 134, 128 ), + ( 58, 133, 128 ), + ( 55, 131, 127 ), + ( 52, 129, 127 ), + ( 49, 128, 126 ), + ( 46, 126, 126 ), + ( 44, 124, 125 ), + ( 42, 123, 125 ), + ( 39, 121, 124 ), + ( 37, 119, 124 ), + ( 36, 117, 123 ), + ( 34, 116, 122 ), + ( 33, 114, 122 ), + ( 32, 112, 121 ), + ( 32, 110, 120 ), + ( 31, 108, 119 ), + ( 31, 106, 118 ), + ( 30, 105, 118 ), + ( 30, 103, 117 ), + ( 29, 101, 116 ), + ( 29, 99, 115 ), + ( 28, 97, 114 ), + ( 28, 95, 113 ), + ( 27, 93, 112 ), + ( 26, 92, 111 ), + ( 26, 90, 111 ), + ( 25, 88, 110 ), + ( 24, 86, 109 ), + ( 24, 84, 108 ), + ( 23, 83, 107 ), + ( 22, 81, 107 ), + ( 21, 79, 106 ), + ( 20, 77, 105 ), + ( 19, 75, 104 ), + ( 18, 73, 104 ), + ( 17, 72, 103 ), + ( 16, 70, 102 ), + ( 16, 68, 101 ), + ( 15, 66, 101 ), + ( 14, 64, 100 ), + ( 13, 62, 99 ), + ( 12, 60, 99 ), + ( 11, 59, 98 ), + ( 10, 57, 98 ), + ( 9, 55, 97 ), + ( 9, 53, 96 ), + ( 9, 51, 96 ), + ( 9, 49, 95 ), + ( 10, 47, 94 ), + ( 11, 45, 93 ), + ( 12, 42, 91 ), + ( 13, 40, 89 ), + ( 14, 38, 88 ), + ( 14, 36, 86 ), + ( 15, 34, 84 ), + ( 15, 32, 82 ), + ( 16, 30, 79 ) + + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Tempo.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Tempo.cs new file mode 100644 index 000000000..30debcc30 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Tempo.cs @@ -0,0 +1,274 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Tempo : ByteColormapBase + { + public override string Name => "Tempo"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + private static readonly (byte, byte, byte)[] _rgbs = { + ( 255, 246, 244 ), + ( 253, 245, 243 ), + ( 252, 244, 241 ), + ( 251, 243, 240 ), + ( 249, 242, 238 ), + ( 248, 241, 237 ), + ( 247, 240, 235 ), + ( 245, 239, 234 ), + ( 244, 238, 232 ), + ( 242, 237, 231 ), + ( 241, 236, 229 ), + ( 240, 235, 228 ), + ( 238, 234, 226 ), + ( 237, 234, 225 ), + ( 235, 233, 223 ), + ( 234, 232, 222 ), + ( 233, 231, 221 ), + ( 231, 230, 219 ), + ( 230, 229, 218 ), + ( 228, 228, 216 ), + ( 227, 227, 215 ), + ( 226, 226, 214 ), + ( 224, 226, 212 ), + ( 223, 225, 211 ), + ( 221, 224, 209 ), + ( 220, 223, 208 ), + ( 219, 222, 207 ), + ( 217, 221, 205 ), + ( 216, 221, 204 ), + ( 214, 220, 203 ), + ( 213, 219, 201 ), + ( 211, 218, 200 ), + ( 210, 217, 199 ), + ( 209, 216, 197 ), + ( 207, 216, 196 ), + ( 206, 215, 195 ), + ( 204, 214, 193 ), + ( 203, 213, 192 ), + ( 201, 212, 191 ), + ( 200, 212, 190 ), + ( 198, 211, 188 ), + ( 197, 210, 187 ), + ( 195, 209, 186 ), + ( 194, 209, 185 ), + ( 192, 208, 183 ), + ( 191, 207, 182 ), + ( 189, 206, 181 ), + ( 188, 206, 180 ), + ( 186, 205, 179 ), + ( 185, 204, 178 ), + ( 183, 203, 176 ), + ( 182, 203, 175 ), + ( 180, 202, 174 ), + ( 179, 201, 173 ), + ( 177, 200, 172 ), + ( 176, 200, 171 ), + ( 174, 199, 170 ), + ( 172, 198, 169 ), + ( 171, 197, 168 ), + ( 169, 197, 166 ), + ( 168, 196, 165 ), + ( 166, 195, 164 ), + ( 164, 195, 163 ), + ( 163, 194, 162 ), + ( 161, 193, 161 ), + ( 160, 192, 160 ), + ( 158, 192, 159 ), + ( 156, 191, 159 ), + ( 155, 190, 158 ), + ( 153, 190, 157 ), + ( 151, 189, 156 ), + ( 150, 188, 155 ), + ( 148, 188, 154 ), + ( 146, 187, 153 ), + ( 145, 186, 152 ), + ( 143, 186, 151 ), + ( 141, 185, 151 ), + ( 139, 184, 150 ), + ( 138, 183, 149 ), + ( 136, 183, 148 ), + ( 134, 182, 147 ), + ( 133, 181, 147 ), + ( 131, 181, 146 ), + ( 129, 180, 145 ), + ( 127, 179, 144 ), + ( 125, 179, 144 ), + ( 124, 178, 143 ), + ( 122, 177, 142 ), + ( 120, 177, 142 ), + ( 118, 176, 141 ), + ( 116, 175, 141 ), + ( 114, 175, 140 ), + ( 113, 174, 139 ), + ( 111, 173, 139 ), + ( 109, 173, 138 ), + ( 107, 172, 138 ), + ( 105, 171, 137 ), + ( 103, 171, 137 ), + ( 101, 170, 136 ), + ( 99, 169, 136 ), + ( 97, 169, 135 ), + ( 95, 168, 135 ), + ( 93, 167, 134 ), + ( 91, 166, 134 ), + ( 89, 166, 133 ), + ( 87, 165, 133 ), + ( 86, 164, 133 ), + ( 84, 164, 132 ), + ( 82, 163, 132 ), + ( 80, 162, 132 ), + ( 78, 161, 131 ), + ( 75, 161, 131 ), + ( 73, 160, 131 ), + ( 71, 159, 130 ), + ( 69, 159, 130 ), + ( 67, 158, 130 ), + ( 65, 157, 130 ), + ( 63, 156, 129 ), + ( 61, 156, 129 ), + ( 59, 155, 129 ), + ( 58, 154, 129 ), + ( 56, 153, 129 ), + ( 54, 152, 128 ), + ( 52, 152, 128 ), + ( 50, 151, 128 ), + ( 48, 150, 128 ), + ( 46, 149, 128 ), + ( 44, 148, 127 ), + ( 42, 147, 127 ), + ( 41, 147, 127 ), + ( 39, 146, 127 ), + ( 37, 145, 127 ), + ( 36, 144, 127 ), + ( 34, 143, 126 ), + ( 33, 142, 126 ), + ( 31, 141, 126 ), + ( 30, 141, 126 ), + ( 28, 140, 126 ), + ( 27, 139, 125 ), + ( 26, 138, 125 ), + ( 25, 137, 125 ), + ( 23, 136, 125 ), + ( 22, 135, 124 ), + ( 22, 134, 124 ), + ( 21, 133, 124 ), + ( 20, 132, 124 ), + ( 19, 132, 123 ), + ( 19, 131, 123 ), + ( 18, 130, 123 ), + ( 18, 129, 123 ), + ( 17, 128, 122 ), + ( 17, 127, 122 ), + ( 17, 126, 122 ), + ( 17, 125, 121 ), + ( 17, 124, 121 ), + ( 17, 123, 121 ), + ( 17, 122, 120 ), + ( 17, 121, 120 ), + ( 17, 120, 120 ), + ( 17, 119, 119 ), + ( 17, 118, 119 ), + ( 18, 118, 118 ), + ( 18, 117, 118 ), + ( 18, 116, 118 ), + ( 19, 115, 117 ), + ( 19, 114, 117 ), + ( 19, 113, 116 ), + ( 20, 112, 116 ), + ( 20, 111, 115 ), + ( 20, 110, 115 ), + ( 21, 109, 115 ), + ( 21, 108, 114 ), + ( 22, 107, 114 ), + ( 22, 106, 113 ), + ( 22, 105, 113 ), + ( 23, 104, 112 ), + ( 23, 103, 112 ), + ( 23, 102, 111 ), + ( 24, 101, 111 ), + ( 24, 101, 110 ), + ( 24, 100, 110 ), + ( 25, 99, 109 ), + ( 25, 98, 109 ), + ( 25, 97, 108 ), + ( 25, 96, 108 ), + ( 26, 95, 107 ), + ( 26, 94, 107 ), + ( 26, 93, 106 ), + ( 26, 92, 106 ), + ( 26, 91, 105 ), + ( 27, 90, 104 ), + ( 27, 89, 104 ), + ( 27, 88, 103 ), + ( 27, 88, 103 ), + ( 27, 87, 102 ), + ( 27, 86, 102 ), + ( 28, 85, 101 ), + ( 28, 84, 101 ), + ( 28, 83, 100 ), + ( 28, 82, 99 ), + ( 28, 81, 99 ), + ( 28, 80, 98 ), + ( 28, 79, 98 ), + ( 28, 78, 97 ), + ( 28, 77, 97 ), + ( 28, 76, 96 ), + ( 28, 76, 95 ), + ( 28, 75, 95 ), + ( 28, 74, 94 ), + ( 28, 73, 94 ), + ( 28, 72, 93 ), + ( 28, 71, 93 ), + ( 28, 70, 92 ), + ( 28, 69, 91 ), + ( 28, 68, 91 ), + ( 28, 67, 90 ), + ( 28, 66, 90 ), + ( 28, 66, 89 ), + ( 28, 65, 88 ), + ( 28, 64, 88 ), + ( 27, 63, 87 ), + ( 27, 62, 87 ), + ( 27, 61, 86 ), + ( 27, 60, 86 ), + ( 27, 59, 85 ), + ( 27, 58, 84 ), + ( 27, 57, 84 ), + ( 27, 56, 83 ), + ( 26, 55, 83 ), + ( 26, 54, 82 ), + ( 26, 54, 81 ), + ( 26, 53, 81 ), + ( 26, 52, 80 ), + ( 26, 51, 80 ), + ( 25, 50, 79 ), + ( 25, 49, 79 ), + ( 25, 48, 78 ), + ( 25, 47, 77 ), + ( 25, 46, 77 ), + ( 24, 45, 76 ), + ( 24, 44, 76 ), + ( 24, 43, 75 ), + ( 24, 42, 75 ), + ( 24, 41, 74 ), + ( 23, 40, 74 ), + ( 23, 39, 73 ), + ( 23, 38, 72 ), + ( 23, 37, 72 ), + ( 23, 36, 71 ), + ( 22, 35, 71 ), + ( 22, 34, 70 ), + ( 22, 33, 70 ), + ( 22, 32, 69 ), + ( 21, 31, 69 ), + ( 21, 30, 68 ), + ( 21, 29, 68 ) + + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Thermal.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Thermal.cs new file mode 100644 index 000000000..209e805ce --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Thermal.cs @@ -0,0 +1,275 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Thermal : ByteColormapBase + { + public override string Name => "Thermal"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + + private static readonly (byte, byte, byte)[] _rgbs = { + ( 4, 35, 51 ), + ( 4, 36, 53 ), + ( 4, 37, 55 ), + ( 4, 37, 57 ), + ( 5, 38, 59 ), + ( 5, 39, 61 ), + ( 5, 39, 63 ), + ( 5, 40, 65 ), + ( 5, 41, 67 ), + ( 6, 41, 69 ), + ( 6, 42, 71 ), + ( 6, 43, 73 ), + ( 7, 43, 75 ), + ( 7, 44, 77 ), + ( 7, 44, 80 ), + ( 8, 45, 82 ), + ( 8, 46, 84 ), + ( 9, 46, 86 ), + ( 9, 47, 89 ), + ( 10, 47, 91 ), + ( 11, 48, 93 ), + ( 12, 48, 96 ), + ( 12, 48, 98 ), + ( 13, 49, 101 ), + ( 14, 49, 103 ), + ( 15, 50, 106 ), + ( 16, 50, 108 ), + ( 18, 50, 111 ), + ( 19, 51, 114 ), + ( 20, 51, 116 ), + ( 22, 51, 119 ), + ( 23, 51, 122 ), + ( 25, 51, 124 ), + ( 26, 52, 127 ), + ( 28, 52, 130 ), + ( 30, 52, 132 ), + ( 31, 52, 135 ), + ( 33, 52, 138 ), + ( 35, 52, 140 ), + ( 37, 52, 143 ), + ( 39, 52, 145 ), + ( 42, 51, 147 ), + ( 44, 51, 149 ), + ( 46, 51, 151 ), + ( 48, 51, 153 ), + ( 51, 51, 155 ), + ( 53, 51, 156 ), + ( 55, 51, 157 ), + ( 57, 51, 158 ), + ( 60, 51, 159 ), + ( 62, 52, 159 ), + ( 64, 52, 159 ), + ( 66, 52, 160 ), + ( 68, 53, 160 ), + ( 70, 53, 160 ), + ( 71, 54, 160 ), + ( 73, 54, 159 ), + ( 75, 55, 159 ), + ( 77, 55, 159 ), + ( 78, 56, 158 ), + ( 80, 57, 158 ), + ( 82, 57, 157 ), + ( 83, 58, 157 ), + ( 85, 59, 157 ), + ( 86, 59, 156 ), + ( 88, 60, 156 ), + ( 89, 61, 155 ), + ( 91, 61, 155 ), + ( 92, 62, 154 ), + ( 94, 63, 154 ), + ( 95, 63, 153 ), + ( 96, 64, 153 ), + ( 98, 65, 152 ), + ( 99, 65, 152 ), + ( 101, 66, 151 ), + ( 102, 67, 151 ), + ( 103, 67, 150 ), + ( 105, 68, 150 ), + ( 106, 69, 149 ), + ( 108, 69, 149 ), + ( 109, 70, 148 ), + ( 110, 71, 148 ), + ( 112, 71, 148 ), + ( 113, 72, 147 ), + ( 114, 72, 147 ), + ( 116, 73, 146 ), + ( 117, 74, 146 ), + ( 118, 74, 146 ), + ( 120, 75, 145 ), + ( 121, 75, 145 ), + ( 122, 76, 145 ), + ( 124, 77, 144 ), + ( 125, 77, 144 ), + ( 126, 78, 144 ), + ( 128, 78, 143 ), + ( 129, 79, 143 ), + ( 131, 80, 143 ), + ( 132, 80, 142 ), + ( 133, 81, 142 ), + ( 135, 81, 142 ), + ( 136, 82, 141 ), + ( 137, 82, 141 ), + ( 139, 83, 141 ), + ( 140, 83, 140 ), + ( 142, 84, 140 ), + ( 143, 84, 140 ), + ( 144, 85, 139 ), + ( 146, 85, 139 ), + ( 147, 86, 139 ), + ( 149, 86, 138 ), + ( 150, 87, 138 ), + ( 151, 87, 138 ), + ( 153, 88, 137 ), + ( 154, 88, 137 ), + ( 156, 89, 137 ), + ( 157, 89, 136 ), + ( 159, 90, 136 ), + ( 160, 90, 135 ), + ( 162, 91, 135 ), + ( 163, 91, 134 ), + ( 165, 92, 134 ), + ( 166, 92, 134 ), + ( 168, 93, 133 ), + ( 169, 93, 132 ), + ( 171, 93, 132 ), + ( 172, 94, 131 ), + ( 174, 94, 131 ), + ( 175, 95, 130 ), + ( 177, 95, 130 ), + ( 178, 96, 129 ), + ( 180, 96, 128 ), + ( 181, 97, 128 ), + ( 183, 97, 127 ), + ( 184, 98, 126 ), + ( 186, 98, 126 ), + ( 187, 98, 125 ), + ( 189, 99, 124 ), + ( 190, 99, 123 ), + ( 192, 100, 123 ), + ( 193, 100, 122 ), + ( 195, 101, 121 ), + ( 196, 101, 120 ), + ( 198, 102, 119 ), + ( 199, 102, 118 ), + ( 201, 103, 117 ), + ( 202, 103, 116 ), + ( 204, 104, 115 ), + ( 205, 104, 114 ), + ( 206, 105, 113 ), + ( 208, 105, 112 ), + ( 209, 106, 111 ), + ( 211, 106, 110 ), + ( 212, 107, 109 ), + ( 214, 108, 108 ), + ( 215, 108, 107 ), + ( 216, 109, 106 ), + ( 218, 110, 105 ), + ( 219, 110, 104 ), + ( 220, 111, 102 ), + ( 222, 112, 101 ), + ( 223, 112, 100 ), + ( 224, 113, 99 ), + ( 225, 114, 98 ), + ( 227, 114, 96 ), + ( 228, 115, 95 ), + ( 229, 116, 94 ), + ( 230, 117, 93 ), + ( 231, 118, 91 ), + ( 232, 119, 90 ), + ( 234, 120, 89 ), + ( 235, 121, 88 ), + ( 236, 121, 86 ), + ( 237, 122, 85 ), + ( 238, 123, 84 ), + ( 238, 125, 83 ), + ( 239, 126, 82 ), + ( 240, 127, 80 ), + ( 241, 128, 79 ), + ( 242, 129, 78 ), + ( 243, 130, 77 ), + ( 243, 131, 76 ), + ( 244, 133, 75 ), + ( 245, 134, 74 ), + ( 245, 135, 73 ), + ( 246, 136, 72 ), + ( 246, 138, 71 ), + ( 247, 139, 70 ), + ( 247, 140, 69 ), + ( 248, 142, 68 ), + ( 248, 143, 67 ), + ( 249, 145, 67 ), + ( 249, 146, 66 ), + ( 249, 147, 65 ), + ( 250, 149, 65 ), + ( 250, 150, 64 ), + ( 250, 152, 63 ), + ( 251, 153, 63 ), + ( 251, 155, 62 ), + ( 251, 156, 62 ), + ( 251, 158, 62 ), + ( 251, 159, 61 ), + ( 251, 161, 61 ), + ( 252, 163, 61 ), + ( 252, 164, 61 ), + ( 252, 166, 60 ), + ( 252, 167, 60 ), + ( 252, 169, 60 ), + ( 252, 170, 60 ), + ( 252, 172, 60 ), + ( 252, 174, 60 ), + ( 252, 175, 60 ), + ( 252, 177, 60 ), + ( 251, 178, 61 ), + ( 251, 180, 61 ), + ( 251, 182, 61 ), + ( 251, 183, 61 ), + ( 251, 185, 62 ), + ( 251, 187, 62 ), + ( 251, 188, 62 ), + ( 250, 190, 63 ), + ( 250, 191, 63 ), + ( 250, 193, 64 ), + ( 250, 195, 64 ), + ( 249, 196, 65 ), + ( 249, 198, 65 ), + ( 249, 200, 66 ), + ( 248, 201, 67 ), + ( 248, 203, 67 ), + ( 248, 205, 68 ), + ( 247, 206, 69 ), + ( 247, 208, 69 ), + ( 247, 210, 70 ), + ( 246, 211, 71 ), + ( 246, 213, 71 ), + ( 245, 215, 72 ), + ( 245, 216, 73 ), + ( 244, 218, 74 ), + ( 244, 220, 75 ), + ( 243, 221, 75 ), + ( 243, 223, 76 ), + ( 242, 225, 77 ), + ( 242, 226, 78 ), + ( 241, 228, 79 ), + ( 241, 230, 80 ), + ( 240, 232, 81 ), + ( 239, 233, 81 ), + ( 239, 235, 82 ), + ( 238, 237, 83 ), + ( 237, 238, 84 ), + ( 237, 240, 85 ), + ( 236, 242, 86 ), + ( 235, 244, 87 ), + ( 234, 245, 88 ), + ( 234, 247, 89 ), + ( 233, 249, 90 ), + ( 232, 250, 91 ) + + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Topo.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Topo.cs new file mode 100644 index 000000000..394348ef4 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Topo.cs @@ -0,0 +1,275 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Topo : ByteColormapBase + { + public override string Name => "Topo"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + + private static readonly (byte, byte, byte)[] _rgbs = new (byte, byte, byte)[]{ + ( 40, 26, 44 ), + ( 41, 28, 47 ), + ( 43, 29, 50 ), + ( 44, 31, 52 ), + ( 45, 32, 55 ), + ( 47, 34, 58 ), + ( 48, 35, 61 ), + ( 49, 37, 64 ), + ( 50, 38, 67 ), + ( 52, 40, 70 ), + ( 53, 41, 73 ), + ( 54, 42, 76 ), + ( 55, 44, 79 ), + ( 56, 45, 82 ), + ( 57, 47, 85 ), + ( 58, 48, 88 ), + ( 59, 50, 92 ), + ( 60, 51, 95 ), + ( 61, 53, 98 ), + ( 62, 54, 102 ), + ( 63, 56, 105 ), + ( 63, 57, 108 ), + ( 64, 59, 112 ), + ( 64, 60, 115 ), + ( 65, 62, 118 ), + ( 65, 64, 122 ), + ( 65, 65, 125 ), + ( 66, 67, 128 ), + ( 65, 69, 131 ), + ( 65, 71, 133 ), + ( 65, 73, 136 ), + ( 65, 75, 138 ), + ( 64, 77, 140 ), + ( 64, 79, 141 ), + ( 63, 82, 143 ), + ( 63, 84, 144 ), + ( 62, 86, 145 ), + ( 62, 88, 146 ), + ( 62, 90, 146 ), + ( 62, 92, 147 ), + ( 62, 95, 147 ), + ( 62, 97, 148 ), + ( 62, 99, 148 ), + ( 62, 101, 149 ), + ( 62, 103, 149 ), + ( 62, 105, 150 ), + ( 62, 107, 150 ), + ( 63, 109, 151 ), + ( 63, 111, 151 ), + ( 64, 113, 151 ), + ( 64, 115, 152 ), + ( 64, 117, 152 ), + ( 65, 119, 153 ), + ( 66, 121, 153 ), + ( 66, 123, 153 ), + ( 67, 125, 154 ), + ( 67, 127, 154 ), + ( 68, 129, 155 ), + ( 68, 131, 155 ), + ( 69, 133, 156 ), + ( 70, 135, 156 ), + ( 70, 137, 157 ), + ( 71, 139, 157 ), + ( 72, 141, 157 ), + ( 72, 143, 158 ), + ( 73, 145, 158 ), + ( 74, 147, 159 ), + ( 74, 149, 159 ), + ( 75, 151, 160 ), + ( 76, 153, 160 ), + ( 77, 155, 161 ), + ( 77, 157, 161 ), + ( 78, 159, 161 ), + ( 79, 161, 162 ), + ( 80, 163, 162 ), + ( 81, 165, 162 ), + ( 81, 167, 163 ), + ( 82, 169, 163 ), + ( 83, 171, 163 ), + ( 85, 173, 163 ), + ( 86, 175, 164 ), + ( 87, 177, 164 ), + ( 88, 179, 164 ), + ( 90, 182, 164 ), + ( 91, 184, 164 ), + ( 93, 186, 164 ), + ( 95, 188, 164 ), + ( 97, 190, 164 ), + ( 99, 192, 164 ), + ( 101, 194, 164 ), + ( 103, 195, 164 ), + ( 106, 197, 164 ), + ( 109, 199, 163 ), + ( 112, 201, 163 ), + ( 115, 203, 163 ), + ( 118, 205, 163 ), + ( 122, 206, 163 ), + ( 125, 208, 163 ), + ( 129, 210, 163 ), + ( 133, 211, 163 ), + ( 137, 213, 163 ), + ( 141, 215, 163 ), + ( 146, 216, 164 ), + ( 150, 218, 164 ), + ( 154, 219, 165 ), + ( 159, 221, 165 ), + ( 163, 222, 166 ), + ( 167, 224, 167 ), + ( 172, 225, 168 ), + ( 176, 226, 169 ), + ( 181, 228, 170 ), + ( 185, 229, 172 ), + ( 189, 231, 173 ), + ( 193, 232, 175 ), + ( 198, 234, 176 ), + ( 202, 235, 178 ), + ( 206, 236, 179 ), + ( 210, 238, 181 ), + ( 215, 239, 183 ), + ( 219, 241, 185 ), + ( 223, 242, 187 ), + ( 227, 244, 189 ), + ( 231, 245, 191 ), + ( 235, 247, 193 ), + ( 239, 248, 196 ), + ( 243, 250, 198 ), + ( 247, 251, 200 ), + ( 251, 253, 203 ), + ( 13, 37, 20 ), + ( 14, 39, 21 ), + ( 15, 41, 21 ), + ( 16, 42, 22 ), + ( 17, 44, 23 ), + ( 18, 46, 23 ), + ( 19, 48, 24 ), + ( 20, 50, 24 ), + ( 21, 51, 25 ), + ( 22, 53, 26 ), + ( 23, 55, 26 ), + ( 23, 57, 27 ), + ( 24, 58, 27 ), + ( 25, 60, 28 ), + ( 26, 62, 28 ), + ( 27, 64, 28 ), + ( 27, 65, 29 ), + ( 28, 67, 29 ), + ( 29, 69, 29 ), + ( 30, 71, 30 ), + ( 31, 72, 30 ), + ( 32, 74, 30 ), + ( 33, 76, 30 ), + ( 35, 78, 30 ), + ( 37, 79, 30 ), + ( 39, 81, 30 ), + ( 42, 82, 30 ), + ( 45, 83, 31 ), + ( 48, 85, 32 ), + ( 51, 86, 34 ), + ( 54, 87, 35 ), + ( 57, 88, 37 ), + ( 60, 90, 38 ), + ( 63, 91, 40 ), + ( 65, 92, 42 ), + ( 68, 93, 43 ), + ( 71, 95, 45 ), + ( 73, 96, 47 ), + ( 76, 97, 48 ), + ( 78, 98, 49 ), + ( 81, 99, 51 ), + ( 84, 101, 52 ), + ( 86, 102, 53 ), + ( 89, 103, 54 ), + ( 92, 104, 55 ), + ( 94, 106, 56 ), + ( 97, 107, 57 ), + ( 100, 108, 58 ), + ( 102, 109, 58 ), + ( 105, 111, 59 ), + ( 107, 112, 60 ), + ( 110, 113, 60 ), + ( 113, 114, 61 ), + ( 115, 116, 61 ), + ( 118, 117, 62 ), + ( 121, 118, 62 ), + ( 123, 119, 62 ), + ( 126, 121, 63 ), + ( 129, 122, 63 ), + ( 131, 123, 63 ), + ( 134, 124, 63 ), + ( 137, 126, 64 ), + ( 140, 127, 64 ), + ( 142, 128, 64 ), + ( 145, 129, 64 ), + ( 148, 131, 64 ), + ( 150, 132, 64 ), + ( 153, 133, 64 ), + ( 156, 134, 64 ), + ( 159, 136, 64 ), + ( 161, 137, 64 ), + ( 164, 138, 63 ), + ( 167, 140, 63 ), + ( 170, 141, 63 ), + ( 173, 142, 63 ), + ( 176, 143, 63 ), + ( 179, 145, 63 ), + ( 182, 146, 63 ), + ( 185, 147, 62 ), + ( 188, 148, 62 ), + ( 191, 149, 63 ), + ( 193, 151, 65 ), + ( 195, 153, 69 ), + ( 196, 155, 72 ), + ( 197, 157, 76 ), + ( 198, 159, 80 ), + ( 199, 161, 83 ), + ( 200, 163, 87 ), + ( 202, 165, 90 ), + ( 203, 167, 94 ), + ( 204, 169, 97 ), + ( 205, 171, 101 ), + ( 206, 173, 104 ), + ( 207, 176, 108 ), + ( 208, 178, 111 ), + ( 209, 180, 115 ), + ( 210, 182, 118 ), + ( 211, 184, 122 ), + ( 212, 187, 125 ), + ( 213, 189, 129 ), + ( 214, 191, 132 ), + ( 215, 193, 136 ), + ( 216, 195, 139 ), + ( 218, 198, 143 ), + ( 219, 200, 146 ), + ( 220, 202, 150 ), + ( 221, 204, 153 ), + ( 222, 207, 157 ), + ( 223, 209, 160 ), + ( 224, 211, 164 ), + ( 226, 213, 167 ), + ( 227, 216, 171 ), + ( 228, 218, 174 ), + ( 229, 220, 178 ), + ( 230, 223, 182 ), + ( 232, 225, 185 ), + ( 233, 227, 189 ), + ( 234, 230, 192 ), + ( 236, 232, 196 ), + ( 237, 234, 199 ), + ( 238, 237, 203 ), + ( 240, 239, 207 ), + ( 241, 241, 210 ), + ( 242, 244, 214 ), + ( 244, 246, 217 ), + ( 245, 249, 221 ), + ( 247, 251, 225 ), + ( 249, 253, 228 ) + + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Turbid.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Turbid.cs new file mode 100644 index 000000000..86f1c458b --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Turbid.cs @@ -0,0 +1,276 @@ +//This is a cmocean colormap +//All credit to Kristen Thyng +//This colormap is under the MIT License +//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb + + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Turbid : ByteColormapBase + { + public override string Name => "Turbid"; + + public override (byte r, byte g, byte b)[] Rgbs => _rgbs; + + private static readonly (byte, byte, byte)[] _rgbs = new (byte, byte, byte)[] { + ( 233, 246, 171 ), + ( 232, 245, 170 ), + ( 232, 243, 168 ), + ( 231, 242, 167 ), + ( 230, 241, 165 ), + ( 230, 240, 164 ), + ( 229, 239, 162 ), + ( 229, 238, 161 ), + ( 228, 236, 159 ), + ( 228, 235, 158 ), + ( 227, 234, 156 ), + ( 227, 233, 155 ), + ( 226, 232, 154 ), + ( 226, 231, 152 ), + ( 225, 229, 151 ), + ( 224, 228, 149 ), + ( 224, 227, 148 ), + ( 223, 226, 146 ), + ( 223, 225, 145 ), + ( 222, 224, 143 ), + ( 222, 223, 142 ), + ( 221, 221, 141 ), + ( 221, 220, 139 ), + ( 220, 219, 138 ), + ( 220, 218, 136 ), + ( 219, 217, 135 ), + ( 219, 216, 134 ), + ( 218, 215, 132 ), + ( 218, 213, 131 ), + ( 217, 212, 130 ), + ( 217, 211, 128 ), + ( 217, 210, 127 ), + ( 216, 209, 126 ), + ( 216, 208, 124 ), + ( 215, 207, 123 ), + ( 215, 206, 122 ), + ( 214, 204, 120 ), + ( 214, 203, 119 ), + ( 213, 202, 118 ), + ( 213, 201, 116 ), + ( 212, 200, 115 ), + ( 212, 199, 114 ), + ( 211, 198, 113 ), + ( 211, 197, 111 ), + ( 211, 195, 110 ), + ( 210, 194, 109 ), + ( 210, 193, 108 ), + ( 209, 192, 107 ), + ( 209, 191, 105 ), + ( 208, 190, 104 ), + ( 208, 189, 103 ), + ( 207, 188, 102 ), + ( 207, 187, 101 ), + ( 207, 186, 100 ), + ( 206, 184, 98 ), + ( 206, 183, 97 ), + ( 205, 182, 96 ), + ( 205, 181, 95 ), + ( 204, 180, 94 ), + ( 204, 179, 93 ), + ( 203, 178, 92 ), + ( 203, 177, 91 ), + ( 202, 176, 90 ), + ( 202, 175, 89 ), + ( 202, 174, 88 ), + ( 201, 172, 87 ), + ( 201, 171, 86 ), + ( 200, 170, 85 ), + ( 200, 169, 84 ), + ( 199, 168, 83 ), + ( 199, 167, 82 ), + ( 198, 166, 81 ), + ( 198, 165, 81 ), + ( 197, 164, 80 ), + ( 197, 163, 79 ), + ( 196, 162, 78 ), + ( 196, 161, 77 ), + ( 195, 160, 77 ), + ( 195, 159, 76 ), + ( 194, 158, 75 ), + ( 194, 156, 74 ), + ( 193, 155, 74 ), + ( 193, 154, 73 ), + ( 192, 153, 72 ), + ( 192, 152, 72 ), + ( 191, 151, 71 ), + ( 191, 150, 71 ), + ( 190, 149, 70 ), + ( 189, 148, 69 ), + ( 189, 147, 69 ), + ( 188, 146, 68 ), + ( 188, 145, 68 ), + ( 187, 144, 67 ), + ( 187, 143, 67 ), + ( 186, 142, 66 ), + ( 185, 141, 66 ), + ( 185, 140, 66 ), + ( 184, 139, 65 ), + ( 183, 138, 65 ), + ( 183, 137, 64 ), + ( 182, 137, 64 ), + ( 182, 136, 64 ), + ( 181, 135, 64 ), + ( 180, 134, 63 ), + ( 179, 133, 63 ), + ( 179, 132, 63 ), + ( 178, 131, 62 ), + ( 177, 130, 62 ), + ( 177, 129, 62 ), + ( 176, 128, 62 ), + ( 175, 127, 61 ), + ( 175, 126, 61 ), + ( 174, 125, 61 ), + ( 173, 125, 61 ), + ( 172, 124, 61 ), + ( 172, 123, 61 ), + ( 171, 122, 60 ), + ( 170, 121, 60 ), + ( 169, 120, 60 ), + ( 168, 119, 60 ), + ( 168, 119, 60 ), + ( 167, 118, 60 ), + ( 166, 117, 60 ), + ( 165, 116, 60 ), + ( 164, 115, 59 ), + ( 164, 114, 59 ), + ( 163, 114, 59 ), + ( 162, 113, 59 ), + ( 161, 112, 59 ), + ( 160, 111, 59 ), + ( 159, 110, 59 ), + ( 158, 110, 59 ), + ( 158, 109, 59 ), + ( 157, 108, 59 ), + ( 156, 107, 59 ), + ( 155, 107, 59 ), + ( 154, 106, 59 ), + ( 153, 105, 59 ), + ( 152, 104, 59 ), + ( 151, 104, 58 ), + ( 150, 103, 58 ), + ( 150, 102, 58 ), + ( 149, 101, 58 ), + ( 148, 101, 58 ), + ( 147, 100, 58 ), + ( 146, 99, 58 ), + ( 145, 98, 58 ), + ( 144, 98, 58 ), + ( 143, 97, 58 ), + ( 142, 96, 58 ), + ( 141, 96, 58 ), + ( 140, 95, 58 ), + ( 139, 94, 58 ), + ( 138, 94, 58 ), + ( 137, 93, 58 ), + ( 136, 92, 58 ), + ( 135, 92, 57 ), + ( 134, 91, 57 ), + ( 133, 90, 57 ), + ( 132, 90, 57 ), + ( 131, 89, 57 ), + ( 130, 88, 57 ), + ( 129, 88, 57 ), + ( 128, 87, 57 ), + ( 127, 86, 57 ), + ( 126, 86, 57 ), + ( 125, 85, 56 ), + ( 124, 84, 56 ), + ( 123, 84, 56 ), + ( 122, 83, 56 ), + ( 121, 83, 56 ), + ( 120, 82, 56 ), + ( 119, 81, 56 ), + ( 118, 81, 56 ), + ( 117, 80, 55 ), + ( 116, 79, 55 ), + ( 115, 79, 55 ), + ( 114, 78, 55 ), + ( 113, 78, 55 ), + ( 112, 77, 55 ), + ( 111, 76, 54 ), + ( 110, 76, 54 ), + ( 109, 75, 54 ), + ( 108, 75, 54 ), + ( 107, 74, 53 ), + ( 106, 73, 53 ), + ( 105, 73, 53 ), + ( 103, 72, 53 ), + ( 102, 72, 53 ), + ( 101, 71, 52 ), + ( 100, 70, 52 ), + ( 99, 70, 52 ), + ( 98, 69, 52 ), + ( 97, 69, 51 ), + ( 96, 68, 51 ), + ( 95, 67, 51 ), + ( 94, 67, 51 ), + ( 93, 66, 50 ), + ( 92, 66, 50 ), + ( 91, 65, 50 ), + ( 90, 65, 49 ), + ( 89, 64, 49 ), + ( 88, 63, 49 ), + ( 87, 63, 48 ), + ( 86, 62, 48 ), + ( 85, 62, 48 ), + ( 84, 61, 48 ), + ( 83, 60, 47 ), + ( 82, 60, 47 ), + ( 81, 59, 47 ), + ( 80, 59, 46 ), + ( 79, 58, 46 ), + ( 78, 57, 46 ), + ( 77, 57, 45 ), + ( 75, 56, 45 ), + ( 74, 56, 44 ), + ( 73, 55, 44 ), + ( 72, 54, 44 ), + ( 71, 54, 43 ), + ( 70, 53, 43 ), + ( 69, 53, 43 ), + ( 68, 52, 42 ), + ( 67, 51, 42 ), + ( 66, 51, 41 ), + ( 65, 50, 41 ), + ( 64, 50, 41 ), + ( 63, 49, 40 ), + ( 62, 48, 40 ), + ( 61, 48, 39 ), + ( 60, 47, 39 ), + ( 59, 47, 39 ), + ( 58, 46, 38 ), + ( 57, 45, 38 ), + ( 56, 45, 37 ), + ( 55, 44, 37 ), + ( 54, 43, 36 ), + ( 53, 43, 36 ), + ( 52, 42, 36 ), + ( 51, 42, 35 ), + ( 50, 41, 35 ), + ( 49, 40, 34 ), + ( 48, 40, 34 ), + ( 47, 39, 33 ), + ( 46, 38, 33 ), + ( 45, 38, 32 ), + ( 44, 37, 32 ), + ( 43, 36, 31 ), + ( 42, 36, 31 ), + ( 41, 35, 31 ), + ( 40, 35, 30 ), + ( 39, 34, 30 ), + ( 38, 33, 29 ), + ( 37, 33, 29 ), + ( 36, 32, 28 ), + ( 35, 31, 28 ), + ( 34, 31, 27 ) + + }; + } +} + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Turbo.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Turbo.cs new file mode 100644 index 000000000..8ec5f2721 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Turbo.cs @@ -0,0 +1,50 @@ +// This colormap was created by Scott Harden on 2020-06-16 and is released under a MIT license. +// It was designed to mimic Turbo, but is not a copy of or derived from Turbo source code. +// https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html + + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Turbo : ArgbColormapBase + { + public override string Name => "Turbo"; + + public override uint[] Argbs => _argbs; + + private static readonly uint[] _argbs = new int[] + { + -13559489, -13493436, -13427382, -13361328, -13295018, -13228964, -13162911, -13096857, + -13030547, -12964493, -12898440, -12832130, -12766077, -12700023, -12633970, -12567660, + -12501607, -12435554, -12369245, -12303192, -12237139, -12171086, -12170313, -12104260, + -12038208, -12037436, -11971383, -11905331, -11904559, -11838507, -11837991, -11771940, + -11771168, -11770653, -11770138, -11703831, -11703316, -11702801, -11702287, -11701517, + -11701003, -11700489, -11765255, -11764742, -11764228, -11828995, -11828482, -11893506, + -11892737, -11957761, -12022785, -12022017, -12087042, -12152067, -12217092, -12347397, + -12412423, -12477448, -12542218, -12672780, -12737806, -12802577, -12933139, -12998166, + -13128729, -13193500, -13324063, -13389091, -13519654, -13584682, -13714989, -13780017, + -13910581, -13975609, -14106173, -14171201, -14301765, -14366793, -14431822, -14562386, + -14627414, -14692442, -14757471, -14822499, -14887527, -14952556, -14952048, -15017332, + -15082361, -15081853, -15147137, -15146629, -15146121, -15145869, -15145361, -15145109, + -15079065, -15078812, -15013024, -15012515, -14946726, -14880938, -14749356, -14683567, + -14617778, -14486453, -14355127, -14223801, -14092475, -13961405, -13764543, -13633217, + -13436355, -13239748, -13108422, -12911559, -12714952, -12518089, -12255946, -12059339, + -11862476, -11600333, -11403725, -11141582, -10879182, -10682575, -10420431, -10158287, + -09896143, -09633999, -09372111, -09175503, -08913359, -08651215, -08389327, -08127183, + -07865294, -07603150, -07341262, -07079117, -06817229, -06555341, -06293452, -06031308, + -05834955, -05573067, -05311178, -05114826, -04852937, -04656585, -04394952, -04198600, + -04002247, -03740358, -03544262, -03347910, -03217349, -03020997, -02824900, -02628804, + -02497987, -02301891, -02171331, -02040770, -01910210, -01779394, -01648834, -01518273, + -01387713, -01257153, -01126849, -01061824, -00931264, -00866240, -00801216, -00670656, + -00605888, -00540864, -00475840, -00411072, -00346048, -00346560, -00281792, -00282304, + -00217536, -00218048, -00153280, -00153793, -00154561, -00155073, -00155841, -00156354, + -00157122, -00157634, -00158403, -00224451, -00225219, -00291524, -00292036, -00358341, + -00424389, -00490694, -00491206, -00557511, -00623559, -00755400, -00821705, -00887754, + -00954058, -01085643, -01151948, -01283533, -01349837, -01481422, -01613263, -01679312, + -01811153, -01942738, -02074579, -02206164, -02337749, -02469590, -02601175, -02733016, + -02930137, -03061978, -03193563, -03390940, -03522526, -03654111, -03851488, -03983073, + -04180450, -04377572, -04509157, -04706534, -04838119, -05035497, -05232618, -05429739, + -05561580, -05758702, -05956079, -06153200, -06350322, -06482163, -06679284, -06876662, + -07073783, -07270904, -07468282, -07665403, -07862524, -08059902, -08257023, -08388608, + }.Select(argb => (uint)argb).ToArray(); + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Viridis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Viridis.cs new file mode 100644 index 000000000..a8cb3e8bb --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Color Maps/Viridis.cs @@ -0,0 +1,54 @@ +/* Viridis is a colormap by Nathaniel J. Smith, Stefan van der Walt, and Eric Firing + * https://bids.github.io/colormap/ + * https://github.com/BIDS/colormap/blob/master/colormaps.py + * + * This colormap is provided under the CC0 license / public domain dedication + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Viridis : ArgbColormapBase + { + public override string Name => "Viridis"; + public override uint[] Argbs => _argbs; + + private static readonly uint[] _rgbs = + { + 04456788, 04457045, 04457303, 04523352, 04523610, 04524123, 04589916, 04590430, + 04590687, 04591201, 04656994, 04657507, 04657765, 04658278, 04658535, 04658793, + 04659306, 04725099, 04725356, 04725870, 04726127, 04726384, 04726897, 04727154, + 04727411, 04727668, 04662645, 04662902, 04663159, 04663416, 04663929, 04664186, + 04664443, 04599164, 04599676, 04599933, 04600190, 04534911, 04535423, 04535680, + 04535937, 04470657, 04471170, 04405891, 04406147, 04406404, 04341124, 04341381, + 04341893, 04276614, 04276870, 04211591, 04211847, 04146567, 04147080, 04081800, + 04082057, 04016777, 04017033, 04017289, 03952010, 03952266, 03887242, 03887498, + 03822219, 03822475, 03757195, 03757451, 03692171, 03692428, 03627148, 03627404, + 03562124, 03562380, 03497100, 03497356, 03432077, 03432333, 03367053, 03367309, + 03302029, 03302285, 03237005, 03237261, 03237517, 03172237, 03172493, 03107213, + 03107469, 03042190, 03042446, 03042702, 02977422, 02977678, 02912398, 02912654, + 02912910, 02847630, 02847886, 02782606, 02782862, 02783118, 02717838, 02718094, + 02652814, 02652814, 02653070, 02587790, 02588046, 02588302, 02523022, 02523278, + 02523534, 02458254, 02458509, 02393229, 02393485, 02393741, 02328461, 02328717, + 02328973, 02263437, 02263693, 02263949, 02198669, 02198924, 02199180, 02133900, + 02134156, 02134412, 02069132, 02069387, 02069643, 02069899, 02070155, 02004874, + 02005130, 02005386, 02005386, 02005641, 02005897, 02006153, 02006408, 02006664, + 02006920, 02007175, 02072967, 02073222, 02073478, 02139269, 02139525, 02205317, + 02205572, 02271108, 02336899, 02337154, 02402946, 02468737, 02534529, 02600320, + 02666111, 02731903, 02797694, 02863485, 02929021, 03060348, 03126139, 03191930, + 03323258, 03389049, 03520376, 03586167, 03717494, 03783030, 03914357, 04045684, + 04111475, 04242802, 04374129, 04505200, 04570991, 04702318, 04833645, 04964972, + 05096043, 05227369, 05358696, 05490023, 05621350, 05752421, 05883748, 06015074, + 06211937, 06343008, 06474335, 06605661, 06802524, 06933595, 07064921, 07196248, + 07392854, 07524181, 07655508, 07852114, 07983441, 08180303, 08311374, 08508236, + 08639307, 08836169, 08967495, 09164102, 09295428, 09492035, 09623361, 09819967, + 09951294, 10147900, 10344762, 10475832, 10672695, 10869301, 11000627, 11197234, + 11394096, 11525166, 11722028, 11918635, 12049705, 12246567, 12443174, 12574500, + 12771106, 12967713, 13099039, 13295646, 13492253, 13623580, 13820187, 13951258, + 14148121, 14344728, 14475800, 14672664, 14803736, 15000344, 15197209, 15328281, + 15524890, 15656219, 15852828, 15983902, 16180767, 16311841, 16442914, 16639780, + }; + + private static readonly uint[] _argbs = _rgbs.Select(rgb => unchecked((uint)(0xFF << 24) | rgb)).ToArray(); + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/ContextMenuItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/ContextMenuItem.cs new file mode 100644 index 000000000..32411b549 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/ContextMenuItem.cs @@ -0,0 +1,12 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Represents a single item in a right-click pop-up menu + /// + public struct ContextMenuItem + { + public string Label { get; set; } + + public Action OnInvoke { get; set; } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/InputBindings.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/InputBindings.cs new file mode 100644 index 000000000..bfc7b2f8d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/InputBindings.cs @@ -0,0 +1,80 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This class defines which buttons and keys perform which actions to manipulate the plot. + /// + public class InputBindings + { + public MouseButton? DragPanButton = null; + public MouseButton? DragZoomButton = null; + public MouseButton? DragZoomRectangleButton = null; + public MouseButton? DoubleClickButton = null; + public MouseButton? ClickAutoAxisButton = null; + public MouseButton? ClickContextMenuButton = null; + + public MouseWheelDirection? ZoomInWheelDirection = null; + public MouseWheelDirection? ZoomOutWheelDirection = null; + public MouseWheelDirection? PanUpWheelDirection = null; + public MouseWheelDirection? PanDownWheelDirection = null; + public MouseWheelDirection? PanLeftWheelDirection = null; + public MouseWheelDirection? PanRightWheelDirection = null; + + public Key? LockHorizontalAxisKey = null; + public Key? LockVerticalAxisKey = null; + public Key? PanZoomRectangleKey = null; + + /// + /// Returns if contains the key which locks the X axis + /// + public bool ShouldLockX(IEnumerable keys) + { + return LockHorizontalAxisKey.HasValue ? keys.Contains(LockHorizontalAxisKey.Value) : false; + } + + /// + /// Returns if contains the key which locks the Y axis + /// + public bool ShouldLockY(IEnumerable keys) + { + return LockVerticalAxisKey.HasValue ? keys.Contains(LockVerticalAxisKey.Value) : false; + } + + /// + /// Returns if the combination of pressed buttons and keys results in a click-drag zoom rectangle + /// + public bool ShouldZoomRectangle(MouseButton button, IEnumerable keys) + { + if (button == DragZoomRectangleButton) + { + return true; + } + + if (button == DragPanButton) + { + if (PanZoomRectangleKey.HasValue && keys.Contains(PanZoomRectangleKey.Value)) + { + return true; + } + } + + return false; + } + + public static InputBindings Standard() => new() + { + DragPanButton = MouseButton.Left, + DragZoomRectangleButton = MouseButton.Middle, + DragZoomButton = MouseButton.Right, + ClickAutoAxisButton = MouseButton.Middle, + ClickContextMenuButton = MouseButton.Right, + DoubleClickButton = MouseButton.Left, + ZoomInWheelDirection = MouseWheelDirection.Up, + ZoomOutWheelDirection = MouseWheelDirection.Down, + LockHorizontalAxisKey = Key.Shift, + LockVerticalAxisKey = Key.Ctrl, + PanZoomRectangleKey = Key.Alt, + }; + + public static InputBindings NonInteractive() => new() { }; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/Interaction.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/Interaction.cs new file mode 100644 index 000000000..af5c07a30 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/Interaction.cs @@ -0,0 +1,199 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This class contains logic to perform plot manipulations in response to UI actions. + /// To customize how user inputs are interpreted, inherit and override functions in this class. + /// To customize behavior of actions, replace properties of with custom delegates. + /// To customize UI inputs, assign desired button and key properties of . + /// + public class Interaction : IPlotInteraction + { + public IPlotControl PlotControl { get; private set; } + + /// + /// Buttons and keys in this object can be overwritten to customize actions for specific user input events. + /// (e.g., make left-click-drag zoom instead of pan) + /// + public InputBindings Inputs = InputBindings.Standard(); + + /// + /// Delegates in this object can be overwritten with custom functions that manipulate the plot. + /// (e.g., changing the sensitivity of click-drag-zooming) + /// + public PlotActions Actions = PlotActions.Standard(); + + protected readonly KeyboardState Keyboard = new(); + protected readonly MouseState Mouse = new(); + + public bool IsDraggingMouse(Pixel pos) => Mouse.PressedButtons.Any() && Mouse.IsDragging(pos); + protected bool LockX => Inputs.ShouldLockX(Keyboard.PressedKeys); + protected bool LockY => Inputs.ShouldLockY(Keyboard.PressedKeys); + protected bool IsZoomingRectangle = false; + + public Interaction(IPlotControl control) + { + PlotControl = control; + } + + /// + /// Disable all mouse interactivity + /// + public void Disable() + { + Actions = PlotActions.NonInteractive(); + } + + /// + /// Enable mouse interactivity using the default mouse actions + /// + public void Enable() + { + Actions = PlotActions.Standard(); + } + + /// + /// Enable mouse interactivity using custom mouse actions + /// + public void Enable(PlotActions customActions) + { + Actions = customActions; + } + + /// + /// Return the last observed location of the mouse in coordinate units + /// + public Coordinates GetMouseCoordinates(IXAxis? xAxis = null, IYAxis? yAxis = null) + { + return PlotControl.Plot.GetCoordinates(Mouse.LastPosition, xAxis, yAxis); + } + + public virtual void OnMouseMove(Pixel newPosition) + { + Mouse.LastPosition = newPosition; + + if (IsDraggingMouse(newPosition)) + { + MouseDrag( + from: Mouse.MouseDownPosition, + to: newPosition, + button: Mouse.PressedButtons.First(), + keys: Keyboard.PressedKeys, + start: Mouse.MouseDownAxisLimits); + } + } + + protected virtual void MouseDrag(Pixel from, Pixel to, MouseButton button, IEnumerable keys, MultiAxisLimitManager start) + { + var lockY = Inputs.ShouldLockY(keys); + var lockX = Inputs.ShouldLockX(keys); + LockedAxes locks = new(lockX, LockY); + + MouseDrag drag = new(start, from, to); + + if (Inputs.ShouldZoomRectangle(button, keys)) + { + Actions.DragZoomRectangle(PlotControl, drag, locks); + IsZoomingRectangle = true; + } + else if (button == Inputs.DragPanButton) + { + Actions.DragPan(PlotControl, drag, locks); + } + else if (button == Inputs.DragZoomButton) + { + + Actions.DragZoom(PlotControl, drag, locks); + } + } + + public virtual void KeyUp(Key key) + { + Keyboard.Up(key); + } + + public virtual void KeyDown(Key key) + { + Keyboard.Down(key); + } + + public virtual void MouseDown(Pixel position, MouseButton button) + { + Mouse.Down(position, button, new MultiAxisLimitManager(PlotControl)); + } + + public virtual void MouseUp(Pixel position, MouseButton button) + { + var isDragging = Mouse.IsDragging(position); + + var droppedZoomRectangle = + isDragging && + Inputs.ShouldZoomRectangle(button, Keyboard.PressedKeys) && + IsZoomingRectangle; + + if (droppedZoomRectangle) + { + Actions.ZoomRectangleApply(PlotControl); + Actions.ZoomRectangleClear(PlotControl); + IsZoomingRectangle = false; + } + + // this covers the case where an extremely tiny zoom rectangle was made + if (isDragging == false && button == Inputs.ClickAutoAxisButton) + { + Actions.AutoScale(PlotControl); + } + + if (button == Inputs.DragZoomRectangleButton) + { + Actions.ZoomRectangleClear(PlotControl); + IsZoomingRectangle = false; + } + + if (!isDragging && button == Inputs.ClickContextMenuButton) + { + Actions.ShowContextMenu(PlotControl, position); + } + + Mouse.Up(button); + } + + public virtual void DoubleClick() + { + Actions.ToggleBenchmark(PlotControl); + } + + public virtual void MouseWheelVertical(Pixel pixel, float delta) + { + var direction = delta > 0 ? MouseWheelDirection.Up : MouseWheelDirection.Down; + + if (Inputs.ZoomInWheelDirection.HasValue && Inputs.ZoomInWheelDirection == direction) + { + Actions.ZoomIn(PlotControl, pixel, new LockedAxes(LockX, LockY)); + } + else if (Inputs.ZoomOutWheelDirection.HasValue && Inputs.ZoomOutWheelDirection == direction) + { + Actions.ZoomOut(PlotControl, pixel, new LockedAxes(LockX, LockY)); + } + else if (Inputs.PanUpWheelDirection.HasValue && Inputs.PanUpWheelDirection == direction) + { + Actions.PanUp(PlotControl); + } + else if (Inputs.PanDownWheelDirection.HasValue && Inputs.PanDownWheelDirection == direction) + { + Actions.PanDown(PlotControl); + } + else if (Inputs.PanRightWheelDirection.HasValue && Inputs.PanRightWheelDirection == direction) + { + Actions.PanRight(PlotControl); + } + else if (Inputs.PanLeftWheelDirection.HasValue && Inputs.PanLeftWheelDirection == direction) + { + Actions.PanLeft(PlotControl); + } + else + { + return; + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/Key.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/Key.cs new file mode 100644 index 000000000..0b0343d07 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/Key.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public enum Key + { + Unknown, + Ctrl, + Alt, + Shift + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/KeyboardState.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/KeyboardState.cs new file mode 100644 index 000000000..852d13085 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/KeyboardState.cs @@ -0,0 +1,29 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class KeyboardState + { + private readonly HashSet _pressed = new(); + + public IReadOnlyCollection PressedKeys => _pressed.ToArray(); + + public void Down(Key key) + { + if (key == Key.Unknown) + { + return; + } + + _pressed.Add(key); + } + + public void Up(Key key) + { + if (key == Key.Unknown) + { + return; + } + + _pressed.Remove(key); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/LockedAxes.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/LockedAxes.cs new file mode 100644 index 000000000..e704c851a --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/LockedAxes.cs @@ -0,0 +1,14 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public struct LockedAxes + { + public bool X = false; + public bool Y = false; + + public LockedAxes(bool lockedX, bool lockedY) + { + X = lockedX; + Y = lockedY; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/MouseButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/MouseButton.cs new file mode 100644 index 000000000..c698224c6 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/MouseButton.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public enum MouseButton + { + Unknown, + Left, + Right, + Middle, + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/MouseDrag.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/MouseDrag.cs new file mode 100644 index 000000000..e94d2c97d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/MouseDrag.cs @@ -0,0 +1,16 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public struct MouseDrag + { + public readonly MultiAxisLimitManager InitialLimits; + public readonly Pixel From; + public readonly Pixel To; + + public MouseDrag(MultiAxisLimitManager limits, Pixel from, Pixel to) + { + InitialLimits = limits; + From = from; + To = to; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/MouseState.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/MouseState.cs new file mode 100644 index 000000000..ac5238b09 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/MouseState.cs @@ -0,0 +1,66 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class MouseState + { + /// + /// A click-drag must exceed this number of pixels before it is considered a drag. + /// + public float MinimumDragDistance = 5; + + private readonly HashSet _pressed = new(); + + public Pixel LastPosition = new(float.NaN, float.NaN); + + public void Down(MouseButton button) => _pressed.Add(button); + + public bool IsDown(MouseButton button) => _pressed.Contains(button); + + public IReadOnlyCollection PressedButtons => _pressed.ToArray(); + + public Pixel MouseDownPosition { get; private set; } + + public MultiAxisLimitManager MouseDownAxisLimits = new(); + + public void Up(MouseButton button) + { + ForgetMouseDown(); + _pressed.Remove(button); + } + + public void Down(Pixel position, MouseButton button, MultiAxisLimitManager limits) + { + RememberMouseDown(position, limits); + Down(button); + } + + private void RememberMouseDown(Pixel position, MultiAxisLimitManager limits) + { + MouseDownPosition = position; + MouseDownAxisLimits.Remember(limits); + } + + private void ForgetMouseDown() + { + MouseDownPosition = Pixel.NaN; + } + + public bool IsDragging(Pixel position) + { + if (float.IsNaN(MouseDownPosition.X)) + { + return false; + } + + Pixel pixelDifference = MouseDownPosition - position; + PixelSize ps = new(pixelDifference.X, pixelDifference.Y); + + float dragDistance = ps.Diagonal; + if (dragDistance > MinimumDragDistance) + { + return true; + } + + return false; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/MouseWheelDirection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/MouseWheelDirection.cs new file mode 100644 index 000000000..07a2558d0 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/MouseWheelDirection.cs @@ -0,0 +1,11 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public enum MouseWheelDirection + { + Unknown, + Up, + Down, + Left, + Right, + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/MultiAxisLimitManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/MultiAxisLimitManager.cs new file mode 100644 index 000000000..b1c474209 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/MultiAxisLimitManager.cs @@ -0,0 +1,70 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This object remembers limits of all axes so it can restore them later. + /// It is used for mouse interaction to translate pixel distances + /// to coordinate distances based on previous renders. + /// + public class MultiAxisLimitManager + { + private readonly Dictionary _rememberedLimits = new(); + + public MultiAxisLimitManager() + { + + } + + public MultiAxisLimitManager(Plot plot) + { + Remember(plot.Axes.GetAxes()); + } + + public MultiAxisLimitManager(IPlotControl control) + { + Remember(control.Plot.Axes.GetAxes()); + } + + /// + /// Remember the current limits of the given axis + /// + private void Remember(IAxis axis) + { + _rememberedLimits[axis] = new(axis.Min, axis.Max); + } + + /// + /// Remember the current limits of all given axes + /// + private void Remember(IEnumerable axes) + { + foreach (IAxis axis in axes) + { + Remember(axis); + } + } + + /// + /// Clear memory of previous axes and remember all the given axis limits + /// + public void Remember(MultiAxisLimitManager newMultiLimits) + { + foreach (IAxis axis in newMultiLimits._rememberedLimits.Keys) + { + CoordinateRange range = newMultiLimits._rememberedLimits[axis]; + _rememberedLimits[axis] = new(range.Min, range.Max); + } + } + + /// + /// Update all axis limits of the given plot with those previously remembered + /// + public void Apply(Plot plot) + { + foreach (IAxis axis in plot.Axes.GetAxes()) + { + axis.Range.Min = _rememberedLimits[axis].Min; + axis.Range.Max = _rememberedLimits[axis].Max; + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/PlotActions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/PlotActions.cs new file mode 100644 index 000000000..e7992c1ed --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/PlotActions.cs @@ -0,0 +1,66 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This object holds actions which manipulate the plot. + /// To customize plot manipulation behavior, replace these delegates with custom ones. + /// + public class PlotActions + { + public Action ZoomIn = delegate { }; + public Action ZoomOut = delegate { }; + public Action PanUp = delegate { }; + public Action PanDown = delegate { }; + public Action PanLeft = delegate { }; + public Action PanRight = delegate { }; + public Action DragPan = delegate { }; + public Action DragZoom = delegate { }; + public Action DragZoomRectangle = delegate { }; + public Action ZoomRectangleClear = delegate { }; + public Action ZoomRectangleApply = delegate { }; + public Action ToggleBenchmark = delegate { }; + public Action AutoScale = delegate { }; + public Action ShowContextMenu = delegate { }; + + public static PlotActions Standard() + { + return new PlotActions() + { + ZoomIn = StandardActions.ZoomIn, + ZoomOut = StandardActions.ZoomOut, + PanUp = StandardActions.PanUp, + PanDown = StandardActions.PanDown, + PanLeft = StandardActions.PanLeft, + PanRight = StandardActions.PanRight, + DragPan = StandardActions.DragPan, + DragZoom = StandardActions.DragZoom, + DragZoomRectangle = StandardActions.DragZoomRectangle, + ZoomRectangleClear = StandardActions.ZoomRectangleClear, + ZoomRectangleApply = StandardActions.ZoomRectangleApply, + ToggleBenchmark = StandardActions.ToggleBenchmark, + AutoScale = StandardActions.AutoScale, + ShowContextMenu = StandardActions.ShowContextMenu, + }; + } + + public static PlotActions NonInteractive() + { + return new PlotActions() + { + ZoomIn = delegate { }, + ZoomOut = delegate { }, + PanUp = delegate { }, + PanDown = delegate { }, + PanLeft = delegate { }, + PanRight = delegate { }, + DragPan = delegate { }, + DragZoom = delegate { }, + DragZoomRectangle = delegate { }, + ZoomRectangleClear = delegate { }, + ZoomRectangleApply = delegate { }, + ToggleBenchmark = delegate { }, + AutoScale = delegate { }, + ShowContextMenu = delegate { }, + }; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/StandardActions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/StandardActions.cs new file mode 100644 index 000000000..35e26f619 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/StandardActions.cs @@ -0,0 +1,139 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public static class StandardActions + { + public static void ZoomIn(IPlotControl control, Pixel pixel, LockedAxes locked) + { + var zoomInFraction = 1.15; + + var xFrac = locked.X ? 1 : zoomInFraction; + var yFrac = locked.Y ? 1 : zoomInFraction; + + control.Plot.MouseZoom(xFrac, yFrac, pixel); + control.Refresh(); + } + + public static void ZoomOut(IPlotControl control, Pixel pixel, LockedAxes locked) + { + var zoomOutFraction = 0.85; + + var xFrac = locked.X ? 1 : zoomOutFraction; + var yFrac = locked.Y ? 1 : zoomOutFraction; + + control.Plot.MouseZoom(xFrac, yFrac, pixel); + control.Refresh(); + } + + public static void PanUp(IPlotControl control) + { + var panFraction = 0.1; + AxisLimits limits = control.Plot.Axes.GetLimits(); + var deltaY = limits.Rect.Height * panFraction; + control.Plot.Axes.SetLimits(limits.WithPan(0, deltaY)); + control.Refresh(); + } + + public static void PanDown(IPlotControl control) + { + var panFraction = 0.1; + AxisLimits limits = control.Plot.Axes.GetLimits(); + var deltaY = limits.Rect.Height * panFraction; + control.Plot.Axes.SetLimits(limits.WithPan(0, -deltaY)); + control.Refresh(); + } + + public static void PanLeft(IPlotControl control) + { + var panFraction = 0.1; + AxisLimits limits = control.Plot.Axes.GetLimits(); + var deltaX = limits.Rect.Width * panFraction; + control.Plot.Axes.SetLimits(limits.WithPan(-deltaX, 0)); + control.Refresh(); + } + + public static void PanRight(IPlotControl control) + { + var panFraction = 0.1; + AxisLimits limits = control.Plot.Axes.GetLimits(); + var deltaX = limits.Rect.Width * panFraction; + control.Plot.Axes.SetLimits(limits.WithPan(deltaX, 0)); + control.Refresh(); + } + + public static void DragPan(IPlotControl control, MouseDrag drag, LockedAxes locked) + { + Pixel to2 = new( + x: locked.X ? drag.From.X : drag.To.X, + y: locked.Y ? drag.From.Y : drag.To.Y); + + control.Plot.MousePan(drag.InitialLimits, drag.From, to2); + control.Refresh(); + } + + public static void DragZoom(IPlotControl control, MouseDrag drag, LockedAxes locked) + { + Pixel to2 = new( + x: locked.X ? drag.From.X : drag.To.X, + y: locked.Y ? drag.From.Y : drag.To.Y); + + control.Plot.MouseZoom(drag.InitialLimits, drag.From, to2); + control.Refresh(); + } + + public static void ZoomRectangleClear(IPlotControl control) + { + control.Plot.ZoomRectangle.IsVisible = false; + control.Refresh(); + } + + public static void ZoomRectangleApply(IPlotControl control) + { + Pixel px1 = control.Plot.ZoomRectangle.MouseDown; + Pixel px2 = control.Plot.ZoomRectangle.MouseUp; + PixelRect dataRect = control.Plot.RenderManager.LastRender.DataRect; + + foreach (IXAxis xAxis in control.Plot.Axes.XAxes) + { + double x1 = xAxis.GetCoordinate(px1.X, dataRect); + double x2 = xAxis.GetCoordinate(px2.X, dataRect); + var xMin = Math.Min(x1, x2); + var xMax = Math.Max(x1, x2); + xAxis.Range.Set(xMin, xMax); + } + + foreach (IYAxis yAxis in control.Plot.Axes.YAxes) + { + double y1 = yAxis.GetCoordinate(px1.Y, dataRect); + double y2 = yAxis.GetCoordinate(px2.Y, dataRect); + var xMin = Math.Min(y1, y2); + var xMax = Math.Max(y1, y2); + yAxis.Range.Set(xMin, xMax); + } + + control.Refresh(); + } + + public static void DragZoomRectangle(IPlotControl control, MouseDrag drag, LockedAxes locked) + { + control.Plot.MouseZoomRectangle(drag.From, drag.To, vSpan: locked.Y, hSpan: locked.X); + control.Refresh(); + } + + public static void ToggleBenchmark(IPlotControl control) + { + control.Plot.Benchmark.IsVisible = !control.Plot.Benchmark.IsVisible; + control.Refresh(); + } + + public static void AutoScale(IPlotControl control) + { + control.Plot.Axes.AutoScale(); + control.Refresh(); + } + + public static void ShowContextMenu(IPlotControl control, Pixel position) + { + control.ShowContextMenu(position); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/StandardZoomRectangle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/StandardZoomRectangle.cs new file mode 100644 index 000000000..d2683c361 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Control/StandardZoomRectangle.cs @@ -0,0 +1,74 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Logic for drawing the shaded region on the plot when the user middle-click-drags to zoom + /// + public class StandardZoomRectangle : IZoomRectangle + { + public bool IsVisible { get; set; } = false; + + public Color FillColor = new Color(255, 0, 0).WithAlpha(100); + + public LineStyle LineStyle { get; } = new() { Color = new Color(255, 0, 0).WithAlpha(200) }; + + public Pixel MouseDown { get; private set; } + public Pixel MouseUp { get; private set; } + public bool HorizontalSpan { get; set; } = false; + public bool VerticalSpan { get; set; } = false; + + public StandardZoomRectangle() + { + } + + public void Update(Pixel mouseDown, Pixel mouseUp) + { + MouseDown = mouseDown; + MouseUp = mouseUp; + IsVisible = true; + } + + public void Clear() + { + IsVisible = false; + } + + public void Render(RenderPack rp) + { + var canvas = rp.Canvas; + PixelRect dataRect = rp.DataRect; + + SKRect rect = new(MouseDown.X, MouseDown.Y, MouseUp.X, MouseUp.Y); + + canvas.Save(); + canvas.ClipRect(dataRect.ToSkRect()); + + if (HorizontalSpan) + { + rect.Left = dataRect.Left; + rect.Right = dataRect.Right; + } + + if (VerticalSpan) + { + rect.Bottom = dataRect.Bottom; + rect.Top = dataRect.Top; + } + + using SKPaint paint = new() + { + IsAntialias = true + }; + + paint.Color = FillColor.ToSkColor(); + paint.IsStroke = false; + canvas.DrawRect(rect, paint); + + paint.Color = LineStyle.Color.ToSkColor(); + paint.StrokeWidth = LineStyle.Width; + paint.IsStroke = true; + canvas.DrawRect(rect, paint); + + canvas.Restore(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Data/SampleData.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Data/SampleData.cs new file mode 100644 index 000000000..7c186aec1 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Data/SampleData.cs @@ -0,0 +1,131 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Sample data used for testing + /// + public static class SampleData + { + /// + /// The first 100 prime numbers + /// + public static readonly double[] FirstHundredPrimes = + { + 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, + 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, + 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, + 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, + 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, + 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, + }; + + /// + /// The Mona Lisa represented as as a 2D array (65 x 100) + /// of grayscale values from 0 (dark) to 255 (bright) + /// + public static double[,] MonaLisa() + { + return new double[,] { + { 95, 113, 117, 118, 120, 126, 135, 125, 120, 117, 120, 122, 124, 125, 118, 114, 113, 109, 108, 111, 113, 114, 113, 116, 114, 111, 113, 114, 111, 108, 111, 114, 116, 118, 114, 112, 116, 120, 116, 113, 109, 111, 108, 105, 104, 104, 108, 108, 109, 108, 107, 107, 108, 111, 111, 111, 111, 117, 116, 116, 117, 114, 112, 107, 100 }, + { 99, 117, 121, 122, 120, 125, 133, 125, 114, 117, 122, 125, 126, 129, 121, 117, 117, 111, 112, 112, 113, 114, 118, 122, 122, 118, 116, 116, 114, 112, 113, 116, 122, 124, 121, 120, 120, 121, 117, 116, 118, 117, 116, 117, 113, 111, 111, 113, 117, 118, 120, 116, 117, 116, 112, 116, 118, 118, 120, 118, 121, 124, 121, 122, 117}, + { 100, 116, 126, 126, 124, 128, 125, 125, 124, 126, 130, 133, 126, 121, 121, 121, 116, 111, 114, 113, 112, 112, 118, 121, 121, 121, 120, 113, 113, 114, 116, 118, 120, 118, 117, 121, 122, 125, 125, 125, 128, 124, 125, 124, 116, 117, 117, 118, 121, 122, 122, 117, 121, 116, 116, 117, 126, 121, 120, 121, 124, 121, 114, 114, 107}, + { 103, 121, 134, 134, 133, 133, 131, 130, 128, 128, 130, 130, 125, 125, 126, 118, 116, 116, 116, 116, 116, 117, 120, 122, 126, 129, 124, 121, 121, 121, 120, 120, 126, 125, 124, 125, 126, 125, 125, 130, 134, 134, 134, 134, 126, 129, 129, 125, 124, 125, 125, 125, 124, 124, 125, 131, 137, 131, 128, 129, 129, 128, 124, 114, 101}, + { 107, 131, 137, 137, 143, 142, 137, 134, 135, 142, 141, 138, 137, 138, 134, 126, 124, 118, 120, 122, 121, 126, 126, 129, 129, 129, 124, 125, 128, 133, 131, 133, 134, 133, 131, 125, 125, 128, 126, 130, 133, 133, 138, 137, 137, 134, 133, 128, 129, 133, 135, 130, 129, 129, 134, 139, 143, 138, 130, 128, 128, 131, 125, 120, 107}, + { 108, 133, 134, 141, 142, 139, 141, 144, 146, 152, 152, 150, 141, 135, 133, 129, 134, 129, 129, 130, 126, 129, 126, 135, 135, 131, 129, 130, 134, 137, 141, 144, 147, 151, 143, 137, 137, 133, 129, 130, 133, 138, 148, 144, 141, 137, 135, 131, 137, 139, 138, 133, 134, 134, 141, 142, 141, 138, 135, 133, 129, 129, 124, 120, 108}, + { 113, 133, 138, 139, 138, 142, 139, 144, 154, 154, 151, 152, 151, 146, 144, 141, 138, 135, 135, 134, 133, 134, 135, 141, 137, 138, 138, 141, 141, 141, 147, 143, 148, 152, 155, 151, 146, 139, 138, 137, 141, 148, 155, 150, 146, 141, 138, 138, 143, 141, 141, 138, 141, 138, 141, 143, 138, 137, 137, 135, 130, 129, 128, 122, 111}, + { 121, 134, 139, 141, 143, 148, 150, 155, 158, 154, 150, 151, 154, 154, 155, 148, 142, 142, 142, 138, 134, 138, 141, 139, 141, 147, 147, 146, 147, 150, 148, 143, 146, 146, 150, 150, 147, 143, 141, 144, 150, 151, 154, 151, 146, 141, 138, 137, 141, 139, 139, 141, 144, 139, 142, 146, 141, 142, 144, 138, 131, 129, 130, 128, 118}, + { 126, 139, 147, 154, 158, 156, 155, 159, 156, 152, 151, 154, 152, 150, 148, 150, 150, 151, 143, 142, 138, 139, 139, 143, 150, 155, 154, 150, 142, 122, 103, 84, 79, 83, 95, 111, 126, 137, 141, 143, 147, 150, 148, 150, 147, 139, 138, 135, 141, 143, 139, 141, 144, 144, 143, 150, 143, 146, 151, 142, 134, 128, 130, 126, 124}, + { 128, 141, 152, 160, 168, 158, 151, 155, 158, 155, 155, 154, 150, 151, 154, 158, 158, 155, 150, 143, 143, 142, 143, 148, 158, 154, 143, 105, 65, 54, 37, 28, 27, 32, 36, 44, 56, 77, 112, 137, 148, 152, 155, 152, 150, 141, 141, 138, 139, 144, 144, 146, 148, 146, 148, 152, 148, 151, 155, 148, 139, 131, 131, 130, 122}, + { 126, 147, 151, 158, 160, 151, 152, 160, 163, 159, 159, 156, 155, 156, 160, 164, 161, 156, 156, 154, 155, 150, 152, 158, 155, 133, 75, 37, 45, 67, 37, 24, 19, 18, 19, 23, 36, 43, 40, 82, 138, 152, 158, 155, 148, 143, 144, 144, 144, 151, 152, 156, 156, 148, 150, 152, 151, 152, 155, 148, 143, 138, 137, 133, 125}, + { 125, 144, 151, 155, 159, 160, 161, 169, 172, 164, 163, 163, 163, 164, 167, 164, 159, 152, 155, 159, 158, 158, 163, 164, 138, 75, 45, 52, 67, 73, 45, 37, 27, 23, 22, 16, 14, 23, 27, 23, 71, 141, 158, 161, 160, 155, 148, 146, 148, 158, 159, 163, 164, 156, 155, 155, 152, 151, 151, 150, 144, 146, 139, 135, 122}, + { 121, 150, 168, 169, 169, 168, 172, 171, 173, 172, 172, 164, 167, 169, 169, 169, 164, 156, 156, 161, 161, 165, 169, 161, 87, 41, 56, 78, 103, 96, 70, 54, 35, 26, 26, 19, 15, 14, 15, 19, 22, 83, 152, 167, 165, 158, 148, 151, 151, 156, 161, 161, 161, 161, 165, 163, 158, 156, 151, 150, 143, 147, 139, 135, 128}, + { 118, 151, 173, 180, 177, 173, 182, 175, 173, 172, 167, 165, 167, 173, 176, 172, 165, 161, 159, 164, 168, 177, 175, 131, 56, 83, 128, 159, 172, 167, 146, 124, 97, 58, 36, 27, 18, 16, 15, 16, 15, 26, 112, 163, 167, 169, 164, 161, 158, 161, 164, 164, 165, 167, 172, 164, 160, 159, 151, 151, 147, 144, 139, 137, 130}, + { 118, 147, 165, 177, 176, 176, 181, 177, 175, 175, 172, 171, 175, 178, 176, 173, 167, 165, 164, 171, 181, 182, 159, 80, 82, 143, 186, 205, 207, 205, 190, 169, 142, 101, 70, 44, 23, 18, 14, 15, 18, 16, 48, 146, 173, 175, 171, 171, 167, 168, 169, 171, 172, 167, 167, 165, 161, 160, 156, 154, 148, 148, 142, 139, 129}, + { 133, 154, 167, 168, 168, 180, 182, 188, 186, 185, 180, 180, 176, 181, 178, 175, 176, 175, 169, 177, 185, 177, 112, 50, 118, 186, 214, 216, 218, 215, 208, 192, 167, 129, 88, 57, 35, 22, 14, 14, 18, 18, 22, 105, 177, 173, 172, 169, 175, 175, 175, 176, 173, 168, 171, 176, 173, 171, 167, 158, 152, 150, 142, 143, 138}, + { 142, 164, 180, 173, 173, 181, 190, 199, 197, 194, 188, 186, 185, 184, 181, 180, 186, 180, 173, 188, 198, 167, 65, 50, 135, 193, 214, 212, 214, 214, 208, 195, 173, 137, 96, 67, 44, 26, 23, 15, 13, 14, 14, 54, 161, 168, 164, 171, 172, 172, 177, 178, 175, 168, 172, 177, 181, 178, 171, 163, 158, 150, 143, 148, 144}, + { 139, 164, 182, 178, 168, 171, 193, 199, 201, 202, 199, 201, 194, 185, 178, 181, 185, 176, 171, 188, 189, 130, 53, 60, 141, 189, 203, 202, 203, 206, 201, 186, 159, 135, 111, 86, 61, 37, 22, 15, 14, 10, 10, 27, 125, 143, 152, 159, 151, 158, 168, 164, 168, 171, 171, 172, 176, 180, 173, 168, 163, 152, 147, 152, 144}, + { 118, 144, 163, 161, 144, 150, 182, 194, 201, 197, 185, 197, 197, 192, 181, 182, 189, 177, 181, 192, 158, 87, 39, 78, 148, 188, 199, 203, 203, 202, 201, 186, 163, 147, 133, 114, 94, 60, 26, 19, 15, 11, 10, 14, 78, 113, 130, 131, 131, 150, 158, 155, 154, 165, 168, 175, 173, 175, 172, 165, 163, 155, 144, 147, 143}, + { 94, 114, 117, 131, 122, 126, 161, 177, 178, 161, 156, 169, 193, 195, 194, 192, 195, 192, 198, 192, 131, 65, 32, 92, 160, 186, 194, 203, 206, 203, 197, 182, 172, 163, 147, 133, 108, 65, 28, 16, 11, 13, 10, 10, 58, 94, 101, 101, 112, 139, 141, 143, 137, 163, 173, 178, 175, 171, 171, 168, 163, 151, 134, 139, 137}, + { 79, 94, 87, 105, 117, 114, 128, 141, 141, 139, 130, 133, 150, 163, 190, 199, 198, 198, 203, 184, 111, 53, 27, 90, 156, 165, 167, 190, 199, 188, 146, 129, 134, 138, 129, 112, 91, 56, 22, 13, 9, 11, 13, 10, 45, 75, 82, 99, 111, 114, 118, 126, 117, 148, 168, 175, 171, 172, 180, 177, 155, 138, 121, 121, 101}, + { 49, 73, 77, 95, 111, 112, 121, 116, 109, 113, 105, 108, 108, 120, 139, 185, 193, 198, 195, 158, 90, 56, 30, 65, 101, 104, 100, 144, 178, 133, 73, 86, 99, 82, 66, 61, 65, 53, 23, 15, 10, 9, 13, 13, 33, 60, 70, 80, 99, 101, 108, 113, 105, 126, 156, 173, 176, 175, 186, 181, 159, 143, 130, 112, 96}, + { 40, 69, 82, 94, 100, 104, 109, 100, 96, 97, 87, 87, 99, 118, 114, 176, 193, 186, 181, 141, 75, 52, 32, 50, 65, 79, 56, 113, 172, 100, 75, 118, 78, 50, 49, 61, 91, 70, 33, 22, 15, 7, 11, 11, 26, 60, 61, 64, 82, 91, 97, 80, 82, 111, 147, 175, 176, 169, 175, 163, 147, 135, 124, 112, 116}, + { 41, 71, 90, 99, 97, 107, 97, 95, 97, 95, 74, 82, 92, 104, 111, 163, 148, 114, 133, 131, 67, 47, 26, 90, 125, 131, 104, 143, 180, 105, 109, 154, 133, 105, 112, 143, 131, 82, 32, 16, 14, 10, 11, 13, 22, 53, 57, 61, 71, 78, 77, 73, 77, 94, 141, 176, 177, 172, 168, 155, 141, 131, 111, 109, 111}, + { 44, 71, 84, 97, 94, 99, 94, 87, 88, 83, 71, 77, 77, 80, 80, 108, 97, 86, 79, 99, 65, 39, 22, 117, 173, 169, 164, 175, 178, 125, 137, 173, 173, 172, 172, 160, 126, 73, 24, 10, 10, 9, 10, 15, 16, 43, 52, 62, 77, 82, 74, 69, 73, 83, 122, 165, 167, 164, 154, 147, 143, 133, 112, 108, 100}, + { 50, 64, 75, 78, 84, 88, 78, 75, 78, 67, 71, 71, 60, 65, 57, 65, 71, 75, 54, 69, 60, 33, 19, 105, 173, 192, 192, 185, 184, 137, 150, 190, 199, 197, 181, 143, 105, 58, 20, 10, 10, 10, 10, 14, 15, 45, 64, 66, 74, 74, 69, 62, 62, 67, 99, 143, 154, 154, 147, 143, 143, 129, 118, 112, 87}, + { 50, 43, 57, 64, 64, 69, 66, 70, 82, 70, 69, 62, 53, 53, 53, 56, 58, 57, 44, 48, 45, 40, 26, 86, 176, 192, 186, 186, 184, 134, 141, 178, 189, 185, 163, 120, 84, 45, 18, 13, 11, 11, 9, 13, 18, 47, 71, 86, 99, 97, 96, 96, 96, 100, 105, 122, 134, 134, 129, 121, 113, 107, 107, 99, 75}, + { 39, 33, 47, 61, 58, 61, 64, 69, 82, 79, 74, 66, 56, 54, 58, 53, 49, 41, 31, 30, 33, 39, 23, 66, 156, 184, 173, 178, 172, 121, 126, 175, 181, 167, 137, 100, 70, 37, 16, 15, 13, 11, 7, 10, 16, 28, 39, 49, 65, 73, 77, 79, 83, 96, 105, 116, 120, 114, 99, 91, 73, 75, 92, 73, 49}, + { 31, 31, 40, 58, 61, 56, 62, 60, 61, 67, 75, 71, 64, 60, 58, 53, 50, 40, 28, 24, 27, 32, 19, 43, 121, 159, 168, 146, 103, 58, 86, 171, 171, 144, 114, 84, 58, 35, 19, 13, 10, 9, 7, 11, 15, 19, 27, 35, 40, 45, 52, 50, 50, 54, 67, 80, 77, 75, 69, 71, 53, 45, 44, 35, 28}, + { 24, 28, 35, 52, 60, 57, 61, 57, 58, 54, 66, 67, 57, 56, 57, 53, 48, 37, 33, 28, 24, 23, 19, 31, 97, 131, 171, 168, 82, 58, 97, 137, 135, 128, 104, 80, 60, 33, 19, 13, 10, 7, 11, 15, 16, 22, 30, 35, 41, 45, 47, 41, 43, 47, 49, 49, 50, 56, 60, 62, 52, 41, 40, 30, 27}, + { 24, 31, 35, 52, 61, 57, 54, 54, 60, 54, 60, 57, 53, 53, 53, 49, 43, 36, 33, 31, 23, 30, 28, 23, 87, 126, 126, 142, 120, 86, 83, 90, 122, 126, 105, 80, 57, 32, 16, 13, 10, 7, 9, 11, 16, 26, 36, 40, 47, 48, 49, 43, 40, 40, 41, 45, 56, 65, 70, 61, 50, 36, 32, 28, 26}, + { 27, 30, 41, 57, 60, 54, 53, 57, 62, 57, 52, 48, 47, 48, 43, 43, 41, 39, 40, 37, 31, 36, 24, 16, 58, 125, 154, 159, 131, 101, 88, 113, 129, 122, 97, 73, 49, 28, 18, 14, 13, 10, 7, 9, 15, 22, 37, 43, 47, 47, 47, 43, 41, 43, 47, 53, 64, 67, 62, 54, 40, 35, 33, 28, 22}, + { 24, 28, 43, 49, 49, 48, 50, 52, 49, 47, 44, 45, 44, 44, 47, 47, 49, 50, 50, 44, 37, 31, 22, 18, 23, 75, 135, 160, 134, 113, 108, 108, 112, 100, 77, 60, 44, 28, 16, 15, 13, 9, 7, 9, 13, 24, 43, 44, 43, 47, 45, 44, 41, 41, 45, 48, 52, 47, 40, 43, 44, 45, 37, 28, 27}, + { 23, 28, 33, 39, 45, 49, 53, 49, 43, 44, 45, 45, 48, 54, 57, 58, 60, 60, 62, 54, 45, 28, 24, 24, 16, 20, 78, 161, 193, 172, 129, 108, 94, 73, 56, 49, 36, 23, 18, 16, 11, 7, 7, 7, 13, 23, 45, 48, 44, 50, 54, 54, 44, 41, 47, 48, 48, 44, 44, 52, 50, 50, 39, 24, 23}, + { 20, 28, 27, 28, 27, 41, 53, 50, 43, 44, 40, 43, 43, 49, 48, 52, 54, 57, 61, 57, 41, 33, 33, 33, 22, 10, 20, 91, 150, 138, 107, 78, 58, 49, 44, 37, 26, 19, 18, 16, 14, 11, 10, 9, 14, 22, 36, 49, 52, 58, 61, 54, 45, 49, 49, 54, 53, 47, 47, 52, 45, 41, 30, 22, 23}, + { 22, 28, 36, 36, 28, 36, 50, 52, 49, 43, 36, 40, 43, 52, 52, 60, 67, 80, 87, 66, 37, 36, 26, 23, 15, 9, 7, 19, 52, 60, 52, 44, 39, 33, 28, 23, 27, 24, 19, 19, 16, 15, 11, 9, 13, 16, 27, 40, 40, 43, 48, 47, 43, 47, 45, 45, 45, 37, 37, 44, 43, 50, 43, 30, 22}, + { 22, 27, 32, 22, 32, 33, 48, 54, 54, 54, 54, 58, 64, 71, 74, 84, 88, 95, 94, 75, 39, 27, 22, 24, 18, 9, 6, 6, 10, 35, 31, 26, 22, 20, 26, 33, 37, 37, 35, 23, 16, 11, 10, 10, 14, 13, 20, 33, 36, 41, 48, 48, 41, 39, 39, 40, 32, 28, 30, 35, 43, 40, 35, 35, 22}, + { 22, 23, 22, 16, 33, 30, 40, 54, 58, 61, 66, 73, 75, 84, 88, 99, 103, 100, 91, 77, 45, 26, 26, 24, 20, 11, 10, 7, 13, 69, 74, 54, 37, 36, 44, 52, 60, 61, 49, 28, 19, 11, 10, 13, 22, 16, 26, 39, 43, 44, 52, 54, 47, 43, 41, 40, 31, 31, 39, 40, 40, 35, 24, 31, 27}, + { 23, 24, 27, 22, 23, 33, 48, 53, 71, 78, 80, 84, 86, 92, 90, 94, 99, 95, 90, 73, 50, 28, 27, 24, 20, 13, 11, 9, 11, 80, 116, 94, 71, 62, 64, 70, 82, 83, 65, 39, 23, 15, 11, 13, 22, 18, 23, 37, 47, 61, 73, 62, 65, 60, 60, 61, 60, 62, 71, 77, 66, 44, 32, 37, 31}, + { 26, 32, 39, 44, 48, 58, 61, 67, 77, 69, 70, 70, 64, 78, 84, 83, 87, 86, 79, 58, 43, 26, 24, 20, 16, 14, 14, 11, 14, 70, 128, 122, 105, 91, 91, 95, 105, 104, 86, 50, 31, 19, 15, 19, 27, 15, 14, 27, 36, 49, 54, 58, 70, 77, 79, 71, 86, 94, 91, 86, 66, 58, 39, 28, 30}, + { 27, 44, 54, 62, 67, 78, 80, 84, 82, 67, 52, 50, 52, 40, 53, 62, 53, 57, 43, 37, 23, 15, 15, 14, 14, 14, 14, 19, 44, 91, 126, 135, 126, 118, 117, 121, 125, 122, 101, 64, 33, 27, 26, 27, 33, 13, 10, 11, 11, 19, 28, 27, 49, 50, 32, 60, 101, 107, 90, 74, 67, 62, 32, 16, 14}, + { 28, 49, 60, 62, 64, 77, 71, 74, 77, 61, 52, 54, 64, 32, 22, 26, 24, 28, 18, 18, 15, 14, 15, 14, 13, 16, 31, 67, 113, 142, 148, 150, 141, 139, 142, 146, 143, 141, 121, 79, 41, 35, 41, 35, 33, 13, 10, 10, 13, 18, 24, 26, 30, 28, 26, 45, 91, 103, 79, 69, 69, 64, 32, 11, 15}, + { 23, 40, 58, 54, 44, 56, 66, 73, 64, 48, 54, 57, 54, 30, 18, 15, 14, 24, 23, 11, 10, 15, 16, 18, 19, 50, 96, 126, 159, 176, 175, 169, 161, 163, 169, 171, 164, 154, 137, 94, 53, 40, 50, 43, 32, 15, 14, 13, 18, 30, 40, 53, 73, 82, 87, 95, 109, 97, 65, 62, 61, 53, 27, 15, 22}, + { 27, 36, 43, 41, 35, 57, 69, 66, 60, 56, 66, 71, 54, 22, 23, 27, 9, 26, 22, 14, 14, 16, 16, 19, 48, 114, 152, 175, 188, 190, 192, 186, 182, 186, 190, 185, 175, 159, 133, 86, 49, 49, 62, 45, 27, 16, 18, 15, 15, 26, 41, 56, 90, 124, 121, 104, 94, 83, 75, 69, 58, 47, 37, 31, 23}, + { 28, 44, 40, 37, 36, 64, 69, 67, 67, 75, 84, 71, 50, 24, 32, 35, 11, 23, 26, 18, 15, 19, 19, 37, 87, 158, 182, 195, 203, 203, 206, 199, 192, 194, 197, 190, 178, 160, 138, 91, 62, 53, 58, 39, 19, 15, 20, 19, 22, 20, 27, 32, 60, 104, 109, 108, 96, 94, 86, 77, 71, 79, 64, 41, 22}, + { 26, 43, 47, 58, 49, 69, 78, 79, 75, 82, 77, 61, 49, 39, 37, 44, 26, 33, 32, 15, 14, 22, 36, 64, 125, 182, 195, 205, 214, 211, 205, 199, 197, 201, 203, 194, 184, 165, 137, 96, 67, 54, 56, 33, 14, 15, 22, 33, 31, 24, 22, 28, 49, 73, 86, 95, 96, 97, 86, 87, 90, 86, 60, 44, 24}, + { 27, 47, 47, 64, 48, 61, 99, 97, 94, 95, 82, 70, 53, 48, 50, 52, 40, 33, 19, 10, 13, 37, 67, 91, 151, 194, 207, 211, 212, 210, 205, 202, 201, 207, 205, 194, 184, 167, 134, 83, 61, 53, 53, 28, 13, 19, 41, 62, 53, 44, 26, 19, 37, 52, 73, 88, 94, 96, 83, 96, 91, 87, 82, 67, 26}, + { 32, 37, 40, 53, 37, 47, 74, 97, 114, 107, 94, 88, 64, 54, 61, 57, 32, 15, 11, 13, 18, 66, 103, 120, 175, 201, 208, 215, 215, 212, 207, 206, 203, 208, 205, 192, 178, 165, 133, 92, 74, 56, 50, 32, 35, 53, 69, 74, 65, 52, 33, 15, 16, 31, 49, 62, 78, 96, 101, 107, 117, 122, 121, 96, 50}, + { 31, 44, 47, 45, 36, 47, 52, 47, 73, 103, 99, 87, 77, 61, 60, 43, 16, 13, 15, 13, 30, 94, 133, 163, 194, 206, 208, 212, 212, 215, 216, 214, 208, 208, 205, 198, 186, 167, 134, 92, 70, 52, 58, 71, 84, 92, 96, 95, 83, 65, 45, 20, 15, 10, 16, 27, 32, 50, 64, 60, 69, 79, 84, 71, 61}, + { 37, 52, 60, 67, 60, 56, 52, 40, 48, 66, 91, 86, 90, 86, 57, 19, 11, 15, 16, 14, 48, 118, 163, 189, 202, 210, 210, 211, 212, 215, 222, 219, 215, 212, 211, 205, 186, 163, 128, 95, 78, 70, 78, 90, 108, 114, 99, 83, 62, 45, 28, 14, 10, 9, 7, 11, 24, 26, 24, 27, 40, 60, 75, 80, 66}, + { 32, 50, 60, 66, 57, 57, 62, 56, 53, 64, 73, 67, 87, 101, 41, 11, 13, 16, 15, 18, 50, 116, 185, 205, 210, 207, 205, 205, 210, 220, 224, 227, 222, 216, 215, 210, 192, 164, 131, 104, 83, 84, 103, 100, 80, 57, 43, 33, 23, 18, 13, 10, 6, 7, 9, 6, 18, 26, 22, 19, 23, 52, 86, 109, 80}, + { 35, 49, 49, 52, 57, 67, 77, 67, 71, 82, 87, 95, 96, 69, 20, 13, 14, 20, 16, 27, 53, 83, 152, 192, 207, 206, 194, 198, 211, 223, 228, 228, 225, 222, 219, 211, 194, 159, 125, 91, 80, 79, 60, 39, 31, 30, 23, 15, 11, 9, 6, 6, 6, 6, 6, 6, 7, 22, 23, 23, 22, 27, 41, 61, 48}, + { 31, 50, 57, 73, 80, 92, 96, 83, 91, 103, 101, 88, 53, 23, 15, 13, 18, 24, 23, 37, 60, 75, 92, 111, 150, 169, 168, 197, 216, 219, 222, 222, 220, 218, 208, 198, 163, 116, 88, 67, 47, 33, 27, 24, 18, 13, 11, 10, 6, 6, 5, 5, 6, 6, 5, 7, 7, 18, 36, 36, 32, 27, 32, 28, 20}, + { 26, 52, 69, 83, 95, 87, 79, 79, 83, 77, 70, 50, 19, 18, 15, 13, 22, 20, 35, 50, 64, 64, 71, 77, 84, 86, 103, 137, 168, 185, 194, 202, 206, 201, 185, 148, 100, 75, 66, 40, 28, 24, 20, 14, 10, 15, 15, 16, 10, 6, 5, 5, 6, 6, 6, 7, 9, 10, 35, 45, 50, 37, 31, 31, 14}, + { 23, 52, 71, 78, 90, 86, 75, 80, 86, 79, 65, 30, 16, 19, 15, 14, 18, 20, 44, 60, 61, 56, 52, 64, 65, 73, 78, 83, 88, 97, 105, 112, 121, 124, 108, 84, 67, 53, 48, 28, 19, 13, 13, 23, 31, 35, 24, 20, 13, 5, 5, 5, 6, 6, 5, 7, 7, 7, 20, 35, 44, 32, 27, 35, 19}, + { 16, 39, 67, 74, 86, 94, 94, 95, 101, 103, 90, 30, 19, 16, 14, 13, 15, 23, 47, 49, 53, 41, 47, 53, 52, 69, 73, 70, 75, 78, 77, 75, 74, 78, 73, 64, 43, 41, 24, 11, 10, 10, 15, 32, 49, 32, 26, 18, 10, 6, 6, 6, 6, 5, 6, 5, 5, 6, 10, 18, 24, 22, 19, 31, 22}, + { 14, 22, 45, 58, 70, 82, 88, 87, 84, 80, 67, 24, 16, 15, 14, 13, 14, 20, 44, 39, 48, 32, 39, 33, 50, 65, 69, 66, 69, 66, 61, 57, 56, 61, 60, 43, 31, 19, 13, 13, 14, 19, 24, 35, 45, 28, 30, 22, 26, 27, 22, 22, 11, 7, 9, 5, 5, 6, 10, 28, 30, 27, 24, 18, 7}, + { 13, 18, 36, 53, 60, 67, 70, 64, 64, 65, 49, 20, 13, 13, 11, 11, 13, 23, 36, 28, 30, 31, 32, 28, 44, 58, 64, 64, 60, 50, 45, 45, 52, 50, 37, 20, 13, 11, 11, 15, 19, 26, 27, 31, 28, 32, 39, 58, 60, 43, 39, 31, 22, 13, 10, 9, 7, 9, 11, 28, 48, 43, 32, 13, 5}, + { 15, 19, 37, 54, 60, 61, 58, 60, 65, 58, 44, 18, 11, 9, 7, 9, 11, 22, 28, 27, 20, 31, 31, 26, 40, 43, 50, 49, 45, 35, 36, 47, 40, 32, 20, 10, 7, 7, 7, 13, 16, 23, 19, 19, 26, 36, 52, 64, 57, 41, 40, 33, 23, 10, 7, 10, 7, 7, 9, 15, 41, 48, 30, 9, 5}, + { 18, 23, 57, 77, 86, 86, 80, 80, 82, 54, 31, 14, 11, 7, 7, 9, 13, 19, 22, 22, 16, 28, 23, 20, 32, 23, 31, 35, 33, 28, 39, 37, 33, 28, 15, 9, 6, 6, 7, 10, 14, 15, 10, 14, 32, 39, 56, 62, 57, 52, 44, 22, 11, 6, 7, 9, 10, 7, 7, 6, 11, 15, 15, 6, 5}, + { 19, 37, 79, 92, 97, 96, 94, 99, 96, 69, 33, 18, 11, 7, 9, 10, 13, 14, 15, 16, 16, 24, 18, 16, 19, 19, 20, 22, 22, 35, 36, 36, 27, 11, 9, 7, 6, 7, 9, 9, 14, 14, 10, 20, 37, 44, 60, 61, 58, 41, 20, 6, 6, 5, 6, 6, 13, 11, 9, 7, 20, 32, 30, 10, 5}, + { 20, 61, 88, 96, 101, 103, 105, 105, 99, 50, 19, 15, 10, 9, 10, 9, 11, 13, 13, 15, 16, 22, 13, 15, 16, 20, 15, 13, 22, 35, 37, 28, 15, 11, 9, 5, 6, 9, 7, 7, 10, 10, 13, 30, 39, 43, 60, 52, 43, 19, 6, 5, 5, 6, 6, 6, 15, 18, 10, 9, 19, 40, 43, 27, 7}, + { 39, 70, 79, 87, 90, 91, 101, 94, 78, 28, 18, 14, 13, 11, 11, 11, 9, 11, 13, 11, 13, 19, 11, 13, 14, 15, 10, 11, 24, 31, 27, 18, 16, 14, 7, 5, 6, 7, 6, 7, 10, 11, 20, 35, 40, 40, 49, 36, 14, 9, 6, 5, 5, 6, 5, 5, 13, 18, 11, 7, 14, 41, 44, 43, 23}, + { 28, 41, 48, 58, 62, 65, 67, 58, 36, 18, 15, 15, 19, 22, 16, 11, 7, 9, 11, 9, 10, 16, 11, 10, 10, 13, 10, 16, 20, 23, 18, 18, 15, 11, 5, 3, 5, 6, 6, 7, 7, 11, 22, 37, 31, 27, 23, 14, 7, 10, 9, 6, 6, 6, 5, 5, 9, 13, 10, 6, 6, 19, 23, 20, 16}, + { 20, 28, 39, 49, 56, 50, 41, 30, 19, 15, 11, 15, 22, 28, 23, 16, 11, 9, 9, 9, 9, 14, 10, 9, 9, 9, 10, 16, 19, 20, 18, 16, 14, 7, 6, 5, 5, 6, 6, 6, 6, 9, 20, 22, 18, 14, 10, 7, 6, 13, 9, 6, 6, 5, 5, 5, 6, 7, 6, 5, 3, 6, 9, 9, 10}, + { 24, 36, 44, 50, 54, 44, 30, 19, 18, 15, 14, 20, 28, 32, 31, 20, 15, 13, 13, 10, 9, 13, 11, 10, 9, 7, 13, 15, 20, 18, 19, 14, 9, 9, 7, 6, 6, 5, 5, 5, 6, 9, 19, 18, 11, 7, 6, 6, 9, 11, 9, 6, 6, 6, 5, 3, 6, 6, 6, 6, 7, 13, 13, 11, 9}, + { 24, 36, 41, 47, 40, 22, 16, 18, 19, 16, 16, 26, 35, 36, 37, 28, 18, 15, 14, 10, 10, 14, 13, 13, 9, 6, 11, 15, 20, 19, 18, 7, 7, 11, 11, 9, 7, 5, 5, 5, 6, 6, 18, 13, 5, 5, 6, 7, 13, 13, 7, 6, 5, 5, 3, 5, 6, 7, 6, 7, 13, 15, 20, 18, 11}, + { 22, 28, 37, 30, 16, 14, 14, 19, 19, 24, 26, 33, 41, 44, 39, 26, 19, 16, 14, 11, 13, 14, 13, 13, 9, 9, 11, 20, 23, 14, 9, 6, 7, 10, 11, 9, 6, 5, 5, 5, 6, 6, 9, 5, 3, 3, 6, 10, 11, 9, 6, 5, 3, 3, 3, 5, 6, 6, 6, 6, 13, 14, 18, 15, 7}, + { 22, 28, 32, 16, 14, 13, 19, 22, 30, 35, 30, 24, 28, 30, 32, 24, 26, 19, 14, 11, 13, 13, 9, 9, 9, 10, 16, 26, 16, 7, 6, 6, 6, 7, 7, 6, 5, 5, 5, 5, 6, 7, 5, 3, 3, 3, 7, 13, 14, 11, 9, 7, 3, 5, 3, 3, 6, 7, 6, 7, 13, 15, 19, 18, 7}, + { 19, 27, 19, 16, 14, 18, 15, 15, 23, 23, 16, 16, 22, 23, 18, 14, 18, 18, 11, 9, 10, 10, 7, 7, 9, 14, 20, 15, 9, 6, 6, 6, 5, 6, 6, 6, 5, 6, 5, 6, 6, 7, 5, 3, 3, 5, 9, 13, 16, 15, 18, 15, 7, 3, 3, 3, 6, 7, 9, 11, 14, 14, 18, 20, 7}, + { 14, 18, 14, 16, 22, 20, 11, 14, 16, 19, 16, 20, 24, 19, 14, 10, 18, 15, 10, 7, 9, 9, 6, 6, 10, 13, 11, 9, 7, 7, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 6, 5, 5, 3, 5, 5, 7, 10, 13, 14, 22, 18, 11, 5, 3, 5, 3, 7, 11, 14, 14, 11, 14, 20, 9}, + { 9, 10, 9, 14, 16, 13, 18, 24, 44, 52, 49, 44, 43, 40, 33, 14, 13, 15, 10, 10, 9, 11, 7, 6, 7, 7, 9, 7, 7, 6, 6, 6, 6, 6, 5, 5, 5, 6, 5, 5, 5, 5, 5, 5, 5, 6, 9, 14, 11, 13, 14, 13, 7, 3, 3, 5, 3, 6, 10, 13, 11, 7, 9, 14, 10}, + { 9, 10, 13, 14, 15, 14, 31, 41, 56, 67, 37, 41, 48, 52, 40, 19, 13, 11, 10, 13, 14, 16, 10, 10, 6, 6, 9, 7, 6, 6, 7, 6, 6, 6, 5, 6, 7, 7, 7, 6, 5, 3, 5, 6, 6, 7, 11, 13, 10, 9, 7, 7, 7, 5, 3, 3, 2, 5, 10, 9, 5, 3, 2, 5, 3}, + { 11, 9, 11, 16, 16, 15, 33, 43, 52, 53, 74, 75, 56, 61, 50, 52, 39, 16, 22, 35, 37, 32, 16, 13, 9, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 9, 10, 7, 6, 5, 5, 9, 10, 9, 9, 7, 11, 13, 15, 11, 9, 9, 6, 3, 3, 2, 5, 10, 9, 5, 2, 2, 1, 0}, + { 11, 9, 13, 16, 14, 19, 33, 52, 74, 87, 82, 50, 69, 65, 67, 77, 54, 84, 137, 165, 158, 133, 92, 52, 23, 10, 6, 6, 6, 7, 6, 6, 6, 7, 9, 9, 7, 7, 6, 6, 6, 6, 7, 6, 6, 7, 7, 10, 15, 18, 13, 6, 6, 3, 3, 2, 2, 5, 7, 10, 10, 3, 2, 1, 0}, + { 9, 9, 13, 15, 14, 19, 30, 60, 77, 62, 56, 80, 56, 61, 64, 58, 96, 158, 194, 202, 192, 177, 156, 144, 113, 71, 39, 18, 9, 7, 6, 6, 6, 7, 7, 7, 5, 5, 5, 6, 6, 6, 6, 5, 6, 7, 9, 13, 16, 16, 10, 6, 5, 3, 2, 2, 2, 6, 6, 7, 9, 3, 1, 1, 0}, + { 10, 10, 13, 15, 14, 15, 26, 54, 65, 50, 69, 56, 44, 50, 41, 56, 111, 171, 186, 194, 186, 184, 173, 167, 152, 143, 142, 114, 52, 10, 6, 6, 6, 7, 7, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 9, 10, 11, 11, 7, 6, 3, 3, 3, 3, 3, 5, 5, 3, 2, 2, 2, 1, 0}, + { 13, 11, 11, 14, 13, 14, 23, 41, 37, 57, 56, 33, 37, 47, 39, 61, 107, 154, 165, 169, 167, 175, 176, 173, 165, 158, 158, 150, 120, 71, 37, 11, 6, 6, 6, 6, 5, 5, 5, 5, 6, 5, 6, 5, 5, 5, 6, 7, 10, 11, 7, 6, 5, 6, 5, 3, 3, 3, 3, 2, 2, 3, 2, 1, 0}, + { 15, 15, 15, 14, 13, 14, 18, 26, 26, 49, 36, 35, 40, 48, 39, 50, 86, 126, 135, 139, 142, 158, 168, 169, 171, 165, 161, 158, 151, 148, 128, 86, 36, 11, 7, 6, 5, 6, 5, 6, 6, 5, 6, 5, 5, 5, 5, 5, 7, 11, 7, 6, 5, 5, 3, 5, 3, 3, 3, 3, 2, 3, 2, 1, 0}, + { 15, 16, 18, 15, 16, 15, 15, 23, 24, 28, 23, 28, 27, 32, 28, 44, 54, 90, 96, 101, 116, 135, 150, 159, 165, 164, 164, 168, 165, 165, 164, 151, 104, 53, 19, 6, 6, 10, 11, 9, 10, 19, 37, 41, 30, 23, 20, 14, 7, 7, 7, 7, 6, 5, 6, 6, 3, 5, 3, 3, 2, 2, 2, 1, 0}, + { 14, 15, 15, 15, 18, 18, 18, 18, 19, 19, 14, 15, 18, 23, 19, 30, 32, 49, 57, 71, 100, 121, 134, 144, 152, 150, 148, 159, 151, 126, 146, 175, 155, 84, 56, 45, 50, 77, 71, 56, 44, 45, 69, 73, 57, 53, 52, 41, 22, 7, 5, 9, 6, 6, 6, 6, 5, 5, 3, 3, 3, 2, 2, 1, 1}, + { 13, 14, 13, 11, 13, 15, 14, 13, 14, 14, 10, 10, 19, 20, 18, 18, 26, 30, 44, 73, 95, 114, 124, 131, 138, 135, 134, 146, 143, 100, 70, 113, 143, 126, 87, 75, 77, 90, 90, 67, 70, 62, 58, 69, 67, 48, 40, 33, 31, 14, 6, 5, 5, 5, 6, 6, 5, 3, 3, 3, 3, 3, 2, 1, 1}, + { 10, 11, 10, 9, 9, 11, 11, 11, 10, 10, 10, 11, 14, 15, 16, 26, 54, 88, 117, 125, 95, 97, 107, 114, 118, 122, 125, 118, 133, 142, 84, 41, 66, 97, 90, 75, 73, 61, 57, 58, 56, 60, 48, 54, 67, 62, 37, 32, 31, 20, 9, 5, 5, 3, 5, 5, 3, 3, 3, 3, 3, 3, 2, 1, 1}, + { 11, 13, 10, 9, 9, 10, 11, 11, 11, 10, 13, 14, 11, 13, 36, 90, 105, 105, 139, 146, 112, 83, 86, 97, 103, 116, 126, 105, 92, 129, 139, 91, 44, 48, 69, 80, 73, 65, 47, 52, 56, 57, 57, 40, 33, 44, 40, 33, 32, 27, 14, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3}, + { 10, 10, 10, 9, 7, 9, 10, 11, 13, 13, 11, 14, 11, 15, 71, 91, 84, 111, 137, 144, 137, 97, 67, 75, 87, 95, 117, 137, 99, 77, 109, 121, 83, 47, 40, 56, 70, 53, 45, 37, 45, 49, 62, 48, 31, 26, 32, 24, 24, 26, 19, 5, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 6}, + { 9, 9, 10, 9, 10, 11, 11, 11, 14, 13, 11, 13, 14, 19, 73, 74, 96, 118, 118, 150, 141, 116, 79, 61, 75, 78, 74, 109, 138, 96, 61, 86, 99, 73, 39, 32, 33, 35, 31, 32, 32, 23, 45, 44, 24, 27, 26, 20, 14, 14, 9, 3, 3, 2, 3, 2, 3, 3, 3, 5, 3, 5, 3, 3, 7}, + { 10, 10, 11, 13, 13, 13, 11, 14, 15, 15, 14, 15, 15, 24, 73, 84, 104, 88, 111, 137, 138, 113, 87, 58, 53, 74, 64, 60, 101, 120, 70, 47, 75, 90, 69, 33, 33, 30, 19, 26, 24, 15, 24, 24, 19, 18, 24, 18, 11, 10, 7, 3, 3, 2, 2, 3, 3, 2, 3, 5, 5, 5, 5, 3, 6}, + { 10, 10, 11, 13, 13, 13, 13, 14, 16, 15, 15, 15, 16, 30, 67, 82, 78, 80, 112, 129, 118, 88, 69, 53, 37, 39, 56, 49, 50, 71, 66, 48, 39, 61, 86, 54, 26, 23, 15, 19, 15, 11, 15, 14, 11, 13, 15, 14, 9, 6, 5, 3, 3, 3, 3, 3, 3, 3, 5, 3, 5, 5, 5, 2, 3}, + { 10, 10, 11, 11, 11, 11, 11, 13, 13, 13, 14, 16, 18, 24, 48, 64, 69, 91, 114, 113, 79, 58, 41, 32, 24, 20, 26, 32, 33, 31, 35, 43, 37, 24, 41, 48, 15, 11, 10, 14, 10, 9, 10, 9, 7, 7, 9, 9, 6, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 1, 1}, + { 9, 10, 11, 13, 11, 11, 11, 10, 11, 13, 14, 15, 18, 20, 28, 47, 64, 94, 109, 73, 39, 31, 31, 32, 31, 35, 35, 28, 30, 33, 30, 24, 22, 15, 10, 11, 6, 7, 7, 7, 6, 6, 7, 6, 6, 6, 6, 5, 5, 3, 3, 3, 3, 3, 5, 5, 3, 3, 3, 5, 6, 3, 3, 1, 1}, + { 10, 10, 11, 13, 14, 14, 13, 13, 14, 14, 15, 14, 15, 18, 19, 26, 47, 84, 73, 40, 22, 30, 30, 28, 23, 26, 23, 22, 26, 28, 26, 16, 13, 11, 10, 9, 9, 9, 6, 6, 6, 6, 6, 6, 5, 6, 5, 5, 5, 5, 5, 3, 3, 3, 5, 5, 3, 5, 5, 6, 5, 2, 2, 1, 1}, + { 11, 13, 13, 14, 16, 15, 14, 13, 13, 15, 18, 16, 15, 15, 14, 16, 24, 61, 50, 26, 18, 26, 23, 19, 16, 15, 16, 18, 19, 16, 14, 11, 10, 10, 9, 9, 9, 9, 7, 7, 7, 6, 6, 6, 5, 5, 5, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 7, 5, 6, 5, 3, 2, 1, 1}, + { 11, 13, 14, 15, 16, 13, 11, 11, 11, 15, 18, 16, 15, 14, 14, 16, 20, 47, 40, 24, 20, 23, 19, 18, 18, 20, 23, 20, 18, 14, 13, 11, 11, 13, 11, 10, 9, 9, 7, 7, 6, 6, 6, 7, 9, 6, 5, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 5, 5, 5, 2, 3, 2, 1, 1}, + { 9, 10, 13, 14, 14, 14, 14, 14, 11, 15, 18, 16, 15, 14, 15, 18, 18, 27, 26, 18, 15, 15, 15, 15, 16, 18, 16, 14, 13, 11, 10, 9, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 9, 11, 9, 6, 5, 3, 3, 3, 2, 3, 3, 5, 3, 3, 7, 5, 2, 2, 5, 3, 1, 0}, + { 9, 10, 11, 13, 13, 14, 14, 13, 14, 15, 15, 14, 16, 15, 16, 16, 16, 18, 15, 11, 10, 11, 11, 9, 10, 9, 9, 7, 7, 7, 6, 6, 6, 6, 7, 7, 6, 5, 5, 6, 6, 5, 5, 6, 9, 7, 6, 5, 5, 3, 2, 2, 2, 2, 3, 3, 2, 9, 6, 3, 3, 11, 6, 2, 0}, + { 9, 9, 10, 13, 14, 14, 15, 13, 13, 15, 15, 15, 15, 15, 16, 18, 15, 16, 14, 11, 9, 9, 13, 10, 9, 7, 7, 6, 5, 6, 7, 6, 6, 9, 10, 11, 7, 6, 6, 5, 5, 5, 5, 6, 7, 6, 5, 5, 5, 3, 2, 3, 2, 2, 3, 3, 2, 5, 5, 2, 3, 10, 6, 2, 0}, + { 9, 9, 11, 13, 13, 14, 14, 13, 11, 13, 14, 13, 14, 14, 14, 14, 10, 11, 11, 10, 9, 10, 14, 15, 15, 9, 9, 6, 6, 6, 9, 7, 6, 7, 7, 7, 6, 5, 5, 6, 6, 6, 6, 7, 7, 5, 5, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 1, 7, 5, 1, 0}, + { 10, 10, 11, 11, 11, 11, 13, 13, 13, 14, 15, 18, 16, 15, 14, 13, 11, 10, 9, 9, 10, 11, 11, 14, 15, 10, 9, 9, 9, 9, 11, 9, 6, 6, 5, 6, 6, 6, 5, 6, 7, 6, 6, 6, 5, 3, 3, 3, 2, 3, 2, 2, 2, 2, 2, 2, 1, 2, 2, 3, 1, 3, 3, 0, 0}, + { 10, 11, 11, 13, 13, 11, 11, 13, 14, 15, 16, 16, 16, 16, 14, 14, 11, 10, 10, 10, 11, 14, 14, 14, 18, 14, 11, 11, 13, 10, 10, 10, 7, 6, 6, 6, 7, 7, 7, 10, 10, 6, 6, 6, 3, 3, 3, 3, 3, 5, 3, 2, 2, 2, 2, 2, 2, 2, 2, 5, 2, 3, 2, 1, 0}, + { 11, 13, 13, 13, 13, 14, 11, 14, 14, 15, 16, 16, 16, 15, 13, 13, 11, 11, 11, 13, 14, 15, 14, 14, 19, 18, 15, 13, 13, 11, 13, 11, 11, 7, 7, 7, 10, 10, 10, 11, 13, 9, 9, 10, 6, 5, 5, 5, 5, 7, 5, 5, 5, 5, 3, 3, 2, 3, 3, 3, 2, 2, 3, 1, 0} + }; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/CacheScatterLimitsDecorator.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/CacheScatterLimitsDecorator.cs new file mode 100644 index 000000000..0f8c33039 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/CacheScatterLimitsDecorator.cs @@ -0,0 +1,53 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class CacheScatterLimitsDecorator : IScatterSource + { + private readonly IScatterSource _source; + + private AxisLimits? _axisLimits = null; + private CoordinateRange _limitsX = CoordinateRange.NotSet; + private CoordinateRange _limitsY = CoordinateRange.NotSet; + + public CacheScatterLimitsDecorator(IScatterSource source) + { + _source = source; + } + + public AxisLimits GetLimits() + { + _axisLimits ??= _source.GetLimits(); + + return _axisLimits.Value; + } + + public CoordinateRange GetLimitsX() + { + if (_limitsX == CoordinateRange.NotSet) + { + _limitsX = _source.GetLimitsX(); + } + + return _limitsX; + } + + public CoordinateRange GetLimitsY() + { + if (_limitsY == CoordinateRange.NotSet) + { + _limitsY = _source.GetLimitsY(); + } + + return _limitsY; + } + + public DataPoint GetNearest(Coordinates mouseLocation, RenderDetails renderInfo, float maxDistance = 15) + { + return _source.GetNearest(mouseLocation, renderInfo, maxDistance); + } + + public IReadOnlyList GetScatterPoints() + { + return _source.GetScatterPoints(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/DataLoggerSource.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/DataLoggerSource.cs new file mode 100644 index 000000000..5de2bcb7b --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/DataLoggerSource.cs @@ -0,0 +1,62 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class DataLoggerSource + { + // TODO: support unevenly spaced X positions + + // TODO: render using SignalXY binary search strategy + + public readonly List Coordinates = []; + public double Period = 1; + + private double _yMin = double.PositiveInfinity; + private double _yMax = double.NegativeInfinity; + + public int CountOnLastRender = -1; + public int CountTotal => Coordinates.Count; + + public DataLoggerSource() + { + } + + public void Add(double y) + { + var x = Coordinates.Count * Period; + Add(x, y); + } + + public void Add(double x, double y) + { + Add(new Coordinates(x, y)); + } + + public void Add(Coordinates coordinates) + { + if (Coordinates.Any()) + { + if (coordinates.X < Coordinates.Last().X) + { + throw new ArgumentException("new X values cannot be smaller than existing ones"); + } + } + + Coordinates.Add(coordinates); + _yMin = Math.Min(_yMin, coordinates.Y); + _yMax = Math.Max(_yMax, coordinates.Y); + } + + public void Clear() + { + Coordinates.Clear(); + _yMin = double.PositiveInfinity; + _yMax = double.NegativeInfinity; + } + + public AxisLimits GetAxisLimits() + { + return Coordinates.Any() + ? new AxisLimits(Coordinates.First().X, Coordinates.Last().X, _yMin, _yMax) + : AxisLimits.NoLimits; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/DataStreamerSource.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/DataStreamerSource.cs new file mode 100644 index 000000000..069696a77 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/DataStreamerSource.cs @@ -0,0 +1,112 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class DataStreamerSource + { + /// + /// Fixed-length array used as a circular buffer to shift data in at the position defined by . + /// Values in this array should not be modified externally if is enabled. + /// + public double[] Data { get; } + + /// + /// Index in where the next point will be added + /// + public int NextIndex { get; private set; } = 0; + + /// + /// The fied number of visible data points to display + /// + public int Length => Data.Length; + + /// + /// The total number of data points added + /// + public int CountTotal { get; private set; } = 0; + + /// + /// Total of data points added the last time this plottable was rendered. + /// This can be compared with to determine if a new render is required. + /// + public int CountTotalOnLastRender { get; set; } = -1; + + /// + /// Minimum value of all known data (not just the data in view) + /// + public double DataMin { get; private set; } = double.PositiveInfinity; + + /// + /// Maximum value of all known data (not just the data in view) + /// + public double DataMax { get; private set; } = double.NegativeInfinity; + + public double OffsetX { get; set; } = 0; + + public double OffsetY { get; set; } = 0; + + public double SamplePeriod { get; set; } = 1; + + public DataStreamerSource(double[] data) + { + Data = data; + } + + /// + /// Shift in a new Y value + /// + public void Add(double value) + { + Data[NextIndex] = value; + NextIndex += 1; + + if (NextIndex >= Data.Length) + { + NextIndex = 0; + } + + DataMin = Math.Min(value, DataMin); + DataMax = Math.Max(value, DataMax); + + CountTotal += 1; + } + + /// + /// Shift in a collection of new Y values + /// + public void AddRange(IEnumerable values) + { + foreach (var value in values) + { + Add(value); + } + } + + /// + /// Clear the buffer by setting all Y points to the given value + /// + public void Clear(double value = 0) + { + for (var i = 0; i < Data.Length; i++) + { + Data[i] = 0; + } + + DataMin = value; + DataMax = value; + + NextIndex = 0; + CountTotal = 0; + } + + public AxisLimits GetAxisLimits() + { + if (double.IsInfinity(DataMin) || double.IsInfinity(DataMax)) + { + return AxisLimits.NoLimits; + } + + var xMin = OffsetX; + var xMax = xMin + Data.Length * SamplePeriod; + return new AxisLimits(xMin, xMax, DataMin, DataMax); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/FunctionSource.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/FunctionSource.cs new file mode 100644 index 000000000..f2bc7ef21 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/FunctionSource.cs @@ -0,0 +1,16 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class FunctionSource(Func func) : IFunctionSource + { + public CoordinateRange RangeX { get; set; } = CoordinateRange.Infinity; + public Func Function { get; set; } = func; + public Func? GetRangeYFunc { get; set; } = null; + + public double Get(double x) => Function(x); + + public CoordinateRange GetRangeY(CoordinateRange xs) + { + return GetRangeYFunc is null ? CoordinateRange.NotSet : GetRangeYFunc(xs); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/OHLCSource.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/OHLCSource.cs new file mode 100644 index 000000000..aa8d41484 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/OHLCSource.cs @@ -0,0 +1,36 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class OhlcSource : IOhlcSource + { + private readonly List _prices; + + public OhlcSource(List prices) + { + _prices = prices; + } + + public List GetOhlCs() + { + return _prices; + } + + public AxisLimits GetLimits() + { + return _prices.Any() ? new AxisLimits(GetLimitsX(), GetLimitsY()) : AxisLimits.NoLimits; + } + + public CoordinateRange GetLimitsX() + { + var dates = _prices.Select(x => x.DateTime); + return new CoordinateRange(dates.Min().ToNumber(), dates.Max().ToNumber()); + } + + public CoordinateRange GetLimitsY() + { + var priceRanges = _prices.Select(x => x.GetPriceRange()); + double min = priceRanges.Select(x => x.Min).Min(); + double max = priceRanges.Select(x => x.Max).Max(); + return new CoordinateRange(min, max); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/ScatterSourceCoordinatesArray.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/ScatterSourceCoordinatesArray.cs new file mode 100644 index 000000000..5b68f3303 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/ScatterSourceCoordinatesArray.cs @@ -0,0 +1,67 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This data source manages X/Y points as a collection of coordinates + /// + public class ScatterSourceCoordinatesArray : IScatterSource + { + private readonly Coordinates[] _coordinates; + + public ScatterSourceCoordinatesArray(Coordinates[] coordinates) + { + _coordinates = coordinates; + } + + public IReadOnlyList GetScatterPoints() + { + // TODO: try to avoid calling this + return _coordinates; + } + + public AxisLimits GetLimits() + { + ExpandingAxisLimits limits = new(); + limits.Expand(_coordinates); + return limits.AxisLimits; + } + + public CoordinateRange GetLimitsX() + { + return GetLimits().Rect.XRange; + } + + public CoordinateRange GetLimitsY() + { + return GetLimits().Rect.YRange; + } + + public DataPoint GetNearest(Coordinates mouseLocation, RenderDetails renderInfo, float maxDistance = 15) + { + double maxDistanceSquared = maxDistance * maxDistance; + var closestDistanceSquared = double.PositiveInfinity; + + var closestIndex = 0; + var closestX = double.PositiveInfinity; + var closestY = double.PositiveInfinity; + + for (var i = 0; i < _coordinates.Length; i++) + { + double dX = (_coordinates[i].X - mouseLocation.X) * renderInfo.PxPerUnitX; + double dY = (_coordinates[i].Y - mouseLocation.Y) * renderInfo.PxPerUnitY; + var distanceSquared = dX * dX + dY * dY; + + if (distanceSquared <= closestDistanceSquared) + { + closestDistanceSquared = distanceSquared; + closestX = _coordinates[i].X; + closestY = _coordinates[i].Y; + closestIndex = i; + } + } + + return closestDistanceSquared <= maxDistanceSquared + ? new DataPoint(closestX, closestY, closestIndex) + : DataPoint.None; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/ScatterSourceCoordinatesList.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/ScatterSourceCoordinatesList.cs new file mode 100644 index 000000000..3762e7807 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/ScatterSourceCoordinatesList.cs @@ -0,0 +1,67 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This data source manages X/Y points as a collection of coordinates + /// + public class ScatterSourceCoordinatesList : IScatterSource + { + private readonly List _coordinates; + + public ScatterSourceCoordinatesList(List coordinates) + { + _coordinates = coordinates; + } + + public IReadOnlyList GetScatterPoints() + { + // TODO: try to avoid calling this + return _coordinates; + } + + public AxisLimits GetLimits() + { + ExpandingAxisLimits limits = new(); + limits.Expand(_coordinates); + return limits.AxisLimits; + } + + public CoordinateRange GetLimitsX() + { + return GetLimits().Rect.XRange; + } + + public CoordinateRange GetLimitsY() + { + return GetLimits().Rect.YRange; + } + + public DataPoint GetNearest(Coordinates mouseLocation, RenderDetails renderInfo, float maxDistance = 15) + { + double maxDistanceSquared = maxDistance * maxDistance; + var closestDistanceSquared = double.PositiveInfinity; + + var closestIndex = 0; + var closestX = double.PositiveInfinity; + var closestY = double.PositiveInfinity; + + for (var i = 0; i < _coordinates.Count; i++) + { + double dX = (_coordinates[i].X - mouseLocation.X) * renderInfo.PxPerUnitX; + double dY = (_coordinates[i].Y - mouseLocation.Y) * renderInfo.PxPerUnitY; + var distanceSquared = dX * dX + dY * dY; + + if (distanceSquared <= closestDistanceSquared) + { + closestDistanceSquared = distanceSquared; + closestX = _coordinates[i].X; + closestY = _coordinates[i].Y; + closestIndex = i; + } + } + + return closestDistanceSquared <= maxDistanceSquared + ? new DataPoint(closestX, closestY, closestIndex) + : DataPoint.None; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/ScatterSourceDoubleArray.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/ScatterSourceDoubleArray.cs new file mode 100644 index 000000000..61e2453f5 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/ScatterSourceDoubleArray.cs @@ -0,0 +1,77 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This data source manages X/Y points as separate X and Y collections + /// + public class ScatterSourceDoubleArray : IScatterSource + { + private readonly double[] _xs; + private readonly double[] _ys; + + public ScatterSourceDoubleArray(double[] xs, double[] ys) + { + _xs = xs; + _ys = ys; + } + + public IReadOnlyList GetScatterPoints() + { + // TODO: try to avoid calling this + return _xs.Zip(_ys, (x, y) => new Coordinates(x, y)).ToArray(); + } + + public AxisLimits GetLimits() + { + return new AxisLimits(GetLimitsX(), GetLimitsY()); + } + + public CoordinateRange GetLimitsX() + { + if (!_xs.Any()) + { + return CoordinateRange.NotSet; + } + + return new CoordinateRange(_xs.Min(), _xs.Max()); + } + + public CoordinateRange GetLimitsY() + { + if (!_ys.Any()) + { + return CoordinateRange.NotSet; + } + + return new CoordinateRange(_ys.Min(), _ys.Max()); + } + + public DataPoint GetNearest(Coordinates mouseLocation, RenderDetails renderInfo, float maxDistance = 15) + { + double maxDistanceSquared = maxDistance * maxDistance; + var closestDistanceSquared = double.PositiveInfinity; + + var closestIndex = 0; + var closestX = double.PositiveInfinity; + var closestY = double.PositiveInfinity; + + for (var i = 0; i < _xs.Length; i++) + { + var dX = (_xs[i] - mouseLocation.X) * renderInfo.PxPerUnitX; + var dY = (_ys[i] - mouseLocation.Y) * renderInfo.PxPerUnitY; + var distanceSquared = dX * dX + dY * dY; + + if (distanceSquared <= closestDistanceSquared) + { + closestDistanceSquared = distanceSquared; + closestX = _xs[i]; + closestY = _ys[i]; + closestIndex = i; + } + } + + return closestDistanceSquared <= maxDistanceSquared + ? new DataPoint(closestX, closestY, closestIndex) + : DataPoint.None; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/ScatterSourceGenericArray.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/ScatterSourceGenericArray.cs new file mode 100644 index 000000000..40f504a9e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/ScatterSourceGenericArray.cs @@ -0,0 +1,90 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This data source manages X/Y points as separate X and Y collections + /// + public class ScatterSourceGenericArray : IScatterSource + { + private readonly T1[] _xs; + private readonly T2[] _ys; + + public ScatterSourceGenericArray(T1[] xs, T2[] ys) + { + if (xs.Length != ys.Length) + { + throw new ArgumentException($"{nameof(xs)} and {nameof(ys)} must have equal length"); + } + + _xs = xs; + _ys = ys; + } + + public IReadOnlyList GetScatterPoints() + { + // TODO: try to avoid calling this + return _xs.Zip(_ys, (x, y) => NumericConversion.GenericToCoordinates(ref x, ref y)).ToArray(); + } + + public AxisLimits GetLimits() + { + return new AxisLimits(GetLimitsX(), GetLimitsY()); + } + + public CoordinateRange GetLimitsX() + { + if (_xs.Length == 0) + { + return CoordinateRange.NotSet; + } + + var values = NumericConversion.GenericToDoubleArray(_xs); + + return new CoordinateRange(values.Min(), values.Max()); + } + + public CoordinateRange GetLimitsY() + { + if (_ys.Length == 0) + { + return CoordinateRange.NotSet; + } + + var values = NumericConversion.GenericToDoubleArray(_ys); + + return new CoordinateRange(values.Min(), values.Max()); + } + + public DataPoint GetNearest(Coordinates mouseLocation, RenderDetails renderInfo, float maxDistance = 15) + { + double maxDistanceSquared = maxDistance * maxDistance; + var closestDistanceSquared = double.PositiveInfinity; + + var closestIndex = 0; + var closestX = double.PositiveInfinity; + var closestY = double.PositiveInfinity; + + for (var i = 0; i < _xs.Length; i++) + { + var xValue = _xs[i]; + var yValue = _ys[i]; + var xValueDouble = NumericConversion.GenericToDouble(ref xValue); + var yValueDouble = NumericConversion.GenericToDouble(ref yValue); + var dX = (xValueDouble - mouseLocation.X) * renderInfo.PxPerUnitX; + var dY = (yValueDouble - mouseLocation.Y) * renderInfo.PxPerUnitY; + var distanceSquared = dX * dX + dY * dY; + + if (distanceSquared <= closestDistanceSquared) + { + closestDistanceSquared = distanceSquared; + closestX = xValueDouble; + closestY = yValueDouble; + closestIndex = i; + } + } + + return closestDistanceSquared <= maxDistanceSquared + ? new DataPoint(closestX, closestY, closestIndex) + : DataPoint.None; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/ScatterSourceGenericList.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/ScatterSourceGenericList.cs new file mode 100644 index 000000000..2c383ef7f --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/ScatterSourceGenericList.cs @@ -0,0 +1,90 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This data source manages X/Y points as separate X and Y collections + /// + public class ScatterSourceGenericList : IScatterSource + { + private readonly List _xs; + private readonly List _ys; + + public ScatterSourceGenericList(List xs, List ys) + { + if (xs.Count != ys.Count) + { + throw new ArgumentException($"{nameof(xs)} and {nameof(ys)} must have equal length"); + } + + _xs = xs; + _ys = ys; + } + + public IReadOnlyList GetScatterPoints() + { + // TODO: try to avoid calling this + return _xs.Zip(_ys, (x, y) => NumericConversion.GenericToCoordinates(ref x, ref y)).ToArray(); + } + + public AxisLimits GetLimits() + { + return new AxisLimits(GetLimitsX(), GetLimitsY()); + } + + public CoordinateRange GetLimitsX() + { + if (_xs.Count == 0) + { + return CoordinateRange.NotSet; + } + + var values = NumericConversion.GenericToDoubleArray(_xs); + + return new CoordinateRange(values.Min(), values.Max()); + } + + public CoordinateRange GetLimitsY() + { + if (_ys.Count == 0) + { + return CoordinateRange.NotSet; + } + + var values = NumericConversion.GenericToDoubleArray(_ys); + + return new CoordinateRange(values.Min(), values.Max()); + } + + public DataPoint GetNearest(Coordinates mouseLocation, RenderDetails renderInfo, float maxDistance = 15) + { + double maxDistanceSquared = maxDistance * maxDistance; + var closestDistanceSquared = double.PositiveInfinity; + + var closestIndex = 0; + var closestX = double.PositiveInfinity; + var closestY = double.PositiveInfinity; + + for (var i = 0; i < _xs.Count; i++) + { + var xValue = _xs[i]; + var yValue = _ys[i]; + var xValueDouble = NumericConversion.GenericToDouble(ref xValue); + var yValueDouble = NumericConversion.GenericToDouble(ref yValue); + var dX = (xValueDouble - mouseLocation.X) * renderInfo.PxPerUnitX; + var dY = (yValueDouble - mouseLocation.Y) * renderInfo.PxPerUnitY; + var distanceSquared = dX * dX + dY * dY; + + if (distanceSquared <= closestDistanceSquared) + { + closestDistanceSquared = distanceSquared; + closestX = xValueDouble; + closestY = yValueDouble; + closestIndex = i; + } + } + + return closestDistanceSquared <= maxDistanceSquared + ? new DataPoint(closestX, closestY, closestIndex) + : DataPoint.None; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SegmentedTree.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SegmentedTree.cs new file mode 100644 index 000000000..e60f00dc7 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SegmentedTree.cs @@ -0,0 +1,331 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class SegmentedTree where T : struct, IComparable + { + private T[] _sourceArray; + + private T[]? _treeMin; + private T[]? _treeMax; + private int _n = 0; // size of each Tree + public bool TreesReady = false; + + // precompiled lambda expressions for fast math on generic + private static Func _minExp; + private static Func _maxExp; + private static Func _equalExp; + private static Func _maxValue; + private static Func _minValue; + private static Func _lessThanExp; + private static Func _greaterThanExp; + + public T[] SourceArray + { + get => _sourceArray; + set + { + _sourceArray = value ?? throw new Exception("Source Array cannot be null"); + UpdateTrees(); + } + } + + public SegmentedTree() + { + try // runtime check + { + var v = new T(); + NumericConversion.GenericToDouble(ref v); + } + catch + { + throw new ArgumentOutOfRangeException("Unsupported data type, provide convertable to double data types"); + } + InitExp(); + } + + public async Task SetSourceAsync(T[] data) + { + _sourceArray = data ?? throw new ArgumentNullException("Data cannot be null"); + await Task.Run(() => UpdateTrees()); + } + + private void InitExp() + { + var paramA = Expression.Parameter(typeof(T), "a"); + var paramB = Expression.Parameter(typeof(T), "b"); + // add the parameters together + var bodyMin = Expression.Condition(Expression.LessThanOrEqual(paramA, paramB), paramA, paramB); + var bodyMax = Expression.Condition(Expression.GreaterThanOrEqual(paramA, paramB), paramA, paramB); + var bodyEqual = Expression.Equal(paramA, paramB); + var bodyMaxValue = Expression.MakeMemberAccess(null, typeof(T).GetField("MaxValue")); + var bodyMinValue = Expression.MakeMemberAccess(null, typeof(T).GetField("MinValue")); + var bodyLessThan = Expression.LessThan(paramA, paramB); + var bodyGreaterThan = Expression.GreaterThan(paramA, paramB); + // compile it + _minExp = Expression.Lambda>(bodyMin, paramA, paramB).Compile(); + _maxExp = Expression.Lambda>(bodyMax, paramA, paramB).Compile(); + _equalExp = Expression.Lambda>(bodyEqual, paramA, paramB).Compile(); + _maxValue = Expression.Lambda>(bodyMaxValue).Compile(); + _minValue = Expression.Lambda>(bodyMinValue).Compile(); + _lessThanExp = Expression.Lambda>(bodyLessThan, paramA, paramB).Compile(); + _greaterThanExp = Expression.Lambda>(bodyGreaterThan, paramA, paramB).Compile(); + } + + public void UpdateElement(int index, T newValue) + { + _sourceArray[index] = newValue; + // Update Tree, can be optimized + if (index == _sourceArray.Length - 1) // last elem haven't pair + { + _treeMin![_n / 2 + index / 2] = _sourceArray[index]; + _treeMax![_n / 2 + index / 2] = _sourceArray[index]; + } + else if (index % 2 == 0) // even elem have right pair + { + _treeMin![_n / 2 + index / 2] = _minExp(_sourceArray[index], _sourceArray[index + 1]); + _treeMax![_n / 2 + index / 2] = _maxExp(_sourceArray[index], _sourceArray[index + 1]); + } + else // odd elem have left pair + { + _treeMin![_n / 2 + index / 2] = _minExp(_sourceArray[index], _sourceArray[index - 1]); + _treeMax![_n / 2 + index / 2] = _maxExp(_sourceArray[index], _sourceArray[index - 1]); + } + + T candidate; + for (var i = (_n / 2 + index / 2) / 2; i > 0; i /= 2) + { + candidate = _minExp(_treeMin[i * 2], _treeMin[i * 2 + 1]); + if (_equalExp(_treeMin[i], candidate)) // if node same then new value don't need to recalc all upper + { + break; + } + + _treeMin[i] = candidate; + } + for (var i = (_n / 2 + index / 2) / 2; i > 0; i /= 2) + { + candidate = _maxExp(_treeMax[i * 2], _treeMax[i * 2 + 1]); + if (_equalExp(_treeMax[i], candidate)) // if node same then new value don't need to recalc all upper + { + break; + } + + _treeMax[i] = candidate; + } + } + + public void UpdateRange(int from, int to, T[] newData, int fromData = 0) // RangeUpdate + { + //update source signal + for (var i = from; i < to; i++) + { + _sourceArray[i] = newData[i - from + fromData]; + } + + for (var i = _n / 2 + from / 2; i < _n / 2 + to / 2; i++) + { + _treeMin![i] = _minExp(_sourceArray[i * 2 - _n], _sourceArray[i * 2 + 1 - _n]); + _treeMax![i] = _maxExp(_sourceArray[i * 2 - _n], _sourceArray[i * 2 + 1 - _n]); + } + if (to == _sourceArray.Length) // last elem haven't pair + { + _treeMin![_n / 2 + to / 2] = _sourceArray[to - 1]; + _treeMax![_n / 2 + to / 2] = _sourceArray[to - 1]; + } + else if (to % 2 == 1) //last elem even(to-1) and not last + { + _treeMin![_n / 2 + to / 2] = _minExp(_sourceArray[to - 1], _sourceArray[to]); + _treeMax![_n / 2 + to / 2] = _maxExp(_sourceArray[to - 1], _sourceArray[to]); + } + + from = (_n / 2 + from / 2) / 2; + to = (_n / 2 + to / 2) / 2; + + T candidate; + while (from != 0) // up to root elem, that is [1], [0] - is free elem + { + if (from != to) + { + for (var i = from; i <= to; i++) // Recalc all level nodes in range + { + _treeMin![i] = _minExp(_treeMin[i * 2], _treeMin[i * 2 + 1]); + _treeMax![i] = _maxExp(_treeMax[i * 2], _treeMax[i * 2 + 1]); + } + } + else + { + // left == right, so no need more from to loop + for (var i = from; i > 0; i /= 2) // up to root node + { + candidate = _minExp(_treeMin![i * 2], _treeMin[i * 2 + 1]); + if (_equalExp(_treeMin[i], candidate)) // if node same then new value don't need to recalc all upper + { + break; + } + + _treeMin[i] = candidate; + } + + for (var i = from; i > 0; i /= 2) // up to root node + { + candidate = _maxExp(_treeMax![i * 2], _treeMax[i * 2 + 1]); + if (_equalExp(_treeMax[i], candidate)) // if node same then new value don't need to recalc all upper + { + break; + } + + _treeMax[i] = candidate; + } + // all work done exit while loop + break; + } + // level up + from = from / 2; + to = to / 2; + } + } + + public void UpdateData(int from, T[] newData) + { + UpdateRange(from, newData.Length, newData); + } + + public void UpdateData(T[] newData) + { + UpdateRange(0, newData.Length, newData); + } + + public void UpdateTreesInBackground() + { + Task.Run(() => { UpdateTrees(); }); + } + + public void UpdateTrees() + { + // O(n) to build trees + TreesReady = false; + try + { + if (_sourceArray.Length == 0) + { + throw new ArgumentOutOfRangeException($"Array cant't be empty"); + } + + // Size up to pow2 + if (_sourceArray.Length > 0x40_00_00_00) // pow 2 must be more then int.MaxValue + { + throw new ArgumentOutOfRangeException($"Array higher than {0x40_00_00_00} not supported by SignalConst"); + } + + var pow2 = 1; + while (pow2 < 0x40_00_00_00 && pow2 < _sourceArray.Length) + pow2 <<= 1; + _n = pow2; + _treeMin = new T[_n]; + _treeMax = new T[_n]; + var maxValue = _maxValue(); + var minValue = _minValue(); + + // fill bottom layer of tree + for (var i = 0; i < _sourceArray.Length / 2; i++) // with source array pairs min/max + { + _treeMin[_n / 2 + i] = _minExp(_sourceArray[i * 2], _sourceArray[i * 2 + 1]); + _treeMax[_n / 2 + i] = _maxExp(_sourceArray[i * 2], _sourceArray[i * 2 + 1]); + } + if (_sourceArray.Length % 2 == 1) // if array size odd, last element haven't pair to compare + { + _treeMin[_n / 2 + _sourceArray.Length / 2] = _sourceArray[_sourceArray.Length - 1]; + _treeMax[_n / 2 + _sourceArray.Length / 2] = _sourceArray[_sourceArray.Length - 1]; + } + for (var i = _n / 2 + (_sourceArray.Length + 1) / 2; i < _n; i++) // min/max for pairs of nonexistent elements + { + _treeMin[i] = minValue; + _treeMax[i] = maxValue; + } + // fill other layers + for (var i = _n / 2 - 1; i > 0; i--) + { + _treeMin[i] = _minExp(_treeMin[2 * i], _treeMin[2 * i + 1]); + _treeMax[i] = _maxExp(_treeMax[2 * i], _treeMax[2 * i + 1]); + } + TreesReady = true; + } + catch (OutOfMemoryException oem) + { + _treeMin = null; + _treeMax = null; + TreesReady = false; + DebugUtilities.WriteLine(oem); + } + } + + // O(log(n)) for each range min/max query + public void MinMaxRangeQuery(int l, int r, out double lowestValue, out double highestValue) + { + T lowestValueT; + T highestValueT; + // if the tree calculation isn't finished or if it crashed + if (!TreesReady) + { + // use the original (slower) min/max calculated method + lowestValueT = _sourceArray[l]; + highestValueT = _sourceArray[l]; + for (var i = l; i < r; i++) + { + if (_lessThanExp(_sourceArray[i], lowestValueT)) + { + lowestValueT = _sourceArray[i]; + } + + if (_greaterThanExp(_sourceArray[i], highestValueT)) + { + highestValueT = _sourceArray[i]; + } + } + lowestValue = NumericConversion.GenericToDouble(ref lowestValueT); + highestValue = NumericConversion.GenericToDouble(ref highestValueT); + return; + } + + lowestValueT = _maxValue(); + highestValueT = _minValue(); + if (l == r) + { + lowestValue = highestValue = NumericConversion.GenericToDouble(ref _sourceArray[l]); + return; + } + // first iteration on source array that virtualy bottom of tree + if ((l & 1) == 1) // l is right child + { + lowestValueT = _minExp(lowestValueT, _sourceArray[l]); + highestValueT = _maxExp(highestValueT, _sourceArray[l]); + } + if ((r & 1) != 1) // r is left child + { + lowestValueT = _minExp(lowestValueT, _sourceArray[r]); + highestValueT = _maxExp(highestValueT, _sourceArray[r]); + } + // go up from array to bottom of Tree + l = (l + _n + 1) / 2; + r = (r + _n - 1) / 2; + // next iterations on tree + while (l <= r) + { + if ((l & 1) == 1) // l is right child + { + lowestValueT = _minExp(lowestValueT, _treeMin![l]); + highestValueT = _maxExp(highestValueT, _treeMax![l]); + } + if ((r & 1) != 1) // r is left child + { + lowestValueT = _minExp(lowestValueT, _treeMin![r]); + highestValueT = _maxExp(highestValueT, _treeMax![r]); + } + // go up one level + l = (l + 1) / 2; + r = (r - 1) / 2; + } + lowestValue = NumericConversion.GenericToDouble(ref lowestValueT); + highestValue = NumericConversion.GenericToDouble(ref highestValueT); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalConstSourceDoubleArray.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalConstSourceDoubleArray.cs new file mode 100644 index 000000000..e0fb41a53 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalConstSourceDoubleArray.cs @@ -0,0 +1,110 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class SignalConstSourceDoubleArray + where T : struct, IComparable + { + public readonly SegmentedTree SegmentedTree = new(); + + public readonly T[] Ys; + public readonly double Period; + + public double XOffset = 0; + public double YOffset = 0; + public int MinRenderIndex = 0; + public int MaxRenderIndex = int.MaxValue; + + public SignalConstSourceDoubleArray(T[] ys, double period) + { + Ys = ys; + Period = period; + SegmentedTree.SourceArray = ys; + MaxRenderIndex = ys.Length - 1; + } + public AxisLimits GetAxisLimits() + { + SegmentedTree.MinMaxRangeQuery(0, Ys.Length - 1, out double low, out double high); + return new AxisLimits(0, Ys.Length * Period, low, high); + } + + public int GetIndex(double x, bool visibleDataOnly) + { + int i = (int)((x - XOffset) / Period); + + if (visibleDataOnly) + { + i = Math.Max(i, MinRenderIndex); + i = Math.Min(i, MaxRenderIndex); + } + + return i; + } + + public bool RangeContainsSignal(double xMin, double xMax) + { + int xMinIndex = GetIndex(xMin, false); + int xMaxIndex = GetIndex(xMax, false); + return xMaxIndex >= MinRenderIndex && xMinIndex <= MaxRenderIndex; + } + + public SignalRangeY GetLimitsY(int firstIndex, int lastIndex) + { + double min = double.PositiveInfinity; + double max = double.NegativeInfinity; + + for (int i = firstIndex; i <= lastIndex; i++) + { + double value = NumericConversion.GenericToDouble(Ys, i); + min = Math.Min(min, value); + max = Math.Max(max, value); + } + + return new SignalRangeY(min, max); + } + + public List GetPixelColumns(IAxes axes) + { + List cols = new(); + + // ensure the same i1 isn't sampled twice + int latIndex1 = int.MinValue; + for (int xPixelIndex = 0; xPixelIndex < (int)axes.DataRect.Width; xPixelIndex++) + { + float xPixel = axes.DataRect.Left + xPixelIndex; + double xRangeMin = axes.GetCoordinateX(xPixel); + float xUnitsPerPixel = (float)(axes.XAxis.Width / axes.DataRect.Width); + double xRangeMax = xRangeMin + xUnitsPerPixel; + + // off the edge of the data + if (RangeContainsSignal(xRangeMin, xRangeMax) == false) + { + continue; + } + + // determine column limits horizontally + int i1 = GetIndex(xRangeMin, true); + int i2 = GetIndex(xRangeMax, true); + if (i1 == latIndex1) + { + continue; + } + + latIndex1 = i1; + + // first and last Y vales for this column + double y1 = NumericConversion.GenericToDouble(Ys, i1); + double y2 = NumericConversion.GenericToDouble(Ys, i2); + float yEnter = axes.GetPixelY(y1 + YOffset); + float yExit = axes.GetPixelY(y2 + YOffset); + + // column min and max + SignalRangeY rangeY = GetLimitsY(i1, i2); + float yBottom = axes.GetPixelY(rangeY.Min + YOffset); + float yTop = axes.GetPixelY(rangeY.Max + YOffset); + + cols.Add(new PixelColumn(xPixel, yEnter, yExit, yBottom, yTop)); + } + + return cols; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalInterpolation.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalInterpolation.cs new file mode 100644 index 000000000..f263b3d1d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalInterpolation.cs @@ -0,0 +1,109 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public static class SignalInterpolation + { + /// + /// If the point to the left of the graph is extremely far outside the data area, + /// modify it using interpolation so it's closer to the data area to prevent render artifacts. + /// + public static void InterpolateBeforeX(RenderPack rp, Pixel[] pixels) + { + if (pixels.Length <= 2) + { + return; + } + + Pixel lastOutsidePoint = pixels[0]; + Pixel firstInsidePoint = pixels[1]; + if (lastOutsidePoint.X == firstInsidePoint.X) + { + return; + } + + float x = rp.DataRect.Left - 1; + float yDelta = lastOutsidePoint.Y - firstInsidePoint.Y; + float xDelta1 = x - firstInsidePoint.X; + float xDelta2 = lastOutsidePoint.X - firstInsidePoint.X; + float y = firstInsidePoint.Y + yDelta * xDelta1 / xDelta2; + pixels[0] = new Pixel(x, y); + } + + /// + /// If the point to the bottom of the graph is extremely far outside the data area, + /// modify it using interpolation so it's closer to the data area to prevent render artifacts. + /// + public static void InterpolateBeforeY(RenderPack rp, Pixel[] pixels) + { + if (pixels.Length <= 2) + { + return; + } + + Pixel lastOutsidePoint = pixels[0]; + Pixel firstInsidePoint = pixels[1]; + if (lastOutsidePoint.Y == firstInsidePoint.Y) + { + return; + } + + float y = rp.DataRect.Bottom + 1; + float xDelta = lastOutsidePoint.X - firstInsidePoint.X; + float yDelta1 = y - firstInsidePoint.Y; + float yDelta2 = lastOutsidePoint.Y - firstInsidePoint.Y; + float x = firstInsidePoint.X + xDelta * yDelta1 / yDelta2; + pixels[0] = new Pixel(x, y); + } + + /// + /// If the point to the right of the graph is extremely far outside the data area, + /// modify it using interpolation so it's closer to the data area to prevent render artifacts. + /// + public static void InterpolateAfterX(RenderPack rp, Pixel[] pixels) + { + if (pixels.Length <= 2) + { + return; + } + + Pixel lastInsidePoint = pixels[pixels.Length - 2]; + Pixel firstOutsidePoint = pixels[pixels.Length - 1]; + if (firstOutsidePoint.X == lastInsidePoint.X) + { + return; + } + + float x = rp.DataRect.Right + 1; + float yDelta = firstOutsidePoint.Y - lastInsidePoint.Y; + float xDelta1 = x - lastInsidePoint.X; + float xDelta2 = firstOutsidePoint.X - lastInsidePoint.X; + float y = lastInsidePoint.Y + yDelta * xDelta1 / xDelta2; + pixels[pixels.Length - 1] = new Pixel(x, y); + } + + /// + /// If the point to the top of the graph is extremely far outside the data area, + /// modify it using interpolation so it's closer to the data area to prevent render artifacts. + /// + public static void InterpolateAfterY(RenderPack rp, Pixel[] pixels) + { + if (pixels.Length <= 2) + { + return; + } + + Pixel lastInsidePoint = pixels[pixels.Length - 2]; + Pixel firstOutsidePoint = pixels[pixels.Length - 1]; + if (firstOutsidePoint.Y == lastInsidePoint.Y) + { + return; + } + + float y = rp.DataRect.Top - 1; + float xDelta = firstOutsidePoint.X - lastInsidePoint.X; + float yDelta1 = y - lastInsidePoint.Y; + float yDelta2 = firstOutsidePoint.Y - lastInsidePoint.Y; + float x = lastInsidePoint.X + xDelta * yDelta1 / yDelta2; + pixels[pixels.Length - 1] = new Pixel(x, y); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalRangeY.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalRangeY.cs new file mode 100644 index 000000000..6227604f8 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalRangeY.cs @@ -0,0 +1,14 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public readonly struct SignalRangeY + { + public double Min { get; } + public double Max { get; } + public SignalRangeY(double min, double max) + { + Min = min; + Max = max; + } + public override string ToString() => $"Range [{Min}, {Max}]"; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalSourceBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalSourceBase.cs new file mode 100644 index 000000000..ff858dc4a --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalSourceBase.cs @@ -0,0 +1,67 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public abstract class SignalSourceBase + { + public double Period { get; set; } + public abstract int Length { get; } + + public int MinimumIndex { get; set; } = 0; + public int MaximumIndex { get; set; } = int.MaxValue; + + public int MinRenderIndex => Math.Max(0, MinimumIndex); + public int MaxRenderIndex => Math.Min(Length - 1, MaximumIndex); + + public double XOffset { get; set; } + public double YOffset { get; set; } + + public int GetIndex(double x, bool visibleDataOnly) + { + int i = (int)((x - XOffset) / Period); + + if (visibleDataOnly) + { + i = Math.Max(i, MinRenderIndex); + i = Math.Min(i, MaxRenderIndex); + } + + return i; + } + + public bool RangeContainsSignal(double xMin, double xMax) + { + int xMinIndex = GetIndex(xMin, false); + int xMaxIndex = GetIndex(xMax, false); + return xMaxIndex >= MinRenderIndex && xMinIndex <= MaxRenderIndex; + } + + public double GetX(int index) + { + return index * Period + XOffset; + } + + public CoordinateRange GetLimitsX() + { + CoordinateRect rect = GetLimits().Rect; + return new CoordinateRange(rect.Left, rect.Left); + } + + public CoordinateRange GetLimitsY() + { + CoordinateRect rect = GetLimits().Rect; + return new CoordinateRange(rect.Bottom, rect.Bottom); + } + + public abstract SignalRangeY GetLimitsY(int firstIndex, int lastIndex); + + public AxisLimits GetLimits() + { + SignalRangeY rangeY = GetLimitsY(MinRenderIndex, MaxRenderIndex); + + return new AxisLimits( + left: XOffset + MinRenderIndex * Period, + right: XOffset + MaxRenderIndex * Period, + bottom: rangeY.Min + YOffset, + top: rangeY.Max + YOffset); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalSourceDouble.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalSourceDouble.cs new file mode 100644 index 000000000..c9196cdb1 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalSourceDouble.cs @@ -0,0 +1,61 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class SignalSourceDouble : SignalSourceBase, ISignalSource + { + private readonly IReadOnlyList _ys; + public override int Length => _ys.Count; + + public SignalSourceDouble(IReadOnlyList ys, double period) + { + _ys = ys; + Period = period; + } + + public IReadOnlyList GetYs() + { + return _ys; + } + + public override SignalRangeY GetLimitsY(int firstIndex, int lastIndex) + { + double min = double.PositiveInfinity; + double max = double.NegativeInfinity; + + for (int i = firstIndex; i <= lastIndex; i++) + { + min = Math.Min(min, _ys[i]); + max = Math.Max(max, _ys[i]); + } + + return new SignalRangeY(min, max); + } + + public PixelColumn GetPixelColumn(IAxes axes, int xPixelIndex) + { + float xPixel = axes.DataRect.Left + xPixelIndex; + double xRangeMin = axes.GetCoordinateX(xPixel); + float xUnitsPerPixel = (float)(axes.XAxis.Width / axes.DataRect.Width); + double xRangeMax = xRangeMin + xUnitsPerPixel; + + if (RangeContainsSignal(xRangeMin, xRangeMax) == false) + { + return PixelColumn.WithoutData(xPixel); + } + + // determine column limits horizontally + int i1 = GetIndex(xRangeMin, true); + int i2 = GetIndex(xRangeMax, true); + + // first and last Y vales for this column + float yEnter = axes.GetPixelY(_ys[i1] + YOffset); + float yExit = axes.GetPixelY(_ys[i2] + YOffset); + + // column min and max + SignalRangeY rangeY = GetLimitsY(i1, i2); + float yBottom = axes.GetPixelY(rangeY.Min + YOffset); + float yTop = axes.GetPixelY(rangeY.Max + YOffset); + + return new PixelColumn(xPixel, yEnter, yExit, yBottom, yTop); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalSourceGenericArray.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalSourceGenericArray.cs new file mode 100644 index 000000000..391307691 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalSourceGenericArray.cs @@ -0,0 +1,70 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class SignalSourceGenericArray : SignalSourceBase, ISignalSource + { + private readonly T[] _ys; + public override int Length => _ys.Length; + + public SignalSourceGenericArray(T[] ys, double period) + { + _ys = ys; + Period = period; + } + + public IReadOnlyList GetYs() + { + return NumericConversion.GenericToDoubleArray(_ys); + } + + public override SignalRangeY GetLimitsY(int firstIndex, int lastIndex) + { + double min = double.PositiveInfinity; + double max = double.NegativeInfinity; + + for (int i = firstIndex; i <= lastIndex; i++) + { + double value = NumericConversion.GenericToDouble(ref _ys[i]); + min = Math.Min(min, value); + max = Math.Max(max, value); + } + + return new SignalRangeY(min, max); + } + + public PixelColumn GetPixelColumn(IAxes axes, int xPixelIndex) + { + float xPixel = axes.DataRect.Left + xPixelIndex; + double xRangeMin = axes.GetCoordinateX(xPixel); + float xUnitsPerPixel = (float)(axes.XAxis.Width / axes.DataRect.Width); + double xRangeMax = xRangeMin + xUnitsPerPixel; + + if (RangeContainsSignal(xRangeMin, xRangeMax) == false) + { + return PixelColumn.WithoutData(xPixel); + } + + // determine column limits horizontally + int i1 = GetIndex(xRangeMin, true); + int i2 = GetIndex(xRangeMax, true); + float yEnter = axes.GetPixelY(NumericConversion.GenericToDouble(_ys, i1) + YOffset); + float yExit = axes.GetPixelY(NumericConversion.GenericToDouble(_ys, i2) + YOffset); + + // determine column span vertically + double yMin = double.PositiveInfinity; + double yMax = double.NegativeInfinity; + for (int i = i1; i <= i2; i++) + { + double value = NumericConversion.GenericToDouble(_ys, i); + yMin = Math.Min(yMin, value); + yMax = Math.Max(yMax, value); + } + yMin += YOffset; + yMax += YOffset; + + float yBottom = axes.GetPixelY(yMin); + float yTop = axes.GetPixelY(yMax); + + return new PixelColumn(xPixel, yEnter, yExit, yBottom, yTop); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalSourceGenericList.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalSourceGenericList.cs new file mode 100644 index 000000000..cba74b272 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalSourceGenericList.cs @@ -0,0 +1,71 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class SignalSourceGenericList : SignalSourceBase, ISignalSource + { + private readonly List _ys; + public override int Length => _ys.Count; + + public SignalSourceGenericList(List ys, double period) + { + _ys = ys; + Period = period; + } + + public IReadOnlyList GetYs() + { + return NumericConversion.GenericToDoubleArray(_ys); + } + + public override SignalRangeY GetLimitsY(int firstIndex, int lastIndex) + { + double min = double.PositiveInfinity; + double max = double.NegativeInfinity; + + for (int i = firstIndex; i <= lastIndex; i++) + { + T genericValue = _ys[i]; + double value = NumericConversion.GenericToDouble(ref genericValue); + min = Math.Min(min, value); + max = Math.Max(max, value); + } + + return new SignalRangeY(min, max); + } + + public PixelColumn GetPixelColumn(IAxes axes, int xPixelIndex) + { + float xPixel = axes.DataRect.Left + xPixelIndex; + double xRangeMin = axes.GetCoordinateX(xPixel); + float xUnitsPerPixel = (float)(axes.XAxis.Width / axes.DataRect.Width); + double xRangeMax = xRangeMin + xUnitsPerPixel; + + if (RangeContainsSignal(xRangeMin, xRangeMax) == false) + { + return PixelColumn.WithoutData(xPixel); + } + + // determine column limits horizontally + int i1 = GetIndex(xRangeMin, true); + int i2 = GetIndex(xRangeMax, true); + float yEnter = axes.GetPixelY(NumericConversion.GenericToDouble(_ys, i1) + YOffset); + float yExit = axes.GetPixelY(NumericConversion.GenericToDouble(_ys, i2) + YOffset); + + // determine column span vertically + double yMin = double.PositiveInfinity; + double yMax = double.NegativeInfinity; + for (int i = i1; i <= i2; i++) + { + double value = NumericConversion.GenericToDouble(_ys, i); + yMin = Math.Min(yMin, value); + yMax = Math.Max(yMax, value); + } + yMin += YOffset; + yMax += YOffset; + + float yBottom = axes.GetPixelY(yMin); + float yTop = axes.GetPixelY(yMax); + + return new PixelColumn(xPixel, yEnter, yExit, yBottom, yTop); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalXYSourceDoubleArray.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalXYSourceDoubleArray.cs new file mode 100644 index 000000000..360521821 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalXYSourceDoubleArray.cs @@ -0,0 +1,292 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class SignalXySourceDoubleArray : ISignalXySource + { + readonly double[] _xs; + readonly double[] _ys; + public bool Rotated { get; set; } = false; + + public double XOffset { get; set; } = 0; + public double YOffset { get; set; } = 0; + public int MinimumIndex { get; set; } = 0; + public int MaximumIndex { get; set; } + + public SignalXySourceDoubleArray(double[] xs, double[] ys) + { + if (xs.Length != ys.Length) + { + throw new ArgumentException($"{nameof(xs)} and {nameof(ys)} must have equal length"); + } + + _xs = xs; + _ys = ys; + MaximumIndex = xs.Length - 1; + } + + public AxisLimits GetAxisLimits() + { + double xMin = _xs[MinimumIndex] + XOffset; + double xMax = _xs[MaximumIndex] + XOffset; + + CoordinateRange xRange = new(xMin, xMax); + CoordinateRange yRange = GetRange(MinimumIndex, MaximumIndex); + return Rotated + ? new AxisLimits(yRange, xRange) + : new AxisLimits(xRange, yRange); + } + + public Pixel[] GetPixelsToDraw(RenderPack rp, IAxes axes) + { + return Rotated + ? GetPixelsToDrawVertically(rp, axes) + : GetPixelsToDrawHorizontally(rp, axes); + } + + private Pixel[] GetPixelsToDrawHorizontally(RenderPack rp, IAxes axes) + { + // determine the range of data in view + (Pixel[] pointBefore, int dataIndexFirst) = GetFirstPointX(axes); + (Pixel[] pointAfter, int dataIndexLast) = GetLastPointX(axes); + IndexRange visibileRange = new(dataIndexFirst, dataIndexLast); + + // get all points in view + IEnumerable visiblePoints = Enumerable.Range(0, (int)Math.Ceiling(rp.DataRect.Width)) + .Select(pxColumn => GetColumnPixelsX(pxColumn, visibileRange, rp, axes)) + .SelectMany(x => x); + + // combine with one extra point before and after + Pixel[] points = [.. pointBefore, .. visiblePoints, .. pointAfter]; + + // use interpolation at the edges to prevent points from going way off the screen + if (pointBefore.Length > 0) + { + SignalInterpolation.InterpolateBeforeX(rp, points); + } + + if (pointAfter.Length > 0) + { + SignalInterpolation.InterpolateAfterX(rp, points); + } + + return points; + } + + private Pixel[] GetPixelsToDrawVertically(RenderPack rp, IAxes axes) + { + // determine the range of data in view + (Pixel[] pointBefore, int dataIndexFirst) = GetFirstPointY(axes); + (Pixel[] pointAfter, int dataIndexLast) = GetLastPointY(axes); + IndexRange visibleRange = new(dataIndexFirst, dataIndexLast); + + // get all points in view + IEnumerable visiblePoints = Enumerable.Range(0, (int)Math.Ceiling(rp.DataRect.Height)) + .Select(pxRow => GetColumnPixelsY(pxRow, visibleRange, rp, axes)) + .SelectMany(x => x); + + // combine with one extra point before and after + Pixel[] points = [.. pointBefore, .. visiblePoints, .. pointAfter]; + + // use interpolation at the edges to prevent points from going way off the screen + if (pointBefore.Length > 0) + { + SignalInterpolation.InterpolateBeforeY(rp, points); + } + + if (pointAfter.Length > 0) + { + SignalInterpolation.InterpolateAfterY(rp, points); + } + + return points; + } + + /// + /// Return the vertical range covered by data between the given indices (inclusive) + /// + public CoordinateRange GetRange(int index1, int index2) + { + double min = _ys[index1]; + double max = _ys[index1]; + + for (int i = index1; i <= index2; i++) + { + min = Math.Min(_ys[i], min); + max = Math.Max(_ys[i], max); + } + + return new CoordinateRange(min + YOffset, max + YOffset); + } + + /// + /// Get the index associated with the given X position + /// + public int GetIndex(double x) + { + IndexRange range = new(MinimumIndex, MaximumIndex); + return GetIndex(x, range); + } + + /// + /// Get the index associated with the given X position limited to the given range + /// + public int GetIndex(double x, IndexRange indexRange) + { + int index = Array.BinarySearch(_xs, indexRange.Min, indexRange.Length, x - XOffset); + + if (index < 0) + { + index = ~index; // read BinarySearch() docs + } + + return index; + } + + /// + /// Given a pixel column, return the pixels to render its line. + /// If the column contains no data, no pixels are returned. + /// If the column contains one point, return that one pixel. + /// If the column contains multiple points, return 4 pixels: enter, min, max, and exit + /// + public IEnumerable GetColumnPixelsX(int pixelColumnIndex, IndexRange rng, RenderPack rp, IAxes axes) + { + float xPixel = pixelColumnIndex + rp.DataRect.Left; + double unitsPerPixelX = axes.XAxis.Width / rp.DataRect.Width; + double start = axes.XAxis.Min + unitsPerPixelX * pixelColumnIndex; + double end = start + unitsPerPixelX; + int startIndex = GetIndex(start, rng); + int endIndex = GetIndex(end, rng); + int pointsInRange = endIndex - startIndex; + + if (pointsInRange == 0) + { + yield break; + } + + yield return new Pixel(xPixel, axes.GetPixelY(_ys[startIndex] + YOffset)); // enter + + if (pointsInRange > 1) + { + CoordinateRange yRange = GetRange(startIndex, endIndex - 1); + yield return new Pixel(xPixel, axes.GetPixelY(yRange.Min)); // min + yield return new Pixel(xPixel, axes.GetPixelY(yRange.Max)); // max + yield return new Pixel(xPixel, axes.GetPixelY(_ys[endIndex - 1] + YOffset)); // exit + } + } + + /// + /// Given a pixel column, return the pixels to render its line. + /// If the column contains no data, no pixels are returned. + /// If the column contains one point, return that one pixel. + /// If the column contains multiple points, return 4 pixels: enter, min, max, and exit + /// + public IEnumerable GetColumnPixelsY(int rowColumnIndex, IndexRange rng, RenderPack rp, IAxes axes) + { + float yPixel = rp.DataRect.Bottom - rowColumnIndex; + double unitsPerPixelY = axes.YAxis.Height / rp.DataRect.Height; + double start = axes.YAxis.Min + unitsPerPixelY * rowColumnIndex; + double end = start + unitsPerPixelY; + int startIndex = GetIndex(start, rng); + int endIndex = GetIndex(end, rng); + int pointsInRange = endIndex - startIndex; + + if (pointsInRange == 0) + { + yield break; + } + + yield return new Pixel(axes.GetPixelX(_ys[startIndex] + XOffset), yPixel); // enter + + if (pointsInRange > 1) + { + CoordinateRange yRange = GetRange(startIndex, endIndex - 1); + yield return new Pixel(axes.GetPixelX(yRange.Min), yPixel); // min + yield return new Pixel(axes.GetPixelX(yRange.Max), yPixel); // max + yield return new Pixel(axes.GetPixelX(_ys[endIndex - 1] + XOffset), yPixel); // exit + } + } + + /// + /// If data is off to the screen to the left, + /// returns information about the closest point off the screen + /// + private (Pixel[] pointsBefore, int firstIndex) GetFirstPointX(IAxes axes) + { + int pointBeforeIndex = GetIndex(axes.XAxis.Min); + + if (pointBeforeIndex > MinimumIndex) + { + float beforeX = axes.GetPixelX(_xs[pointBeforeIndex - 1] + XOffset); + float beforeY = axes.GetPixelY(_ys[pointBeforeIndex - 1] + YOffset); + Pixel beforePoint = new(beforeX, beforeY); + return ([beforePoint], pointBeforeIndex); + } + else + { + return ([], MinimumIndex); + } + } + + /// + /// If data is off to the screen to the bottom, + /// returns information about the closest point off the screen + /// + private (Pixel[] pointsBefore, int firstIndex) GetFirstPointY(IAxes axes) + { + int pointBeforeIndex = GetIndex(axes.YAxis.Min); + + if (pointBeforeIndex > MinimumIndex) + { + float beforeX = axes.GetPixelX(_ys[pointBeforeIndex - 1] + XOffset); + float beforeY = axes.GetPixelY(_xs[pointBeforeIndex - 1] + YOffset); + Pixel beforePoint = new(beforeX, beforeY); + return ([beforePoint], pointBeforeIndex); + } + else + { + return ([], MinimumIndex); + } + } + + /// + /// If data is off to the screen to the right, + /// returns information about the closest point off the screen + /// + private (Pixel[] pointsBefore, int lastIndex) GetLastPointX(IAxes axes) + { + int pointAfterIndex = GetIndex(axes.XAxis.Max); + + if (pointAfterIndex <= MaximumIndex) + { + float afterX = axes.GetPixelX(_xs[pointAfterIndex] + XOffset); + float afterY = axes.GetPixelY(_ys[pointAfterIndex] + YOffset); + Pixel afterPoint = new(afterX, afterY); + return ([afterPoint], pointAfterIndex); + } + else + { + return ([], MaximumIndex); + } + } + + /// + /// If data is off to the screen to the top, + /// returns information about the closest point off the screen + /// + private (Pixel[] pointsBefore, int lastIndex) GetLastPointY(IAxes axes) + { + int pointAfterIndex = GetIndex(axes.YAxis.Max); + + if (pointAfterIndex <= MaximumIndex) + { + float afterX = axes.GetPixelX(_ys[pointAfterIndex] + XOffset); + float afterY = axes.GetPixelY(_xs[pointAfterIndex] + YOffset); + Pixel afterPoint = new(afterX, afterY); + return ([afterPoint], pointAfterIndex); + } + else + { + return ([], MaximumIndex); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalXYSourceGenericArray.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalXYSourceGenericArray.cs new file mode 100644 index 000000000..08eec5e70 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataSources/SignalXYSourceGenericArray.cs @@ -0,0 +1,191 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class SignalXySourceGenericArray : ISignalXySource + { + public TX[] Xs { get; set; } + public TY[] Ys { get; set; } + public bool Rotated + { + get => false; + set => throw new NotImplementedException("rotation is not yet supported for generic SignalXY plots"); + } + + public double XOffset { get; set; } = 0; + public double YOffset { get; set; } = 0; + public int MinimumIndex { get; set; } = 0; + public int MaximumIndex { get; set; } + + public SignalXySourceGenericArray(TX[] xs, TY[] ys) + { + if (xs.Length != ys.Length) + { + throw new InvalidOperationException($"{nameof(xs)} and {nameof(ys)} must have equal length"); + } + + Xs = xs; + Ys = ys; + MaximumIndex = xs.Length - 1; + } + + public AxisLimits GetAxisLimits() + { + double xMin = NumericConversion.GenericToDouble(Xs, MinimumIndex) + XOffset; + double xMax = NumericConversion.GenericToDouble(Xs, MaximumIndex) + XOffset; + CoordinateRange xRange = new(xMin, xMax); + CoordinateRange yRange = GetRangeY(MinimumIndex, MaximumIndex); + return new AxisLimits(xRange, yRange); + } + + public Pixel[] GetPixelsToDraw(RenderPack rp, IAxes axes) + { + // determine the range of data in view + (Pixel[] pointBefore, int dataIndexFirst) = GetFirstPoint(axes); + (Pixel[] pointAfter, int dataIndexLast) = GetLastPoint(axes); + IndexRange columnIndexRange = new(dataIndexFirst, dataIndexLast); + + // get all points in view + IEnumerable visiblePoints = Enumerable.Range(0, (int)Math.Ceiling(rp.DataRect.Width)) + .Select(pixelColumnIndex => GetColumnPixels(pixelColumnIndex, columnIndexRange, rp, axes)) + .SelectMany(x => x); + + // combine with one extra point before and after + Pixel[] points = [.. pointBefore, .. visiblePoints, .. pointAfter]; + + // use interpolation at the edges to prevent points from going way off the screen + if (pointBefore.Length > 0) + { + SignalInterpolation.InterpolateBeforeX(rp, points); + } + + if (pointAfter.Length > 0) + { + SignalInterpolation.InterpolateAfterX(rp, points); + } + + return points; + } + + /// + /// Return the vertical range covered by data between the given indices (inclusive) + /// + public CoordinateRange GetRangeY(int index1, int index2) + { + double min = NumericConversion.GenericToDouble(Ys, index1); + double max = NumericConversion.GenericToDouble(Ys, index1); + + for (int i = index1; i <= index2; i++) + { + double value = NumericConversion.GenericToDouble(Ys, i); + min = Math.Min(value, min); + max = Math.Max(value, max); + } + + return new CoordinateRange(min + YOffset, max + YOffset); + } + + /// + /// Get the index associated with the given X position + /// + public int GetIndexX(double x) + { + IndexRange range = new(MinimumIndex, MaximumIndex); + return GetIndex(x, range); + } + + /// + /// Get the index associated with the given X position limited to the given range + /// + public int GetIndex(double x, IndexRange indexRange) + { + NumericConversion.DoubleToGeneric(x - XOffset, out TX x2); + int index = Array.BinarySearch(Xs, indexRange.Min, indexRange.Length, x2); + + if (index < 0) + { + index = ~index; // read BinarySearch() docs + } + + return index; + } + + /// + /// Given a pixel column, return the pixels to render its line. + /// If the column contains no data, no pixels are returned. + /// If the column contains one point, return that one pixel. + /// If the column contains multiple points, return 4 pixels: enter, min, max, and exit + /// + public IEnumerable GetColumnPixels(int pixelColumnIndex, IndexRange rng, RenderPack rp, IAxes axes) + { + float xPixel = pixelColumnIndex + rp.DataRect.Left; + double unitsPerPixelX = axes.XAxis.Width / rp.DataRect.Width; + double start = axes.XAxis.Min + unitsPerPixelX * pixelColumnIndex; + double end = start + unitsPerPixelX; + int startIndex = GetIndex(start, rng); + int endIndex = GetIndex(end, rng); + int pointsInRange = endIndex - startIndex; + + if (pointsInRange == 0) + { + yield break; + } + + double yStart = NumericConversion.GenericToDouble(Ys, startIndex); + yield return new Pixel(xPixel, axes.GetPixelY(yStart + YOffset)); // enter + + if (pointsInRange > 1) + { + double yEnd = NumericConversion.GenericToDouble(Ys, endIndex - 1); + CoordinateRange yRange = GetRangeY(startIndex, endIndex - 1); + yield return new Pixel(xPixel, axes.GetPixelY(yRange.Min)); // min + yield return new Pixel(xPixel, axes.GetPixelY(yRange.Max)); // max + yield return new Pixel(xPixel, axes.GetPixelY(yEnd) + YOffset); // exit + } + } + + /// + /// If data is off to the screen to the left, + /// returns information about the closest point off the screen + /// + private (Pixel[] pointsBefore, int firstIndex) GetFirstPoint(IAxes axes) + { + int pointBeforeIndex = GetIndexX(axes.XAxis.Min); + + if (pointBeforeIndex > MinimumIndex) + { + double x = NumericConversion.GenericToDouble(Xs, pointBeforeIndex - 1) + XOffset; + double y = NumericConversion.GenericToDouble(Ys, pointBeforeIndex - 1) + YOffset; + float beforeX = axes.GetPixelX(x); + float beforeY = axes.GetPixelY(y); + Pixel beforePoint = new(beforeX, beforeY); + return ([beforePoint], pointBeforeIndex); + } + else + { + return ([], MinimumIndex); + } + } + + /// + /// If data is off to the screen to the right, + /// returns information about the closest point off the screen + /// + private (Pixel[] pointsBefore, int lastIndex) GetLastPoint(IAxes axes) + { + int pointAfterIndex = GetIndexX(axes.XAxis.Max); + + if (pointAfterIndex <= MaximumIndex) + { + double x = NumericConversion.GenericToDouble(Xs, pointAfterIndex) + XOffset; + double y = NumericConversion.GenericToDouble(Ys, pointAfterIndex) + YOffset; + float afterX = axes.GetPixelX(x); + float afterY = axes.GetPixelY(y); + Pixel afterPoint = new(afterX, afterY); + return ([afterPoint], pointAfterIndex); + } + else + { + return ([], MaximumIndex); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataViews/IDataStreamerView.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataViews/IDataStreamerView.cs new file mode 100644 index 000000000..e73559f27 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataViews/IDataStreamerView.cs @@ -0,0 +1,11 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Contains logic for rendering fixed-length data in a streaming data logger. + /// + public interface IDataStreamerView + { + DataStreamer Streamer { get; } + void Render(RenderPack rp); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataViews/Scroll.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataViews/Scroll.cs new file mode 100644 index 000000000..c581b3b07 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataViews/Scroll.cs @@ -0,0 +1,35 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Scroll : IDataStreamerView + { + private readonly bool _newOnRight; + + public DataStreamer Streamer { get; } + + public Scroll(DataStreamer streamer, bool newOnRight) + { + Streamer = streamer; + _newOnRight = newOnRight; + } + + public void Render(RenderPack rp) + { + Pixel[] points = new Pixel[Streamer.Data.Length]; + + int oldPointCount = Streamer.Data.Length - Streamer.Data.NextIndex; + + for (int i = 0; i < Streamer.Data.Length; i++) + { + bool isNewPoint = i < oldPointCount; + int sourceIndex = isNewPoint ? Streamer.Data.NextIndex + i : i - oldPointCount; + int targetIndex = _newOnRight ? i : Streamer.Data.Data.Length - 1 - i; + points[targetIndex] = new( + x: Streamer.Axes.GetPixelX(targetIndex * Streamer.Data.SamplePeriod + Streamer.Data.OffsetX), + y: Streamer.Axes.GetPixelY(Streamer.Data.Data[sourceIndex] + Streamer.Data.OffsetY)); + } + + using SKPaint paint = new(); + Drawing.DrawLines(rp.Canvas, paint, points, Streamer.LineStyle); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataViews/Wipe.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataViews/Wipe.cs new file mode 100644 index 000000000..7c6f418bb --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/DataViews/Wipe.cs @@ -0,0 +1,48 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Wipe : IDataStreamerView + { + private readonly bool _wipeRight; + + public DataStreamer Streamer { get; } + + //TODO: Add a BlankFraction property that adds a gap between old and new data + + public Wipe(DataStreamer streamer, bool wipeRight) + { + Streamer = streamer; + _wipeRight = wipeRight; + } + + public void Render(RenderPack rp) + { + int newestCount = Streamer.Data.NextIndex; + int oldestCount = Streamer.Data.Data.Length - newestCount; + + double xMax = Streamer.Data.Data.Length * Streamer.Data.SamplePeriod + Streamer.Data.OffsetX; + + Pixel[] newest = new Pixel[newestCount]; + Pixel[] oldest = new Pixel[oldestCount]; + + for (int i = 0; i < newest.Length; i++) + { + double xPos = i * Streamer.Data.SamplePeriod + Streamer.Data.OffsetX; + float x = Streamer.Axes.GetPixelX(_wipeRight ? xPos : xMax - xPos); + float y = Streamer.Axes.GetPixelY(Streamer.Data.Data[i] + Streamer.Data.OffsetY); + newest[i] = new(x, y); + } + + for (int i = 0; i < oldest.Length; i++) + { + double xPos = (i + Streamer.Data.NextIndex) * Streamer.Data.SamplePeriod + Streamer.Data.OffsetX; + float x = Streamer.Axes.GetPixelX(_wipeRight ? xPos : xMax - xPos); + float y = Streamer.Axes.GetPixelY(Streamer.Data.Data[i + Streamer.Data.NextIndex] + Streamer.Data.OffsetY); + oldest[i] = new(x, y); + } + + using SKPaint paint = new(); + Drawing.DrawLines(rp.Canvas, paint, oldest, Streamer.LineStyle); + Drawing.DrawLines(rp.Canvas, paint, newest, Streamer.LineStyle); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Extensions/DateTimeExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Extensions/DateTimeExtensions.cs new file mode 100644 index 000000000..4123a7dcd --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Extensions/DateTimeExtensions.cs @@ -0,0 +1,39 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// These methods hold conversion logic between DateTime (used for representing dates) + /// and double (used for defining positions on a Cartesian coordinate plane). + /// + /// Converting double <-> OADate has issues (e.g., OADates have a limited range), so by + /// isolating the conversion here we can ensure we can change the logic later without + /// hunting around the code base finding all the OADate conversion calls. + /// + public static class DateTimeExtensions + { + /// + /// Convert a number that can be plotted on a numeric axis into a DateTime + /// + public static DateTime ToDateTime(this double value) + { + return value switch + { + <= -657435 => new DateTime(100, 1, 1), + >= 2958466 => new DateTime(9_999, 1, 1), + _ => DateTime.FromOADate(value) + }; + } + + /// + /// Convert a DateTime into a number that can be plotted on a numeric axis + /// + public static double ToNumber(this DateTime value) + { + return value.Year switch + { + < 100 => new DateTime(100, 1, 1).ToOADate(), + >= 10_000 => new DateTime(10_000, 1, 1).ToOADate(), + _ => value.ToOADate() + }; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Extensions/EnumerableExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Extensions/EnumerableExtensions.cs new file mode 100644 index 000000000..9aa1a0ad0 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Extensions/EnumerableExtensions.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal static class EnumerableExtensions + { + public static IEnumerable One(T item) + { + yield return item; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Extensions/InternationalizationExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Extensions/InternationalizationExtensions.cs new file mode 100644 index 000000000..1099b74d6 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Extensions/InternationalizationExtensions.cs @@ -0,0 +1,8 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal static class InternationalizationExtensions + { + public static bool Uses24HourClock(this CultureInfo culture) => + culture.DateTimeFormat.LongTimePattern.Contains('H'); + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Extensions/NumericExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Extensions/NumericExtensions.cs new file mode 100644 index 000000000..28a32a4c8 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Extensions/NumericExtensions.cs @@ -0,0 +1,55 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public static class NumericExtensions + { + public static bool IsInfiniteOrNaN(this double x) + { + return !IsFinite(x); + } + + public static bool IsFinite(this double x) + { + if (double.IsInfinity(x)) + { + return false; + } + + return !double.IsNaN(x); + } + + public static float ToDegrees(this double radians) + { + return (float)(radians * 180.0 / Math.PI); + } + + public static float ToRadians(this double degrees) + { + return (float)(degrees / 180.0 * Math.PI); + } + + public static float ToRadians(this float degrees) + { + return (float)(degrees / 180.0 * Math.PI); + } + + public static float ToRadians(this int degrees) + { + return (float)(degrees / 180.0 * Math.PI); + } + + /// + /// Returns the fallback value if the given value is infinity + /// + public static double FiniteCoallesce(this double value, double fallback) + { + if (double.IsInfinity(value) || double.IsNaN(value)) + { + return fallback; + } + else + { + return value; + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Extensions/SkiaSharpExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Extensions/SkiaSharpExtensions.cs new file mode 100644 index 000000000..6064aeac5 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Extensions/SkiaSharpExtensions.cs @@ -0,0 +1,102 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public static class SkiaSharpExtensions + { + public static PixelSize ToPixelSize(this SKRect rect) + { + return new PixelSize(rect.Width, rect.Height); + } + + public static SKTextAlign ToSkTextAlign(this Alignment alignment) + { + return alignment switch + { + Alignment.UpperLeft => SKTextAlign.Left, + Alignment.UpperCenter => SKTextAlign.Center, + Alignment.UpperRight => SKTextAlign.Right, + Alignment.MiddleLeft => SKTextAlign.Left, + Alignment.MiddleCenter => SKTextAlign.Center, + Alignment.MiddleRight => SKTextAlign.Right, + Alignment.LowerLeft => SKTextAlign.Left, + Alignment.LowerCenter => SKTextAlign.Center, + Alignment.LowerRight => SKTextAlign.Right, + _ => throw new NotImplementedException(), + }; + } + + public static SKEncodedImageFormat ToSkFormat(this ImageFormat fmt) + { + return fmt switch + { + ImageFormat.Jpeg => SKEncodedImageFormat.Jpeg, + ImageFormat.Png => SKEncodedImageFormat.Png, + ImageFormat.Bmp => SKEncodedImageFormat.Bmp, + ImageFormat.Webp => SKEncodedImageFormat.Webp, + _ => throw new NotImplementedException($"unsupported format: {fmt}") + }; + } + + public static Pixel CenterPixel(this SKBitmap bmp) + { + return new Pixel(bmp.Width / 2, bmp.Height / 2); + } + + public static PixelSize GetPixelSize(this SKSurface surface) + { + return new PixelSize( + width: surface.Canvas.LocalClipBounds.Width, + height: surface.Canvas.LocalClipBounds.Height); + } + + public static PixelRect GetPixelRect(this SKSurface surface) + { + return new PixelRect( + left: 0, + right: surface.Canvas.LocalClipBounds.Width, + bottom: surface.Canvas.LocalClipBounds.Height, + top: 0); + } + + public static PixelRect ToPixelRect(this SKRect rect) + { + return new PixelRect(rect.Left, rect.Right, rect.Bottom, rect.Top); + } + + public static void ApplyToPaint(this LineStyle style, SKPaint paint) + { + paint.Shader = null; + paint.IsStroke = true; + paint.Color = style.Color.ToSkColor(); + paint.StrokeWidth = style.Width; + paint.PathEffect = style.Pattern.GetPathEffect(); + paint.IsAntialias = style.AntiAlias; + } + + public static void ApplyToPaint(this FillStyle fs, SKPaint paint) + { + paint.Color = fs.Color.ToSkColor(); + paint.IsStroke = false; + paint.IsAntialias = fs.AntiAlias; + + if (fs.Hatch is not null) + { + paint.Shader = fs.Hatch.GetShader(fs.Color, fs.HatchColor); + } + else + { + paint.Shader = null; + } + } + + public static void ApplyToPaint(this FontStyle fontStyle, SKPaint paint) + { + paint.Shader = null; + paint.IsStroke = false; + paint.Typeface = fontStyle.Typeface; + paint.TextSize = fontStyle.Size; + paint.Color = fontStyle.Color.ToSkColor(); + paint.IsAntialias = fontStyle.AntiAlias; + paint.FakeBoldText = fontStyle.Bold; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Extensions/SystemDrawingExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Extensions/SystemDrawingExtensions.cs new file mode 100644 index 000000000..d50cdc446 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Extensions/SystemDrawingExtensions.cs @@ -0,0 +1,19 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public static class SystemDrawingExtensions + { + public static Color ToColor(this System.Drawing.Color color) => new Color(color.R, color.G, color.B, color.A); + + public static PixelRect ToPixelRect(this System.Drawing.Rectangle rect) => new PixelRect(rect.Left, rect.Right, rect.Bottom, rect.Top); + + public static PixelRect ToPixelRect(this System.Drawing.RectangleF rect) => new PixelRect(rect.Left, rect.Right, rect.Bottom, rect.Top); + + public static PixelSize ToPixelSize(this System.Drawing.Size size) => new PixelSize(size.Width, size.Height); + + public static PixelSize ToPixelSize(this System.Drawing.SizeF size) => new PixelSize(size.Width, size.Height); + + public static Pixel ToPixel(this System.Drawing.Point point) => new Pixel(point.X, point.Y); + + public static Pixel ToPixel(this System.Drawing.PointF point) => new Pixel(point.X, point.Y); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Finance/BollingerBands.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Finance/BollingerBands.cs new file mode 100644 index 000000000..ce7828302 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Finance/BollingerBands.cs @@ -0,0 +1,33 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class BollingerBands + { + public readonly double[] Means; + public readonly double[] UpperValues; + public readonly double[] LowerValues; + public readonly DateTime[] DateTimes; + public readonly double[] Dates; + + public BollingerBands(List ohlcs, int n, double sdCoeff = 2) + { + double[] prices = ohlcs.Select(x => x.Close).ToArray(); + double[] sma = Series.MovingAverage(prices, n, preserveLength: true); + double[] smstd = Series.SimpleMovingStandardDeviation(prices, n, preserveLength: true); + + UpperValues = new double[prices.Length]; + LowerValues = new double[prices.Length]; + for (int i = 0; i < prices.Length; i++) + { + LowerValues[i] = sma[i] - sdCoeff * smstd[i]; + UpperValues[i] = sma[i] + sdCoeff * smstd[i]; + } + + // skip the first points which all contain NaN + Means = sma.Skip(n).ToArray(); + LowerValues = LowerValues.Skip(n).ToArray(); + UpperValues = UpperValues.Skip(n).ToArray(); + DateTimes = ohlcs.Skip(n).Select(x => x.DateTime).ToArray(); + Dates = DateTimes.Select(x => x.ToOADate()).ToArray(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Finance/SimpleMovingAverage.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Finance/SimpleMovingAverage.cs new file mode 100644 index 000000000..b26b74aaf --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Finance/SimpleMovingAverage.cs @@ -0,0 +1,17 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class SimpleMovingAverage + { + public readonly double[] Means; + public readonly DateTime[] DateTimes; + public readonly double[] Dates; + + public SimpleMovingAverage(List ohlcs, int n) + { + double[] prices = ohlcs.Select(x => x.Close).ToArray(); + Means = Series.MovingAverage(prices, n); + DateTimes = ohlcs.Skip(n).Select(x => x.DateTime).ToArray(); + Dates = DateTimes.Select(x => x.ToOADate()).ToArray(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/AxisManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/AxisManager.cs new file mode 100644 index 000000000..2c9c1b7f3 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/AxisManager.cs @@ -0,0 +1,450 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class AxisManager + { + private readonly Plot _plot; + + /// + /// Logic that determines padding around the data area when is called + /// + public IAutoScaler AutoScaler { get; set; } = new FractionalAutoScaler(.1, .15); + + /// + /// Horizontal axes + /// + internal List XAxes { get; } = new(); + + /// + /// Vertical axes + /// + internal List YAxes { get; } = new(); + + /// + /// Panels take up spce on one side of the data area (like a colorbar) + /// + internal List Panels { get; } = new(); + + /// + /// A special panel + /// + public TitlePanel Title { get; } = new(); + + /// + /// All axes + /// + public IEnumerable GetAxes() => XAxes.Cast().Concat(YAxes); + + /// + /// All axes with the given edge + /// + public IEnumerable GetAxes(Edge edge) => GetAxes().Where(x => x.Edge == edge).ToArray(); + + /// + /// Returns all axes, panels, and the title + /// + /// + internal IPanel[] GetPanels() => GetAxes().Concat(Panels).Concat(new[] { Title }).ToArray(); + + /// + /// The primary horizontal axis above the plot + /// + public IXAxis Top => XAxes.First(x => x.Edge == Edge.Top); + + /// + /// The primary horizontal axis below the plot + /// + public IXAxis Bottom => XAxes.First(x => x.Edge == Edge.Bottom); + + /// + /// The primary vertical axis to the left of the plot + /// + public IYAxis Left => YAxes.First(x => x.Edge == Edge.Left); + + /// + /// The primary vertical axis to the right of the plot + /// + public IYAxis Right => YAxes.First(x => x.Edge == Edge.Right); + + /// + /// All grids + /// + public List Grids { get; } = new(); + + /// + /// Rules that are applied before each render + /// + public List Rules { get; } = new(); + + /// + /// Contains state and logic for axes + /// + public AxisManager(Plot plot) + { + _plot = plot; + + // setup the default primary X and Y axes + IXAxis xAxisPrimary = new BottomAxis(); + IYAxis yAxisPrimary = new LeftAxis(); + XAxes.Add(xAxisPrimary); + YAxes.Add(yAxisPrimary); + + // add labeless secondary axes to get right side ticks and padding + IXAxis xAxisSecondary = new TopAxis(); + IYAxis yAxisSecondary = new RightAxis(); + XAxes.Add(xAxisSecondary); + YAxes.Add(yAxisSecondary); + + // add a default grid using the primary axes + IGrid grid = new DefaultGrid(xAxisPrimary, yAxisPrimary); + Grids.Add(grid); + } + + public void Clear() + { + Grids.Clear(); + Panels.Clear(); + YAxes.Clear(); + XAxes.Clear(); + } + + /// + /// Remove all axes that lie on the given edge. + /// + public void Remove(Edge edge) + { + foreach (IAxis axis in GetAxes(edge).ToArray()) + { + if (axis is IXAxis xAxis) + { + _plot.Axes.XAxes.Remove(xAxis); + } + + if (axis is IYAxis yAxis) + { + _plot.Axes.YAxes.Remove(yAxis); + } + } + } + + /// + /// Remove all axes on the given edge and add a new one that displays DateTime ticks + /// + public void DateTimeTicks(Edge edge) + { + Remove(edge); + + IXAxis dateAxis = edge switch + { + Edge.Left => throw new NotImplementedException(), // TODO: support vertical DateTime axes + Edge.Right => throw new NotImplementedException(), + Edge.Bottom => new DateTimeXAxis(), + Edge.Top => throw new NotImplementedException(), + _ => throw new NotImplementedException(), + }; + + _plot.Axes.XAxes.Add(dateAxis); + + foreach (IGrid grid in _plot.Axes.Grids) + { + grid.Replace(dateAxis); + } + } + + /// + /// Crete a new axis, add it to the plot, and return it + /// + public LeftAxis AddLeftAxis() + { + LeftAxis axis = new(); + YAxes.Add(axis); + return axis; + } + + /// + /// Crete a new axis, add it to the plot, and return it + /// + public RightAxis AddRightAxis() + { + RightAxis axis = new(); + YAxes.Add(axis); + return axis; + } + + /// + /// Crete a new axis, add it to the plot, and return it + /// + public BottomAxis AddBottomAxis() + { + BottomAxis axis = new(); + XAxes.Add(axis); + return axis; + } + + /// + /// Crete a new axis, add it to the plot, and return it + /// + public TopAxis AddTopAxis() + { + TopAxis axis = new(); + XAxes.Add(axis); + return axis; + } + + + public void SetLimitsX(double left, double right, IXAxis xAxis) + { + xAxis.Min = left; + xAxis.Max = right; + } + + public void SetLimitsY(double bottom, double top, IYAxis yAxis) + { + yAxis.Min = bottom; + yAxis.Max = top; + } + + public void SetLimitsX(double left, double right) + { + SetLimitsX(left, right, Bottom); + } + + public void SetLimitsY(double bottom, double top) + { + SetLimitsY(bottom, top, Left); + } + + public void SetLimits(double left, double right, double bottom, double top) + { + SetLimitsX(left, right, Bottom); + SetLimitsY(bottom, top, Left); + } + + public void SetLimits(double left, double right, double bottom, double top, IXAxis xAxis, IYAxis yAxis) + { + SetLimitsX(left, right, xAxis); + SetLimitsY(bottom, top, yAxis); + } + + public void SetLimits(double? left = null, double? right = null, double? bottom = null, double? top = null) + { + SetLimitsX(left ?? Bottom.Min, right ?? Bottom.Max); + SetLimitsY(bottom ?? Left.Min, top ?? Left.Max); + } + + public void SetLimits(CoordinateRect rect) + { + SetLimits(rect.Left, rect.Right, rect.Bottom, rect.Top); + } + + public void SetLimitsX(CoordinateRect limits) + { + SetLimitsX(limits.Left, limits.Right, Bottom); + } + + public void SetLimitsY(CoordinateRect limits) + { + SetLimitsY(limits.Bottom, limits.Top, Left); + } + + public void SetLimitsX(AxisLimits limits) + { + SetLimitsX(limits.Left, limits.Right); + } + + public void SetLimitsX(AxisLimits limits, IXAxis xAxis) + { + SetLimitsX(limits.Left, limits.Right, xAxis); + } + + public void SetLimitsY(AxisLimits limits) + { + SetLimitsY(limits.Bottom, limits.Top); + } + + public void SetLimitsY(AxisLimits limits, IYAxis yAxis) + { + SetLimitsY(limits.Bottom, limits.Top, yAxis); + } + + public void SetLimits(AxisLimits limits) + { + SetLimits(limits, Bottom, Left); + } + + public void SetLimits(AxisLimits limits, IXAxis xAxis, IYAxis yAxis) + { + SetLimitsX(limits.Left, limits.Right, xAxis); + SetLimitsY(limits.Bottom, limits.Top, yAxis); + } + + public void SetLimits(CoordinateRange xRange, CoordinateRange yRange) + { + AxisLimits limits = new(xRange.Min, xRange.Max, yRange.Min, yRange.Max); + SetLimits(limits); + } + + /// + /// Return the 2D axis limits for the default axes + /// + public AxisLimits GetLimits() + { + return new AxisLimits( + Bottom.Min, + Bottom.Max, + Left.Min, + Left.Max); + } + + /// + /// Return the 2D axis limits for the given X/Y axis pair + /// + public AxisLimits GetLimits(IXAxis xAxis, IYAxis yAxis) + { + return new AxisLimits(xAxis.Min, xAxis.Max, yAxis.Min, yAxis.Max); + } + + /// + /// Return the 2D axis limits for the given X/Y axis pair + /// + public AxisLimits GetLimits(IAxes axes) + { + return GetLimits(axes.XAxis, axes.YAxis); + } + + /// + /// Adds the default X and Y axes to all plottables with unset axes + /// + internal void ReplaceNullAxesWithDefaults() + { + foreach (var plottable in _plot.PlottableList) + { + if (plottable.Axes.XAxis is null) + { + plottable.Axes.XAxis = Bottom; + } + + if (plottable.Axes.YAxis is null) + { + plottable.Axes.YAxis = Left; + } + } + } + + /// + /// Automatically scale all axes to fit the data in all plottables + /// + public void AutoScale() + { + ReplaceNullAxesWithDefaults(); + AutoScaler.AutoScaleAll(_plot.PlottableList); // TODO: this should call the autoscaler's GetAxisLimits() + } + + public void AutoScaleX() + { + AutoScaleX(Bottom); + } + + public void AutoScaleY() + { + AutoScaleY(Left); + } + + public void AutoScaleX(IXAxis xAxis) + { + ReplaceNullAxesWithDefaults(); + AxisLimits limits = AutoScaler.GetAxisLimits(_plot, xAxis, Left); + SetLimitsX(limits.Left, limits.Right, xAxis); + } + + public void AutoScaleY(IYAxis yAxis) + { + ReplaceNullAxesWithDefaults(); + AxisLimits limits = AutoScaler.GetAxisLimits(_plot, Bottom, yAxis); + SetLimitsY(limits.Bottom, limits.Top, yAxis); + } + + /// + /// Autoscale the given axes to accommodate the data from all plottables that use them + /// + public void AutoScale(IXAxis xAxis, IYAxis yAxis, bool horizontal = true, bool vertical = true) + { + ReplaceNullAxesWithDefaults(); + + AxisLimits limits = AutoScaler.GetAxisLimits(_plot, xAxis, yAxis); + + if (horizontal) + { + SetLimitsX(limits.Left, limits.Right, xAxis); + } + + if (vertical) + { + SetLimitsY(limits.Bottom, limits.Top, yAxis); + } + } + + /// + /// Adjust limits all axes to pan by the given distance in coordinate space + /// + public void Pan(CoordinateSize distance) + { + XAxes.ForEach(x => x.Range.Pan(distance.Width)); + YAxes.ForEach(x => x.Range.Pan(distance.Height)); + } + + /// + /// Adjust limits all axes to pan by the given distance in pixel space + /// + public void Pan(PixelSize distance) + { + if (_plot.RenderManager.LastRender.Count == 0) + { + throw new InvalidOperationException("at least one render is required before pixel panning is possible"); + } + + XAxes.ForEach(ax => + ax.Range.Pan(ax.GetCoordinateDistance(distance.Width, _plot.RenderManager.LastRender.DataRect))); + YAxes.ForEach(ax => + ax.Range.Pan(ax.GetCoordinateDistance(distance.Height, _plot.RenderManager.LastRender.DataRect))); + } + + /// + /// Modify limits of all axes to apply the given zoom. + /// Fractional values >1 zoom in and <1 zoom out. + /// + public void Zoom(double fracX = 1.0, double fracY = 1.0) + { + XAxes.ForEach(xAxis => xAxis.Range.ZoomFrac(fracX)); + YAxes.ForEach(yAxis => yAxis.Range.ZoomFrac(fracY)); + } + + /// + /// Reset plot data margins to their default value. + /// + public void Margins() + { + AutoScaler = new FractionalAutoScaler(); + AutoScale(); + } + + /// + /// Define the amount of whitespace to place around the data area when calling . + /// Values are a fraction from 0 (tightly fit the data) to 1 (lots of whitespace). + /// + public void Margins(double horizontal = 0.1, double vertical = .15) + { + AutoScaler = new FractionalAutoScaler(horizontal, vertical); + AutoScale(); + } + + /// + /// Define the amount of whitespace to place around the data area when calling . + /// Values are a fraction from 0 (tightly fit the data) to 1 (lots of whitespace). + /// + public void Margins(double left = .05, double right = .05, double bottom = .07, double top = .07) + { + AutoScaler = new FractionalAutoScaler(left, right, bottom, top); + AutoScale(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/CompilerFeatureRequiredAttribute.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/CompilerFeatureRequiredAttribute.cs new file mode 100644 index 000000000..bc7483434 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/CompilerFeatureRequiredAttribute.cs @@ -0,0 +1,13 @@ +namespace System.Runtime.CompilerServices +{ + /// + /// Allows required members in older .NET versions + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class CompilerFeatureRequiredAttribute : Attribute + { + public CompilerFeatureRequiredAttribute(string _) + { + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/DataOperations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/DataOperations.cs new file mode 100644 index 000000000..473a0f57e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/DataOperations.cs @@ -0,0 +1,65 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public static class DataOperations + { + public static double[,] ResizeHalf(double[,] values) + { + var height = values.GetLength(0); + var width = values.GetLength(1); + + var heightNew = (int)Math.Floor((double)height / 2); + var widthNew = (int)Math.Floor((double)width / 2); + + var output = new double[heightNew, widthNew]; + + for (var y = 0; y < heightNew; y++) + { + for (var x = 0; x < widthNew; x++) + { + double sum = 0; + sum += values[y * 2, x * 2]; + sum += values[y * 2 + 1, x * 2]; + sum += values[y * 2, x * 2 + 1]; + sum += values[y * 2 + 1, x * 2 + 1]; + output[y, x] = sum / 4; + } + } + + return output; + } + + public static double[,] ReplaceNullWithNaN(double?[,] values) + { + var height = values.GetLength(0); + var width = values.GetLength(1); + var output = new double[height, width]; + + for (var y = 0; y < height; y++) + { + for (var x = 0; x < width; x++) + { + output[y, x] = values[y, x] ?? double.NaN; + } + } + + return output; + } + + public static double?[,] ReplaceNaNWithNull(double[,] values) + { + var height = values.GetLength(0); + var width = values.GetLength(1); + var output = new double?[height, width]; + + for (var y = 0; y < height; y++) + { + for (var x = 0; x < width; x++) + { + output[y, x] = double.IsNaN(values[y, x]) ? null : values[y, x]; + } + } + + return output; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/Drawing.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/Drawing.cs new file mode 100644 index 000000000..49c1149b5 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/Drawing.cs @@ -0,0 +1,319 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Common operations using the default rendering system. + /// + public static class Drawing + { + public static PixelSize MeasureString(string text, SKPaint paint) + { + var strings = text.Split('\n'); + if (strings.Length > 1) + { + return strings + .Select(s => MeasureString(s, paint)) + .Aggregate((a, b) => new PixelSize(Math.Max(a.Width, b.Width), a.Height + b.Height)); + } + + SKRect bounds = new(); + paint.MeasureText(text, ref bounds); + + var width = bounds.Width; + var height = bounds.Height; + return new PixelSize(width, height); + } + + public static PixelSize MeasureLargestString(string[] strings, SKPaint paint) + { + float maxWidth = 0; + float maxHeight = 0; + + for (var i = 0; i < strings.Length; i++) + { + PixelSize tickSize = MeasureString(strings[i], paint); + maxWidth = Math.Max(maxWidth, tickSize.Width); + maxHeight = Math.Max(maxHeight, tickSize.Height); + } + + return new PixelSize(maxWidth, maxHeight); + } + + public static void DrawLine(SKCanvas canvas, SKPaint paint, PixelLine pixelLine) + { + DrawLine(canvas, paint, pixelLine.Pixel1, pixelLine.Pixel2); + } + + public static void DrawLine(SKCanvas canvas, SKPaint paint, Pixel pt1, Pixel pt2) + { + if (paint.StrokeWidth == 0) + { + return; + } + + canvas.DrawLine(pt1.ToSkPoint(), pt2.ToSkPoint(), paint); + } + + public static void DrawLine(SKCanvas canvas, SKPaint paint, PixelLine pxLine, LineStyle lineStyle) + { + DrawLine(canvas, paint, pxLine.Pixel1, pxLine.Pixel2, lineStyle); + } + + public static void DrawLine(SKCanvas canvas, SKPaint paint, Pixel pt1, Pixel pt2, LineStyle lineStyle) + { + if (lineStyle.Width == 0 || lineStyle.IsVisible == false) // TODO: move this check in the LineStyle class + { + return; + } + + lineStyle.ApplyToPaint(paint); + if (paint.StrokeWidth == 0) + { + return; + } + + canvas.DrawLine(pt1.ToSkPoint(), pt2.ToSkPoint(), paint); + } + + public static void DrawLine(SKCanvas canvas, SKPaint paint, Pixel pt1, Pixel pt2, Color color, float width = 1, bool antiAlias = true, LinePattern pattern = LinePattern.Solid) + { + if (width == 0) + { + return; + } + + paint.Color = color.ToSkColor(); + paint.IsStroke = true; + paint.IsAntialias = antiAlias; + paint.StrokeWidth = width; + paint.PathEffect = pattern.GetPathEffect(); + if (paint.StrokeWidth == 0) + { + return; + } + + canvas.DrawLine(pt1.ToSkPoint(), pt2.ToSkPoint(), paint); + } + + public static void DrawLines(SKCanvas canvas, Pixel[] starts, Pixel[] ends, Color color, float width = 1, bool antiAlias = true, LinePattern pattern = LinePattern.Solid) + { + if (width == 0) + { + return; + } + + if (starts.Length != ends.Length) + { + throw new ArgumentException($"{nameof(starts)} and {nameof(ends)} must have same length"); + } + + using SKPaint paint = new() + { + Color = color.ToSkColor(), + IsStroke = true, + IsAntialias = antiAlias, + StrokeWidth = width, + PathEffect = pattern.GetPathEffect(), + }; + + using SKPath path = new(); + + for (var i = 0; i < starts.Length; i++) + { + path.MoveTo(starts[i].X, starts[i].Y); + path.LineTo(ends[i].X, ends[i].Y); + } + + canvas.DrawPath(path, paint); + } + + public static void DrawLines(SKCanvas canvas, SKPaint paint, IEnumerable pixels, Color color, float width = 1, bool antiAlias = true, LinePattern pattern = LinePattern.Solid) + { + LineStyle ls = new() + { + Color = color, + AntiAlias = antiAlias, + Width = width, + Pattern = pattern, + }; + + DrawLines(canvas, paint, pixels, ls); + } + + public static void DrawLines(SKCanvas canvas, SKPaint paint, IEnumerable pixels, LineStyle lineStyle) + { + if (lineStyle.Width == 0 || lineStyle.IsVisible == false || pixels.Count() < 2) + { + return; + } + + lineStyle.ApplyToPaint(paint); + + using SKPath path = new(); + + path.MoveTo(pixels.First().ToSkPoint()); + + foreach (var pixel in pixels.Skip(1)) + { + path.LineTo(pixel.ToSkPoint()); + } + + canvas.DrawPath(path, paint); + } + + public static void Fillectangle(SKCanvas canvas, PixelRect rect, SKPaint paint) + { + canvas.DrawRect(rect.ToSkRect(), paint); + } + + public static void Fillectangle(SKCanvas canvas, PixelRect rect, Color color) + { + using SKPaint paint = new() + { + Color = color.ToSkColor(), + IsStroke = false, + IsAntialias = true, + }; + + canvas.DrawRect(rect.ToSkRect(), paint); + } + + public static void DrawRectangle(SKCanvas canvas, PixelRect rect, SKPaint paint) + { + canvas.DrawRect(rect.ToSkRect(), paint); + } + + public static void DrawRectangle(SKCanvas canvas, PixelRect rect, Color color, float lineWidth = 1) + { + using SKPaint paint = new() + { + Color = color.ToSkColor(), + IsStroke = true, + StrokeWidth = lineWidth, + IsAntialias = true, + }; + + DrawRectangle(canvas, rect, paint); + } + + public static void DrawDebugRectangle(SKCanvas canvas, PixelRect rect, Pixel point, Color color, float lineWidth = 1) + { + using SKPaint paint = new() + { + Color = color.ToSkColor(), + IsStroke = true, + StrokeWidth = lineWidth, + IsAntialias = true, + }; + + canvas.DrawRect(rect.ToSkRect(), paint); + canvas.DrawLine(rect.BottomLeft.ToSkPoint(), rect.TopRight.ToSkPoint(), paint); + canvas.DrawLine(rect.TopLeft.ToSkPoint(), rect.BottomRight.ToSkPoint(), paint); + + canvas.DrawCircle(point.ToSkPoint(), 5, paint); + + paint.IsStroke = false; + paint.Color = paint.Color.WithAlpha(20); + canvas.DrawRect(rect.ToSkRect(), paint); + } + + public static void DrawCircle(SKCanvas canvas, Pixel center, Color color, float radius = 5, bool fill = true) + { + using SKPaint paint = new() + { + Color = color.ToSkColor(), + IsStroke = !fill, + IsAntialias = true, + }; + + canvas.DrawCircle(center.ToSkPoint(), radius, paint); + } + + public static void DrawMarker(SKCanvas canvas, SKPaint paint, Pixel pixel, MarkerStyle style) + { + if (!style.IsVisible) + { + return; + } + + IMarker renderer = style.Shape.GetRenderer(); + + renderer.Render(canvas, paint, pixel, style.Size, style.Fill, style.Outline); + } + + public static void DrawMarkers(SKCanvas canvas, SKPaint paint, IEnumerable pixels, MarkerStyle style) + { + if (!style.IsVisible) + { + return; + } + + IMarker renderer = style.Shape.GetRenderer(); + + foreach (Pixel pixel in pixels) + { + renderer.Render(canvas, paint, pixel, style.Size, style.Fill, style.Outline); + } + } + + public static SKBitmap BitmapFromArgbs(uint[] argbs, int width, int height) + { + var handle = GCHandle.Alloc(argbs, GCHandleType.Pinned); + + var imageInfo = new SKImageInfo(width, height); + var bmp = new SKBitmap(imageInfo); + bmp.InstallPixels( + info: imageInfo, + pixels: handle.AddrOfPinnedObject(), + rowBytes: imageInfo.RowBytes, + releaseProc: (IntPtr _, object _) => handle.Free()); + + return bmp; + } + + public static SKColorFilter GetMaskColorFilter(Color foreground, Color? background = null) + { + // This function and the math is explained here: https://bclehmann.github.io/2022/11/06/UnmaskingWithSKColorFilter.html + + background ??= Colors.Black; + + float redDifference = foreground.Red - background.Value.Red; + float greenDifference = foreground.Green - background.Value.Green; + float blueDifference = foreground.Blue - background.Value.Blue; + float alphaDifference = foreground.Alpha - background.Value.Alpha; + + // See https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/graphics/skiasharp/effects/color-filters + // for an explanation of this matrix + // + // Essentially, this matrix maps all gray colours to a line from `background.Value` to `foreground`. + // Black and white are at the extremes on this line, + // so they get mapped to `background.Value` and `foreground` respectively + var mat = new float[] { + redDifference / 255, 0, 0, 0, background.Value.Red / 255.0f, + 0, greenDifference / 255, 0, 0, background.Value.Green / 255.0f, + 0, 0, blueDifference / 255, 0, background.Value.Blue / 255.0f, + alphaDifference / 255, 0, 0, 0, background.Value.Alpha / 255.0f, + }; + + var filter = SKColorFilter.CreateColorMatrix(mat); + return filter; + } + + public static SKSurface CreateSurface(int width, int height) + { + SKImageInfo imageInfo = new( + width: width, + height: height, + colorType: SKColorType.Rgba8888, + alphaType: SKAlphaType.Premul); + + return SKSurface.Create(imageInfo); + } + + public static void SavePng(SKSurface surface, string filename) + { + using var skimg = surface.Snapshot(); + Image img = new(skimg); + img.SavePng(filename); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/Fonts.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/Fonts.cs new file mode 100644 index 000000000..129617e6b --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/Fonts.cs @@ -0,0 +1,283 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Cross-platform tools for working with fonts + /// + public static class Fonts + { + /// + /// This font is used for almost all text rendering. + /// + public static string Default { get; set; } = InstalledSansFont(); + + /// + /// Name of a sans-serif font present on the system + /// + public static string Sans { get; set; } = InstalledSansFont(); + + /// + /// Name of a serif font present on the system + /// + public static string Serif { get; set; } = InstalledSerifFont(); + + /// + /// Name of a monospace font present on the system + /// + public static string Monospace { get; set; } = InstalledMonospaceFont(); + + /// + /// The default font on the system + /// + public static string System { get; } = SKTypeface.Default.FamilyName; + + /// + /// Returns true if the given font is present on the system + /// + public static bool Exists(string fontName) + { + return GetInstalledFonts().Contains(fontName); + } + + #region PRIVATE + + private static HashSet GetInstalledFonts() + { + return new(SKFontManager.Default.FontFamilies, StringComparer.InvariantCultureIgnoreCase); + } + + private static string InstalledSansFont() + { + // Prefer the the system default because it is probably the best for international users + // https://github.com/ScottPlot/ScottPlot/issues/2746 + var font = SKTypeface.Default.FamilyName; + + // Favor "Open Sans" over "Segoe UI" because better anti-aliasing + var installedFonts = GetInstalledFonts(); + if (font == "Segoe UI" && installedFonts.Contains("Open Sans")) + { + font = "Open Sans"; + } + + return font; + } + + private static string InstalledMonospaceFont() + { + var installedFonts = GetInstalledFonts(); + + string[] preferredFonts = { "Roboto Mono", "Consolas", "DejaVu Sans Mono", "Courier" }; + foreach (var preferredFont in preferredFonts) + { + if (installedFonts.Contains(preferredFont)) + { + return SKTypeface.FromFamilyName(preferredFont).FamilyName; + } + } + + return SKTypeface.Default.FamilyName; + } + + private static string InstalledSerifFont() + { + var installedFonts = GetInstalledFonts(); + + string[] preferredFonts = { "Times New Roman", "DejaVu Serif", "Times" }; + foreach (var preferredFont in preferredFonts) + { + if (installedFonts.Contains(preferredFont)) + { + return SKTypeface.FromFamilyName(preferredFont).FamilyName; + } + } + + return SKTypeface.Default.FamilyName; + } + + #endregion + + #region Font Detection + + /// + /// Use the characters in the string to detetermine an installed system font + /// most likely to support this character set. + /// Returns the system font if an ideal font cannot be determined. + /// + public static string Detect(string text) + { + // TODO: Use the ScottPlot default font. Maybe give as an input parameter? + // TODO: Replace unrenderable characters with "�" + // Should replace characters consisting of multiple code points, as well as missing glyphs. + // + // We ignore Unicode characters that are made up of multiple code points since it looks like they + // cannot be rendered without more work, e.g. by using HarfBuzz or similar at higher levels. + // + // The function breaks down the input text string into "text elements" (=grapheme clusters). + // A text element can consist of multiple Unicode code points. + // Each code point can consist of 1 or 2 C# 'char's (=UTF-16 code units). + + var defaultFontFamily = GetDefaultFontFamily(); // Should use the ScottPlot default font instead + var standaloneCodePoints = GetStandaloneCodePoints(text); + + List candidateFontNames = GetCandidateFontsForString(standaloneCodePoints); + + if (!candidateFontNames.Any()) + { + return string.Empty; // TODO: Signal an error somehow? Could return default font name. + } + + // We prefer the default font if it can render the string without missing glyphs + if (candidateFontNames.Contains(defaultFontFamily) && + CountMissingGlyphs(defaultFontFamily, standaloneCodePoints) == 0) + { + return defaultFontFamily; + } + + var bestFontName = candidateFontNames + .Select(fontName => new { fontName, NumMissingGlyphs = CountMissingGlyphs(fontName, standaloneCodePoints) }) + .OrderBy(result => result.NumMissingGlyphs) + .First() + .fontName; + + return bestFontName; + } + + public static string GetDefaultFontFamily() + { + using var typeface = SKFontManager.Default.MatchCharacter(' '); + + if (typeface != null) + { + return typeface.FamilyName; + } + else + { + return string.Empty; + } + } + + public static List GetCandidateFontsForString(List standaloneCodePoints) + { + HashSet candidateFontNames = []; // Using HashSet to avoid duplicates + + foreach (var standaloneCodePoint in standaloneCodePoints) + { + using var typeface = SKFontManager.Default.MatchCharacter(standaloneCodePoint); + if (typeface != null) + { + candidateFontNames.Add(typeface.FamilyName); + } + + var ch = char.ConvertFromUtf32(standaloneCodePoint); + DebugUtilities.WriteLine($"Input codepoint '{standaloneCodePoint}', char '{ch}': Typeface = {typeface?.FamilyName}"); + } + + return candidateFontNames.ToList(); + } + + public static int CountMissingGlyphs(string fontName, List standaloneCodePoints) + { + var missingGlyphCount = 0; + + using var typeface = SKTypeface.FromFamilyName(fontName); + if (typeface != null) + { + foreach (var standaloneCodePoint in standaloneCodePoints) + { + ReadOnlySpan codePoints = [standaloneCodePoint]; + if (!typeface.ContainsGlyphs(codePoints)) + { + missingGlyphCount++; + } + } + var s = string.Join("", standaloneCodePoints.Select(char.ConvertFromUtf32)); + DebugUtilities.WriteLine($"Input '{s}': Font {fontName} has {missingGlyphCount} items with missing glyphs"); + } + else + { + missingGlyphCount = int.MaxValue; + } + + return missingGlyphCount; + } + + public static List GetStandaloneCodePoints(string inputText) + { + List textElements = ConvertStringToTextElements(inputText); + IEnumerable> codePoints = textElements.Select(ConvertTextElementToUtf32CodePoints); + var standaloneCodePoints = GetStandaloneCodePoints(codePoints); + + return standaloneCodePoints; + } + + public static List ConvertStringToTextElements(string textString) + { + List resultList = []; + + var chars = StringInfo.GetTextElementEnumerator(textString); + while (chars.MoveNext()) + { + var textElement = chars.GetTextElement(); + + resultList.Add(textElement); + } + + return resultList; + } + + + /// + /// Take a single text element ("grapheme cluster") as input, + /// and return one or more Unicode code points. + /// The code points are represented with signed ints since that is idiomatic for C#, + /// even though they are always unsigned values. + /// + public static List ConvertTextElementToUtf32CodePoints(string textElement) + { + List resultList = []; + + var i = 0; + while (i < textElement.Length) + { + // ArgumentOutOfRangeException is possible for malformed input strings, + // we let that propagate up to the user + var codePoint = char.ConvertToUtf32(textElement, i); + resultList.Add(codePoint); + + // Did we consume one or two chars? + if (char.IsHighSurrogate(textElement, i)) + { + i += 2; + } + else + { + i += 1; + } + } + + return resultList; + } + + public static List GetStandaloneCodePoints(IEnumerable> codePointLists) + { + // Take a list of code point lists as input. + // Each code point list must correspond to a single text element ("grapheme cluster"). + // Filter the list to retain the code point lists made up of single code points, + // i.e. remove combining characters, etc. + // Return as a flattened list of the remaining standalone code points. + + List codePoints = []; + + foreach (var codePointList in codePointLists) + { + if (codePointList.Count == 1) + { + codePoints.Add(codePointList[0]); + } + } + + return codePoints; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/Generate.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/Generate.cs new file mode 100644 index 000000000..a64ff022f --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/Generate.cs @@ -0,0 +1,559 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This class contains methods which generate sample data for testing and demonstration purposes + /// + public static class Generate + { + public static RandomDataGenerator RandomData { get; } = new(0); + + #region numerical 1D + + /// + /// Return an array of evenly-spaced numbers + /// + public static double[] Consecutive(int count = 51, double delta = 1, double first = 0) + { + var ys = new double[count]; + for (var i = 0; i < ys.Length; i++) + { + ys[i] = i * delta + first; + } + + return ys; + } + + /// + /// Return an array of sine waves between -1 and 1. + /// Values are multiplied by then shifted by . + /// Phase shifts the sine wave horizontally between 0 and 2 Pi. + /// + public static double[] Sin(int count = 51, double mult = 1, double offset = 0, double oscillations = 1, double phase = 0) + { + var sinScale = 2 * Math.PI * oscillations / (count - 1); + var ys = new double[count]; + for (var i = 0; i < ys.Length; i++) + { + ys[i] = Math.Sin(i * sinScale + phase * Math.PI * 2) * mult + offset; + } + + return ys; + } + + /// + /// Return an array of cosine waves between -1 and 1. + /// Values are multiplied by then shifted by . + /// Phase shifts the sine wave horizontally between 0 and 2 Pi. + /// + public static double[] Cos(int count = 51, double mult = 1, double offset = 0, double oscillations = 1, double phase = 0) + { + var sinScale = 2 * Math.PI * oscillations / (count - 1); + var ys = new double[count]; + for (var i = 0; i < ys.Length; i++) + { + ys[i] = Math.Cos(i * sinScale + phase * Math.PI * 2) * mult + offset; + } + + return ys; + } + + public static double[] NoisySin(Random rand, int count = 51, double noiseLevel = 1) + { + var data = Sin(count); + for (var i = 0; i < data.Length; i++) + { + data[i] += rand.NextDouble() * noiseLevel; + } + return data; + } + + public static double[] SquareWave(uint cycles = 20, uint pointsPerCycle = 1_000, double duty = .5, double low = 0, double high = 1) + { + if (duty is < 0 or > 1) + { + throw new ArgumentException($"{nameof(duty)} must be in the range [0, 1]"); + } + + var points = cycles * pointsPerCycle; + var cyclePointsHigh = (uint)(pointsPerCycle * duty); + var cyclePointsLow = pointsPerCycle - cyclePointsHigh; + + var values = new double[points]; + + uint i = 0; + + for (var c = 0; c < cycles; c++) + { + for (var p = 0; p < cyclePointsLow; p++) + { + values[i++] = low; + } + + for (var p = 0; p < cyclePointsHigh; p++) + { + values[i++] = high; + } + } + + return values; + } + + public static double[] Zeros(int count) + { + return Repeating(count, 0); + } + + public static double[] Ones(int count) + { + return Repeating(count, 1); + } + + public static double[] Repeating(int count, double value) + { + var values = new double[count]; + + for (var i = 0; i < values.Length; i++) + { + values[i] = value; + } + + return values; + } + + #endregion + + #region numerical 2D + + /// + /// Generates a 2D array of numbers with constant spacing. + /// + /// + /// + /// The space between points. + /// The first point. + /// + public static double[,] Consecutive2D(int rows, int columns, double spacing = 1, double offset = 0) + { + var data = new double[rows, columns]; + + var count = offset; + for (var y = 0; y < data.GetLength(0); y++) + { + for (var x = 0; x < data.GetLength(1); x++) + { + data[y, x] = count; + count += spacing; + } + } + + return data; + } + + /// + /// Generates a 2D sine pattern. + /// + /// + /// + /// Frequency factor in x direction. + /// Frequency factor in y direction. + /// Intensity factor. + public static double[,] Sin2D(int width, int height, double xPeriod = .2, double yPeriod = .2, double multiple = 100) + { + var intensities = new double[height, width]; + + for (var y = 0; y < height; y++) + { + var siny = Math.Cos(y * yPeriod) * multiple; + for (var x = 0; x < width; x++) + { + var sinx = Math.Sin(x * xPeriod) * multiple; + intensities[y, x] = sinx + siny; + } + } + + return intensities; + } + + /// + /// Generate a 2D array in a diagonal gradient pattern + /// + /// + /// + /// + /// + /// + public static double[,] Ramp2D(int width, int height, double min = 0, double max = 1) + { + var intensities = new double[height, width]; + + var span = max - min; + + for (var y = 0; y < height; y++) + { + var fracY = (double)y / height; + var valY = fracY * span + min; + + for (var x = 0; x < width; x++) + { + var fracX = (double)x / width; + var valX = fracX * span + min; + + intensities[y, x] = (valX + valY) / 2; + } + } + + return intensities; + } + + #endregion + + #region numerical random + + /// + /// Return a series of values starting with and + /// each randomly deviating from the previous by at most . + /// + public static double[] RandomWalk(int count, double mult = 1, double offset = 0) + { + return RandomData.RandomWalk(count, mult, offset); + } + + public class RandomWalker(int seed = 0) + { + readonly RandomDataGenerator _gen = new(seed); + double _lastValue = 0; + + public double GetNext() + { + var value = _gen.RandomWalk(1, offset: _lastValue)[0]; + _lastValue = value; + return value; + } + + public double[] GetNext(int count) + { + var values = _gen.RandomWalk(count, offset: _lastValue); + _lastValue = values[values.Length - 1]; + return values; + } + } + + [Obsolete("use RandomSample()")] + public static double[] Random(int count, double min = 0, double max = 1) + { + return RandomSample(count, min, max); + } + + /// + /// Return an array of random values + /// from to + /// + public static double[] RandomSample(int count, double min = 0, double max = 1) + { + return Enumerable.Range(0, count) + .Select(_ => RandomData.RandomNumber(min, max)) + .ToArray(); + } + + public static double[] RandomNormal(int count, double mean = 0, double stdDev = 1) + { + return Enumerable.Range(0, count) + .Select(_ => RandomData.RandomNormalNumber(mean, stdDev)) + .ToArray(); + } + + /// + /// RandomSample integer between zero (inclusive) and (exclusive) + /// + public static int RandomInteger(int max) + { + return RandomData.RandomInteger(max); + } + + /// + /// RandomSample integer between (inclusive) and (exclusive) + /// + public static int RandomInteger(int min, int max) + { + return RandomData.RandomInteger(min, max); + } + + /// + /// RandomSample integers between zero (inclusive) and (exclusive) + /// + public static int[] RandomIntegers(int count, int max) + { + return Enumerable + .Range(0, count) + .Select(x => RandomData.RandomInteger(max)) + .ToArray(); + } + + /// + /// RandomSample integers between (inclusive) and (exclusive) + /// + public static int[] RandomIntegers(int count, int min, int max) + { + return Enumerable + .Range(0, count) + .Select(x => RandomData.RandomInteger(min, max)) + .ToArray(); + } + + /// + /// Return a copy of the given array with random values added to each point + /// + public static double[] AddNoise(double[] input, double magnitude = 1) + { + var output = new double[input.Length]; + Array.Copy(input, 0, output, 0, input.Length); + AddNoiseInPlace(output, magnitude); + return output; + } + + /// + /// Mutate the given array by adding a random value to each point + /// + public static void AddNoiseInPlace(double[] values, double magnitude = 1) + { + for (var i = 0; i < values.Length; i++) + { + values[i] = values[i] + RandomData.RandomNumber(-magnitude / 2, magnitude / 2); + } + } + + #endregion + + #region text + + public static char RandomChar() + { + return (char)('A' + RandomInteger(26)); + } + + public static string RandomString(int length) + { + var chars = new char[length]; + + for (var i = 0; i < chars.Length; i++) + { + chars[i] = RandomChar(); + } + + return new string(chars); + } + + #endregion + + #region Axes + + public static Coordinates RandomCoordinates(double xMult = 1, double yMult = 1, double xOffset = 0, double yOffset = 0) + { + var x = RandomData.RandomNumber() * xMult + xOffset; + var y = RandomData.RandomNumber() * yMult + yOffset; + return new Coordinates(x, y); + } + + public static Coordinates[] RandomCoordinates(int count, double xMult = 1, double yMult = 1, double xOffset = 0, double yOffset = 0) + { + Coordinates[] cs = new Coordinates[count]; + + for (var i = 0; i < count; i++) + { + cs[i] = RandomCoordinates(xMult, yMult, xOffset, yOffset); + } + + return cs; + } + + public static Coordinates RandomLocation() + { + AxisLimits limits = new(0, 1, 0, 1); + return RandomLocation(limits); + } + + public static Coordinates RandomLocation(AxisLimits limits) + { + var x = RandomData.RandomNumber() * limits.HorizontalSpan + limits.Left; + var y = RandomData.RandomNumber() * limits.VerticalSpan + limits.Bottom; + return new Coordinates(x, y); + } + + public static Coordinates[] RandomLocations(int count) + { + return Enumerable + .Range(0, count) + .Select(x => RandomCoordinates()) + .ToArray(); + } + + public static Coordinates[] RandomLocations(int count, AxisLimits limits) + { + return Enumerable + .Range(0, count) + .Select(x => RandomLocation(limits)) + .ToArray(); + } + + #endregion + + #region DateTime + + /// + /// Contains methods for generating DateTime sequences + /// + public static class DateTime + { + /// + /// Date of the first ScottPlot commit + /// + public static readonly System.DateTime ExampleDate = new(2018, 01, 03); + + /// + /// Evenly-spaced DateTimes + /// + public static System.DateTime[] Consecutive(int count, System.DateTime start, TimeSpan step) + { + var dt = start; + var values = new System.DateTime[count]; + for (var i = 0; i < count; i++) + { + values[i] = dt; + dt += step; + } + return values; + } + + public static System.DateTime[] Weekdays(int count, System.DateTime start) + { + var dates = new System.DateTime[count]; + var i = 0; + while (i < count) + { + if (start.DayOfWeek != DayOfWeek.Saturday && start.DayOfWeek != DayOfWeek.Sunday) + { + dates[i] = start; + i++; + } + + start = start.AddDays(1); + } + return dates; + } + + public static System.DateTime[] Weekdays(int count) => Weekdays(count, ExampleDate); + + public static System.DateTime[] Days(int count, System.DateTime start) => Consecutive(count, start, TimeSpan.FromDays(1)); + + public static System.DateTime[] Days(int count) => Days(count, ExampleDate); + + public static System.DateTime[] Hours(int count, System.DateTime start) => Consecutive(count, start, TimeSpan.FromHours(1)); + + public static System.DateTime[] Hours(int count) => Hours(count, ExampleDate); + + public static System.DateTime[] Minutes(int count, System.DateTime start) => Consecutive(count, start, TimeSpan.FromMinutes(1)); + + public static System.DateTime[] Minutes(int count) => Hours(count, ExampleDate); + + public static System.DateTime[] Seconds(int count, System.DateTime start) => Consecutive(count, start, TimeSpan.FromSeconds(1)); + + public static System.DateTime[] Seconds(int count) => Hours(count, ExampleDate); + } + + #endregion + + #region Finance + + public static List RandomOhlCs(int count) + { + return RandomData.RandomOhlCs(count); + } + + #endregion + + #region Plot Items + + public static Box RandomBox(double position) + { + var n = 50; + var mean = RandomData.RandomNumber(3); + var stdDev = RandomData.RandomNumber(3); + + var values = RandomNormal(n, mean, stdDev); + Array.Sort(values); + var min = values[0]; + var q1 = values[n / 4]; + var median = values[n / 2]; + var q3 = values[3 * n / 4]; + var max = values[n - 1]; + + return new Box + { + Position = position, + WhiskerMin = min, + BoxMin = q1, + BoxMiddle = median, + BoxMax = q3, + WhiskerMax = max, + }; + } + + public static Color RandomColor() + { + var r = RandomData.RandomByte(); + var g = RandomData.RandomByte(); + var b = RandomData.RandomByte(); + return new Color(r, g, b); + } + + /// + /// Generate a dark color by defining the maximum value to use for R, G, and B + /// + public static Color RandomColor(byte max) + { + var r = (byte)RandomData.RandomInteger(max); + var g = (byte)RandomData.RandomInteger(max); + var b = (byte)RandomData.RandomInteger(max); + return new Color(r, g, b); + } + + public static Color RandomColor(IColormap colormap) + { + return colormap.GetColor(RandomData.RandomNumber()); + } + + public static Color[] RandomColors(int count, IColormap colormap) + { + return RandomSample(count).Select(colormap.GetColor).ToArray(); + } + + public static MarkerShape RandomMarkerShape() + { + MarkerShape[] markerShapes = Enum + .GetValues(typeof(MarkerShape)) + .Cast() + .ToArray(); + + var i = RandomInteger(markerShapes.Length); + return markerShapes[i]; + } + + public static CoordinateLine RandomLine() + { + return new CoordinateLine(RandomLocation(), RandomLocation()); + } + + public static LinePattern RandomLinePattern() + { + LinePattern[] linePatterns = Enum + .GetValues(typeof(LinePattern)) + .Cast() + .ToArray(); + + var i = RandomInteger(linePatterns.Length); + return linePatterns[i]; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/IPanelExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/IPanelExtensions.cs new file mode 100644 index 000000000..0e13e5560 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/IPanelExtensions.cs @@ -0,0 +1,15 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public static class PanelExtensions + { + /// + /// Returns true for X axes (bottom and top) + /// + public static bool IsHorizontal(this IPanel panel) => panel.Edge is Edge.Bottom or Edge.Top; + + /// + /// Returns true for Y axes (left and right) + /// + public static bool IsVertical(this IPanel panel) => !panel.IsHorizontal(); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/ImageOperations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/ImageOperations.cs new file mode 100644 index 000000000..3b172ba69 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/ImageOperations.cs @@ -0,0 +1,11 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public static class ImageOperations + { + public static string GetImageHtml(byte[] bytes, string imageType = "png") + { + var b64 = Convert.ToBase64String(bytes); + return $""; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/IsExternalInit.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/IsExternalInit.cs new file mode 100644 index 000000000..79b1cce91 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/IsExternalInit.cs @@ -0,0 +1,8 @@ +namespace System.Runtime.CompilerServices +{ + /// + /// Allows init-only setters in older .NET versions + /// + [EditorBrowsable(EditorBrowsableState.Never)] + internal static class IsExternalInit { } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/LayoutManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/LayoutManager.cs new file mode 100644 index 000000000..90161e3db --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/LayoutManager.cs @@ -0,0 +1,53 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// A collection of methods for making common adjustments to plot layouts + /// + public class LayoutManager + { + private readonly Plot _plot; + + public ILayoutEngine LayoutEngine { get; set; } = new Automatic(); + + public LayoutManager(Plot plot) + { + _plot = plot; + } + + /// + /// Automatically resize the layout on each render to acheive the best fit + /// + public void Default() + { + LayoutEngine = new Automatic(); + } + + /// + /// Apply a fixed layout using the given rectangle to define the data area + /// + public void Fixed(PixelRect dataRect) + { + LayoutEngine = new FixedDataArea(dataRect); + } + + /// + /// Apply a fixed layout using the given padding to define space between the + /// data area and the edge of the figure + /// + public void Fixed(PixelPadding padding) + { + LayoutEngine = new FixedPadding(padding); + } + + /// + /// Disable visibility of all axes and titles so the data area fills the entire figure + /// + public void Frameless() + { + _plot.Axes.XAxes.ForEach(x => x.IsVisible = false); + _plot.Axes.YAxes.ForEach(x => x.IsVisible = false); + _plot.Axes.Title.IsVisible = false; + } + } + +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/NumericConversion.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/NumericConversion.cs new file mode 100644 index 000000000..2a460513a --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/NumericConversion.cs @@ -0,0 +1,256 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This class contains type-specific methods to convert between generic values and doubles + /// optimized for performance using platform-specific features. + /// See discussion in https://github.com/ScottPlot/ScottPlot/pull/1927 + /// + public static class NumericConversion + { + private const MethodImplOptions ImplOptions = +#if NETCOREAPP + MethodImplOptions.AggressiveOptimization | +#endif + MethodImplOptions.AggressiveInlining; + + [MethodImpl(ImplOptions)] + public static double[] GenericToDoubleArray(T[] values) + { + var values2 = new double[values.Length]; + + for (var i = 0; i < values.Length; i++) + { + values2[i] = GenericToDouble(values, i); + } + + return values2; + } + + [MethodImpl(ImplOptions)] + public static double[] GenericToDoubleArray(IEnumerable values) + { + return values.Select(value => GenericToDouble(ref value)).ToArray(); + } + + /// + /// Returns the double value of a + /// using a conversion technique optimized for the platform. + /// + [MethodImpl(ImplOptions)] + public static double GenericToDouble(ref T value) + { + return value switch + { + double vDouble => vDouble, + float vSingle => Convert.ToDouble(vSingle), + int vInt32 => Convert.ToDouble(vInt32), + uint vUint32 => Convert.ToDouble(vUint32), + long vInt64 => Convert.ToDouble(vInt64), + ulong vUint64 => Convert.ToDouble(vUint64), + short vInt16 => Convert.ToDouble(vInt16), + ushort vUint16 => Convert.ToDouble(vUint16), + decimal vDecimal => Convert.ToDouble(vDecimal), + byte vByte => Convert.ToDouble(vByte), + DateTime vDateTime => vDateTime.ToOADate(), + _ => Convert.ToDouble(value), + }; + } + + [MethodImpl(ImplOptions)] + public static Coordinates GenericToCoordinates(ref T1 x, ref T2 y) => new Coordinates(GenericToDouble(ref x), GenericToDouble(ref y)); + + /// + /// Returns the double value of the at position in + /// using a conversion technique optimized for the platform. + /// + [MethodImpl(ImplOptions)] + public static double GenericToDouble(IReadOnlyList list, int i) + { + var v = list[i]; + return GenericToDouble(ref v); + } + + /// + /// Returns the double value of the at position in + /// using a conversion technique optimized for the platform. + /// + [MethodImpl(ImplOptions)] + public static double GenericToDouble(T[] array, int i) + { + var v = array[i]; + return GenericToDouble(ref v); + } + + /// + /// Creates a for a given double + /// using a conversion technique optimized for the platform. + /// + [MethodImpl(ImplOptions)] + public static void DoubleToGeneric(double value, out T v) + { + if (typeof(T) == typeof(double)) + { + v = (T)(object)value; + } + else if (typeof(T) == typeof(float)) + { + v = (T)(object)Convert.ToSingle(value); + } + else if (typeof(T) == typeof(int)) + { + v = (T)(object)Convert.ToInt32(value); + } + else if (typeof(T) == typeof(uint)) + { + v = (T)(object)Convert.ToUInt32(value); + } + else if (typeof(T) == typeof(long)) + { + v = (T)(object)Convert.ToInt64(value); + } + else if (typeof(T) == typeof(ulong)) + { + v = (T)(object)Convert.ToUInt64(value); + } + else if (typeof(T) == typeof(short)) + { + v = (T)(object)Convert.ToInt16(value); + } + else if (typeof(T) == typeof(ushort)) + { + v = (T)(object)Convert.ToUInt16(value); + } + else if (typeof(T) == typeof(decimal)) + { + v = (T)(object)Convert.ToDecimal(value); + } + else if (typeof(T) == typeof(byte)) + { + v = (T)(object)Convert.ToByte(value); + } + else if (typeof(T) == typeof(DateTime)) + { + v = (T)(object)DateTime.FromOADate(value); + } + else + { + v = (T)Convert.ChangeType(value, typeof(T)); + } + } + + public static T[] DoubleToGeneric(this double[] input) + { + T[] result = new T[input.Length]; + for (var i = 0; i < input.Length; i++) + { + DoubleToGeneric(input[i], out result[i]); + } + return result; + } + + public static T[] ToGenericArray(this double[] input) + { + T[] result = new T[input.Length]; + for (var i = 0; i < input.Length; i++) + { + DoubleToGeneric(input[i], out result[i]); + } + return result; + } + + public static byte AddBytes(byte a, byte b) => (byte)(a + b); + public static byte Multiply(byte a, byte b) => (byte)(a * b); + public static byte SubtractBytes(byte a, byte b) => (byte)(a - b); + public static bool LessThanOrEqualBytes(byte a, byte b) => a <= b; + + public static Func CreateAddFunction() + { + var paramA = Expression.Parameter(typeof(T), "a"); + var paramB = Expression.Parameter(typeof(T), "b"); + + var body = Type.GetTypeCode(typeof(T)) switch + { + TypeCode.Byte => Expression.Add(paramA, paramB, typeof(NumericConversion).GetMethod(nameof(AddBytes))), + _ => Expression.Add(paramA, paramB), + }; + + return Expression.Lambda>(body, paramA, paramB).Compile(); + } + + public static Func CreateMultFunction() + { + var paramA = Expression.Parameter(typeof(T), "a"); + var paramB = Expression.Parameter(typeof(T), "b"); + + var body = Type.GetTypeCode(typeof(T)) switch + { + TypeCode.Byte => Expression.Multiply(paramA, paramB, typeof(NumericConversion).GetMethod(nameof(Multiply))), + _ => Expression.Multiply(paramA, paramB), + }; + + return Expression.Lambda>(body, paramA, paramB).Compile(); + + } + + public static Func CreateSubtractFunction() + { + var paramA = Expression.Parameter(typeof(T), "a"); + var paramB = Expression.Parameter(typeof(T), "b"); + + var body = Type.GetTypeCode(typeof(T)) switch + { + TypeCode.Byte => Expression.Subtract(paramA, paramB, typeof(NumericConversion).GetMethod(nameof(SubtractBytes))), + _ => Expression.Subtract(paramA, paramB), + }; + + return Expression.Lambda>(body, paramA, paramB).Compile(); + } + + public static Func CreateLessThanOrEqualFunction() + { + var paramA = Expression.Parameter(typeof(T), "a"); + var paramB = Expression.Parameter(typeof(T), "b"); + + var body = Type.GetTypeCode(typeof(T)) switch + { + TypeCode.Byte => Expression.LessThanOrEqual(paramA, paramB, false, typeof(NumericConversion).GetMethod(nameof(LessThanOrEqualBytes))), + _ => Expression.LessThanOrEqual(paramA, paramB), + }; + + return Expression.Lambda>(body, paramA, paramB).Compile(); + } + + public static T Clamp(T input, T min, T max) where T : IComparable + { + if (input.CompareTo(min) < 0) + { + return min; + } + + if (input.CompareTo(max) > 0) + { + return max; + } + + return input; + } + + public static bool AreReal(double x, double y) + { + // implemented here because older versions of .NET do not support double.IsReal() + return IsReal(x) && IsReal(y); + } + + public static bool IsReal(double x) + { + // implemented here because older versions of .NET do not support double.IsReal() + return !double.IsNaN(x) && !double.IsInfinity(x); + } + + public static bool IsReal(float x) + { + // implemented here because older versions of .NET do not support double.IsReal() + return !float.IsNaN(x) && !float.IsInfinity(x); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/Plot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/Plot.cs new file mode 100644 index 000000000..3b6e5b3d9 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/Plot.cs @@ -0,0 +1,438 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Plot : IDisposable + { + public List PlottableList { get; } = new(); + public PlottableAdder Add { get; } + public IPalette Palette { get => Add.Palette; set => Add.Palette = value; } + public RenderManager RenderManager { get; } + public RenderDetails LastRender => RenderManager.LastRender; + public LayoutManager Layout { get; private set; } + public Color FigureBackground { get; set; } = Colors.White; + public Color DataBackground { get; set; } = Colors.White; + public IZoomRectangle ZoomRectangle { get; set; } = new StandardZoomRectangle(); + public float ScaleFactor { get; set; } = 1.0f; + + public AxisManager Axes { get; } + + public PlotStyler Style { get; } + + public Legend Legend { get; set; } + + public IPlottable Benchmark { get; set; } = new Benchmark(); + + public Plot() + { + Axes = new(this); + Add = new(this); + Style = new(this); + RenderManager = new(this); + Legend = new(this); + Layout = new(this); + } + + public void Dispose() + { + PlottableList.Clear(); + Axes.Clear(); + } + + #region Mouse Interaction + + /// + /// Apply a click-drag pan operation to the plot + /// + public void MousePan(MultiAxisLimitManager originalLimits, Pixel mouseDown, Pixel mouseNow) + { + float pixelDeltaX = -(mouseNow.X - mouseDown.X); + float pixelDeltaY = mouseNow.Y - mouseDown.Y; + + var scaledDeltaX = pixelDeltaX / ScaleFactor; + var scaledDeltaY = pixelDeltaY / ScaleFactor; + + // restore mousedown limits + originalLimits.Apply(this); + + // pan in the direction opposite of the mouse movement + Axes.XAxes.ForEach(xAxis => xAxis.Range.PanMouse(scaledDeltaX, RenderManager.LastRender.DataRect.Width)); + Axes.YAxes.ForEach(yAxis => yAxis.Range.PanMouse(scaledDeltaY, RenderManager.LastRender.DataRect.Height)); + } + + /// + /// Apply a click-drag zoom operation to the plot + /// + public void MouseZoom(MultiAxisLimitManager originalLimits, Pixel mouseDown, Pixel mouseNow) + { + float pixelDeltaX = mouseNow.X - mouseDown.X; + float pixelDeltaY = -(mouseNow.Y - mouseDown.Y); + + // restore mousedown limits + originalLimits.Apply(this); + + // apply zoom for each axis + Axes.XAxes.ForEach(xAxis => xAxis.Range.ZoomMouseDelta(pixelDeltaX, RenderManager.LastRender.DataRect.Width)); + Axes.YAxes.ForEach(yAxis => yAxis.Range.ZoomMouseDelta(pixelDeltaY, RenderManager.LastRender.DataRect.Height)); + } + + /// + /// Zoom into the coordinate corresponding to the given pixel. + /// Fractional values >1 zoom in and <1 zoom out. + /// + public void MouseZoom(double fracX, double fracY, Pixel pixel) + { + Coordinates mouseCoordinate = GetCoordinates(pixel); + + MultiAxisLimitManager originalLimits = new(this); + + // restore mousedown limits + originalLimits.Apply(this); + + // apply zoom for each axis + Pixel scaledPixel = new(pixel.X / ScaleFactor, pixel.Y / ScaleFactor); + Axes.XAxes.ForEach(xAxis => xAxis.Range.ZoomFrac(fracX, xAxis.GetCoordinate(scaledPixel.X, RenderManager.LastRender.DataRect))); + Axes.YAxes.ForEach(yAxis => yAxis.Range.ZoomFrac(fracY, yAxis.GetCoordinate(scaledPixel.Y, RenderManager.LastRender.DataRect))); + } + + /// + /// Update the shape of the zoom rectangle + /// + /// Location of the mouse at the start of the drag + /// Location of the mouse now (after dragging) + /// If true, shade the full region between two X positions + /// If true, shade the full region between two Y positions + public void MouseZoomRectangle(Pixel mouseDown, Pixel mouseNow, bool vSpan, bool hSpan) + { + Pixel scaledMouseDown = new(mouseDown.X / ScaleFactor, mouseDown.Y / ScaleFactor); + Pixel scaledMouseNow = new(mouseNow.X / ScaleFactor, mouseNow.Y / ScaleFactor); + ZoomRectangle.Update(scaledMouseDown, scaledMouseNow); + ZoomRectangle.VerticalSpan = vSpan; + ZoomRectangle.HorizontalSpan = hSpan; + } + + /// + /// Return the pixel for a specific coordinate using measurements from the most recent render. + /// + public Pixel GetPixel(Coordinates coordinates) + { + Coordinates scaledCoordinates = new(coordinates.X * ScaleFactor, coordinates.Y * ScaleFactor); + PixelRect dataRect = RenderManager.LastRender.DataRect; + float x = Axes.Bottom.GetPixel(scaledCoordinates.X, dataRect); + float y = Axes.Left.GetPixel(scaledCoordinates.Y, dataRect); + return new Pixel(x, y); + } + + /// + /// Return the coordinate for a specific pixel using measurements from the most recent render. + /// + public Coordinates GetCoordinates(Pixel pixel, IXAxis? xAxis = null, IYAxis? yAxis = null) + { + Pixel scaledPx = new(pixel.X / ScaleFactor, pixel.Y / ScaleFactor); + PixelRect dataRect = RenderManager.LastRender.DataRect; + double x = (xAxis ?? Axes.Bottom).GetCoordinate(scaledPx.X, dataRect); + double y = (yAxis ?? Axes.Left).GetCoordinate(scaledPx.Y, dataRect); + return new Coordinates(x, y); + } + + /// + /// Return the coordinate for a specific pixel using measurements from the most recent render. + /// + public Coordinates GetCoordinates(float x, float y, IXAxis? xAxis = null, IYAxis? yAxis = null) + { + Pixel px = new(x, y); + return GetCoordinates(px, xAxis, yAxis); + } + + /// + /// Return a coordinate rectangle centered at a pixel + /// + public CoordinateRect GetCoordinateRect(float x, float y, float radius = 10) + { + PixelRect dataRect = RenderManager.LastRender.DataRect; + double left = Axes.Bottom.GetCoordinate(x - radius, dataRect); + double right = Axes.Bottom.GetCoordinate(x + radius, dataRect); + double top = Axes.Left.GetCoordinate(y - radius, dataRect); + double bottom = Axes.Left.GetCoordinate(y + radius, dataRect); + return new CoordinateRect(left, right, bottom, top); + } + + /// + /// Return a coordinate rectangle centered at a pixel + /// + public CoordinateRect GetCoordinateRect(Pixel pixel, float radius = 10) + { + return GetCoordinateRect(pixel.X, pixel.Y, radius); + } + + /// + /// Return a coordinate rectangle centered at a pixel + /// + public CoordinateRect GetCoordinateRect(Coordinates coordinates, float radius = 10) + { + PixelRect dataRect = RenderManager.LastRender.DataRect; + double radiusX = Axes.Bottom.GetCoordinateDistance(radius, dataRect); + double radiusY = Axes.Left.GetCoordinateDistance(radius, dataRect); + return coordinates.ToRect(radiusX, radiusY); + } + + #endregion + + #region Rendering and Image Creation + + /// + /// Force the plot to render once by calling but don't return what was rendered. + /// + public void Render(int width = 400, int height = 300) + { + if (width < 1) + { + throw new ArgumentException($"{nameof(width)} must be greater than 0"); + } + + if (height < 1) + { + throw new ArgumentException($"{nameof(height)} must be greater than 0"); + } + + GetImage(width, height); + } + + /// + /// Render onto an existing canvas + /// + public void Render(SKCanvas canvas, int width, int height) + { + // TODO: obsolete this + PixelRect rect = new(0, width, height, 0); + RenderManager.Render(canvas, rect); + } + + /// + /// Render onto an existing canvas inside the given rectangle + /// + public void Render(SKCanvas canvas, PixelRect rect) + { + RenderManager.Render(canvas, rect); + } + + public Image GetImage(int width, int height) + { + if (width < 1) + { + throw new ArgumentException($"{nameof(width)} must be greater than 0"); + } + + if (height < 1) + { + throw new ArgumentException($"{nameof(height)} must be greater than 0"); + } + + SKImageInfo info = new(width, height, SKColorType.Rgba8888, SKAlphaType.Premul); + using var surface = SKSurface.Create(info); + if (surface is null) + { + throw new NullReferenceException($"invalid SKImageInfo"); + } + + Render(surface.Canvas, width, height); + return new(surface.Snapshot()); + } + + /// + /// Render the plot and return an HTML img element containing a Base64-encoded PNG + /// + public string GetImageHtml(int width, int height) + { + var img = GetImage(width, height); + byte[] bytes = img.GetImageBytes(); + return ImageOperations.GetImageHtml(bytes); + } + + public void SaveJpeg(string filePath, int width, int height, int quality = 85) + { + using var image = GetImage(width, height); + image.SaveJpeg(filePath, quality); + } + + public void SavePng(string filePath, int width, int height) + { + using var image = GetImage(width, height); + image.SavePng(filePath); + } + + public void SaveBmp(string filePath, int width, int height) + { + using var image = GetImage(width, height); + image.SaveBmp(filePath); + } + + public void SaveWebp(string filePath, int width, int height, int quality = 85) + { + using var image = GetImage(width, height); + image.SaveWebp(filePath, quality); + } + + public void SaveSvg(string filePath, int width, int height) + { + using FileStream fs = new(filePath, FileMode.Create); + using var canvas = SKSvgCanvas.Create(new SKRect(0, 0, width, height), fs); + Render(canvas, width, height); + } + + public void Save(string filePath, int width, int height, ImageFormat format = ImageFormat.Png, int quality = 85) + { + if (format == ImageFormat.Svg) + { + SaveSvg(filePath, width, height); + return; + } + + if (format.IsRasterFormat()) + { + using var image = GetImage(width, height); + image.Save(filePath, format, quality); + return; + } + + throw new NotImplementedException(format.ToString()); + } + + public byte[] GetImageBytes(int width, int height, ImageFormat format = ImageFormat.Bmp) + { + using var image = GetImage(width, height); + byte[] bytes = image.GetImageBytes(format); + return bytes; + } + + /// + /// Returns the content of the legend as a raster image + /// + public Image GetLegendImage() => Legend.GetImage(this); + + /// + /// Returns the content of the legend as SVG (vector) image + /// + public string GetLegendSvgXml() => Legend.GetSvgXml(this); + + #endregion + + #region Helper Methods + + /// + /// Remove a specific object from the plot. + /// This removes the given object from . + /// + public void Remove(IPlottable plottable) + { + PlottableList.Remove(plottable); + } + + /// + /// Disable visibility for all grids + /// + public void HideGrid() + { + Axes.Grids.ForEach(x => x.IsVisible = false); + } + + /// + /// Enable visibility for all grids + /// + public void ShowGrid() + { + Axes.Grids.ForEach(x => x.IsVisible = true); + } + + /// + /// Helper method for setting visibility of the + /// + public void ShowLegend(Alignment location = Alignment.LowerRight) + { + Legend.IsVisible = true; + Legend.Location = location; + } + + /// + /// Helper method for setting visibility of the + /// + public void HideLegend() + { + Legend.IsVisible = false; + } + + /// + /// Clears the list + /// + public void Clear() => PlottableList.Clear(); + + /// + /// Shortcut to set text of the Label. + /// Assign properties of Label to customize size, color, font, etc. + /// + public void Title(string text, float? size = null) + { + Axes.Title.Label.Text = text; + Axes.Title.IsVisible = !string.IsNullOrWhiteSpace(text); + if (size.HasValue) + { + Axes.Title.Label.FontSize = size.Value; + } + } + + /// + /// Shortcut to set text of the Label + /// Assign properties of Label to customize size, color, font, etc. + /// + public void XLabel(string label, float? size = null) + { + Axes.Bottom.Label.Text = label; + if (size.HasValue) + { + Axes.Bottom.Label.FontSize = size.Value; + } + } + + /// + /// Shortcut to set text of the Label + /// Assign properties of Label to customize size, color, font, etc. + /// + public void YLabel(string label, float? size = null) + { + Axes.Left.Label.Text = label; + if (size.HasValue) + { + Axes.Left.Label.FontSize = size.Value; + } + } + + /// + /// Return the first default grid in use. + /// Throws an exception if no default grids exist. + /// + public DefaultGrid GetDefaultGrid() + { + IEnumerable defaultGrids = Axes.Grids.OfType(); + if (defaultGrids.Any()) + { + return defaultGrids.First(); + } + else + { + throw new InvalidOperationException("The plot has no default grids"); + } + } + + #endregion + + #region Developer Tools + + public void Developer_ShowAxisDetails(bool enable = true) + { + foreach (IPanel panel in Axes.GetAxes()) + { + panel.ShowDebugInformation = enable; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/PlottableAdder.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/PlottableAdder.cs new file mode 100644 index 000000000..b2a9ab63a --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/PlottableAdder.cs @@ -0,0 +1,536 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Helper methods to create plottable objects and add them to the plot + /// + public class PlottableAdder + { + private readonly Plot _plot; + + public PlottableAdder(Plot plot) + { + _plot = plot; + } + + public IPalette Palette { get; set; } = new Category10(); + + public Color GetNextColor() + { + return Palette.Colors[_plot.PlottableList.Count % Palette.Colors.Length]; + } + + public BarPlot Bar(Bar bar) + { + BarPlot bp = new(bar); + Plottable(bp); + return bp; + } + + public BarPlot Bar(double position, double value, double error = 0) + { + Bar bar = new() + { + Position = position, + Value = value, + Error = error, + FillColor = GetNextColor(), + }; + return Bar(bar); + } + + public BarPlot Bars(IEnumerable bars) + { + BarPlot bp = new(bars); + + // only set bar colors if the user has not already configured them + var barColorsAreAllTheSame = bars.Select(x => x.FillColor).Distinct().Count() == 1; + if (barColorsAreAllTheSame) + { + bp.Color = GetNextColor(); + } + + Plottable(bp); + return bp; + } + + public BarPlot Bars(double[] values) + { + var positions = Enumerable.Range(0, values.Length).Select(x => (double)x); + return Bars(positions, values); + } + + public BarPlot Bars(IEnumerable positions, IEnumerable values) + { + if (positions.Count() != values.Count()) + { + throw new ArgumentException($"{nameof(positions)} and {nameof(positions)} have different lengths"); + } + + var color = GetNextColor(); + + List bars = new(); + foreach (var item in positions.Zip(values, (a, b) => new { a, b })) + { + bars.Add(new Bar() + { + Position = item.a, + Value = item.b, + FillColor = color + }); + } + + return Bars(bars); + } + + public BoxPlot Box(Box box) + { + BoxPlot bp = new(); + bp.Boxes.Add(box); + bp.FillColor = GetNextColor(); + _plot.PlottableList.Add(bp); + return bp; + } + + public BoxPlot Boxes(IEnumerable boxes) + { + BoxPlot bp = new(); + bp.Boxes.AddRange(boxes); + bp.FillColor = GetNextColor(); + _plot.PlottableList.Add(bp); + return bp; + } + + public CandlestickPlot Candlestick(List ohlcs) + { + OhlcSource dataSource = new(ohlcs); + CandlestickPlot candlestickPlot = new(dataSource); + _plot.PlottableList.Add(candlestickPlot); + return candlestickPlot; + } + + public Crosshair Crosshair(double x, double y) + { + Crosshair ch = new() + { + Position = new(x, y) + }; + ch.LineStyle.Color = GetNextColor(); + _plot.PlottableList.Add(ch); + return ch; + } + + public ColorBar ColorBar(IHasColorAxis source, Edge edge = Edge.Right) + { + ColorBar colorBar = new(source, edge); + + _plot.Axes.Panels.Add(colorBar); + return colorBar; + } + + public DataLogger DataLogger() + { + DataLogger logger = new() + { + Color = GetNextColor(), + }; + + _plot.PlottableList.Add(logger); + + return logger; + } + + public DataStreamer DataStreamer(int points, double period = 1) + { + var data = new double[points]; + + DataStreamer streamer = new(_plot, data) + { + Color = GetNextColor(), + Period = period, + }; + + _plot.PlottableList.Add(streamer); + + return streamer; + } + + public ErrorBar ErrorBar(IReadOnlyList xs, IReadOnlyList ys, IReadOnlyList yErrors) + { + ErrorBar eb = new(xs, ys, null, null, yErrors, yErrors) + { + Color = GetNextColor(), + }; + + _plot.PlottableList.Add(eb); + return eb; + } + + /// + /// Fill the vertical range between two Y points for each X point + /// + public FillY FillY(double[] xs, double[] ys1, double[] ys2) + { + List<(double, double, double)> data = new(); + + for (var i = 0; i < xs.Length; i++) + { + data.Add((xs[i], ys1[i], ys2[i])); + } + + return FillY(data); + } + + /// + /// Fill the vertical range between two Y points for each X point + /// + public FillY FillY(Scatter scatter1, Scatter scatter2) + { + FillY rangePlot = new(scatter1, scatter2); + rangePlot.FillStyle.Color = GetNextColor(); + _plot.PlottableList.Add(rangePlot); + return rangePlot; + } + + /// + /// Fill the vertical range between two Y points for each X point + /// + public FillY FillY(ICollection<(double X, double Top, double Bottom)> data) + { + FillY rangePlot = new(); + rangePlot.FillStyle.Color = GetNextColor(); + rangePlot.SetDataSource(data); + _plot.PlottableList.Add(rangePlot); + return rangePlot; + } + + /// + /// Fill the vertical range between two Y points for each X point + /// This overload uses a custom function to calculate X, Y1, and Y2 values + /// + public FillY FillY(ICollection data, Func function) + { + var rangePlot = new FillY(); + rangePlot.FillStyle.Color = GetNextColor(); + rangePlot.SetDataSource(data, function); + _plot.PlottableList.Add(rangePlot); + return rangePlot; + } + + public FunctionPlot Function(IFunctionSource functionSource) + { + FunctionPlot functionPlot = new(functionSource); + functionPlot.LineStyle.Color = GetNextColor(); + + _plot.PlottableList.Add(functionPlot); + return functionPlot; + } + + public FunctionPlot Function(Func func) + { + var functionSource = new FunctionSource(func); + return Function(functionSource); + } + + public Heatmap Heatmap(double[,] intensities) + { + Heatmap heatmap = new(intensities); + _plot.PlottableList.Add(heatmap); + return heatmap; + } + + public HorizontalLine HorizontalLine(double y, float width = 2, Color? color = null, LinePattern pattern = LinePattern.Solid) + { + HorizontalLine line = new(); + line.LineStyle.Width = width; + line.LineStyle.Color = color ?? GetNextColor(); + line.LineStyle.Pattern = pattern; + line.Y = y; + _plot.PlottableList.Add(line); + return line; + } + + public LinePlot Line(Coordinates start, Coordinates end) + { + LinePlot lp = new() + { + Start = start, + End = end, + }; + + lp.LineStyle.Color = GetNextColor(); + lp.MarkerStyle.Fill.Color = lp.LineStyle.Color; + + _plot.PlottableList.Add(lp); + + return lp; + } + + public LinePlot Line(CoordinateLine line) + { + return Line(line.Start, line.End); + } + + public LinePlot Line(double x1, double y1, double x2, double y2) + { + Coordinates start = new(x1, y1); + Coordinates end = new(x2, y2); + return Line(start, end); + } + + public Marker Marker(double x, double y, MarkerShape shape = MarkerShape.FilledCircle, float size = 10, Color? color = null) + { + Marker mp = new() + { + MarkerStyle = new MarkerStyle(shape, size, color ?? GetNextColor()), + Location = new Coordinates(x, y), + }; + + _plot.PlottableList.Add(mp); + + return mp; + } + + public Marker Marker(Coordinates location, MarkerShape shape = MarkerShape.FilledCircle, float size = 10, Color? color = null) + { + return Marker(location.X, location.Y, shape, size, color); + } + + public OhlcPlot Ohlc(List ohlcs) + { + OhlcSource dataSource = new(ohlcs); + OhlcPlot ohlc = new(dataSource); + _plot.PlottableList.Add(ohlc); + return ohlc; + } + + public Pie Pie(IList slices) + { + Pie pie = new(slices); + _plot.PlottableList.Add(pie); + return pie; + } + + public Pie Pie(IEnumerable values) + { + var slices = values.Select(v => new PieSlice + { + Value = v, + Fill = new() { Color = GetNextColor() }, + }).ToList(); + var pie = Pie(slices); + _plot.PlottableList.Add(pie); + return pie; + } + + public Polygon Polygon(Coordinates[] coordinates) + { + Polygon poly = new(coordinates); + _plot.PlottableList.Add(poly); + return poly; + } + + public IPlottable Plottable(IPlottable plottable) + { + _plot.PlottableList.Add(plottable); + return plottable; + } + + public Polygon Rectangle(double left, double right, double bottom, double top) + { + Coordinates[] points = { + new(left, bottom), + new(left, top), + new(right, top), + new(right, bottom), + }; + return Polygon(points); + } + + public Scatter Scatter(IScatterSource source, Color? color = null) + { + var nextColor = color ?? GetNextColor(); + Scatter scatter = new(source); + scatter.LineStyle.Color = nextColor; + scatter.MarkerStyle.Fill.Color = nextColor; + _plot.PlottableList.Add(scatter); + return scatter; + } + + public Scatter Scatter(double x, double y, Color? color = null) + { + double[] xs = { x }; + double[] ys = { y }; + ScatterSourceDoubleArray source = new(xs, ys); + return Scatter(source, color); + } + + public Scatter Scatter(double[] xs, double[] ys, Color? color = null) + { + ScatterSourceDoubleArray source = new(xs, ys); + return Scatter(source, color); + } + + public Scatter Scatter(Coordinates point, Color? color = null) + { + Coordinates[] coordinates = { point }; + ScatterSourceCoordinatesArray source = new(coordinates); + return Scatter(source, color); + } + + public Scatter Scatter(Coordinates[] coordinates, Color? color = null) + { + ScatterSourceCoordinatesArray source = new(coordinates); + return Scatter(source, color); + } + + public Scatter Scatter(List coordinates, Color? color = null) + { + ScatterSourceCoordinatesList source = new(coordinates); + return Scatter(source, color); + } + + public Scatter Scatter(T1[] xs, T2[] ys, Color? color = null) + { + var nextColor = color ?? GetNextColor(); + ScatterSourceGenericArray source = new(xs, ys); + Scatter scatter = new(source); + scatter.LineStyle.Color = nextColor; + scatter.MarkerStyle.Fill.Color = nextColor; + _plot.PlottableList.Add(scatter); + return scatter; + } + + public Scatter Scatter(List xs, List ys, Color? color = null) + { + var nextColor = color ?? GetNextColor(); + ScatterSourceGenericList source = new(xs, ys); + Scatter scatter = new(source); + scatter.LineStyle.Color = nextColor; + scatter.MarkerStyle.Fill.Color = nextColor; + _plot.PlottableList.Add(scatter); + return scatter; + } + + public Signal Signal(ISignalSource source, Color? color = null) + { + Signal sig = new(source) + { + Color = color ?? GetNextColor() + }; + + _plot.PlottableList.Add(sig); + + return sig; + } + + public Signal Signal(double[] ys, double period = 1, Color? color = null) + { + SignalSourceDouble source = new(ys, period); + + Signal sig = new(source) + { + Color = color ?? GetNextColor() + }; + + _plot.PlottableList.Add(sig); + + return sig; + } + + public Signal Signal(T[] ys, double period = 1, Color? color = null) + { + SignalSourceGenericArray source = new(ys, period); + + Signal sig = new(source) + { + Color = color ?? GetNextColor() + }; + + _plot.PlottableList.Add(sig); + + return sig; + } + + public Signal Signal(List ys, double period = 1, Color? color = null) + { + SignalSourceGenericList source = new(ys, period); + + Signal sig = new(source) + { + Color = color ?? GetNextColor() + }; + + _plot.PlottableList.Add(sig); + + return sig; + } + + public SignalConst SignalConst(T[] ys, double period = 1, Color? color = null) + where T : struct, IComparable + { + SignalConst sig = new(ys, period) + { + Color = color ?? GetNextColor() + }; + + _plot.PlottableList.Add(sig); + + return sig; + } + + public SignalXy SignalXy(double[] xs, double[] ys, Color? color = null) + { + SignalXySourceDoubleArray dataSource = new(xs, ys); + + SignalXy sig = new(dataSource) + { + Color = color ?? GetNextColor() + }; + + _plot.PlottableList.Add(sig); + + return sig; + } + + public SignalXy SignalXy(TX[] xs, TY[] ys, Color? color = null) + { + var dataSource = new SignalXySourceGenericArray(xs, ys); + + SignalXy sig = new(dataSource) + { + Color = color ?? GetNextColor() + }; + + _plot.PlottableList.Add(sig); + + return sig; + } + + public Text Text(string text, Coordinates location) + { + return Text(text, location.X, location.Y); + } + + public Text Text(string text, double x, double y) + { + Text txt = new(); + txt.Label.Text = text; + txt.Label.BackColor = Colors.Transparent; + txt.Label.BorderColor = Colors.Transparent; + txt.Location = new(x, y); + _plot.PlottableList.Add(txt); + return txt; + } + + public VerticalLine VerticalLine(double x, float width = 2, Color? color = null, LinePattern pattern = LinePattern.Solid) + { + VerticalLine line = new(); + line.LineStyle.Width = width; + line.LineStyle.Color = color ?? GetNextColor(); + line.LineStyle.Pattern = pattern; + line.X = x; + _plot.PlottableList.Add(line); + return line; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/RandomDataGenerator.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/RandomDataGenerator.cs new file mode 100644 index 000000000..aeccfaaea --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/RandomDataGenerator.cs @@ -0,0 +1,206 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class RandomDataGenerator + { + /// + /// Global random number generator, to ensure each generator will returns different data. + /// Using ThreadLocal, because Random is not thread safe. + /// + private static readonly ThreadLocal _globalRandomThread = new(() => new Random(GetCryptoRandomInt())); + + /// + /// To select right random number generator + /// + private readonly Random _rand; + + /// + /// Create a random number generator. + /// The seed is random by deafult, but could be fixed to the defined value + /// + public RandomDataGenerator(int? seed = null) + { + _rand = seed.HasValue + ? new Random(seed.Value) + : _globalRandomThread.Value!; + } + + public static RandomDataGenerator Generate { get; private set; } = new(0); + + private static int GetCryptoRandomInt() + { + var rng = RandomNumberGenerator.Create(); + var data = new byte[sizeof(int)]; + rng.GetBytes(data); + return BitConverter.ToInt32(data, 0) & (int.MaxValue - 1); + } + + #region Methods that return single numbers + + /// + /// Return a uniformly random number between 0 (inclusive) and 1 (exclusive) + /// + public double RandomNumber() + { + return _rand.NextDouble(); + } + + /// + /// Return a uniformly random number between 0 (inclusive) and (exclusive) + /// + public double RandomNumber(double max) + { + return _rand.NextDouble() * max; + } + + /// + /// Return a uniformly random number between (inclusive) and (exclusive) + /// + public double RandomNumber(double min, double max) + { + return _rand.NextDouble() * (max - min) + min; + } + + /// + /// Return a random number guaranteed not to be zero + /// + public double RandomNonZeroNumber(double max = 1) + { + var randomValue = RandomNumber(max); + return randomValue != 0 + ? randomValue + : RandomNonZeroNumber(); + } + + /// + /// Return a random integer up to the maximum integer size + /// + public int RandomInteger() + { + return _rand.Next(); + } + + /// + /// Return a random byte (0-255) + /// + public byte RandomByte() + { + return (byte)_rand.Next(256); + } + + /// + /// Return a random integer between zero (inclusive) and (exclusive) + /// + public int RandomInteger(int max) + { + return _rand.Next(max); + } + + /// + /// Return a random integer between (inclusive) and (exclusive) + /// + public int RandomInteger(int min, int max) + { + return _rand.Next(min, max); + } + + /// + /// Return a number normally distributed around the given + /// according to the standard deviation. + /// + public double RandomNormalNumber(double mean = 0, double stdDev = 1) + { + var u1 = RandomNonZeroNumber(); + var u2 = RandomNumber(); + var randStdNormal = Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.PI * u2); + return mean + stdDev * randStdNormal; + } + + #endregion + + /// + /// Uniformly distributed random numbers between 0 and 1 + /// (multiplied by then added to ). + /// + public double[] RandomSample(int count, double mult = 1, double offset = 0) + { + var values = new double[count]; + for (var i = 0; i < count; i++) + { + values[i] = _rand.NextDouble() * mult + offset; + } + + return values; + } + + /// + /// Return a collection of numbers normally distributed around the given + /// according to the standard deviation. + /// + public double[] RandomNormalSample(int count, double mean = 0, double stdDev = 1) + { + var values = new double[count]; + for (var i = 0; i <= count; i++) + { + values[i] = RandomNormalNumber(mean, stdDev); + } + return values; + } + + /// + /// Sine wave with random frequency, amplitude, and phase + /// + public double[] RandomSin(int count) + { + var mult = Math.Pow(2, 1 + _rand.NextDouble() * 10); + var offset = mult * (_rand.NextDouble() - .5); + var oscillations = 1 + _rand.NextDouble() * 5; + var phase = _rand.NextDouble() * Math.PI * 2; + return ScottPlot.Generate.Sin(count, mult, offset, oscillations, phase); + } + + /// + /// A sequence of numbers that starts at + /// and "walks" randomly from one point to the next, scaled by + /// with an approximate slope of . + /// + public double[] RandomWalk(int count, double mult = 1, double offset = 0, double slope = 0) + { + var data = new double[count]; + data[0] = offset; + for (var i = 1; i < data.Length; i++) + { + // RandomSample number between -1 and 1; + var randomStep = _rand.NextDouble() * 2 - 1; + // Using linear equation y_2 = m * x + y_1 where x = 1, + // then adding a scaled random step simplifies to: + data[i] = slope + data[i - 1] + randomStep * mult; + } + return data; + } + + /// + /// Return a collection OHLCs representing random price action + /// + public List RandomOhlCs(int count) + { + var dates = ScottPlot.Generate.DateTime.Weekdays(count); + var span = TimeSpan.FromDays(1); + + double mult = 1; + + List ohlcs = new(); + var open = RandomNumber(150, 250); + for (var i = 0; i < count; i++) + { + var close = open + RandomNumber(-mult, mult); + var high = Math.Max(open, close) + RandomNumber(0, mult); + var low = Math.Min(open, close) - RandomNumber(0, mult); + Ohlc ohlc = new(open, high, low, close, dates[i], span); + ohlcs.Add(ohlc); + open = close + RandomNumber(-mult / 2, mult / 2); + } + + return ohlcs; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/RenderPack.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/RenderPack.cs new file mode 100644 index 000000000..9bcd9cc22 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/RenderPack.cs @@ -0,0 +1,54 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class RenderPack + { + public SKCanvas Canvas { get; } + public PixelRect FigureRect { get; } + public PixelRect DataRect { get; private set; } + public Layout Layout { get; private set; } + public Plot Plot { get; } + private Stopwatch Stopwatch { get; } + public TimeSpan Elapsed => Stopwatch.Elapsed; + + /// + /// This object is passed through the render system. + /// The plot will be drawn on the canvas to create a figure of the given size. + /// + public RenderPack(Plot plot, PixelRect figureRect, SKCanvas canvas) + { + Canvas = canvas; + FigureRect = figureRect; + Plot = plot; + Stopwatch = Stopwatch.StartNew(); + } + + public void CalculateLayout() + { + if (DataRect.HasArea) + { + throw new InvalidOperationException("DataRect must only be calculated once per render"); + } + + PixelRect scaledRect = new( + left: FigureRect.Left / Plot.ScaleFactor, + right: FigureRect.Right / Plot.ScaleFactor, + bottom: FigureRect.Bottom / Plot.ScaleFactor, + top: FigureRect.Top / Plot.ScaleFactor); + + Layout = Plot.Layout.LayoutEngine.GetLayout(scaledRect, Plot.Axes.GetPanels()); + DataRect = Layout.DataRect; + } + + public override string ToString() => $"RenderPack FigureRect={FigureRect} DataRect={DataRect}"; + + public void ClipToDataArea() + { + Canvas.ClipRect(DataRect.ToSkRect()); + } + + public void DisableClipping() + { + Canvas.Restore(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/RequiredMemberAttribute.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/RequiredMemberAttribute.cs new file mode 100644 index 000000000..b9fcb991a --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/RequiredMemberAttribute.cs @@ -0,0 +1,10 @@ +namespace System.Runtime.CompilerServices +{ + /// + /// Allows required members in older .NET versions + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class RequiredMemberAttribute : Attribute + { + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/Version.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/Version.cs new file mode 100644 index 000000000..5a5611997 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/General/Version.cs @@ -0,0 +1,61 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public static class Version + { + public static int Major => int.Parse(VersionString.Split('-')[0].Split('.')[0]); + public static int Minor => int.Parse(VersionString.Split('-')[0].Split('.')[1]); + public static int Build => int.Parse(VersionString.Split('-')[0].Split('.')[2]); + + /// + /// Version formatted like "5.0.0-beta" + /// + public static string VersionString { get; private set; } = GetVersionString(); + + /// + /// Version formatted like "ScottPlot 5.0.0-beta" + /// + public static string LongString { get; private set; } = "ScottPlot " + GetVersionString(); + + private static string GetVersionString() + { + var v = Assembly.GetAssembly(typeof(Plot))! + .GetCustomAttribute()! + .InformationalVersion; + + return v.Contains("+") ? v.Split('+')[0] : v; + } + + /// + /// Throws an exception if this version of ScottPlot does not match the expected major version + /// + public static void ShouldBe(int major) + { + if (major != Major) + { + throw new InvalidOperationException($"ScottPlot was expected to be {major}.x.x but is actually {VersionString}"); + } + } + + /// + /// Throws an exception if this version of ScottPlot does not match the expected major and minor versions + /// + public static void ShouldBe(int major, int minor) + { + if (major != Major || minor != Minor) + { + throw new InvalidOperationException($"ScottPlot was expected to be {major}.{minor}.x but is actually {VersionString}"); + } + } + + /// + /// Throws an exception if this version of ScottPlot does not match the exact one given + /// + public static void ShouldBe(int major, int minor, int build) + { + if (major != Major || minor != Minor || build != Build) + { + throw new InvalidOperationException($"ScottPlot was expected to be {major}.{minor}.{build} but is actually {VersionString}"); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Grids/DefaultGrid.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Grids/DefaultGrid.cs new file mode 100644 index 000000000..1685c88a3 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Grids/DefaultGrid.cs @@ -0,0 +1,68 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class DefaultGrid(IXAxis xAxis, IYAxis yAxis) : IGrid + { + public bool IsVisible { get; set; } = true; + public LineStyle MajorLineStyle = new() { Width = 1, Color = Colors.Black.WithOpacity(.1) }; + public LineStyle MinorLineStyle = new() { Width = 0, Color = Colors.Black.WithOpacity(.05) }; + + public int MaximumNumberOfGridLines = 1000; + + public bool IsBeneathPlotables { get; set; } = true; + + public IXAxis XAxis { get; private set; } = xAxis; + public IYAxis YAxis { get; private set; } = yAxis; + + public void Replace(IXAxis xAxis) + { + XAxis = xAxis; + } + + public void Replace(IYAxis yAxis) + { + YAxis = yAxis; + } + + public void Render(RenderPack rp) + { + if (!IsVisible) + { + return; + } + + var xTicks = XAxis.TickGenerator.Ticks.Where(x => x.Position >= XAxis.Min && x.Position <= XAxis.Max); + var yTicks = YAxis.TickGenerator.Ticks.Where(x => x.Position >= YAxis.Min && x.Position <= YAxis.Max); + + if (MinorLineStyle.Width > 0) + { + float[] xTicksMinor = xTicks.Where(x => !x.IsMajor).Select(x => XAxis.GetPixel(x.Position, rp.DataRect)).ToArray(); + float[] yTicksMinor = yTicks.Where(x => !x.IsMajor).Select(x => YAxis.GetPixel(x.Position, rp.DataRect)).ToArray(); + RenderGridLines(rp, xTicksMinor, XAxis.Edge, MinorLineStyle); + RenderGridLines(rp, yTicksMinor, YAxis.Edge, MinorLineStyle); + } + + if (MajorLineStyle.Width > 0) + { + float[] xTicksMajor = xTicks.Where(x => x.IsMajor).Select(x => XAxis.GetPixel(x.Position, rp.DataRect)).ToArray(); + float[] yTicksMajor = yTicks.Where(x => x.IsMajor).Select(x => YAxis.GetPixel(x.Position, rp.DataRect)).ToArray(); + RenderGridLines(rp, xTicksMajor, XAxis.Edge, MajorLineStyle); + RenderGridLines(rp, yTicksMajor, YAxis.Edge, MajorLineStyle); + } + } + + private void RenderGridLines(RenderPack rp, float[] positions, Edge edge, LineStyle lineStyle) + { + Pixel[] starts = new Pixel[positions.Length]; + Pixel[] ends = new Pixel[positions.Length]; + + for (int i = 0; i < positions.Length; i++) + { + float px = positions[i]; + starts[i] = edge.IsHorizontal() ? new Pixel(px, rp.DataRect.Bottom) : new Pixel(rp.DataRect.Left, px); + ends[i] = edge.IsHorizontal() ? new Pixel(px, rp.DataRect.Top) : new Pixel(rp.DataRect.Right, px); + } + + Drawing.DrawLines(rp.Canvas, starts, ends, lineStyle.Color, lineStyle.Width, antiAlias: true, lineStyle.Pattern); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Hatches/Checker.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Hatches/Checker.cs new file mode 100644 index 000000000..79ef6d053 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Hatches/Checker.cs @@ -0,0 +1,37 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Checker : IHatch + { + static Checker() + { + _bmp = CreateBitmap(); + } + private static readonly SKBitmap _bmp; + private static SKBitmap CreateBitmap() + { + var bmp = new SKBitmap(20, 20); + using var paint = new SKPaint() + { + Color = Colors.White.ToSkColor() + }; + using var path = new SKPath(); + using var canvas = new SKCanvas(bmp); + + canvas.Clear(Colors.Black.ToSkColor()); + canvas.DrawRect(new SKRect(0, 0, 10, 10), paint); + canvas.DrawRect(new SKRect(10, 10, 20, 20), paint); + + return bmp; + } + + public SKShader GetShader(Color backgroundColor, Color hatchColor) + { + return SKShader.CreateBitmap( + _bmp, + SKShaderTileMode.Repeat, + SKShaderTileMode.Repeat, + SKMatrix.CreateScale(0.5f, 0.5f)) + .WithColorFilter(Drawing.GetMaskColorFilter(hatchColor, backgroundColor)); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Hatches/Dots.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Hatches/Dots.cs new file mode 100644 index 000000000..db4933b78 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Hatches/Dots.cs @@ -0,0 +1,38 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Dots : IHatch + { + static Dots() + { + _bmp = CreateBitmap(); + } + private static readonly SKBitmap _bmp; + private static SKBitmap CreateBitmap() + { + var bmp = new SKBitmap(20, 20); + using var paint = new SKPaint() + { + Color = Colors.White.ToSkColor() + }; + using var path = new SKPath(); + using var canvas = new SKCanvas(bmp); + + paint.IsAntialias = true; // AA is especially important for circles, it seems to do little for the other shapes + + canvas.Clear(Colors.Black.ToSkColor()); + canvas.DrawCircle(5, 5, 5, paint); + + return bmp; + } + + public SKShader GetShader(Color backgroundColor, Color hatchColor) + { + return SKShader.CreateBitmap( + _bmp, + SKShaderTileMode.Repeat, + SKShaderTileMode.Repeat, + SKMatrix.CreateScale(0.5f, 0.5f)) + .WithColorFilter(Drawing.GetMaskColorFilter(hatchColor, backgroundColor)); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Hatches/Grid.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Hatches/Grid.cs new file mode 100644 index 000000000..a2ab27a86 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Hatches/Grid.cs @@ -0,0 +1,48 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Grid : IHatch + { + public bool Rotate { get; set; } + + static Grid() + { + _bmp = CreateBitmap(); + } + public Grid(bool rotate = false) + { + Rotate = rotate; + } + + private static readonly SKBitmap _bmp; + private static SKBitmap CreateBitmap() + { + var bmp = new SKBitmap(20, 20); + using var paint = new SKPaint() + { + Color = Colors.White.ToSkColor(), + IsStroke = true, + StrokeWidth = 3 + }; + using var path = new SKPath(); + using var canvas = new SKCanvas(bmp); + + canvas.Clear(Colors.Black.ToSkColor()); + canvas.DrawRect(0, 0, 20, 20, paint); + + return bmp; + } + + public SKShader GetShader(Color backgroundColor, Color hatchColor) + { + var rotationMatrix = Rotate ? SKMatrix.CreateRotationDegrees(45) : SKMatrix.Identity; + + return SKShader.CreateBitmap( + _bmp, + SKShaderTileMode.Repeat, + SKShaderTileMode.Repeat, + SKMatrix.CreateScale(0.5f, 0.5f) + .PostConcat(rotationMatrix)) + .WithColorFilter(Drawing.GetMaskColorFilter(hatchColor, backgroundColor)); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Hatches/Square.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Hatches/Square.cs new file mode 100644 index 000000000..7863d2604 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Hatches/Square.cs @@ -0,0 +1,33 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Square : IHatch + { + static Square() + { + _bmp = CreateBitmap(); + } + private static readonly SKBitmap _bmp; + private static SKBitmap CreateBitmap() + { + var bitmap = new SKBitmap(20, 20); + using var paint = new SKPaint() { Color = Colors.White.ToSkColor() }; + using var path = new SKPath(); + using var canvas = new SKCanvas(bitmap); + + canvas.Clear(Colors.Black.ToSkColor()); + canvas.DrawRect(new SKRect(0, 0, 10, 10), paint); + + return bitmap; + } + + public SKShader GetShader(Color backgroundColor, Color hatchColor) + { + return SKShader.CreateBitmap( + _bmp, + SKShaderTileMode.Repeat, + SKShaderTileMode.Repeat, + SKMatrix.CreateScale(0.5f, 0.5f)) + .WithColorFilter(Drawing.GetMaskColorFilter(hatchColor, backgroundColor)); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Hatches/StripeDirection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Hatches/StripeDirection.cs new file mode 100644 index 000000000..93071ea88 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Hatches/StripeDirection.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public enum StripeDirection + { + DiagonalUp, + DiagonalDown, + Horizontal, + Vertical + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Hatches/Striped.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Hatches/Striped.cs new file mode 100644 index 000000000..dbe47fa40 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Hatches/Striped.cs @@ -0,0 +1,51 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Striped : IHatch + { + public Striped(StripeDirection stripeDirection = StripeDirection.DiagonalUp) + { + StripeDirection = stripeDirection; + } + + // This is implemented as a transformation of the shader, so we don't need to invalidate the bitmap in the setter + public StripeDirection StripeDirection { get; set; } + static Striped() + { + _bmp = CreateBitmap(); + } + private static readonly SKBitmap _bmp; + private static SKBitmap CreateBitmap() + { + var bitmap = new SKBitmap(20, 50); + + using var paint = new SKPaint() { Color = Colors.White.ToSkColor() }; + using var path = new SKPath(); + using var canvas = new SKCanvas(bitmap); + + canvas.Clear(Colors.Black.ToSkColor()); + canvas.DrawRect(new SKRect(0, 0, 20, 20), paint); + + return bitmap; + } + + public SKShader GetShader(Color backgroundColor, Color hatchColor) + { + var rotationMatrix = StripeDirection switch + { + StripeDirection.DiagonalUp => SKMatrix.CreateRotationDegrees(-45), + StripeDirection.DiagonalDown => SKMatrix.CreateRotationDegrees(45), + StripeDirection.Horizontal => SKMatrix.Identity, + StripeDirection.Vertical => SKMatrix.CreateRotationDegrees(90), + _ => throw new NotImplementedException(nameof(StripeDirection)) + }; + + return SKShader.CreateBitmap( + _bmp, + SKShaderTileMode.Repeat, + SKShaderTileMode.Repeat, + SKMatrix.CreateScale(0.1f, 0.15f) + .PostConcat(rotationMatrix)) + .WithColorFilter(Drawing.GetMaskColorFilter(hatchColor, backgroundColor)); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/IO/BitmapHeader.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/IO/BitmapHeader.cs new file mode 100644 index 000000000..2bbf06fa0 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/IO/BitmapHeader.cs @@ -0,0 +1,35 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This struct holds values that define the first several bytes of a bitmap file. + /// + [StructLayout(LayoutKind.Sequential, Pack = 1)] + internal struct BitmapHeader + { + public const int FileHeaderSize = 54; // number of bytes in the bitmap header + public readonly byte MagicNumberHighByte = (byte)'B'; + public readonly byte MagicNumberLowByte = (byte)'M'; + public readonly int Size; // number of bytes in the image + public readonly short Reserved1; + public readonly short Reserved2; + public readonly int Offset = FileHeaderSize; // byte where the image data begins + public readonly int BitmapInfoHeaderSize = 40; + public readonly int Width; // pixel width of the image + public readonly int Height; // pixel height of the image (a negative value means rows are encoded top-to-bottom) + public readonly short ColorPlanes = 1; // always 1 for standard images + public readonly short BitsPerPixel = 32; // typically 8 (grayscale), 24 (RGB), or 32 (RGBA) + public readonly int CompressionMethod = 0; // 0 means no compression + public readonly int PixelSize = 0; // Size of the compressed image. 0 is valid if compression is disabled. + public readonly int HorizontalResolution; // pixels per meter (0 for undefined) + public readonly int VerticalResolution; // pixels per meter (0 for undefined) + public readonly int ColorsInPalette; // 0 for default + public readonly int ImportantColors; // 0 indicates every color is important + + public BitmapHeader(int width, int height) + { + Size = width * Math.Abs(height) * BitsPerPixel / 8 + FileHeaderSize; + Width = width; + Height = -height; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IAxes.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IAxes.cs new file mode 100644 index 000000000..87d65eeff --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IAxes.cs @@ -0,0 +1,32 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This interface describes a pair of 1D axes. + /// It is intended to be stored inside objects, + /// defining which axes they use and providing logic for coordinate/pixel conversions. + /// + public interface IAxes + { + /// + /// Describes the region in the center of the figure where plottable data will be displayed. + /// This region is set by the renderer immediately before a Plottable's Render() method is called. + /// + PixelRect DataRect { get; set; } + + // Note: Axes (not just the translation logic) are here so ticks are accessible to plottables. + // Note: At render time any null axes will be set to the default axes for the plot + IXAxis XAxis { get; set; } + IYAxis YAxis { get; set; } + + PixelRect GetPixelRect(CoordinateRect rect); + PixelLine GetPixelLine(CoordinateLine rect); + + Pixel GetPixel(Coordinates coordinates); + float GetPixelX(double xCoordinate); + float GetPixelY(double yCoordinate); + + Coordinates GetCoordinates(Pixel pixel); + double GetCoordinateX(float pixel); + double GetCoordinateY(float pixel); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IAxis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IAxis.cs new file mode 100644 index 000000000..295e44e94 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IAxis.cs @@ -0,0 +1,63 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This interface describes a 1D axis (horizontal or vertical). + /// Responsibilities include: min/max management, unit/pixel conversion, + /// tick generation (and rendering), axis label rendering, + /// and self-measurement for layout purposes. + /// + public interface IAxis : IPanel + { + /// + /// Min/Max range currently displayed by this axis + /// + CoordinateRangeMutable Range { get; } // TODO: don't expose this + + double Min { get; set; } + double Max { get; set; } + + /// + /// Get the pixel position of a coordinate given the location and size of the data area + /// + float GetPixel(double position, PixelRect dataArea); + + /// + /// Get the coordinate of a pixel position given the location and size of the data area + /// + double GetCoordinate(float pixel, PixelRect dataArea); + + /// + /// Given a distance in coordinate space, converts to pixel space + /// + /// A distance in coordinate units + /// The rectangle onto which the coordinates are mapped + /// The same distance in pixel units + double GetPixelDistance(double coordinateDistance, PixelRect dataArea); + + /// + /// Given a distance in pixel space, converts to coordinate space + /// + /// A distance in pixel units + /// The rectangle onto which the coordinates are mapped + /// The same distance in coordinate units + double GetCoordinateDistance(float pixelDistance, PixelRect dataArea); + + /// + /// Logic for determining tick positions and formatting tick labels + /// + ITickGenerator TickGenerator { get; set; } + + /// + /// The label is the text displayed distal to the ticks + /// + Label Label { get; } + + TickMarkStyle MajorTickStyle { get; set; } + + TickMarkStyle MinorTickStyle { get; set; } + + Label TickLabelStyle { get; set; } + + LineStyle FrameLineStyle { get; } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IAxisRule.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IAxisRule.cs new file mode 100644 index 000000000..6522decf7 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IAxisRule.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// These rules are applied just before each render + /// + public interface IAxisRule + { + void Apply(RenderPack rp, bool beforeLayout); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IColormap.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IColormap.cs new file mode 100644 index 000000000..aa99ce308 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IColormap.cs @@ -0,0 +1,27 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public interface IColormap + { + /// + /// Full name for this colormap + /// + string Name { get; } + + /// + /// Returns the color of a position on this colormap (from 0 to 1). + /// Returns transparent if NaN. + /// Positions outside the range will be clamped. + /// + /// position from 0 (first color) to 1 (last color) + Color GetColor(double position); + + /// + /// Returns the color of a position on this colormap (according to the given range). + /// Returns transparent if NaN. + /// Positions outside the range will be clamped. + /// + /// position relative to the given range + /// range of values spanned by this colormap + Color GetColor(double position, Range range); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IFunctionSource.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IFunctionSource.cs new file mode 100644 index 000000000..fe78c9531 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IFunctionSource.cs @@ -0,0 +1,9 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public interface IFunctionSource + { + CoordinateRange RangeX { get; } + CoordinateRange GetRangeY(CoordinateRange rangeX); + double Get(double x); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IGrid.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IGrid.cs new file mode 100644 index 000000000..07f2cc9a7 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IGrid.cs @@ -0,0 +1,14 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Implement this interface to create a custom grid + /// + public interface IGrid + { + bool IsVisible { get; set; } + bool IsBeneathPlotables { get; set; } + void Render(RenderPack rp); + void Replace(IXAxis xAxis); // TODO: remove this + void Replace(IYAxis yAxis); // TODO: remove this + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IHasColorAxis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IHasColorAxis.cs new file mode 100644 index 000000000..5908b888e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IHasColorAxis.cs @@ -0,0 +1,8 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public interface IHasColorAxis + { + Range GetRange(); + IColormap Colormap { get; } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IHatch.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IHatch.cs new file mode 100644 index 000000000..fa3caf01d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IHatch.cs @@ -0,0 +1,7 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public interface IHatch + { + SKShader GetShader(Color backgroundColor, Color hatchColor); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/ILayoutEngine.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/ILayoutEngine.cs new file mode 100644 index 000000000..8d3ccdacf --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/ILayoutEngine.cs @@ -0,0 +1,12 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This interface describes a class that decides how to lay-out a collection of panels around the + /// edges of a figure and create a final layout containing size and position of all panels + /// and also the size and position of the data area. + /// + public interface ILayoutEngine + { + public Layout GetLayout(PixelRect figureRect, IEnumerable panels); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IManagesAxisLimits.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IManagesAxisLimits.cs new file mode 100644 index 000000000..960241e2d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IManagesAxisLimits.cs @@ -0,0 +1,12 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This interface is applied to plottables which modify axis limits at rendeer time. + /// The update method is called at render time before the ticks are calculated. + /// + public interface IManagesAxisLimits + { + void UpdateAxisLimits(Plot plot, bool force = false); + bool ManageAxisLimits { get; set; } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IMarker.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IMarker.cs new file mode 100644 index 000000000..d0b791d59 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IMarker.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Describes logic necessary to render a marker at a point + /// + public interface IMarker + { + void Render(SKCanvas canvas, SKPaint paint, Pixel center, float size, FillStyle fill, LineStyle outline); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IOHLCSource.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IOHLCSource.cs new file mode 100644 index 000000000..1a9c08964 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IOHLCSource.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public interface IOhlcSource + { + List GetOhlCs(); + public CoordinateRange GetLimitsX(); + public CoordinateRange GetLimitsY(); + AxisLimits GetLimits(); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPalette.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPalette.cs new file mode 100644 index 000000000..6bccad68e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPalette.cs @@ -0,0 +1,25 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public interface IPalette + { + /// + /// All colors in this palette + /// + public Color[] Colors { get; } + + /// + /// Display name + /// + public string Name { get; } + + /// + /// Additional information such as the source of this palette + /// + public string Description { get; } + + /// + /// Return the Nth color (wrapping around if N is larger than the number of colors) + /// + public Color GetColor(int index); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPanel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPanel.cs new file mode 100644 index 000000000..bb41476ed --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPanel.cs @@ -0,0 +1,54 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// A panel is a rectangular region outside the data area of a plot. + /// Example panels include axes, colorbars, and titles + /// + public interface IPanel + { + /// + /// If false, the panel will not be displayed or report any size + /// + public bool IsVisible { get; set; } + + /// + /// Disallow the panel to be smaller than this + /// + public float MinimumSize { get; set; } + + /// + /// Disallow the panel to be larger than this + /// + public float MaximumSize { get; set; } + + /// + /// Return the size (in pixels) of the panel in the dimension perpendicular to the edge it lays on + /// + /// + float Measure(); + + /// + /// Indicates which edge of the data rectangle this panel lays on + /// + Edge Edge { get; } + + /// + /// Draw this panel on a canvas + /// + /// contains the canvas to draw on + /// dimensions of the data area (pixel units) + /// size of this panel (pixel units) + /// distance from the edge of this panel to the edge of the data area + void Render(RenderPack rp, float size, float offset); + + /// + /// Enable this to display extra information on the axis to facilitate development + /// + bool ShowDebugInformation { get; set; } + + /// + /// Return the rectangle for this panel + /// + PixelRect GetPanelRect(PixelRect dataRect, float size, float offset); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPlotControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPlotControl.cs new file mode 100644 index 000000000..0b1119f2f --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPlotControl.cs @@ -0,0 +1,48 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public interface IPlotControl + { + /// + /// The displayed by this interactive control + /// + Plot Plot { get; } + + /// + /// Render the plot and update the image + /// + void Refresh(); + + /// + /// Advanced options for configuring how user inputs manipulate the plot + /// + IPlotInteraction Interaction { get; set; } + + /// + /// Platform-specific logic for managing the context menu + /// + IPlotMenu Menu { get; set; } + + /// + /// Launch the default pop-up menu (typically in response to a right-click) at the given position in the control + /// + void ShowContextMenu(Pixel position); + + /// + /// Context for hardware-accelerated graphics (or null if not available) + /// + GRContext? GrContext { get; } + + /// + /// Determine the DPI scaling ratio of the present display. + /// A value of 1.0 means no scaling, and 1.5 means 150% scaling. + /// This operation may be costly so do not call it frequently. + /// + float DetectDisplayScale(); + + /// + /// The value of the present display scaling. + /// Mouse positions are multiplied by this value for pixel/coordinate conversions. + /// + float DisplayScale { get; set; } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPlotInteraction.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPlotInteraction.cs new file mode 100644 index 000000000..39402cec4 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPlotInteraction.cs @@ -0,0 +1,34 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public interface IPlotInteraction + { + IPlotControl PlotControl { get; } + + /// + /// Disable all mouse interactivity + /// + void Disable(); + + /// + /// Enable mouse interactivity using the default mouse actions + /// + void Enable(); + + /// + /// Enable mouse interactivity using custom mouse actions + /// + void Enable(PlotActions customActions); + + void OnMouseMove(Pixel newPosition); + + void KeyUp(Key key); + void KeyDown(Key key); + + void MouseDown(Pixel position, MouseButton button); + + void MouseUp(Pixel position, MouseButton button); + void DoubleClick(); + + void MouseWheelVertical(Pixel pixel, float delta); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPlotMenu.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPlotMenu.cs new file mode 100644 index 000000000..9e1b1b269 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPlotMenu.cs @@ -0,0 +1,13 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public interface IPlotMenu + { + public void Reset(); + + public void Clear(); + + public void Add(string label, Action action); + + void ShowContextMenu(Pixel pixel); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPlottable.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPlottable.cs new file mode 100644 index 000000000..a492b2e3b --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPlottable.cs @@ -0,0 +1,37 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Any object that renders shapes on the canvas using scale information from the axes must implement this interface. + /// + public interface IPlottable + { + /// + /// Toggles whether this plottable is shown and contributes to the automatic axis limit detection. + /// The calling method will check this variable (it does not need to be checked inside the Render method). + /// + bool IsVisible { get; set; } + + /// + /// This object performs coordinate/pixel translation at render time based on the latest data area. + /// It stores the axes to use for this plottable and also the data area (in pixels) updated just before each render. + /// If this object is null it will be constructed using the default X and Y axes at render time. + /// + IAxes Axes { get; set; } + + /// + /// Return the 2D area (in coordinate space) occupied by the data contained in this plottable + /// + AxisLimits GetAxisLimits(); + + /// + /// Draw the data from this plottable into the data area defined in the . + /// By default the surface is already clipped to the data area, but this can be cleared inside the plottable. + /// + void Render(RenderPack rp); + + /// + /// Items which will appear in the legend + /// + IEnumerable LegendItems { get; } // TODO: this should be a method GetLegendItems() + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPlottableGL.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPlottableGL.cs new file mode 100644 index 000000000..7ac64fc76 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IPlottableGL.cs @@ -0,0 +1,19 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This interface is applied to plottables which can be rendered directly on the GPU using an OpenGL shader + /// + public interface IPlottableGl : IPlottable + { + /// + /// The control used to display this plottable. + /// It is used to access the at render time. + /// + IPlotControl PlotControl { get; } + + /// + /// Used to manually synchronize rendering + /// + void GlFinish(); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IRenderAction.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IRenderAction.cs new file mode 100644 index 000000000..9eff0c580 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IRenderAction.cs @@ -0,0 +1,7 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public interface IRenderAction + { + void Render(RenderPack renderPack); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IRenderLast.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IRenderLast.cs new file mode 100644 index 000000000..49d30a954 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IRenderLast.cs @@ -0,0 +1,11 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public interface IRenderLast + { + /// + /// Plottables that implement this interface have a second render method that runs + /// after the axes are drawn, allowing graphics to be placed on top of the axes. + /// + void RenderLast(RenderPack renderPack); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IScatterSource.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IScatterSource.cs new file mode 100644 index 000000000..593d77e89 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IScatterSource.cs @@ -0,0 +1,25 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Represents a series of data points with distinct X and Y positions in coordinate space. + /// + public interface IScatterSource + { + /// + /// Return a copy of the data in format. + /// + IReadOnlyList GetScatterPoints(); // TODO: obsolete this + + /// + /// Return the point nearest a specific location given the X/Y pixel scaling information from a previous render. + /// Will return if the nearest point is greater than pixels away. + /// + DataPoint GetNearest(Coordinates location, RenderDetails renderInfo, float maxDistance = 15); + + public CoordinateRange GetLimitsX(); // TODO: struct + + public CoordinateRange GetLimitsY(); // TODO: struct + + AxisLimits GetLimits(); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/ISignalSource.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/ISignalSource.cs new file mode 100644 index 000000000..e88d8779f --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/ISignalSource.cs @@ -0,0 +1,63 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This interface is used by plottables to access data while rendering. + /// This interface describes Y data sampled along an X axis at a fixed period. + /// + public interface ISignalSource + { + /// + /// X distance between Y points + /// + double Period { get; set; } + + /// + /// X position of the first data point + /// + double XOffset { get; set; } + + /// + /// Shift Y position of all values by this amount + /// + double YOffset { get; set; } + + /// + /// Do not display data above this index + /// + public int MaximumIndex { get; set; } + + /// + /// Do not display data below this index + /// + public int MinimumIndex { get; set; } + + /// + /// Returns range information about the data at a specific pixel location + /// + PixelColumn GetPixelColumn(IAxes axes, int xPixelIndex); + + /// + /// Returns the predicted index for the data point nearest a given X position. + /// If clamped, the returned index will be clamped between 0 and Length - 1. + /// + int GetIndex(double x, bool clamp); + + /// + /// Returns the X position for a given index. + /// + double GetX(int index); + + /// + /// Return an object for working with all Y values. + /// + IReadOnlyList GetYs(); + // NOTE: GetYs() is only called in low density mode to plot a few ploints + // TODO: Add min/max X arguments so large datasets are not copied + + public CoordinateRange GetLimitsX(); // TODO: struct + + public CoordinateRange GetLimitsY(); // TODO: struct + + AxisLimits GetLimits(); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/ISignalXYSource.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/ISignalXYSource.cs new file mode 100644 index 000000000..e91791696 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/ISignalXYSource.cs @@ -0,0 +1,41 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public interface ISignalXySource + { + /// + /// X position of the first data point + /// + double XOffset { get; set; } + + /// + /// Shift Y position of all values by this amount + /// + double YOffset { get; set; } + + /// + /// Do not display data below this index + /// + public int MinimumIndex { get; set; } + + /// + /// Do not display data above this index + /// + public int MaximumIndex { get; set; } + + /// + /// If enabled, Xs will be vertical and Ys will be horizontal. + /// + public bool Rotated { get; set; } + + /// + /// Return the axis limits covered by these data + /// + AxisLimits GetAxisLimits(); + + /// + /// Return pixels to render to display this signal. + /// May return one extra point on each side of the plot outside the data area. + /// + Pixel[] GetPixelsToDraw(RenderPack rp, IAxes axes); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/ITickGenerator.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/ITickGenerator.cs new file mode 100644 index 000000000..ff23bfe64 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/ITickGenerator.cs @@ -0,0 +1,21 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public interface ITickGenerator + { + /// + /// Ticks to display the next time the axis is rendered + /// + Tick[] Ticks { get; set; } + + /// + /// Do not automatically generate more ticks than this + /// + int MaxTickCount { get; set; } + + /// + /// Logic for generating ticks automatically. + /// Generated ticks are stored in . + /// + void Regenerate(CoordinateRange range, Edge edge, PixelLength size); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IXAxis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IXAxis.cs new file mode 100644 index 000000000..2c65395c4 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IXAxis.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Horizontal axis + /// + public interface IXAxis : IAxis + { + public double Width { get; } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IYAxis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IYAxis.cs new file mode 100644 index 000000000..24aa86a10 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IYAxis.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Vertical axis + /// + public interface IYAxis : IAxis + { + public double Height { get; } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IZoomRectangle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IZoomRectangle.cs new file mode 100644 index 000000000..aeec4a8ee --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Interfaces/IZoomRectangle.cs @@ -0,0 +1,16 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public interface IZoomRectangle + { + bool VerticalSpan { get; set; } + bool HorizontalSpan { get; set; } + bool IsVisible { get; set; } + + public Pixel MouseDown { get; } + public Pixel MouseUp { get; } + void Update(Pixel mouseDown, Pixel mouseUp); + void Clear(); + + void Render(RenderPack rp); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/LayoutEngines/Automatic.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/LayoutEngines/Automatic.cs new file mode 100644 index 000000000..320d8545c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/LayoutEngines/Automatic.cs @@ -0,0 +1,52 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Generate the layout by measuring all panels and adding + /// enough padding around the data area to fit them all exactly. + /// + public class Automatic : LayoutEngineBase, ILayoutEngine + { + public Layout GetLayout(PixelRect figureRect, IEnumerable panels) + { + /* PROBLEM: There is a chicken-or-egg situation + * where the ideal layout depends on the ticks, + * but the ticks depend on the layout. + * + * SOLUTION: Regenerate ticks using the figure area (not the data area) + * to create a first-pass estimate of the space needed for axis panels. + * Ticks require recalculation once more after the axes are repositioned + * according to the layout determined by this function. + * + */ + + PixelSize figureSize = figureRect.Size; + + panels.OfType() + .ToList() + .ForEach(xAxis => xAxis.TickGenerator.Regenerate(xAxis.Range.ToCoordinateRange, xAxis.Edge, figureSize.Width)); + + panels.OfType() + .ToList() + .ForEach(yAxis => yAxis.TickGenerator.Regenerate(yAxis.Range.ToCoordinateRange, yAxis.Edge, figureSize.Height)); + + Dictionary panelSizes = MeasurePanels(panels); + Dictionary panelOffsets = GetPanelOffsets(panels, panelSizes); + + PixelPadding paddingNeededForPanels = new( + left: panels.Where(x => x.Edge == Edge.Left).Select(x => panelSizes[x]).Sum(), + right: panels.Where(x => x.Edge == Edge.Right).Select(x => panelSizes[x]).Sum(), + bottom: panels.Where(x => x.Edge == Edge.Bottom).Select(x => panelSizes[x]).Sum(), + top: panels.Where(x => x.Edge == Edge.Top).Select(x => panelSizes[x]).Sum()); + + PixelRect dataRect = new( + left: paddingNeededForPanels.Left, + right: figureSize.Width - paddingNeededForPanels.Right, + bottom: figureSize.Height - paddingNeededForPanels.Bottom, + top: paddingNeededForPanels.Top); + + dataRect = dataRect.WithPan(figureRect.Left, figureRect.Top); + + return new Layout(figureRect, dataRect, panelSizes, panelOffsets); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/LayoutEngines/FixedDataArea.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/LayoutEngines/FixedDataArea.cs new file mode 100644 index 000000000..63f83d09c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/LayoutEngines/FixedDataArea.cs @@ -0,0 +1,22 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Generate a layout using a fixed rectangle for the data area + /// + public class FixedDataArea : LayoutEngineBase, ILayoutEngine + { + private PixelRect DataRect { get; } + + public FixedDataArea(PixelRect dataRect) + { + DataRect = dataRect; + } + + public Layout GetLayout(PixelRect figureRect, IEnumerable panels) + { + Dictionary panelSizes = MeasurePanels(panels); + Dictionary panelOffsets = GetPanelOffsets(panels, panelSizes); + return new Layout(figureRect, DataRect, panelSizes, panelOffsets); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/LayoutEngines/FixedPadding.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/LayoutEngines/FixedPadding.cs new file mode 100644 index 000000000..31ed2e95d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/LayoutEngines/FixedPadding.cs @@ -0,0 +1,39 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Generate layouts where the data area has a fixed padding from the edge of the figure + /// + public class FixedPadding : LayoutEngineBase, ILayoutEngine + { + private PixelPadding Padding { get; } + + public FixedPadding(PixelPadding padding) + { + Padding = padding; + } + + public Layout GetLayout(PixelRect figureRect, IEnumerable panels) + { + // must recalculate ticks before measuring panels + + panels.OfType() + .ToList() + .ForEach(xAxis => xAxis.TickGenerator.Regenerate(xAxis.Range.ToCoordinateRange, xAxis.Edge, figureRect.Width)); + + panels.OfType() + .ToList() + .ForEach(yAxis => yAxis.TickGenerator.Regenerate(yAxis.Range.ToCoordinateRange, yAxis.Edge, figureRect.Height)); + + Dictionary panelSizes = MeasurePanels(panels); + Dictionary panelOffsets = GetPanelOffsets(panels, panelSizes); + + PixelRect dataRect = new( + left: figureRect.Left + Padding.Left, + right: figureRect.Left + figureRect.Width - Padding.Right, + bottom: figureRect.Top + figureRect.Height - Padding.Bottom, + top: figureRect.Top + Padding.Top); + + return new Layout(figureRect, dataRect, panelSizes, panelOffsets); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/LayoutEngines/LayoutEngineBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/LayoutEngines/LayoutEngineBase.cs new file mode 100644 index 000000000..a059417c9 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/LayoutEngines/LayoutEngineBase.cs @@ -0,0 +1,41 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class LayoutEngineBase + { + internal static Dictionary MeasurePanels(IEnumerable panels) + { + Dictionary measuredPanels = new(); + + foreach (IPanel panel in panels) + { + measuredPanels[panel] = panel.MinimumSize == panel.MaximumSize + ? panel.MinimumSize + : NumericConversion.Clamp(panel.Measure(), panel.MinimumSize, panel.MaximumSize); + } + + return measuredPanels; + } + + internal static void CalculateOffsets(IEnumerable panels, Dictionary sizes, Dictionary offsets) + { + float offset = 0; + foreach (IPanel panel in panels) + { + offsets[panel] = offset; + offset += sizes[panel]; + } + } + + internal static Dictionary GetPanelOffsets(IEnumerable panels, Dictionary panelSizes) + { + Dictionary panelOffsets = new(); + + CalculateOffsets(panels.Where(x => x.Edge == Edge.Left), panelSizes, panelOffsets); + CalculateOffsets(panels.Where(x => x.Edge == Edge.Right), panelSizes, panelOffsets); + CalculateOffsets(panels.Where(x => x.Edge == Edge.Bottom), panelSizes, panelOffsets); + CalculateOffsets(panels.Where(x => x.Edge == Edge.Top), panelSizes, panelOffsets); + + return panelOffsets; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/LayoutEngines/MatchedDataRect.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/LayoutEngines/MatchedDataRect.cs new file mode 100644 index 000000000..acf09ca2d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/LayoutEngines/MatchedDataRect.cs @@ -0,0 +1,24 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Generate layouts that match layouts of another control + /// + public class MatchedDataRect : LayoutEngineBase, ILayoutEngine + { + private Plot ReferencePlot { get; } + + public MatchedDataRect(Plot referencePlot) + { + ReferencePlot = referencePlot; + } + + public Layout GetLayout(PixelRect figureRect, IEnumerable panels) + { + Dictionary panelSizes = MeasurePanels(panels); + Dictionary panelOffsets = GetPanelOffsets(panels, panelSizes); + + PixelRect dataRect = ReferencePlot.RenderManager.LastRender.DataRect; + return new Layout(figureRect, dataRect, panelSizes, panelOffsets); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Legends/Common.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Legends/Common.cs new file mode 100644 index 000000000..253366812 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Legends/Common.cs @@ -0,0 +1,121 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Common methods which legends may choose to use for rendering + /// + public static class Common + { + /// + /// Render a leger item: its label, symbol, and all its children + /// + public static void RenderItem( + SKCanvas canvas, + SKPaint paint, + SizedLegendItem sizedItem, + float x, + float y, + float symbolWidth, + float symbolPadRight, + PixelPadding itemPadding) + { + LegendItem item = sizedItem.Item; + + SKPoint textPoint = new(x, y + paint.TextSize); + float ownHeight = sizedItem.Size.OwnSize.Height; + + if (item.HasSymbol) + { + RenderSymbol( + canvas: canvas, + item: item, + x: x, + y: y + itemPadding.Bottom, + height: ownHeight - itemPadding.Vertical, + symbolWidth: symbolWidth); + + textPoint.X += symbolWidth + symbolPadRight; + } + + using SKAutoCanvasRestore _ = new(canvas); + if (!string.IsNullOrEmpty(item.Label)) + { + canvas.DrawText(item.Label, textPoint, paint); + canvas.Translate(itemPadding.Left, 0); + } + + y += ownHeight; + foreach (var curr in sizedItem.Children) + { + RenderItem(canvas, paint, curr, x, y, symbolWidth, symbolPadRight, itemPadding); + y += curr.Size.WithChildren.Height; + } + } + + /// + /// Render just the symbol of a legend + /// + public static void RenderSymbol( + SKCanvas canvas, + LegendItem item, + float x, + float y, + float height, + float symbolWidth) + { + // TODO: make LegendSymbol its own object that include size and padding + + PixelRect rect = new(x, x + symbolWidth, y + height, y); + + using SKPaint paint = new(); + + if (item.Line is not null) + { + item.Line.ApplyToPaint(paint); + canvas.DrawLine(new(rect.Left, rect.VerticalCenter), new(rect.Right, rect.VerticalCenter), paint); + } + + if (item.Marker.IsVisible) + { + Pixel px = new(rect.HorizontalCenter, rect.VerticalCenter); + Drawing.DrawMarker(canvas, paint, px, item.Marker); + } + + if (item.Fill.HasValue) + { + item.Fill.ApplyToPaint(paint); + canvas.DrawRect(rect.ToSkRect(), paint); + } + } + + /// + /// Return the size of the given item including all its children + /// + public static LegendItemSize Measure( + LegendItem item, + SKPaint paint, + SizedLegendItem[] children, + float symbolWidth, + float symbolPadRight, + PixelPadding padding, + PixelPadding itemPadding) + { + PixelSize labelRect = !string.IsNullOrWhiteSpace(item.Label) + ? Drawing.MeasureString(item.Label ?? string.Empty, paint) + : new(0, 0); + + float width2 = item.HasSymbol ? symbolWidth : 0; + float width = width2 + symbolPadRight + labelRect.Width + itemPadding.Horizontal; + float height = paint.TextSize + padding.Vertical; + + PixelSize ownSize = new(width, height); + + foreach (SizedLegendItem childItem in children) + { + width = Math.Max(width, padding.Left + childItem.Size.WithChildren.Width); + height += childItem.Size.WithChildren.Height; + } + + return new LegendItemSize(ownSize, new(width, height)); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Legends/Legend.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Legends/Legend.cs new file mode 100644 index 000000000..18c13d617 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Legends/Legend.cs @@ -0,0 +1,227 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Legend + { + public bool IsVisible { get; set; } = false; + public Alignment Location { get; set; } = Alignment.LowerRight; + public PixelPadding Margin { get; set; } = new PixelPadding(8); + public PixelPadding Padding { get; set; } = new PixelPadding(3); + public PixelPadding ItemPadding { get; set; } = new PixelPadding(3); + + public FontStyle Font { get; set; } = new(); + public LineStyle OutlineStyle { get; set; } = new(); + public FillStyle BackgroundFill { get; set; } = new() { Color = Colors.White }; + public FillStyle ShadowFill { get; set; } = new() { Color = Colors.Black.WithOpacity(.2) }; + + public float ShadowOffset = 3; + public Alignment ShadowAlignment = Alignment.LowerRight; + + private const float SymbolWidth = 20; + private const float SymbolLabelSeparation = 5; + public List ManualItems { get; set; } = new(); + + private readonly Plot _plot; + + public Legend(Plot plot) + { + _plot = plot; + } + + public void Render(RenderPack rp) + { + if (!IsVisible) + { + return; + } + + IEnumerable allItems = GetItems(); + + LegendItem[] items = GetAllLegendItems(allItems).Where(x => x.IsVisible).ToArray(); + if (!items.Any()) + { + return; + } + + // measure all items to determine dimensions of the legend + using SKPaint paint = new(); + SizedLegendItem[] sizedItems = GetSizedLegendItems(rp.Plot, paint); + + if (sizedItems?.Any() != true) + { + return; + } + + float maxWidth = sizedItems.Select(x => x.Size.WithChildren.Width).Max(); + float totalheight = sizedItems.Select(x => x.Size.WithChildren.Height).Sum(); + + PixelSize legendSize = new(maxWidth + Padding.Left + Padding.Right, totalheight + Padding.Top + Padding.Bottom); + PixelRect legendRect = legendSize.AlignedInside(rp.DataRect, Location, Margin); + PixelRect legendShadowRect = legendRect.WithDelta(ShadowOffset, ShadowOffset, Location); + Pixel offset = new(legendRect.Left + Padding.Left, legendRect.Top + Padding.Top); + + // render the legend panel + RenderLegend(sizedItems, rp.Canvas, paint, offset, legendRect, legendShadowRect); + } + + public void AsSvg(Plot plot, Stream svgStream, int maxWidth = 0, int maxHeight = 0) + { + if (svgStream is null) + { + throw new NullReferenceException($"invalid Stream"); + } + + var canvas = RenderToObject(plot, svgStream: svgStream, maxWidth: maxWidth, maxHeight: maxHeight) as SKCanvas; + canvas?.Dispose(); + } + + public Image GetImage(Plot plot, int maxWidth = 0, int maxHeight = 0) + { + SKSurface? surface = RenderToObject(plot, maxWidth: maxWidth, maxHeight: maxHeight) as SKSurface + ?? throw new NullReferenceException(); + SKImage skimg = surface.Snapshot(); + surface.Dispose(); + return new Image(skimg); + } + + public string GetSvgXml(Plot plot) + { + using SKPaint paint = new(); + SizedLegendItem[] sizedItems = GetSizedLegendItems(plot, paint); + float maxWidth = sizedItems.Select(x => x.Size.WithChildren.Width).Max() + Padding.Left + Padding.Right + 2 * ShadowOffset; + float totalHeight = sizedItems.Select(x => x.Size.WithChildren.Height).Sum() + Padding.Top + Padding.Bottom + 2 * ShadowOffset; + int width = (int)Math.Ceiling(maxWidth); + int height = (int)Math.Ceiling(totalHeight); + + PixelRect legendRect = new(0, width, 0, height); + PixelRect legendShadowRect = legendRect.WithDelta(ShadowOffset, ShadowOffset, Location); + Pixel offset = new(legendRect.Left + Padding.Left, legendRect.Top + Padding.Top); + + using SvgImage svg = new(width, height); + RenderLegend(sizedItems, svg.Canvas, paint, offset, legendRect, legendShadowRect); + string svgXml = svg.GetXml(); + return svgXml; + } + + private SKObject RenderToObject(Plot plot, Stream? svgStream = null, int maxWidth = 0, int maxHeight = 0) + { + // measure all items to determine dimensions of the legend + using SKPaint paint = new(); + SizedLegendItem[] sizedItems = GetSizedLegendItems(plot, paint); + + if (sizedItems.Any() != true) + { + throw new InvalidOperationException($"empty legend items"); + } + + float maxItemWidth = sizedItems.Select(x => x.Size.WithChildren.Width).Max() + Padding.Left + Padding.Right + 2 * ShadowOffset; + if (maxWidth > 0) + { + maxItemWidth = Math.Min(maxItemWidth, maxWidth); + } + + float totalheight = sizedItems.Select(x => x.Size.WithChildren.Height).Sum() + Padding.Top + Padding.Bottom + 2 * ShadowOffset; + if (maxHeight > 0) + { + totalheight = Math.Min(totalheight, maxHeight); + } + + PixelSize legendSize = new(maxItemWidth, totalheight); + PixelRect legendRect = new(new Pixel(ShadowOffset, ShadowOffset), legendSize.Width - 2 * ShadowOffset, legendSize.Height - 2 * ShadowOffset); + PixelRect legendShadowRect = legendRect.WithDelta(ShadowOffset, ShadowOffset, Location); + Pixel offset = new(legendRect.Left + Padding.Left + ShadowOffset, legendRect.Top + Padding.Top + ShadowOffset); + + if (svgStream is null) + { + SKImageInfo info = new( + width: (int)Math.Ceiling(legendSize.Width), + height: (int)Math.Ceiling(legendSize.Height), + colorType: SKColorType.Rgba8888, + alphaType: SKAlphaType.Premul); + + SKSurface surface = SKSurface.Create(info) ?? throw new NullReferenceException($"invalid SKImageInfo"); + + RenderLegend(sizedItems, surface.Canvas, paint, offset, legendRect, legendShadowRect); + return surface; + } + + SKCanvas canvas = SKSvgCanvas.Create(new SKRect(0, 0, legendSize.Width, legendSize.Height), svgStream); + RenderLegend(sizedItems, canvas, paint, offset, legendRect, legendShadowRect); + return canvas; + } + + public IEnumerable GetItems() + { + return _plot.PlottableList.SelectMany(x => x.LegendItems).Concat(ManualItems); + } + + /// + /// Recursively walk through children and return a flat array with all legend items + /// + private LegendItem[] GetAllLegendItems(IEnumerable items) + { + List allItems = new(); + foreach (LegendItem item in items) + { + allItems.Add(item); + allItems.AddRange(GetAllLegendItems(item.Children)); + } + return allItems.ToArray(); + } + + private SizedLegendItem[] GetSizedLegendItems(Plot plot, SKPaint paint) + { + IEnumerable allItems = plot.PlottableList.Where(x => x.IsVisible).SelectMany(x => x.LegendItems).Concat(ManualItems); + + LegendItem[] items = GetAllLegendItems(allItems).Where(x => x.IsVisible).ToArray(); + if (!items.Any()) + { + return Array.Empty(); + } + + // measure all items to determine dimensions of the legend + Font.ApplyToPaint(paint); + return GetSizedLegendItems(items, paint); + } + + private SizedLegendItem[] GetSizedLegendItems(IEnumerable items, SKPaint paint) + { + List sizedItems = new(); + + foreach (LegendItem item in items) + { + LegendItem[] visibleItems = GetAllLegendItems(item.Children).Where(x => x.IsVisible).ToArray(); + SizedLegendItem[] sizedChildren = GetSizedLegendItems(visibleItems, paint); + LegendItemSize itemSize = Common.Measure(item, paint, sizedChildren, SymbolWidth, SymbolLabelSeparation, Padding, ItemPadding); + SizedLegendItem sizedItem = new(item, itemSize, sizedChildren); + sizedItems.Add(sizedItem); + } + + return sizedItems.ToArray(); + } + + private void RenderLegend(SizedLegendItem[] sizedItems, SKCanvas canvas, SKPaint paint, Pixel offset, PixelRect legendRect, PixelRect legendShadowRect) + { + // render the legend panel + Drawing.Fillectangle(canvas, legendShadowRect, ShadowFill.Color); + Drawing.Fillectangle(canvas, legendRect, BackgroundFill.Color); + Drawing.DrawRectangle(canvas, legendRect, OutlineStyle.Color, OutlineStyle.Width); + + // render all items inside the legend + float yOffset = offset.Y; + foreach (SizedLegendItem item in sizedItems) + { + Common.RenderItem( + canvas: canvas, + paint: paint, + sizedItem: item, + x: offset.X, + y: yOffset, + symbolWidth: SymbolWidth, + symbolPadRight: SymbolLabelSeparation, + itemPadding: ItemPadding); + + yOffset += item.Size.WithChildren.Height; + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Legends/LegendItemSize.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Legends/LegendItemSize.cs new file mode 100644 index 000000000..ab38b4619 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Legends/LegendItemSize.cs @@ -0,0 +1,14 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public struct LegendItemSize + { + public PixelSize OwnSize { get; } + public PixelSize WithChildren { get; } + + public LegendItemSize(PixelSize ownSize, PixelSize withChildren) + { + OwnSize = ownSize; + WithChildren = withChildren; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Legends/SizedLegendItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Legends/SizedLegendItem.cs new file mode 100644 index 000000000..4847b85e0 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Legends/SizedLegendItem.cs @@ -0,0 +1,16 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public struct SizedLegendItem + { + public LegendItem Item { get; } + public LegendItemSize Size { get; } + public SizedLegendItem[] Children { get; } + + public SizedLegendItem(LegendItem item, LegendItemSize size, SizedLegendItem[] children) + { + Item = item; + Size = size; + Children = children; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/Asterisk.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/Asterisk.cs new file mode 100644 index 000000000..eeb0ae687 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/Asterisk.cs @@ -0,0 +1,28 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal class Asterisk : IMarker + { + public void Render(SKCanvas canvas, SKPaint paint, Pixel center, float size, FillStyle fill, LineStyle outline) + { + float crossOffset = size / 2; + + float eksOffset = (float)(size / 2.828); + + var path = new SKPath(); + // Same as cross marker + path.MoveTo(center.X + crossOffset, center.Y); + path.LineTo(center.X - crossOffset, center.Y); + path.MoveTo(center.X, center.Y + crossOffset); + path.LineTo(center.X, center.Y - crossOffset); + + // Similar to eks (X) marker, but with length = size / 2 + path.MoveTo(center.X + eksOffset, center.Y + eksOffset); + path.LineTo(center.X - eksOffset, center.Y - eksOffset); + path.MoveTo(center.X - eksOffset, center.Y + eksOffset); + path.LineTo(center.X + eksOffset, center.Y - eksOffset); + + outline.ApplyToPaint(paint); + canvas.DrawPath(path, paint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/Circle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/Circle.cs new file mode 100644 index 000000000..94805d228 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/Circle.cs @@ -0,0 +1,19 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal class Circle : IMarker + { + public void Render(SKCanvas canvas, SKPaint paint, Pixel center, float size, FillStyle fill, LineStyle outline) + { + float radius = size / 2; + + fill.ApplyToPaint(paint); + canvas.DrawCircle(center.ToSkPoint(), radius, paint); + + if (outline.Width > 0) + { + outline.ApplyToPaint(paint); + canvas.DrawCircle(center.ToSkPoint(), radius, paint); + } + } + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/Cross.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/Cross.cs new file mode 100644 index 000000000..02b602e37 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/Cross.cs @@ -0,0 +1,19 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal class Cross : IMarker + { + public void Render(SKCanvas canvas, SKPaint paint, Pixel center, float size, FillStyle fill, LineStyle outline) + { + float offset = size / 2; + + var path = new SKPath(); + path.MoveTo(center.X + offset, center.Y); + path.LineTo(center.X - offset, center.Y); + path.MoveTo(center.X, center.Y + offset); + path.LineTo(center.X, center.Y - offset); + + outline.ApplyToPaint(paint); + canvas.DrawPath(path, paint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/Diamond.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/Diamond.cs new file mode 100644 index 000000000..33bc016b1 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/Diamond.cs @@ -0,0 +1,33 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal class Diamond : IMarker + { + public void Render(SKCanvas canvas, SKPaint paint, Pixel center, float size, FillStyle fill, LineStyle outline) + { + float offset = size / 2; + + fill.ApplyToPaint(paint); + + // 4 corners + SKPoint[] pointsList = new SKPoint[] + { + new SKPoint(center.X + offset, center.Y), + new SKPoint(center.X, center.Y + offset), + new SKPoint(center.X - offset, center.Y), + new SKPoint(center.X, center.Y - offset), + + }; + + var path = new SKPath(); + path.AddPoly(pointsList); + + canvas.DrawPath(path, paint); + + if (outline.Width > 0) + { + outline.ApplyToPaint(paint); + canvas.DrawPath(path, paint); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/Eks.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/Eks.cs new file mode 100644 index 000000000..f3fb453fd --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/Eks.cs @@ -0,0 +1,19 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal class Eks : IMarker + { + public void Render(SKCanvas canvas, SKPaint paint, Pixel center, float size, FillStyle fill, LineStyle outline) + { + float offset = size / 2; + + var path = new SKPath(); + path.MoveTo(center.X + offset, center.Y + offset); + path.LineTo(center.X - offset, center.Y - offset); + path.MoveTo(center.X - offset, center.Y + offset); + path.LineTo(center.X + offset, center.Y - offset); + + outline.ApplyToPaint(paint); + canvas.DrawPath(path, paint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/HashTag.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/HashTag.cs new file mode 100644 index 000000000..43c686268 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/HashTag.cs @@ -0,0 +1,27 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal class HashTag : IMarker + { + public void Render(SKCanvas canvas, SKPaint paint, Pixel center, float size, FillStyle fill, LineStyle outline) + { + float sixthOffset = size / 6; + float halfOffset = size / 2; + + var path = new SKPath(); + // Vertical Lines + path.MoveTo(center.X + sixthOffset, center.Y + halfOffset); + path.LineTo(center.X + sixthOffset, center.Y - halfOffset); + path.MoveTo(center.X - sixthOffset, center.Y + halfOffset); + path.LineTo(center.X - sixthOffset, center.Y - halfOffset); + + // Horizontal Lines + path.MoveTo(center.X + halfOffset, center.Y + sixthOffset); + path.LineTo(center.X - halfOffset, center.Y + sixthOffset); + path.MoveTo(center.X + halfOffset, center.Y - sixthOffset); + path.LineTo(center.X - halfOffset, center.Y - sixthOffset); + + outline.ApplyToPaint(paint); + canvas.DrawPath(path, paint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/HorizontalBar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/HorizontalBar.cs new file mode 100644 index 000000000..e909150c6 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/HorizontalBar.cs @@ -0,0 +1,17 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal class HorizontalBar : IMarker + { + public void Render(SKCanvas canvas, SKPaint paint, Pixel center, float size, FillStyle fill, LineStyle outline) + { + float offset = size / 2; + + var path = new SKPath(); + path.MoveTo(center.X + offset, center.Y); + path.LineTo(center.X - offset, center.Y); + + outline.ApplyToPaint(paint); + canvas.DrawPath(path, paint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/None.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/None.cs new file mode 100644 index 000000000..10ce46055 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/None.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal class None : IMarker + { + public void Render(SKCanvas canvas, SKPaint paint, Pixel center, float size, FillStyle fill, LineStyle outline) + { + + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/SquareMarker.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/SquareMarker.cs new file mode 100644 index 000000000..302efb1f3 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/SquareMarker.cs @@ -0,0 +1,19 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal class SquareMarker : IMarker + { + public void Render(SKCanvas canvas, SKPaint paint, Pixel center, float size, FillStyle fill, LineStyle outline) + { + PixelRect rect = new(center: center, radius: size / 2); + + fill.ApplyToPaint(paint); + canvas.DrawRect(rect.ToSkRect(), paint); + + if (outline.Width > 0) + { + outline.ApplyToPaint(paint); + canvas.DrawRect(rect.ToSkRect(), paint); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/TriDown.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/TriDown.cs new file mode 100644 index 000000000..02bdec181 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/TriDown.cs @@ -0,0 +1,28 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal class TriDown : IMarker + { + public void Render(SKCanvas canvas, SKPaint paint, Pixel center, float size, FillStyle fill, LineStyle outline) + { + // Length of each side of inscribing triangle = size + float radius = (float)(size / 1.732); // size / sqrt(3) + float xOffset = (float)(radius * 0.866); // r * sqrt(3)/2 + float yOffset = radius / 2; + + var path = new SKPath(); + + // Bottom line + path.MoveTo(center.X, center.Y); + path.LineTo(center.X, center.Y - radius); + // Left top line + path.MoveTo(center.X, center.Y); + path.LineTo(center.X - xOffset, center.Y + yOffset); + // Right top line + path.MoveTo(center.X, center.Y); + path.LineTo(center.X + xOffset, center.Y + yOffset); + + outline.ApplyToPaint(paint); + canvas.DrawPath(path, paint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/TriUp.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/TriUp.cs new file mode 100644 index 000000000..e9a49b6b2 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/TriUp.cs @@ -0,0 +1,28 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal class TriUp : IMarker + { + public void Render(SKCanvas canvas, SKPaint paint, Pixel center, float size, FillStyle fill, LineStyle outline) + { + // Length of each side of inscribing triangle = size + float radius = (float)(size / 1.732); // size / sqrt(3) + float xOffset = (float)(radius * 0.866); // r * sqrt(3)/2 + float yOffset = radius / 2; + + var path = new SKPath(); + + // Top line + path.MoveTo(center.X, center.Y); + path.LineTo(center.X, center.Y + radius); + // Left bottom line + path.MoveTo(center.X, center.Y); + path.LineTo(center.X - xOffset, center.Y - yOffset); + // Right bottom line + path.MoveTo(center.X, center.Y); + path.LineTo(center.X + xOffset, center.Y - yOffset); + + outline.ApplyToPaint(paint); + canvas.DrawPath(path, paint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/TriangleDown.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/TriangleDown.cs new file mode 100644 index 000000000..af03cc58a --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/TriangleDown.cs @@ -0,0 +1,34 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal class TriangleDown : IMarker + { + public void Render(SKCanvas canvas, SKPaint paint, Pixel center, float size, FillStyle fill, LineStyle outline) + { + // Length of each side of triangle = size + float radius = (float)(size / 1.732); // size / sqrt(3) + float xOffset = (float)(radius * 0.866); // r * sqrt(3)/2 + float yOffset = radius / 2; + + fill.ApplyToPaint(paint); + + // Bottom, right, and left vertecies + SKPoint[] pointsList = new SKPoint[] + { + new SKPoint(center.X, center.Y + radius), + new SKPoint(center.X + xOffset, center.Y - yOffset), + new SKPoint(center.X - xOffset, center.Y - yOffset), + }; + + var path = new SKPath(); + path.AddPoly(pointsList); + + canvas.DrawPath(path, paint); + + if (outline.Width > 0) + { + outline.ApplyToPaint(paint); + canvas.DrawPath(path, paint); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/TriangleUp.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/TriangleUp.cs new file mode 100644 index 000000000..4fb4da6da --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/TriangleUp.cs @@ -0,0 +1,34 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal class TriangleUp : IMarker + { + public void Render(SKCanvas canvas, SKPaint paint, Pixel center, float size, FillStyle fill, LineStyle outline) + { + // Length of each side of triangle = size + float radius = (float)(size / 1.732); // size / sqrt(3) + float xOffset = (float)(radius * 0.866); // r * sqrt(3)/2 + float yOffset = radius / 2; + + fill.ApplyToPaint(paint); + + // Top, right, and left vertices + SKPoint[] pointsList = new SKPoint[] + { + new SKPoint(center.X, center.Y - radius), + new SKPoint(center.X + xOffset, center.Y + yOffset), + new SKPoint(center.X - xOffset, center.Y + yOffset), + }; + + var path = new SKPath(); + path.AddPoly(pointsList); + + canvas.DrawPath(path, paint); + + if (outline.Width > 0) + { + outline.ApplyToPaint(paint); + canvas.DrawPath(path, paint); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/VerticalBar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/VerticalBar.cs new file mode 100644 index 000000000..4f34477f8 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Markers/VerticalBar.cs @@ -0,0 +1,17 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal class VerticalBar : IMarker + { + public void Render(SKCanvas canvas, SKPaint paint, Pixel center, float size, FillStyle fill, LineStyle outline) + { + float offset = size / 2; + + var path = new SKPath(); + path.MoveTo(center.X, center.Y + offset); + path.LineTo(center.X, center.Y - offset); + + outline.ApplyToPaint(paint); + canvas.DrawPath(path, paint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/INamedColors.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/INamedColors.cs new file mode 100644 index 000000000..0cc425523 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/INamedColors.cs @@ -0,0 +1,7 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal interface INamedColors + { + Color[] GetAllColors(); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/NamedColorsBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/NamedColorsBase.cs new file mode 100644 index 000000000..842ca6f00 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/NamedColorsBase.cs @@ -0,0 +1,8 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public abstract class NamedColorsBase : INamedColors + { + public Color[] GetAllColors() => GetType().GetMethods().Where(x => x.ReturnType == typeof(Color)) + .Select(x => x.Invoke(null, null)).Cast().ToArray(); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/WebColors.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/WebColors.cs new file mode 100644 index 000000000..0511cb09c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/WebColors.cs @@ -0,0 +1,158 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Colors defined according to W3C standard keywords + /// https://www.w3.org/wiki/CSS/Properties/color/keywords + /// + public class WebColors : NamedColorsBase + { + public static Color AliceBlue => new Color(240, 248, 255); + public static Color AntiqueWhite => new Color(250, 235, 215); + public static Color Aqua => new Color(0, 255, 255); + public static Color Aquamarine => new Color(127, 255, 212); + public static Color Azure => new Color(240, 255, 255); + public static Color Beige => new Color(245, 245, 220); + public static Color Bisque => new Color(255, 228, 196); + public static Color Black => new Color(0, 0, 0); + public static Color BlanchedAlmond => new Color(255, 235, 205); + public static Color Blue => new Color(0, 0, 255); + public static Color BlueViolet => new Color(138, 43, 226); + public static Color Brown => new Color(165, 42, 42); + public static Color BurlyWood => new Color(222, 184, 135); + public static Color CadetBlue => new Color(95, 158, 160); + public static Color Chartreuse => new Color(127, 255, 0); + public static Color Chocolate => new Color(210, 105, 30); + public static Color Coral => new Color(255, 127, 80); + public static Color CornflowerBlue => new Color(100, 149, 237); + public static Color Cornsilk => new Color(255, 248, 220); + public static Color Crimson => new Color(220, 20, 60); + public static Color Cyan => new Color(0, 255, 255); + public static Color DarkBlue => new Color(0, 0, 139); + public static Color DarkCyan => new Color(0, 139, 139); + public static Color DarkGoldenRod => new Color(184, 134, 11); + public static Color DarkGray => new Color(169, 169, 169); + public static Color DarkGrey => new Color(169, 169, 169); + public static Color DarkGreen => new Color(0, 100, 0); + public static Color DarkKhaki => new Color(189, 183, 107); + public static Color DarkMagenta => new Color(139, 0, 139); + public static Color DarkOliveGreen => new Color(85, 107, 47); + public static Color DarkOrange => new Color(255, 140, 0); + public static Color DarkOrchid => new Color(153, 50, 204); + public static Color DarkRed => new Color(139, 0, 0); + public static Color DarkSalmon => new Color(233, 150, 122); + public static Color DarkSeaGreen => new Color(143, 188, 143); + public static Color DarkSlateBlue => new Color(72, 61, 139); + public static Color DarkSlateGray => new Color(47, 79, 79); + public static Color DarkSlateGrey => new Color(47, 79, 79); + public static Color DarkTurquoise => new Color(0, 206, 209); + public static Color DarkViolet => new Color(148, 0, 211); + public static Color DeepPink => new Color(255, 20, 147); + public static Color DeepSkyBlue => new Color(0, 191, 255); + public static Color DimGray => new Color(105, 105, 105); + public static Color DimGrey => new Color(105, 105, 105); + public static Color DodgerBlue => new Color(30, 144, 255); + public static Color FireBrick => new Color(178, 34, 34); + public static Color FloralWhite => new Color(255, 250, 240); + public static Color ForestGreen => new Color(34, 139, 34); + public static Color Fuchsia => new Color(255, 0, 255); + public static Color Gainsboro => new Color(220, 220, 220); + public static Color GhostWhite => new Color(248, 248, 255); + public static Color Gold => new Color(255, 215, 0); + public static Color GoldenRod => new Color(218, 165, 32); + public static Color Gray => new Color(128, 128, 128); + public static Color Grey => new Color(128, 128, 128); + public static Color Green => new Color(0, 128, 0); + public static Color GreenYellow => new Color(173, 255, 47); + public static Color HoneyDew => new Color(240, 255, 240); + public static Color HotPink => new Color(255, 105, 180); + public static Color IndianRed => new Color(205, 92, 92); + public static Color Indigo => new Color(75, 0, 130); + public static Color Ivory => new Color(255, 255, 240); + public static Color Khaki => new Color(240, 230, 140); + public static Color Lavender => new Color(230, 230, 250); + public static Color LavenderBlush => new Color(255, 240, 245); + public static Color LawnGreen => new Color(124, 252, 0); + public static Color LemonChiffon => new Color(255, 250, 205); + public static Color LightBlue => new Color(173, 216, 230); + public static Color LightCoral => new Color(240, 128, 128); + public static Color LightCyan => new Color(224, 255, 255); + public static Color LightGoldenRodYellow => new Color(250, 250, 210); + public static Color LightGray => new Color(211, 211, 211); + public static Color LightGrey => new Color(211, 211, 211); + public static Color LightGreen => new Color(144, 238, 144); + public static Color LightPink => new Color(255, 182, 193); + public static Color LightSalmon => new Color(255, 160, 122); + public static Color LightSeaGreen => new Color(32, 178, 170); + public static Color LightSkyBlue => new Color(135, 206, 250); + public static Color LightSlateGray => new Color(119, 136, 153); + public static Color LightSlateGrey => new Color(119, 136, 153); + public static Color LightSteelBlue => new Color(176, 196, 222); + public static Color LightYellow => new Color(255, 255, 224); + public static Color Lime => new Color(0, 255, 0); + public static Color LimeGreen => new Color(50, 205, 50); + public static Color Linen => new Color(250, 240, 230); + public static Color Magenta => new Color(255, 0, 255); + public static Color Maroon => new Color(128, 0, 0); + public static Color MediumAquaMarine => new Color(102, 205, 170); + public static Color MediumBlue => new Color(0, 0, 205); + public static Color MediumOrchid => new Color(186, 85, 211); + public static Color MediumPurple => new Color(147, 112, 219); + public static Color MediumSeaGreen => new Color(60, 179, 113); + public static Color MediumSlateBlue => new Color(123, 104, 238); + public static Color MediumSpringGreen => new Color(0, 250, 154); + public static Color MediumTurquoise => new Color(72, 209, 204); + public static Color MediumVioletRed => new Color(199, 21, 133); + public static Color MidnightBlue => new Color(25, 25, 112); + public static Color MintCream => new Color(245, 255, 250); + public static Color MistyRose => new Color(255, 228, 225); + public static Color Moccasin => new Color(255, 228, 181); + public static Color NavajoWhite => new Color(255, 222, 173); + public static Color Navy => new Color(0, 0, 128); + public static Color OldLace => new Color(253, 245, 230); + public static Color Olive => new Color(128, 128, 0); + public static Color OliveDrab => new Color(107, 142, 35); + public static Color Orange => new Color(255, 165, 0); + public static Color OrangeRed => new Color(255, 69, 0); + public static Color Orchid => new Color(218, 112, 214); + public static Color PaleGoldenRod => new Color(238, 232, 170); + public static Color PaleGreen => new Color(152, 251, 152); + public static Color PaleTurquoise => new Color(175, 238, 238); + public static Color PaleVioletRed => new Color(219, 112, 147); + public static Color PapayaWhip => new Color(255, 239, 213); + public static Color PeachPuff => new Color(255, 218, 185); + public static Color Peru => new Color(205, 133, 63); + public static Color Pink => new Color(255, 192, 203); + public static Color Plum => new Color(221, 160, 221); + public static Color PowderBlue => new Color(176, 224, 230); + public static Color Purple => new Color(128, 0, 128); + public static Color RebeccaPurple => new Color(102, 51, 153); + public static Color Red => new Color(255, 0, 0); + public static Color RosyBrown => new Color(188, 143, 143); + public static Color RoyalBlue => new Color(65, 105, 225); + public static Color SaddleBrown => new Color(139, 69, 19); + public static Color Salmon => new Color(250, 128, 114); + public static Color SandyBrown => new Color(244, 164, 96); + public static Color SeaGreen => new Color(46, 139, 87); + public static Color SeaShell => new Color(255, 245, 238); + public static Color Sienna => new Color(160, 82, 45); + public static Color Silver => new Color(192, 192, 192); + public static Color SkyBlue => new Color(135, 206, 235); + public static Color SlateBlue => new Color(106, 90, 205); + public static Color SlateGray => new Color(112, 128, 144); + public static Color SlateGrey => new Color(112, 128, 144); + public static Color Snow => new Color(255, 250, 250); + public static Color SpringGreen => new Color(0, 255, 127); + public static Color SteelBlue => new Color(70, 130, 180); + public static Color Tan => new Color(210, 180, 140); + public static Color Teal => new Color(0, 128, 128); + public static Color Thistle => new Color(216, 191, 216); + public static Color Tomato => new Color(255, 99, 71); + public static Color Turquoise => new Color(64, 224, 208); + public static Color Violet => new Color(238, 130, 238); + public static Color Wheat => new Color(245, 222, 179); + public static Color White => new Color(255, 255, 255); + public static Color WhiteSmoke => new Color(245, 245, 245); + public static Color Yellow => new Color(255, 255, 0); + public static Color YellowGreen => new Color(154, 205, 50); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/WindowsClassicColors.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/WindowsClassicColors.cs new file mode 100644 index 000000000..3e50c8cdb --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/WindowsClassicColors.cs @@ -0,0 +1,34 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class WindowsClassicColors : NamedColorsBase + { + public static Color ActiveBorder => new Color(192, 192, 192); + public static Color ActiveCaption => new Color(000, 000, 128); + public static Color AppWorkspace => new Color(128, 128, 128); + public static Color Background => new Color(58, 110, 165); + public static Color ButtonFace => new Color(192, 192, 192); + public static Color ButtonHighlight => new Color(255, 255, 255); + public static Color ButtonShadow => new Color(128, 128, 128); + public static Color ButtonText => new Color(000, 000, 000); + public static Color CaptionText => new Color(255, 255, 255); + public static Color GrayText => new Color(128, 128, 128); + public static Color Highlight => new Color(000, 000, 128); + public static Color HighlightText => new Color(255, 255, 255); + public static Color InactiveBorder => new Color(192, 192, 192); + public static Color InactiveCaption => new Color(128, 128, 128); + public static Color InactiveCaptionText => new Color(192, 192, 192); + public static Color InfoBackground => new Color(255, 255, 225); + public static Color InfoText => new Color(000, 000, 000); + public static Color Menu => new Color(192, 192, 192); + public static Color MenuText => new Color(000, 000, 000); + public static Color Scrollbar => new Color(192, 192, 192); + public static Color ThreeDDarkShadow => new Color(000, 000, 000); + public static Color ThreeDFace => new Color(192, 192, 192); + public static Color ThreeDHighlight => new Color(255, 255, 255); + public static Color ThreeDLightShadow => new Color(192, 192, 192); + public static Color ThreeDShadow => new Color(128, 128, 128); + public static Color Window => new Color(255, 255, 255); + public static Color WindowFrame => new Color(000, 000, 000); + public static Color WindowText => new Color(000, 000, 000); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/WindowsStandardColors.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/WindowsStandardColors.cs new file mode 100644 index 000000000..335fef61f --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/WindowsStandardColors.cs @@ -0,0 +1,34 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class WindowsStandardColors : NamedColorsBase + { + public static Color ActiveBorder => new Color(212, 208, 200); + public static Color ActiveCaption => new Color(10, 36, 106); + public static Color AppWorkspace => new Color(128, 128, 128); + public static Color Background => new Color(58, 110, 165); + public static Color ButtonFace => new Color(212, 208, 200); + public static Color ButtonHighlight => new Color(255, 255, 255); + public static Color ButtonShadow => new Color(128, 128, 128); + public static Color ButtonText => new Color(000, 000, 000); + public static Color CaptionText => new Color(255, 255, 255); + public static Color GrayText => new Color(128, 128, 128); + public static Color Highlight => new Color(10, 36, 106); + public static Color HighlightText => new Color(255, 255, 255); + public static Color InactiveBorder => new Color(212, 208, 200); + public static Color InactiveCaption => new Color(128, 128, 128); + public static Color InactiveCaptionText => new Color(212, 208, 200); + public static Color InfoBackground => new Color(255, 255, 225); + public static Color InfoText => new Color(000, 000, 000); + public static Color Menu => new Color(212, 208, 200); + public static Color MenuText => new Color(000, 000, 000); + public static Color Scrollbar => new Color(212, 208, 200); + public static Color ThreeDDarkShadow => new Color(64, 64, 64); + public static Color ThreeDFace => new Color(212, 208, 200); + public static Color ThreeDHighlight => new Color(255, 255, 255); + public static Color ThreeDLightShadow => new Color(212, 208, 200); + public static Color ThreeDShadow => new Color(128, 128, 128); + public static Color Window => new Color(255, 255, 255); + public static Color WindowFrame => new Color(000, 000, 000); + public static Color WindowText => new Color(000, 000, 000); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/WindowsVistaColors.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/WindowsVistaColors.cs new file mode 100644 index 000000000..230fe1106 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/WindowsVistaColors.cs @@ -0,0 +1,34 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class WindowsVistaColors : NamedColorsBase + { + public static Color ActiveBorder => new Color(180, 180, 180); + public static Color ActiveCaption => new Color(153, 180, 209); + public static Color AppWorkspace => new Color(171, 171, 171); + public static Color Background => new Color(000, 000, 000); + public static Color ButtonFace => new Color(240, 240, 240); + public static Color ButtonHighlight => new Color(255, 255, 255); + public static Color ButtonShadow => new Color(160, 160, 160); + public static Color ButtonText => new Color(000, 000, 000); + public static Color CaptionText => new Color(000, 000, 000); + public static Color GrayText => new Color(128, 128, 128); + public static Color Highlight => new Color(51, 153, 255); + public static Color HighlightText => new Color(255, 255, 255); + public static Color InactiveBorder => new Color(244, 247, 252); + public static Color InactiveCaption => new Color(191, 205, 219); + public static Color InactiveCaptionText => new Color(67, 78, 84); + public static Color InfoBackground => new Color(255, 255, 225); + public static Color InfoText => new Color(000, 000, 000); + public static Color Menu => new Color(240, 240, 240); + public static Color MenuText => new Color(000, 000, 000); + public static Color Scrollbar => new Color(200, 200, 200); + public static Color ThreeDDarkShadow => new Color(105, 105, 105); + public static Color ThreeDFace => new Color(240, 240, 240); + public static Color ThreeDHighlight => new Color(255, 255, 255); + public static Color ThreeDLightShadow => new Color(227, 227, 227); + public static Color ThreeDShadow => new Color(160, 160, 160); + public static Color Window => new Color(255, 255, 255); + public static Color WindowFrame => new Color(100, 100, 100); + public static Color WindowText => new Color(000, 000, 000); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/XkcdColors.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/XkcdColors.cs new file mode 100644 index 000000000..947283428 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/NamedColors/XkcdColors.cs @@ -0,0 +1,959 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Colors defined according to results of the xkcd color name survey + /// https://xkcd.com/color/rgb/ + /// + public class XkcdColors : NamedColorsBase + { + public static Color AcidGreen => new Color(143, 254, 9); + public static Color Adobe => new Color(189, 108, 72); + public static Color Algae => new Color(84, 172, 104); + public static Color AlgaeGreen => new Color(33, 195, 111); + public static Color AlmostBlack => new Color(7, 13, 13); + public static Color Amber => new Color(254, 179, 8); + public static Color Amethyst => new Color(155, 95, 192); + public static Color Apple => new Color(110, 203, 60); + public static Color AppleGreen => new Color(118, 205, 38); + public static Color Apricot => new Color(255, 177, 109); + public static Color Aqua => new Color(19, 234, 201); + public static Color AquaBlue => new Color(2, 216, 233); + public static Color AquaGreen => new Color(18, 225, 147); + public static Color AquaMarine => new Color(46, 232, 187); + public static Color Aquamarine => new Color(4, 216, 178); + public static Color ArmyGreen => new Color(75, 93, 22); + public static Color Asparagus => new Color(119, 171, 86); + public static Color Aubergine => new Color(61, 7, 52); + public static Color Auburn => new Color(154, 48, 1); + public static Color Avocado => new Color(144, 177, 52); + public static Color AvocadoGreen => new Color(135, 169, 34); + public static Color Azul => new Color(29, 93, 236); + public static Color Azure => new Color(6, 154, 243); + public static Color BabyBlue => new Color(162, 207, 254); + public static Color BabyGreen => new Color(140, 255, 158); + public static Color BabyPink => new Color(255, 183, 206); + public static Color BabyPoo => new Color(171, 144, 4); + public static Color BabyPoop => new Color(147, 124, 0); + public static Color BabyPoopGreen => new Color(143, 152, 5); + public static Color BabyPukeGreen => new Color(182, 196, 6); + public static Color BabyPurple => new Color(202, 155, 247); + public static Color BabyShitBrown => new Color(173, 144, 13); + public static Color BabyShitGreen => new Color(136, 151, 23); + public static Color Banana => new Color(255, 255, 126); + public static Color BananaYellow => new Color(250, 254, 75); + public static Color BarbiePink => new Color(254, 70, 165); + public static Color BarfGreen => new Color(148, 172, 2); + public static Color Barney => new Color(172, 29, 184); + public static Color BarneyPurple => new Color(160, 4, 152); + public static Color BattleshipGrey => new Color(107, 124, 133); + public static Color Beige => new Color(230, 218, 166); + public static Color Berry => new Color(153, 15, 75); + public static Color Bile => new Color(181, 195, 6); + public static Color Black => new Color(0, 0, 0); + public static Color Bland => new Color(175, 168, 139); + public static Color Blood => new Color(119, 0, 1); + public static Color BloodOrange => new Color(254, 75, 3); + public static Color BloodRed => new Color(152, 0, 2); + public static Color Blue => new Color(3, 67, 223); + public static Color BlueBlue => new Color(34, 66, 199); + public static Color BlueGreen => new Color(19, 126, 109); + public static Color BlueGrey => new Color(96, 124, 142); + public static Color BluePurple => new Color(87, 41, 206); + public static Color BlueSlashGreen => new Color(15, 155, 142); + public static Color BlueSlashGrey => new Color(117, 141, 163); + public static Color BlueSlashPurple => new Color(90, 6, 239); + public static Color BlueViolet => new Color(93, 6, 233); + public static Color BlueWithAHintOfPurple => new Color(83, 60, 198); + public static Color Blueberry => new Color(70, 65, 150); + public static Color Bluegreen => new Color(1, 122, 121); + public static Color Bluegrey => new Color(133, 163, 178); + public static Color BlueyGreen => new Color(43, 177, 121); + public static Color BlueyGrey => new Color(137, 160, 176); + public static Color BlueyPurple => new Color(98, 65, 199); + public static Color Bluish => new Color(41, 118, 187); + public static Color BluishGreen => new Color(16, 166, 116); + public static Color BluishGrey => new Color(116, 139, 151); + public static Color BluishPurple => new Color(112, 59, 231); + public static Color Blurple => new Color(85, 57, 204); + public static Color Blush => new Color(242, 158, 142); + public static Color BlushPink => new Color(254, 130, 140); + public static Color Booger => new Color(155, 181, 60); + public static Color BoogerGreen => new Color(150, 180, 3); + public static Color Bordeaux => new Color(123, 0, 44); + public static Color BoringGreen => new Color(99, 179, 101); + public static Color BottleGreen => new Color(4, 74, 5); + public static Color Brick => new Color(160, 54, 35); + public static Color BrickOrange => new Color(193, 74, 9); + public static Color BrickRed => new Color(143, 20, 2); + public static Color BrightAqua => new Color(11, 249, 234); + public static Color BrightBlue => new Color(1, 101, 252); + public static Color BrightCyan => new Color(65, 253, 254); + public static Color BrightGreen => new Color(1, 255, 7); + public static Color BrightLavender => new Color(199, 96, 255); + public static Color BrightLightBlue => new Color(38, 247, 253); + public static Color BrightLightGreen => new Color(45, 254, 84); + public static Color BrightLilac => new Color(201, 94, 251); + public static Color BrightLime => new Color(135, 253, 5); + public static Color BrightLimeGreen => new Color(101, 254, 8); + public static Color BrightMagenta => new Color(255, 8, 232); + public static Color BrightOlive => new Color(156, 187, 4); + public static Color BrightOrange => new Color(255, 91, 0); + public static Color BrightPink => new Color(254, 1, 177); + public static Color BrightPurple => new Color(190, 3, 253); + public static Color BrightRed => new Color(255, 0, 13); + public static Color BrightSeaGreen => new Color(5, 255, 166); + public static Color BrightSkyBlue => new Color(2, 204, 254); + public static Color BrightTeal => new Color(1, 249, 198); + public static Color BrightTurquoise => new Color(15, 254, 249); + public static Color BrightViolet => new Color(173, 10, 253); + public static Color BrightYellow => new Color(255, 253, 1); + public static Color BrightYellowGreen => new Color(157, 255, 0); + public static Color BritishRacingGreen => new Color(5, 72, 13); + public static Color Bronze => new Color(168, 121, 0); + public static Color Brown => new Color(101, 55, 0); + public static Color BrownGreen => new Color(112, 108, 17); + public static Color BrownGrey => new Color(141, 132, 104); + public static Color BrownOrange => new Color(185, 105, 2); + public static Color BrownRed => new Color(146, 43, 5); + public static Color BrownYellow => new Color(178, 151, 5); + public static Color Brownish => new Color(156, 109, 87); + public static Color BrownishGreen => new Color(106, 110, 9); + public static Color BrownishGrey => new Color(134, 119, 95); + public static Color BrownishOrange => new Color(203, 119, 35); + public static Color BrownishPink => new Color(194, 126, 121); + public static Color BrownishPurple => new Color(118, 66, 78); + public static Color BrownishRed => new Color(158, 54, 35); + public static Color BrownishYellow => new Color(201, 176, 3); + public static Color BrownyGreen => new Color(111, 108, 10); + public static Color BrownyOrange => new Color(202, 107, 2); + public static Color Bruise => new Color(126, 64, 113); + public static Color BubbleGumPink => new Color(255, 105, 175); + public static Color Bubblegum => new Color(255, 108, 181); + public static Color BubblegumPink => new Color(254, 131, 204); + public static Color Buff => new Color(254, 246, 158); + public static Color Burgundy => new Color(97, 0, 35); + public static Color BurntOrange => new Color(192, 78, 1); + public static Color BurntRed => new Color(159, 35, 5); + public static Color BurntSiena => new Color(183, 82, 3); + public static Color BurntSienna => new Color(176, 78, 15); + public static Color BurntUmber => new Color(160, 69, 14); + public static Color BurntYellow => new Color(213, 171, 9); + public static Color Burple => new Color(104, 50, 227); + public static Color Butter => new Color(255, 255, 129); + public static Color ButterYellow => new Color(255, 253, 116); + public static Color Butterscotch => new Color(253, 177, 71); + public static Color CadetBlue => new Color(78, 116, 150); + public static Color Camel => new Color(198, 159, 89); + public static Color Camo => new Color(127, 143, 78); + public static Color CamoGreen => new Color(82, 101, 37); + public static Color CamouflageGreen => new Color(75, 97, 19); + public static Color Canary => new Color(253, 255, 99); + public static Color CanaryYellow => new Color(255, 254, 64); + public static Color CandyPink => new Color(255, 99, 233); + public static Color Caramel => new Color(175, 111, 9); + public static Color Carmine => new Color(157, 2, 22); + public static Color Carnation => new Color(253, 121, 143); + public static Color CarnationPink => new Color(255, 127, 167); + public static Color CarolinaBlue => new Color(138, 184, 254); + public static Color Celadon => new Color(190, 253, 183); + public static Color Celery => new Color(193, 253, 149); + public static Color Cement => new Color(165, 163, 145); + public static Color Cerise => new Color(222, 12, 98); + public static Color Cerulean => new Color(4, 133, 209); + public static Color CeruleanBlue => new Color(5, 110, 238); + public static Color Charcoal => new Color(52, 56, 55); + public static Color CharcoalGrey => new Color(60, 65, 66); + public static Color Chartreuse => new Color(193, 248, 10); + public static Color Cherry => new Color(207, 2, 52); + public static Color CherryRed => new Color(247, 2, 42); + public static Color Chestnut => new Color(116, 40, 2); + public static Color Chocolate => new Color(61, 28, 2); + public static Color ChocolateBrown => new Color(65, 25, 0); + public static Color Cinnamon => new Color(172, 79, 6); + public static Color Claret => new Color(104, 0, 24); + public static Color Clay => new Color(182, 106, 80); + public static Color ClayBrown => new Color(178, 113, 61); + public static Color ClearBlue => new Color(36, 122, 253); + public static Color CloudyBlue => new Color(172, 194, 217); + public static Color Cobalt => new Color(30, 72, 143); + public static Color CobaltBlue => new Color(3, 10, 167); + public static Color Cocoa => new Color(135, 95, 66); + public static Color Coffee => new Color(166, 129, 76); + public static Color CoolBlue => new Color(73, 132, 184); + public static Color CoolGreen => new Color(51, 184, 100); + public static Color CoolGrey => new Color(149, 163, 166); + public static Color Copper => new Color(182, 99, 37); + public static Color Coral => new Color(252, 90, 80); + public static Color CoralPink => new Color(255, 97, 99); + public static Color Cornflower => new Color(106, 121, 247); + public static Color CornflowerBlue => new Color(81, 112, 215); + public static Color Cranberry => new Color(158, 0, 58); + public static Color Cream => new Color(255, 255, 194); + public static Color Creme => new Color(255, 255, 182); + public static Color Crimson => new Color(140, 0, 15); + public static Color Custard => new Color(255, 253, 120); + public static Color Cyan => new Color(0, 255, 255); + public static Color Dandelion => new Color(254, 223, 8); + public static Color Dark => new Color(27, 36, 49); + public static Color DarkAqua => new Color(5, 105, 107); + public static Color DarkAquamarine => new Color(1, 115, 113); + public static Color DarkBeige => new Color(172, 147, 98); + public static Color DarkBlue => new Color(0, 3, 91); + public static Color DarkBlueGreen => new Color(0, 82, 73); + public static Color DarkBlueGrey => new Color(31, 59, 77); + public static Color DarkBrown => new Color(52, 28, 2); + public static Color DarkCoral => new Color(207, 82, 78); + public static Color DarkCream => new Color(255, 243, 154); + public static Color DarkCyan => new Color(10, 136, 138); + public static Color DarkForestGreen => new Color(0, 45, 4); + public static Color DarkFuchsia => new Color(157, 7, 89); + public static Color DarkGold => new Color(181, 148, 16); + public static Color DarkGrassGreen => new Color(56, 128, 4); + public static Color DarkGreen => new Color(3, 53, 0); + public static Color DarkGreenBlue => new Color(31, 99, 87); + public static Color DarkGrey => new Color(54, 55, 55); + public static Color DarkGreyBlue => new Color(41, 70, 91); + public static Color DarkHotPink => new Color(217, 1, 102); + public static Color DarkIndigo => new Color(31, 9, 84); + public static Color DarkKhaki => new Color(155, 143, 85); + public static Color DarkLavender => new Color(133, 103, 152); + public static Color DarkLilac => new Color(156, 109, 165); + public static Color DarkLime => new Color(132, 183, 1); + public static Color DarkLimeGreen => new Color(126, 189, 1); + public static Color DarkMagenta => new Color(150, 0, 86); + public static Color DarkMaroon => new Color(60, 0, 8); + public static Color DarkMauve => new Color(135, 76, 98); + public static Color DarkMint => new Color(72, 192, 114); + public static Color DarkMintGreen => new Color(32, 192, 115); + public static Color DarkMustard => new Color(168, 137, 5); + public static Color DarkNavy => new Color(0, 4, 53); + public static Color DarkNavyBlue => new Color(0, 2, 46); + public static Color DarkOlive => new Color(55, 62, 2); + public static Color DarkOliveGreen => new Color(60, 77, 3); + public static Color DarkOrange => new Color(198, 81, 2); + public static Color DarkPastelGreen => new Color(86, 174, 87); + public static Color DarkPeach => new Color(222, 126, 93); + public static Color DarkPeriwinkle => new Color(102, 95, 209); + public static Color DarkPink => new Color(203, 65, 107); + public static Color DarkPlum => new Color(63, 1, 44); + public static Color DarkPurple => new Color(53, 6, 62); + public static Color DarkRed => new Color(132, 0, 0); + public static Color DarkRose => new Color(181, 72, 93); + public static Color DarkRoyalBlue => new Color(2, 6, 111); + public static Color DarkSage => new Color(89, 133, 86); + public static Color DarkSalmon => new Color(200, 90, 83); + public static Color DarkSand => new Color(168, 143, 89); + public static Color DarkSeaGreen => new Color(17, 135, 93); + public static Color DarkSeafoam => new Color(31, 181, 122); + public static Color DarkSeafoamGreen => new Color(62, 175, 118); + public static Color DarkSkyBlue => new Color(68, 142, 228); + public static Color DarkSlateBlue => new Color(33, 71, 97); + public static Color DarkTan => new Color(175, 136, 74); + public static Color DarkTaupe => new Color(127, 104, 78); + public static Color DarkTeal => new Color(1, 77, 78); + public static Color DarkTurquoise => new Color(4, 92, 90); + public static Color DarkViolet => new Color(52, 1, 63); + public static Color DarkYellow => new Color(213, 182, 10); + public static Color DarkYellowGreen => new Color(114, 143, 2); + public static Color Darkblue => new Color(3, 7, 100); + public static Color Darkgreen => new Color(5, 73, 7); + public static Color DarkishBlue => new Color(1, 65, 130); + public static Color DarkishGreen => new Color(40, 124, 55); + public static Color DarkishPink => new Color(218, 70, 125); + public static Color DarkishPurple => new Color(117, 25, 115); + public static Color DarkishRed => new Color(169, 3, 8); + public static Color DeepAqua => new Color(8, 120, 127); + public static Color DeepBlue => new Color(4, 2, 115); + public static Color DeepBrown => new Color(65, 2, 0); + public static Color DeepGreen => new Color(2, 89, 15); + public static Color DeepLavender => new Color(141, 94, 183); + public static Color DeepLilac => new Color(150, 110, 189); + public static Color DeepMagenta => new Color(160, 2, 92); + public static Color DeepOrange => new Color(220, 77, 1); + public static Color DeepPink => new Color(203, 1, 98); + public static Color DeepPurple => new Color(54, 1, 63); + public static Color DeepRed => new Color(154, 2, 0); + public static Color DeepRose => new Color(199, 71, 103); + public static Color DeepSeaBlue => new Color(1, 84, 130); + public static Color DeepSkyBlue => new Color(13, 117, 248); + public static Color DeepTeal => new Color(0, 85, 90); + public static Color DeepTurquoise => new Color(1, 115, 116); + public static Color DeepViolet => new Color(73, 6, 72); + public static Color Denim => new Color(59, 99, 140); + public static Color DenimBlue => new Color(59, 91, 146); + public static Color Desert => new Color(204, 173, 96); + public static Color Diarrhea => new Color(159, 131, 3); + public static Color Dirt => new Color(138, 110, 69); + public static Color DirtBrown => new Color(131, 101, 57); + public static Color DirtyBlue => new Color(63, 130, 157); + public static Color DirtyGreen => new Color(102, 126, 44); + public static Color DirtyOrange => new Color(200, 118, 6); + public static Color DirtyPink => new Color(202, 123, 128); + public static Color DirtyPurple => new Color(115, 74, 101); + public static Color DirtyYellow => new Color(205, 197, 10); + public static Color DodgerBlue => new Color(62, 130, 252); + public static Color Drab => new Color(130, 131, 68); + public static Color DrabGreen => new Color(116, 149, 81); + public static Color DriedBlood => new Color(75, 1, 1); + public static Color DuckEggBlue => new Color(195, 251, 244); + public static Color DullBlue => new Color(73, 117, 156); + public static Color DullBrown => new Color(135, 110, 75); + public static Color DullGreen => new Color(116, 166, 98); + public static Color DullOrange => new Color(216, 134, 59); + public static Color DullPink => new Color(213, 134, 157); + public static Color DullPurple => new Color(132, 89, 126); + public static Color DullRed => new Color(187, 63, 63); + public static Color DullTeal => new Color(95, 158, 143); + public static Color DullYellow => new Color(238, 220, 91); + public static Color Dusk => new Color(78, 84, 129); + public static Color DuskBlue => new Color(38, 83, 141); + public static Color DuskyBlue => new Color(71, 95, 148); + public static Color DuskyPink => new Color(204, 122, 139); + public static Color DuskyPurple => new Color(137, 91, 123); + public static Color DuskyRose => new Color(186, 104, 115); + public static Color Dust => new Color(178, 153, 110); + public static Color DustyBlue => new Color(90, 134, 173); + public static Color DustyGreen => new Color(118, 169, 115); + public static Color DustyLavender => new Color(172, 134, 168); + public static Color DustyOrange => new Color(240, 131, 58); + public static Color DustyPink => new Color(213, 138, 148); + public static Color DustyPurple => new Color(130, 95, 135); + public static Color DustyRed => new Color(185, 72, 78); + public static Color DustyRose => new Color(192, 115, 122); + public static Color DustyTeal => new Color(76, 144, 133); + public static Color Earth => new Color(162, 101, 62); + public static Color EasterGreen => new Color(140, 253, 126); + public static Color EasterPurple => new Color(192, 113, 254); + public static Color Ecru => new Color(254, 255, 202); + public static Color EggShell => new Color(255, 252, 196); + public static Color Eggplant => new Color(56, 8, 53); + public static Color EggplantPurple => new Color(67, 5, 65); + public static Color Eggshell => new Color(255, 255, 212); + public static Color EggshellBlue => new Color(196, 255, 247); + public static Color ElectricBlue => new Color(6, 82, 255); + public static Color ElectricGreen => new Color(33, 252, 13); + public static Color ElectricLime => new Color(168, 255, 4); + public static Color ElectricPink => new Color(255, 4, 144); + public static Color ElectricPurple => new Color(170, 35, 255); + public static Color Emerald => new Color(1, 160, 73); + public static Color EmeraldGreen => new Color(2, 143, 30); + public static Color Evergreen => new Color(5, 71, 42); + public static Color FadedBlue => new Color(101, 140, 187); + public static Color FadedGreen => new Color(123, 178, 116); + public static Color FadedOrange => new Color(240, 148, 77); + public static Color FadedPink => new Color(222, 157, 172); + public static Color FadedPurple => new Color(145, 110, 153); + public static Color FadedRed => new Color(211, 73, 78); + public static Color FadedYellow => new Color(254, 255, 127); + public static Color Fawn => new Color(207, 175, 123); + public static Color Fern => new Color(99, 169, 80); + public static Color FernGreen => new Color(84, 141, 68); + public static Color FireEngineRed => new Color(254, 0, 2); + public static Color FlatBlue => new Color(60, 115, 168); + public static Color FlatGreen => new Color(105, 157, 76); + public static Color FluorescentGreen => new Color(8, 255, 8); + public static Color FluroGreen => new Color(10, 255, 2); + public static Color FoamGreen => new Color(144, 253, 169); + public static Color Forest => new Color(11, 85, 9); + public static Color ForestGreen => new Color(6, 71, 12); + public static Color ForrestGreen => new Color(21, 68, 6); + public static Color FrenchBlue => new Color(67, 107, 173); + public static Color FreshGreen => new Color(105, 216, 79); + public static Color FrogGreen => new Color(88, 188, 8); + public static Color Fuchsia => new Color(237, 13, 217); + public static Color Gold => new Color(219, 180, 12); + public static Color Golden => new Color(245, 191, 3); + public static Color GoldenBrown => new Color(178, 122, 1); + public static Color GoldenRod => new Color(249, 188, 8); + public static Color GoldenYellow => new Color(254, 198, 21); + public static Color Goldenrod => new Color(250, 194, 5); + public static Color Grape => new Color(108, 52, 97); + public static Color GrapePurple => new Color(93, 20, 81); + public static Color Grapefruit => new Color(253, 89, 86); + public static Color Grass => new Color(92, 172, 45); + public static Color GrassGreen => new Color(63, 155, 11); + public static Color GrassyGreen => new Color(65, 156, 3); + public static Color Green => new Color(21, 176, 26); + public static Color GreenApple => new Color(94, 220, 31); + public static Color GreenBlue => new Color(6, 180, 139); + public static Color GreenBrown => new Color(84, 78, 3); + public static Color GreenGrey => new Color(119, 146, 111); + public static Color GreenSlashBlue => new Color(1, 192, 141); + public static Color GreenSlashYellow => new Color(181, 206, 8); + public static Color GreenTeal => new Color(12, 181, 119); + public static Color GreenYellow => new Color(201, 255, 39); + public static Color Greenblue => new Color(35, 196, 139); + public static Color Greenish => new Color(64, 163, 104); + public static Color GreenishBeige => new Color(201, 209, 121); + public static Color GreenishBlue => new Color(11, 139, 135); + public static Color GreenishBrown => new Color(105, 97, 18); + public static Color GreenishCyan => new Color(42, 254, 183); + public static Color GreenishGrey => new Color(150, 174, 141); + public static Color GreenishTan => new Color(188, 203, 122); + public static Color GreenishTeal => new Color(50, 191, 132); + public static Color GreenishTurquoise => new Color(0, 251, 176); + public static Color GreenishYellow => new Color(205, 253, 2); + public static Color GreenyBlue => new Color(66, 179, 149); + public static Color GreenyBrown => new Color(105, 96, 6); + public static Color GreenyGrey => new Color(126, 160, 122); + public static Color GreenyYellow => new Color(198, 248, 8); + public static Color Grey => new Color(146, 149, 145); + public static Color GreyBlue => new Color(107, 139, 164); + public static Color GreyBrown => new Color(127, 112, 83); + public static Color GreyGreen => new Color(120, 155, 115); + public static Color GreyPink => new Color(195, 144, 155); + public static Color GreyPurple => new Color(130, 109, 140); + public static Color GreySlashBlue => new Color(100, 125, 142); + public static Color GreySlashGreen => new Color(134, 161, 125); + public static Color GreyTeal => new Color(94, 155, 138); + public static Color Greyblue => new Color(119, 161, 181); + public static Color Greyish => new Color(168, 164, 149); + public static Color GreyishBlue => new Color(94, 129, 157); + public static Color GreyishBrown => new Color(122, 106, 79); + public static Color GreyishGreen => new Color(130, 166, 125); + public static Color GreyishPink => new Color(200, 141, 148); + public static Color GreyishPurple => new Color(136, 113, 145); + public static Color GreyishTeal => new Color(113, 159, 145); + public static Color GrossGreen => new Color(160, 191, 22); + public static Color Gunmetal => new Color(83, 98, 103); + public static Color Hazel => new Color(142, 118, 24); + public static Color Heather => new Color(164, 132, 172); + public static Color Heliotrope => new Color(217, 79, 245); + public static Color HighlighterGreen => new Color(27, 252, 6); + public static Color HospitalGreen => new Color(155, 229, 170); + public static Color HotGreen => new Color(37, 255, 41); + public static Color HotMagenta => new Color(245, 4, 201); + public static Color HotPink => new Color(255, 2, 141); + public static Color HotPurple => new Color(203, 0, 245); + public static Color HunterGreen => new Color(11, 64, 8); + public static Color Ice => new Color(214, 255, 250); + public static Color IceBlue => new Color(215, 255, 254); + public static Color IckyGreen => new Color(143, 174, 34); + public static Color IndianRed => new Color(133, 14, 4); + public static Color Indigo => new Color(56, 2, 130); + public static Color IndigoBlue => new Color(58, 24, 177); + public static Color Iris => new Color(98, 88, 196); + public static Color IrishGreen => new Color(1, 149, 41); + public static Color Ivory => new Color(255, 255, 203); + public static Color Jade => new Color(31, 167, 116); + public static Color JadeGreen => new Color(43, 175, 106); + public static Color JungleGreen => new Color(4, 130, 67); + public static Color KelleyGreen => new Color(0, 147, 55); + public static Color KellyGreen => new Color(2, 171, 46); + public static Color KermitGreen => new Color(92, 178, 0); + public static Color KeyLime => new Color(174, 255, 110); + public static Color Khaki => new Color(170, 166, 98); + public static Color KhakiGreen => new Color(114, 134, 57); + public static Color Kiwi => new Color(156, 239, 67); + public static Color KiwiGreen => new Color(142, 229, 63); + public static Color Lavender => new Color(199, 159, 239); + public static Color LavenderBlue => new Color(139, 136, 248); + public static Color LavenderPink => new Color(221, 133, 215); + public static Color LawnGreen => new Color(77, 164, 9); + public static Color Leaf => new Color(113, 170, 52); + public static Color LeafGreen => new Color(92, 169, 4); + public static Color LeafyGreen => new Color(81, 183, 59); + public static Color Leather => new Color(172, 116, 52); + public static Color Lemon => new Color(253, 255, 82); + public static Color LemonGreen => new Color(173, 248, 2); + public static Color LemonLime => new Color(191, 254, 40); + public static Color LemonYellow => new Color(253, 255, 56); + public static Color Lichen => new Color(143, 182, 123); + public static Color LightAqua => new Color(140, 255, 219); + public static Color LightAquamarine => new Color(123, 253, 199); + public static Color LightBeige => new Color(255, 254, 182); + public static Color LightBlue => new Color(149, 208, 252); + public static Color LightBlueGreen => new Color(126, 251, 179); + public static Color LightBlueGrey => new Color(183, 201, 226); + public static Color LightBluishGreen => new Color(118, 253, 168); + public static Color LightBrightGreen => new Color(83, 254, 92); + public static Color LightBrown => new Color(173, 129, 80); + public static Color LightBurgundy => new Color(168, 65, 91); + public static Color LightCyan => new Color(172, 255, 252); + public static Color LightEggplant => new Color(137, 69, 133); + public static Color LightForestGreen => new Color(79, 145, 83); + public static Color LightGold => new Color(253, 220, 92); + public static Color LightGrassGreen => new Color(154, 247, 100); + public static Color LightGreen => new Color(150, 249, 123); + public static Color LightGreenBlue => new Color(86, 252, 162); + public static Color LightGreenishBlue => new Color(99, 247, 180); + public static Color LightGrey => new Color(216, 220, 214); + public static Color LightGreyBlue => new Color(157, 188, 212); + public static Color LightGreyGreen => new Color(183, 225, 161); + public static Color LightIndigo => new Color(109, 90, 207); + public static Color LightKhaki => new Color(230, 242, 162); + public static Color LightLavendar => new Color(239, 192, 254); + public static Color LightLavender => new Color(223, 197, 254); + public static Color LightLightBlue => new Color(202, 255, 251); + public static Color LightLightGreen => new Color(200, 255, 176); + public static Color LightLilac => new Color(237, 200, 255); + public static Color LightLime => new Color(174, 253, 108); + public static Color LightLimeGreen => new Color(185, 255, 102); + public static Color LightMagenta => new Color(250, 95, 247); + public static Color LightMaroon => new Color(162, 72, 87); + public static Color LightMauve => new Color(194, 146, 161); + public static Color LightMint => new Color(182, 255, 187); + public static Color LightMintGreen => new Color(166, 251, 178); + public static Color LightMossGreen => new Color(166, 200, 117); + public static Color LightMustard => new Color(247, 213, 96); + public static Color LightNavy => new Color(21, 80, 132); + public static Color LightNavyBlue => new Color(46, 90, 136); + public static Color LightNeonGreen => new Color(78, 253, 84); + public static Color LightOlive => new Color(172, 191, 105); + public static Color LightOliveGreen => new Color(164, 190, 92); + public static Color LightOrange => new Color(253, 170, 72); + public static Color LightPastelGreen => new Color(178, 251, 165); + public static Color LightPeaGreen => new Color(196, 254, 130); + public static Color LightPeach => new Color(255, 216, 177); + public static Color LightPeriwinkle => new Color(193, 198, 252); + public static Color LightPink => new Color(255, 209, 223); + public static Color LightPlum => new Color(157, 87, 131); + public static Color LightPurple => new Color(191, 119, 246); + public static Color LightRed => new Color(255, 71, 76); + public static Color LightRose => new Color(255, 197, 203); + public static Color LightRoyalBlue => new Color(58, 46, 254); + public static Color LightSage => new Color(188, 236, 172); + public static Color LightSalmon => new Color(254, 169, 147); + public static Color LightSeaGreen => new Color(152, 246, 176); + public static Color LightSeafoam => new Color(160, 254, 191); + public static Color LightSeafoamGreen => new Color(167, 255, 181); + public static Color LightSkyBlue => new Color(198, 252, 255); + public static Color LightTan => new Color(251, 238, 172); + public static Color LightTeal => new Color(144, 228, 193); + public static Color LightTurquoise => new Color(126, 244, 204); + public static Color LightUrple => new Color(179, 111, 246); + public static Color LightViolet => new Color(214, 180, 252); + public static Color LightYellow => new Color(255, 254, 122); + public static Color LightYellowGreen => new Color(204, 253, 127); + public static Color LightYellowishGreen => new Color(194, 255, 137); + public static Color Lightblue => new Color(123, 200, 246); + public static Color LighterGreen => new Color(117, 253, 99); + public static Color LighterPurple => new Color(165, 90, 244); + public static Color Lightgreen => new Color(118, 255, 123); + public static Color LightishBlue => new Color(61, 122, 253); + public static Color LightishGreen => new Color(97, 225, 96); + public static Color LightishPurple => new Color(165, 82, 230); + public static Color LightishRed => new Color(254, 47, 74); + public static Color Lilac => new Color(206, 162, 253); + public static Color Liliac => new Color(196, 142, 253); + public static Color Lime => new Color(170, 255, 50); + public static Color LimeGreen => new Color(137, 254, 5); + public static Color LimeYellow => new Color(208, 254, 29); + public static Color Lipstick => new Color(213, 23, 78); + public static Color LipstickRed => new Color(192, 2, 47); + public static Color MacaroniAndCheese => new Color(239, 180, 53); + public static Color Magenta => new Color(194, 0, 120); + public static Color Mahogany => new Color(74, 1, 0); + public static Color Maize => new Color(244, 208, 84); + public static Color Mango => new Color(255, 166, 43); + public static Color Manilla => new Color(255, 250, 134); + public static Color Marigold => new Color(252, 192, 6); + public static Color Marine => new Color(4, 46, 96); + public static Color MarineBlue => new Color(1, 56, 106); + public static Color Maroon => new Color(101, 0, 33); + public static Color Mauve => new Color(174, 113, 129); + public static Color MediumBlue => new Color(44, 111, 187); + public static Color MediumBrown => new Color(127, 81, 18); + public static Color MediumGreen => new Color(57, 173, 72); + public static Color MediumGrey => new Color(125, 127, 124); + public static Color MediumPink => new Color(243, 97, 150); + public static Color MediumPurple => new Color(158, 67, 162); + public static Color Melon => new Color(255, 120, 85); + public static Color Merlot => new Color(115, 0, 57); + public static Color MetallicBlue => new Color(79, 115, 142); + public static Color MidBlue => new Color(39, 106, 179); + public static Color MidGreen => new Color(80, 167, 71); + public static Color Midnight => new Color(3, 1, 45); + public static Color MidnightBlue => new Color(2, 0, 53); + public static Color MidnightPurple => new Color(40, 1, 55); + public static Color MilitaryGreen => new Color(102, 124, 62); + public static Color MilkChocolate => new Color(127, 78, 30); + public static Color Mint => new Color(159, 254, 176); + public static Color MintGreen => new Color(143, 255, 159); + public static Color MintyGreen => new Color(11, 247, 125); + public static Color Mocha => new Color(157, 118, 81); + public static Color Moss => new Color(118, 153, 88); + public static Color MossGreen => new Color(101, 139, 56); + public static Color MossyGreen => new Color(99, 139, 39); + public static Color Mud => new Color(115, 92, 18); + public static Color MudBrown => new Color(96, 70, 15); + public static Color MudGreen => new Color(96, 102, 2); + public static Color MuddyBrown => new Color(136, 104, 6); + public static Color MuddyGreen => new Color(101, 116, 50); + public static Color MuddyYellow => new Color(191, 172, 5); + public static Color Mulberry => new Color(146, 10, 78); + public static Color MurkyGreen => new Color(108, 122, 14); + public static Color Mushroom => new Color(186, 158, 136); + public static Color Mustard => new Color(206, 179, 1); + public static Color MustardBrown => new Color(172, 126, 4); + public static Color MustardGreen => new Color(168, 181, 4); + public static Color MustardYellow => new Color(210, 189, 10); + public static Color MutedBlue => new Color(59, 113, 159); + public static Color MutedGreen => new Color(95, 160, 82); + public static Color MutedPink => new Color(209, 118, 143); + public static Color MutedPurple => new Color(128, 91, 135); + public static Color NastyGreen => new Color(112, 178, 63); + public static Color Navy => new Color(1, 21, 62); + public static Color NavyBlue => new Color(0, 17, 70); + public static Color NavyGreen => new Color(53, 83, 10); + public static Color NeonBlue => new Color(4, 217, 255); + public static Color NeonGreen => new Color(12, 255, 12); + public static Color NeonPink => new Color(254, 1, 154); + public static Color NeonPurple => new Color(188, 19, 254); + public static Color NeonRed => new Color(255, 7, 58); + public static Color NeonYellow => new Color(207, 255, 4); + public static Color NiceBlue => new Color(16, 122, 176); + public static Color NightBlue => new Color(4, 3, 72); + public static Color Ocean => new Color(1, 123, 146); + public static Color OceanBlue => new Color(3, 113, 156); + public static Color OceanGreen => new Color(61, 153, 115); + public static Color Ocher => new Color(191, 155, 12); + public static Color Ochre => new Color(191, 144, 5); + public static Color Ocre => new Color(198, 156, 4); + public static Color OffBlue => new Color(86, 132, 174); + public static Color OffGreen => new Color(107, 163, 83); + public static Color OffWhite => new Color(255, 255, 228); + public static Color OffYellow => new Color(241, 243, 63); + public static Color OldPink => new Color(199, 121, 134); + public static Color OldRose => new Color(200, 127, 137); + public static Color Olive => new Color(110, 117, 14); + public static Color OliveBrown => new Color(100, 84, 3); + public static Color OliveDrab => new Color(111, 118, 50); + public static Color OliveGreen => new Color(103, 122, 4); + public static Color OliveYellow => new Color(194, 183, 9); + public static Color Orange => new Color(249, 115, 6); + public static Color OrangeBrown => new Color(190, 100, 0); + public static Color OrangePink => new Color(255, 111, 82); + public static Color OrangeRed => new Color(253, 65, 30); + public static Color OrangeYellow => new Color(255, 173, 1); + public static Color Orangeish => new Color(253, 141, 73); + public static Color Orangered => new Color(254, 66, 15); + public static Color OrangeyBrown => new Color(177, 96, 2); + public static Color OrangeyRed => new Color(250, 66, 36); + public static Color OrangeyYellow => new Color(253, 185, 21); + public static Color Orangish => new Color(252, 130, 74); + public static Color OrangishBrown => new Color(178, 95, 3); + public static Color OrangishRed => new Color(244, 54, 5); + public static Color Orchid => new Color(200, 117, 196); + public static Color Pale => new Color(255, 249, 208); + public static Color PaleAqua => new Color(184, 255, 235); + public static Color PaleBlue => new Color(208, 254, 254); + public static Color PaleBrown => new Color(177, 145, 110); + public static Color PaleCyan => new Color(183, 255, 250); + public static Color PaleGold => new Color(253, 222, 108); + public static Color PaleGreen => new Color(199, 253, 181); + public static Color PaleGrey => new Color(253, 253, 254); + public static Color PaleLavender => new Color(238, 207, 254); + public static Color PaleLightGreen => new Color(177, 252, 153); + public static Color PaleLilac => new Color(228, 203, 255); + public static Color PaleLime => new Color(190, 253, 115); + public static Color PaleLimeGreen => new Color(177, 255, 101); + public static Color PaleMagenta => new Color(215, 103, 173); + public static Color PaleMauve => new Color(254, 208, 252); + public static Color PaleOlive => new Color(185, 204, 129); + public static Color PaleOliveGreen => new Color(177, 210, 123); + public static Color PaleOrange => new Color(255, 167, 86); + public static Color PalePeach => new Color(255, 229, 173); + public static Color PalePink => new Color(255, 207, 220); + public static Color PalePurple => new Color(183, 144, 212); + public static Color PaleRed => new Color(217, 84, 77); + public static Color PaleRose => new Color(253, 193, 197); + public static Color PaleSalmon => new Color(255, 177, 154); + public static Color PaleSkyBlue => new Color(189, 246, 254); + public static Color PaleTeal => new Color(130, 203, 178); + public static Color PaleTurquoise => new Color(165, 251, 213); + public static Color PaleViolet => new Color(206, 174, 250); + public static Color PaleYellow => new Color(255, 255, 132); + public static Color Parchment => new Color(254, 252, 175); + public static Color PastelBlue => new Color(162, 191, 254); + public static Color PastelGreen => new Color(176, 255, 157); + public static Color PastelOrange => new Color(255, 150, 79); + public static Color PastelPink => new Color(255, 186, 205); + public static Color PastelPurple => new Color(202, 160, 255); + public static Color PastelRed => new Color(219, 88, 86); + public static Color PastelYellow => new Color(255, 254, 113); + public static Color Pea => new Color(164, 191, 32); + public static Color PeaGreen => new Color(142, 171, 18); + public static Color PeaSoup => new Color(146, 153, 1); + public static Color PeaSoupGreen => new Color(148, 166, 23); + public static Color Peach => new Color(255, 176, 124); + public static Color PeachyPink => new Color(255, 154, 138); + public static Color PeacockBlue => new Color(1, 103, 149); + public static Color Pear => new Color(203, 248, 95); + public static Color Periwinkle => new Color(142, 130, 254); + public static Color PeriwinkleBlue => new Color(143, 153, 251); + public static Color Perrywinkle => new Color(143, 140, 231); + public static Color Petrol => new Color(0, 95, 106); + public static Color PigPink => new Color(231, 142, 165); + public static Color Pine => new Color(43, 93, 52); + public static Color PineGreen => new Color(10, 72, 30); + public static Color Pink => new Color(255, 129, 192); + public static Color PinkPurple => new Color(219, 75, 218); + public static Color PinkRed => new Color(245, 5, 79); + public static Color PinkSlashPurple => new Color(239, 29, 231); + public static Color Pinkish => new Color(212, 106, 126); + public static Color PinkishBrown => new Color(177, 114, 97); + public static Color PinkishGrey => new Color(200, 172, 169); + public static Color PinkishOrange => new Color(255, 114, 76); + public static Color PinkishPurple => new Color(214, 72, 215); + public static Color PinkishRed => new Color(241, 12, 69); + public static Color PinkishTan => new Color(217, 155, 130); + public static Color Pinky => new Color(252, 134, 170); + public static Color PinkyPurple => new Color(201, 76, 190); + public static Color PinkyRed => new Color(252, 38, 71); + public static Color PissYellow => new Color(221, 214, 24); + public static Color Pistachio => new Color(192, 250, 139); + public static Color Plum => new Color(88, 15, 65); + public static Color PlumPurple => new Color(78, 5, 80); + public static Color PoisonGreen => new Color(64, 253, 20); + public static Color Poo => new Color(143, 115, 3); + public static Color PooBrown => new Color(136, 95, 1); + public static Color Poop => new Color(127, 94, 0); + public static Color PoopBrown => new Color(122, 89, 1); + public static Color PoopGreen => new Color(111, 124, 0); + public static Color PowderBlue => new Color(177, 209, 252); + public static Color PowderPink => new Color(255, 178, 208); + public static Color PrimaryBlue => new Color(8, 4, 249); + public static Color PrussianBlue => new Color(0, 69, 119); + public static Color Puce => new Color(165, 126, 82); + public static Color Puke => new Color(165, 165, 2); + public static Color PukeBrown => new Color(148, 119, 6); + public static Color PukeGreen => new Color(154, 174, 7); + public static Color PukeYellow => new Color(194, 190, 14); + public static Color Pumpkin => new Color(225, 119, 1); + public static Color PumpkinOrange => new Color(251, 125, 7); + public static Color PureBlue => new Color(2, 3, 226); + public static Color Purple => new Color(126, 30, 156); + public static Color PurpleBlue => new Color(99, 45, 233); + public static Color PurpleBrown => new Color(103, 58, 63); + public static Color PurpleGrey => new Color(134, 111, 133); + public static Color PurplePink => new Color(224, 63, 216); + public static Color PurpleRed => new Color(153, 1, 71); + public static Color PurpleSlashBlue => new Color(93, 33, 208); + public static Color PurpleSlashPink => new Color(215, 37, 222); + public static Color Purpleish => new Color(152, 86, 141); + public static Color PurpleishBlue => new Color(97, 64, 239); + public static Color PurpleishPink => new Color(223, 78, 200); + public static Color Purpley => new Color(135, 86, 228); + public static Color PurpleyBlue => new Color(95, 52, 231); + public static Color PurpleyGrey => new Color(148, 126, 148); + public static Color PurpleyPink => new Color(200, 60, 185); + public static Color Purplish => new Color(148, 86, 140); + public static Color PurplishBlue => new Color(96, 30, 249); + public static Color PurplishBrown => new Color(107, 66, 71); + public static Color PurplishGrey => new Color(122, 104, 127); + public static Color PurplishPink => new Color(206, 93, 174); + public static Color PurplishRed => new Color(176, 5, 75); + public static Color Purply => new Color(152, 63, 178); + public static Color PurplyBlue => new Color(102, 26, 238); + public static Color PurplyPink => new Color(240, 117, 230); + public static Color Putty => new Color(190, 174, 138); + public static Color RacingGreen => new Color(1, 70, 0); + public static Color RadioactiveGreen => new Color(44, 250, 31); + public static Color Raspberry => new Color(176, 1, 73); + public static Color RawSienna => new Color(154, 98, 0); + public static Color RawUmber => new Color(167, 94, 9); + public static Color ReallyLightBlue => new Color(212, 255, 255); + public static Color Red => new Color(229, 0, 0); + public static Color RedBrown => new Color(139, 46, 22); + public static Color RedOrange => new Color(253, 60, 6); + public static Color RedPink => new Color(250, 42, 85); + public static Color RedPurple => new Color(130, 7, 71); + public static Color RedViolet => new Color(158, 1, 104); + public static Color RedWine => new Color(140, 0, 52); + public static Color Reddish => new Color(196, 66, 64); + public static Color ReddishBrown => new Color(127, 43, 10); + public static Color ReddishGrey => new Color(153, 117, 112); + public static Color ReddishOrange => new Color(248, 72, 28); + public static Color ReddishPink => new Color(254, 44, 84); + public static Color ReddishPurple => new Color(145, 9, 81); + public static Color ReddyBrown => new Color(110, 16, 5); + public static Color RichBlue => new Color(2, 27, 249); + public static Color RichPurple => new Color(114, 0, 88); + public static Color RobinEggBlue => new Color(138, 241, 254); + public static Color RobinsEgg => new Color(109, 237, 253); + public static Color RobinsEggBlue => new Color(152, 239, 249); + public static Color Rosa => new Color(254, 134, 164); + public static Color Rose => new Color(207, 98, 117); + public static Color RosePink => new Color(247, 135, 154); + public static Color RoseRed => new Color(190, 1, 60); + public static Color RosyPink => new Color(246, 104, 142); + public static Color Rouge => new Color(171, 18, 57); + public static Color Royal => new Color(12, 23, 147); + public static Color RoyalBlue => new Color(5, 4, 170); + public static Color RoyalPurple => new Color(75, 0, 110); + public static Color Ruby => new Color(202, 1, 71); + public static Color Russet => new Color(161, 57, 5); + public static Color Rust => new Color(168, 60, 9); + public static Color RustBrown => new Color(139, 49, 3); + public static Color RustOrange => new Color(196, 85, 8); + public static Color RustRed => new Color(170, 39, 4); + public static Color RustyOrange => new Color(205, 89, 9); + public static Color RustyRed => new Color(175, 47, 13); + public static Color Saffron => new Color(254, 178, 9); + public static Color Sage => new Color(135, 174, 115); + public static Color SageGreen => new Color(136, 179, 120); + public static Color Salmon => new Color(255, 121, 108); + public static Color SalmonPink => new Color(254, 123, 124); + public static Color Sand => new Color(226, 202, 118); + public static Color SandBrown => new Color(203, 165, 96); + public static Color SandYellow => new Color(252, 225, 102); + public static Color Sandstone => new Color(201, 174, 116); + public static Color Sandy => new Color(241, 218, 122); + public static Color SandyBrown => new Color(196, 166, 97); + public static Color SandyYellow => new Color(253, 238, 115); + public static Color SapGreen => new Color(92, 139, 21); + public static Color Sapphire => new Color(33, 56, 171); + public static Color Scarlet => new Color(190, 1, 25); + public static Color Sea => new Color(60, 153, 146); + public static Color SeaBlue => new Color(4, 116, 149); + public static Color SeaGreen => new Color(83, 252, 161); + public static Color Seafoam => new Color(128, 249, 173); + public static Color SeafoamBlue => new Color(120, 209, 182); + public static Color SeafoamGreen => new Color(122, 249, 171); + public static Color Seaweed => new Color(24, 209, 123); + public static Color SeaweedGreen => new Color(53, 173, 107); + public static Color Sepia => new Color(152, 94, 43); + public static Color Shamrock => new Color(1, 180, 76); + public static Color ShamrockGreen => new Color(2, 193, 77); + public static Color Shit => new Color(127, 95, 0); + public static Color ShitBrown => new Color(123, 88, 4); + public static Color ShitGreen => new Color(117, 128, 0); + public static Color ShockingPink => new Color(254, 2, 162); + public static Color SickGreen => new Color(157, 185, 44); + public static Color SicklyGreen => new Color(148, 178, 28); + public static Color SicklyYellow => new Color(208, 228, 41); + public static Color Sienna => new Color(169, 86, 30); + public static Color Silver => new Color(197, 201, 199); + public static Color Sky => new Color(130, 202, 252); + public static Color SkyBlue => new Color(117, 187, 253); + public static Color Slate => new Color(81, 101, 114); + public static Color SlateBlue => new Color(91, 124, 153); + public static Color SlateGreen => new Color(101, 141, 109); + public static Color SlateGrey => new Color(89, 101, 109); + public static Color SlimeGreen => new Color(153, 204, 4); + public static Color Snot => new Color(172, 187, 13); + public static Color SnotGreen => new Color(157, 193, 0); + public static Color SoftBlue => new Color(100, 136, 234); + public static Color SoftGreen => new Color(111, 194, 118); + public static Color SoftPink => new Color(253, 176, 192); + public static Color SoftPurple => new Color(166, 111, 181); + public static Color Spearmint => new Color(30, 248, 118); + public static Color SpringGreen => new Color(169, 249, 113); + public static Color Spruce => new Color(10, 95, 56); + public static Color Squash => new Color(242, 171, 21); + public static Color Steel => new Color(115, 133, 149); + public static Color SteelBlue => new Color(90, 125, 154); + public static Color SteelGrey => new Color(111, 130, 138); + public static Color Stone => new Color(173, 165, 135); + public static Color StormyBlue => new Color(80, 123, 156); + public static Color Straw => new Color(252, 246, 121); + public static Color Strawberry => new Color(251, 41, 67); + public static Color StrongBlue => new Color(12, 6, 247); + public static Color StrongPink => new Color(255, 7, 137); + public static Color SunYellow => new Color(255, 223, 34); + public static Color Sunflower => new Color(255, 197, 18); + public static Color SunflowerYellow => new Color(255, 218, 3); + public static Color SunnyYellow => new Color(255, 249, 23); + public static Color SunshineYellow => new Color(255, 253, 55); + public static Color Swamp => new Color(105, 131, 57); + public static Color SwampGreen => new Color(116, 133, 0); + public static Color Tan => new Color(209, 178, 111); + public static Color TanBrown => new Color(171, 126, 76); + public static Color TanGreen => new Color(169, 190, 112); + public static Color Tangerine => new Color(255, 148, 8); + public static Color Taupe => new Color(185, 162, 129); + public static Color Tea => new Color(101, 171, 124); + public static Color TeaGreen => new Color(189, 248, 163); + public static Color Teal => new Color(2, 147, 134); + public static Color TealBlue => new Color(1, 136, 159); + public static Color TealGreen => new Color(37, 163, 111); + public static Color Tealish => new Color(36, 188, 168); + public static Color TealishGreen => new Color(12, 220, 115); + public static Color TerraCotta => new Color(201, 100, 59); + public static Color Terracota => new Color(203, 104, 67); + public static Color Terracotta => new Color(202, 102, 65); + public static Color TiffanyBlue => new Color(123, 242, 218); + public static Color Tomato => new Color(239, 64, 38); + public static Color TomatoRed => new Color(236, 45, 1); + public static Color Topaz => new Color(19, 187, 175); + public static Color Toupe => new Color(199, 172, 125); + public static Color ToxicGreen => new Color(97, 222, 42); + public static Color TreeGreen => new Color(42, 126, 25); + public static Color TrueBlue => new Color(1, 15, 204); + public static Color TrueGreen => new Color(8, 148, 4); + public static Color Turquoise => new Color(6, 194, 172); + public static Color TurquoiseBlue => new Color(6, 177, 196); + public static Color TurquoiseGreen => new Color(4, 244, 137); + public static Color TurtleGreen => new Color(117, 184, 79); + public static Color Twilight => new Color(78, 81, 139); + public static Color TwilightBlue => new Color(10, 67, 122); + public static Color UglyBlue => new Color(49, 102, 138); + public static Color UglyBrown => new Color(125, 113, 3); + public static Color UglyGreen => new Color(122, 151, 3); + public static Color UglyPink => new Color(205, 117, 132); + public static Color UglyPurple => new Color(164, 66, 160); + public static Color UglyYellow => new Color(208, 193, 1); + public static Color Ultramarine => new Color(32, 0, 177); + public static Color UltramarineBlue => new Color(24, 5, 219); + public static Color Umber => new Color(178, 100, 0); + public static Color Velvet => new Color(117, 8, 81); + public static Color Vermillion => new Color(244, 50, 12); + public static Color VeryDarkBlue => new Color(0, 1, 51); + public static Color VeryDarkBrown => new Color(29, 2, 0); + public static Color VeryDarkGreen => new Color(6, 46, 3); + public static Color VeryDarkPurple => new Color(42, 1, 52); + public static Color VeryLightBlue => new Color(213, 255, 255); + public static Color VeryLightBrown => new Color(211, 182, 131); + public static Color VeryLightGreen => new Color(209, 255, 189); + public static Color VeryLightPink => new Color(255, 244, 242); + public static Color VeryLightPurple => new Color(246, 206, 252); + public static Color VeryPaleBlue => new Color(214, 255, 254); + public static Color VeryPaleGreen => new Color(207, 253, 188); + public static Color VibrantBlue => new Color(3, 57, 248); + public static Color VibrantGreen => new Color(10, 221, 8); + public static Color VibrantPurple => new Color(173, 3, 222); + public static Color Violet => new Color(154, 14, 234); + public static Color VioletBlue => new Color(81, 10, 201); + public static Color VioletPink => new Color(251, 95, 252); + public static Color VioletRed => new Color(165, 0, 85); + public static Color Viridian => new Color(30, 145, 103); + public static Color VividBlue => new Color(21, 46, 255); + public static Color VividGreen => new Color(47, 239, 16); + public static Color VividPurple => new Color(153, 0, 250); + public static Color Vomit => new Color(162, 164, 21); + public static Color VomitGreen => new Color(137, 162, 3); + public static Color VomitYellow => new Color(199, 193, 12); + public static Color WarmBlue => new Color(75, 87, 219); + public static Color WarmBrown => new Color(150, 78, 2); + public static Color WarmGrey => new Color(151, 138, 132); + public static Color WarmPink => new Color(251, 85, 129); + public static Color WarmPurple => new Color(149, 46, 143); + public static Color WashedOutGreen => new Color(188, 245, 166); + public static Color WaterBlue => new Color(14, 135, 204); + public static Color Watermelon => new Color(253, 70, 89); + public static Color WeirdGreen => new Color(58, 229, 127); + public static Color Wheat => new Color(251, 221, 126); + public static Color White => new Color(255, 255, 255); + public static Color WindowsBlue => new Color(55, 120, 191); + public static Color Wine => new Color(128, 1, 63); + public static Color WineRed => new Color(123, 3, 35); + public static Color Wintergreen => new Color(32, 249, 134); + public static Color Wisteria => new Color(168, 125, 194); + public static Color Yellow => new Color(255, 255, 20); + public static Color YellowBrown => new Color(183, 148, 0); + public static Color YellowGreen => new Color(192, 251, 45); + public static Color YellowOchre => new Color(203, 157, 6); + public static Color YellowOrange => new Color(252, 176, 1); + public static Color YellowSlashGreen => new Color(200, 253, 61); + public static Color YellowTan => new Color(255, 227, 110); + public static Color Yellowgreen => new Color(187, 249, 15); + public static Color Yellowish => new Color(250, 238, 102); + public static Color YellowishBrown => new Color(155, 122, 1); + public static Color YellowishGreen => new Color(176, 221, 22); + public static Color YellowishOrange => new Color(255, 171, 15); + public static Color YellowishTan => new Color(252, 252, 129); + public static Color YellowyBrown => new Color(174, 139, 12); + public static Color YellowyGreen => new Color(191, 241, 40); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Amber.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Amber.cs new file mode 100644 index 000000000..52aaa4b06 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Amber.cs @@ -0,0 +1,22 @@ +/* Sourced from Material Design + * https://material.io/design/color/the-color-system.html + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Amber : IPalette + { + public string Name { get; } = "Amber"; + + public string Description { get; } = string.Empty; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#FF6F00", "#FF8F00", "#FFA000", "#FFB300", "#FFC107" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Aurora.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Aurora.cs new file mode 100644 index 000000000..958ab7c3b --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Aurora.cs @@ -0,0 +1,24 @@ +/* Sourced from Nord: + * https://github.com/arcticicestudio/nord + * https://www.nordtheme.com/docs/colors-and-palettes + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Aurora : IPalette + { + public string Name { get; } = "Aurora"; + + public string Description { get; } = "From the Nord " + + "collection of palettes: https://github.com/arcticicestudio/nord"; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#BF616A", "#D08770", "#EBCB8B", "#A3BE8C", "#B48EAD" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Building.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Building.cs new file mode 100644 index 000000000..2e801ab54 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Building.cs @@ -0,0 +1,22 @@ +/* Sourced from RefactoringUI - Building Your Color Palette: + * https://www.refactoringui.com/previews/building-your-color-palette + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Building : IPalette + { + public string Name { get; } = "Building"; + + public string Description { get; } = string.Empty; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#FF6F00", "#FF8F00", "#FFA000", "#FFB300", "#FFC107" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Category10.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Category10.cs new file mode 100644 index 000000000..8a8e671a2 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Category10.cs @@ -0,0 +1,69 @@ +// These colors were originally developed by Tableau: +// https://www.tableau.com/about/blog/2016/7/colors-upgrade-tableau-10-56782 +// +// Vega obtained permission to release this color set under a BSD license: +// https://github.com/d3/d3-scale-chromatic/pull/16 +// +// Vega placed these color values here under a BSD (3-clause) license: +// https://github.com/vega/vega/blob/af5cc1df42eb5aaf2f478d0bda69313643fe0532/docs/releases/v1.2.1/vega.js#L170-L205 +// +// ScottPlot obtained this list of colors from Vega (not Tableau) and includes them here along with a copy +// of the Vega's BSD 3-clause license. +// +// D3 also uses this default color set under a BSD (3-clause) license: +// https://github.com/d3/d3-3.x-api-reference/blob/master/Ordinal-Scales.md#category10 +// +// Matplotlib also uses this color set: +// https://github.com/matplotlib/matplotlib/blob/b34895dbfaba1293ea2ab8c35d1b2df5a246054c/lib/matplotlib/_color_data.py#L16-L28 +// + +/* +Copyright (c) 2015-2018, University of Washington Interactive Data Lab +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors +may be used to endorse or promote products derived from this software +without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Category10 : IPalette + { + public string Name { get; } = "Category 10"; + + public string Description { get; } = "A set of 10 unique colors used in " + + "many data visualization libraries such as Matplotlib, Vega, and Tableau"; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", + "#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Category20.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Category20.cs new file mode 100644 index 000000000..622e6cd80 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Category20.cs @@ -0,0 +1,71 @@ +// These colors were originally developed by Tableau: +// https://www.tableau.com/about/blog/2016/7/colors-upgrade-tableau-10-56782 +// +// Vega obtained permission to release this color set under a BSD license: +// https://github.com/d3/d3-scale-chromatic/pull/16 +// +// Vega placed these color values here under a BSD (3-clause) license: +// https://github.com/vega/vega/blob/af5cc1df42eb5aaf2f478d0bda69313643fe0532/docs/releases/v1.2.1/vega.js#L170-L205 +// +// ScottPlot obtained this list of colors from Vega (not Tableau) and includes them here along with a copy +// of the Vega's BSD 3-clause license. +// +// D3 also uses this default color set under a BSD (3-clause) license: +// https://github.com/d3/d3-3.x-api-reference/blob/master/Ordinal-Scales.md#category10 +// +// Matplotlib also uses this color set: +// https://github.com/matplotlib/matplotlib/blob/b34895dbfaba1293ea2ab8c35d1b2df5a246054c/lib/matplotlib/_color_data.py#L16-L28 +// + +/* +Copyright (c) 2015-2018, University of Washington Interactive Data Lab +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors +may be used to endorse or promote products derived from this software +without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Category20 : IPalette + { + public string Name { get; } = "Category 20"; + + public string Description { get; } = "A set of 20 unique colors used in " + + "many data visualization libraries such as Matplotlib, Vega, and Tableau"; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#1f77b4", "#aec7e8", "#ff7f0e", "#ffbb78", "#2ca02c", + "#98df8a", "#d62728", "#ff9896", "#9467bd", "#c5b0d5", + "#8c564b", "#c49c94", "#e377c2", "#f7b6d2", "#7f7f7f", + "#c7c7c7", "#bcbd22", "#dbdb8d", "#17becf", "#9edae5" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/ColorblindFriendly.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/ColorblindFriendly.cs new file mode 100644 index 000000000..e1cd1a77a --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/ColorblindFriendly.cs @@ -0,0 +1,26 @@ +/* This color palette was sourced from the examples provided in: + * Wong 2011, https://www.nature.com/articles/nmeth.1618.pdf + * This 8-color palette has good overall variability and can be + * differentiated by individuals with red-green color blindness. + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class ColorblindFriendly : IPalette + { + public string Name { get; } = "Colorblind Friendly"; + + public string Description { get; } = "A set of 8 colorblind-friendly colors " + + "from Bang Wong's Nature Methods paper https://www.nature.com/articles/nmeth.1618.pdf"; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#000000", "#E69F00", "#56B4E9", "#009E73", "#F0E442", + "#0072B2", "#D55E00", "#CC79A7" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/CustomPalette.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/CustomPalette.cs new file mode 100644 index 000000000..f252aab4a --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/CustomPalette.cs @@ -0,0 +1,27 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal class CustomPalette : IPalette + { + public Color[] Colors { get; } + + public string Name { get; } + + public string Description { get; } + + public CustomPalette(Color[] colors, string name, string description) + { + Colors = colors; + Name = name; + Description = description; + } + + public CustomPalette(string[] hex, string name, string description) + { + Colors = Color.FromHex(hex); + Name = name; + Description = description; + } + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Dark.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Dark.cs new file mode 100644 index 000000000..2a7470142 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Dark.cs @@ -0,0 +1,24 @@ +/* This a qualitative 8-color palette generated using https://colorbrewer2.org + * © Cynthia Brewer, Mark Harrower and The Pennsylvania State University + * It is is both LCD and print friendly but not blind nor photocopy friendly + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Dark : IPalette + { + public string Name { get; } = "Dark"; + + public string Description { get; } = "A qualitative 8-color palette generated using colorbrewer2.org"; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#1b9e77", "#d95f02", "#7570b3", "#e7298a", "#66a61e", + "#e6ab02", "#a6761d", "#666666" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/DarkPastel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/DarkPastel.cs new file mode 100644 index 000000000..6becbb953 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/DarkPastel.cs @@ -0,0 +1,24 @@ +/* This a qualitative 8-color palette generated using https://colorbrewer2.org + * © Cynthia Brewer, Mark Harrower and The Pennsylvania State University + * This palette is the lighter-color version of the 'Dark' palette. + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class DarkPastel : IPalette + { + public string Name { get; } = "Dark Pastel"; + + public string Description { get; } = "A qualitative 8-color palette generated using colorbrewer2.org"; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#66c2a5", "#fc8d62", "#8da0cb", "#e78ac3", "#a6d854", + "#ffd92f", "#e5c494", "#b3b3b3" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Frost.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Frost.cs new file mode 100644 index 000000000..78602e33d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Frost.cs @@ -0,0 +1,24 @@ +/* Sourced from Nord: + * https://github.com/arcticicestudio/nord + * https://www.nordtheme.com/docs/colors-and-palettes + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Frost : IPalette + { + public string Name { get; } = "Frost"; + + public string Description { get; } = "From the Nord " + + "collection of palettes: https://github.com/arcticicestudio/nord"; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#8FBCBB", "#88C0D0", "#81A1C1", "#5E81AC" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/LightOcean.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/LightOcean.cs new file mode 100644 index 000000000..fa413a2d3 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/LightOcean.cs @@ -0,0 +1,24 @@ +/* A 9-color palette by Arthurits created by a mixture of light greens, blues, and purples + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class LightOcean : IPalette + { + public string Name { get; } = "Light ocean"; + + public string Description { get; } = + "A 9-color palette by Arthurits created by a mixture of light greens, blues, and purples"; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#dfedd9", "#dbecdc", "#dbede4", + "#daeeec", "#daeef3", "#dae6f2", + "#dadef1", "#dedaee", "#e5daed" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/LightSpectrum.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/LightSpectrum.cs new file mode 100644 index 000000000..9d373c878 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/LightSpectrum.cs @@ -0,0 +1,24 @@ +/* A 9-color palette by Arthurits created by lightening the colors in the visible spectrum + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class LightSpectrum : IPalette + { + public string Name { get; } = "Light spectrum"; + + public string Description { get; } = + "A 9-color palette by Arthurits created by lightening the colors in the visible spectrum"; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#fce5e6", "#fff8e7", "#fffce8", + "#eff5e4", "#e7f2e6", "#ddf0f5", + "#e6f2fc", "#e6eaf7", "#eee0f0" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Microcharts.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Microcharts.cs new file mode 100644 index 000000000..b37a7e809 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Microcharts.cs @@ -0,0 +1,28 @@ +/* This color palette was sourced from the examples provided by Microcharts: + * https://github.com/microcharts-dotnet/Microcharts/blob/main/Sources/Microcharts.Samples/Data.cs + * At the time the license file was accessed (2021-09-02) the original work was + * released under a MIT License, Copyright (c) 2017 Aloïs Deniel. + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Microcharts : IPalette + { + public string Name { get; } = "Microcharts"; + + + public string Description { get; } = "Soft color palette sourced from " + + "the Microcharts project: https://github.com/microcharts-dotnet/Microcharts"; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#266489", "#68B9C0", "#90D585", "#F3C151", "#F37F64", + "#424856", "#8F97A4", "#DAC096", "#76846E", "#DABFAF", + "#A65B69", "#97A69D" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Nero.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Nero.cs new file mode 100644 index 000000000..02b60d188 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Nero.cs @@ -0,0 +1,20 @@ +/* no info on where this palette originated */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Nero : IPalette + { + public string Name { get; } = "Nero"; + + public string Description { get; } = string.Empty; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#013A20", "#478C5C", "#94C973", "#BACC81", "#CDD193" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Nord.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Nord.cs new file mode 100644 index 000000000..9d1983326 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Nord.cs @@ -0,0 +1,25 @@ +/* Sourced from NordConEmu: + * https://github.com/arcticicestudio/nord-conemu + * Seems to be an extended version of Aurora + * suggested background: #2e3440 + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Nord : IPalette + { + public string Name { get; } = "Nord"; + + public string Description => "From the Nord " + + "ConEmu color scheme: https://github.com/arcticicestudio/nord-conemu"; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#bf616a", "#a3be8c", "#ebcb8b", "#81a1c1", "#b48ead", "#88c0d0", "#e5e9f0" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Normal.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Normal.cs new file mode 100644 index 000000000..c62ec072e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Normal.cs @@ -0,0 +1,25 @@ +/* A color palette based on Anton Tsitsulin's 6-color palette + * http://tsitsul.in/blog/coloropt + * https://github.com/xgfs/coloropt + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Normal : IPalette + { + public string Name { get; } = "Xgfs Normal 6"; + + public string Description { get; } = "A color palette adapted from " + + "Tsitsulin's 6-color normal xgfs palette: http://tsitsul.in/blog/coloropt"; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#4053d3", "#ddb310", "#b51d14", + "#00beff", "#fb49b0", "#00b25d", "#cacaca" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/OneHalf.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/OneHalf.cs new file mode 100644 index 000000000..bbb88ce80 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/OneHalf.cs @@ -0,0 +1,23 @@ +/* Sourced from Son A. Pham's Sublime color scheme by the same name + * https://github.com/sonph/onehalf + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class OneHalf : IPalette + { + public string Name { get; } = "One Half"; + + public string Description { get; } = "A Sublime color scheme " + + "by Son A. Pham: https://github.com/sonph/onehalf"; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#383a42", "#e4564a", "#50a14f", "#c18402", "#0084bc", "#a626a4", "#0897b3" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/OneHalfDark.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/OneHalfDark.cs new file mode 100644 index 000000000..e9ab86354 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/OneHalfDark.cs @@ -0,0 +1,22 @@ +/* Sourced from Son A. Pham's Sublime color scheme by the same name + * https://github.com/sonph/onehalf + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class OneHalfDark : IPalette + { + public string Name { get; } = "One Half (Dark)"; + + public string Description { get; } = "A Sublime color scheme by Son A. Pham: https://github.com/sonph/onehalf"; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#e06c75", "#98c379", "#e5c07b", "#61aff0", "#c678dd", "#56b6c2", "#dcdfe4" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/PastelWheel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/PastelWheel.cs new file mode 100644 index 000000000..692af49c7 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/PastelWheel.cs @@ -0,0 +1,24 @@ +/* A 12-color palette based on lighter tints of the classic color wheel + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class PastelWheel : IPalette + { + public string Name { get; } = "Pastel wheel"; + + public string Description { get; } = "A 12-color palette by Arthurits created by lightening the color wheel"; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#f8c5c7", "#fadec3", "#fbf6c4", + "#e1ecc8", "#d7e8cb", "#daebd7", + "#d9eef3", "#cadbed", "#c7d2e6", + "#d4d1e5", "#e8d3e6", "#f8c7de" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Penumbra.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Penumbra.cs new file mode 100644 index 000000000..afcd2adac --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Penumbra.cs @@ -0,0 +1,24 @@ +/* Sourced from Neal McKee's Penumbra color theme: + * https://github.com/nealmckee/penumbra/blob/main/penumbra.tsv + * https://github.com/nealmckee/penumbra#accent-colour-palettes-2 + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Penumbra : IPalette + { + public string Name { get; } = "Penumbra"; + + public string Description => "A perceptually uniform color palette " + + "by Neal McKee: https://github.com/nealmckee/penumbra"; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#CB7459", "#A38F2D", "#46A473", "#00A0BE", "#7E87D6", "#BD72A8" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/PolarNight.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/PolarNight.cs new file mode 100644 index 000000000..d9bfdd1d8 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/PolarNight.cs @@ -0,0 +1,24 @@ +/* Sourced from Nord: + * https://github.com/arcticicestudio/nord + * https://www.nordtheme.com/docs/colors-and-palettes + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class PolarNight : IPalette + { + public string Name { get; } = "Polar Night"; + + public string Description { get; } = "From the " + + "Nord collection of palettes: https://github.com/arcticicestudio/nord"; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#2E3440", "#3B4252", "#434C5E", "#4C566A" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Redness.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Redness.cs new file mode 100644 index 000000000..b8a5c83e8 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Redness.cs @@ -0,0 +1,23 @@ +/* Sourced from Color Hex: + * https://www.color-hex.com/ + * https://www.color-hex.com/color-palette/616 + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Redness : IPalette + { + public string Name { get; } = "Redness"; + + public string Description { get; } = string.Empty; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#FF0000", "#FF4F00", "#FFA900", "#900303", "#FF8181" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/SnowStorm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/SnowStorm.cs new file mode 100644 index 000000000..2dae75f83 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/SnowStorm.cs @@ -0,0 +1,24 @@ +/* Sourced from Nord: + * https://github.com/arcticicestudio/nord + * https://www.nordtheme.com/docs/colors-and-palettes + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class SnowStorm : IPalette + { + public string Name { get; } = "Snow Storm"; + + public string Description { get; } = "From the " + + "Nord collection of palettes: https://github.com/arcticicestudio/nord"; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#D8DEE9", "#E5E9F0", "#ECEFF4" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/SummerSplash.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/SummerSplash.cs new file mode 100644 index 000000000..793954a68 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/SummerSplash.cs @@ -0,0 +1,24 @@ +/* This palette can be found in several places: + * https://www.canva.com/colors/color-palettes/summer-splash/ + * https://color.adobe.com/My-Color-Theme-color-theme-17257636/ + * "The Indian Ocean" on https://evening-ridge-43372.herokuapp.com/ + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class SummerSplash : IPalette + { + public string Name { get; } = "Summer Splash"; + + public string Description { get; } = string.Empty; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#05445E", "#189AB4", "#75E6DA", "#D4F1F4" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Tsitsulin.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Tsitsulin.cs new file mode 100644 index 000000000..09f5fdf56 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Palettes/Tsitsulin.cs @@ -0,0 +1,31 @@ +/* A 25-color palette based on Anton Tsitsulin's 12-color palette + * Adapted by Arthurits: https://github.com/ScottPlot/ScottPlot/pull/1318 + * http://tsitsul.in/blog/coloropt + * https://github.com/xgfs/coloropt + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Tsitsulin : IPalette + { + public string Name { get; } = "Xgfs 25"; + + public string Description { get; } = "A 25-color palette by Arthurits " + + "adapted from Tsitsulin's 12-color xgfs palette: http://tsitsul.in/blog/coloropt"; + + public Color[] Colors { get; } = Color.FromHex(_hexColors); + + private static readonly string[] _hexColors = + [ + "#ebac23", "#b80058", "#008cf9", "#006e00", "#00bbad", + "#d163e6", "#b24502", "#ff9287", "#5954d6", "#00c6f8", + "#878500", "#00a76c", + "#f6da9c", "#ff5caa", "#8accff", "#4bff4b", "#6efff4", + "#edc1f5", "#feae7c", "#ffc8c3", "#bdbbef", "#bdf2ff", + "#fffc43", "#65ffc8", + "#aaaaaa" + ]; + + public Color GetColor(int index) => Colors[index % Colors.Length]; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Panels/BoxPanel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Panels/BoxPanel.cs new file mode 100644 index 000000000..dfa98fa19 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Panels/BoxPanel.cs @@ -0,0 +1,48 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class BoxPanel : IPanel + { + public bool IsVisible { get; set; } = true; + public Edge Edge { get; set; } + public float Size { get; set; } + public bool ShowDebugInformation { get; set; } = false; + public float MinimumSize { get; set; } = 0; + public float MaximumSize { get; set; } = float.MaxValue; + + public float Measure() => IsVisible ? Size : 0; + + public BoxPanel(Edge edge, float size) + { + Edge = edge; + Size = size; + } + + public PixelRect GetPanelRect(PixelRect rect, float size, float offset) + { + if (!IsVisible) + { + return PixelRect.Zero; + } + + return Edge switch + { + Edge.Left => new SKRect(rect.Left - Size, rect.Top, Size, rect.Height).ToPixelRect(), + Edge.Right => new SKRect(rect.Right, rect.Top, Size, rect.Height).ToPixelRect(), + Edge.Bottom => new SKRect(rect.Left, rect.Bottom, rect.Width, Size).ToPixelRect(), + Edge.Top => new SKRect(rect.Left, rect.Top - Size, rect.Width, Size).ToPixelRect(), + _ => throw new NotImplementedException() + }; + } + + public void Render(RenderPack rp, float size, float offset) + { + if (!IsVisible) + { + return; + } + + PixelRect panelRect = GetPanelRect(rp.DataRect, size, offset); + Drawing.DrawRectangle(rp.Canvas, panelRect, Colors.LightGray); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Panels/ColorBar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Panels/ColorBar.cs new file mode 100644 index 000000000..352d34629 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Panels/ColorBar.cs @@ -0,0 +1,109 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class ColorBar : IPanel + { + public bool IsVisible { get; set; } = true; + + public IHasColorAxis Source { get; set; } + + public Edge Edge { get; set; } + public float Width { get; set; } = 50; + public float Margin { get; set; } = 15; + public bool ShowDebugInformation { get; set; } = false; + public float MinimumSize { get; set; } = 0; + public float MaximumSize { get; set; } = float.MaxValue; + + public ColorBar(IHasColorAxis source, Edge edge = Edge.Right) + { + Source = source; + Edge = edge; + } + + // Unfortunately the size of the axis depends on the size of the plotting window, so we just have to guess here. 2000 should be larger than most + public float Measure() => IsVisible ? Margin + GetAxis(2000).Measure() + Width : 0; + + public PixelRect GetPanelRect(PixelRect dataRect, float size, float offset) + { + if (!IsVisible) + { + return PixelRect.Zero; + } + + return Edge switch + { + Edge.Left => new SKRect(dataRect.Left - Width, dataRect.Top, dataRect.Left, dataRect.Top + dataRect.Height).ToPixelRect(), + Edge.Right => new SKRect(dataRect.Right, dataRect.Top, dataRect.Right + Width, dataRect.Top + dataRect.Height).ToPixelRect(), + Edge.Bottom => new SKRect(dataRect.Left, dataRect.Bottom, dataRect.Left + dataRect.Width, dataRect.Bottom + Width).ToPixelRect(), + Edge.Top => new SKRect(dataRect.Left, dataRect.Top - Width, dataRect.Left + dataRect.Width, dataRect.Top).ToPixelRect(), + _ => throw new NotImplementedException() + }; + } + + public void Render(RenderPack rp, float size, float offset) + { + if (!IsVisible) + { + return; + } + + using var _ = new SKAutoCanvasRestore(rp.Canvas); + + PixelRect panelRect = GetPanelRect(rp.DataRect, size, offset); + + SKPoint marginTranslation = GetTranslation(Margin); + SKPoint axisTranslation = GetTranslation(Width); + + using var bmp = GetBitmap(); + + rp.Canvas.Translate(marginTranslation); + rp.Canvas.DrawBitmap(bmp, panelRect.ToSkRect()); + + var colorbarLength = Edge.IsVertical() ? rp.DataRect.Height : rp.DataRect.Width; + var axis = GetAxis(colorbarLength); + + rp.Canvas.Translate(axisTranslation); + axis.Render(rp, size, offset); + } + + private SKPoint GetTranslation(float magnitude) => Edge switch + { + Edge.Left => new(-magnitude, 0), + Edge.Right => new(magnitude, 0), + Edge.Bottom => new(0, magnitude), + Edge.Top => new(0, -magnitude), + _ => throw new ArgumentOutOfRangeException(nameof(Edge)) + }; + + private SKBitmap GetBitmap() + { + uint[] argbs = Enumerable.Range(0, 256).Select(i => Source.Colormap.GetColor((Edge.IsVertical() ? 255 - i : i) / 255f).Argb).ToArray(); + + int bmpWidth = Edge.IsVertical() ? 1 : 256; + int bmpHeight = !Edge.IsVertical() ? 1 : 256; + + return Drawing.BitmapFromArgbs(argbs, bmpWidth, bmpHeight); + } + + private IAxis GetAxis(float length) + { + IAxis axis = Edge switch + { + Edge.Left => new LeftAxis(), + Edge.Right => new RightAxis(), + Edge.Bottom => new BottomAxis(), + Edge.Top => new TopAxis(), + _ => throw new ArgumentOutOfRangeException(nameof(Edge)) + }; + + axis.Label.Text = ""; + + var range = Source.GetRange(); + axis.Min = range.Min; + axis.Max = range.Max; + + axis.TickGenerator.Regenerate(axis.Range.ToCoordinateRange, axis.Edge, length); + + return axis; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Panels/TitlePanel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Panels/TitlePanel.cs new file mode 100644 index 000000000..5ec76fe33 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Panels/TitlePanel.cs @@ -0,0 +1,74 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class TitlePanel : IPanel + { + public bool IsVisible { get; set; } = true; + + public Edge Edge => Edge.Top; + + public bool ShowDebugInformation { get; set; } = false; + public float MinimumSize { get; set; } = 0; + public float MaximumSize { get; set; } = float.MaxValue; + + public TitlePanel() + { + Label.Rotation = 0; + } + + public Label Label { get; } = new() + { + Text = string.Empty, + FontSize = 16, + Bold = true, + Alignment = Alignment.LowerCenter, + }; + + /// + /// Extra space to add above the title text so the title does not touch the edge of the image + /// + public float VerticalPadding = 10; + + public PixelRect GetPanelRect(PixelRect dataRect, float size, float offset) + { + return new PixelRect( + left: dataRect.Left, + right: dataRect.Right, + bottom: dataRect.Top - offset, + top: dataRect.Top - offset - size); + } + + public float Measure() + { + if (!IsVisible) + { + return 0; + } + + if (string.IsNullOrWhiteSpace(Label.Text)) + { + return 0; + } + + return Label.Measure().Height + VerticalPadding; + } + + public void Render(RenderPack rp, float size, float offset) + { + if (!IsVisible) + { + return; + } + + PixelRect panelRect = GetPanelRect(rp.DataRect, size, offset); + + Pixel labelPoint = new(panelRect.HorizontalCenter, panelRect.Bottom); + + if (ShowDebugInformation) + { + Drawing.DrawDebugRectangle(rp.Canvas, panelRect, labelPoint, Label.ForeColor); + } + + Label.Render(rp.Canvas, labelPoint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Arrow.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Arrow.cs new file mode 100644 index 000000000..fdea74d6a --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Arrow.cs @@ -0,0 +1,231 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Arrow : IPlottable + { + public bool IsVisible { get; set; } = true; + public IAxes Axes { get; set; } = new Axes(); + public IEnumerable LegendItems => LegendItem.Single(Label, LineStyle); + + /// + /// Label to appear in the legend + /// + public string Label { get; set; } = string.Empty; + + /// + /// Position of the base of the arrow in coordinate units + /// + public Coordinates Base = Coordinates.Origin; + + /// + /// Position of the base of the arrowhead in coordinate units + /// + public Coordinates Tip = Coordinates.Origin; + + /// + /// Advanced styling options + /// + public readonly LineStyle LineStyle = new() { Color = Colors.Gray, Width = 2 }; + + /// + /// Color of the arrow line and arrowhead + /// + public Color Color + { + get => LineStyle.Color; + set => LineStyle.Color = value; + } + + /// + /// Thickness of the line at the base of the arrow + /// + public float LineWidth + { + get => LineStyle.Width; + set => LineStyle.Width = value; + } + + /// + /// Total width of the arrowhead in pixels + /// + public float ArrowheadWidth { get; set; } = 10; + + /// + /// Length of the arrowhead in pixels + /// + public float ArrowheadLength { get; set; } = 16; + + /// + /// The base of the arrow will be expanded away from the tip so its length is always at least this number of pixels + /// + public float MinimumLength { get; set; } = 0; + + /// + /// Back the arrow away from its tip along its axis by this many pixels + /// + public float Offset { get; set; } = 0; + + public AxisLimits GetAxisLimits() => new( + Math.Min(Base.X, Tip.X), + Math.Max(Base.X, Tip.X), + Math.Min(Base.Y, Tip.Y), + Math.Max(Base.Y, Tip.Y)); + + public void Render(RenderPack rp) + { + if (!IsVisible) + { + return; + } + + using SKPaint paint = new(); + LineStyle.ApplyToPaint(paint); + + var pxBase = Axes.GetPixel(Base); + var pxTip = Axes.GetPixel(Tip); + var dist0 = CalcDistance(ref pxTip, ref pxBase); + var dist = dist0; + + double angle; + SKPoint skptTipOffset; + + // Line + { + Pixel pxEdgeBase, pxEdgeTip; + if (dist < 1) + { + // To avoid getting incorrect angle when zooming far out, extend both base and tip to edges. + + var coordEdgeBase = Coordinates.NaN; + var coordEdgeTip = Coordinates.NaN; + + var xDif = Base.X - Tip.X; + var yDif = Base.Y - Tip.Y; + + // Dot product + var dp1 = xDif * (Axes.XAxis.Max - Axes.XAxis.Min) + yDif * (Axes.YAxis.Max - Axes.YAxis.Min); + var dp2 = xDif * (Axes.XAxis.Min - Axes.XAxis.Max) + yDif * (Axes.YAxis.Max - Axes.YAxis.Min); + + if (dp1 > 0) + { + if (dp2 > 0) // Top + { + coordEdgeBase.X = Tip.X + xDif * (Axes.YAxis.Max - Tip.Y) / yDif; + coordEdgeBase.Y = Axes.YAxis.Max; + + coordEdgeTip.X = Tip.X - xDif * (Tip.Y - Axes.YAxis.Min) / yDif; + coordEdgeTip.Y = Axes.YAxis.Min; + } + else // Right + { + coordEdgeBase.X = Axes.XAxis.Max; + coordEdgeBase.Y = Tip.Y + yDif * (Axes.XAxis.Max - Tip.X) / xDif; + + coordEdgeTip.X = Axes.XAxis.Min; + coordEdgeTip.Y = Tip.Y - yDif * (Tip.X - Axes.XAxis.Min) / xDif; + } + } + else + { + if (dp2 > 0) // Left + { + coordEdgeBase.X = Axes.XAxis.Min; + coordEdgeBase.Y = Tip.Y - yDif * (Tip.X - Axes.XAxis.Min) / xDif; + + coordEdgeTip.X = Axes.XAxis.Max; + coordEdgeTip.Y = Tip.Y + yDif * (Axes.XAxis.Max - Tip.X) / xDif; + } + else // Bottom + { + coordEdgeBase.X = Tip.X - xDif * (Tip.Y - Axes.YAxis.Min) / yDif; + coordEdgeBase.Y = Axes.YAxis.Min; + + coordEdgeTip.X = Tip.X + xDif * (Axes.YAxis.Max - Tip.Y) / yDif; + coordEdgeTip.Y = Axes.YAxis.Max; + } + } + + pxEdgeBase = Axes.GetPixel(coordEdgeBase); + pxEdgeTip = Axes.GetPixel(coordEdgeTip); + } + else + { + pxEdgeBase = pxBase; + pxEdgeTip = pxTip; + } + + angle = Math.Atan2(pxEdgeTip.Y - pxEdgeBase.Y, pxEdgeTip.X - pxEdgeBase.X); + + if (Offset == 0) + { + skptTipOffset = pxTip.ToSkPoint(); + } + else + { + skptTipOffset = Rotate(pxTip.X - Offset, pxTip.Y, pxTip.X, pxTip.Y, angle); + dist -= Offset; + } + + SKPoint skptBaseExtended; + if (dist < MinimumLength) + { + var m = MinimumLength / CalcDistance(ref pxEdgeBase, ref pxEdgeTip); + skptBaseExtended = new( + skptTipOffset.X - (pxEdgeTip.X - pxEdgeBase.X) * m, + skptTipOffset.Y - (pxEdgeTip.Y - pxEdgeBase.Y) * m); + dist = MinimumLength; + } + else + { + skptBaseExtended = pxBase.ToSkPoint(); + } + + if (dist - ArrowheadLength >= 1) + { + var skptHeadBottom = Rotate( + skptTipOffset.X - ArrowheadLength, + skptTipOffset.Y, + skptTipOffset.X, + skptTipOffset.Y, + angle); + rp.Canvas.DrawLine(skptBaseExtended, skptHeadBottom, paint); + } + } + + // Head + if (ArrowheadLength >= 1) + { + using SKPath path = new(); + path.MoveTo(skptTipOffset); + path.LineTo(Rotate( + skptTipOffset.X - ArrowheadLength - 1, + skptTipOffset.Y + ArrowheadWidth / 2, + skptTipOffset.X, + skptTipOffset.Y, + angle)); + path.LineTo(Rotate( + skptTipOffset.X - ArrowheadLength - 1, + skptTipOffset.Y - ArrowheadWidth / 2, + skptTipOffset.X, + skptTipOffset.Y, + angle)); + path.LineTo(skptTipOffset); + + paint.Style = SKPaintStyle.Fill; + rp.Canvas.DrawPath(path, paint); + } + + static float CalcDistance(ref Pixel px1, ref Pixel px2) + => (float)Math.Sqrt(Math.Pow(px1.X - px2.X, 2) + Math.Pow(px1.Y - px2.Y, 2)); + + static SKPoint Rotate(float x, float y, float xCenter, float yCenter, double angleRadians) + { + var sin = Math.Sin(angleRadians); + var cos = Math.Cos(angleRadians); + var dx = x - xCenter; + var dy = y - yCenter; + + return new SKPoint((float)(dx * cos - dy * sin + xCenter), (float)(dy * cos + dx * sin + yCenter)); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/AxisLine.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/AxisLine.cs new file mode 100644 index 000000000..a08a95e29 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/AxisLine.cs @@ -0,0 +1,85 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// An axis line is a straight vertical or horizontal line that spans the data area. + /// + public abstract class AxisLine : IPlottable, IRenderLast + { + public bool IsVisible { get; set; } = true; + + public IAxes Axes { get; set; } = new Axes(); + + public readonly Label Label = new(); + + public float FontSize + { + get => Label.FontSize; + set => Label.FontSize = value; + } + + public bool FontBold + { + get => Label.Bold; + set => Label.Bold = value; + } + + public string FontName + { + get => Label.FontName; + set => Label.FontName = value; + } + + public Color FontColor + { + get => Label.ForeColor; + set => Label.ForeColor = value; + } + + public string Text + { + get => Label.Text; + set => Label.Text = value; + } + + public LineStyle LineStyle { get; set; } = new(); + + public float LineWidth + { + get => LineStyle.Width; + set => LineStyle.Width = value; + } + + public LinePattern LinePattern + { + get => LineStyle.Pattern; + set => LineStyle.Pattern = value; + } + + public bool LabelOppositeAxis { get; set; } = false; + + public Color Color + { + get => LineStyle.Color; + set + { + LineStyle.Color = value; + Label.BackColor = value; + } + } + + public double Position { get; set; } = 0; + + public IEnumerable LegendItems => + LegendItem.Single(new LegendItem() + { + Label = Label.Text, + Line = LineStyle, + }); + + public abstract AxisLimits GetAxisLimits(); + + public abstract void Render(RenderPack rp); + + public abstract void RenderLast(RenderPack rp); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/BarPlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/BarPlot.cs new file mode 100644 index 000000000..5dd8f9815 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/BarPlot.cs @@ -0,0 +1,77 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Holds a collection of individually styled bars + /// + public class BarPlot : IPlottable + { + public bool IsVisible { get; set; } = true; + public IAxes Axes { get; set; } = new Axes(); + public string? Label { get; set; } + public IEnumerable Bars { get; set; } // TODO: bars data source + + /// + /// Apply a fill color to all bars + /// + public Color Color + { + set + { + foreach (Bar bar in Bars) + { + bar.FillColor = value; + } + } + } + + /// + /// Define orientation for all bars + /// + public bool Horizontal + { + set + { + foreach (Bar bar in Bars) + { + bar.Orientation = value + ? Orientation.Horizontal + : Orientation.Vertical; + } + } + } + + public BarPlot(Bar bar) + { + Bars = new Bar[] { bar }; + } + + public BarPlot(IEnumerable bars) + { + Bars = bars; + } + + public IEnumerable LegendItems => LegendItem.None; + + public AxisLimits GetAxisLimits() + { + ExpandingAxisLimits limits = new(); + + foreach (Bar bar in Bars) + { + limits.Expand(bar.AxisLimits); + } + + return limits.AxisLimits; + } + + public void Render(RenderPack rp) + { + using var paint = new SKPaint(); + + foreach (Bar bar in Bars) + { + bar.Render(rp, Axes, paint); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Benchmark.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Benchmark.cs new file mode 100644 index 000000000..320613358 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Benchmark.cs @@ -0,0 +1,54 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Benchmark : IPlottable + { + public bool IsVisible { get; set; } + + public IAxes Axes { get; set; } = new Axes(); + + public IEnumerable LegendItems => LegendItem.None; + + public AxisLimits GetAxisLimits() => AxisLimits.NoLimits; + + public void Render(RenderPack rp) + { + if (!IsVisible) + { + return; + } + + string message = + $"Rendered in {rp.Elapsed.TotalMilliseconds:0.000} ms ({1e3 / rp.Elapsed.TotalMilliseconds:N0} FPS)"; + + using SKPaint paint = new() + { + IsAntialias = true, + Typeface = SKTypeface.FromFamilyName("consolas") + }; + + PixelSize textSize = Drawing.MeasureString(message, paint); + float margin = 5; + SKRect textRect = new( + left: rp.DataRect.Left + margin, + top: rp.DataRect.Bottom - paint.TextSize * .9f - 5 - margin, + right: rp.DataRect.Left + 5 * 2 + textSize.Width + margin, + bottom: rp.DataRect.Bottom - margin); + + paint.Color = SKColors.Yellow; + paint.IsStroke = false; + rp.Canvas.DrawRect(textRect, paint); + + paint.Color = SKColors.Black; + paint.IsStroke = true; + rp.Canvas.DrawRect(textRect, paint); + + paint.Color = SKColors.Black; + paint.IsStroke = false; + rp.Canvas.DrawText( + text: message, + x: rp.DataRect.Left + 4 + margin, + y: rp.DataRect.Bottom - 4 - margin, + paint: paint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/BoxPlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/BoxPlot.cs new file mode 100644 index 000000000..8b1f1cd7f --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/BoxPlot.cs @@ -0,0 +1,53 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Displays 1 or more boxes all styled the same + /// + public class BoxPlot : IPlottable + { + public bool IsVisible { get; set; } = true; + public IAxes Axes { get; set; } = new Axes(); + public string Label { get; set; } = string.Empty; + public IEnumerable LegendItems => LegendItem.Single(Label, Boxes.First().Fill); + + public readonly List Boxes = new(); + + // helper methods to quickly style all boxes with common traits + public Color FillColor + { + set => Boxes.ForEach(x => x.Fill.Color = value); + } + + public Color StrokeColor + { + set => Boxes.ForEach(x => x.Stroke.Color = value); + } + + public float StrokeWidth + { + set => Boxes.ForEach(x => x.Stroke.Width = value); + } + + public AxisLimits GetAxisLimits() + { + ExpandingAxisLimits limits = new(); + + foreach (Box box in Boxes) + { + limits.Expand(box.GetAxisLimits()); + } + + return limits.AxisLimits; + } + + public void Render(RenderPack rp) + { + using SKPaint paint = new(); + + foreach (Box box in Boxes) + { + box.Render(rp, paint, Axes); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/CandlestickPlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/CandlestickPlot.cs new file mode 100644 index 000000000..bb223326a --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/CandlestickPlot.cs @@ -0,0 +1,114 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class CandlestickPlot(IOhlcSource data) : IPlottable + { + public bool IsVisible { get; set; } = true; + + public IAxes Axes { get; set; } = new Axes(); + + private readonly IOhlcSource _data = data; + + /// + /// X position of candles is sourced from the OHLC's DateTime by default. + /// If this option is enabled, X position will be an ascending integers starting at 0 with no gaps. + /// + public bool Sequential { get; set; } = false; + + /// + /// Fractional width of the candle symbol relative to its time span + /// + public double SymbolWidth = .8; + + public LineStyle RisingLineStyle { get; } = new() + { + Color = Color.FromHex("#089981"), + Width = 2, + }; + + public LineStyle FallingLineStyle { get; } = new() + { + Color = Color.FromHex("#f23645"), + Width = 2, + }; + + public FillStyle RisingFillStyle { get; } = new() + { + Color = Color.FromHex("#089981"), + }; + + public FillStyle FallingFillStyle { get; } = new() + { + Color = Color.FromHex("#f23645"), + }; + + public IEnumerable LegendItems => Enumerable.Empty(); + + public AxisLimits GetAxisLimits() + { + AxisLimits limits = _data.GetLimits(); // TODO: Data.GetSequentialLimits() + + if (Sequential) + { + limits = new AxisLimits(0, _data.GetOhlCs().Count, limits.Bottom, limits.Top); + } + + return limits; + } + + public void Render(RenderPack rp) + { + using SKPaint paint = new(); + + IList ohlcs = _data.GetOhlCs(); + for (int i = 0; i < ohlcs.Count; i++) + { + Ohlc ohlc = ohlcs[i]; + bool isRising = ohlc.Close >= ohlc.Open; + LineStyle lineStyle = isRising ? RisingLineStyle : FallingLineStyle; + FillStyle fillStlye = isRising ? RisingFillStyle : FallingFillStyle; + + float top = Axes.GetPixelY(ohlc.High); + float bottom = Axes.GetPixelY(ohlc.Low); + + float center, left, right; + if (Sequential == false) + { + center = Axes.GetPixelX(ohlc.DateTime.ToNumber()); + TimeSpan halfWidth = new((long)(ohlc.TimeSpan.Ticks * SymbolWidth / 2)); + DateTime leftTime = ohlc.DateTime - halfWidth; + DateTime rightTime = ohlc.DateTime + halfWidth; + left = Axes.GetPixelX(leftTime.ToNumber()); + right = Axes.GetPixelX(rightTime.ToNumber()); + } + else + { + center = Axes.GetPixelX(i); + left = Axes.GetPixelX(i - (float)SymbolWidth / 2); + right = Axes.GetPixelX(i + (float)SymbolWidth / 2); + } + + // do not render OHLCs off the screen + if (right < rp.DataRect.Left || left > rp.DataRect.Right) + { + continue; + } + + float open = Axes.GetPixelY(ohlc.Open); + float close = Axes.GetPixelY(ohlc.Close); + + // center line + using SKPath path = new(); + path.MoveTo(center, top); + path.LineTo(center, bottom); + + lineStyle.ApplyToPaint(paint); + rp.Canvas.DrawPath(path, paint); + + // rectangle + SKRect rect = new(left, Math.Max(open, close), right, Math.Min(open, close)); + fillStlye.ApplyToPaint(paint); + rp.Canvas.DrawRect(rect, paint); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Crosshair.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Crosshair.cs new file mode 100644 index 000000000..43e14382d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Crosshair.cs @@ -0,0 +1,51 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Crosshair : IPlottable + { + public bool IsVisible { get; set; } = true; + + public IAxes Axes { get; set; } = new Axes(); + + public IEnumerable LegendItems { get; } = Array.Empty(); + + public AxisLimits GetAxisLimits() => new(X, X, Y, Y); + + public Coordinates Position + { + get => new(X, Y); + set + { + X = value.X; + Y = value.Y; + } + } + + public double X { get; set; } + public double Y { get; set; } + + public bool VerticalLineIsVisible { get; set; } = true; + + public bool HorizontalLineIsVisible { get; set; } = true; + public readonly LineStyle LineStyle = new(); + + public void Render(RenderPack rp) + { + PixelRect dataArea = rp.Canvas.LocalClipBounds.ToPixelRect(); + Pixel px = Axes.GetPixel(Position); + + using SKPaint paint = new(); + + LineStyle.ApplyToPaint(paint); + + if (VerticalLineIsVisible) + { + rp.Canvas.DrawLine(px.X, dataArea.Top, px.X, dataArea.Bottom, paint); + } + + if (HorizontalLineIsVisible) + { + rp.Canvas.DrawLine(dataArea.Left, px.Y, dataArea.Right, px.Y, paint); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/DataLogger.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/DataLogger.cs new file mode 100644 index 000000000..9c57fc7fd --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/DataLogger.cs @@ -0,0 +1,140 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class DataLogger : IPlottable, IManagesAxisLimits + { + public bool IsVisible { get; set; } = true; + public IAxes Axes { get; set; } = ScottPlot.Axes.Default; + public DataLoggerSource Data { get; set; } = new(); + public IEnumerable LegendItems => LegendItem.None; + + public bool ManageAxisLimits { get; set; } = true; + public IAxisManager AxisManager { get; set; } = new Full(); + + public AxisLimits GetAxisLimits() => Data.GetAxisLimits(); + public LineStyle LineStyle = new(); + + public Color Color + { + get => LineStyle.Color; + set => LineStyle.Color = value; + } + + /// + /// Returns true if data has been added since the last render + /// + public bool HasNewData => Data.CountTotal != Data.CountOnLastRender; + + public void UpdateAxisLimits(Plot plot, bool force = false) + { + AxisLimits viewLimits = force ? AxisLimits.NoLimits : plot.Axes.GetLimits(Axes); + AxisLimits dataLimits = GetAxisLimits(); + AxisLimits newLimits = AxisManager.GetAxisLimits(viewLimits, dataLimits); + + DebugUtilities.WriteLine(""); + DebugUtilities.WriteLine(dataLimits); + DebugUtilities.WriteLine(newLimits); + + plot.Axes.SetLimits(newLimits); + + if (force) + { + UpdateAxisLimits(plot); + } + } + + public void Add(double y) + { + Data.Add(y); + } + + public void Add(double x, double y) + { + Data.Add(x, y); + } + + public void Add(Coordinates coordinates) + { + Data.Add(coordinates); + } + + public void Add(IReadOnlyList ys) + { + foreach (double y in ys) + { + Data.Add(y); + } + } + + public void Add(IReadOnlyList coordinates) + { + foreach (Coordinates c in coordinates) + { + Data.Add(c); + } + } + + public void Add(IReadOnlyList xs, IReadOnlyList ys) + { + if (xs.Count != ys.Count) + { + throw new ArgumentException($"{nameof(xs)} and {nameof(ys)} must have equal size"); + } + + for (int i = 0; i < xs.Count; i++) + { + Data.Add(xs[i], ys[i]); + } + } + + public void Render(RenderPack rp) + { + IEnumerable points = Data.Coordinates.Select(Axes.GetPixel); + + using SKPaint paint = new(); + Drawing.DrawLines(rp.Canvas, paint, points, LineStyle); + + Data.CountOnLastRender = Data.CountTotal; + } + + /// + /// Automatically expand the axis as needed to ensure the full dataset is visible before each render. + /// + public void ViewFull() + { + ManageAxisLimits = true; + AxisManager = new Full(); + Data.CountOnLastRender = -1; + } + + /// + /// Automatically adjust the axis limits to track the newest data as it comes in. + /// The axis limits will appear to "jump" when new data runs off the screen. + /// + public void ViewJump(double width = 1000, double paddingFraction = .5) + { + ManageAxisLimits = true; + AxisManager = new Slide() + { + Width = width, + PaddingFractionX = paddingFraction, + }; + Data.CountOnLastRender = -1; + } + + /// + /// Automatically adjust the axis limits to track the newest data as it comes in. + /// The axis limits will appear to "slide" continuously as new data is added. + /// + public void ViewSlide(double width = 1000) + { + ManageAxisLimits = true; + AxisManager = new Slide() + { + Width = width, + PaddingFractionX = 0, + }; + Data.CountOnLastRender = -1; + } + + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/DataStreamer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/DataStreamer.cs new file mode 100644 index 000000000..f003dfaae --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/DataStreamer.cs @@ -0,0 +1,154 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class DataStreamer : IPlottable, IManagesAxisLimits + { + public bool IsVisible { get; set; } = true; + public IAxes Axes { get; set; } = ScottPlot.Axes.Default; + public IEnumerable LegendItems => LegendItem.None; + + public readonly LineStyle LineStyle = new(); + + public Color Color + { + get => LineStyle.Color; + set => LineStyle.Color = value; + } + + public DataStreamerSource Data { get; set; } + + public double Period + { + get => Data.SamplePeriod; + set => Data.SamplePeriod = value; + } + + /// + /// Returns true if data has been added since the last render + /// + public bool HasNewData => Data.CountTotal != Data.CountTotalOnLastRender; + + /// + /// If enabled, axis limits will be adjusted automatically if new data runs off the screen. + /// + public bool ManageAxisLimits { get; set; } = true; + + /// + /// Contains logic for automatically adjusting axis limits if new data runs off the screen. + /// Only used if is true. + /// + private IAxisManager AxisManager { get; set; } = new FixedWidth(); + + /// + /// Used to obtain the current axis limits so can adjust them if needed. + /// + private readonly Plot _plot; + + /// + /// Logic for displaying the fixed-length Y values in + /// + public IDataStreamerView Renderer { get; set; } + + public DataStreamer(Plot plot, double[] data) + { + _plot = plot; + Data = new DataStreamerSource(data); + Renderer = new Wipe(this, true); + } + + /// + /// Shift in a new Y value + /// + public void Add(double value) + { + Data.Add(value); + } + + /// + /// Shift in a collection of new Y values + /// + public void AddRange(IEnumerable values) + { + Data.AddRange(values); + } + + /// + /// Clear the buffer by setting all Y points to the given value + /// + public void Clear(double value = 0) + { + Data.Clear(value); + } + + /// + /// Display the data using a view where new data overlapps old data from left to right. + /// + public void ViewWipeRight() + { + Renderer = new Wipe(this, true); + } + + /// + /// Display the data using a view where new data overlapps old data from right to left. + /// + public void ViewWipeLeft() + { + Renderer = new Wipe(this, false); + } + + /// + /// Display the data using a view that continuously shifts data to the left, placing the newest data on the right. + /// + public void ViewScrollLeft() + { + Renderer = new Scroll(this, true); + } + + /// + /// Display the data using a view that continuously shifts data to the right, placing the newest data on the left. + /// + public void ViewScrollRight() + { + Renderer = new Scroll(this, false); + } + + /* + // TODO: slide axes + /// + /// Display the data using a view that continuously shifts data to the left, + /// placing the newest data on the right, and sliding the horizontal axis + /// to track the latest data coming in. + /// + public void ViewSlideLeft() + { + Renderer = new DataViews.Scroll(this, true); + } + */ + + /// + /// Display the data using a custom rendering function + /// + public void ViewCustom(IDataStreamerView view) + { + Renderer = view; + } + + public AxisLimits GetAxisLimits() + { + return Data.GetAxisLimits(); + } + + public void UpdateAxisLimits(Plot plot, bool force = false) + { + AxisLimits limits = _plot.Axes.GetLimits(Axes); + AxisLimits dataLimits = Data.GetAxisLimits(); + AxisLimits newLimits = AxisManager.GetAxisLimits(limits, dataLimits); + _plot.Axes.SetLimits(newLimits); + } + + public void Render(RenderPack rp) + { + Renderer.Render(rp); + Data.CountTotalOnLastRender = Data.CountTotal; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/ErrorBar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/ErrorBar.cs new file mode 100644 index 000000000..b31066d6c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/ErrorBar.cs @@ -0,0 +1,108 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class ErrorBar : IPlottable + { + // TODO: use an errorbar source instead of so many lists + + public bool IsVisible { get; set; } = true; + public IAxes Axes { get; set; } = new Axes(); + + public IReadOnlyList Xs { get; set; } + public IReadOnlyList Ys { get; set; } + public IReadOnlyList? XErrorPositive { get; set; } + public IReadOnlyList? XErrorNegative { get; set; } + public IReadOnlyList? YErrorPositive { get; set; } + public IReadOnlyList? YErrorNegative { get; set; } + + public LineStyle LineStyle { get; set; } = new(); + public float CapSize { get; set; } = 3; + public Color Color + { + get => LineStyle.Color; + set => LineStyle.Color = value; + } + + public ErrorBar(IReadOnlyList xs, IReadOnlyList ys, IReadOnlyList? xErrorsPositive, IReadOnlyList? xErrorsNegative, IReadOnlyList? yErrorsPositive, IReadOnlyList? yErrorsNegative) + { + Xs = xs; + Ys = ys; + XErrorPositive = xErrorsPositive; + XErrorNegative = xErrorsNegative; + YErrorPositive = yErrorsPositive; + YErrorNegative = yErrorsNegative; + } + + public IEnumerable LegendItems => Enumerable.Empty(); + + public AxisLimits GetAxisLimits() + { + ExpandingAxisLimits limits = new(); + + for (int i = 0; i < Xs.Count; i++) + { + double xMin = XErrorNegative is null ? Xs[i] : Xs[i] - XErrorNegative[i]; + double xMax = XErrorPositive is null ? Xs[i] : Xs[i] + XErrorPositive[i]; + double yMin = YErrorNegative is null ? Ys[i] : Ys[i] - YErrorNegative[i]; + double yMax = YErrorPositive is null ? Ys[i] : Ys[i] + YErrorPositive[i]; + + limits.ExpandX(xMin); + limits.ExpandX(xMax); + limits.ExpandY(yMin); + limits.ExpandY(yMax); + } + + return limits.AxisLimits; + } + + public void Render(RenderPack rp) + { + RenderErrorBars(rp.Canvas, Xs, Ys, YErrorPositive, YErrorNegative); + RenderErrorBars(rp.Canvas, Ys, Xs, XErrorPositive, XErrorNegative, true); + } + + private void RenderErrorBars(SKCanvas canvas, IReadOnlyList positions, IReadOnlyList vals, IReadOnlyList? errorPositive, IReadOnlyList? errorNegative, bool horizontal = false) + { + using SKPaint paint = new(); + using SKPath path = new(); + + LineStyle.ApplyToPaint(paint); + + for (int i = 0; i < vals.Count; i++) + { + double bottom = vals[i] - (errorNegative?[i] ?? 0); + double top = vals[i] + (errorPositive?[i] ?? 0); + + if (bottom == top && bottom == vals[i]) + { + continue; + } + + Coordinates centreBottom = horizontal ? new Coordinates(bottom, positions[i]) : new Coordinates(positions[i], bottom); + Coordinates centreTop = horizontal ? new Coordinates(top, positions[i]) : new Coordinates(positions[i], top); + + + Pixel capOffset = horizontal ? new(0, CapSize) : new(CapSize, 0); + + Pixel centreBottomPx = Axes.GetPixel(centreBottom); + Pixel leftBottomPx = centreBottomPx - capOffset; + Pixel rightBottomPx = centreBottomPx + capOffset; + + Pixel centreTopPx = Axes.GetPixel(centreTop); + Pixel leftTopPx = centreTopPx - capOffset; + Pixel rightTopPx = centreTopPx + capOffset; + + path.MoveTo(leftBottomPx.ToSkPoint()); + path.LineTo(rightBottomPx.ToSkPoint()); + + path.MoveTo(centreBottomPx.ToSkPoint()); + path.LineTo(centreTopPx.ToSkPoint()); + + path.MoveTo(leftTopPx.ToSkPoint()); + path.LineTo(rightTopPx.ToSkPoint()); + + } + + canvas.DrawPath(path, paint); + } + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/FillY.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/FillY.cs new file mode 100644 index 000000000..07819a094 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/FillY.cs @@ -0,0 +1,109 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class FillY : IPlottable + { + public string? Label { get; set; } + public bool IsVisible { get; set; } = true; + + public IAxes Axes + { + get => Poly.Axes; + set => Poly.Axes = value; + } + + public IEnumerable LegendItems => EnumerableExtensions.One( + new LegendItem + { + Label = Label, + Marker = MarkerStyle, + Line = new LineStyle() { Width = 10, Color = FillStyle.Color }, + }); + + private Polygon Poly { get; set; } = Polygon.Empty; + + public FillStyle FillStyle => Poly.FillStyle; + + public LineStyle LineStyle => Poly.LineStyle; + + public MarkerStyle MarkerStyle => Poly.MarkerStyle; + + /// + /// Creates an empty RangePlot plot, call SetDataSource() to set the coordinates. + /// + public FillY() + { + + } + + /// + /// Creates a RangePlot plot from two scatter plots. + /// + /// + /// + public FillY(Scatter scatter1, Scatter scatter2) + { + var data1 = scatter1.Data.GetScatterPoints(); + var data2 = scatter2.Data.GetScatterPoints(); + + var data = data1.Concat(data2.Reverse()).ToArray(); + + Poly = new Polygon(data); + } + + public void SetDataSource(ICollection<(double X, double Top, double Bottom)> items) + { + Coordinates[] all = new Coordinates[items.Count * 2]; + + int i = 0; + foreach (var item in items) + { + Coordinates top = new Coordinates(item.X, item.Top); + Coordinates bottom = new Coordinates(item.X, item.Bottom); + + all[i] = bottom; + all[items.Count + (items.Count - 1 - i)] = top; + + i++; + } + + Poly = new Polygon(all); + } + + public void SetDataSource(ICollection items, + Func coordinateSolver) + { + Coordinates[] all = new Coordinates[items.Count * 2]; + + int i = 0; + foreach (var item in items) + { + var coords = coordinateSolver(item); + + Coordinates top = new Coordinates(coords.X, coords.Top); + Coordinates bottom = new Coordinates(coords.X, coords.Bottom); + + all[i] = bottom; + all[items.Count + (items.Count - 1 - i)] = top; + + i++; + } + + Poly = new Polygon(all); + } + + public AxisLimits GetAxisLimits() + { + if (Poly is null) + { + return AxisLimits.NoLimits; + } + + return Poly.GetAxisLimits(); + } + + public void Render(RenderPack rp) + { + Poly.Render(rp); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/FunctionPlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/FunctionPlot.cs new file mode 100644 index 000000000..b5f2cfa96 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/FunctionPlot.cs @@ -0,0 +1,81 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class FunctionPlot : IPlottable + { + public bool IsVisible { get; set; } = true; + public IAxes Axes { get; set; } = new Axes(); + + /// + /// Default horizontal range to use when autoscaling + /// + public CoordinateRange XRange { get; set; } = new(-10, 10); + + public string? Label { get; set; } + public LineStyle LineStyle { get; } = new(); + IFunctionSource Source { get; set; } + AxisLimits LastRenderLimits { get; set; } = AxisLimits.NoLimits; + + public FunctionPlot(IFunctionSource source) + { + Source = source; + } + + private double MinX => Math.Min(Source.RangeX.Min.FiniteCoallesce(Axes.XAxis.Min), Axes.XAxis.Min); + private double MaxX => Math.Max(Source.RangeX.Max.FiniteCoallesce(Axes.XAxis.Max), Axes.XAxis.Max); + + public IEnumerable LegendItems => EnumerableExtensions.One( + new LegendItem + { + Label = Label, + Marker = MarkerStyle.None, + Line = LineStyle, + }); + + public AxisLimits GetAxisLimits() + { + return LastRenderLimits; + } + + public void Render(RenderPack rp) + { + var unitsPerPixel = Axes.XAxis.GetCoordinateDistance(1, rp.DataRect); + + double max = double.MinValue; + double min = double.MaxValue; + + using SKPath path = new(); + bool penIsDown = false; + for (double x = MinX; x <= MaxX; x += unitsPerPixel) + { + double y = Source.Get(x); + if (y.IsInfiniteOrNaN()) + { + penIsDown = false; // Picking up pen allows us to skip over regions where the function is undefined + continue; + } + + max = Math.Max(max, y); + min = Math.Min(min, y); + + Pixel px = Axes.GetPixel(new(x, y)); + + if (penIsDown) + { + path.LineTo(px.ToSkPoint()); + } + else + { + path.MoveTo(px.ToSkPoint()); + penIsDown = true; + } + } + + using SKPaint paint = new(); + LineStyle.ApplyToPaint(paint); + + rp.Canvas.DrawPath(path, paint); + + LastRenderLimits = new AxisLimits(XRange.Min, XRange.Max, min, max); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Heatmap.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Heatmap.cs new file mode 100644 index 000000000..2b811b426 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Heatmap.cs @@ -0,0 +1,200 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Heatmap : IPlottable, IHasColorAxis + { + public bool IsVisible { get; set; } = true; + public IAxes Axes { get; set; } = new Axes(); + public IColormap Colormap { get; set; } = new Viridis(); + + /// + /// Indicates position of the data point relative to the rectangle used to represent it. + /// An alignment of upper right means the rectangle will appear to the lower left of the point itself. + /// + public Alignment CellAlignment { get; set; } = Alignment.MiddleCenter; + + /// + /// If defined, the this rectangle sets the axis boundaries of heatmap data. + /// Note that the actual heatmap area is 1 cell larger than this rectangle. + /// + public CoordinateRect? Extent { get; set; } + + /// + /// This variable controls whether row 0 of the 2D source array is the top or bottom of the heatmap. + /// When set to false (default), row 0 is the top of the heatmap. + /// When set to true, row 0 of the source data will be displayed at the bottom. + /// + public bool FlipVertically { get; set; } = false; + + /// + /// If true, pixels in the final image will be interpolated to give the heatmap a smooth appearance. + /// If false, the heatmap will appear as individual rectangles with sharp edges. + /// + public bool Smooth { get; set; } = false; + + /// + /// Actual extent of the heatmap bitmap after alignment has been applied + /// + private CoordinateRect AlignedExtent + { + get + { + double x = CellWidth * CellAlignment.HorizontalFraction(); + double y = CellWidth * CellAlignment.VerticalFraction(); + Coordinates cellOffset = new(-x, -y); + return ExtentOrDefault.WithTranslation(cellOffset); + } + } + + /// + /// Extent used at render time. + /// Supplies the user-provided extent if available, + /// otherwise a heatmap centered at the origin with cell size 1. + /// + private CoordinateRect ExtentOrDefault + { + get + { + if (Extent.HasValue) + { + return Extent.Value; + } + + return new CoordinateRect( + left: 0, + right: Intensities.GetLength(1), + bottom: 0, + top: Intensities.GetLength(0)); + } + } + + /// + /// Width of a single cell from the heatmap (in coordinate units) + /// + private double CellWidth => ExtentOrDefault.Width / Intensities.GetLength(1); + + /// + /// Height of a single cell from the heatmap (in coordinate units) + /// + private double CellHeight => ExtentOrDefault.Height / Intensities.GetLength(0); + + /// + /// This object holds data values for the heatmap. + /// After editing contents users must call before changes + /// appear on the heatmap. + /// + public readonly double[,] Intensities; + + /// + /// Height of the heatmap data (rows) + /// + int Height => Intensities.GetLength(0); + + /// + /// Width of the heatmap data (columns) + /// + int Width => Intensities.GetLength(1); + + /// + /// Generated and stored when is called + /// + private SKBitmap? _bitmap = null; + + public Heatmap(double[,] intensities) + { + Intensities = intensities; + } + + ~Heatmap() + { + _bitmap?.Dispose(); + } + + /// + /// Return heatmap as an array of ARGB values, + /// scaled according to the heatmap setting, + /// and in the order necessary to create a bitmap. + /// + private uint[] GetArgbValues() + { + Range range = GetRange(); + uint[] argb = new uint[Intensities.Length]; + for (int y = 0; y < Height; y++) + { + int rowOffset = FlipVertically ? (Height - 1 - y) * Width : y * Width; + for (int x = 0; x < Width; x++) + { + argb[rowOffset + x] = Colormap.GetColor(Intensities[y, x], range).Argb; + } + } + + return argb; + } + + public void Update() + { + uint[] argbs = GetArgbValues(); + _bitmap?.Dispose(); + _bitmap = Drawing.BitmapFromArgbs(argbs, Width, Height); + } + + public AxisLimits GetAxisLimits() + { + return new(AlignedExtent); + } + + /// + /// Return the position in the array beneath the given point + /// + public (int x, int y) GetIndexes(Coordinates coordinates) + { + CoordinateRect rect = AlignedExtent; + + double distanceFromLeft = coordinates.X - rect.Left; + int xIndex = (int)(distanceFromLeft / CellWidth); + + double distanceFromTop = rect.Top - coordinates.Y; + int yIndex = (int)(distanceFromTop / CellHeight); + + return (xIndex, yIndex); + } + + /// + /// Return the value of the cell beneath the given point. + /// Returns NaN if the point is outside the heatmap area. + /// + public double GetValue(Coordinates coordinates) + { + CoordinateRect rect = AlignedExtent; + + if (!rect.Contains(coordinates)) + { + return double.NaN; + } + + (int xIndex, int yIndex) = GetIndexes(coordinates); + + return Intensities[yIndex, xIndex]; + } + + public IEnumerable LegendItems => Enumerable.Empty(); + + public Range GetRange() => Range.GetRange(Intensities); + + public void Render(RenderPack rp) + { + if (_bitmap is null) + { + Update(); // automatically generate the bitmap on first render if it was not generated manually + } + + using SKPaint paint = new() + { + FilterQuality = Smooth ? SKFilterQuality.High : SKFilterQuality.None + }; + + SKRect rect = Axes.GetPixelRect(AlignedExtent).ToSkRect(); + + rp.Canvas.DrawBitmap(_bitmap, rect, paint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/HorizontalLine.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/HorizontalLine.cs new file mode 100644 index 000000000..7368c4e01 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/HorizontalLine.cs @@ -0,0 +1,80 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// A line at a defined Y position that spans the entire horizontal space of the data area + /// + public class HorizontalLine : AxisLine + { + public double Y + { + get => Position; + set => Position = value; + } + + public HorizontalLine() + { + Label.Rotation = -90; + Label.Alignment = Alignment.LowerCenter; + Label.FontSize = 14; + Label.Bold = true; + Label.ForeColor = Colors.White; + Label.Padding = 5; + } + + public override AxisLimits GetAxisLimits() + { + return AxisLimits.VerticalOnly(Y, Y); + } + + public override void Render(RenderPack rp) + { + if (!IsVisible) + { + return; + } + + // determine location + float x1 = rp.DataRect.Left; + float x2 = rp.DataRect.Right; + float y = Axes.GetPixelY(Y); + if (!rp.DataRect.ContainsY(y)) + { + return; + } + + // draw line inside the data area + PixelLine line = new(x1, y, x2, y); + using SKPaint paint = new(); + LineStyle.Render(rp.Canvas, paint, line); + } + + public override void RenderLast(RenderPack rp) + { + if (Label.IsVisible == false || string.IsNullOrEmpty(Label.Text)) + { + return; + } + + // determine location + float y = Axes.GetPixelY(Y); + if (!rp.DataRect.ContainsY(y)) + { + return; + } + + float x = LabelOppositeAxis + ? rp.DataRect.Right + Label.Padding + : rp.DataRect.Left - Label.Padding; + + Label.Alignment = LabelOppositeAxis + ? Alignment.UpperCenter + : Alignment.LowerCenter; + + // draw label outside the data area + rp.DisableClipping(); + using SKPaint paint = new(); + Label.BackColor = LineStyle.Color; + Label.Render(rp.Canvas, x, y, paint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/LinePlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/LinePlot.cs new file mode 100644 index 000000000..0b7ff85d7 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/LinePlot.cs @@ -0,0 +1,81 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class LinePlot : IPlottable + { + public Coordinates Start { get; set; } + public Coordinates End { get; set; } + public LineStyle LineStyle { get; set; } = new(); + public MarkerStyle MarkerStyle { get; set; } = new() { Size = 0 }; + public string Label { get; set; } = string.Empty; + public bool IsVisible { get; set; } = true; + public IAxes Axes { get; set; } = new Axes(); + public IEnumerable LegendItems => LegendItem.Single(Label, LineStyle, MarkerStyle); + + public Color Color + { + get => LineStyle.Color; + set + { + LineStyle.Color = value; + MarkerStyle.Fill.Color = value; + } + } + + public Color LineColor + { + get => LineStyle.Color; + set => LineStyle.Color = value; + } + + public Color MarkerColor + { + get => MarkerStyle.Fill.Color; + set + { + MarkerStyle.Fill.Color = value; + MarkerStyle.Outline.Color = value; + } + } + + public MarkerShape MarkerShape + { + get => MarkerStyle.Shape; + set => MarkerStyle.Shape = value; + } + + public float LineWidth + { + get => LineStyle.Width; + set => LineStyle.Width = value; + } + + public float MarkerSize + { + get => MarkerStyle.Size; + set => MarkerStyle.Size = value; + } + + public LinePattern LinePattern + { + get => LineStyle.Pattern; + set => LineStyle.Pattern = value; + } + + public AxisLimits GetAxisLimits() + { + CoordinateRect boundingRect = new(Start, End); + return new AxisLimits(boundingRect); + } + + public void Render(RenderPack rp) + { + CoordinateLine line = new(Start, End); + PixelLine pxLine = Axes.GetPixelLine(line); + + using SKPaint paint = new(); + Drawing.DrawMarker(rp.Canvas, paint, Axes.GetPixel(Start), MarkerStyle); + Drawing.DrawMarker(rp.Canvas, paint, Axes.GetPixel(End), MarkerStyle); + Drawing.DrawLine(rp.Canvas, paint, pxLine, LineStyle); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Marker.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Marker.cs new file mode 100644 index 000000000..65f03e537 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Marker.cs @@ -0,0 +1,19 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Marker : IPlottable + { + public string Label { get; set; } = string.Empty; + public Coordinates Location { get; set; } + public bool IsVisible { get; set; } = true; + public MarkerStyle MarkerStyle { get; set; } = MarkerStyle.Default; + public IAxes Axes { get; set; } = new Axes(); + public IEnumerable LegendItems => LegendItem.Single(Label, MarkerStyle); + public AxisLimits GetAxisLimits() => new(Location); + + public void Render(RenderPack rp) + { + using SKPaint paint = new(); + Drawing.DrawMarker(rp.Canvas, paint, Axes.GetPixel(Location), MarkerStyle); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/OHLCPlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/OHLCPlot.cs new file mode 100644 index 000000000..c56456f13 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/OHLCPlot.cs @@ -0,0 +1,82 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class OhlcPlot(IOhlcSource data) : IPlottable + { + public bool IsVisible { get; set; } = true; + + public IAxes Axes { get; set; } = new Axes(); + + private readonly IOhlcSource _data = data; + + /// + /// Fractional width of the OHLC symbol relative to its time span + /// + public double SymbolWidth = .8; + + public LineStyle RisingStyle { get; } = new() + { + Color = Color.FromHex("#089981"), + Width = 2, + }; + + public LineStyle FallingStyle { get; } = new() + { + Color = Color.FromHex("#f23645"), + Width = 2, + }; + + public IEnumerable LegendItems => Enumerable.Empty(); + + public AxisLimits GetAxisLimits() => _data.GetLimits(); + + public void Render(RenderPack rp) + { + using SKPaint paint = new(); + using SKPath risingPath = new(); + using SKPath fallingPath = new(); + + foreach (Ohlc ohlc in _data.GetOhlCs()) + { + bool isRising = ohlc.Close >= ohlc.Open; + SKPath path = isRising ? risingPath : fallingPath; + + float center = Axes.GetPixelX(ohlc.DateTime.ToNumber()); + float top = Axes.GetPixelY(ohlc.High); + float bottom = Axes.GetPixelY(ohlc.Low); + + TimeSpan halfWidth = new((long)(ohlc.TimeSpan.Ticks * SymbolWidth / 2)); + DateTime leftTime = ohlc.DateTime - halfWidth; + DateTime rightTime = ohlc.DateTime + halfWidth; + float left = Axes.GetPixelX(leftTime.ToNumber()); + float right = Axes.GetPixelX(rightTime.ToNumber()); + + float open = Axes.GetPixelY(ohlc.Open); + float close = Axes.GetPixelY(ohlc.Close); + + // do not render OHLCs off the screen + if (right < rp.DataRect.Left || left > rp.DataRect.Right) + { + continue; + } + + // center line + path.MoveTo(center, top); + path.LineTo(center, bottom); + + // left peg + path.MoveTo(left, open); + path.LineTo(center, open); + + // right peg + path.MoveTo(center, close); + path.LineTo(right, close); + } + + RisingStyle.ApplyToPaint(paint); + rp.Canvas.DrawPath(risingPath, paint); + + FallingStyle.ApplyToPaint(paint); + rp.Canvas.DrawPath(fallingPath, paint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Pie.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Pie.cs new file mode 100644 index 000000000..a16c1f09c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Pie.cs @@ -0,0 +1,86 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Pie : IPlottable + { + public IList Slices { get; set; } + public LineStyle LineStyle { get; set; } = new() { Width = 0 }; + public bool IsVisible { get; set; } = true; + public double ExplodeFraction { get; set; } = 0; + + public IAxes Axes { get; set; } = new Axes(); + + public Pie(IList slices) + { + Slices = slices; + } + + public AxisLimits GetAxisLimits() + { + double padding = .03; + return new AxisLimits( + left: -1 - ExplodeFraction - padding, + right: 1 + ExplodeFraction + padding, + bottom: -1 - ExplodeFraction - padding, + top: 1 + ExplodeFraction + padding); + } + + public IEnumerable LegendItems => EnumerableExtensions.One( + new LegendItem + { + Children = Slices.Select(slice => new LegendItem + { + Label = slice.Label, + Fill = slice.Fill + }) + }); + + public void Render(RenderPack rp) + { + double total = Slices.Sum(s => s.Value); + float[] sweeps = Slices.Select(x => (float)(x.Value / total) * 360).ToArray(); + + Pixel origin = Axes.GetPixel(Coordinates.Origin); + + float minX = Math.Abs(Axes.GetPixelX(1) - origin.X); + float minY = Math.Abs(Axes.GetPixelY(1) - origin.Y); + float radius = Math.Min(minX, minY); + float explosionRadius = (float)ExplodeFraction * radius; + SKRect rect = new(-radius, -radius, radius, radius); + + using SKPath path = new(); + using SKPaint paint = new() { IsAntialias = true }; + + float sweepStart = 0; + for (int i = 0; i < Slices.Count(); i++) + { + using var _ = new SKAutoCanvasRestore(rp.Canvas); + + float rotation = sweepStart + sweeps[i] / 2; + rp.Canvas.Translate(origin.X, origin.Y); + rp.Canvas.RotateDegrees(rotation); + rp.Canvas.Translate(explosionRadius, 0); + + if (sweeps[i] != 360) + { + path.MoveTo(0, 0); + path.ArcTo(rect, -sweeps[i] / 2, sweeps[i], false); + path.Close(); + } + else + { + path.AddOval(rect); + } + + Slices[i].Fill.ApplyToPaint(paint); + paint.Shader = paint.Shader?.WithLocalMatrix(SKMatrix.CreateRotationDegrees(-rotation)); + rp.Canvas.DrawPath(path, paint); + + LineStyle.ApplyToPaint(paint); + rp.Canvas.DrawPath(path, paint); + + path.Reset(); + sweepStart += sweeps[i]; + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Polygon.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Polygon.cs new file mode 100644 index 000000000..610b581ab --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Polygon.cs @@ -0,0 +1,150 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// A polygon is a collection of X/Y points that are all connected to form a closed shape. + /// Polygons can be optionally filled with a color or a gradient. + /// + public class Polygon : IPlottable + { + public static Polygon Empty => new(); + + public bool IsEmpty { get; private set; } = false; + + // TODO: replace with a generic data source + public Coordinates[] Coordinates { get; private set; } = Array.Empty(); + + public string Label { get; set; } = string.Empty; + + public bool IsVisible { get; set; } = true; + + public LineStyle LineStyle { get; set; } = new() { Width = 0 }; + public FillStyle FillStyle { get; set; } = new() { Color = Colors.LightGray }; + public MarkerStyle MarkerStyle { get; set; } = MarkerStyle.None; + + public int PointCount => Coordinates.Length; + + public IAxes Axes { get; set; } = new Axes(); + + private AxisLimits _limits; + + public IEnumerable LegendItems => EnumerableExtensions.One( + new LegendItem + { + Label = Label, + Marker = MarkerStyle, + Line = LineStyle, + }); + + private Polygon() + { + Coordinates = new Coordinates[0]; + IsEmpty = true; + } + + /// + /// Creates a new polygon. + /// + /// The axis dependant vertex coordinates. + public Polygon(Coordinates[] coords) + { + UpdateCoordinates(coords); + } + + public override string ToString() + { + string label = string.IsNullOrWhiteSpace(Label) ? "" : $" ({Label})"; + return $"PlottablePolygon{label} with {PointCount} points"; + } + + public void UpdateCoordinates(Coordinates[] newCoordinates) + { + Coordinates = newCoordinates; + + _limits = AxisLimits.NoLimits; + IsEmpty = !Coordinates.Any(); + if (IsEmpty) + { + return; + } + + double xMin = Coordinates[0].X; + double xMax = Coordinates[0].X; + double yMin = Coordinates[0].Y; + double yMax = Coordinates[0].Y; + + foreach (var coord in Coordinates) + { + if (coord.X > xMax) + { + xMax = coord.X; + } + + if (coord.X < xMin) + { + xMax = coord.X; + } + + if (coord.Y > yMax) + { + yMax = coord.Y; + } + + if (coord.Y < yMin) + { + yMin = coord.Y; + } + } + + _limits = new AxisLimits(xMin, xMax, yMin, yMax); + } + + public AxisLimits GetAxisLimits() + { + return _limits; + } + + public void Render(RenderPack rp) + { + if (IsEmpty) + { + return; + } + + bool close = true; // TODO: make property + var coordinates = close + ? Coordinates.Concat(new Coordinates[] { Coordinates.First() }) + : Coordinates; + IEnumerable pixels = coordinates.Select(Axes.GetPixel); + + // TODO: stop using skia primitives directly + IEnumerable skPoints = pixels.Select(x => x.ToSkPoint()); + using SKPath path = new(); + path.MoveTo(skPoints.First()); + foreach (SKPoint p in skPoints.Skip(1)) + { + path.LineTo(p); + } + + using var paint = new SKPaint(); + if (FillStyle != null && FillStyle.HasValue) + { + FillStyle.ApplyToPaint(paint); + paint.Style = SKPaintStyle.Fill; + rp.Canvas.DrawPath(path, paint); + } + + if (LineStyle != null && LineStyle.IsVisible && LineStyle.Width > 0) + { + paint.Style = SKPaintStyle.Stroke; + LineStyle.ApplyToPaint(paint); + rp.Canvas.DrawPath(path, paint); + Drawing.DrawLines(rp.Canvas, paint, pixels, LineStyle); + } + + if (MarkerStyle != null && MarkerStyle.IsVisible) + { + Drawing.DrawMarkers(rp.Canvas, paint, pixels, MarkerStyle); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Rectangle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Rectangle.cs new file mode 100644 index 000000000..3e79e029d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Rectangle.cs @@ -0,0 +1,49 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Rectangle : IPlottable + { + public bool IsVisible { get; set; } = true; + public IAxes Axes { get; set; } = new Axes(); + public IEnumerable LegendItems => LegendItem.Single(Label, FillStyle, LineStyle); + public LineStyle LineStyle { get; set; } = new() { Color = Colors.Black, Width = 1 }; + public FillStyle FillStyle { get; set; } = new() { Color = Colors.Red }; + public string Label { get; set; } = string.Empty; + public double X1 { get; set; } + public double X2 { get; set; } + public double Y1 { get; set; } + public double Y2 { get; set; } + + public CoordinateRect CoordinateRect + { + get + { + double left = Math.Min(X1, X2); + double right = Math.Max(X1, X2); + double bottom = Math.Min(Y1, Y2); + double top = Math.Max(Y1, Y2); + return new CoordinateRect(left, right, bottom, top); + } + set + { + X1 = value.Left; + X2 = value.Right; + Y1 = value.Bottom; + Y2 = value.Top; + } + } + + public AxisLimits GetAxisLimits() => new(CoordinateRect); + + public void Render(RenderPack rp) + { + using SKPaint paint = new(); + + FillStyle.ApplyToPaint(paint); + PixelRect rect = Axes.GetPixelRect(CoordinateRect); + Drawing.Fillectangle(rp.Canvas, rect, paint); + + LineStyle.ApplyToPaint(paint); + Drawing.DrawRectangle(rp.Canvas, rect, paint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Scatter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Scatter.cs new file mode 100644 index 000000000..bf3a90183 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Scatter.cs @@ -0,0 +1,120 @@ +/* Minimal case scatter plot for testing only. + * Avoid temptation to use generics or generic math at this early stage of development! + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Scatter(IScatterSource data) : IPlottable + { + public string? Label { get; set; } + public bool IsVisible { get; set; } = true; + public IAxes Axes { get; set; } = new Axes(); + public LineStyle LineStyle { get; set; } = new(); + + public MarkerStyle MarkerStyle { get; set; } = MarkerStyle.Default; + + public IScatterSource Data { get; } = data; + + public LinePattern LinePattern + { + get => LineStyle.Pattern; + set => LineStyle.Pattern = value; + } + + public float LineWidth + { + get => LineStyle.Width; + set => LineStyle.Width = value; + } + + public float MarkerSize + { + get => MarkerStyle.Size; + set => MarkerStyle.Size = value; + } + + /// + /// The style of lines to use when connecting points. + /// + public ConnectStyle ConnectStyle = ConnectStyle.Straight; + + /// + /// If enabled, points will be connected by smooth lines instead of straight diagnal lines. + /// adjusts the smoothnes of the lines. + /// + public bool Smooth = false; + + /// + /// Tension to use for smoothing when is enabled + /// + public double SmoothTension = 0.5; + + public Color Color + { + get => LineStyle.Color; + set + { + LineStyle.Color = value; + MarkerStyle.Fill.Color = value; + MarkerStyle.Outline.Color = value; + } + } + + public AxisLimits GetAxisLimits() => Data.GetLimits(); + + public IEnumerable LegendItems => EnumerableExtensions.One( + new LegendItem + { + Label = Label, + Marker = MarkerStyle, + Line = LineStyle, + }); + + public void Render(RenderPack rp) + { + // TODO: can this be more effecient by moving this logic into the DataSource to avoid copying? + Pixel[] markerPixels = Data.GetScatterPoints().Select(Axes.GetPixel).ToArray(); + + if (!markerPixels.Any()) + { + return; + } + + IEnumerable linePixels = ConnectStyle switch + { + ConnectStyle.Straight => markerPixels, + ConnectStyle.StepHorizontal => GetStepDisplayPixels(markerPixels, true), + ConnectStyle.StepVertical => GetStepDisplayPixels(markerPixels, false), + _ => throw new NotImplementedException($"unsupported {nameof(ConnectStyle)}: {ConnectStyle}"), + }; + + using SKPaint paint = new(); + Drawing.DrawLines(rp.Canvas, paint, linePixels, LineStyle); + Drawing.DrawMarkers(rp.Canvas, paint, markerPixels, MarkerStyle); + } + + /// + /// Convert scatter plot points (connected by diagnal lines) to step plot points (connected by right angles) + /// by inserting an extra point between each of the original data points to result in L-shaped steps. + /// + /// Array of corner positions + /// Indicates that a line will extend to the right before rising or falling. + public static IEnumerable GetStepDisplayPixels(Pixel[] pixels, bool right) + { + Pixel[] pixelsStep = new Pixel[pixels.Count() * 2 - 1]; + + int offsetX = right ? 1 : 0; + int offsetY = right ? 0 : 1; + + for (int i = 0; i < pixels.Count() - 1; i++) + { + pixelsStep[i * 2] = pixels[i]; + pixelsStep[i * 2 + 1] = new Pixel(pixels[i + offsetX].X, pixels[i + offsetY].Y); + } + + pixelsStep[pixelsStep.Length - 1] = pixels[pixels.Length - 1]; + + return pixelsStep; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Signal.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Signal.cs new file mode 100644 index 000000000..ca1b02257 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Signal.cs @@ -0,0 +1,166 @@ +/* Minimal case signal plot for testing only + * !! Avoid temptation to use generics or generic math at this early stage of development + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Signal : IPlottable + { + public bool IsVisible { get; set; } = true; + public IAxes Axes { get; set; } = new Axes(); + + public readonly ISignalSource Data; + + public string? Label { get; set; } + + public readonly MarkerStyle Marker; + + public readonly LineStyle LineStyle; + + /// + /// Maximum size of the marker (in pixels) to display + /// at each data point when the plot is zoomed far in. + /// + public float MaximumMarkerSize { get; set; } = 4; + + public float LineWidth + { + get => LineStyle.Width; + set => LineStyle.Width = value; + } + + public Color Color + { + get => LineStyle.Color; + set + { + LineStyle.Color = value; + Marker.Fill.Color = value; + Marker.Outline.Color = value; + } + } + + public Signal(ISignalSource data) + { + Data = data; + + Marker = new(MarkerShape.FilledCircle, 5) + { + Outline = LineStyle.None + }; + + LineStyle = new(); + } + + public AxisLimits GetAxisLimits() => Data.GetLimits(); + + public IEnumerable LegendItems => EnumerableExtensions.One( + new LegendItem + { + Label = Label, + Marker = Marker, + Line = LineStyle, + }); + + private CoordinateRange GetVisibleXRange(PixelRect dataRect) + { + // TODO: put GetRange in axis translator + double xViewLeft = Axes.GetCoordinateX(dataRect.Left); + double xViewRight = Axes.GetCoordinateX(dataRect.Right); + return new CoordinateRange(xViewLeft, xViewRight); + } + + private double PointsPerPixel() + { + return GetVisibleXRange(Axes.DataRect).Span / Axes.DataRect.Width / Data.Period; + } + + public void Render(RenderPack rp) + { + if (PointsPerPixel() < 1) + { + RenderLowDensity(rp); + } + else + { + RenderHighDensity(rp); + } + } + + /// + /// Renders each point connected by a single line, like a scatter plot. + /// Call this when zoomed in enough that no pixel could contain two points. + /// + private void RenderLowDensity(RenderPack rp) + { + CoordinateRange visibleXRange = GetVisibleXRange(Axes.DataRect); + int i1 = Data.GetIndex(visibleXRange.Min, true); + int i2 = Data.GetIndex(visibleXRange.Max + Data.Period, true); + + IReadOnlyList ys = Data.GetYs(); + + List points = new(); + for (int i = i1; i <= i2; i++) + { + float x = Axes.GetPixelX(Data.GetX(i)); + float y = Axes.GetPixelY(ys[i] + Data.YOffset); + Pixel px = new(x, y); + points.Add(px); + } + + using SKPath path = new(); + path.MoveTo(points[0].ToSkPoint()); + foreach (Pixel point in points) + { + path.LineTo(point.ToSkPoint()); + } + + using SKPaint paint = new(); + LineStyle.ApplyToPaint(paint); + + rp.Canvas.DrawPath(path, paint); + + double pointsPerPx = PointsPerPixel(); + + if (pointsPerPx < 1) + { + paint.IsStroke = false; + float radius = (float)Math.Min(Math.Sqrt(.2 / pointsPerPx), MaximumMarkerSize); + Marker.Size = radius * MaximumMarkerSize * .2f; + Drawing.DrawMarkers(rp.Canvas, paint, points, Marker); + } + } + + /// + /// Renders the plot by filling-in pixel columns according the extremes of Y data ranges. + /// Call this when zoomed out enough that one X pixel column may contain two or more points. + /// + private void RenderHighDensity(RenderPack rp) + { + using SKPaint paint = new(); + LineStyle.ApplyToPaint(paint); + + IEnumerable cols = Enumerable.Range(0, (int)Axes.DataRect.Width) + .Select(x => Data.GetPixelColumn(Axes, x)) + .Where(x => x.HasData); + + if (!cols.Any()) + { + return; + } + + using SKPath path = new(); + path.MoveTo(cols.First().X, cols.First().Enter); + + foreach (PixelColumn col in cols) + { + path.LineTo(col.X, col.Enter); + path.MoveTo(col.X, col.Bottom); + path.LineTo(col.X, col.Top); + path.MoveTo(col.X, col.Exit); + } + + rp.Canvas.DrawPath(path, paint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/SignalConst.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/SignalConst.cs new file mode 100644 index 000000000..94da97fba --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/SignalConst.cs @@ -0,0 +1,59 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class SignalConst(T[] ys, double period) : IPlottable + where T : struct, IComparable + { + readonly SignalConstSourceDoubleArray _data = new(ys, period); + public readonly MarkerStyle Marker = new(); + public readonly LineStyle LineStyle = new(); + + public string? Label { get; set; } + + public Color Color + { + get => LineStyle.Color; + set + { + LineStyle.Color = value; + Marker.Fill.Color = value; + Marker.Outline.Color = value; + } + } + + public bool IsVisible { get; set; } = true; + public IAxes Axes { get; set; } = ScottPlot.Axes.Default; + + public IEnumerable LegendItems => LegendItem.None; + + public AxisLimits GetAxisLimits() => _data.GetAxisLimits(); + + public void Render(RenderPack rp) + { + using SKPaint paint = new(); + LineStyle.ApplyToPaint(paint); + + List cols = _data.GetPixelColumns(Axes); + + if (!cols.Any()) + { + return; + } + + using SKPath path = new(); + path.MoveTo(cols.First().X, cols.First().Enter); + + foreach (PixelColumn col in cols) + { + path.LineTo(col.X, col.Enter); + if ((int)col.Top != (int)col.Bottom) + { + path.MoveTo(col.X, col.Bottom); + path.LineTo(col.X, col.Top); + path.MoveTo(col.X, col.Exit); + } + } + + rp.Canvas.DrawPath(path, paint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/SignalXY.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/SignalXY.cs new file mode 100644 index 000000000..3c39e346a --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/SignalXY.cs @@ -0,0 +1,43 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class SignalXy : IPlottable + { + public ISignalXySource Data { get; set; } + + public bool IsVisible { get; set; } = true; + public int XAxisIndex { get; set; } = 0; + public int YAxisIndex { get; set; } = 0; + public IAxes Axes { get; set; } = new Axes(); + public LineStyle LineStyle { get; set; } = new(); + + public Color Color + { + get => LineStyle.Color; + set => LineStyle.Color = value; + } + + public float LineWidth + { + get => LineStyle.Width; + set => LineStyle.Width = value; + } + + public string Label = string.Empty; + public IEnumerable LegendItems => LegendItem.Single(Label, LineStyle); + + public SignalXy(ISignalXySource dataSource) + { + Data = dataSource; + } + + public AxisLimits GetAxisLimits() => Data.GetAxisLimits(); + + public void Render(RenderPack rp) + { + Pixel[] pixels = Data.GetPixelsToDraw(rp, Axes); + + using SKPaint paint = new(); + Drawing.DrawLines(rp.Canvas, paint, pixels, LineStyle); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Text.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Text.cs new file mode 100644 index 000000000..c54be0371 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/Text.cs @@ -0,0 +1,63 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Text : IPlottable + { + public readonly Label Label = new(); + public Coordinates Location { get; set; } + public bool IsVisible { get; set; } = true; + public IAxes Axes { get; set; } = new Axes(); + public IEnumerable LegendItems => LegendItem.None; + + public Color Color + { + get => Label.ForeColor; + set => Label.ForeColor = value; + } + + public float Size + { + get => Label.FontSize; + set => Label.FontSize = value; + } + + public bool Bold + { + get => Label.Bold; + set => Label.Bold = value; + } + + public float Rotation + { + get => Label.Rotation; + set => Label.Rotation = value; + } + + public string LabelText + { + get => Label.Text; + set => Label.Text = value; + } + + public string FontName + { + get => Label.FontName; + set => Label.FontName = value; + } + + public Text() + { + + } + + public AxisLimits GetAxisLimits() + { + return new AxisLimits(Location); + } + + public void Render(RenderPack rp) + { + Pixel pixelLocation = Axes.GetPixel(Location); + Label.Render(rp.Canvas, pixelLocation); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/VerticalLine.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/VerticalLine.cs new file mode 100644 index 000000000..8eb672907 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Plotables/VerticalLine.cs @@ -0,0 +1,78 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// A line at a defined X position that spans the entire vertical space of the data area + /// + public class VerticalLine : AxisLine + { + public double X + { + get => Position; + set => Position = value; + } + + public VerticalLine() + { + Label.ForeColor = Colors.White; + Label.FontSize = 14; + Label.Bold = true; + Label.Padding = 5; + } + + public override AxisLimits GetAxisLimits() + { + return AxisLimits.HorizontalOnly(X, X); + } + + public override void Render(RenderPack rp) + { + if (!IsVisible) + { + return; + } + + // determine location + float y1 = rp.DataRect.Bottom; + float y2 = rp.DataRect.Top; + float x = Axes.GetPixelX(X); + if (!rp.DataRect.ContainsX(x)) + { + return; + } + + // draw line inside the data area + PixelLine line = new(x, y1, x, y2); + using SKPaint paint = new(); + LineStyle.Render(rp.Canvas, paint, line); + } + + public override void RenderLast(RenderPack rp) + { + if (Label.IsVisible == false || string.IsNullOrEmpty(Label.Text)) + { + return; + } + + // determine location + float x = Axes.GetPixelX(X); + if (!rp.DataRect.ContainsX(x)) + { + return; + } + + float y = LabelOppositeAxis + ? rp.DataRect.Top - Label.Padding + : rp.DataRect.Bottom + Label.Padding; + + Label.Alignment = LabelOppositeAxis + ? Alignment.LowerCenter + : Alignment.UpperCenter; + + // draw label + rp.DisableClipping(); + using SKPaint paint = new(); + Label.BackColor = LineStyle.Color; + Label.Render(rp.Canvas, x, y, paint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Alignment.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Alignment.cs new file mode 100644 index 000000000..d4ec9d626 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Alignment.cs @@ -0,0 +1,73 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Represents the location of a point relative to a rectangle. + /// UpperLeft means the point is at the top left of the rectangle. + /// + public enum Alignment + { + UpperLeft, + UpperCenter, + UpperRight, + MiddleLeft, + MiddleCenter, + MiddleRight, + LowerLeft, + LowerCenter, + LowerRight, + } + + public static class AlignmentExtensions + { + public static float HorizontalFraction(this Alignment alignment) + { + return alignment switch + { + Alignment.UpperLeft => 0, + Alignment.UpperCenter => .5f, + Alignment.UpperRight => 1, + Alignment.MiddleLeft => 0, + Alignment.MiddleCenter => .5f, + Alignment.MiddleRight => 1, + Alignment.LowerLeft => 0, + Alignment.LowerCenter => .5f, + Alignment.LowerRight => 1, + _ => throw new NotImplementedException(), + }; + } + + public static float VerticalFraction(this Alignment alignment) + { + return alignment switch + { + Alignment.UpperLeft => 1, + Alignment.UpperCenter => 1, + Alignment.UpperRight => 1, + Alignment.MiddleLeft => .5f, + Alignment.MiddleCenter => .5f, + Alignment.MiddleRight => .5f, + Alignment.LowerLeft => 0, + Alignment.LowerCenter => 0, + Alignment.LowerRight => 0, + _ => throw new NotImplementedException(), + }; + } + + public static bool IsUpperEdge(this Alignment a) => a is Alignment.UpperLeft or Alignment.UpperCenter or Alignment.UpperRight; + + public static bool IsLowerEdge(this Alignment a) + { + return a is Alignment.LowerLeft or Alignment.LowerCenter or Alignment.LowerRight; + } + + public static bool IsLeftEdge(this Alignment a) + { + return a is Alignment.UpperLeft or Alignment.MiddleLeft or Alignment.LowerLeft; + } + + public static bool IsRightEdge(this Alignment a) + { + return a is Alignment.UpperRight or Alignment.MiddleRight or Alignment.LowerRight; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Axes.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Axes.cs new file mode 100644 index 000000000..8df830685 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Axes.cs @@ -0,0 +1,57 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This object holds an X axis and Y axis and performs 2D coordinate/pixel conversions + /// + public class Axes : IAxes + { + // TODO: these should probably be readonly and passed into the constructor + public IXAxis XAxis { get; set; } = null!; + public IYAxis YAxis { get; set; } = null!; + public PixelRect DataRect { get; set; } + + public static Axes Default => new(); + + public Axes() + { + } + + public Coordinates GetCoordinates(Pixel pixel) + { + double x = XAxis.GetCoordinate(pixel.X, DataRect); + double y = YAxis.GetCoordinate(pixel.Y, DataRect); + return new Coordinates(x, y); + } + + public double GetCoordinateX(float pixel) => XAxis.GetCoordinate(pixel, DataRect); + + public double GetCoordinateY(float pixel) => YAxis.GetCoordinate(pixel, DataRect); + + public Pixel GetPixel(Coordinates coordinates) + { + float x = XAxis.GetPixel(coordinates.X, DataRect); + float y = YAxis.GetPixel(coordinates.Y, DataRect); + return new Pixel(x, y); + } + + public PixelLine GetPixelLine(CoordinateLine line) + { + Pixel pt1 = GetPixel(line.Start); + Pixel pt2 = GetPixel(line.End); + return new PixelLine(pt1, pt2); + } + + public float GetPixelX(double xCoordinate) => XAxis.GetPixel(xCoordinate, DataRect); + + public float GetPixelY(double yCoordinate) => YAxis.GetPixel(yCoordinate, DataRect); + + public PixelRect GetPixelRect(CoordinateRect rect) + { + return new PixelRect( + left: GetPixelX(rect.Left), + right: GetPixelX(rect.Right), + bottom: GetPixelY(rect.Bottom), + top: GetPixelY(rect.Top)); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/AxisLimits.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/AxisLimits.cs new file mode 100644 index 000000000..df7a7f42a --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/AxisLimits.cs @@ -0,0 +1,197 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This object represents the rectangular visible area on a 2D coordinate system. + /// It simply stores a but has axis-related methods to act upon it. + /// + public readonly struct AxisLimits : IEquatable + { + public double Left { get; } + public double Right { get; } + public double Bottom { get; } + public double Top { get; } + + public double HorizontalSpan => Right - Left; + public double VerticalSpan => Top - Bottom; + + public double HorizontalCenter => (Right + Left) / 2; + public double VerticalCenter => (Top + Bottom) / 2; + + public CoordinateRange XRange => new(Left, Right); + public CoordinateRange YRange => new(Bottom, Top); + + // TODO: make sure callers aren't using this when they dont have to + public CoordinateRect Rect => new(Left, Right, Bottom, Top); + + public static AxisLimits Default { get; } = new(-10, 10, -10, 10); + + public bool IsRealX => NumericConversion.AreReal(Left, Right); + public bool IsRealY => NumericConversion.AreReal(Bottom, Top); + public bool IsReal => IsRealX && IsRealY; + public bool HasArea => IsReal && HorizontalSpan != 0 && VerticalSpan != 0; + + public AxisLimits(Coordinates coordinates) + { + Left = coordinates.X; + Right = coordinates.X; + Bottom = coordinates.Y; + Top = coordinates.Y; + } + + public AxisLimits(CoordinateRect rect) + { + Left = rect.Left; + Right = rect.Right; + Bottom = rect.Bottom; + Top = rect.Top; + } + + public AxisLimits(double left, double right, double bottom, double top) + { + Left = left; + Right = right; + Bottom = bottom; + Top = top; + } + + public AxisLimits(CoordinateRange xRange, CoordinateRange yRange) + { + Left = xRange.Min; + Right = xRange.Max; + Bottom = yRange.Min; + Top = yRange.Max; + } + + public AxisLimits InvertedVertically() => new(Left, Right, Top, Bottom); + public AxisLimits InvertedHorizontally() => new(Right, Left, Bottom, Top); + + public AxisLimits ExpandedToInclude(AxisLimits otherLimits) + { + ExpandingAxisLimits expandingLimits = new(this); + expandingLimits.Expand(otherLimits); + return expandingLimits.AxisLimits; + } + + public static AxisLimits FromPoint(double x, double y) + { + return new AxisLimits(x, x, y, y); + } + + public override string ToString() + { + return $"AxisLimits: X=[{Rect.Left}, {Rect.Right}], Y=[{Rect.Bottom}, {Rect.Top}]"; + } + + public static AxisLimits NoLimits => new(double.NaN, double.NaN, double.NaN, double.NaN); + + public static AxisLimits VerticalOnly(double yMin, double yMax) => new(double.NaN, double.NaN, yMin, yMax); + + public static AxisLimits HorizontalOnly(double xMin, double xMax) => new(xMin, xMax, double.NaN, double.NaN); + + // TODO: obsolete all Expanded() methods and replace functionality with ExpandingAxisLimits + + /// + /// Return a new expanded to include the given and . + /// + public AxisLimits Expanded(double x, double y) + { + double xMin2 = !double.IsNaN(Left) ? Math.Min(Left, x) : x; + double xMax2 = !double.IsNaN(Right) ? Math.Max(Right, x) : x; + double yMin2 = !double.IsNaN(Bottom) ? Math.Min(Bottom, y) : y; + double yMax2 = !double.IsNaN(Top) ? Math.Max(Top, y) : y; + return new AxisLimits(xMin2, xMax2, yMin2, yMax2); + } + + /// + /// Return a new expanded to include the given . + /// + public AxisLimits Expanded(Coordinates coordinates) + { + return Expanded(coordinates.X, coordinates.Y); + } + + /// + /// Return a new expanded to include all corners of the given . + /// + public AxisLimits Expanded(CoordinateRect rect) + { + return Expanded(rect.TopLeft).Expanded(rect.BottomRight); + } + + /// + /// Return a new expanded to include the area defined by . + /// + public AxisLimits Expanded(AxisLimits limits) + { + limits = limits.Expanded(Left, Bottom); + limits = limits.Expanded(Right, Top); + return limits; + } + + public AxisLimits WithPan(double deltaX, double deltaY) + { + return new(Left + deltaX, Right + deltaX, Bottom + deltaY, Top + deltaY); + } + + public AxisLimits WithZoom(double fracX, double fracY) + { + return WithZoom(fracX, fracY, Rect.HorizontalCenter, Rect.VerticalCenter); + } + + public AxisLimits WithZoom(double fracX, double fracY, double zoomToX, double zoomToY) + { + // TODO: do this without heap allocations + + CoordinateRangeMutable xRange = new(Rect.Left, Rect.Right); + xRange.ZoomFrac(fracX, zoomToX); + + CoordinateRangeMutable yRange = new(Rect.Bottom, Rect.Top); + yRange.ZoomFrac(fracY, zoomToY); + + return new(XRange.Min, XRange.Max, yRange.Min, yRange.Max); + } + + public bool Equals(AxisLimits other) + { + return + Equals(Left, other.Left) && + Equals(Right, other.Right) && + Equals(Top, other.Top) && + Equals(Bottom, other.Bottom); + } + + public override bool Equals(object? obj) + { + if (obj is null) + { + return false; + } + + if (obj is AxisLimits other) + { + return Equals(other); + } + + return false; + } + + public static bool operator ==(AxisLimits a, AxisLimits b) + { + return a.Equals(b); + } + + public static bool operator !=(AxisLimits a, AxisLimits b) + { + return !a.Equals(b); + } + + public override int GetHashCode() + { + return + Left.GetHashCode() ^ + Right.GetHashCode() ^ + Bottom.GetHashCode() ^ + Top.GetHashCode(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Bar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Bar.cs new file mode 100644 index 000000000..9dc2ff27b --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Bar.cs @@ -0,0 +1,96 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Represents a single bar in a bar chart + /// + public class Bar + { + public double Position; + public double Value; + public double ValueBase = 0; + public double Error = 0; + + public Color FillColor = Colors.Gray; + public Color BorderColor = Colors.Black; + public Color ErrorColor = Colors.Black; + + public double Size = 0.8; // coordinate units + public double ErrorSize = 0.2; // coordinate units + public float BorderLineWidth = 1; + public float ErrorLineWidth = 0; + + // TODO: something like ErrorInDirectionOfValue? + // Maybe ErrorPosition should be an enum containing: None, Upward, Downward, Both, or Extend + public bool ErrorPositive = true; + public bool ErrorNegative = true; + + public Orientation Orientation = Orientation.Vertical; + + internal CoordinateRect Rect => + Orientation == Orientation.Vertical + ? new CoordinateRect( + left: Position - Size / 2, + right: Position + Size / 2, + bottom: ValueBase, + top: Value) + : new CoordinateRect( + left: ValueBase, + right: Value, + bottom: Position - Size / 2, + top: Position + Size / 2); + + internal IEnumerable ErrorLines + { + get + { + CoordinateLine center, top, bottom; + if (Orientation == Orientation.Vertical) + { + center = new(Position, Value - Error, Position, Value + Error); + top = new(Position - ErrorSize / 2, Value + Error, Position + ErrorSize / 2, Value + Error); + bottom = new(Position - ErrorSize / 2, Value - Error, Position + ErrorSize / 2, Value - Error); + } + else + { + center = new(Value - Error, Position, Value + Error, Position); + top = new(Value + Error, Position - ErrorSize / 2, Value + Error, Position + ErrorSize / 2); + bottom = new(Value - Error, Position - ErrorSize / 2, Value - Error, Position + ErrorSize / 2); + } + + return new List() { center, top, bottom }; + } + } + + internal AxisLimits AxisLimits => + Orientation == Orientation.Vertical + ? new AxisLimits( + left: Position - Size / 2, + right: Position + Size / 2, + bottom: Math.Min(ValueBase, Value - Error), + top: Value + Error) + : new AxisLimits( + left: Math.Min(ValueBase, Value - Error), + right: Value + Error, + bottom: Position - Size / 2, + top: Position + Size / 2); + + public void Render(RenderPack rp, IAxes axes, SKPaint paint) + { + PixelRect rect = axes.GetPixelRect(Rect); + Drawing.Fillectangle(rp.Canvas, rect, FillColor); + Drawing.DrawRectangle(rp.Canvas, rect, BorderColor, BorderLineWidth); + + if (Error == 0) + { + return; + } + + foreach (CoordinateLine line in ErrorLines) + { + Pixel pt1 = axes.GetPixel(line.Start); + Pixel pt2 = axes.GetPixel(line.End); + Drawing.DrawLine(rp.Canvas, paint, pt1, pt2, BorderColor, BorderLineWidth); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/BarSeries.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/BarSeries.cs new file mode 100644 index 000000000..1f6ad8e33 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/BarSeries.cs @@ -0,0 +1,13 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Holds a collection of bars which are all styled the same and have a common label + /// + [Obsolete("Temporarily not in use", true)] + public class BarSeries + { + public IList Bars { get; set; } = Array.Empty(); + public string? Label { get; set; } + public Color Color { get; set; } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Box.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Box.cs new file mode 100644 index 000000000..10b70a52e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Box.cs @@ -0,0 +1,82 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Holds values for drawing a box-and-whisker symbol + /// + public class Box + { + public double Position { get; set; } + + public double BoxMin { get; set; } + public double BoxMax { get; set; } + + public double? BoxMiddle { get; set; } + public double? WhiskerMin { get; set; } + public double? WhiskerMax { get; set; } + + public double Width { get; set; } = 0.8; + public double CapSize { get; set; } = 0.3; + public FillStyle Fill { get; set; } = new(); + public LineStyle Stroke { get; set; } = new(); + public Orientation Orientation { get; set; } = Orientation.Vertical; + + public AxisLimits GetAxisLimits() + { + double xMin = Position - Width / 2; + double xMax = Position + Width / 2; + double yMin = WhiskerMin.HasValue ? Math.Min(BoxMin, WhiskerMin.Value) : BoxMin; + double yMax = WhiskerMax.HasValue ? Math.Max(BoxMin, WhiskerMax.Value) : BoxMax; + return new AxisLimits(xMin, xMax, yMin, yMax); + } + + public void Render(RenderPack rp, SKPaint paint, IAxes axes) + { + // TODO: support horizontal boxes + if (Orientation != Orientation.Vertical) + { + throw new NotImplementedException(); + } + + // body fill + CoordinateRect bodyRect = new(Position - Width / 2, Position + Width / 2, BoxMin, BoxMax); + PixelRect bodyRectPx = axes.GetPixelRect(bodyRect); + Fill.ApplyToPaint(paint); + Drawing.Fillectangle(rp.Canvas, bodyRectPx, paint); + + // body stroke + Stroke.ApplyToPaint(paint); + Drawing.DrawRectangle(rp.Canvas, bodyRectPx, paint); + + if (BoxMiddle.HasValue) + { + CoordinateLine lineMid = new(bodyRect.Left, BoxMiddle.Value, bodyRect.Right, BoxMiddle.Value); + PixelLine lineMidPx = axes.GetPixelLine(lineMid); + Drawing.DrawLine(rp.Canvas, paint, lineMidPx); + } + + if (WhiskerMax.HasValue) + { + CoordinateLine lineMax = new(Position, BoxMax, Position, WhiskerMax.Value); + PixelLine lineMaxPx = axes.GetPixelLine(lineMax); + Drawing.DrawLine(rp.Canvas, paint, lineMaxPx); + + CoordinateLine lineMaxAcross = new(Position - CapSize / 2, WhiskerMax.Value, Position + CapSize / 2, + WhiskerMax.Value); + PixelLine lineMaxAcrossPx = axes.GetPixelLine(lineMaxAcross); + Drawing.DrawLine(rp.Canvas, paint, lineMaxAcrossPx); + } + + if (WhiskerMin.HasValue) + { + CoordinateLine lineMin = new(Position, BoxMin, Position, WhiskerMin.Value); + PixelLine lineMinPx = axes.GetPixelLine(lineMin); + Drawing.DrawLine(rp.Canvas, paint, lineMinPx); + + CoordinateLine lineMinAcross = new(Position - CapSize / 2, WhiskerMin.Value, Position + CapSize / 2, + WhiskerMin.Value); + PixelLine lineMinAcrossPx = axes.GetPixelLine(lineMinAcross); + Drawing.DrawLine(rp.Canvas, paint, lineMinAcrossPx); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Color.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Color.cs new file mode 100644 index 000000000..854ab8a62 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Color.cs @@ -0,0 +1,266 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public readonly struct Color + { + public readonly byte Red; + public readonly byte Green; + public readonly byte Blue; + public readonly byte Alpha; + + // TODO: benchmark if referencing these is slower + public byte R => Red; + public byte G => Green; + public byte B => Blue; + public byte A => Alpha; + + public uint Argb => + (uint)Alpha << 24 | + (uint)Red << 16 | + (uint)Green << 8 | + (uint)Blue << 0; + + public Color(byte red, byte green, byte blue, byte alpha = 255) + { + Red = red; + Green = green; + Blue = blue; + Alpha = alpha; + } + + public Color(float red, float green, float blue, float alpha = 1) + { + Red = (byte)(red * 255); + Green = (byte)(green * 255); + Blue = (byte)(blue * 255); + Alpha = (byte)(alpha * 255); + } + + public static bool operator ==(Color a, Color b) + { + return a.Argb == b.Argb; + } + + public static bool operator !=(Color a, Color b) + { + return a.Argb != b.Argb; + } + + public override int GetHashCode() + { + return (int)Argb; + } + + public override bool Equals(object? obj) + { + if (obj is null) + { + return false; + } + + if (obj is not Color) + { + return false; + } + + return ((Color)obj).Argb == Argb; + } + + public readonly Color WithRed(byte red) => new(red, Green, Blue, Alpha); + public readonly Color WithGreen(byte green) => new(Red, green, Blue, Alpha); + public readonly Color WithBlue(byte blue) => new(Red, Green, blue, Alpha); + + public readonly Color WithAlpha(byte alpha) + { + // If requesting a semitransparent black, make it slightly non-black + // to prevent SVG export from rendering the color as opaque. + // https://github.com/ScottPlot/ScottPlot/issues/3063 + if (Red == 0 && Green == 0 && Blue == 0 && alpha < 255) + { + return new Color(1, 1, 1, alpha); + } + + return new(Red, Green, Blue, alpha); + } + + public readonly Color WithAlpha(double alpha) => WithAlpha((byte)(alpha * 255)); + + public readonly Color WithOpacity(double opacity = .5) => WithAlpha((byte)(opacity * 255)); + + public static Color Gray(byte value) => new(value, value, value); + + public static Color FromArgb(uint argb) + { + byte alpha = (byte)(argb >> 24); + byte red = (byte)(argb >> 16); + byte green = (byte)(argb >> 8); + byte blue = (byte)(argb >> 0); + return new Color(red, green, blue, alpha); + } + + public static Color FromHex(string hex) + { + if (hex[0] == '#') + { + return FromHex(hex.Substring(1)); + } + + if (hex.Length == 6) + { + hex += "FF"; + } + + if (!uint.TryParse(hex, NumberStyles.HexNumber, null, out uint rgba)) + { + return new Color(0, 0, 0); + } + + uint argb = ((rgba & 0xFF) << 24) | (rgba >> 8); + return FromArgb(argb); + } + + public static Color[] FromHex(string[] hex) + { + return hex.Select(x => FromHex(x)).ToArray(); + } + + public static Color FromSkColor(SKColor skcolor) + { + return new Color(skcolor.Red, skcolor.Green, skcolor.Blue, skcolor.Alpha); + } + + public string ToStringRgb() + { + return "#" + Red.ToString("X2") + Green.ToString("X2") + Blue.ToString("X2"); + } + + public string ToStringRgba() + { + return "#" + Red.ToString("X2") + Green.ToString("X2") + Blue.ToString("X2") + Alpha.ToString("X2"); + } + + public SKColor ToSkColor() + { + return new SKColor(Red, Green, Blue, Alpha); + } + + public (float h, float s, float l) ToHsl() + { + // adapted from Microsoft.Maui.Graphics/Color.cs (MIT license) + + float v = Math.Max(Red, Green); + v = Math.Max(v, Blue); + + float m = Math.Min(Red, Green); + m = Math.Min(m, Blue); + + float h, s, l; + l = (m + v) / 2.0f; + if (l <= 0.0) + { + return (0, 0, 0); + } + + float vm = v - m; + s = vm; + if (s <= 0.0) + { + return (0, 0, l); + } + + s /= l <= 0.5f ? v + m : 2.0f - v - m; + + float r2 = (v - Red) / vm; + float g2 = (v - Green) / vm; + float b2 = (v - Blue) / vm; + + if (Red == v) + { + h = Green == m ? 5.0f + b2 : 1.0f - g2; + } + else if (Green == v) + { + h = Blue == m ? 1.0f + r2 : 3.0f - b2; + } + else + { + h = Red == m ? 3.0f + g2 : 5.0f - r2; + } + + h /= 6.0f; + + return (h, s, l); + } + + public static Color FromHsl(float hue, float saturation, float luminosity) + { + // adapted from Microsoft.Maui.Graphics/Color.cs (MIT license) + + if (luminosity == 0) + { + return new Color(0, 0, 0); + } + + if (saturation == 0) + { + return new Color(luminosity, luminosity, luminosity); + } + + float temp2 = luminosity <= 0.5f + ? luminosity * (1.0f + saturation) + : luminosity + saturation - luminosity * saturation; + float temp1 = 2.0f * luminosity - temp2; + + var t3 = new[] { hue + 1.0f / 3.0f, hue, hue - 1.0f / 3.0f }; + var clr = new float[] { 0, 0, 0 }; + for (var i = 0; i < 3; i++) + { + if (t3[i] < 0) + { + t3[i] += 1.0f; + } + + if (t3[i] > 1) + { + t3[i] -= 1.0f; + } + + if (6.0 * t3[i] < 1.0) + { + clr[i] = temp1 + (temp2 - temp1) * t3[i] * 6.0f; + } + else if (2.0 * t3[i] < 1.0) + { + clr[i] = temp2; + } + else if (3.0 * t3[i] < 2.0) + { + clr[i] = temp1 + (temp2 - temp1) * (2.0f / 3.0f - t3[i]) * 6.0f; + } + else + { + clr[i] = temp1; + } + } + + return new Color(clr[0], clr[1], clr[2]); + } + + public Color WithLightness(float lightness = .5f) + { + (float h, float s, float l) = ToHsl(); + return FromHsl(h, s, lightness); + } + + public Color Lighten(float fraction = .5f) + { + (float h, float s, float l) = ToHsl(); + return FromHsl(h, s, l + (1 - l) * fraction); + } + + public Color Darken(float fraction = .5f) + { + (float h, float s, float l) = ToHsl(); + return FromHsl(h, s, l * fraction); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Colors.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Colors.cs new file mode 100644 index 000000000..498e5c9f4 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Colors.cs @@ -0,0 +1,176 @@ +/* + * Discussion and links to reference APIs: + * https://github.com/ScottPlot/ScottPlot/pull/1647#issuecomment-1152963629 + * + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public struct Colors + { + public static Color AliceBlue => new(240, 248, 255); + public static Color AntiqueWhite => new(250, 235, 215); + public static Color Aqua => new(0, 255, 255); + public static Color Aquamarine => new(127, 255, 212); + public static Color Azure => new(240, 255, 255); + public static Color Beige => new(245, 245, 220); + public static Color Bisque => new(255, 228, 196); + public static Color Black => new(0, 0, 0); + public static Color BlanchedAlmond => new(255, 235, 205); + public static Color Blue => new(0, 0, 255); + public static Color BlueViolet => new(138, 43, 226); + public static Color Brown => new(165, 42, 42); + public static Color BurlyWood => new(222, 184, 135); + public static Color CadetBlue => new(95, 158, 160); + public static Color Chartreuse => new(127, 255, 0); + public static Color Chocolate => new(210, 105, 30); + public static Color Coral => new(255, 127, 80); + public static Color CornflowerBlue => new(100, 149, 237); + public static Color Cornsilk => new(255, 248, 220); + public static Color Crimson => new(220, 20, 60); + public static Color Cyan => new(0, 255, 255); + public static Color DarkBlue => new(0, 0, 139); + public static Color DarkCyan => new(0, 139, 139); + public static Color DarkGoldenRod => new(184, 134, 11); + public static Color DarkGray => new(169, 169, 169); + public static Color DarkGrey => new(169, 169, 169); + public static Color DarkGreen => new(0, 100, 0); + public static Color DarkKhaki => new(189, 183, 107); + public static Color DarkMagenta => new(139, 0, 139); + public static Color DarkOliveGreen => new(85, 107, 47); + public static Color DarkOrange => new(255, 140, 0); + public static Color DarkOrchid => new(153, 50, 204); + public static Color DarkRed => new(139, 0, 0); + public static Color DarkSalmon => new(233, 150, 122); + public static Color DarkSeaGreen => new(143, 188, 143); + public static Color DarkSlateBlue => new(72, 61, 139); + public static Color DarkSlateGray => new(47, 79, 79); + public static Color DarkSlateGrey => new(47, 79, 79); + public static Color DarkTurquoise => new(0, 206, 209); + public static Color DarkViolet => new(148, 0, 211); + public static Color DeepPink => new(255, 20, 147); + public static Color DeepSkyBlue => new(0, 191, 255); + public static Color DimGray => new(105, 105, 105); + public static Color DimGrey => new(105, 105, 105); + public static Color DodgerBlue => new(30, 144, 255); + public static Color FireBrick => new(178, 34, 34); + public static Color FloralWhite => new(255, 250, 240); + public static Color ForestGreen => new(34, 139, 34); + public static Color Fuchsia => new(255, 0, 255); + public static Color Gainsboro => new(220, 220, 220); + public static Color GhostWhite => new(248, 248, 255); + public static Color Gold => new(255, 215, 0); + public static Color GoldenRod => new(218, 165, 32); + public static Color Gray => new(128, 128, 128); + public static Color Grey => new(128, 128, 128); + public static Color Green => new(0, 128, 0); + public static Color GreenYellow => new(173, 255, 47); + public static Color HoneyDew => new(240, 255, 240); + public static Color HotPink => new(255, 105, 180); + public static Color IndianRed => new(205, 92, 92); + public static Color Indigo => new(75, 0, 130); + public static Color Ivory => new(255, 255, 240); + public static Color Khaki => new(240, 230, 140); + public static Color Lavender => new(230, 230, 250); + public static Color LavenderBlush => new(255, 240, 245); + public static Color LawnGreen => new(124, 252, 0); + public static Color LemonChiffon => new(255, 250, 205); + public static Color LightBlue => new(173, 216, 230); + public static Color LightCoral => new(240, 128, 128); + public static Color LightCyan => new(224, 255, 255); + public static Color LightGoldenRodYellow => new(250, 250, 210); + public static Color LightGray => new(211, 211, 211); + public static Color LightGrey => new(211, 211, 211); + public static Color LightGreen => new(144, 238, 144); + public static Color LightPink => new(255, 182, 193); + public static Color LightSalmon => new(255, 160, 122); + public static Color LightSeaGreen => new(32, 178, 170); + public static Color LightSkyBlue => new(135, 206, 250); + public static Color LightSlateGray => new(119, 136, 153); + public static Color LightSlateGrey => new(119, 136, 153); + public static Color LightSteelBlue => new(176, 196, 222); + public static Color LightYellow => new(255, 255, 224); + public static Color Lime => new(0, 255, 0); + public static Color LimeGreen => new(50, 205, 50); + public static Color Linen => new(250, 240, 230); + public static Color Magenta => new(255, 0, 255); + public static Color Maroon => new(128, 0, 0); + public static Color MediumAquaMarine => new(102, 205, 170); + public static Color MediumBlue => new(0, 0, 205); + public static Color MediumOrchid => new(186, 85, 211); + public static Color MediumPurple => new(147, 112, 219); + public static Color MediumSeaGreen => new(60, 179, 113); + public static Color MediumSlateBlue => new(123, 104, 238); + public static Color MediumSpringGreen => new(0, 250, 154); + public static Color MediumTurquoise => new(72, 209, 204); + public static Color MediumVioletRed => new(199, 21, 133); + public static Color MidnightBlue => new(25, 25, 112); + public static Color MintCream => new(245, 255, 250); + public static Color MistyRose => new(255, 228, 225); + public static Color Moccasin => new(255, 228, 181); + public static Color NavajoWhite => new(255, 222, 173); + public static Color Navy => new(0, 0, 128); + public static Color OldLace => new(253, 245, 230); + public static Color Olive => new(128, 128, 0); + public static Color OliveDrab => new(107, 142, 35); + public static Color Orange => new(255, 165, 0); + public static Color OrangeRed => new(255, 69, 0); + public static Color Orchid => new(218, 112, 214); + public static Color PaleGoldenRod => new(238, 232, 170); + public static Color PaleGreen => new(152, 251, 152); + public static Color PaleTurquoise => new(175, 238, 238); + public static Color PaleVioletRed => new(219, 112, 147); + public static Color PapayaWhip => new(255, 239, 213); + public static Color PeachPuff => new(255, 218, 185); + public static Color Peru => new(205, 133, 63); + public static Color Pink => new(255, 192, 203); + public static Color Plum => new(221, 160, 221); + public static Color PowderBlue => new(176, 224, 230); + public static Color Purple => new(128, 0, 128); + public static Color RebeccaPurple => new(102, 51, 153); + public static Color Red => new(255, 0, 0); + public static Color RosyBrown => new(188, 143, 143); + public static Color RoyalBlue => new(65, 105, 225); + public static Color SaddleBrown => new(139, 69, 19); + public static Color Salmon => new(250, 128, 114); + public static Color SandyBrown => new(244, 164, 96); + public static Color SeaGreen => new(46, 139, 87); + public static Color SeaShell => new(255, 245, 238); + public static Color Sienna => new(160, 82, 45); + public static Color Silver => new(192, 192, 192); + public static Color SkyBlue => new(135, 206, 235); + public static Color SlateBlue => new(106, 90, 205); + public static Color SlateGray => new(112, 128, 144); + public static Color SlateGrey => new(112, 128, 144); + public static Color Snow => new(255, 250, 250); + public static Color SpringGreen => new(0, 255, 127); + public static Color SteelBlue => new(70, 130, 180); + public static Color Tan => new(210, 180, 140); + public static Color Teal => new(0, 128, 128); + public static Color Thistle => new(216, 191, 216); + public static Color Tomato => new(255, 99, 71); + public static Color Transparent => Black.WithAlpha(0); + public static Color Turquoise => new(64, 224, 208); + public static Color Violet => new(238, 130, 238); + public static Color Wheat => new(245, 222, 179); + public static Color White => new(255, 255, 255); + public static Color WhiteSmoke => new(245, 245, 245); + public static Color Yellow => new(255, 255, 0); + public static Color YellowGreen => new(154, 205, 50); + + /// + /// Default Windows Colors + /// + public class Windows : WindowsStandardColors + { + } + + /// + /// Colors from the xkcd color name survey + /// https://xkcd.com/color/rgb/ + /// + public class Xkcd : XkcdColors + { + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/ConnectStyle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/ConnectStyle.cs new file mode 100644 index 000000000..5e1cd2dc5 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/ConnectStyle.cs @@ -0,0 +1,20 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public enum ConnectStyle + { + /// + /// Connect points with straight lines + /// + Straight, + + /// + /// Connect points with a line horizontally, then vertically + /// + StepHorizontal, + + /// + /// Connect points with a line vertically, then horizontally + /// + StepVertical, + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/CoordinateLine.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/CoordinateLine.cs new file mode 100644 index 000000000..df1e778d8 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/CoordinateLine.cs @@ -0,0 +1,32 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Represents a straight line in coordinate space + /// + public readonly struct CoordinateLine + { + public readonly double X1; + public readonly double X2; + public readonly double Y1; + public readonly double Y2; + + public Coordinates Start => new(X1, Y1); + public Coordinates End => new(X2, Y2); + + public CoordinateLine(double x1, double y1, double x2, double y2) + { + X1 = x1; + Y1 = y1; + X2 = x2; + Y2 = y2; + } + + public CoordinateLine(Coordinates pt1, Coordinates pt2) + { + X1 = pt1.X; + Y1 = pt1.Y; + X2 = pt2.X; + Y2 = pt2.Y; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/CoordinateRange.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/CoordinateRange.cs new file mode 100644 index 000000000..73beb249b --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/CoordinateRange.cs @@ -0,0 +1,27 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public readonly record struct CoordinateRange(double Min, double Max) + { + public double Span => Max - Min; + public double Center => (Min + Max) / 2; + public static CoordinateRange Infinity => new(double.NegativeInfinity, double.PositiveInfinity); + public static CoordinateRange NotSet => new(double.PositiveInfinity, double.NegativeInfinity); + public bool IsReal => NumericConversion.IsReal(Max) && NumericConversion.IsReal(Min); + + public bool Contains(double value) + { + if (value < Min) + { + return false; + } + else if (value > Max) + { + return false; + } + else + { + return true; + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/CoordinateRangeMutable.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/CoordinateRangeMutable.cs new file mode 100644 index 000000000..439392c70 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/CoordinateRangeMutable.cs @@ -0,0 +1,189 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ +// TODO: strangle this class and replace with CoordinateRangeStruct + + /// + /// Represents a range of values between two coordinates on a single axis + /// + public class + CoordinateRangeMutable : IEquatable // TODO: rename to MutableCoordinateRange or something + { + public double Min { get; set; } + public double Max { get; set; } + public double Center => (Min + Max) / 2; + public double Span => Max - Min; + + // TODO: obsolete this + public bool HasBeenSet => NumericConversion.IsReal(Span) && Span != 0; + + public CoordinateRange ToCoordinateRange => new(Min, Max); + + public CoordinateRange ToRectifiedCoordinateRange => Min < Max ? new(Min, Max) : new(Max, Min); + + public CoordinateRangeMutable(double min, double max) + { + Min = min; + Max = max; + } + + public static CoordinateRangeMutable Infinity => new(double.NegativeInfinity, double.PositiveInfinity); + + public override string ToString() + { + return $"Min={Min}, Max={Max}, Span={Span}"; + } + + /// + /// Returns true if the given position is within the range (inclusive) + /// + public bool Contains(double position) + { + return position >= Min && position <= Max; + } + + // TODO: deprecate + /// + /// Expand the range if needed to include the given point + /// + public void Expand(double value) + { + if (double.IsNaN(value)) + { + return; + } + + if (double.IsNaN(Min) || value < Min) + { + Min = value; + } + + if (double.IsNaN(Max) || value > Max) + { + Max = value; + } + } + + // TODO: deprecate + /// + /// Expand this range if needed to ensure the given range is included + /// + public void Expand(CoordinateRangeMutable range) + { + Expand(range.Min); + Expand(range.Max); + } + + /// + /// Expand this range if needed to ensure the given range is included + /// + public void Expand(CoordinateRange range) + { + Expand(range.Min); + Expand(range.Max); + } + + /// + /// This infinite inverted range is used to indicate a range that has not yet been set + /// + public static CoordinateRangeMutable NotSet => new(double.PositiveInfinity, double.NegativeInfinity); + + // TODO: deprecate + /// + /// Reset this range to inverted infinite values to indicate the range has not yet been set + /// + public void Reset() + { + Min = double.PositiveInfinity; + Max = double.NegativeInfinity; + if (HasBeenSet) + { + throw new InvalidOperationException(); + } + } + + public void Set(double min, double max) + { + Min = min; + Max = max; + } + + public void Set(CoordinateRangeMutable range) + { + Min = range.Min; + Max = range.Max; + } + + public void Pan(double delta) + { + Min += delta; + Max += delta; + } + + public void PanMouse(float mouseDeltaPx, float dataSizePx) + { + double pxPerUnitx = dataSizePx / Span; + double delta = mouseDeltaPx / pxPerUnitx; + Pan(delta); + } + + public void ZoomFrac(double frac) + { + ZoomFrac(frac, Center); + } + + public void ZoomMouseDelta(float deltaPx, float dataSizePx) + { + double deltaFracX = deltaPx / (Math.Abs(deltaPx) + dataSizePx); + double fracX = Math.Pow(10, deltaFracX); + ZoomFrac(fracX); + } + + public void ZoomFrac(double frac, double zoomTo) + { + double spanLeftX = zoomTo - Min; + double spanRightX = Max - zoomTo; + Min = zoomTo - spanLeftX / frac; + Max = zoomTo + spanRightX / frac; + } + + public bool Equals(CoordinateRangeMutable? other) + { + if (other is null) + { + return false; + } + + return Equals(Min, other.Min) && Equals(Min, other.Min); + } + + public override bool Equals(object? obj) + { + if (obj is null) + { + return false; + } + + if (obj is CoordinateRangeMutable other) + { + return Equals(other); + } + + return false; + } + + public static bool operator ==(CoordinateRangeMutable a, CoordinateRangeMutable b) + { + return a.Equals(b); + } + + public static bool operator !=(CoordinateRangeMutable a, CoordinateRangeMutable b) + { + return !a.Equals(b); + } + + public override int GetHashCode() + { + return Min.GetHashCode() ^ Max.GetHashCode(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/CoordinateRect.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/CoordinateRect.cs new file mode 100644 index 000000000..0c5fdd01a --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/CoordinateRect.cs @@ -0,0 +1,158 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Describes a rectangle in 2D coordinate space. + /// + public struct CoordinateRect : IEquatable + { + public double Left { get; set; } + public double Right { get; set; } + public double Bottom { get; set; } + public double Top { get; set; } + + public double HorizontalCenter => (Right + Left) / 2; + public double VerticalCenter => (Top + Bottom) / 2; + + public Coordinates Center => new(HorizontalCenter, VerticalCenter); + public Coordinates TopLeft => new(Left, Top); + public Coordinates TopRight => new(Right, Top); + public Coordinates BottomLeft => new(Left, Bottom); + public Coordinates BottomRight => new(Bottom, Right); + + public CoordinateRange XRange => new(Left, Right); + public CoordinateRange YRange => new(Bottom, Top); + + public double Width => Right - Left; + public double Height => Top - Bottom; + public double Area => Width * Height; + public bool HasArea => Area != 0 && !double.IsNaN(Area) && !double.IsInfinity(Area); + + public CoordinateRect(CoordinateRange xRange, CoordinateRange yRange) + { + Left = xRange.Min; + Right = xRange.Max; + Bottom = yRange.Min; + Top = yRange.Max; + } + + public CoordinateRect(CoordinateRangeMutable xRange, CoordinateRangeMutable yRange) + { + Left = xRange.Min; + Right = xRange.Max; + Bottom = yRange.Min; + Top = yRange.Max; + } + + public CoordinateRect(Coordinates pt1, Coordinates pt2) + { + Left = Math.Min(pt1.X, pt2.X); + Right = Math.Max(pt1.X, pt2.X); + Bottom = Math.Min(pt1.Y, pt2.Y); + Top = Math.Max(pt1.Y, pt2.Y); + } + + public CoordinateRect(double left, double right, double bottom, double top) + { + Left = left; + Right = right; + Bottom = bottom; + Top = top; + } + + public CoordinateRect(Coordinates point, CoordinateSize size) + { + Coordinates pt2 = new(point.X + size.Width, point.Y + size.Height); + Left = Math.Min(point.X, pt2.X); + Right = Math.Max(point.X, pt2.X); + Bottom = Math.Min(point.Y, pt2.Y); + Top = Math.Max(point.Y, pt2.Y); + } + + public bool Contains(double x, double y) + { + return x >= Left && x <= Right && y >= Bottom && y <= Top; + } + + public bool ContainsX(double x) + { + return x >= Left && x <= Right; + } + + public bool ContainsY(double y) + { + return y >= Bottom && y <= Top; + } + + public CoordinateRect Expanded(Coordinates point) + { + double exLeft = Left; + double exRight = Right; + double exBottom = Bottom; + double exTop = Top; + + if (!Contains(point)) + { + exLeft = Math.Min(exLeft, point.X); + exRight = Math.Max(exRight, point.X); + exBottom = Math.Min(exBottom, point.Y); + exTop = Math.Max(exTop, point.Y); + } + + return new CoordinateRect(exLeft, exRight, exBottom, exTop); + } + + public bool Contains(Coordinates point) => Contains(point.X, point.Y); + + public static CoordinateRect Empty => new(double.NaN, double.NaN, double.NaN, double.NaN); + + public CoordinateRect WithTranslation(Coordinates p) => new(Left + p.X, Right + p.X, Bottom + p.Y, Top + p.Y); + + public override string ToString() + { + return $"PixelRect: Left={Left} Right={Right} Bottom={Bottom} Top={Top}"; + } + + public bool Equals(CoordinateRect other) + { + return + Equals(Left, other.Left) && + Equals(Right, other.Right) && + Equals(Top, other.Top) && + Equals(Bottom, other.Bottom); + } + + public override bool Equals(object? obj) + { + if (obj is null) + { + return false; + } + + if (obj is CoordinateRect other) + { + return Equals(other); + } + + return false; + } + + public static bool operator ==(CoordinateRect a, CoordinateRect b) + { + return a.Equals(b); + } + + public static bool operator !=(CoordinateRect a, CoordinateRect b) + { + return !a.Equals(b); + } + + public override int GetHashCode() + { + return + Left.GetHashCode() ^ + Right.GetHashCode() ^ + Bottom.GetHashCode() ^ + Top.GetHashCode(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/CoordinateSize.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/CoordinateSize.cs new file mode 100644 index 000000000..7afb45a02 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/CoordinateSize.cs @@ -0,0 +1,50 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public struct CoordinateSize : IEquatable + { + public double Width; + public double Height; + public double Area => Width * Height; + + public CoordinateSize(double width, double height) + { + Width = width; + Height = height; + } + + public bool Equals(CoordinateSize other) + { + return Equals(Width, other.Width) && Equals(Height, other.Height); + } + + public override bool Equals(object? obj) + { + if (obj is null) + { + return false; + } + + if (obj is CoordinateSize other) + { + return Equals(other); + } + + return false; + } + + public static bool operator ==(CoordinateSize a, CoordinateSize b) + { + return a.Equals(b); + } + + public static bool operator !=(CoordinateSize a, CoordinateSize b) + { + return !a.Equals(b); + } + + public override int GetHashCode() + { + return Width.GetHashCode() ^ Height.GetHashCode(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Coordinates.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Coordinates.cs new file mode 100644 index 000000000..19314bc55 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Coordinates.cs @@ -0,0 +1,87 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Represents a point in coordinate space (X and Y axis units) + /// + public struct Coordinates : IEquatable + { + public double X { get; set; } + public double Y { get; set; } + + public bool AreReal => NumericConversion.IsReal(X) && NumericConversion.IsReal(Y); + + public Coordinates(double x, double y) + { + X = x; + Y = y; + } + + public double DistanceSquared(Coordinates pt) + { + double dX = Math.Abs(X - pt.X); + double dY = Math.Abs(Y - pt.Y); + return dX * dX + dY * dY; + } + + public double Distance(Coordinates pt) + { + return Math.Sqrt(DistanceSquared(pt)); + } + + public override string ToString() + { + return $"Coordinates {{ X = {X}, Y = {Y} }}"; + } + + public static Coordinates NaN => new(double.NaN, double.NaN); + + public static Coordinates Origin => new(0, 0); + + public static Coordinates Infinity => new(double.PositiveInfinity, double.PositiveInfinity); + + public bool Equals(Coordinates other) + { + return Equals(X, other.X) && Equals(Y, other.Y); + } + + public override bool Equals(object? obj) + { + if (obj is null) + { + return false; + } + + if (obj is Coordinates other) + { + return Equals(other); + } + + return false; + } + + public static bool operator ==(Coordinates a, Coordinates b) + { + return a.Equals(b); + } + + public static bool operator !=(Coordinates a, Coordinates b) + { + return !a.Equals(b); + } + + public override int GetHashCode() + { + return X.GetHashCode() ^ Y.GetHashCode(); + } + + public CoordinateRect ToRect(double radiusX, double radiusY) + { + return new CoordinateRect(X - radiusX, X + radiusX, Y - radiusY, Y + radiusY); + } + + public CoordinateRect ToRect(double radius) + { + return ToRect(radius, radius); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/CountingCollection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/CountingCollection.cs new file mode 100644 index 000000000..eaa6cb245 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/CountingCollection.cs @@ -0,0 +1,42 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal class CountingCollection where T : notnull + { + public readonly Dictionary Counts = []; + + public bool Any() => Counts.Any(); + public int Count => Counts.Count; + + public IEnumerable SortedKeys => Counts.OrderBy(x => x.Value).Select(x => x.Key); + + public void Add(T item) + { + if (Counts.ContainsKey(item)) + { + Counts[item]++; + } + else + { + Counts[item] = 1; + } + } + + public void AddRange(IEnumerable items) + { + foreach (T item in items) + { + Add(item); + } + } + + public override string ToString() + { + return $"CountingCollection<{typeof(T)}> with {Count} items"; + } + + public string GetLongString() + { + return string.Join(", ", SortedKeys.Select(x => $"{x} ({Counts[x]})")); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/DataPoint.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/DataPoint.cs new file mode 100644 index 000000000..3b36d002b --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/DataPoint.cs @@ -0,0 +1,30 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Represents a specific point in a DataSource + /// + public readonly struct DataPoint + { + public readonly double X; + public readonly double Y; + public readonly int Index; + public Coordinates Coordinates => new(X, Y); + public bool IsReal => NumericConversion.IsReal(X) && NumericConversion.IsReal(Y); + + public DataPoint(double x, double y, int index) + { + X = x; + Y = y; + Index = index; + } + + public DataPoint(Coordinates coordinates, int index) + { + X = coordinates.X; + Y = coordinates.Y; + Index = index; + } + + public static DataPoint None => new(double.NaN, double.NaN, -1); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Edge.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Edge.cs new file mode 100644 index 000000000..19cf9fb3d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Edge.cs @@ -0,0 +1,37 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public enum Edge + { + Left, + Right, + Bottom, + Top + } + + public static class EdgeExtensions + { + /// + /// True for bottom and top axes + /// + public static bool IsHorizontal(this Edge edge) => edge switch + { + Edge.Left => false, + Edge.Right => false, + Edge.Bottom => true, + Edge.Top => true, + _ => throw new NotImplementedException(edge.ToString()) + }; + + /// + /// True for left and right axes + /// + public static bool IsVertical(this Edge edge) => edge switch + { + Edge.Left => true, + Edge.Right => true, + Edge.Bottom => false, + Edge.Top => false, + _ => throw new NotImplementedException(edge.ToString()) + }; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/ExpandingAxisLimits.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/ExpandingAxisLimits.cs new file mode 100644 index 000000000..c6dc95b78 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/ExpandingAxisLimits.cs @@ -0,0 +1,228 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// A stateful analog to deisgned to expand to include given data + /// + public class ExpandingAxisLimits : IEquatable + { + public double Left { get; set; } = double.NaN; + public double Right { get; set; } = double.NaN; + public double Bottom { get; set; } = double.NaN; + public double Top { get; set; } = double.NaN; + public double HorizontalSpan => Right - Left; + public double VerticalSpan => Top - Bottom; + public bool IsRealX => NumericConversion.AreReal(Left, Right); + public bool IsRealY => NumericConversion.AreReal(Bottom, Top); + public bool IsReal => IsRealX && IsRealY; + public bool HasArea => IsReal && HorizontalSpan != 0 && VerticalSpan != 0; + + public AxisLimits AxisLimits => new(Left, Right, Bottom, Top); + + /// + /// Create a new set of expanding axis limits with no leimits set initially + /// + public ExpandingAxisLimits() + { + } + + /// + /// Create a new set of expanding axis limits starting from the given axis limits + /// + public ExpandingAxisLimits(AxisLimits initialLimits) + { + Expand(initialLimits); + } + + public override string ToString() + { + return $"Expanding Limits: X=[{Left}, {Right}] Y=[{Bottom}, {Top}]"; + } + + public void SetX(double left, double right) + { + Left = left; + Right = right; + } + + public void SetY(double bottom, double top) + { + Bottom = bottom; + Top = top; + } + + // TODO: Methods like Expand() should be fluent, named Expanded(), and returning this object + + /// + /// Expanded limits to include the given and . + /// + public void Expand(double x, double y) + { + ExpandX(x); + ExpandY(y); + } + + /// + /// Expanded limits to include the given . + /// + public void ExpandX(double x) + { + // if incoming is NaN do nothing + if (double.IsNaN(x)) + { + return; + } + + // if existing is NaN, use the new value + if (double.IsNaN(Left)) + { + Left = x; + } + + if (double.IsNaN(Right)) + { + Right = x; + } + + // otherwise use minmax + Left = Math.Min(Left, x); + Right = Math.Max(Right, x); + } + + /// + /// Expanded limits to include the given . + /// + public void ExpandY(double y) + { + // if incoming is NaN do nothing + if (double.IsNaN(y)) + { + return; + } + + // if existing is NaN, use the new value + if (double.IsNaN(Bottom)) + { + Bottom = y; + } + + if (double.IsNaN(Top)) + { + Top = y; + } + + // otherwise use minmax + Bottom = Math.Min(Bottom, y); + Top = Math.Max(Top, y); + } + + /// + /// Expanded limits to include the given . + /// + public void Expand(Coordinates coordinates) + { + Expand(coordinates.X, coordinates.Y); + } + + /// + /// Expanded limits to include the given . + /// + public void Expand(IReadOnlyList coordinates) + { + foreach (Coordinates coordinate in coordinates) + { + Expand(coordinate); + } + } + + public void Expand(CoordinateRect rect) + { + Expand(rect.Left, rect.Top); + Expand(rect.Right, rect.Bottom); + } + + public void Expand(AxisLimits limits) + { + ExpandX(limits); + ExpandY(limits); + } + + public void ExpandX(AxisLimits limits) + { + ExpandX(limits.Left); + ExpandX(limits.Right); + } + + public void ExpandY(AxisLimits limits) + { + ExpandY(limits.Bottom); + ExpandY(limits.Top); + } + + public bool Equals(ExpandingAxisLimits? other) + { + if (other is null) + { + return false; + } + + return + Equals(Left, other.Left) && + Equals(Right, other.Right) && + Equals(Top, other.Top) && + Equals(Bottom, other.Bottom); + } + + public bool Equals(AxisLimits other) + { + return + Equals(Left, other.Left) && + Equals(Right, other.Right) && + Equals(Top, other.Top) && + Equals(Bottom, other.Bottom); + } + + public override bool Equals(object? obj) + { + if (obj is null) + { + return false; + } + + if (obj is ExpandingAxisLimits other) + { + return Equals(other); + } + + return false; + } + + public static bool operator ==(ExpandingAxisLimits a, ExpandingAxisLimits b) + { + return a.Equals(b); + } + + public static bool operator !=(ExpandingAxisLimits a, ExpandingAxisLimits b) + { + return !a.Equals(b); + } + + public static bool operator ==(ExpandingAxisLimits a, AxisLimits b) + { + return a.Equals(b); + } + + public static bool operator !=(ExpandingAxisLimits a, AxisLimits b) + { + return !a.Equals(b); + } + + public override int GetHashCode() + { + return + Left.GetHashCode() ^ + Right.GetHashCode() ^ + Bottom.GetHashCode() ^ + Top.GetHashCode(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/FillStyle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/FillStyle.cs new file mode 100644 index 000000000..7b67f7da1 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/FillStyle.cs @@ -0,0 +1,15 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This configuration object (reference type) permanently lives inside objects which require styling. + /// It is recommended to use this object as an init-only property. + /// + public class FillStyle + { + public Color Color { get; set; } = Colors.Black; + public Color HatchColor { get; set; } = Colors.Gray; + public IHatch? Hatch { get; set; } = null; + public bool HasValue => Color != Colors.Transparent || Hatch is not null && HatchColor != Colors.Transparent; + public bool AntiAlias = true; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/FontStyle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/FontStyle.cs new file mode 100644 index 000000000..f880fbf5f --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/FontStyle.cs @@ -0,0 +1,91 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This configuration object (reference type) permanently lives inside objects which require styling. + /// It is recommended to use this object as an init-only property. + /// + public class FontStyle + { + /* Typefaces are cached to improve performance. + * https://github.com/ScottPlot/ScottPlot/issues/2833 + * https://github.com/ScottPlot/ScottPlot/pull/2848 + */ + + private SKTypeface? _cachedTypeface = null; + + public SKTypeface Typeface => _cachedTypeface ?? CreateTypeface(Name, Bold, Italic); + + private string _name = Fonts.Default; + + public string Name + { + get => _name; + set + { + bool fieldChanged = string.Compare(_name, value, StringComparison.InvariantCultureIgnoreCase) != 0; + + if (fieldChanged) + { + ClearCachedTypeface(); + } + + _name = value; + } + } + + private bool _bold = false; + + public bool Bold + { + get => _bold; + set + { + bool fieldChanged = _bold != value; + + if (fieldChanged) + { + ClearCachedTypeface(); + } + + _bold = value; + } + } + + private bool _italic = false; + + public bool Italic + { + get => _italic; + set + { + bool fieldChanged = _italic != value; + + if (fieldChanged) + { + ClearCachedTypeface(); + } + + _italic = value; + } + } + + // TODO: consider whether color really belongs here... + public Color Color { get; set; } = Colors.Black; + public float Size { get; set; } = 12; + public bool AntiAlias { get; set; } = true; + + private void ClearCachedTypeface() + { + _cachedTypeface = null; + } + + public static SKTypeface CreateTypeface(string font, bool bold, bool italic) + { + SKFontStyleWeight weight = bold ? SKFontStyleWeight.Bold : SKFontStyleWeight.Normal; + SKFontStyleSlant slant = italic ? SKFontStyleSlant.Italic : SKFontStyleSlant.Upright; + SKFontStyleWidth width = SKFontStyleWidth.Normal; + SKFontStyle skfs = new(weight, width, slant); + return SKTypeface.FromFamilyName(font, skfs); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/FontWeight.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/FontWeight.cs new file mode 100644 index 000000000..4288660df --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/FontWeight.cs @@ -0,0 +1,16 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public enum FontWeight + { + Thin = 100, + ExtraLight = 200, + Light = 300, + Normal = 400, + Medium = 500, + SemiBold = 600, + Bold = 700, + ExtraBold = 800, + Black = 900, + ExtraBlack = 1000, + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/IAutoScaler.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/IAutoScaler.cs new file mode 100644 index 000000000..852c6d104 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/IAutoScaler.cs @@ -0,0 +1,24 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Contains logic for determining new axis limits when Autoscale() is called + /// + public interface IAutoScaler + { + /// + /// Return the recommended axis limits for the plottables that use the given axes + /// + AxisLimits GetAxisLimits(Plot plot, IXAxis xAxis, IYAxis yAxis); + + /// + /// Autoscale every unset axis used by plottables. + /// + public void AutoScaleAll(IEnumerable plottables); + + // TODO: GetRecommendedAxisLimits() should return a dictionary of limits by axis, + // then both functions can be collapsed into one. + + public bool InvertedX { get; set; } + public bool InvertedY { get; set; } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Image.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Image.cs new file mode 100644 index 000000000..62ccfb34f --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Image.cs @@ -0,0 +1,123 @@ +/* SkiaSharp cannot create BMP files, so bitmap IO is implemented manually + * https://github.com/mono/SkiaSharp/issues/320 + */ + +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Bitmap representation of a + /// + public class Image : IDisposable + { + private bool _isDisposed = false; + + protected readonly SKImage SkImage; + public int Width => SkImage.Width; + public int Height => SkImage.Height; + + public Image(SKImage skiaImage) + { + SkImage = skiaImage; + } + + /// + /// SkiaSharp cannot natively create BMP files. + /// This function creates bitmaps in memory manually. + /// https://github.com/mono/SkiaSharp/issues/320 + /// + private byte[] GetBitmapBytes() + { + using SKBitmap skBitmap = SKBitmap.FromImage(SkImage); + + BitmapHeader header = new(Width, Height); + + byte[] bitmapBytes = new byte[skBitmap.Bytes.Length + BitmapHeader.FileHeaderSize]; + + IntPtr pHeader = IntPtr.Zero; + + try + { + pHeader = Marshal.AllocHGlobal(BitmapHeader.FileHeaderSize); + Marshal.StructureToPtr(header, pHeader, false); + + // copy the header from the bytes of our custom bitmap header struct + Marshal.Copy(pHeader, bitmapBytes, 0, BitmapHeader.FileHeaderSize); + + // copy the content of the bitmap from the SkiaSharp image + Array.Copy(skBitmap.Bytes, 0, bitmapBytes, BitmapHeader.FileHeaderSize, skBitmap.Bytes.Length); + } + finally + { + Marshal.FreeHGlobal(pHeader); + } + + return bitmapBytes; + } + + public byte[] GetImageBytes(ImageFormat format = ImageFormat.Png, int quality = 100) + { + SKEncodedImageFormat skFormat = format.ToSkFormat(); + + if (format == ImageFormat.Bmp) + { + return GetBitmapBytes(); + } + + using var skData = SkImage.Encode(skFormat, quality); + return skData.ToArray(); + } + + public string SaveJpeg(string path, int quality = 85) + { + byte[] bytes = GetImageBytes(ImageFormat.Jpeg, quality); + File.WriteAllBytes(path, bytes); + return Path.GetFullPath(path); + } + + public string SavePng(string path) + { + byte[] bytes = GetImageBytes(ImageFormat.Png, 100); + File.WriteAllBytes(path, bytes); + return Path.GetFullPath(path); + } + + public string SaveBmp(string path) + { + byte[] bytes = GetImageBytes(ImageFormat.Bmp, 100); + File.WriteAllBytes(path, bytes); + return Path.GetFullPath(path); + } + + public string SaveWebp(string path, int quality = 85) + { + byte[] bytes = GetImageBytes(ImageFormat.Webp, quality); + File.WriteAllBytes(path, bytes); + return Path.GetFullPath(path); + } + + public string Save(string path, ImageFormat format = ImageFormat.Png, int quality = 85) + { + return format switch + { + ImageFormat.Png => SavePng(path), + ImageFormat.Jpeg => SaveJpeg(path, quality), + ImageFormat.Webp => SaveWebp(path, quality), + ImageFormat.Bmp => SaveBmp(path), + _ => throw new ArgumentException($"Unsupported image format: {format}"), + }; + } + + public void Dispose() + { + if (_isDisposed) + { + return; + } + + SkImage.Dispose(); + _isDisposed = true; + + GC.SuppressFinalize(this); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/ImageFormat.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/ImageFormat.cs new file mode 100644 index 000000000..1539ff430 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/ImageFormat.cs @@ -0,0 +1,53 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public enum ImageFormat + { + Bmp, + Jpeg, + Png, + Webp, + Svg, + } + + public static class ImageFormatExtensions + { + public static bool IsRasterFormat(this ImageFormat format) + { + return format switch + { + ImageFormat.Bmp => true, + ImageFormat.Jpeg => true, + ImageFormat.Png => true, + ImageFormat.Webp => true, + ImageFormat.Svg => false, + _ => throw new ArgumentException($"unknown image format: '{format}'") + }; + } + } + + public static class ImageFormatLookup + { + public static ImageFormat FromFileExtension(string ext) + { + if (!ext.StartsWith(".")) + { + throw new ArgumentException("extension must start with '.'"); + } + + return ext.ToLowerInvariant() switch + { + ".jpg" or ".jpeg" => ImageFormat.Jpeg, + ".png" => ImageFormat.Png, + ".bmp" => ImageFormat.Bmp, + ".webp" => ImageFormat.Webp, + ".svg" => ImageFormat.Svg, + _ => throw new ArgumentException($"unknown image format: '{ext}'") + }; + } + + public static ImageFormat FromFilePath(string path) + { + return FromFileExtension(Path.GetExtension(path)); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/IndexRange.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/IndexRange.cs new file mode 100644 index 000000000..c347abc45 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/IndexRange.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Represents a range of indexes in an array (inclusive) + /// + public readonly record struct IndexRange(int Min, int Max) + { + public int Length => Max - Min + 1; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Label.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Label.cs new file mode 100644 index 000000000..b5cd6c007 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Label.cs @@ -0,0 +1,210 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Label + { + public bool IsVisible { get; set; } = true; + public string Text { get; set; } = string.Empty; + + public Alignment Alignment { get; set; } = 0; + + /// + /// Rotation in degrees clockwise from 0 (horizontal text) + /// + public float Rotation { get; set; } = 0; + + public Color ForeColor { get; set; } = Colors.Black; + + public Color BackColor { get; set; } = Colors.Transparent; + + public Color BorderColor { get; set; } = Colors.Transparent; + + public float BorderWidth { get; set; } = 1; + + // TODO: use a class for cached typeface management + + public bool UseCachedTypefaces = true; + private SKTypeface? _cachedTypeface = null; + + private SKTypeface Typeface => UseCachedTypefaces && _cachedTypeface is not null + ? _cachedTypeface + : FontStyle.CreateTypeface(FontName, Bold, Italic); + + private string _fontName = Fonts.Default; + + public string FontName + { + get => _fontName; + set + { + _fontName = value; + ClearCachedTypeface(); + } + } + + private float _fontSize = 12; + + public float FontSize + { + get => _fontSize; + set + { + _fontSize = value; + ClearCachedTypeface(); + } + } + + private bool _bold = false; + + public bool Bold + { + get => _bold; + set + { + _bold = value; + ClearCachedTypeface(); + } + } + + public bool Italic = false; + public bool AntiAlias = true; + public float Padding = 0; + + public float PointSize = 0; + public bool PointFilled = false; + public Color PointColor = Colors.Magenta; + + public float OffsetX = 0; // TODO: automatic padding support for arbitrary rotations + public float OffsetY = 0; // TODO: automatic padding support for arbitrary rotations + + /// + /// Use the characters in to detetermine an installed + /// system font most likely to support this character set. + /// + public void SetBestFont() + { + FontName = Fonts.Detect(Text); + } + + public void ClearCachedTypeface() + { + _cachedTypeface = null; + } + + private void ApplyPointPaint(SKPaint paint) + { + paint.IsStroke = !PointFilled; + paint.StrokeWidth = 1; + paint.Color = PointColor.ToSkColor(); + paint.IsAntialias = AntiAlias; + } + + private void ApplyBorderPaint(SKPaint paint) + { + paint.IsStroke = true; + paint.StrokeWidth = BorderWidth; + paint.Color = BorderColor.ToSkColor(); + paint.IsAntialias = AntiAlias; + } + + private void ApplyBackgroundPaint(SKPaint paint) + { + paint.IsStroke = false; + paint.Color = BackColor.ToSkColor(); + paint.IsAntialias = AntiAlias; + } + + private void ApplyTextPaint(SKPaint paint) + { + paint.TextAlign = SKTextAlign.Left; + paint.IsStroke = false; + paint.Typeface = Typeface; + paint.TextSize = FontSize; + paint.Color = ForeColor.ToSkColor(); + paint.IsAntialias = AntiAlias; + } + + public void ApplyToPaint(SKPaint paint) + { + ApplyTextPaint(paint); + } + + public void Render(SKCanvas canvas, Pixel pixel) + { + Render(canvas, pixel.X, pixel.Y); + } + + public void Render(SKCanvas canvas, float x, float y) + { + using SKPaint paint = new(); + Render(canvas, x, y, paint); + } + + public PixelSize Measure() + { + using SKPaint paint = new(); + return Measure(paint); + } + + public PixelSize Measure(SKPaint paint) + { + ApplyTextPaint(paint); + SKRect textBounds = new(); + ///INFO: MeasureText(string str, ref SKRect rect) works as follow: + /// - returned value is the length of the text with leading and trailing white spaces + /// - rect.Left contains the width of leading white spaces + /// - rect.width contains the length of the text __without__ leading or trailing white spaces + var fullTextWidth = paint.MeasureText(Text, ref textBounds); + return new PixelSize(fullTextWidth, textBounds.Height); + } + + public void Render(SKCanvas canvas, float x, float y, SKPaint paint) + { + PixelSize size = Measure(paint); + + float xOffset = size.Width * Alignment.HorizontalFraction(); + float yOffset = size.Height * Alignment.VerticalFraction(); + PixelRect textRect = new(0, size.Width, size.Height, 0); + textRect = textRect.WithDelta(-xOffset, yOffset - size.Height); + PixelRect backgroundRect = textRect.Expand(Padding); + + canvas.Save(); + canvas.Translate(x + OffsetX, y + OffsetY); // compensate for padding + canvas.RotateDegrees(Rotation); + ApplyBackgroundPaint(paint); + canvas.DrawRect(backgroundRect.ToSkRect(), paint); + ApplyTextPaint(paint); + + if (Text.Contains('\n')) + { + // TODO: multiline support could be significantly improved + string[] lines = Text.Split('\n'); + for (int i = 0; i < lines.Length; i++) + { + canvas.DrawText(lines[i], textRect.Left, textRect.Bottom + i * paint.FontSpacing, paint); + } + } + else + { + canvas.DrawText(Text, textRect.Left, textRect.Bottom, paint); + } + + ApplyBorderPaint(paint); + canvas.DrawRect(backgroundRect.ToSkRect(), paint); + canvas.Restore(); + + canvas.Save(); + canvas.Translate(x, y); // do not compensate for padding + canvas.RotateDegrees(Rotation); + + if (PointSize > 0) + { + ApplyPointPaint(paint); + canvas.DrawCircle(0, 0, PointSize, paint); + } + + canvas.DrawLine(-PointSize, 0, PointSize, 0, paint); + canvas.DrawLine(0, -PointSize, 0, PointSize, paint); + canvas.Restore(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Layout.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Layout.cs new file mode 100644 index 000000000..b8a40e920 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Layout.cs @@ -0,0 +1,49 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public struct Layout : IEquatable + { + /// + /// Size of the figure this layout represents + /// + public readonly PixelRect FigureRect { get; } + + /// + /// Final size of the data area + /// + public readonly PixelRect DataRect { get; } + + /// + /// Distance (pixels) each panel is to be placed from the edge of the data rectangle + /// + public readonly Dictionary PanelOffsets { get; } + + /// + /// Size (pixels) of each panel in the dimension perpendicular to the data edge it is placed on + /// + public readonly Dictionary PanelSizes { get; } + + public Layout(PixelRect figureRect, PixelRect dataRect, Dictionary sizes, + Dictionary offsets) + { + FigureRect = figureRect; + DataRect = dataRect; + PanelSizes = sizes; + PanelOffsets = offsets; + } + + public bool Equals(Layout other) + { + if (!FigureRect.Equals(other.FigureRect)) + { + return false; + } + + if (!DataRect.Equals(other.DataRect)) + { + return false; + } + + return true; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/LegendItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/LegendItem.cs new file mode 100644 index 000000000..351455e1c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/LegendItem.cs @@ -0,0 +1,112 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class LegendItem + { + public string? Label { get; set; } + public LineStyle Line { get; set; } = new(); + + public Color LineColor + { + get => Line.Color; + set => Line.Color = value; + } + + public float LineWidth + { + get => Line.Width; + set => Line.Width = value; + } + + public MarkerStyle Marker { get; set; } = MarkerStyle.Default; + + public Color MarkerColor + { + get => Marker.Fill.Color; + set + { + Marker.Fill.Color = value; + Marker.Outline.Color = value; + } + } + + public FillStyle Fill { get; set; } = new() { Color = Colors.Transparent }; + + public Color FillColor + { + get => Fill.Color; + set => Fill.Color = value; + } + + public IEnumerable Children { get; set; } = Array.Empty(); + public bool HasSymbol => Line.Width > 0 || Marker.IsVisible || Fill.HasValue; + public bool IsVisible => !string.IsNullOrEmpty(Label); + + public static IEnumerable None => Array.Empty(); + + public static IEnumerable Single(LegendItem item) + { + return new LegendItem[] { item }; + } + + public static IEnumerable Single(string label, MarkerStyle markerStyle) + { + LegendItem item = new() + { + Label = label, + Marker = markerStyle, + Line = LineStyle.None, + }; + + return Single(item); + } + + public static IEnumerable Single(string label, LineStyle lineStyle) + { + LegendItem item = new() + { + Label = label, + Marker = MarkerStyle.None, + Line = lineStyle, + }; + + return Single(item); + } + + public static IEnumerable Single(string label, FillStyle fillStyle) + { + LegendItem item = new() + { + Label = label, + Marker = MarkerStyle.None, + Fill = fillStyle, + }; + + return Single(item); + } + + public static IEnumerable Single(string label, FillStyle fillStyle, LineStyle lineStyle) + { + LegendItem item = new() + { + Label = label, + Marker = MarkerStyle.None, + Fill = fillStyle, + Line = lineStyle, + }; + + return Single(item); + } + + public static IEnumerable Single(string label, LineStyle lineStyle, MarkerStyle markerStyle) + { + LegendItem item = new() + { + Label = label, + Marker = markerStyle, + Line = lineStyle, + }; + + return Single(item); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Line.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Line.cs new file mode 100644 index 000000000..a3a73a49e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Line.cs @@ -0,0 +1,56 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Represents an line on screen defined by the endpoints, pattern, and style. + /// + public class Line + { + public Coordinates Start { get; set; } + public Coordinates End { get; set; } + public static Line Default => new(0, 0, 1, 1); + public LineStyle Style { get; set; } = new LineStyle(); + + /// + /// Create a default line using x and y values + /// + public Line(double x1, double y1, double x2, double y2) + { + Start = new Coordinates(x1, y1); + End = new Coordinates(x2, y2); + } + + /// + /// Create a default line using coordinates + /// + public Line(Coordinates start, Coordinates end) + { + Start = start; + End = end; + } + + /// + /// Create a styled line using x and y values, LinePattern, and LineStyle information + /// + public Line(double x1, double y1, double x2, double y2, LineStyle style) + { + Start = new Coordinates(x1, y1); + End = new Coordinates(x2, y2); + Style = style; + } + + /// + /// Create a styled line using coordinates, LinePattern, and LineStyle information + /// + public Line(Coordinates start, Coordinates end, LineStyle style) + { + Start = start; + End = end; + Style = style; + } + + public override string ToString() + { + return $"Line {{ X1 = {Start.X}, Y1 = {Start.Y}, X2 = {End.X}, Y2 = {End.Y} }}"; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/LinePattern.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/LinePattern.cs new file mode 100644 index 000000000..5ce6da7d9 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/LinePattern.cs @@ -0,0 +1,30 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + // NOTE: names are consistent with matplotlib linestyles +// https://matplotlib.org/stable/gallery/lines_bars_and_markers/linestyles.html + +// TODO: add support for more line styles + + public enum LinePattern + { + Solid, + Dashed, + DenselyDashed, + Dotted, + } + + public static class LinePatternExtensions + { + public static SKPathEffect? GetPathEffect(this LinePattern pattern) + { + return pattern switch + { + LinePattern.Solid => null, + LinePattern.Dashed => SKPathEffect.CreateDash(new float[] { 10, 10 }, 0), + LinePattern.DenselyDashed => SKPathEffect.CreateDash(new float[] { 6, 6 }, 0), + LinePattern.Dotted => SKPathEffect.CreateDash(new float[] { 3, 5 }, 0), + _ => throw new NotImplementedException($"Line pattern '{pattern}' has no matching path effect"), + }; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/LineStyle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/LineStyle.cs new file mode 100644 index 000000000..5c07b30b0 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/LineStyle.cs @@ -0,0 +1,32 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This configuration object (reference type) permanently lives inside objects which require styling. + /// It is recommended to use this object as an init-only property. + /// + public class LineStyle + { + public float Width { get; set; } = 1.0f; + public Color Color { get; set; } = Colors.Black; + public LinePattern Pattern { get; set; } = LinePattern.Solid; + public bool IsVisible { get; set; } = true; + public static LineStyle None => new() { IsVisible = false }; + public bool AntiAlias { get; set; } = true; + + public void Render(SKCanvas canvas, SKPaint paint, PixelLine line) + { + if (IsVisible == false) + { + return; + } + + if (Width == 0) + { + return; + } + + this.ApplyToPaint(paint); + canvas.DrawLine(line.X1, line.Y1, line.X2, line.Y2, paint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Location.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Location.cs new file mode 100644 index 000000000..9df6cf4cf --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Location.cs @@ -0,0 +1,64 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Describes X/Y location in pixel or coordinate space + /// + public class Location + { + public LocationUnit Unit { get; init; } + public double X { get; set; } + public double Y { get; set; } + + private Location() + { + } + + public Pixel GetPixel() + { + if (Unit != LocationUnit.Pixel) + { + throw new InvalidOperationException("units are not pixels"); + } + + return new Pixel(X, Y); + } + + public Coordinates GetCoordinates() + { + if (Unit != LocationUnit.Coordinates) + { + throw new InvalidOperationException("units are not pixels"); + } + + return new Coordinates(X, Y); + } + + public static Location Pixel(float x, float y) + { + return new Location() + { + X = x, + Y = y, + Unit = LocationUnit.Pixel + }; + } + + public static Location Coordinates(float x, float y) + { + return new Location() + { + X = x, + Y = y, + Unit = LocationUnit.Coordinates + }; + } + + public static Location Unspecified => + new() + { + X = double.NaN, + Y = double.NaN, + Unit = LocationUnit.Unspecified + }; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/LocationUnit.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/LocationUnit.cs new file mode 100644 index 000000000..1c33cbd44 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/LocationUnit.cs @@ -0,0 +1,9 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public enum LocationUnit + { + Unspecified, + Coordinates, + Pixel, + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/MarkerShape.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/MarkerShape.cs new file mode 100644 index 000000000..b5745840c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/MarkerShape.cs @@ -0,0 +1,63 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public enum MarkerShape + { + None, + FilledCircle, + OpenCircle, + FilledSquare, + OpenSquare, + FilledTriangleUp, + OpenTriangleUp, + FilledTriangleDown, + OpenTriangleDown, + FilledDiamond, + OpenDiamond, + Eks, + Cross, + VerticalBar, + HorizontalBar, + TriUp, + TriDown, + Asterisk, + HashTag, + } + + public static class MarkerShapeExtensions + { + public static IMarker GetRenderer(this MarkerShape shape) + { + return shape switch + { + MarkerShape.FilledCircle or MarkerShape.OpenCircle => new Circle(), + MarkerShape.FilledSquare or MarkerShape.OpenSquare => new SquareMarker(), + MarkerShape.FilledTriangleUp or MarkerShape.OpenTriangleUp => new TriangleUp(), + MarkerShape.FilledTriangleDown or MarkerShape.OpenTriangleDown => new TriangleDown(), + MarkerShape.FilledDiamond or MarkerShape.OpenDiamond => new Diamond(), + MarkerShape.Eks => new Eks(), + MarkerShape.Cross => new Cross(), + MarkerShape.VerticalBar => new VerticalBar(), + MarkerShape.HorizontalBar => new HorizontalBar(), + MarkerShape.TriUp => new TriUp(), + MarkerShape.TriDown => new TriDown(), + MarkerShape.Asterisk => new Asterisk(), + MarkerShape.HashTag => new HashTag(), + MarkerShape.None => new None(), + _ => throw new NotImplementedException(shape.ToString()), + }; + } + + public static bool IsOutlined(this MarkerShape shape) + { + return shape switch + { + (MarkerShape.OpenCircle or MarkerShape.OpenSquare or MarkerShape.OpenTriangleUp or + MarkerShape.OpenTriangleDown or MarkerShape.OpenDiamond or MarkerShape.Eks or + MarkerShape.Cross or MarkerShape.VerticalBar or MarkerShape.HorizontalBar or + MarkerShape.TriUp or MarkerShape.TriDown or MarkerShape.Asterisk or + MarkerShape.HashTag) => true, + _ => false, + }; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/MarkerStyle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/MarkerStyle.cs new file mode 100644 index 000000000..76e60a1c4 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/MarkerStyle.cs @@ -0,0 +1,53 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This configuration object (reference type) permanently lives inside objects which require styling. + /// It is recommended to use this object as an init-only property. + /// + public class MarkerStyle + { + public bool IsVisible { get; set; } + + public MarkerShape Shape { get; set; } + + /// + /// Diameter of the marker (in pixels) + /// + public float Size { get; set; } + + public FillStyle Fill { get; set; } = new() { Color = Colors.Gray }; + + public LineStyle Outline { get; set; } = new() { Width = 0 }; + + public MarkerStyle() : this(MarkerShape.FilledCircle, 5, Colors.Gray) + { + } + + public MarkerStyle(MarkerShape shape, float size) : this(shape, size, Colors.Gray) + { + } + + public MarkerStyle(MarkerShape shape, float size, Color color) + { + Shape = shape; + IsVisible = shape != MarkerShape.None; + + Outline.Color = color; + if (shape.IsOutlined()) + { + Fill.Color = Colors.Transparent; + Outline.Width = 2; + } + else + { + Fill.Color = color; + } + + Size = size; + } + + public static MarkerStyle Default => new(MarkerShape.FilledCircle, 5); + + public static MarkerStyle None => new(MarkerShape.None, 0); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/OHLC.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/OHLC.cs new file mode 100644 index 000000000..991f3e24c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/OHLC.cs @@ -0,0 +1,40 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public struct Ohlc + { + public double Open { get; set; } + public double High { get; set; } + public double Low { get; set; } + public double Close { get; set; } + public DateTime DateTime { get; set; } + public TimeSpan TimeSpan { get; set; } + + public Ohlc(double open, double high, double low, double close, DateTime start, TimeSpan span) + { + Open = open; + High = high; + Low = low; + Close = close; + DateTime = start; + TimeSpan = span; + } + } + + public static class OhlcExtensions + { + public static CoordinateRange GetPriceRange(this Ohlc ohlc) + { + double min = ohlc.Open; + min = Math.Min(min, ohlc.High); + min = Math.Min(min, ohlc.Low); + min = Math.Min(min, ohlc.Close); + + double max = ohlc.Open; + max = Math.Max(max, ohlc.High); + max = Math.Max(max, ohlc.Low); + max = Math.Max(max, ohlc.Close); + + return new CoordinateRange(min, max); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Orientation.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Orientation.cs new file mode 100644 index 000000000..3de3c484c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Orientation.cs @@ -0,0 +1,8 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public enum Orientation + { + Horizontal, + Vertical + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Palette.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Palette.cs new file mode 100644 index 000000000..83a5dfebb --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Palette.cs @@ -0,0 +1,36 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public static class Palette + { + /// + /// Create a custom palette from an array of colors + /// + public static IPalette FromColors(string[] hexColors) + { + return new CustomPalette(hexColors, string.Empty, string.Empty); + } + + /// + /// Create a custom palette from an array of colors + /// + public static IPalette FromColors(Color[] colors) + { + return new CustomPalette(colors, string.Empty, string.Empty); + } + + /// + /// Return an array containing every available palette + /// + public static IPalette[] GetPalettes() + { + return Assembly.GetExecutingAssembly() + .GetTypes() + .Where(x => x.IsClass) + .Where(x => !x.IsAbstract) + .Where(x => x.GetInterfaces().Contains(typeof(IPalette))) + .Where(x => x.GetConstructors().Where(x => x.GetParameters().Count() == 0).Any()) + .Select(x => (IPalette)Activator.CreateInstance(x)!) + .ToArray(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PieSlice.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PieSlice.cs new file mode 100644 index 000000000..4c523b731 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PieSlice.cs @@ -0,0 +1,34 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class PieSlice + { + public string? Label { get; set; } + public double Value { get; set; } + public FillStyle Fill { get; set; } = new(); + + public Color FillColor + { + get => Fill.Color; + set => Fill.Color = value; + } + + // TODO: deprecate constructors + + public PieSlice() + { + } + + public PieSlice(double value, Color color) + { + Value = value; + Fill.Color = color; + } + + public PieSlice(double value, Color color, string label) + { + Value = value; + Label = label; + Fill.Color = color; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Pixel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Pixel.cs new file mode 100644 index 000000000..796c47cbe --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Pixel.cs @@ -0,0 +1,103 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Represents an X/Y location on screen in pixel units. + /// Pixels in screen units are distinct from with axis units. + /// Pixels use precision, whereas use precision. + /// + public struct Pixel : IEquatable + { + /// + /// Horizontal position on the screen in pixel units. + /// Larger numbers are farther right on the screen. + /// + public float X; + + /// + /// Vertical position on the screen in pixel units. + /// Larger numbers are lower on the screen. + /// + public float Y; + + /// + /// Create a pixel, casting values into ones with precision + /// + public Pixel(float x, float y) + { + X = x; + Y = y; + } + + /// + /// Create a pixel, casting values into ones with precision + /// + public Pixel(double x, double y) + { + X = (float)x; + Y = (float)y; + } + + public override string ToString() + { + return $"Pixel {{ X = {X}, Y = {Y} }}"; + } + + /// + /// Represents an invalid pixel location + /// + public static Pixel NaN => new(float.NaN, float.NaN); + + /// + /// Convert the ScottPlot pixel to a SkiaSharp point + /// + public SKPoint ToSkPoint() + { + return new SKPoint(X, Y); + } + + public bool Equals(Pixel other) + { + return Equals(X, other.X) && Equals(Y, other.Y); + } + + public override bool Equals(object? obj) + { + if (obj is null) + { + return false; + } + + if (obj is Pixel other) + { + return Equals(other); + } + + return false; + } + + public static bool operator ==(Pixel a, Pixel b) + { + return a.Equals(b); + } + + public static bool operator !=(Pixel a, Pixel b) + { + return !a.Equals(b); + } + + public override int GetHashCode() + { + return X.GetHashCode() ^ Y.GetHashCode(); + } + + public static Pixel operator +(Pixel a, Pixel b) + { + return new Pixel(a.X + b.X, a.Y + b.Y); + } + + public static Pixel operator -(Pixel a, Pixel b) + { + return new Pixel(a.X - b.X, a.Y - b.Y); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelColumn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelColumn.cs new file mode 100644 index 000000000..b9caf809b --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelColumn.cs @@ -0,0 +1,36 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// This data structure describes a single vertical column of pixels + /// that represents the Y span of an X range of data points. + /// + public readonly struct PixelColumn + { + public readonly float X; + public readonly float Enter; + public readonly float Exit; + public readonly float Bottom; + public readonly float Top; + + public bool HasData => !float.IsNaN(Enter); + + public PixelColumn(float x, float enter, float exit, float bottom, float top) + { + X = x; + Enter = enter; + Exit = exit; + Bottom = bottom; + Top = top; + } + + public static PixelColumn WithoutData(float x) + { + return new PixelColumn(x, float.NaN, float.NaN, float.NaN, float.NaN); + } + + public override string ToString() + { + return $"x={X} y=[{Bottom}, {Top}], edges=[{Enter}, {Exit}]"; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelLength.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelLength.cs new file mode 100644 index 000000000..79a10cc96 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelLength.cs @@ -0,0 +1,25 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Represents a distance in pixel units + /// + public readonly struct PixelLength + { + public readonly float Length; + + public PixelLength(float length) + { + Length = length; + } + + public static implicit operator PixelLength(float length) + { + return new PixelLength(length); + } + + public override string ToString() + { + return $"{Length} pixels"; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelLine.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelLine.cs new file mode 100644 index 000000000..2cd43dc2d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelLine.cs @@ -0,0 +1,43 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Describes a straight line in pixel space + /// + public readonly struct PixelLine + { + public readonly float X1; + public readonly float X2; + public readonly float Y1; + public readonly float Y2; + + public Pixel Pixel1 => new(X1, Y1); + + public Pixel Pixel2 => new(X2, Y2); + + public PixelLine(float x1, float y1, float x2, float y2) + { + X1 = x1; + Y1 = y1; + X2 = x2; + Y2 = y2; + } + + public PixelLine(Pixel px1, Pixel px2) + { + X1 = px1.X; + Y1 = px1.Y; + X2 = px2.X; + Y2 = px2.Y; + } + + public override string ToString() + { + return $"Line from {Pixel1} to {Pixel2}"; + } + + public void Draw(SKCanvas canvas, SKPaint paint) + { + canvas.DrawLine(X1, Y1, X2, Y2, paint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelPadding.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelPadding.cs new file mode 100644 index 000000000..a0677bd02 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelPadding.cs @@ -0,0 +1,52 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Represents the size (in pixels) of padding on all edges of a rectangle + /// + public struct PixelPadding + { + public float Left; + public float Right; + public float Bottom; + public float Top; + + public float Horizontal => Left + Right; + public float Vertical => Top + Bottom; + + public PixelPadding(float padding) + { + Left = padding; + Right = padding; + Bottom = padding; + Top = padding; + } + + public PixelPadding(float left, float right, float bottom, float top) + { + Left = left; + Right = right; + Bottom = bottom; + Top = top; + } + + public PixelPadding(PixelSize figureSize, PixelRect dataArea) + { + Left = dataArea.Left; + Right = figureSize.Width - dataArea.Right; + Top = dataArea.Top; + Bottom = figureSize.Height - dataArea.Bottom; + } + + public void Expand(float amount) + { + Left += amount; + Right += amount; + Bottom += amount; + Top += amount; + } + + public void Contract(float amount) => Expand(-amount); + + public static PixelPadding Zero => new(); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelRangeY.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelRangeY.cs new file mode 100644 index 000000000..b1c678f9d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelRangeY.cs @@ -0,0 +1,42 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Represents a range of pixels between two pixels on the vertical axis used in Signal plots. + /// The value of will be SMALLER than the value of . + /// + public struct PixelRangeY + { + public float Top { get; private set; } + public float Bottom { get; private set; } + public float Span => Bottom - Top; + + public PixelRangeY(float y1, float y2) + { + Top = Math.Min(y1, y2); + Bottom = Math.Max(y1, y2); + } + + public void Expand(float value) + { + if (value < Top) + { + Top = value; + } + + if (value > Bottom) + { + Bottom = value; + } + } + + public override string ToString() + { + return $"Top={Top}, Bottom={Bottom}, Span={Span}"; + } + + public bool Contains(float position) + { + return position >= Top && position <= Bottom; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelRect.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelRect.cs new file mode 100644 index 000000000..9b1331e26 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelRect.cs @@ -0,0 +1,255 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public struct PixelRect : IEquatable + { + public readonly float Left; + public readonly float Right; + public readonly float Bottom; + public readonly float Top; + + public float HorizontalCenter => (Left + Right) / 2; + public float VerticalCenter => (Top + Bottom) / 2; + public float Width => Right - Left; + public float Height => Bottom - Top; + public bool HasArea => Width * Height != 0; + public Pixel TopLeft => new(Left, Top); + public Pixel TopRight => new(Right, Top); + public Pixel BottomLeft => new(Left, Bottom); + public Pixel BottomRight => new(Right, Bottom); + public Pixel LeftCenter => new(Left, VerticalCenter); + public Pixel RightCenter => new(Right, VerticalCenter); + public Pixel BottomCenter => new(HorizontalCenter, Bottom); + public Pixel TopCenter => new(HorizontalCenter, Top); + public PixelSize Size => new(Width, Height); + + public static PixelRect Zero => new(0, 0, 0, 0); + public static PixelRect NaN => new(Pixel.NaN, PixelSize.NaN); + + /// + /// Create a rectangle from the bounding box of a circle centered at with radius + /// + public PixelRect(Pixel center, float radius) : this(center.X - radius, center.X + radius, center.Y + radius, + center.Y - radius) + { + } + + /// + /// Create a rectangle with edges at the given pixel positions. + /// This constructor will rectify the points so rectangles will always have positive area. + /// + public PixelRect(Pixel corner1, Pixel corner2) : this(corner1.X, corner2.X, corner1.Y, corner2.Y) + { + } + + /// + /// Create a rectangle representing pixels on a screen + /// + public PixelRect(Pixel topLeftCorner, PixelSize size) : this(topLeftCorner.X, topLeftCorner.X + size.Width, + topLeftCorner.Y, topLeftCorner.Y + size.Height) + { + } + + /// + /// Create a rectangle representing pixels on a screen + /// + public PixelRect(Pixel topLeftCorner, float width, float height) : this(topLeftCorner.X, + topLeftCorner.X + width, topLeftCorner.Y, topLeftCorner.Y + height) + { + } + + /// + /// Create a rectangle from the given edges. + /// This constructor permits inverted rectangles with negative area. + /// + public PixelRect(float left, float right, float bottom, float top) + { + Left = Math.Min(left, right); + Right = Math.Max(left, right); + Bottom = Math.Max(top, bottom); + Top = Math.Min(top, bottom); + } + + public PixelRect WithPan(float x, float y) + { + return new PixelRect(Left + x, Right + x, Bottom + y, Top + y); + } + + public override string ToString() + { + return $"PixelRect: Left={Left} Right={Right} Bottom={Bottom} Top={Top}"; + } + + public SKRect ToSkRect() + { + return new SKRect(Left, Top, Right, Bottom); + } + + public PixelRect Contract(float delta) + { + float left = Math.Min(Left + delta, HorizontalCenter); + float right = Math.Max(Right - delta, HorizontalCenter); + float bottom = Math.Max(Bottom - delta, VerticalCenter); + float top = Math.Min(Top + delta, VerticalCenter); + return new PixelRect(left, right, bottom, top); + } + + public PixelRect Contract(PixelPadding padding) + { + float left = Math.Min(Left + padding.Left, HorizontalCenter); + float right = Math.Max(Right - padding.Right, HorizontalCenter); + float bottom = Math.Max(Bottom - padding.Bottom, VerticalCenter); + float top = Math.Min(Top + padding.Top, VerticalCenter); + return new PixelRect(left, right, bottom, top); + } + + public PixelRect Expand(float delta) + { + return Contract(-delta); + } + + // TODO: use operator logic? + public PixelRect WithDelta(float x, float y) + { + return new PixelRect(Left + x, Right + x, Bottom + y, Top + y); + } + + public PixelRect WithDelta(float x, float y, Alignment alignment) + { + return new PixelRect(Left + x, Right + x, Bottom + y, Top + y); + } + + public bool Equals(PixelRect other) + { + return + Equals(Left, other.Left) && + Equals(Right, other.Right) && + Equals(Top, other.Top) && + Equals(Bottom, other.Bottom); + } + + public override bool Equals(object? obj) + { + if (obj is null) + { + return false; + } + + if (obj is PixelRect other) + { + return Equals(other); + } + + return false; + } + + public static bool operator ==(PixelRect a, PixelRect b) + { + return a.Equals(b); + } + + public static bool operator !=(PixelRect a, PixelRect b) + { + return !a.Equals(b); + } + + public override int GetHashCode() + { + return + Left.GetHashCode() ^ + Right.GetHashCode() ^ + Bottom.GetHashCode() ^ + Top.GetHashCode(); + } + + public bool Contains(Pixel px) + { + return Contains(px.X, px.Y); + } + + public bool Contains(float x, float y) + { + return Left <= x && x <= Right && Top <= y && y <= Bottom; + } + + public bool ContainsX(float x) + { + return Left <= x && x <= Right; + } + + public bool ContainsY(float y) + { + return Top <= y && y <= Bottom; + } + } + + public static class PixelRectExtensions + { + /// + /// Create a rectangle of given sized aligned inside a larger rectangle + /// + public static PixelRect AlignedInside(this PixelSize size, PixelRect rect, Alignment alignment, + PixelPadding padding) + { + PixelRect inner = rect.Contract(padding); + + return alignment switch + { + Alignment.UpperLeft => new PixelRect( + left: inner.Left, + right: inner.Left + size.Width, + bottom: inner.Top + size.Height, + top: inner.Top), + + Alignment.UpperCenter => new PixelRect( + left: inner.HorizontalCenter - size.Width / 2, + right: inner.HorizontalCenter + size.Width / 2, + bottom: inner.Top + size.Height, + top: inner.Top), + + Alignment.UpperRight => new PixelRect( + left: inner.Right - size.Width, + right: inner.Right, + bottom: inner.Top + size.Height, + top: inner.Top), + + Alignment.MiddleLeft => new PixelRect( + left: inner.Left, + right: inner.Left + size.Width, + bottom: inner.VerticalCenter + size.Height / 2, + top: inner.VerticalCenter - size.Height / 2), + + Alignment.MiddleCenter => new PixelRect( + left: inner.HorizontalCenter - size.Width / 2, + right: inner.HorizontalCenter + size.Width / 2, + bottom: inner.VerticalCenter + size.Height / 2, + top: inner.VerticalCenter - size.Height / 2), + + Alignment.MiddleRight => new PixelRect( + left: inner.Right - size.Width, + right: inner.Right, + bottom: inner.VerticalCenter + size.Height / 2, + top: inner.VerticalCenter - size.Height / 2), + + Alignment.LowerLeft => new PixelRect( + left: inner.Left, + right: inner.Left + size.Width, + bottom: inner.Bottom, + top: inner.Bottom - size.Height), + + Alignment.LowerCenter => new PixelRect( + left: inner.HorizontalCenter - size.Width / 2, + right: inner.HorizontalCenter + size.Width / 2, + bottom: inner.Bottom, + top: inner.Bottom - size.Height), + + Alignment.LowerRight => new PixelRect( + left: inner.Right - size.Width, + right: inner.Right, + bottom: inner.Bottom, + top: inner.Bottom - size.Height), + + _ => throw new NotImplementedException(), + }; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelSize.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelSize.cs new file mode 100644 index 000000000..1397389fe --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/PixelSize.cs @@ -0,0 +1,98 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public struct PixelSize : IEquatable + { + public readonly float Width; + public readonly float Height; + public float Area => Width * Height; + public float Diagonal => (float)Math.Sqrt(Width * Width + Height * Height); + + public PixelSize(float width, float height) + { + Width = width; + Height = height; + } + + public PixelSize(double width, double height) + { + Width = (float)width; + Height = (float)height; + } + + public override string ToString() + { + return $"PixelSize: Width={Width}, Height={Height}"; + } + + public static PixelSize Zero => new(0, 0); + + public static PixelSize NaN => new(float.NaN, float.NaN); + + public PixelRect ToPixelRect() + { + return new PixelRect(0, Width, Height, 0); + } + + public PixelRect ToPixelRect(Pixel pixel, Alignment alignment) + { + PixelRect rect = new( + left: pixel.X, + right: pixel.X + Width, + bottom: pixel.Y + Height, + top: pixel.Y); + + rect = rect.WithDelta( + x: -Width * alignment.HorizontalFraction(), + y: -Height * (1 - alignment.VerticalFraction())); + + return rect; + } + + public bool Contains(PixelSize size) + { + return Width >= size.Width && Height >= size.Height; + } + + public PixelSize Max(PixelSize rect2) + { + return new PixelSize( + width: Math.Max(Width, rect2.Width), + height: Math.Max(Height, rect2.Height)); + } + + public bool Equals(PixelSize other) + { + return Equals(Width, other.Width) && Equals(Height, other.Height); + } + + public override bool Equals(object? obj) + { + if (obj is null) + { + return false; + } + + if (obj is PixelSize other) + { + return Equals(other); + } + + return false; + } + + public static bool operator ==(PixelSize a, PixelSize b) + { + return a.Equals(b); + } + + public static bool operator !=(PixelSize a, PixelSize b) + { + return !a.Equals(b); + } + + public override int GetHashCode() + { + return Width.GetHashCode() ^ Height.GetHashCode(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Platform.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Platform.cs new file mode 100644 index 000000000..861241db6 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Platform.cs @@ -0,0 +1,56 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public static class Platform + { + private enum Os + { + Windows, + Linux, + MacOs, + Other, + }; + + private static Os _thisOs = GetOs(); + + private static Os GetOs() + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + return Os.Windows; + } + + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + return Os.Linux; + } + + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + return Os.MacOs; + } + + return Os.Other; + } + + /// + /// Launch a web browser to a URL using a command appropriate for the operating system + /// + public static void LaunchWebBrowser(string url) + { + switch (_thisOs) + { + case Os.Windows: + Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") { CreateNoWindow = true }); + break; + case Os.Linux: + Process.Start("xdg-open", url); + break; + case Os.MacOs: + Process.Start("open", url); + break; + default: + throw new InvalidOperationException("Cannot launch a web browser on this OS"); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Range.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Range.cs new file mode 100644 index 000000000..8d92f17e2 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Range.cs @@ -0,0 +1,92 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + ///Represents a range between any two finite values (inclusive) + /// + public readonly struct Range // TODO: evaluate if this can be replaced with more task-specific primitives + { + public double Min { get; } + public double Max { get; } + + public Range(double min, double max) + { + if (min.IsInfiniteOrNaN()) + { + throw new ArgumentException($"{nameof(min)} must be a real number"); + } + + if (max.IsInfiniteOrNaN()) + { + throw new ArgumentException($"{nameof(max)} must be a real number"); + } + + if (min > max) + { + throw new ArgumentException($"Argument ${nameof(min)} must be less than or equal to ${nameof(max)}."); + } + + Min = min; + Max = max; + } + + /// + /// Returns the given value as a fraction of the difference between Min and Max. This is a min-max feature scaling. + /// + /// The value to normalize + /// If true, values outside of the range will be clamped onto the interval [0, 1]. + /// The normalized value + public double Normalize(double value, bool clamp = false) + { + if (Max == Min) + { + throw new ArgumentException($"Cannot normalize to the range if {nameof(Min)} == {nameof(Max)}"); + } + + double normalized = (value - Min) / (Max - Min); + + Range unitRange = new(0, 1); + return clamp ? unitRange.Clamp(normalized) : normalized; + } + + /// + ///Returns the given value clamped to the range (inclusive). + /// + public double Clamp(double value) + { + if (value < Min) + { + return Min; + } + + if (value > Max) + { + return Max; + } + + return value; + } + + public static Range GetRange(double[,] input) + { + return GetRange(input.Cast()); + } + + public static Range GetRange(IEnumerable input) + { + double min = double.PositiveInfinity; + double max = double.NegativeInfinity; + foreach (var curr in input) + { + if (double.IsNaN(curr)) + { + continue; + } + + min = Math.Min(min, curr); + max = Math.Max(max, curr); + } + + return new(min, max); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/RenderDetails.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/RenderDetails.cs new file mode 100644 index 000000000..81b35c21e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/RenderDetails.cs @@ -0,0 +1,92 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Details about a completed render + /// + public readonly struct RenderDetails + { + /// + /// Size of the plot image in pixel units + /// + public readonly PixelRect FigureRect; + + /// + /// Size of the data area of the plot in pixel units + /// + public readonly PixelRect DataRect; + + /// + /// Distance between the data area and the edge of the figure + /// + public readonly PixelPadding Padding; + + /// + /// Total time required to render this image + /// + public readonly TimeSpan Elapsed; + + /// + /// Time the render was completed + /// + public readonly DateTime Timestamp; + + /// + /// Each step of the render and how long it took to execute + /// + public readonly (string, TimeSpan)[] TimedActions; + + /// + /// Axis limits of the primary axes for this render + /// + public readonly AxisLimits AxisLimits; + + /// + /// Axis limits for every axis + /// + public readonly Dictionary AxisLimitsByAxis; + + /// + /// Indicates whether the axis view (coordinate units) of this render differs from the previous + /// + public readonly bool AxisLimitsChanged { get; } + + /// + /// Indicates whether the size (pixels) of this render differs from the previous + /// + public readonly bool SizeChanged { get; } + + /// + /// Arrangement of all panels + /// + public readonly Layout Layout; + + /// + /// The number of total renders including this one + /// + public readonly int Count; + + public double PxPerUnitX => DataRect.Width / AxisLimits.HorizontalSpan; + public double PxPerUnitY => DataRect.Height / AxisLimits.VerticalSpan; + public double UnitsPerPxX => AxisLimits.HorizontalSpan / DataRect.Width; + public double UnitsPerPxY => AxisLimits.VerticalSpan / DataRect.Height; + + public RenderDetails(RenderPack rp, (string, TimeSpan)[] actionTimes, RenderDetails lastRender) + { + // TODO: extend actionTimes report individual plottables, axes, etc. + FigureRect = rp.FigureRect; + DataRect = rp.DataRect; + Padding = new PixelPadding(rp.FigureRect.Size, rp.DataRect); + Elapsed = rp.Elapsed; + Timestamp = DateTime.Now; + TimedActions = actionTimes; + AxisLimits = rp.Plot.Axes.GetLimits(); + AxisLimitsByAxis = rp.Plot.Axes.GetAxes().ToDictionary(x => x, x => x.Range.ToCoordinateRange); + Layout = rp.Layout; + Count = lastRender.Count + 1; + + // TODO: evaluate multi-axis limits (not just the primary axes) + AxisLimitsChanged = !AxisLimits.Equals(lastRender.AxisLimits); + SizeChanged = !DataRect.Equals(lastRender.DataRect); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/SvgImage.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/SvgImage.cs new file mode 100644 index 000000000..a7d465e32 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/SvgImage.cs @@ -0,0 +1,38 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal class SvgImage : IDisposable + { + private bool _isDisposed = false; + public readonly int Width; + public readonly int Height; + private readonly MemoryStream _stream; + public readonly SKCanvas Canvas; + + public SvgImage(int width, int height) + { + Width = width; + Height = height; + SKRect rect = new(0, 0, width, height); + _stream = new MemoryStream(); + Canvas = SKSvgCanvas.Create(rect, _stream); + } + + public string GetXml() + { + return Encoding.ASCII.GetString(_stream.ToArray()) + ""; + } + + public void Dispose() + { + if (_isDisposed) + { + return; + } + + Canvas.Dispose(); + _isDisposed = true; + + GC.SuppressFinalize(this); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Tick.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Tick.cs new file mode 100644 index 000000000..b6b7d2cb7 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/Tick.cs @@ -0,0 +1,33 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public struct Tick + { + public readonly double Position; + public readonly string Label; + public readonly bool IsMajor; + + public Tick(double position, string label) + { + Position = position; + Label = label; + IsMajor = true; + } + + public Tick(double position, string label, bool isMajor) + { + Position = position; + Label = label; + IsMajor = isMajor; + } + + public static Tick Major(double position, string label) + { + return new Tick(position, label, true); + } + + public static Tick Minor(double position) + { + return new Tick(position, string.Empty, false); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/TickMarkStyle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/TickMarkStyle.cs new file mode 100644 index 000000000..bdbb10457 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Primitives/TickMarkStyle.cs @@ -0,0 +1,9 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class TickMarkStyle + { + public float Length; + public float Width; + public Color Color; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/ApplyAxisRulesAfterLayout.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/ApplyAxisRulesAfterLayout.cs new file mode 100644 index 000000000..8cafd9e09 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/ApplyAxisRulesAfterLayout.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class ApplyAxisRulesAfterLayout : IRenderAction + { + public void Render(RenderPack rp) + { + rp.Plot.Axes.Rules.ForEach(x => x.Apply(rp, beforeLayout: false)); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/ApplyAxisRulesBeforeLayout.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/ApplyAxisRulesBeforeLayout.cs new file mode 100644 index 000000000..f9f85e1e4 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/ApplyAxisRulesBeforeLayout.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class ApplyAxisRulesBeforeLayout : IRenderAction + { + public void Render(RenderPack rp) + { + rp.Plot.Axes.Rules.ForEach(x => x.Apply(rp, beforeLayout: true)); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/AutoScaleUnsetAxes.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/AutoScaleUnsetAxes.cs new file mode 100644 index 000000000..ce52200e2 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/AutoScaleUnsetAxes.cs @@ -0,0 +1,49 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class AutoScaleUnsetAxes : IRenderAction + { + public void Render(RenderPack rp) + { + IEnumerable visiblePlottables = rp.Plot.PlottableList.Where(x => x.IsVisible); + + if (visiblePlottables.Any()) + { + AutoscaleUnsetAxesToData(rp.Plot); + } + else + { + ApplyDefaultLimitsToUnsetAxes(rp.Plot); + } + } + + private void AutoscaleUnsetAxesToData(Plot plot) + { + foreach (IPlottable plottable in plot.PlottableList) + { + bool xAxisNeedsScaling = !plottable.Axes.XAxis.Range.HasBeenSet; + bool yAxisNeedsScaling = !plottable.Axes.YAxis.Range.HasBeenSet; + if (xAxisNeedsScaling || yAxisNeedsScaling) + { + plot.Axes.AutoScale( + xAxis: plottable.Axes.XAxis, + yAxis: plottable.Axes.YAxis, + horizontal: xAxisNeedsScaling, + vertical: yAxisNeedsScaling); + } + } + } + + private void ApplyDefaultLimitsToUnsetAxes(Plot plot) + { + if (!plot.Axes.Bottom.Range.HasBeenSet) + { + plot.Axes.SetLimitsX(AxisLimits.Default); + } + + if (!plot.Axes.Left.Range.HasBeenSet) + { + plot.Axes.SetLimitsY(AxisLimits.Default); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/CalculateLayout.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/CalculateLayout.cs new file mode 100644 index 000000000..bf1cfb0fd --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/CalculateLayout.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class CalculateLayout : IRenderAction + { + public void Render(RenderPack rp) + { + rp.CalculateLayout(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/ClearCanvas.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/ClearCanvas.cs new file mode 100644 index 000000000..072fb050f --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/ClearCanvas.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class ClearCanvas : IRenderAction + { + public void Render(RenderPack rp) + { + rp.Canvas.Clear(rp.Plot.FigureBackground.ToSkColor()); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/ExecutePlottableAxisManagers.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/ExecutePlottableAxisManagers.cs new file mode 100644 index 000000000..e28073298 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/ExecutePlottableAxisManagers.cs @@ -0,0 +1,14 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal class ExecutePlottableAxisManagers : IRenderAction + { + public void Render(RenderPack rp) + { + rp.Plot.PlottableList + .OfType() + .Where(x => x.ManageAxisLimits) + .ToList() + .ForEach(x => x.UpdateAxisLimits(rp.Plot)); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/InvokePreRenderEvent.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/InvokePreRenderEvent.cs new file mode 100644 index 000000000..4039ea31d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/InvokePreRenderEvent.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class InvokePreRenderEvent : IRenderAction + { + public void Render(RenderPack rp) + { + rp.Plot.RenderManager.RenderStarting.Invoke(this, rp); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/PreRenderLock.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/PreRenderLock.cs new file mode 100644 index 000000000..64da288ce --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/PreRenderLock.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class PreRenderLock : IRenderAction + { + public void Render(RenderPack rp) + { + rp.Plot.RenderManager.PreRenderLock.Invoke(this, EventArgs.Empty); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RegenerateTicks.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RegenerateTicks.cs new file mode 100644 index 000000000..37dbfc28d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RegenerateTicks.cs @@ -0,0 +1,18 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class RegenerateTicks : IRenderAction + { + public void Render(RenderPack rp) + { + rp.Plot.Axes.Bottom.TickGenerator.Regenerate( + range: rp.Plot.Axes.Bottom.Range.ToRectifiedCoordinateRange, + edge: rp.Plot.Axes.Bottom.Edge, + size: rp.DataRect.Width); + + rp.Plot.Axes.Left.TickGenerator.Regenerate( + range: rp.Plot.Axes.Left.Range.ToRectifiedCoordinateRange, + edge: rp.Plot.Axes.Left.Edge, + size: rp.DataRect.Height); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderBackground.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderBackground.cs new file mode 100644 index 000000000..96f3f6de2 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderBackground.cs @@ -0,0 +1,11 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class RenderBackground : IRenderAction + { + public void Render(RenderPack rp) + { + using SKPaint paint = new() { Color = rp.Plot.DataBackground.ToSkColor() }; + rp.Canvas.DrawRect(rp.DataRect.ToSkRect(), paint); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderBenchmark.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderBenchmark.cs new file mode 100644 index 000000000..1ad1d7e39 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderBenchmark.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class RenderBenchmark : IRenderAction + { + public void Render(RenderPack rp) + { + rp.Plot.Benchmark.Render(rp); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderGridsAbovePlotables.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderGridsAbovePlotables.cs new file mode 100644 index 000000000..1b630678e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderGridsAbovePlotables.cs @@ -0,0 +1,13 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class RenderGridsAbovePlotables : IRenderAction + { + public void Render(RenderPack rp) + { + foreach (IGrid grid in rp.Plot.Axes.Grids.Where(x => !x.IsBeneathPlotables)) + { + grid.Render(rp); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderGridsBelowPlotables.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderGridsBelowPlotables.cs new file mode 100644 index 000000000..ecf746d9b --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderGridsBelowPlotables.cs @@ -0,0 +1,13 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class RenderGridsBelowPlotables : IRenderAction + { + public void Render(RenderPack rp) + { + foreach (IGrid grid in rp.Plot.Axes.Grids.Where(x => x.IsBeneathPlotables)) + { + grid.Render(rp); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderLegends.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderLegends.cs new file mode 100644 index 000000000..525e0a523 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderLegends.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class RenderLegends : IRenderAction + { + public void Render(RenderPack rp) + { + rp.Plot.Legend.Render(rp); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderPanels.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderPanels.cs new file mode 100644 index 000000000..4377d4a26 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderPanels.cs @@ -0,0 +1,15 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class RenderPanels : IRenderAction + { + public void Render(RenderPack rp) + { + foreach (IPanel panel in rp.Plot.Axes.GetPanels()) + { + float size = rp.Layout.PanelSizes[panel]; + float offset = rp.Layout.PanelOffsets[panel]; + panel.Render(rp, size, offset); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderPlotables.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderPlotables.cs new file mode 100644 index 000000000..5f7922cfb --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderPlotables.cs @@ -0,0 +1,31 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class RenderPlotables : IRenderAction + { + public void Render(RenderPack rp) + { + foreach (IPlottable plottable in rp.Plot.PlottableList) + { + if (!plottable.IsVisible) + { + continue; + } + + plottable.Axes.DataRect = rp.DataRect; + rp.Canvas.Save(); + + if (plottable is IPlottableGl plottableGl) + { + plottableGl.Render(rp); + } + else + { + rp.ClipToDataArea(); + plottable.Render(rp); + } + + rp.DisableClipping(); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderPlotablesLast.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderPlotablesLast.cs new file mode 100644 index 000000000..e362973c6 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderPlotablesLast.cs @@ -0,0 +1,14 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class RenderPlotablesLast : IRenderAction + { + public void Render(RenderPack rp) + { + rp.Plot.PlottableList + .Where(x => x.IsVisible) + .OfType() + .ToList() + .ForEach(x => x.RenderLast(rp)); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderZoomRectangle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderZoomRectangle.cs new file mode 100644 index 000000000..e3652eaee --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/RenderZoomRectangle.cs @@ -0,0 +1,13 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class RenderZoomRectangle : IRenderAction + { + public void Render(RenderPack rp) + { + if (rp.Plot.ZoomRectangle.IsVisible) + { + rp.Plot.ZoomRectangle.Render(rp); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/ReplaceNullAxesWithDefaults.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/ReplaceNullAxesWithDefaults.cs new file mode 100644 index 000000000..747235258 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/ReplaceNullAxesWithDefaults.cs @@ -0,0 +1,10 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class ReplaceNullAxesWithDefaults : IRenderAction + { + public void Render(RenderPack rp) + { + rp.Plot.Axes.ReplaceNullAxesWithDefaults(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/SyncGLPlotables.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/SyncGLPlotables.cs new file mode 100644 index 000000000..9c6d6260d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderActions/SyncGLPlotables.cs @@ -0,0 +1,14 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class SyncGlPlotables : IRenderAction + { + public void Render(RenderPack rp) + { + var glPlottables = rp.Plot.PlottableList.OfType(); + if (glPlottables.Any()) + { + glPlottables.First().GlFinish(); + } + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderManager.cs new file mode 100644 index 000000000..acd18aa25 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Rendering/RenderManager.cs @@ -0,0 +1,146 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class RenderManager(Plot plot) + { + /// + /// This list of actions is performed in sequence to render a plot. + /// It may be modified externally to inject custom functionality. + /// + public List RenderActions { get; } = DefaultRenderActions; + + /// + /// Information about the previous render + /// + public RenderDetails LastRender { get; private set; } + + /// + /// These events are invoked before any render action. + /// Users can add blocking code to this event to ensure processes + /// that modify plottables are complete before rendering begins. + /// + public EventHandler PreRenderLock { get; set; } = delegate { }; + + /// + /// This event is invoked just before each render, + /// after axis limits are determined and axis limits are set + /// + public EventHandler RenderStarting { get; set; } = delegate { }; + + /// + /// This event is invoked after each render + /// + public EventHandler RenderFinished { get; set; } = delegate { }; + + /// + /// This event a render where the figure size (in pixels) changed from the previous render + /// + public EventHandler SizeChanged { get; set; } = delegate { }; + + /// + /// This event a render where the axis limits (in coordinate units) changed from the previous render + /// + public EventHandler AxisLimitsChanged { get; set; } = delegate { }; + + /// + /// Indicates whether this plot is in the process of executing a render + /// + public bool IsRendering { get; private set; } = false; + + /// + /// Disable this in multiplot environments + /// + public bool ClearCanvasBeforeRendering { get; set; } = true; + + + /// + /// If false, any calls to Render() return immediately + /// + public bool EnableRendering { get; set; } = true; + + public bool EnableEvents { get; set; } = true; + + private Plot Plot { get; } = plot; + + /// + /// Total number of renders completed + /// + public int RenderCount { get; private set; } = 0; + + public static List DefaultRenderActions => new() + { + new PreRenderLock(), + new ClearCanvas(), + new ReplaceNullAxesWithDefaults(), + new AutoScaleUnsetAxes(), + new ExecutePlottableAxisManagers(), + new ApplyAxisRulesBeforeLayout(), + new CalculateLayout(), + new ApplyAxisRulesAfterLayout(), + new RegenerateTicks(), + new InvokePreRenderEvent(), + new RenderBackground(), + new RenderGridsBelowPlotables(), + new RenderPlotables(), + new RenderGridsAbovePlotables(), + new RenderLegends(), + new RenderPanels(), + new RenderZoomRectangle(), + new SyncGlPlotables(), + new RenderPlotablesLast(), + new RenderBenchmark(), + }; + + public void Render(SKCanvas canvas, PixelRect rect) + { + if (EnableRendering == false) + { + return; + } + + IsRendering = true; + canvas.Scale(Plot.ScaleFactor); + + List<(string, TimeSpan)> actionTimes = new(); + + RenderPack rp = new(Plot, rect, canvas); + + Stopwatch sw = new(); + foreach (IRenderAction action in RenderActions) + { + if (action is ClearCanvas && !ClearCanvasBeforeRendering) + { + continue; + } + + sw.Restart(); + rp.Canvas.Save(); + action.Render(rp); + rp.Canvas.Restore(); + actionTimes.Add((action.ToString() ?? string.Empty, sw.Elapsed)); + } + + LastRender = new(rp, actionTimes.ToArray(), LastRender); + + if (EnableEvents) + { + RenderFinished.Invoke(Plot, LastRender); + + if (LastRender.SizeChanged) + { + SizeChanged.Invoke(Plot, LastRender); + } + + if (LastRender.AxisLimitsChanged) + { + AxisLimitsChanged.Invoke(Plot, LastRender); + } + } + + // TODO: event for when layout changes + + RenderCount += 1; + + IsRendering = false; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Statistics/Descriptive.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Statistics/Descriptive.cs new file mode 100644 index 000000000..40ffb637a --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Statistics/Descriptive.cs @@ -0,0 +1,466 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public static class Descriptive + { + /* NOTES: + * The core functions in this class should support double[]. + * Overloads may support but they just convert to double[] then call the other function. + * IReadOnlyList is favored to IEnumerable to avoid Count(). + * Code here may benefit from benchmarking to confirm which strategies are most performant. + * Additional discussion: https://github.com/ScottPlot/ScottPlot/pull/3071. + */ + + /// + /// Return the sample sum. + /// + public static double Sum(double[] values) + { + if (!values.Any()) + { + throw new ArgumentException($"{nameof(values)} cannot be empty"); + } + + double sum = 0; + + for (int i = 0; i < values.Length; i++) + { + sum += values[i]; + } + + return sum; + } + + /// + /// Return the sample sum. + /// + public static double Sum(IReadOnlyList values) + { + double[] values2 = NumericConversion.GenericToDoubleArray(values); + return Sum(values2); + } + + /// + /// Return the sample mean. + /// + public static double Mean(double[] values) + { + if (!values.Any()) + { + throw new ArgumentException($"{nameof(values)} cannot be empty"); + } + + return Sum(values) / values.Length; + } + + /// + /// Return the sample mean. + /// + public static double Mean(IEnumerable values) + { + double[] values2 = NumericConversion.GenericToDoubleArray(values); + return Mean(values2); + } + + /// + /// Return the sample variance (second moment about the mean) of data. + /// Input must contain at least two values. + /// Use this function when your data is a sample from a population. + /// To calculate the variance from the entire population use . + /// + public static double Variance(double[] values) + { + if (values.Length == 0) + { + throw new ArgumentException($"{nameof(values)} must not be empty"); + } + + if (values.Length == 1) + { + return 0; + } + + // TODO: benchmark and see if this can be optimized by not using LINQ + double mean = Mean(values); + double variance = values.Select(x => x - mean).Select(x => x * x).Sum(); + return variance / (values.Length - 1); + } + + /// + /// Return the sample variance (second moment about the mean) of data. + /// Input must contain at least two values. + /// Use this function to calculate the variance from the entire population. + /// To estimate the variance from a sample, use . + /// + public static double Variance(IReadOnlyList values) + { + double[] values2 = NumericConversion.GenericToDoubleArray(values); + return Variance(values2); + } + + /// + /// Return the sample variance (second moment about the mean) of data. + /// Input must contain at least two values. + /// Use this function to calculate the variance from the entire population. + /// To estimate the variance from a sample, use . + /// + public static double VarianceP(double[] values) + { + if (values.Length == 0) + { + throw new ArgumentException($"{nameof(values)} must not be empty"); + } + + if (values.Length == 1) + { + return 0; + } + + // TODO: benchmark and see if this can be optimized by not using LINQ + double mean = Mean(values); + double variance = values.Select(x => x - mean).Select(x => x * x).Sum(); + return variance / values.Length; + } + + /// + /// Return the sample variance (second moment about the mean) of data. + /// Input must contain at least two values. + /// Use this function to calculate the variance from the entire population. + /// To estimate the variance from a sample, use . + /// + public static double VarianceP(IReadOnlyList values) + { + double[] values2 = NumericConversion.GenericToDoubleArray(values); + return VarianceP(values2); + } + + /// + /// Return the sample standard deviation (the square root of the sample variance). + /// + public static double StandardDeviation(double[] values) + { + return Math.Sqrt(Variance(values)); + } + + /// + /// Return the sample standard deviation (the square root of the sample variance). + /// + public static double StandardDeviation(IEnumerable values) + { + if (!values.Any()) + { + throw new ArgumentException($"{nameof(values)} cannot be empty"); + } + + double[] values2 = NumericConversion.GenericToDoubleArray(values); + return StandardDeviation(values2); + } + + /// + /// Return the population standard deviation (the square root of the population variance). + /// See VarianceP() for more information. + /// + public static double StandardDeviationP(double[] values) + { + return Math.Sqrt(VarianceP(values)); + } + + /// + /// Return the population standard deviation (the square root of the population variance). + /// See VarianceP() for more information. + /// + public static double StandardDeviationP(IEnumerable values) + { + if (!values.Any()) + { + throw new ArgumentException($"{nameof(values)} cannot be empty"); + } + + double[] values2 = NumericConversion.GenericToDoubleArray(values); + return StandardDeviationP(values2); + } + + /// + /// Standard error of the mean. + /// + public static double StandardError(IReadOnlyList values) + { + return StandardDeviation(values) / Math.Sqrt(values.Count); + } + + + public static IReadOnlyList RemoveNaN(IReadOnlyList values) + { + double[] values2 = NumericConversion.GenericToDoubleArray(values); + List values3 = new(); + + foreach (double value in values2) + { + if (!double.IsNaN(value)) + { + values3.Add(value); + } + } + + return values3; + } + + public static double[] RemoveNaN(double[] values) + { + List values2 = new(); + + foreach (double value in values) + { + if (!double.IsNaN(value)) + { + values2.Add(value); + } + } + + return values2.ToArray(); + } + + /// + /// Return the sample mean. NaN values are ignored. + /// Returns NaN if all values are NaN. + /// + public static double NanMean(IReadOnlyList values) + { + IReadOnlyList real = RemoveNaN(values); + + if (real.Any() == false) + { + return double.NaN; + } + + return Mean(real); + } + + /// + /// Return the sample variance (second moment about the mean) of data. + /// Input must contain at least two values. NaN values are ignored. + /// Use this function when your data is a sample from a population. + /// To calculate the variance from the entire population use . + /// + public static double NanVariance(IReadOnlyList values) + { + IReadOnlyList real = RemoveNaN(values); + + if (real.Count() < 2) + { + return double.NaN; + } + + return Variance(real); + } + + /// + /// Return the sample variance (second moment about the mean) of data. + /// Input must contain at least two values. NaN values are ignored. + /// Use this function when your data is a sample from a population. + /// To calculate the variance from the entire population use . + /// + public static double NanVarianceP(IReadOnlyList values) + { + IReadOnlyList real = RemoveNaN(values); + + if (real.Count() < 2) + { + return double.NaN; + } + + return VarianceP(real); + } + + /// + /// Return the sample standard deviation (the square root of the sample variance). + /// NaN values are ignored. + /// + public static double NanStandardDeviation(IReadOnlyList values) + { + IReadOnlyList real = RemoveNaN(values); + + if (real.Count() < 2) + { + return double.NaN; + } + + return StandardDeviation(real); + } + + /// + /// Return the population standard deviation (the square root of the sample variance). + /// NaN values are ignored. + /// + public static double NanStandardDeviationP(IReadOnlyList values) + { + IReadOnlyList real = RemoveNaN(values); + + if (real.Count() < 2) + { + return double.NaN; + } + + return StandardDeviationP(real); + } + + /// + /// Standard error of the mean. + /// NaN values are ignored. + /// + public static double NanStandardError(IReadOnlyList values) + { + IReadOnlyList real = RemoveNaN(values); + + if (!real.Any()) + { + return double.NaN; + } + + return StandardError(real); + } + + /// + /// Transpose a multidimensional (not jagged) array + /// + public static double[,] ArrayTranspose(double[,] matrix) + { + int rows = matrix.GetLength(0); + int cols = matrix.GetLength(1); + double[,] result = new double[cols, rows]; + + for (int i = 0; i < rows; i++) + { + for (int j = 0; j < cols; j++) + result[j, i] = matrix[i, j]; + + } + return result; + } + + /// + /// Extracts a row or column from a 2D array + /// + public static double[] ArrayToVector(double[,] values, uint? row = 0, uint? column = null) + { + if (values.GetLength(0) == 0) + { + throw new ArgumentException($"Array {nameof(values)} cannot be empty"); + } + + double[] vector = Array.Empty(); + if (row is not null) + { + vector = new double[values.GetLength(1)]; + Array.Copy(values, (int)row * values.GetLength(1), vector, 0, values.GetLength(1)); + } + else if (column is not null) + { + vector = ArrayToVector(ArrayTranspose(values), column); + } + + return vector; + } + + public static double NanMean(double[,] values, uint row = 0, uint? column = null) + { + double[] vector = ArrayToVector(values, row, column); + return NanMean(vector); + } + + public static double NanVariance(double[,] values, uint row = 0, uint? column = null) + { + double[] vector = ArrayToVector(values, row, column); + return Variance(RemoveNaN(vector)); + } + + public static double NanVarianceP(double[,] values, uint row = 0, uint? column = null) + { + double[] vector = ArrayToVector(values, row, column); + return VarianceP(RemoveNaN(vector)); + } + + public static double NanStandardDeviation(double[,] values, uint row = 0, uint? column = null) + { + double[] vector = ArrayToVector(values, row, column); + return StandardDeviation(RemoveNaN(vector)); + } + + public static double NanStandardDeviationP(double[,] values, uint row = 0, uint? column = null) + { + double[] vector = ArrayToVector(values, row, column); + return StandardDeviationP(RemoveNaN(vector)); + } + + public static double NanStandardError(double[,] values, uint row = 0, uint? column = null) + { + double[] vector = ArrayToVector(values, row, column); + return NanStandardError(RemoveNaN(vector)); + } + + public static double[] VerticalSlice(double[,] values, int columnIndex) + { + double[] slice = new double[values.GetLength(0)]; + + for (int y = 0; y < slice.Length; y++) + { + slice[y] = values[y, columnIndex]; + } + + return slice; + } + + public static double[] VerticalMean(double[,] values) + { + return Enumerable + .Range(0, values.GetLength(1)) + .Select(x => VerticalSlice(values, x)) + .Select(Mean) + .ToArray(); + } + + public static double[] VerticalNanMean(double[,] values) + { + return Enumerable + .Range(0, values.GetLength(1)) + .Select(x => VerticalSlice(values, x)) + .Select(NanMean) + .ToArray(); + } + + public static double[] VerticalStandardDeviation(double[,] values) + { + return Enumerable + .Range(0, values.GetLength(1)) + .Select(x => VerticalSlice(values, x)) + .Select(StandardDeviation) + .ToArray(); + } + + public static double[] VerticalNanStandardDeviation(double[,] values) + { + return Enumerable + .Range(0, values.GetLength(1)) + .Select(x => VerticalSlice(values, x)) + .Select(NanStandardDeviation) + .ToArray(); + } + + public static double[] VerticalStandardError(double[,] values) + { + return Enumerable + .Range(0, values.GetLength(1)) + .Select(x => VerticalSlice(values, x)) + .Select(StandardError) + .ToArray(); + } + + public static double[] VerticalNanStandardError(double[,] values) + { + return Enumerable + .Range(0, values.GetLength(1)) + .Select(x => VerticalSlice(values, x)) + .Select(NanStandardError) + .ToArray(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Statistics/Histogram.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Statistics/Histogram.cs new file mode 100644 index 000000000..34d8fd867 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Statistics/Histogram.cs @@ -0,0 +1,257 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Histogram + { + /// + /// Number of values counted for each bin. + /// + public readonly double[] Counts; + + /// + /// Number of bins. + /// + public readonly int BinCount; + + /// + /// Running total of all values counted. + /// + public double Sum { get; private set; } + + /// + /// Total number of values accumulated. + /// + public int ValuesCounted { get; private set; } + + /// + /// Lower edge for each bin. + /// + public double[] Bins { get; } + + /// + /// Center of each bin. + /// + public double[] BinCenters { get; } + + /// + /// Default behavior is that outlier values are not counted. + /// If this is enabled, min/max outliers will be counted in the first/last bin. + /// + public bool AddOutliersToEdgeBins { get; } + + /// + /// Lower edge of the first bin + /// + public double Min { get; } + + /// + /// Upper edge of the last bin + /// + public double Max { get; } + + /// + /// The calculated bin size. + /// + public double BinSize { get; } + + /// + /// Number of values that were smaller than the lower edge of the first bin. + /// + public int MinOutlierCount { get; private set; } = 0; + + /// + /// Number of values that were greater than the upper edge of the last bin. + /// + public int MaxOutlierCount { get; private set; } = 0; + + /// + /// Create a histogram which will count values supplied by and + /// + /// minimum value to be counted + /// maximum value to be counted + /// number of bins between and + /// if false, outliers will not be counted + /// if true, one more bin will be added so values equal to can be counted too + /// + /// If and are the same value, the and + /// properties will be - 0.5 and + 0.5, respectively. This is to handle an edge + /// case where all values of an array are exactly the same, producing an identical min and max. + /// + public Histogram(double min, double max, int binCount, bool addOutliersToEdgeBins = false, bool addFinalBin = true) + { + if (min >= max) + { + throw new ArgumentException($"{nameof(max)} must be greater than {nameof(min)}"); + } + + if (binCount < 1) + { + throw new ArgumentException($"must have at least 1 bin"); + } + + BinSize = (max - min) / binCount; + AddOutliersToEdgeBins = addOutliersToEdgeBins; + + if (addFinalBin) + { + binCount += 1; + } + + BinCount = binCount; + + Min = min == max ? min - 0.5 : min; + Max = min == max ? max + 0.5 : min + BinSize * binCount; + + Counts = new double[binCount]; + Bins = new double[binCount]; + BinCenters = new double[binCount]; + for (int i = 0; i < binCount; i++) + { + Bins[i] = Min + BinSize * i; + BinCenters[i] = Bins[i] + BinSize / 2; + } + } + + /// + /// Create a histogram with bins that can count data from to (inclusive) + /// + public static Histogram WithFixedBinSize(double min, double max, double binSize, bool addOutliersToEdgeBins = false) + { + int binCount = (int)Math.Ceiling((max - min) / binSize) + 1; + max = binCount * binSize + min; + return new Histogram(min, max, binCount, addOutliersToEdgeBins, addFinalBin: false); + } + + /// + /// Create a histogram with bins that can count data from to (inclusive) + /// + public static Histogram WithFixedBinCount(double min, double max, int binCount, bool addOutliersToEdgeBins = false) + { + return new Histogram(min, max, binCount, addOutliersToEdgeBins); + } + + /// + /// Return counts normalized so the sum of all counts equals 1 + /// + public double[] GetProbability() + { + return Counts.Select(x => x / ValuesCounted).ToArray(); + } + + /// + /// Return a function describing the probability function (a Gaussian curve fitted to the histogram probabilities). + /// + public Func GetProbabilityCurve(double[] values, bool scaleToBinnedProbability = false) + { + double mean = Descriptive.Mean(values); + double stDev = Descriptive.StandardDeviation(values); + + double? Unscaled(double x) => Math.Exp(-.5 * Math.Pow((x - mean) / stDev, 2)); + if (!scaleToBinnedProbability) + { + return Unscaled; + } + + double sum = Bins.Select(x => Unscaled(x)).Sum()!.Value; + double? Scaled(double x) => Math.Exp(-.5 * Math.Pow((x - mean) / stDev, 2)) / sum; + return Scaled; + } + + /// + /// Return counts normalized so the maximum value equals the given value + /// + public double[] GetNormalized(double maxValue = 1) + { + double mult = maxValue / Counts.Max(); + return Counts.Select(x => x * mult).ToArray(); + } + + /// + /// Return the cumulative histogram counts. + /// Each value is the number of counts in that bin and all bins below it. + /// + public double[] GetCumulative() + { + double[] cumulative = new double[Counts.Length]; + cumulative[0] = Counts[0]; + for (int i = 1; i < Counts.Length; i++) + { + cumulative[i] = cumulative[i - 1] + Counts[i]; + } + return cumulative; + } + + /// + /// Return the cumulative probability histogram. + /// Each value is the fraction of counts in that bin and all bins below it. + /// + public double[] GetCumulativeProbability() + { + double[] cumulative = GetCumulative(); + double final = cumulative.Last(); + return cumulative.Select(x => x / final).ToArray(); + } + + /// + /// Add a single value to the histogram + /// + public void Add(double value) + { + if (value < Min) + { + MinOutlierCount += 1; + if (AddOutliersToEdgeBins) + { + Counts[0] += 1; + Sum += value; + ValuesCounted += 1; + } + return; + } + + if (value >= Max) + { + MaxOutlierCount += 1; + if (AddOutliersToEdgeBins) + { + Counts[Counts.Length - 1] += 1; + Sum += value; + ValuesCounted += 1; + } + return; + } + + double distanceFromMin = value - Min; + int binsFromMin = (int)(distanceFromMin / BinSize); + Counts[binsFromMin] += 1; + Sum += value; + ValuesCounted += 1; + } + + /// + /// Add multiple values to the histogram + /// + public void AddRange(IEnumerable values) + { + foreach (double value in values) + { + Add(value); + } + } + + /// + /// Reset the histogram, setting all counts and values to zero + /// + public void Clear() + { + MinOutlierCount = 0; + MaxOutlierCount = 0; + Sum = 0; + ValuesCounted = 0; + for (int i = 0; i < Counts.Length; i++) + { + Counts[i] = 0; + } + } + } + +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Statistics/LinearRegression.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Statistics/LinearRegression.cs new file mode 100644 index 000000000..0fd18b9e7 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Statistics/LinearRegression.cs @@ -0,0 +1,123 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public readonly struct LinearRegression + { + public readonly double Slope; + public readonly double Offset; + public readonly double Rsquared; + public string Formula => $"y = {Slope:0.###}x + {Offset:0.###}"; + public string FormulaWithRSquared => $"{Formula} (r²={Rsquared:0.###})"; + + /// + /// Calculate the linear regression from a collection of X/Y coordinates + /// + public LinearRegression(Coordinates[] coordinates) + { + if (coordinates.Length < 2) + { + throw new ArgumentException($"{nameof(coordinates)} must have at least 2 points"); + } + + double[] xs = coordinates.Select(x => x.X).ToArray(); + double[] ys = coordinates.Select(x => x.Y).ToArray(); + (Slope, Offset, Rsquared) = GetCoefficients(xs, ys); + } + + /// + /// Calculate the linear regression a paired collection of X and Y points + /// + public LinearRegression(double[] xs, double[] ys) + { + if (xs.Length != ys.Length) + { + throw new ArgumentException($"{nameof(xs)} and {nameof(ys)} must be the same length"); + } + + if (ys.Length < 2) + { + throw new ArgumentException($"{nameof(xs)} and {nameof(ys)} must have at least 2 points"); + } + + (Slope, Offset, Rsquared) = GetCoefficients(xs, ys); + } + + /// + /// Calculate the linear regression from a collection of evenly-spaced Y values + /// + public LinearRegression(double[] ys, double firstX = 0, double xSpacing = 1) + { + if (xSpacing == 0) + { + throw new ArgumentException($"{nameof(xSpacing)} cannot be zero"); + } + + if (ys.Length < 2) + { + throw new ArgumentException($"{nameof(ys)} must have at least 2 points"); + } + + double[] xs = Generate.Consecutive(count: ys.Length, delta: xSpacing, first: firstX); + (Slope, Offset, Rsquared) = GetCoefficients(xs, ys); + } + + private static (double slope, double offset, double rSquared) GetCoefficients(double[] xs, double[] ys) + { + double sumXyResidual = 0; + double sumXSquareResidual = 0; + + double meanX = xs.Average(); + double meanY = ys.Average(); + + for (int i = 0; i < xs.Length; i++) + { + sumXyResidual += (xs[i] - meanX) * (ys[i] - meanY); + sumXSquareResidual += (xs[i] - meanX) * (xs[i] - meanX); + } + + // Note: least-squares regression line always passes through (x̄, ȳ) + double slope = sumXyResidual / sumXSquareResidual; + double offset = meanY - slope * meanX; + + // calcualte R squared (https://en.wikipedia.org/wiki/Coefficient_of_determination) + double ssTot = 0; + double ssRes = 0; + for (int i = 0; i < ys.Length; i++) + { + double thisY = ys[i]; + + double distanceFromMeanSquared = Math.Pow(thisY - meanY, 2); + ssTot += distanceFromMeanSquared; + + double modelY = slope * xs[i] + offset; + double distanceFromModelSquared = Math.Pow(thisY - modelY, 2); + ssRes += distanceFromModelSquared; + } + double rSquared = 1 - ssRes / ssTot; + + return (slope, offset, rSquared); + } + + /// + /// Return the Y point of the regression line for the given X position + /// + public double GetValue(double x) + { + return Offset + Slope * x; + } + + /// + /// Return the Y points of the regression line for the given X positions + /// + public double[] GetValues(double[] xs) + { + double[] ys = new double[xs.Length]; + + for (int i = 0; i < ys.Length; i++) + { + ys[i] = GetValue(xs[i]); + } + + return ys; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Statistics/Series.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Statistics/Series.cs new file mode 100644 index 000000000..55e7c0d9e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Statistics/Series.cs @@ -0,0 +1,86 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public static class Series + { + /// + /// Return a moving window average of the given data. + /// If original length is true, data will be padded with NaN. + /// + public static double[] MovingAverage(double[] values, int window, bool preserveLength = false) + { + if (window < 2) + { + throw new ArgumentException("period must be 2 or greater"); + } + + if (window > values.Length) + { + throw new ArgumentException("period cannot be longer than number of values"); + } + + double[] sma = new double[values.Length]; + + for (int i = 0; i < values.Length; i++) + { + if (i < window) + { + sma[i] = double.NaN; + } + else + { + var periodValues = new double[window]; + Array.Copy(values, i - window + 1, periodValues, 0, window); + sma[i] = Descriptive.Mean(periodValues); + } + } + + if (preserveLength == false) + { + sma = sma.Skip(window).ToArray(); + } + + return sma; + } + + /// + /// Return a moving window standard deviation of the given data. + /// If original length is true, data will be padded with NaN. + /// + public static double[] SimpleMovingStandardDeviation(double[] values, int window, bool preserveLength = false) + { + if (window < 2) + { + throw new ArgumentException("period must be 2 or greater"); + } + + if (window > values.Length) + { + throw new ArgumentException("period cannot be longer than number of values"); + } + + double[] stDev = new double[values.Length]; + + for (int i = 0; i < values.Length; i++) + { + if (i < window) + { + stDev[i] = double.NaN; + continue; + } + else + { + var periodValues = new double[window]; + Array.Copy(values, i - window + 1, periodValues, 0, window); + stDev[i] = Descriptive.StandardDeviation(periodValues); + } + } + + if (preserveLength == false) + { + stDev = stDev.Skip(window).ToArray(); + } + + return stDev; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Stylers/PlotStyler.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Stylers/PlotStyler.cs new file mode 100644 index 000000000..259784660 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Stylers/PlotStyler.cs @@ -0,0 +1,147 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// A collection of high-level methods that make it easy to style many components of a plot at once + /// + public class PlotStyler + { + private readonly Plot _plot; + + public PlotStyler(Plot plot) + { + _plot = plot; + } + + /// + /// Apply background colors to the figure and data areas + /// + public void Background(Color figure, Color data) + { + _plot.FigureBackground = figure; + _plot.DataBackground = data; + } + + /// + /// Apply a single color to all components of each axis (label, tick labels, tick marks, and frame) + /// + public void ColorAxes(Color color) + { + foreach (AxisBase axis in _plot.Axes.GetAxes().OfType()) + { + axis.Color(color); + } + + _plot.Axes.Title.Label.ForeColor = color; + } + + /// + /// Apply a color to all currently visible grids + /// + public void ColorGrids(Color majorColor) + { + foreach (DefaultGrid grid in _plot.Axes.Grids.OfType()) + { + grid.MajorLineStyle.Color = majorColor; + } + } + + /// + /// Apply a color to all currently visible grids + /// + public void ColorGrids(Color majorColor, Color minorColor) + { + foreach (DefaultGrid grid in _plot.Axes.Grids.OfType()) + { + grid.MajorLineStyle.Color = majorColor; + grid.MinorLineStyle.Color = minorColor; + } + } + + public void ColorLegend(Color background, Color foreground, Color border) + { + _plot.Legend.BackgroundFill.Color = background; + _plot.Legend.Font.Color = foreground; + _plot.Legend.OutlineStyle.Color = border; + } + + /// + /// Set frame thickness for each side of the plot + /// + public void AxisFrame(float left, float right, float bottom, float top) + { + _plot.Axes.Left.FrameLineStyle.Width = left; + _plot.Axes.Right.FrameLineStyle.Width = right; + _plot.Axes.Bottom.FrameLineStyle.Width = bottom; + _plot.Axes.Top.FrameLineStyle.Width = top; + } + + /// + /// Apply the given font name to all existing plot objects. + /// Also sets the default font name so this font will be used for plot objects added in the future. + /// + public void SetFont(string fontName) + { + fontName = Fonts.Exists(fontName) ? fontName : Fonts.Default; + + // set default font so future added objects will use it + Fonts.Default = fontName; + + // title + _plot.Axes.Title.Label.FontName = fontName; + + // axis labels and ticks + foreach (IAxis axis in _plot.Axes.GetAxes()) + { + axis.Label.FontName = fontName; + axis.TickLabelStyle.FontName = fontName; + } + + // TODO: also modify tick labels + // TODO: also modify plotted text + } + + [Obsolete("use SetBestFonts()", true)] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool SetFontFromText(string text) + { + throw new InvalidOperationException(); + } + + /// + /// Detects the best font to apply to every label in the plot based on the characters that they contain. + /// If the best font for a label cannot be detected, the font last defined by will be used. + /// + public void SetBestFonts() + { + // title + _plot.Axes.Title.Label.SetBestFont(); + + // axis labels and ticks + foreach (IAxis axis in _plot.Axes.GetAxes()) + { + axis.Label.SetBestFont(); + } + + // TODO: also modify tick labels + // TODO: also modify plotted text + } + + /// + /// Reset colors and palette do a dark mode style + /// + public void DarkMode() + { + _plot.Add.Palette = new Penumbra(); + + ColorAxes(Color.FromHex("#d7d7d7")); + ColorGrids(Color.FromHex("#404040")); + Background( + figure: Color.FromHex("#181818"), + data: Color.FromHex("#1f1f1f")); + ColorLegend( + background: Color.FromHex("#404040"), + foreground: Color.FromHex("#d7d7d7"), + border: Color.FromHex("#d7d7d7")); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Testing/DuplicateIdentifier.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Testing/DuplicateIdentifier.cs new file mode 100644 index 000000000..3ee2f57aa --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/Testing/DuplicateIdentifier.cs @@ -0,0 +1,47 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + /// + /// Helper class to detect for duplicate items in complex collections + /// and display helpful error messages to the console the facilitate debugging. + /// + public class DuplicateIdentifier(string title) + { + private readonly List> _things = []; + + private readonly string _title = title; + + public void Add(string id, T thing) + { + _things.Add(new KeyValuePair(id, thing)); + } + + public void ShouldHaveNoDuplicates() + { + HashSet duplicateIDs = new(); + HashSet seenIDs = new(); + for (int i = 0; i < _things.Count; i++) + { + string id = _things[i].Key; + if (seenIDs.Contains(id)) + { + duplicateIDs.Add(id); + } + seenIDs.Add(id); + } + + if (!duplicateIDs.Any()) + { + return; + } + + StringBuilder sb = new(); + foreach (string id in duplicateIDs) + { + IEnumerable duplicateThings = _things.Where(x => x.Key == id).Select(x => x.Value); + string duplicateThingsString = string.Join(", ", duplicateThings); + sb.AppendLine($"The {_title} \"{id}\" is not unique as it is shared by: {duplicateThingsString}"); + } + throw new InvalidOperationException(sb.ToString()); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/DateTimeAutomatic.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/DateTimeAutomatic.cs new file mode 100644 index 000000000..653adfafe --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/DateTimeAutomatic.cs @@ -0,0 +1,177 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class DateTimeAutomatic : IDateTimeTickGenerator + { + private readonly static List TheseTimeUnits = new() + { + new Millisecond(), + new Centisecond(), + new Decisecond(), + new Second(), + new Minute(), + new Hour(), + new Day(), + new Month(), + new Year(), + }; + + public Tick[] Ticks { get; set; } = Array.Empty(); + + public int MaxTickCount { get; set; } = 10_000; + + private ITimeUnit GetAppropriateTimeUnit(TimeSpan timeSpan, int targetTickCount = 10) + { + foreach (var timeUnit in TheseTimeUnits) + { + long estimatedUnitTicks = timeSpan.Ticks / timeUnit.MinSize.Ticks; + foreach (var increment in timeUnit.Divisors) + { + long estimatedTicks = estimatedUnitTicks / increment; + if (estimatedTicks > targetTickCount / 3 && estimatedTicks < targetTickCount * 3) + { + return timeUnit; + } + } + } + + return TheseTimeUnits.Last(); + } + + private ITimeUnit GetLargerTimeUnit(ITimeUnit timeUnit) + { + for (int i = 0; i < TheseTimeUnits.Count - 1; i++) + { + if (timeUnit.GetType() == TheseTimeUnits[i].GetType()) + { + return TheseTimeUnits[i + 1]; + } + } + + return TheseTimeUnits.Last(); + } + + private int? LeastMemberGreaterThan(double value, IReadOnlyList list) + { + for (int i = 0; i < list.Count; i++) + if (list[i] > value) + { + return list[i]; + } + + return null; + } + + public void Regenerate(CoordinateRange range, Edge edge, PixelLength size) + { + if (range.Span >= TimeSpan.MaxValue.Days || double.IsNaN(range.Span)) + { + // cases of extreme zoom (10,000 years) + Ticks = Array.Empty(); + return; + } + + TimeSpan span = TimeSpan.FromDays(range.Span); + ITimeUnit? timeUnit = GetAppropriateTimeUnit(span); + + // estimate the size of the largest tick label for this unit this unit + int maxExpectedTickLabelWidth = (int)Math.Max(16, span.TotalDays / MaxTickCount); + int tickLabelHeight = 12; + PixelSize tickLabelBounds = new(maxExpectedTickLabelWidth, tickLabelHeight); + double coordinatesPerPixel = range.Span / size.Length; + + while (true) + { + // determine the ideal spacing to use between ticks + double increment = coordinatesPerPixel * tickLabelBounds.Width / timeUnit.MinSize.TotalDays; + int? niceIncrement = LeastMemberGreaterThan(increment, timeUnit.Divisors); + if (niceIncrement is null) + { + timeUnit = TheseTimeUnits.FirstOrDefault(t => t.MinSize > timeUnit.MinSize); + if (timeUnit is not null) + { + continue; + } + + timeUnit = TheseTimeUnits.Last(); + niceIncrement = (int)Math.Ceiling(increment); + } + + // attempt to generate the ticks given these conditions + (List? ticks, PixelSize? largestTickLabelSize) = + GenerateTicks(range, timeUnit, niceIncrement.Value, tickLabelBounds); + + // if ticks were returned, use them + if (ticks is not null) + { + Ticks = ticks.Where(x => range.Contains(x.Position)).ToArray(); + return; + } + + // if no ticks were returned it means the conditions were too dense and tick labels + // overlapped, so expand the tick label bounds and try again. + if (largestTickLabelSize is not null) + { + tickLabelBounds = tickLabelBounds.Max(largestTickLabelSize.Value); + tickLabelBounds = new PixelSize(tickLabelBounds.Width + 10, tickLabelBounds.Height + 10); + continue; + } + + throw new InvalidOperationException( + $"{nameof(ticks)} and {nameof(largestTickLabelSize)} are both null"); + } + } + + /// + /// This method attempts to find an ideal set of ticks. + /// If all labels fit within the bounds, the list of ticks is returned. + /// If a label doesn't fit in the bounds, the list is null and the size of the large tick label is returned. + /// + private (List? Positions, PixelSize? PixelSize) GenerateTicks(CoordinateRange range, ITimeUnit unit, + int increment, PixelSize tickLabelBounds) + { + DateTime rangeMin = range.Min.ToDateTime(); + DateTime rangeMax = range.Max.ToDateTime(); + + // range.Min could be anything, but when calculating start and stop it must be "snapped" to the best tick + rangeMin = GetLargerTimeUnit(unit).Snap(rangeMin); + rangeMax = unit.Snap(rangeMax); + + DateTime start = unit.Next(rangeMin, -increment); + DateTime end = unit.Next(rangeMax, increment); + string dtFormat = unit.GetDateTimeFormatString(); + + using SKPaint paint = new(); + List ticks = new(); + + const int maxTickCount = 1000; + for (DateTime dt = start; dt <= end; dt = unit.Next(dt, increment)) + { + string tickLabel = dt.ToString(dtFormat); + PixelSize tickLabelSize = Drawing.MeasureString(tickLabel, paint); + + bool tickLabelIsTooLarge = !tickLabelBounds.Contains(tickLabelSize); + if (tickLabelIsTooLarge) + { + return (null, tickLabelSize); + } + + double tickPosition = dt.ToNumber(); + Tick tick = new(tickPosition, tickLabel, isMajor: true); + ticks.Add(tick); + + // this prevents infinite loops with weird axis limits or small delta (e.g., DateTime) + if (ticks.Count >= maxTickCount) + { + break; + } + } + + return (ticks, null); + } + + public IEnumerable ConvertToCoordinateSpace(IEnumerable dates) + { + return dates.Select(dt => dt.ToNumber()); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/DateTimeFixedInterval.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/DateTimeFixedInterval.cs new file mode 100644 index 000000000..c11e1af6e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/DateTimeFixedInterval.cs @@ -0,0 +1,38 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class DateTimeFixedInterval : IDateTimeTickGenerator + { + public ITimeUnit Interval { get; set; } + + public int IntervalsPerTick { get; set; } = 1; + + public DateTimeFixedInterval(ITimeUnit interval, int intervalsPerTick = 1) + { + Interval = interval; + IntervalsPerTick = intervalsPerTick; + } + + public Tick[] Ticks { get; set; } = Array.Empty(); + + public int MaxTickCount { get; set; } = 10_000; + + public IEnumerable ConvertToCoordinateSpace(IEnumerable dates) + { + return dates.Select(dt => dt.ToNumber()); + } + + public void Regenerate(CoordinateRange range, Edge edge, PixelLength size) + { + List ticks = new(); + + DateTime start = Interval.Next(range.Min.ToDateTime(), -1); + DateTime end = Interval.Next(range.Max.ToDateTime(), 1); + for (DateTime dt = start; dt <= end; dt = Interval.Next(dt, IntervalsPerTick)) + { + ticks.Add(new Tick(dt.ToNumber(), dt.ToString(Interval.GetDateTimeFormatString()), true)); + } + + Ticks = ticks.Where(x => range.Contains(x.Position)).ToArray(); + } + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/EmptyTickGenerator.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/EmptyTickGenerator.cs new file mode 100644 index 000000000..a1f81503b --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/EmptyTickGenerator.cs @@ -0,0 +1,17 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class EmptyTickGenerator : ITickGenerator + { + public Tick[] Ticks { get; set; } = Array.Empty(); + + public int MaxTickCount { get; set; } = 50; + + public EmptyTickGenerator() + { + } + + public void Regenerate(CoordinateRange range, Edge edge, PixelLength size) + { + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/IDateTimeTickGenerator.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/IDateTimeTickGenerator.cs new file mode 100644 index 000000000..4f3dbe429 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/IDateTimeTickGenerator.cs @@ -0,0 +1,7 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public interface IDateTimeTickGenerator : ITickGenerator + { + IEnumerable ConvertToCoordinateSpace(IEnumerable dates); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/ITimeUnit.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/ITimeUnit.cs new file mode 100644 index 000000000..752442e71 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/ITimeUnit.cs @@ -0,0 +1,33 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public interface ITimeUnit + { + /// + /// An array of integers that serve as good divisors to subdivide this time unit + /// + public IReadOnlyList Divisors { get; } + + /// + /// Returns the format string used to display tick labels of this time unit. + /// https://learn.microsoft.com/en-us/dotnet/api/system.datetime.tostring + /// + public string GetDateTimeFormatString(); + + /// + /// Return the DateTime N units relative to this one + /// + public DateTime Next(DateTime dateTime, int increment = 1); + + /// + /// Minimum span this time unit can represent. + /// To represent spans smaller than this, try the next smaller unit. + /// + public TimeSpan MinSize { get; } + + /// + /// Return a given date "snapped" back to the nearest nice tick position. + /// Use this to find a good tick position for a given DateTime. + /// + public DateTime Snap(DateTime dateTime); + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/NumericAutomatic.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/NumericAutomatic.cs new file mode 100644 index 000000000..83d0d8507 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/NumericAutomatic.cs @@ -0,0 +1,173 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class NumericAutomatic : ITickGenerator + { + public Tick[] Ticks { get; set; } = Array.Empty(); + + public int MaxTickCount { get; set; } = 10_000; + + public Func LabelFormatter { get; set; } = DefaultLabelFormatter; + + public static string DefaultLabelFormatter(double value) + { + CultureInfo culture = CultureInfo.InvariantCulture; + + // if the number is round or large, use the numeric format + // https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#the-numeric-n-format-specifier + bool isRoundNumber = (int)value == value; + bool isLargeNumber = Math.Abs(value) > 1000; + if (isRoundNumber || isLargeNumber) + { + return value.ToString("N0", culture); + } + + // otherwise the number is probably small or very precise to use the general format (with slight rounding) + // https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#the-general-g-format-specifier + string label = Math.Round(value, 10).ToString("G", culture); + return label == "-0" ? "0" : label; + } + + public void Regenerate(CoordinateRange range, Edge edge, PixelLength size) + { + PixelSize largestLabel = new(12, 12); + Ticks = GenerateTicks(range, edge, size, largestLabel) + .Where(x => range.Contains(x.Position)) + .ToArray(); + } + + private Tick[] GenerateTicks(CoordinateRange range, Edge edge, PixelLength size, PixelSize predictedTickSize, + int depth = 0) + { + if (depth > 3) + { + DebugUtilities.WriteLine($"Warning: Tick recusion depth = {depth}"); + } + + // generate ticks and labels based on predicted maximum label size + float maxPredictedSize = edge.IsVertical() ? predictedTickSize.Height : predictedTickSize.Width; + double[] majorTickPositions = GenerateTickPositions(range, size, maxPredictedSize); + string[] majorTickLabels = majorTickPositions.Select(x => LabelFormatter(x)).ToArray(); + + // determine if the actual tick labels are larger than predicted (suggesting density is too high and overlapping may occur) + using SKPaint paint = new(); + PixelSize measuredLabel = Drawing.MeasureLargestString(majorTickLabels, paint); + PixelSize largestLabel = new( + width: Math.Max(predictedTickSize.Width, measuredLabel.Width), + height: Math.Max(predictedTickSize.Height, measuredLabel.Height)); + bool tickExceedsPredictedSize = largestLabel.Area > predictedTickSize.Area; + + // recursively recalculate tick density if necessary + return tickExceedsPredictedSize + ? GenerateTicks(range, edge, size, largestLabel, depth + 1) + : GenerateFinalTicks(majorTickPositions, majorTickLabels, range); + } + + private static double[] GenerateTickPositions(CoordinateRange range, PixelLength size, float predictedTickSize) + { + double unitsPerPx = range.Span / size.Length; + + float tickDensity = 1.0f; + int targetTickCount = (int)(size.Length / predictedTickSize * tickDensity); + double tickSpacing = GetIdealTickSpacing(range, targetTickCount); + + double firstTickOffset = range.Min % tickSpacing; + int tickCount = (int)(range.Span / tickSpacing) + 2; + tickCount = Math.Min(1000, tickCount); + tickCount = Math.Max(1, tickCount); + + double[] majorTickPositions = Enumerable.Range(0, tickCount) + .Select(x => range.Min - firstTickOffset + tickSpacing * x) + .Where(x => range.Contains(x)) + .ToArray(); + + if (majorTickPositions.Length < 2) + { + double tickBelow = range.Min - firstTickOffset; + double firstTick = majorTickPositions.Length > 0 ? majorTickPositions[0] : tickBelow; + double nextTick = tickBelow + tickSpacing; + majorTickPositions = new double[] { firstTick, nextTick }; + } + + return majorTickPositions; + } + + private static Tick[] GenerateFinalTicks(double[] positions, string[] labels, CoordinateRange range, + int minorTicksPerMajorTick = 5) + { + Tick[] majorTicks = positions + .Select((position, i) => Tick.Major(position, labels[i])) + .ToArray(); + + Tick[] minorTicks = MinorFromMajor(positions, minorTicksPerMajorTick, range) + .Select(Tick.Minor) + .ToArray(); + + return majorTicks.Concat(minorTicks).ToArray(); + } + + private static double GetIdealTickSpacing(CoordinateRange range, int maxTickCount) + { + int radix = 10; + int exponent = (int)Math.Log(range.Span, radix); + double initialSpace = Math.Pow(radix, exponent); + List tickSpacings = new() { initialSpace, initialSpace, initialSpace }; + + double[] divBy; + if (radix == 10) + { + divBy = new double[] { 2, 2, 2.5 }; // 10, 5, 2.5, 1 + } + else if (radix == 16) + { + divBy = new double[] { 2, 2, 2, 2 }; // 16, 8, 4, 2, 1 + } + else + { + throw new ArgumentException($"radix {radix} is not supported"); + } + + int divisions = 0; + int tickCount = 0; + while (tickCount < maxTickCount && tickSpacings.Count < 1000) + { + tickSpacings.Add(tickSpacings.Last() / divBy[divisions++ % divBy.Length]); + tickCount = (int)(range.Span / tickSpacings.Last()); + } + + return tickSpacings[tickSpacings.Count - 3]; + } + + private static double[] MinorFromMajor(double[] majorTicks, double minorTicksPerMajorTick, + CoordinateRange range) + { + if (majorTicks == null || majorTicks.Length < 2) + { + return new double[] { }; + } + + double majorTickSpacing = majorTicks[1] - majorTicks[0]; + double minorTickSpacing = majorTickSpacing / minorTicksPerMajorTick; + + List majorTicksWithPadding = new() + { + majorTicks[0] - majorTickSpacing + }; + majorTicksWithPadding.AddRange(majorTicks); + + List minorTicks = new(); + foreach (var majorTickPosition in majorTicksWithPadding) + { + for (int i = 1; i < minorTicksPerMajorTick; i++) + { + double minorTickPosition = majorTickPosition + minorTickSpacing * i; + if (range.Contains(minorTickPosition)) + { + minorTicks.Add(minorTickPosition); + } + } + } + + return minorTicks.ToArray(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/NumericFixedInterval.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/NumericFixedInterval.cs new file mode 100644 index 000000000..ceb001a5e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/NumericFixedInterval.cs @@ -0,0 +1,35 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class NumericFixedInterval : ITickGenerator + { + public double Interval { get; set; } + + public Tick[] Ticks { get; set; } = Array.Empty(); + + public int MaxTickCount { get; set; } = 10_000; + + public NumericFixedInterval(int interval = 1) + { + Interval = interval; + } + + public void Regenerate(CoordinateRange range, Edge edge, PixelLength size) + { + List ticks = new(); + + double lowest = range.Min - range.Min % Interval; + double highest = range.Max - range.Max % Interval + Interval; + int tickCount = (int)((highest - lowest) / Interval); + tickCount = Math.Min(tickCount, MaxTickCount); + + for (int i = 0; i < tickCount; i++) + { + double position = lowest + i * Interval; + string label = position.ToString(); + ticks.Add(new Tick(position, label, true)); + } + + Ticks = ticks.Where(x => range.Contains(x.Position)).ToArray(); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/NumericManual.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/NumericManual.cs new file mode 100644 index 000000000..9515c01b7 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/NumericManual.cs @@ -0,0 +1,56 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class NumericManual : ITickGenerator + { + public Tick[] Ticks + { + get => TickList.ToArray(); + set => throw new InvalidOperationException(); + } + + private readonly List TickList = new(); + + public int MaxTickCount { get; set; } = 50; + + public NumericManual() + { + } + + public NumericManual(Tick[] ticks) + { + TickList.AddRange(ticks); + } + + public NumericManual(double[] positions, string[] labels) + { + if (positions.Length != labels.Length) + { + throw new ArgumentException($"{nameof(positions)} must have same length as {nameof(labels)}"); + } + + for (int i = 0; i < positions.Length; i++) + { + AddMajor(positions[i], labels[i]); + } + } + + public void Regenerate(CoordinateRange range, Edge edge, PixelLength size) + { + } + + public void Add(Tick tick) + { + TickList.Add(tick); + } + + public void AddMajor(double position, string label) + { + Add(Tick.Major(position, label)); + } + + public void AddMinor(double position) + { + Add(Tick.Minor(position)); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Centisecond.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Centisecond.cs new file mode 100644 index 000000000..d1be88a60 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Centisecond.cs @@ -0,0 +1,27 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Centisecond : ITimeUnit + { + public IReadOnlyList Divisors => StandardDivisors.Decimal; + + public TimeSpan MinSize => TimeSpan.FromMilliseconds(10); + + public DateTime Snap(DateTime dt) + { + return new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second, dt.Millisecond % 10); + } + + public string GetDateTimeFormatString() + { + string hourSpecifier = CultureInfo.CurrentCulture.Uses24HourClock() ? "HH" : "hh"; + + // TODO: This assumes colons as the separators, but consider (some) French-language locales use 12h30 rather than 12:30 + return $"{CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern}\n{hourSpecifier}:mm:ss.ff"; + } + + public DateTime Next(DateTime dateTime, int increment = 1) + { + return dateTime.AddMilliseconds(increment * 10); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Day.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Day.cs new file mode 100644 index 000000000..811b8edd8 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Day.cs @@ -0,0 +1,24 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Day : ITimeUnit + { + public IReadOnlyList Divisors => StandardDivisors.Days; + + public TimeSpan MinSize => TimeSpan.FromDays(1); + + public DateTime Snap(DateTime dt) + { + return new DateTime(dt.Year, dt.Month, dt.Day); + } + + public string GetDateTimeFormatString() + { + return $"d"; + } + + public DateTime Next(DateTime dateTime, int increment = 1) + { + return dateTime.AddDays(increment); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Decisecond.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Decisecond.cs new file mode 100644 index 000000000..fb97c43f5 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Decisecond.cs @@ -0,0 +1,26 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Decisecond : ITimeUnit + { + public IReadOnlyList Divisors => StandardDivisors.Decimal; + + public TimeSpan MinSize => TimeSpan.FromMilliseconds(100); + + public DateTime Snap(DateTime dt) + { + return new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second, dt.Millisecond % 100); + } + + public string GetDateTimeFormatString() + { + string hourSpecifier = CultureInfo.CurrentCulture.Uses24HourClock() ? "HH" : "hh"; + return + $"{CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern}\n{hourSpecifier}:mm:ss.f"; // TODO: This assumes colons as the separators, but consider (some) French-language locales use 12h30 rather than 12:30 + } + + public DateTime Next(DateTime dateTime, int increment = 1) + { + return dateTime.AddMilliseconds(increment * 100); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Hour.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Hour.cs new file mode 100644 index 000000000..a28103643 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Hour.cs @@ -0,0 +1,25 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Hour : ITimeUnit + { + public IReadOnlyList Divisors => StandardDivisors.Dozenal; + + public TimeSpan MinSize => TimeSpan.FromHours(1); + + public DateTime Snap(DateTime dt) + { + return new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, 0, 0); + } + + public string GetDateTimeFormatString() + { + return + $"{CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern}\n{CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern}"; + } + + public DateTime Next(DateTime dateTime, int increment = 1) + { + return dateTime.AddHours(increment); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Millisecond.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Millisecond.cs new file mode 100644 index 000000000..f01f9b780 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Millisecond.cs @@ -0,0 +1,26 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Millisecond : ITimeUnit + { + public IReadOnlyList Divisors => StandardDivisors.Decimal; + + public TimeSpan MinSize => TimeSpan.FromMilliseconds(1); + + public DateTime Snap(DateTime dt) + { + return new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second, dt.Millisecond); + } + + public string GetDateTimeFormatString() + { + string hourSpecifier = CultureInfo.CurrentCulture.Uses24HourClock() ? "HH" : "hh"; + return + $"{CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern}\n{hourSpecifier}:mm:ss.fff"; // TODO: This assumes colons as the separators, but consider (some) French-language locales use 12h30 rather than 12:30 + } + + public DateTime Next(DateTime dateTime, int increment = 1) + { + return dateTime.AddMilliseconds(increment); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Minute.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Minute.cs new file mode 100644 index 000000000..a871a0562 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Minute.cs @@ -0,0 +1,21 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Minute : ITimeUnit + { + public IReadOnlyList Divisors => StandardDivisors.Sexagesimal; + + public TimeSpan MinSize => TimeSpan.FromMinutes(1); + + public DateTime Snap(DateTime dt) + { + return new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, 0); + } + + public string GetDateTimeFormatString() => $"{CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern}\n{CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern}"; + + public DateTime Next(DateTime dateTime, int increment = 1) + { + return dateTime.AddMinutes(increment); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Month.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Month.cs new file mode 100644 index 000000000..2655144c9 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Month.cs @@ -0,0 +1,24 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Month : ITimeUnit + { + public IReadOnlyList Divisors => StandardDivisors.Months; + + public TimeSpan MinSize => TimeSpan.FromDays(28); + + public DateTime Snap(DateTime dt) + { + return new DateTime(dt.Year, dt.Month, 1); + } + + public string GetDateTimeFormatString() + { + return $"d"; + } + + public DateTime Next(DateTime dateTime, int increment = 1) + { + return dateTime.AddMonths(increment); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Second.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Second.cs new file mode 100644 index 000000000..f0725aa7d --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Second.cs @@ -0,0 +1,25 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Second : ITimeUnit + { + public IReadOnlyList Divisors => StandardDivisors.Sexagesimal; + + public TimeSpan MinSize => TimeSpan.FromSeconds(1); + + public DateTime Snap(DateTime dt) + { + return new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second); + } + + public string GetDateTimeFormatString() + { + return + $"{CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern}\n{CultureInfo.CurrentCulture.DateTimeFormat.LongTimePattern}"; + } + + public DateTime Next(DateTime dateTime, int increment = 1) + { + return dateTime.AddSeconds(increment); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/StandardDivisors.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/StandardDivisors.cs new file mode 100644 index 000000000..3a8e6f4b4 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/StandardDivisors.cs @@ -0,0 +1,13 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + internal static class StandardDivisors + { + public static readonly IReadOnlyList Decimal = new int[] { 1, 5, 10 }; + public static readonly IReadOnlyList Sexagesimal = new int[] { 1, 5, 10, 15, 20, 30, 60 }; + public static readonly IReadOnlyList Dozenal = new int[] { 1, 2, 3, 4, 6, 12 }; + public static readonly IReadOnlyList Hexadecimal = new int[] { 1, 2, 3, 4, 6, 8, 16 }; + public static readonly IReadOnlyList Days = new int[] { 1, 3, 7, 14, 28 }; + public static readonly IReadOnlyList Months = new int[] { 1, 3, 6 }; + public static readonly IReadOnlyList Years = new int[] { 1, 2, 3, 4, 5, 10 }; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Year.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Year.cs new file mode 100644 index 000000000..f545b8d5e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Core/TickGenerators/TimeUnits/Year.cs @@ -0,0 +1,38 @@ +namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot +{ + public class Year : ITimeUnit + { + public IReadOnlyList Divisors => StandardDivisors.Years; + + public TimeSpan MinSize => TimeSpan.FromDays(365); + + public DateTime Snap(DateTime dt) + { + return new DateTime(dt.Year, 1, 1); + } + + public string GetDateTimeFormatString() + { + return $"yyyy"; + } + + public DateTime Next(DateTime dateTime, int increment = 1) + { + // TODO: move this into extension methods file + + int newYear = dateTime.Year + increment; + + if (newYear <= 100) + { + return new DateTime(100, 1, 1); + } + + if (newYear > 10_000) + { + return new DateTime(9_999, 1, 1); + } + + return dateTime.AddYears(increment); + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Algae.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Algae.cs deleted file mode 100644 index ce92e546f..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Algae.cs +++ /dev/null @@ -1,297 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Algae : IColourMap - { - public string Name => "Algae"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 215, 249, 208 }, - { 214, 248, 206 }, - { 212, 247, 205 }, - { 211, 246, 203 }, - { 210, 245, 202 }, - { 209, 244, 200 }, - { 207, 244, 199 }, - { 206, 243, 197 }, - { 205, 242, 196 }, - { 204, 241, 195 }, - { 202, 240, 193 }, - { 201, 239, 192 }, - { 200, 238, 190 }, - { 199, 237, 189 }, - { 197, 236, 187 }, - { 196, 235, 186 }, - { 195, 235, 185 }, - { 194, 234, 183 }, - { 192, 233, 182 }, - { 191, 232, 180 }, - { 190, 231, 179 }, - { 189, 230, 177 }, - { 187, 229, 176 }, - { 186, 228, 175 }, - { 185, 228, 173 }, - { 184, 227, 172 }, - { 182, 226, 171 }, - { 181, 225, 169 }, - { 180, 224, 168 }, - { 178, 223, 166 }, - { 177, 222, 165 }, - { 176, 222, 164 }, - { 175, 221, 162 }, - { 173, 220, 161 }, - { 172, 219, 160 }, - { 171, 218, 158 }, - { 170, 218, 157 }, - { 168, 217, 156 }, - { 167, 216, 154 }, - { 166, 215, 153 }, - { 164, 214, 152 }, - { 163, 213, 150 }, - { 162, 213, 149 }, - { 160, 212, 148 }, - { 159, 211, 146 }, - { 158, 210, 145 }, - { 157, 209, 144 }, - { 155, 209, 143 }, - { 154, 208, 141 }, - { 153, 207, 140 }, - { 151, 206, 139 }, - { 150, 205, 138 }, - { 149, 205, 136 }, - { 147, 204, 135 }, - { 146, 203, 134 }, - { 145, 202, 133 }, - { 143, 202, 131 }, - { 142, 201, 130 }, - { 140, 200, 129 }, - { 139, 199, 128 }, - { 138, 199, 126 }, - { 136, 198, 125 }, - { 135, 197, 124 }, - { 133, 196, 123 }, - { 132, 196, 122 }, - { 131, 195, 121 }, - { 129, 194, 119 }, - { 128, 193, 118 }, - { 126, 193, 117 }, - { 125, 192, 116 }, - { 123, 191, 115 }, - { 122, 190, 114 }, - { 120, 190, 113 }, - { 119, 189, 111 }, - { 117, 188, 110 }, - { 116, 187, 109 }, - { 114, 187, 108 }, - { 113, 186, 107 }, - { 111, 185, 106 }, - { 110, 185, 105 }, - { 108, 184, 104 }, - { 107, 183, 103 }, - { 105, 182, 102 }, - { 103, 182, 101 }, - { 102, 181, 100 }, - { 100, 180, 99 }, - { 98, 180, 98 }, - { 97, 179, 97 }, - { 95, 178, 96 }, - { 93, 178, 95 }, - { 91, 177, 94 }, - { 90, 176, 93 }, - { 88, 175, 93 }, - { 86, 175, 92 }, - { 84, 174, 91 }, - { 82, 173, 90 }, - { 80, 173, 89 }, - { 78, 172, 89 }, - { 76, 171, 88 }, - { 74, 171, 87 }, - { 72, 170, 87 }, - { 70, 169, 86 }, - { 68, 168, 85 }, - { 66, 168, 85 }, - { 63, 167, 84 }, - { 61, 166, 84 }, - { 59, 166, 84 }, - { 57, 165, 83 }, - { 55, 164, 83 }, - { 52, 163, 83 }, - { 50, 163, 82 }, - { 48, 162, 82 }, - { 46, 161, 82 }, - { 44, 160, 82 }, - { 42, 160, 82 }, - { 40, 159, 81 }, - { 38, 158, 81 }, - { 36, 157, 81 }, - { 34, 156, 81 }, - { 32, 156, 81 }, - { 30, 155, 81 }, - { 28, 154, 81 }, - { 27, 153, 81 }, - { 25, 152, 81 }, - { 24, 151, 80 }, - { 22, 150, 80 }, - { 21, 150, 80 }, - { 19, 149, 80 }, - { 18, 148, 80 }, - { 16, 147, 80 }, - { 15, 146, 80 }, - { 14, 145, 80 }, - { 13, 144, 79 }, - { 12, 143, 79 }, - { 11, 143, 79 }, - { 10, 142, 79 }, - { 9, 141, 79 }, - { 9, 140, 79 }, - { 8, 139, 78 }, - { 8, 138, 78 }, - { 7, 137, 78 }, - { 7, 136, 78 }, - { 7, 135, 77 }, - { 7, 134, 77 }, - { 7, 134, 77 }, - { 7, 133, 77 }, - { 7, 132, 77 }, - { 7, 131, 76 }, - { 7, 130, 76 }, - { 8, 129, 76 }, - { 8, 128, 75 }, - { 8, 127, 75 }, - { 9, 126, 75 }, - { 9, 125, 75 }, - { 10, 124, 74 }, - { 10, 124, 74 }, - { 11, 123, 74 }, - { 11, 122, 73 }, - { 12, 121, 73 }, - { 12, 120, 73 }, - { 13, 119, 72 }, - { 13, 118, 72 }, - { 14, 117, 72 }, - { 14, 116, 71 }, - { 15, 115, 71 }, - { 15, 115, 71 }, - { 16, 114, 70 }, - { 16, 113, 70 }, - { 17, 112, 69 }, - { 17, 111, 69 }, - { 18, 110, 69 }, - { 18, 109, 68 }, - { 18, 108, 68 }, - { 19, 107, 67 }, - { 19, 106, 67 }, - { 20, 106, 67 }, - { 20, 105, 66 }, - { 20, 104, 66 }, - { 21, 103, 65 }, - { 21, 102, 65 }, - { 21, 101, 64 }, - { 22, 100, 64 }, - { 22, 99, 64 }, - { 22, 98, 63 }, - { 23, 98, 63 }, - { 23, 97, 62 }, - { 23, 96, 62 }, - { 23, 95, 61 }, - { 24, 94, 61 }, - { 24, 93, 60 }, - { 24, 92, 60 }, - { 24, 91, 59 }, - { 24, 91, 59 }, - { 25, 90, 58 }, - { 25, 89, 58 }, - { 25, 88, 57 }, - { 25, 87, 57 }, - { 25, 86, 56 }, - { 25, 85, 56 }, - { 25, 84, 55 }, - { 25, 84, 55 }, - { 26, 83, 54 }, - { 26, 82, 53 }, - { 26, 81, 53 }, - { 26, 80, 52 }, - { 26, 79, 52 }, - { 26, 78, 51 }, - { 26, 77, 51 }, - { 26, 77, 50 }, - { 26, 76, 50 }, - { 26, 75, 49 }, - { 26, 74, 48 }, - { 26, 73, 48 }, - { 26, 72, 47 }, - { 26, 71, 47 }, - { 26, 71, 46 }, - { 26, 70, 46 }, - { 26, 69, 45 }, - { 26, 68, 44 }, - { 26, 67, 44 }, - { 25, 66, 43 }, - { 25, 65, 43 }, - { 25, 64, 42 }, - { 25, 64, 41 }, - { 25, 63, 41 }, - { 25, 62, 40 }, - { 25, 61, 39 }, - { 25, 60, 39 }, - { 24, 59, 38 }, - { 24, 59, 38 }, - { 24, 58, 37 }, - { 24, 57, 36 }, - { 24, 56, 36 }, - { 24, 55, 35 }, - { 23, 54, 34 }, - { 23, 53, 34 }, - { 23, 53, 33 }, - { 23, 52, 32 }, - { 23, 51, 32 }, - { 22, 50, 31 }, - { 22, 49, 30 }, - { 22, 48, 30 }, - { 22, 47, 29 }, - { 21, 47, 28 }, - { 21, 46, 28 }, - { 21, 45, 27 }, - { 20, 44, 26 }, - { 20, 43, 26 }, - { 20, 42, 25 }, - { 20, 41, 24 }, - { 19, 41, 24 }, - { 19, 40, 23 }, - { 19, 39, 22 }, - { 18, 38, 22 }, - { 18, 37, 21 }, - { 18, 36, 20 } - - }; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Amp.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Amp.cs deleted file mode 100644 index e269f2f7e..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Amp.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Amp : IColourMap - { - public string Name => "Amp"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 241, 237, 236 }, - { 241, 236, 235 }, - { 240, 235, 233 }, - { 239, 233, 232 }, - { 239, 232, 231 }, - { 238, 231, 229 }, - { 238, 230, 228 }, - { 237, 229, 227 }, - { 237, 227, 225 }, - { 236, 226, 224 }, - { 236, 225, 222 }, - { 235, 224, 221 }, - { 235, 223, 220 }, - { 234, 221, 218 }, - { 234, 220, 217 }, - { 233, 219, 215 }, - { 233, 218, 214 }, - { 233, 217, 212 }, - { 232, 216, 211 }, - { 232, 214, 210 }, - { 231, 213, 208 }, - { 231, 212, 207 }, - { 230, 211, 205 }, - { 230, 210, 204 }, - { 230, 209, 202 }, - { 229, 207, 201 }, - { 229, 206, 200 }, - { 228, 205, 198 }, - { 228, 204, 197 }, - { 228, 203, 195 }, - { 227, 201, 194 }, - { 227, 200, 192 }, - { 226, 199, 191 }, - { 226, 198, 189 }, - { 226, 197, 188 }, - { 225, 196, 187 }, - { 225, 195, 185 }, - { 225, 193, 184 }, - { 224, 192, 182 }, - { 224, 191, 181 }, - { 223, 190, 179 }, - { 223, 189, 178 }, - { 223, 188, 176 }, - { 222, 186, 175 }, - { 222, 185, 174 }, - { 222, 184, 172 }, - { 221, 183, 171 }, - { 221, 182, 169 }, - { 221, 181, 168 }, - { 220, 180, 166 }, - { 220, 178, 165 }, - { 220, 177, 163 }, - { 219, 176, 162 }, - { 219, 175, 161 }, - { 219, 174, 159 }, - { 218, 173, 158 }, - { 218, 172, 156 }, - { 217, 170, 155 }, - { 217, 169, 153 }, - { 217, 168, 152 }, - { 216, 167, 150 }, - { 216, 166, 149 }, - { 216, 165, 148 }, - { 215, 164, 146 }, - { 215, 162, 145 }, - { 215, 161, 143 }, - { 214, 160, 142 }, - { 214, 159, 140 }, - { 214, 158, 139 }, - { 213, 157, 137 }, - { 213, 156, 136 }, - { 213, 154, 135 }, - { 212, 153, 133 }, - { 212, 152, 132 }, - { 212, 151, 130 }, - { 211, 150, 129 }, - { 211, 149, 127 }, - { 211, 148, 126 }, - { 210, 146, 125 }, - { 210, 145, 123 }, - { 210, 144, 122 }, - { 209, 143, 120 }, - { 209, 142, 119 }, - { 209, 141, 118 }, - { 208, 140, 116 }, - { 208, 139, 115 }, - { 208, 137, 113 }, - { 207, 136, 112 }, - { 207, 135, 111 }, - { 207, 134, 109 }, - { 206, 133, 108 }, - { 206, 132, 106 }, - { 205, 131, 105 }, - { 205, 129, 104 }, - { 205, 128, 102 }, - { 204, 127, 101 }, - { 204, 126, 100 }, - { 204, 125, 98 }, - { 203, 124, 97 }, - { 203, 122, 96 }, - { 203, 121, 94 }, - { 202, 120, 93 }, - { 202, 119, 91 }, - { 201, 118, 90 }, - { 201, 117, 89 }, - { 201, 116, 87 }, - { 200, 114, 86 }, - { 200, 113, 85 }, - { 200, 112, 84 }, - { 199, 111, 82 }, - { 199, 110, 81 }, - { 198, 109, 80 }, - { 198, 107, 78 }, - { 198, 106, 77 }, - { 197, 105, 76 }, - { 197, 104, 74 }, - { 197, 103, 73 }, - { 196, 101, 72 }, - { 196, 100, 71 }, - { 195, 99, 70 }, - { 195, 98, 68 }, - { 195, 97, 67 }, - { 194, 95, 66 }, - { 194, 94, 65 }, - { 193, 93, 63 }, - { 193, 92, 62 }, - { 192, 91, 61 }, - { 192, 89, 60 }, - { 192, 88, 59 }, - { 191, 87, 58 }, - { 191, 86, 57 }, - { 190, 84, 56 }, - { 190, 83, 54 }, - { 189, 82, 53 }, - { 189, 81, 52 }, - { 189, 79, 51 }, - { 188, 78, 50 }, - { 188, 77, 49 }, - { 187, 76, 48 }, - { 187, 74, 48 }, - { 186, 73, 47 }, - { 186, 72, 46 }, - { 185, 70, 45 }, - { 185, 69, 44 }, - { 184, 68, 43 }, - { 184, 66, 43 }, - { 183, 65, 42 }, - { 183, 64, 41 }, - { 182, 63, 41 }, - { 181, 61, 40 }, - { 181, 60, 39 }, - { 180, 59, 39 }, - { 180, 57, 38 }, - { 179, 56, 38 }, - { 178, 55, 38 }, - { 178, 53, 37 }, - { 177, 52, 37 }, - { 176, 51, 37 }, - { 176, 49, 37 }, - { 175, 48, 36 }, - { 174, 47, 36 }, - { 174, 45, 36 }, - { 173, 44, 36 }, - { 172, 43, 36 }, - { 171, 42, 36 }, - { 170, 40, 36 }, - { 170, 39, 36 }, - { 169, 38, 36 }, - { 168, 37, 36 }, - { 167, 36, 36 }, - { 166, 34, 37 }, - { 165, 33, 37 }, - { 164, 32, 37 }, - { 163, 31, 37 }, - { 162, 30, 37 }, - { 161, 29, 37 }, - { 160, 28, 38 }, - { 159, 27, 38 }, - { 158, 26, 38 }, - { 157, 25, 38 }, - { 156, 24, 39 }, - { 155, 23, 39 }, - { 154, 22, 39 }, - { 153, 21, 39 }, - { 152, 21, 39 }, - { 151, 20, 40 }, - { 149, 19, 40 }, - { 148, 19, 40 }, - { 147, 18, 40 }, - { 146, 17, 40 }, - { 145, 17, 41 }, - { 144, 16, 41 }, - { 142, 16, 41 }, - { 141, 16, 41 }, - { 140, 15, 41 }, - { 139, 15, 41 }, - { 137, 15, 41 }, - { 136, 15, 41 }, - { 135, 14, 41 }, - { 133, 14, 41 }, - { 132, 14, 41 }, - { 131, 14, 41 }, - { 129, 14, 41 }, - { 128, 14, 41 }, - { 127, 14, 41 }, - { 125, 14, 41 }, - { 124, 14, 41 }, - { 123, 14, 41 }, - { 121, 14, 41 }, - { 120, 14, 40 }, - { 119, 14, 40 }, - { 117, 14, 40 }, - { 116, 14, 40 }, - { 115, 14, 39 }, - { 113, 14, 39 }, - { 112, 14, 39 }, - { 111, 14, 38 }, - { 109, 14, 38 }, - { 108, 15, 38 }, - { 107, 15, 37 }, - { 105, 15, 37 }, - { 104, 15, 37 }, - { 103, 15, 36 }, - { 101, 15, 36 }, - { 100, 14, 35 }, - { 99, 14, 35 }, - { 97, 14, 34 }, - { 96, 14, 34 }, - { 95, 14, 33 }, - { 93, 14, 33 }, - { 92, 14, 33 }, - { 91, 14, 32 }, - { 90, 14, 31 }, - { 88, 14, 31 }, - { 87, 14, 30 }, - { 86, 14, 30 }, - { 84, 13, 29 }, - { 83, 13, 29 }, - { 82, 13, 28 }, - { 81, 13, 28 }, - { 79, 13, 27 }, - { 78, 13, 26 }, - { 77, 12, 26 }, - { 75, 12, 25 }, - { 74, 12, 25 }, - { 73, 12, 24 }, - { 72, 11, 23 }, - { 70, 11, 23 }, - { 69, 11, 22 }, - { 68, 11, 22 }, - { 67, 10, 21 }, - { 65, 10, 20 }, - { 64, 10, 20 }, - { 63, 10, 19 }, - { 61, 9, 18 }, - { 60, 9, 18 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Balance.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Balance.cs deleted file mode 100644 index ef3579009..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Balance.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Balance : IColourMap - { - public string Name => "Balance"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 24, 28, 67 }, - { 25, 30, 70 }, - { 26, 31, 73 }, - { 27, 33, 76 }, - { 28, 34, 79 }, - { 29, 35, 82 }, - { 30, 37, 85 }, - { 31, 38, 88 }, - { 32, 39, 91 }, - { 33, 41, 95 }, - { 33, 42, 98 }, - { 34, 43, 101 }, - { 35, 45, 105 }, - { 36, 46, 108 }, - { 37, 47, 111 }, - { 37, 48, 115 }, - { 38, 50, 118 }, - { 39, 51, 122 }, - { 39, 52, 125 }, - { 40, 54, 129 }, - { 40, 55, 132 }, - { 41, 56, 136 }, - { 41, 58, 140 }, - { 41, 59, 143 }, - { 41, 60, 147 }, - { 41, 62, 151 }, - { 41, 63, 154 }, - { 41, 64, 158 }, - { 41, 66, 162 }, - { 40, 67, 165 }, - { 39, 69, 169 }, - { 38, 71, 172 }, - { 37, 72, 176 }, - { 35, 74, 179 }, - { 33, 76, 182 }, - { 31, 78, 184 }, - { 28, 80, 186 }, - { 25, 82, 188 }, - { 22, 85, 189 }, - { 19, 87, 190 }, - { 16, 89, 190 }, - { 13, 91, 190 }, - { 12, 94, 190 }, - { 10, 96, 190 }, - { 10, 98, 190 }, - { 10, 100, 190 }, - { 11, 102, 189 }, - { 13, 104, 189 }, - { 15, 106, 189 }, - { 17, 108, 188 }, - { 19, 110, 188 }, - { 22, 112, 188 }, - { 25, 114, 187 }, - { 27, 116, 187 }, - { 30, 118, 187 }, - { 33, 120, 187 }, - { 35, 122, 186 }, - { 38, 123, 186 }, - { 41, 125, 186 }, - { 43, 127, 186 }, - { 46, 129, 186 }, - { 48, 131, 186 }, - { 51, 132, 186 }, - { 54, 134, 186 }, - { 56, 136, 186 }, - { 59, 137, 186 }, - { 62, 139, 186 }, - { 64, 141, 186 }, - { 67, 143, 186 }, - { 70, 144, 186 }, - { 72, 146, 186 }, - { 75, 148, 186 }, - { 78, 149, 186 }, - { 81, 151, 186 }, - { 83, 153, 186 }, - { 86, 154, 187 }, - { 89, 156, 187 }, - { 92, 157, 187 }, - { 95, 159, 187 }, - { 98, 160, 187 }, - { 101, 162, 188 }, - { 104, 164, 188 }, - { 107, 165, 188 }, - { 110, 167, 189 }, - { 113, 168, 189 }, - { 117, 170, 190 }, - { 120, 171, 190 }, - { 123, 172, 191 }, - { 126, 174, 191 }, - { 129, 175, 192 }, - { 133, 177, 192 }, - { 136, 178, 193 }, - { 139, 180, 194 }, - { 142, 181, 195 }, - { 145, 183, 195 }, - { 148, 184, 196 }, - { 152, 186, 197 }, - { 155, 187, 198 }, - { 158, 188, 199 }, - { 161, 190, 200 }, - { 164, 191, 201 }, - { 167, 193, 202 }, - { 170, 194, 203 }, - { 173, 196, 204 }, - { 176, 197, 205 }, - { 179, 199, 206 }, - { 182, 201, 207 }, - { 185, 202, 208 }, - { 188, 204, 210 }, - { 191, 205, 211 }, - { 193, 207, 212 }, - { 196, 208, 213 }, - { 199, 210, 215 }, - { 202, 212, 216 }, - { 205, 213, 217 }, - { 208, 215, 218 }, - { 211, 217, 220 }, - { 213, 218, 221 }, - { 216, 220, 222 }, - { 219, 222, 224 }, - { 222, 224, 225 }, - { 225, 225, 227 }, - { 227, 227, 228 }, - { 230, 229, 230 }, - { 233, 231, 231 }, - { 235, 233, 233 }, - { 238, 234, 234 }, - { 241, 236, 236 }, - { 241, 236, 235 }, - { 240, 234, 233 }, - { 239, 232, 230 }, - { 238, 229, 227 }, - { 237, 227, 224 }, - { 236, 224, 222 }, - { 235, 222, 219 }, - { 234, 220, 216 }, - { 233, 217, 213 }, - { 232, 215, 210 }, - { 231, 213, 207 }, - { 230, 210, 205 }, - { 229, 208, 202 }, - { 229, 206, 199 }, - { 228, 203, 196 }, - { 227, 201, 193 }, - { 226, 199, 190 }, - { 225, 196, 187 }, - { 225, 194, 184 }, - { 224, 192, 181 }, - { 223, 189, 178 }, - { 223, 187, 176 }, - { 222, 185, 173 }, - { 221, 182, 170 }, - { 220, 180, 167 }, - { 220, 178, 164 }, - { 219, 175, 161 }, - { 218, 173, 158 }, - { 218, 171, 155 }, - { 217, 169, 152 }, - { 216, 166, 150 }, - { 216, 164, 147 }, - { 215, 162, 144 }, - { 214, 159, 141 }, - { 214, 157, 138 }, - { 213, 155, 135 }, - { 212, 153, 132 }, - { 211, 150, 129 }, - { 211, 148, 127 }, - { 210, 146, 124 }, - { 209, 143, 121 }, - { 209, 141, 118 }, - { 208, 139, 115 }, - { 207, 137, 112 }, - { 207, 134, 110 }, - { 206, 132, 107 }, - { 205, 130, 104 }, - { 205, 127, 101 }, - { 204, 125, 99 }, - { 203, 123, 96 }, - { 202, 121, 93 }, - { 202, 118, 91 }, - { 201, 116, 88 }, - { 200, 114, 85 }, - { 199, 111, 83 }, - { 199, 109, 80 }, - { 198, 107, 77 }, - { 197, 104, 75 }, - { 196, 102, 72 }, - { 195, 99, 70 }, - { 195, 97, 67 }, - { 194, 95, 65 }, - { 193, 92, 63 }, - { 192, 90, 60 }, - { 191, 87, 58 }, - { 190, 85, 56 }, - { 190, 82, 54 }, - { 189, 80, 52 }, - { 188, 77, 50 }, - { 187, 75, 48 }, - { 186, 72, 46 }, - { 185, 69, 44 }, - { 184, 67, 43 }, - { 183, 64, 41 }, - { 182, 61, 40 }, - { 180, 59, 39 }, - { 179, 56, 38 }, - { 178, 53, 37 }, - { 177, 51, 37 }, - { 175, 48, 36 }, - { 174, 46, 36 }, - { 172, 43, 36 }, - { 171, 41, 36 }, - { 169, 38, 36 }, - { 167, 36, 36 }, - { 165, 33, 37 }, - { 163, 31, 37 }, - { 161, 29, 37 }, - { 159, 27, 38 }, - { 157, 25, 38 }, - { 155, 23, 39 }, - { 153, 22, 39 }, - { 151, 20, 40 }, - { 148, 19, 40 }, - { 146, 18, 40 }, - { 144, 16, 41 }, - { 141, 16, 41 }, - { 139, 15, 41 }, - { 136, 15, 41 }, - { 134, 14, 41 }, - { 131, 14, 41 }, - { 128, 14, 41 }, - { 126, 14, 41 }, - { 123, 14, 41 }, - { 120, 14, 40 }, - { 118, 14, 40 }, - { 115, 14, 39 }, - { 112, 14, 39 }, - { 109, 14, 38 }, - { 107, 15, 37 }, - { 104, 15, 37 }, - { 101, 15, 36 }, - { 99, 14, 35 }, - { 96, 14, 34 }, - { 94, 14, 33 }, - { 91, 14, 32 }, - { 88, 14, 31 }, - { 86, 14, 30 }, - { 83, 13, 29 }, - { 81, 13, 28 }, - { 78, 13, 27 }, - { 75, 12, 25 }, - { 73, 12, 24 }, - { 70, 11, 23 }, - { 68, 11, 22 }, - { 65, 10, 20 }, - { 63, 10, 19 }, - { 60, 9, 18 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Blues.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Blues.cs deleted file mode 100644 index 22ddb7974..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Blues.cs +++ /dev/null @@ -1,76 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Blues : IColourMap - { - public string Name => "Blues"; - - public (byte r, byte g, byte b) GetRGB(byte value) - { - byte[] bytes = BitConverter.GetBytes(argb[value]); - return (bytes[2], bytes[1], bytes[0]); - } - - private readonly int[] argb = - { - -16767403, -16767402, -16767144, -16766887, -16701093, -16700835, -16700578, -16634784, - -16634527, -16634269, -16568476, -16568218, -16568216, -16567959, -16502165, -16501908, - -16501650, -16435856, -16435599, -16435341, -16369548, -16369290, -16369033, -16303495, - -16303238, -16302980, -16237186, -16236929, -16236671, -16236414, -16170620, -16170363, - -16170105, -16104312, -16104054, -16103797, -16038259, -16038002, -16037745, -15971951, - -15971694, -15971436, -15905643, -15905385, -15905128, -15839335, -15839077, -15838820, - -15773027, -15772769, -15772512, -15706718, -15706717, -15706460, -15706203, -15640409, - -15640152, -15574359, -15574101, -15573844, -15508051, -15507794, -15507537, -15441743, - -15441486, -15441229, -15375436, -15375179, -15309386, -15309128, -15308871, -15243078, - -15242821, -15177284, -15177027, -15111234, -15110977, -15045184, -15044927, -14979134, - -14978877, -14913084, -14912827, -14847034, -14781241, -14780984, -14715191, -14715190, - -14649397, -14583605, -14517812, -14517555, -14451762, -14385969, -14320176, -14319920, - -14254383, -14188590, -14122797, -14057005, -13991212, -13925419, -13859626, -13859626, - -13793833, -13662505, -13596712, -13530919, -13465383, -13399590, -13333797, -13268005, - -13202212, -13136676, -13005347, -12939555, -12873762, -12808226, -12676897, -12611105, - -12545312, -12414240, -12348447, -12282655, -12151327, -12085790, -12019998, -11888669, - -11822877, -11757341, -11626012, -11560220, -11429148, -11363355, -11232027, -11166235, - -11035162, -10969370, -10903578, -10772505, -10706713, -10575385, -10509592, -10378520, - -10312728, -10181400, -10115863, -09984535, -09918743, -09787414, -09721878, -09590550, - -09524758, -09393429, -09327893, -09262101, -09130773, -09065237, -08933908, -08868116, - -08736788, -08671252, -08605459, -08474131, -08408339, -08277267, -08211475, -08145682, - -08014354, -07948818, -07817490, -07751698, -07685905, -07554833, -07489041, -07357713, - -07291921, -07226128, -07095056, -07029264, -06897936, -06832144, -06766351, -06635279, - -06569487, -06503695, -06372367, -06306575, -06175502, -06109710, -06043918, -05912590, - -05846798, -05781261, -05649933, -05584141, -05518349, -05387021, -05321485, -05190156, - -05124364, -05058572, -04927244, -04861452, -04730123, -04664587, -04598795, -04467467, - -04401675, -04335883, -04204554, -04139018, -04007690, -03941898, -03876106, -03744777, - -03678985, -03547657, -03481865, -03416329, -03285000, -03219208, -03087880, -03022088, - -02956296, -02824968, -02759175, -02628103, -02562311, -02430983, -02365191, -02299398, - -02168070, -02102278, -01970950, -01905158, -01839621, -01708293, -01642501, -01511173, - -01445381, -01314052, -01248260, -01182468, -01051140, -00985604, -00854275, -00788483, - -00657155, -00591363, -00525571, -00394242, -00328450, -00197122, -00131330, -00000001, - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Curl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Curl.cs deleted file mode 100644 index 5dfc49a21..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Curl.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Curl : IColourMap - { - public string Name => "Curl"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 21, 29, 68 }, - { 21, 31, 69 }, - { 22, 33, 70 }, - { 22, 35, 71 }, - { 23, 37, 72 }, - { 23, 39, 73 }, - { 24, 41, 74 }, - { 24, 43, 75 }, - { 24, 45, 76 }, - { 25, 47, 77 }, - { 25, 49, 79 }, - { 26, 51, 80 }, - { 26, 53, 81 }, - { 26, 54, 82 }, - { 27, 56, 83 }, - { 27, 58, 84 }, - { 27, 60, 86 }, - { 27, 62, 87 }, - { 28, 64, 88 }, - { 28, 66, 89 }, - { 28, 67, 90 }, - { 28, 69, 91 }, - { 28, 71, 93 }, - { 28, 73, 94 }, - { 28, 75, 95 }, - { 28, 76, 96 }, - { 28, 78, 97 }, - { 28, 80, 98 }, - { 28, 82, 99 }, - { 28, 84, 101 }, - { 27, 86, 102 }, - { 27, 88, 103 }, - { 27, 89, 104 }, - { 26, 91, 105 }, - { 26, 93, 106 }, - { 26, 95, 107 }, - { 25, 97, 108 }, - { 25, 99, 109 }, - { 24, 101, 110 }, - { 23, 102, 111 }, - { 23, 104, 112 }, - { 22, 106, 113 }, - { 21, 108, 114 }, - { 20, 110, 115 }, - { 20, 112, 116 }, - { 19, 114, 117 }, - { 18, 116, 118 }, - { 18, 118, 118 }, - { 17, 119, 119 }, - { 17, 121, 120 }, - { 17, 123, 121 }, - { 17, 125, 121 }, - { 17, 127, 122 }, - { 18, 129, 123 }, - { 19, 131, 123 }, - { 20, 132, 124 }, - { 22, 134, 124 }, - { 23, 136, 125 }, - { 26, 138, 125 }, - { 28, 140, 126 }, - { 31, 141, 126 }, - { 34, 143, 126 }, - { 37, 145, 127 }, - { 41, 147, 127 }, - { 44, 148, 127 }, - { 48, 150, 128 }, - { 52, 152, 128 }, - { 56, 153, 129 }, - { 59, 155, 129 }, - { 63, 156, 129 }, - { 67, 158, 130 }, - { 71, 159, 130 }, - { 75, 161, 131 }, - { 80, 162, 132 }, - { 84, 164, 132 }, - { 87, 165, 133 }, - { 91, 166, 134 }, - { 95, 168, 135 }, - { 99, 169, 136 }, - { 103, 171, 137 }, - { 107, 172, 138 }, - { 111, 173, 139 }, - { 114, 175, 140 }, - { 118, 176, 141 }, - { 122, 177, 142 }, - { 125, 179, 144 }, - { 129, 180, 145 }, - { 133, 181, 147 }, - { 136, 183, 148 }, - { 139, 184, 150 }, - { 143, 186, 151 }, - { 146, 187, 153 }, - { 150, 188, 155 }, - { 153, 190, 157 }, - { 156, 191, 159 }, - { 160, 192, 160 }, - { 163, 194, 162 }, - { 166, 195, 164 }, - { 169, 197, 166 }, - { 172, 198, 169 }, - { 176, 200, 171 }, - { 179, 201, 173 }, - { 182, 203, 175 }, - { 185, 204, 178 }, - { 188, 206, 180 }, - { 191, 207, 182 }, - { 194, 209, 185 }, - { 197, 210, 187 }, - { 200, 212, 190 }, - { 203, 213, 192 }, - { 206, 215, 195 }, - { 209, 216, 197 }, - { 211, 218, 200 }, - { 214, 220, 203 }, - { 217, 221, 205 }, - { 220, 223, 208 }, - { 223, 225, 211 }, - { 226, 226, 214 }, - { 228, 228, 216 }, - { 231, 230, 219 }, - { 234, 232, 222 }, - { 237, 234, 225 }, - { 240, 235, 228 }, - { 242, 237, 231 }, - { 245, 239, 234 }, - { 248, 241, 237 }, - { 251, 243, 240 }, - { 253, 245, 243 }, - { 254, 246, 245 }, - { 252, 244, 241 }, - { 251, 241, 238 }, - { 250, 239, 235 }, - { 249, 236, 231 }, - { 248, 234, 228 }, - { 246, 231, 225 }, - { 245, 229, 221 }, - { 244, 226, 218 }, - { 243, 224, 214 }, - { 242, 221, 211 }, - { 242, 219, 208 }, - { 241, 216, 204 }, - { 240, 214, 201 }, - { 239, 211, 198 }, - { 238, 209, 195 }, - { 237, 207, 191 }, - { 236, 204, 188 }, - { 236, 202, 185 }, - { 235, 199, 182 }, - { 234, 197, 179 }, - { 233, 194, 175 }, - { 233, 192, 172 }, - { 232, 189, 169 }, - { 231, 187, 166 }, - { 231, 184, 163 }, - { 230, 182, 160 }, - { 229, 179, 157 }, - { 229, 177, 154 }, - { 228, 174, 152 }, - { 227, 172, 149 }, - { 227, 169, 146 }, - { 226, 167, 143 }, - { 225, 164, 141 }, - { 225, 162, 138 }, - { 224, 159, 136 }, - { 224, 157, 133 }, - { 223, 154, 131 }, - { 222, 152, 128 }, - { 222, 149, 126 }, - { 221, 147, 124 }, - { 220, 144, 122 }, - { 219, 142, 120 }, - { 219, 139, 118 }, - { 218, 137, 116 }, - { 217, 134, 114 }, - { 216, 132, 113 }, - { 215, 129, 111 }, - { 214, 127, 110 }, - { 214, 124, 108 }, - { 213, 122, 107 }, - { 212, 119, 106 }, - { 211, 117, 105 }, - { 210, 114, 104 }, - { 208, 112, 103 }, - { 207, 110, 102 }, - { 206, 107, 101 }, - { 205, 105, 100 }, - { 204, 103, 100 }, - { 202, 100, 99 }, - { 201, 98, 99 }, - { 200, 96, 98 }, - { 198, 93, 98 }, - { 197, 91, 97 }, - { 195, 89, 97 }, - { 194, 87, 97 }, - { 192, 85, 97 }, - { 191, 83, 96 }, - { 189, 81, 96 }, - { 187, 78, 96 }, - { 186, 76, 96 }, - { 184, 74, 96 }, - { 182, 72, 96 }, - { 180, 70, 96 }, - { 179, 68, 96 }, - { 177, 66, 96 }, - { 175, 65, 96 }, - { 173, 63, 96 }, - { 171, 61, 96 }, - { 169, 59, 96 }, - { 167, 57, 96 }, - { 165, 55, 96 }, - { 163, 54, 96 }, - { 161, 52, 96 }, - { 159, 50, 96 }, - { 157, 48, 96 }, - { 155, 47, 96 }, - { 153, 45, 97 }, - { 151, 43, 97 }, - { 149, 42, 97 }, - { 146, 40, 97 }, - { 144, 39, 96 }, - { 142, 37, 96 }, - { 140, 36, 96 }, - { 137, 34, 96 }, - { 135, 33, 96 }, - { 133, 32, 96 }, - { 130, 31, 96 }, - { 128, 29, 95 }, - { 125, 28, 95 }, - { 123, 27, 94 }, - { 120, 26, 94 }, - { 118, 25, 93 }, - { 115, 25, 93 }, - { 113, 24, 92 }, - { 110, 23, 91 }, - { 108, 23, 90 }, - { 105, 22, 89 }, - { 102, 22, 88 }, - { 100, 21, 87 }, - { 97, 21, 86 }, - { 94, 20, 85 }, - { 92, 20, 83 }, - { 89, 20, 82 }, - { 87, 19, 80 }, - { 84, 19, 78 }, - { 81, 19, 77 }, - { 79, 18, 75 }, - { 76, 18, 73 }, - { 73, 18, 71 }, - { 71, 17, 69 }, - { 68, 17, 67 }, - { 66, 16, 65 }, - { 63, 16, 63 }, - { 61, 15, 61 }, - { 58, 15, 59 }, - { 56, 14, 57 }, - { 53, 13, 54 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Deep.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Deep.cs deleted file mode 100644 index 60f7b82d6..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Deep.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Deep : IColourMap - { - public string Name => "Deep"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 253, 254, 204 }, - { 251, 253, 203 }, - { 249, 252, 202 }, - { 247, 251, 200 }, - { 245, 250, 199 }, - { 243, 250, 198 }, - { 241, 249, 197 }, - { 239, 248, 196 }, - { 237, 247, 195 }, - { 235, 247, 193 }, - { 233, 246, 192 }, - { 231, 245, 191 }, - { 229, 244, 190 }, - { 227, 244, 189 }, - { 225, 243, 188 }, - { 223, 242, 187 }, - { 221, 242, 186 }, - { 219, 241, 185 }, - { 217, 240, 184 }, - { 215, 239, 183 }, - { 212, 239, 182 }, - { 210, 238, 181 }, - { 208, 237, 180 }, - { 206, 236, 179 }, - { 204, 236, 179 }, - { 202, 235, 178 }, - { 200, 234, 177 }, - { 198, 234, 176 }, - { 196, 233, 175 }, - { 193, 232, 175 }, - { 191, 231, 174 }, - { 189, 231, 173 }, - { 187, 230, 172 }, - { 185, 229, 172 }, - { 183, 229, 171 }, - { 181, 228, 170 }, - { 178, 227, 170 }, - { 176, 226, 169 }, - { 174, 226, 169 }, - { 172, 225, 168 }, - { 170, 224, 168 }, - { 167, 224, 167 }, - { 165, 223, 167 }, - { 163, 222, 166 }, - { 161, 221, 166 }, - { 159, 221, 165 }, - { 156, 220, 165 }, - { 154, 219, 165 }, - { 152, 218, 164 }, - { 150, 218, 164 }, - { 148, 217, 164 }, - { 146, 216, 164 }, - { 144, 215, 164 }, - { 141, 215, 163 }, - { 139, 214, 163 }, - { 137, 213, 163 }, - { 135, 212, 163 }, - { 133, 211, 163 }, - { 131, 211, 163 }, - { 129, 210, 163 }, - { 127, 209, 163 }, - { 125, 208, 163 }, - { 124, 207, 163 }, - { 122, 206, 163 }, - { 120, 206, 163 }, - { 118, 205, 163 }, - { 117, 204, 163 }, - { 115, 203, 163 }, - { 113, 202, 163 }, - { 112, 201, 163 }, - { 110, 200, 163 }, - { 109, 199, 163 }, - { 107, 198, 163 }, - { 106, 197, 164 }, - { 105, 196, 164 }, - { 103, 195, 164 }, - { 102, 194, 164 }, - { 101, 194, 164 }, - { 100, 193, 164 }, - { 99, 192, 164 }, - { 98, 191, 164 }, - { 97, 190, 164 }, - { 96, 189, 164 }, - { 95, 188, 164 }, - { 94, 187, 164 }, - { 93, 186, 164 }, - { 92, 185, 164 }, - { 91, 184, 164 }, - { 90, 183, 164 }, - { 90, 182, 164 }, - { 89, 180, 164 }, - { 88, 179, 164 }, - { 88, 178, 164 }, - { 87, 177, 164 }, - { 86, 176, 164 }, - { 86, 175, 164 }, - { 85, 174, 163 }, - { 85, 173, 163 }, - { 84, 172, 163 }, - { 83, 171, 163 }, - { 83, 170, 163 }, - { 82, 169, 163 }, - { 82, 168, 163 }, - { 81, 167, 163 }, - { 81, 166, 162 }, - { 81, 165, 162 }, - { 80, 164, 162 }, - { 80, 163, 162 }, - { 79, 162, 162 }, - { 79, 161, 162 }, - { 79, 160, 162 }, - { 78, 159, 161 }, - { 78, 158, 161 }, - { 77, 157, 161 }, - { 77, 156, 161 }, - { 77, 155, 161 }, - { 76, 154, 160 }, - { 76, 153, 160 }, - { 75, 152, 160 }, - { 75, 151, 160 }, - { 75, 150, 160 }, - { 74, 149, 159 }, - { 74, 148, 159 }, - { 74, 147, 159 }, - { 73, 146, 159 }, - { 73, 145, 158 }, - { 73, 144, 158 }, - { 72, 143, 158 }, - { 72, 142, 158 }, - { 72, 141, 157 }, - { 71, 140, 157 }, - { 71, 139, 157 }, - { 71, 138, 157 }, - { 70, 137, 157 }, - { 70, 136, 156 }, - { 70, 135, 156 }, - { 69, 134, 156 }, - { 69, 133, 156 }, - { 69, 132, 155 }, - { 68, 131, 155 }, - { 68, 130, 155 }, - { 68, 129, 155 }, - { 68, 128, 155 }, - { 67, 127, 154 }, - { 67, 126, 154 }, - { 67, 125, 154 }, - { 66, 124, 154 }, - { 66, 123, 153 }, - { 66, 122, 153 }, - { 66, 121, 153 }, - { 65, 120, 153 }, - { 65, 119, 153 }, - { 65, 118, 152 }, - { 64, 117, 152 }, - { 64, 116, 152 }, - { 64, 115, 152 }, - { 64, 114, 152 }, - { 64, 113, 151 }, - { 63, 112, 151 }, - { 63, 111, 151 }, - { 63, 110, 151 }, - { 63, 109, 151 }, - { 63, 108, 150 }, - { 62, 107, 150 }, - { 62, 106, 150 }, - { 62, 105, 150 }, - { 62, 104, 150 }, - { 62, 103, 149 }, - { 62, 102, 149 }, - { 62, 101, 149 }, - { 62, 100, 149 }, - { 62, 99, 148 }, - { 62, 98, 148 }, - { 62, 97, 148 }, - { 62, 96, 148 }, - { 62, 95, 147 }, - { 62, 94, 147 }, - { 62, 92, 147 }, - { 62, 91, 147 }, - { 62, 90, 146 }, - { 62, 89, 146 }, - { 62, 88, 146 }, - { 62, 87, 145 }, - { 62, 86, 145 }, - { 63, 85, 144 }, - { 63, 84, 144 }, - { 63, 83, 143 }, - { 63, 82, 143 }, - { 63, 80, 142 }, - { 64, 79, 141 }, - { 64, 78, 141 }, - { 64, 77, 140 }, - { 64, 76, 139 }, - { 65, 75, 138 }, - { 65, 74, 137 }, - { 65, 73, 136 }, - { 65, 72, 135 }, - { 65, 71, 133 }, - { 65, 70, 132 }, - { 65, 69, 131 }, - { 65, 68, 129 }, - { 66, 67, 128 }, - { 65, 66, 126 }, - { 65, 65, 125 }, - { 65, 64, 123 }, - { 65, 64, 122 }, - { 65, 63, 120 }, - { 65, 62, 118 }, - { 65, 61, 117 }, - { 64, 60, 115 }, - { 64, 60, 113 }, - { 64, 59, 112 }, - { 64, 58, 110 }, - { 63, 57, 108 }, - { 63, 56, 107 }, - { 63, 56, 105 }, - { 62, 55, 103 }, - { 62, 54, 102 }, - { 61, 53, 100 }, - { 61, 53, 98 }, - { 61, 52, 97 }, - { 60, 51, 95 }, - { 60, 50, 93 }, - { 59, 50, 92 }, - { 59, 49, 90 }, - { 58, 48, 88 }, - { 58, 48, 87 }, - { 57, 47, 85 }, - { 57, 46, 84 }, - { 56, 45, 82 }, - { 56, 45, 81 }, - { 55, 44, 79 }, - { 54, 43, 77 }, - { 54, 42, 76 }, - { 53, 42, 74 }, - { 53, 41, 73 }, - { 52, 40, 71 }, - { 52, 40, 70 }, - { 51, 39, 68 }, - { 50, 38, 67 }, - { 50, 37, 65 }, - { 49, 37, 64 }, - { 48, 36, 62 }, - { 48, 35, 61 }, - { 47, 34, 59 }, - { 47, 34, 58 }, - { 46, 33, 57 }, - { 45, 32, 55 }, - { 45, 31, 54 }, - { 44, 31, 52 }, - { 43, 30, 51 }, - { 43, 29, 50 }, - { 42, 28, 48 }, - { 41, 28, 47 }, - { 40, 27, 45 }, - { 40, 26, 44 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Delta.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Delta.cs deleted file mode 100644 index 74aa85849..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Delta.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Delta : IColourMap - { - public string Name => "Delta"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 17, 32, 64 }, - { 18, 33, 67 }, - { 20, 34, 70 }, - { 21, 36, 73 }, - { 22, 37, 76 }, - { 23, 38, 79 }, - { 25, 40, 83 }, - { 26, 41, 86 }, - { 27, 42, 89 }, - { 28, 44, 93 }, - { 30, 45, 96 }, - { 31, 46, 100 }, - { 32, 48, 103 }, - { 33, 49, 107 }, - { 34, 50, 111 }, - { 35, 51, 114 }, - { 36, 53, 118 }, - { 37, 54, 122 }, - { 37, 55, 126 }, - { 38, 56, 130 }, - { 38, 58, 134 }, - { 39, 59, 137 }, - { 39, 61, 141 }, - { 38, 62, 145 }, - { 37, 64, 148 }, - { 36, 66, 150 }, - { 35, 68, 152 }, - { 33, 70, 154 }, - { 32, 73, 155 }, - { 31, 75, 155 }, - { 30, 77, 156 }, - { 29, 79, 156 }, - { 28, 82, 157 }, - { 28, 84, 157 }, - { 27, 86, 157 }, - { 27, 88, 158 }, - { 27, 90, 158 }, - { 27, 92, 158 }, - { 27, 94, 159 }, - { 27, 96, 159 }, - { 27, 98, 159 }, - { 27, 100, 159 }, - { 28, 102, 160 }, - { 28, 104, 160 }, - { 29, 106, 160 }, - { 30, 108, 161 }, - { 30, 110, 161 }, - { 31, 112, 162 }, - { 32, 114, 162 }, - { 33, 116, 162 }, - { 34, 118, 163 }, - { 35, 120, 163 }, - { 36, 122, 164 }, - { 37, 124, 164 }, - { 38, 126, 165 }, - { 39, 128, 165 }, - { 40, 129, 165 }, - { 42, 131, 166 }, - { 43, 133, 166 }, - { 44, 135, 167 }, - { 45, 137, 167 }, - { 47, 139, 168 }, - { 48, 141, 168 }, - { 50, 143, 169 }, - { 51, 145, 169 }, - { 53, 146, 170 }, - { 54, 148, 170 }, - { 56, 150, 171 }, - { 58, 152, 171 }, - { 60, 154, 172 }, - { 62, 156, 172 }, - { 64, 158, 173 }, - { 66, 160, 173 }, - { 68, 161, 174 }, - { 71, 163, 174 }, - { 73, 165, 174 }, - { 76, 167, 175 }, - { 79, 169, 175 }, - { 82, 170, 176 }, - { 86, 172, 176 }, - { 89, 174, 176 }, - { 93, 175, 177 }, - { 96, 177, 177 }, - { 100, 178, 178 }, - { 104, 180, 178 }, - { 108, 181, 179 }, - { 112, 183, 180 }, - { 116, 184, 181 }, - { 120, 186, 181 }, - { 124, 187, 182 }, - { 128, 189, 183 }, - { 132, 190, 184 }, - { 136, 191, 185 }, - { 139, 193, 186 }, - { 143, 194, 187 }, - { 147, 196, 189 }, - { 151, 197, 190 }, - { 154, 199, 191 }, - { 158, 200, 192 }, - { 161, 202, 194 }, - { 165, 203, 195 }, - { 168, 205, 196 }, - { 172, 206, 198 }, - { 175, 208, 199 }, - { 179, 209, 200 }, - { 182, 211, 202 }, - { 185, 212, 203 }, - { 189, 214, 205 }, - { 192, 216, 206 }, - { 195, 217, 208 }, - { 198, 219, 209 }, - { 202, 221, 211 }, - { 205, 222, 212 }, - { 208, 224, 213 }, - { 211, 226, 215 }, - { 214, 227, 216 }, - { 217, 229, 218 }, - { 220, 231, 219 }, - { 223, 233, 220 }, - { 227, 235, 222 }, - { 230, 237, 223 }, - { 233, 238, 224 }, - { 236, 240, 225 }, - { 239, 242, 226 }, - { 242, 244, 227 }, - { 246, 246, 228 }, - { 249, 248, 229 }, - { 252, 250, 230 }, - { 255, 253, 205 }, - { 254, 250, 201 }, - { 252, 248, 197 }, - { 251, 246, 192 }, - { 249, 243, 188 }, - { 248, 241, 184 }, - { 247, 238, 180 }, - { 246, 236, 175 }, - { 244, 234, 171 }, - { 243, 231, 167 }, - { 241, 229, 162 }, - { 240, 227, 158 }, - { 239, 225, 154 }, - { 237, 222, 150 }, - { 236, 220, 145 }, - { 234, 218, 141 }, - { 233, 216, 137 }, - { 231, 214, 132 }, - { 230, 212, 128 }, - { 228, 210, 123 }, - { 227, 207, 119 }, - { 225, 205, 115 }, - { 223, 204, 110 }, - { 221, 202, 106 }, - { 219, 200, 102 }, - { 217, 198, 97 }, - { 215, 196, 93 }, - { 213, 194, 89 }, - { 211, 193, 85 }, - { 209, 191, 81 }, - { 206, 189, 76 }, - { 204, 188, 72 }, - { 201, 186, 69 }, - { 199, 185, 65 }, - { 196, 183, 61 }, - { 193, 182, 57 }, - { 190, 180, 54 }, - { 187, 179, 50 }, - { 184, 178, 47 }, - { 181, 176, 43 }, - { 178, 175, 40 }, - { 175, 174, 37 }, - { 172, 173, 34 }, - { 169, 171, 31 }, - { 165, 170, 28 }, - { 162, 169, 25 }, - { 159, 168, 23 }, - { 155, 166, 20 }, - { 152, 165, 18 }, - { 149, 164, 15 }, - { 145, 163, 13 }, - { 142, 162, 11 }, - { 138, 160, 9 }, - { 135, 159, 8 }, - { 131, 158, 7 }, - { 128, 157, 6 }, - { 124, 156, 6 }, - { 121, 154, 6 }, - { 117, 153, 6 }, - { 113, 152, 6 }, - { 110, 151, 7 }, - { 106, 149, 8 }, - { 102, 148, 9 }, - { 99, 147, 11 }, - { 95, 146, 12 }, - { 92, 144, 14 }, - { 88, 143, 15 }, - { 84, 142, 17 }, - { 81, 140, 18 }, - { 77, 139, 20 }, - { 73, 138, 22 }, - { 70, 136, 23 }, - { 66, 135, 25 }, - { 63, 133, 26 }, - { 59, 132, 28 }, - { 56, 131, 29 }, - { 52, 129, 30 }, - { 49, 127, 32 }, - { 45, 126, 33 }, - { 42, 124, 34 }, - { 39, 123, 35 }, - { 36, 121, 36 }, - { 33, 120, 37 }, - { 30, 118, 38 }, - { 27, 116, 39 }, - { 24, 115, 40 }, - { 22, 113, 41 }, - { 19, 111, 41 }, - { 17, 109, 42 }, - { 15, 108, 43 }, - { 14, 106, 43 }, - { 13, 104, 43 }, - { 12, 102, 44 }, - { 11, 100, 44 }, - { 11, 99, 44 }, - { 11, 97, 45 }, - { 11, 95, 45 }, - { 12, 93, 45 }, - { 12, 91, 45 }, - { 13, 89, 45 }, - { 14, 87, 45 }, - { 15, 85, 44 }, - { 16, 84, 44 }, - { 17, 82, 44 }, - { 18, 80, 43 }, - { 19, 78, 43 }, - { 20, 76, 42 }, - { 20, 74, 42 }, - { 21, 72, 41 }, - { 22, 70, 41 }, - { 23, 68, 40 }, - { 23, 66, 39 }, - { 24, 64, 38 }, - { 24, 63, 37 }, - { 25, 61, 36 }, - { 25, 59, 35 }, - { 25, 57, 34 }, - { 25, 55, 33 }, - { 25, 53, 32 }, - { 25, 51, 31 }, - { 25, 49, 30 }, - { 25, 47, 28 }, - { 25, 45, 27 }, - { 25, 44, 25 }, - { 25, 42, 24 }, - { 24, 40, 23 }, - { 24, 38, 21 }, - { 23, 36, 19 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Dense.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Dense.cs deleted file mode 100644 index dce726d9f..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Dense.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Dense : IColourMap - { - public string Name => "Dense"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 230, 241, 241 }, - { 228, 240, 240 }, - { 227, 239, 239 }, - { 225, 238, 239 }, - { 223, 237, 238 }, - { 221, 237, 237 }, - { 220, 236, 237 }, - { 218, 235, 236 }, - { 216, 234, 236 }, - { 215, 233, 235 }, - { 213, 233, 235 }, - { 211, 232, 234 }, - { 209, 231, 234 }, - { 208, 230, 233 }, - { 206, 229, 233 }, - { 204, 228, 232 }, - { 203, 228, 232 }, - { 201, 227, 232 }, - { 199, 226, 231 }, - { 198, 225, 231 }, - { 196, 224, 230 }, - { 194, 223, 230 }, - { 193, 223, 230 }, - { 191, 222, 230 }, - { 190, 221, 229 }, - { 188, 220, 229 }, - { 186, 219, 229 }, - { 185, 218, 228 }, - { 183, 218, 228 }, - { 182, 217, 228 }, - { 180, 216, 228 }, - { 178, 215, 228 }, - { 177, 214, 227 }, - { 175, 213, 227 }, - { 174, 212, 227 }, - { 172, 212, 227 }, - { 171, 211, 227 }, - { 169, 210, 227 }, - { 168, 209, 227 }, - { 166, 208, 227 }, - { 165, 207, 226 }, - { 163, 206, 226 }, - { 162, 206, 226 }, - { 160, 205, 226 }, - { 159, 204, 226 }, - { 158, 203, 226 }, - { 156, 202, 226 }, - { 155, 201, 226 }, - { 154, 200, 226 }, - { 152, 199, 226 }, - { 151, 198, 226 }, - { 150, 197, 226 }, - { 148, 197, 226 }, - { 147, 196, 226 }, - { 146, 195, 226 }, - { 144, 194, 226 }, - { 143, 193, 226 }, - { 142, 192, 226 }, - { 141, 191, 226 }, - { 140, 190, 226 }, - { 138, 189, 227 }, - { 137, 188, 227 }, - { 136, 187, 227 }, - { 135, 186, 227 }, - { 134, 185, 227 }, - { 133, 184, 227 }, - { 132, 183, 227 }, - { 131, 182, 227 }, - { 130, 181, 227 }, - { 129, 180, 227 }, - { 128, 179, 227 }, - { 127, 178, 227 }, - { 127, 177, 228 }, - { 126, 176, 228 }, - { 125, 175, 228 }, - { 124, 174, 228 }, - { 123, 173, 228 }, - { 123, 172, 228 }, - { 122, 171, 228 }, - { 121, 170, 228 }, - { 121, 169, 228 }, - { 120, 168, 228 }, - { 120, 167, 228 }, - { 119, 166, 228 }, - { 119, 165, 228 }, - { 118, 164, 229 }, - { 118, 163, 229 }, - { 117, 161, 229 }, - { 117, 160, 229 }, - { 117, 159, 229 }, - { 117, 158, 229 }, - { 116, 157, 229 }, - { 116, 156, 228 }, - { 116, 155, 228 }, - { 116, 154, 228 }, - { 116, 152, 228 }, - { 115, 151, 228 }, - { 115, 150, 228 }, - { 115, 149, 228 }, - { 115, 148, 228 }, - { 115, 147, 227 }, - { 115, 145, 227 }, - { 115, 144, 227 }, - { 115, 143, 227 }, - { 115, 142, 226 }, - { 116, 141, 226 }, - { 116, 139, 226 }, - { 116, 138, 226 }, - { 116, 137, 225 }, - { 116, 136, 225 }, - { 116, 135, 224 }, - { 116, 133, 224 }, - { 117, 132, 223 }, - { 117, 131, 223 }, - { 117, 130, 222 }, - { 117, 129, 222 }, - { 117, 127, 221 }, - { 117, 126, 221 }, - { 118, 125, 220 }, - { 118, 124, 220 }, - { 118, 123, 219 }, - { 118, 121, 218 }, - { 118, 120, 218 }, - { 119, 119, 217 }, - { 119, 118, 216 }, - { 119, 117, 215 }, - { 119, 115, 215 }, - { 119, 114, 214 }, - { 120, 113, 213 }, - { 120, 112, 212 }, - { 120, 111, 211 }, - { 120, 110, 210 }, - { 120, 108, 210 }, - { 120, 107, 209 }, - { 120, 106, 208 }, - { 121, 105, 207 }, - { 121, 104, 206 }, - { 121, 102, 205 }, - { 121, 101, 204 }, - { 121, 100, 203 }, - { 121, 99, 202 }, - { 121, 98, 201 }, - { 121, 97, 200 }, - { 121, 96, 199 }, - { 121, 94, 197 }, - { 121, 93, 196 }, - { 121, 92, 195 }, - { 121, 91, 194 }, - { 121, 90, 193 }, - { 121, 89, 192 }, - { 121, 88, 191 }, - { 121, 87, 189 }, - { 121, 86, 188 }, - { 121, 84, 187 }, - { 121, 83, 186 }, - { 121, 82, 184 }, - { 121, 81, 183 }, - { 121, 80, 182 }, - { 121, 79, 181 }, - { 120, 78, 179 }, - { 120, 77, 178 }, - { 120, 76, 177 }, - { 120, 75, 175 }, - { 120, 74, 174 }, - { 120, 73, 173 }, - { 119, 72, 171 }, - { 119, 71, 170 }, - { 119, 70, 169 }, - { 119, 69, 167 }, - { 119, 67, 166 }, - { 118, 66, 165 }, - { 118, 65, 163 }, - { 118, 64, 162 }, - { 118, 63, 160 }, - { 117, 62, 159 }, - { 117, 61, 157 }, - { 117, 60, 156 }, - { 116, 59, 155 }, - { 116, 59, 153 }, - { 116, 58, 152 }, - { 115, 57, 150 }, - { 115, 56, 149 }, - { 115, 55, 147 }, - { 114, 54, 146 }, - { 114, 53, 144 }, - { 114, 52, 143 }, - { 113, 51, 141 }, - { 113, 50, 140 }, - { 112, 49, 138 }, - { 112, 48, 136 }, - { 111, 47, 135 }, - { 111, 46, 133 }, - { 110, 45, 132 }, - { 110, 45, 130 }, - { 109, 44, 129 }, - { 109, 43, 127 }, - { 108, 42, 126 }, - { 108, 41, 124 }, - { 107, 40, 122 }, - { 107, 40, 121 }, - { 106, 39, 119 }, - { 106, 38, 117 }, - { 105, 37, 116 }, - { 104, 36, 114 }, - { 104, 36, 113 }, - { 103, 35, 111 }, - { 103, 34, 109 }, - { 102, 33, 108 }, - { 101, 33, 106 }, - { 101, 32, 104 }, - { 100, 31, 103 }, - { 99, 31, 101 }, - { 98, 30, 99 }, - { 98, 29, 98 }, - { 97, 29, 96 }, - { 96, 28, 94 }, - { 95, 27, 93 }, - { 95, 27, 91 }, - { 94, 26, 89 }, - { 93, 26, 88 }, - { 92, 25, 86 }, - { 91, 25, 84 }, - { 90, 24, 83 }, - { 90, 24, 81 }, - { 89, 23, 80 }, - { 88, 23, 78 }, - { 87, 22, 76 }, - { 86, 22, 75 }, - { 85, 22, 73 }, - { 84, 21, 72 }, - { 83, 21, 70 }, - { 82, 21, 68 }, - { 81, 20, 67 }, - { 80, 20, 65 }, - { 79, 20, 64 }, - { 78, 19, 62 }, - { 77, 19, 61 }, - { 75, 19, 59 }, - { 74, 19, 58 }, - { 73, 18, 56 }, - { 72, 18, 55 }, - { 71, 18, 54 }, - { 70, 18, 52 }, - { 69, 17, 51 }, - { 68, 17, 50 }, - { 66, 17, 48 }, - { 65, 17, 47 }, - { 64, 16, 46 }, - { 63, 16, 45 }, - { 62, 16, 43 }, - { 60, 16, 42 }, - { 59, 15, 41 }, - { 58, 15, 40 }, - { 57, 15, 39 }, - { 56, 15, 37 }, - { 54, 14, 36 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Diff.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Diff.cs deleted file mode 100644 index 9c0e758a8..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Diff.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Diff : IColourMap - { - public string Name => "Diff"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 8, 35, 64 }, - { 9, 37, 66 }, - { 10, 38, 68 }, - { 11, 40, 69 }, - { 12, 42, 71 }, - { 12, 44, 73 }, - { 13, 45, 75 }, - { 14, 47, 77 }, - { 15, 49, 79 }, - { 16, 50, 81 }, - { 17, 52, 83 }, - { 17, 54, 85 }, - { 18, 55, 86 }, - { 19, 57, 88 }, - { 20, 59, 90 }, - { 20, 61, 92 }, - { 21, 62, 94 }, - { 22, 64, 95 }, - { 23, 66, 97 }, - { 24, 67, 99 }, - { 25, 69, 100 }, - { 26, 71, 102 }, - { 27, 72, 103 }, - { 29, 74, 104 }, - { 31, 76, 105 }, - { 33, 77, 106 }, - { 36, 79, 107 }, - { 38, 80, 108 }, - { 40, 82, 109 }, - { 43, 83, 110 }, - { 45, 85, 111 }, - { 47, 86, 112 }, - { 49, 88, 113 }, - { 52, 89, 115 }, - { 54, 91, 116 }, - { 56, 92, 117 }, - { 58, 94, 118 }, - { 60, 95, 119 }, - { 62, 97, 120 }, - { 65, 98, 121 }, - { 67, 100, 122 }, - { 69, 101, 123 }, - { 71, 103, 125 }, - { 73, 104, 126 }, - { 75, 106, 127 }, - { 77, 107, 128 }, - { 79, 109, 129 }, - { 81, 110, 130 }, - { 83, 112, 132 }, - { 85, 113, 133 }, - { 88, 115, 134 }, - { 90, 116, 135 }, - { 92, 118, 136 }, - { 94, 120, 138 }, - { 96, 121, 139 }, - { 98, 123, 140 }, - { 100, 124, 141 }, - { 102, 126, 142 }, - { 104, 127, 144 }, - { 106, 129, 145 }, - { 108, 130, 146 }, - { 110, 132, 148 }, - { 112, 134, 149 }, - { 114, 135, 150 }, - { 116, 137, 151 }, - { 118, 138, 153 }, - { 120, 140, 154 }, - { 123, 141, 155 }, - { 125, 143, 157 }, - { 127, 145, 158 }, - { 129, 146, 159 }, - { 131, 148, 161 }, - { 133, 150, 162 }, - { 135, 151, 163 }, - { 137, 153, 165 }, - { 139, 154, 166 }, - { 141, 156, 167 }, - { 143, 158, 169 }, - { 146, 159, 170 }, - { 148, 161, 172 }, - { 150, 163, 173 }, - { 152, 165, 175 }, - { 154, 166, 176 }, - { 156, 168, 177 }, - { 158, 170, 179 }, - { 160, 171, 180 }, - { 163, 173, 182 }, - { 165, 175, 183 }, - { 167, 177, 185 }, - { 169, 178, 186 }, - { 171, 180, 188 }, - { 174, 182, 189 }, - { 176, 184, 191 }, - { 178, 186, 192 }, - { 180, 187, 194 }, - { 182, 189, 196 }, - { 185, 191, 197 }, - { 187, 193, 199 }, - { 189, 195, 200 }, - { 191, 197, 202 }, - { 194, 198, 204 }, - { 196, 200, 205 }, - { 198, 202, 207 }, - { 200, 204, 209 }, - { 203, 206, 210 }, - { 205, 208, 212 }, - { 207, 210, 214 }, - { 210, 212, 215 }, - { 212, 214, 217 }, - { 214, 216, 219 }, - { 217, 218, 221 }, - { 219, 220, 222 }, - { 221, 222, 224 }, - { 224, 224, 226 }, - { 226, 226, 227 }, - { 228, 227, 229 }, - { 230, 229, 231 }, - { 232, 231, 232 }, - { 235, 233, 234 }, - { 236, 234, 235 }, - { 238, 236, 236 }, - { 240, 237, 238 }, - { 241, 238, 239 }, - { 243, 239, 239 }, - { 244, 240, 240 }, - { 245, 241, 240 }, - { 245, 241, 240 }, - { 246, 241, 240 }, - { 246, 241, 240 }, - { 245, 241, 239 }, - { 245, 240, 238 }, - { 244, 239, 237 }, - { 243, 238, 235 }, - { 242, 237, 233 }, - { 241, 235, 232 }, - { 239, 234, 229 }, - { 238, 232, 227 }, - { 236, 230, 225 }, - { 234, 229, 223 }, - { 232, 227, 220 }, - { 231, 225, 218 }, - { 229, 223, 215 }, - { 227, 221, 212 }, - { 225, 219, 210 }, - { 223, 217, 207 }, - { 221, 215, 205 }, - { 219, 213, 202 }, - { 217, 211, 199 }, - { 215, 209, 197 }, - { 213, 207, 194 }, - { 211, 205, 192 }, - { 210, 203, 189 }, - { 208, 201, 187 }, - { 206, 199, 184 }, - { 204, 197, 181 }, - { 202, 195, 179 }, - { 200, 193, 176 }, - { 199, 191, 174 }, - { 197, 189, 171 }, - { 195, 187, 169 }, - { 193, 185, 166 }, - { 191, 183, 164 }, - { 190, 181, 161 }, - { 188, 179, 159 }, - { 186, 177, 157 }, - { 185, 176, 154 }, - { 183, 174, 152 }, - { 181, 172, 149 }, - { 179, 170, 147 }, - { 178, 168, 144 }, - { 176, 166, 142 }, - { 174, 165, 140 }, - { 173, 163, 137 }, - { 171, 161, 135 }, - { 169, 159, 133 }, - { 168, 157, 130 }, - { 166, 156, 128 }, - { 164, 154, 125 }, - { 163, 152, 123 }, - { 161, 150, 121 }, - { 160, 149, 118 }, - { 158, 147, 116 }, - { 156, 145, 114 }, - { 155, 143, 112 }, - { 153, 142, 109 }, - { 152, 140, 107 }, - { 150, 138, 105 }, - { 149, 137, 103 }, - { 147, 135, 100 }, - { 145, 133, 98 }, - { 144, 132, 96 }, - { 142, 130, 94 }, - { 141, 128, 91 }, - { 139, 127, 89 }, - { 138, 125, 87 }, - { 136, 123, 85 }, - { 135, 122, 83 }, - { 133, 120, 80 }, - { 131, 118, 78 }, - { 130, 117, 76 }, - { 128, 115, 74 }, - { 127, 114, 72 }, - { 125, 112, 70 }, - { 124, 110, 67 }, - { 122, 109, 65 }, - { 121, 107, 63 }, - { 119, 106, 61 }, - { 118, 104, 59 }, - { 116, 102, 57 }, - { 114, 101, 55 }, - { 113, 99, 53 }, - { 111, 98, 51 }, - { 110, 96, 48 }, - { 108, 95, 46 }, - { 106, 93, 44 }, - { 104, 92, 43 }, - { 103, 90, 41 }, - { 101, 89, 39 }, - { 99, 88, 38 }, - { 97, 86, 37 }, - { 95, 85, 36 }, - { 93, 84, 35 }, - { 91, 82, 34 }, - { 89, 81, 33 }, - { 87, 79, 32 }, - { 85, 78, 32 }, - { 83, 77, 31 }, - { 81, 75, 30 }, - { 79, 74, 29 }, - { 77, 72, 29 }, - { 75, 71, 28 }, - { 73, 69, 27 }, - { 71, 68, 26 }, - { 69, 67, 26 }, - { 67, 65, 25 }, - { 66, 64, 24 }, - { 64, 62, 23 }, - { 62, 61, 22 }, - { 60, 59, 22 }, - { 58, 58, 21 }, - { 56, 57, 20 }, - { 54, 55, 19 }, - { 52, 54, 18 }, - { 51, 52, 18 }, - { 49, 51, 17 }, - { 47, 49, 16 }, - { 45, 48, 15 }, - { 43, 46, 14 }, - { 41, 45, 13 }, - { 39, 43, 12 }, - { 38, 42, 11 }, - { 36, 40, 10 }, - { 34, 39, 9 }, - { 32, 37, 9 }, - { 30, 36, 8 }, - { 28, 34, 7 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Grayscale.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Grayscale.cs deleted file mode 100644 index 3d55ce01a..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Grayscale.cs +++ /dev/null @@ -1,39 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Grayscale : IColourMap - { - public string Name => "Grayscale"; - - public (byte r, byte g, byte b) GetRGB(byte value) - { - return (value, value, value); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/GrayscaleR.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/GrayscaleR.cs deleted file mode 100644 index 5c14768ba..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/GrayscaleR.cs +++ /dev/null @@ -1,40 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class GrayscaleR : IColourMap - { - public string Name => "GrayscaleR"; - - public (byte r, byte g, byte b) GetRGB(byte value) - { - value = (byte)(255 - value); - return (value, value, value); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Greens.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Greens.cs deleted file mode 100644 index 3554a24b8..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Greens.cs +++ /dev/null @@ -1,77 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Greens : IColourMap - { - public string Name => "Greens"; - - public (byte r, byte g, byte b) GetRGB(byte value) - { - byte[] bytes = BitConverter.GetBytes(argb[value]); - return (bytes[2], bytes[1], bytes[0]); - } - - private readonly int[] argb = - { - -16761088, -16760832, -16760575, -16760318, -16760061, -16759804, -16759547, -16759290, - -16759033, -16758776, -16758519, -16758006, -16757749, -16757492, -16757235, -16756979, - -16756722, -16756465, -16756208, -16755951, -16755694, -16755437, -16755180, -16754667, - -16754410, -16688617, -16688360, -16688104, -16687847, -16687590, -16687333, -16687076, - -16621283, -16621026, -16620769, -16620512, -16620256, -16554463, -16554206, -16553949, - -16553692, -16487899, -16487642, -16487385, -16421336, -16421080, -16420823, -16355030, - -16354773, -16288980, -16288723, -16222930, -16222930, -16222673, -16156880, -16156623, - -16090830, -16025038, -16024781, -15958988, -15958731, -15892938, -15827145, -15826889, - -15761096, -15695303, -15695046, -15629254, -15563461, -15497924, -15497667, -15431875, - -15366082, -15300289, -15234496, -15234240, -15168447, -15102654, -15037118, -14971325, - -14905532, -14839740, -14773947, -14708154, -14642618, -14576825, -14511033, -14445240, - -14379447, -14313655, -14248118, -14182326, -14116533, -14050741, -13985204, -13919412, - -13853619, -13722291, -13656498, -13590962, -13525169, -13459377, -13328048, -13262512, - -13196720, -13130927, -13065391, -12934063, -12868270, -12802478, -12671406, -12605613, - -12539821, -12408749, -12342957, -12277164, -12146092, -12080300, -12014508, -11883435, - -11817643, -11686315, -11620779, -11554986, -11423914, -11358122, -11226794, -11161258, - -11029929, -10964137, -10833065, -10767273, -10636201, -10570408, -10439080, -10373544, - -10242216, -10176680, -10045351, -09914023, -09848487, -09717159, -09651623, -09520294, - -09389222, -09323430, -09192102, -09061029, -08995237, -08864165, -08798372, -08667300, - -08535972, -08404643, -08339107, -08207779, -08076706, -08010914, -07879842, -07748513, - -07682977, -07551648, -07420576, -07289248, -07223711, -07092383, -06961054, -06895518, - -06764189, -06633116, -06501788, -06436251, -06304923, -06173850, -06108057, -05976984, - -05845656, -05714583, -05648790, -05517717, -05386389, -05320596, -05189523, -05123730, - -04992657, -04861328, -04795791, -04664462, -04598925, -04467596, -04336523, -04270730, - -04139400, -04073863, -03942534, -03876997, -03745667, -03680130, -03614337, -03483007, - -03417470, -03286140, -03220603, -03154809, -03023479, -02957942, -02892148, -02826610, - -02760817, -02629487, -02563949, -02498155, -02432617, -02366823, -02301029, -02235491, - -02169697, -02103903, -02038365, -01972571, -01906777, -01841239, -01775444, -01709650, - -01644112, -01578318, -01512523, -01446985, -01381191, -01315396, -01249858, -01249599, - -01183805, -01118266, -01052472, -00986678, -00986675, -00920880, -00855086, -00789547, - -00723753, -00723494, -00657956, -00592161, -00526367, -00526108, -00460569, -00394775, - -00394516, -00328977, -00263183, -00197388, -00197385, -00131591, -00065796, -00000001, - - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Haline.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Haline.cs deleted file mode 100644 index 60dc50705..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Haline.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Haline : IColourMap - { - public string Name => "Haline"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 42, 24, 108 }, - { 42, 25, 110 }, - { 42, 25, 113 }, - { 43, 25, 115 }, - { 43, 25, 117 }, - { 44, 26, 120 }, - { 44, 26, 122 }, - { 45, 26, 125 }, - { 45, 26, 127 }, - { 45, 27, 130 }, - { 46, 27, 132 }, - { 46, 27, 135 }, - { 46, 28, 137 }, - { 46, 28, 140 }, - { 46, 28, 142 }, - { 46, 29, 145 }, - { 46, 29, 147 }, - { 46, 30, 149 }, - { 46, 30, 152 }, - { 46, 31, 154 }, - { 45, 32, 156 }, - { 45, 33, 157 }, - { 44, 34, 159 }, - { 43, 36, 160 }, - { 42, 37, 161 }, - { 41, 39, 162 }, - { 40, 41, 163 }, - { 38, 43, 163 }, - { 37, 45, 163 }, - { 36, 46, 163 }, - { 34, 48, 163 }, - { 33, 50, 162 }, - { 32, 52, 162 }, - { 30, 53, 161 }, - { 29, 55, 161 }, - { 28, 57, 160 }, - { 27, 58, 160 }, - { 25, 60, 159 }, - { 24, 61, 158 }, - { 23, 63, 158 }, - { 22, 64, 157 }, - { 21, 65, 156 }, - { 20, 67, 156 }, - { 19, 68, 155 }, - { 18, 69, 155 }, - { 17, 71, 154 }, - { 16, 72, 153 }, - { 15, 73, 153 }, - { 15, 74, 152 }, - { 14, 76, 151 }, - { 13, 77, 151 }, - { 13, 78, 150 }, - { 13, 79, 150 }, - { 12, 80, 149 }, - { 12, 81, 149 }, - { 12, 82, 148 }, - { 12, 83, 148 }, - { 12, 84, 147 }, - { 13, 85, 147 }, - { 13, 86, 146 }, - { 13, 87, 146 }, - { 14, 88, 145 }, - { 14, 89, 145 }, - { 15, 90, 145 }, - { 15, 91, 144 }, - { 16, 92, 144 }, - { 17, 93, 143 }, - { 17, 94, 143 }, - { 18, 95, 143 }, - { 19, 96, 142 }, - { 20, 97, 142 }, - { 20, 98, 142 }, - { 21, 99, 142 }, - { 22, 99, 141 }, - { 23, 100, 141 }, - { 24, 101, 141 }, - { 24, 102, 140 }, - { 25, 103, 140 }, - { 26, 104, 140 }, - { 27, 105, 140 }, - { 28, 106, 140 }, - { 29, 107, 139 }, - { 29, 107, 139 }, - { 30, 108, 139 }, - { 31, 109, 139 }, - { 32, 110, 139 }, - { 33, 111, 139 }, - { 34, 112, 138 }, - { 34, 113, 138 }, - { 35, 113, 138 }, - { 36, 114, 138 }, - { 37, 115, 138 }, - { 38, 116, 138 }, - { 38, 117, 138 }, - { 39, 118, 138 }, - { 40, 118, 137 }, - { 41, 119, 137 }, - { 41, 120, 137 }, - { 42, 121, 137 }, - { 43, 122, 137 }, - { 43, 123, 137 }, - { 44, 124, 137 }, - { 45, 124, 137 }, - { 45, 125, 137 }, - { 46, 126, 137 }, - { 47, 127, 137 }, - { 47, 128, 137 }, - { 48, 129, 137 }, - { 49, 130, 137 }, - { 49, 130, 136 }, - { 50, 131, 136 }, - { 51, 132, 136 }, - { 51, 133, 136 }, - { 52, 134, 136 }, - { 52, 135, 136 }, - { 53, 136, 136 }, - { 53, 137, 136 }, - { 54, 137, 136 }, - { 55, 138, 136 }, - { 55, 139, 136 }, - { 56, 140, 136 }, - { 56, 141, 136 }, - { 57, 142, 136 }, - { 57, 143, 136 }, - { 58, 144, 135 }, - { 58, 144, 135 }, - { 59, 145, 135 }, - { 59, 146, 135 }, - { 60, 147, 135 }, - { 60, 148, 135 }, - { 61, 149, 135 }, - { 61, 150, 135 }, - { 62, 151, 135 }, - { 62, 152, 134 }, - { 63, 153, 134 }, - { 63, 153, 134 }, - { 64, 154, 134 }, - { 65, 155, 134 }, - { 65, 156, 133 }, - { 66, 157, 133 }, - { 66, 158, 133 }, - { 67, 159, 133 }, - { 67, 160, 132 }, - { 68, 161, 132 }, - { 68, 162, 132 }, - { 69, 163, 132 }, - { 70, 164, 131 }, - { 70, 164, 131 }, - { 71, 165, 131 }, - { 72, 166, 130 }, - { 72, 167, 130 }, - { 73, 168, 130 }, - { 74, 169, 129 }, - { 74, 170, 129 }, - { 75, 171, 129 }, - { 76, 172, 128 }, - { 76, 173, 128 }, - { 77, 174, 127 }, - { 78, 174, 127 }, - { 79, 175, 126 }, - { 80, 176, 126 }, - { 81, 177, 125 }, - { 81, 178, 125 }, - { 82, 179, 124 }, - { 83, 180, 124 }, - { 84, 181, 123 }, - { 85, 182, 123 }, - { 86, 183, 122 }, - { 87, 184, 121 }, - { 88, 184, 121 }, - { 90, 185, 120 }, - { 91, 186, 119 }, - { 92, 187, 119 }, - { 93, 188, 118 }, - { 94, 189, 117 }, - { 95, 190, 117 }, - { 97, 191, 116 }, - { 98, 191, 115 }, - { 99, 192, 114 }, - { 101, 193, 114 }, - { 102, 194, 113 }, - { 104, 195, 112 }, - { 105, 196, 111 }, - { 107, 196, 110 }, - { 108, 197, 110 }, - { 110, 198, 109 }, - { 112, 199, 108 }, - { 113, 200, 107 }, - { 115, 200, 106 }, - { 117, 201, 105 }, - { 119, 202, 104 }, - { 120, 203, 104 }, - { 122, 203, 103 }, - { 124, 204, 102 }, - { 126, 205, 101 }, - { 128, 206, 100 }, - { 130, 206, 99 }, - { 132, 207, 98 }, - { 134, 208, 98 }, - { 137, 208, 97 }, - { 139, 209, 96 }, - { 141, 210, 95 }, - { 143, 210, 95 }, - { 146, 211, 94 }, - { 148, 211, 93 }, - { 151, 212, 93 }, - { 153, 212, 93 }, - { 155, 213, 92 }, - { 158, 214, 92 }, - { 160, 214, 92 }, - { 163, 215, 92 }, - { 165, 215, 92 }, - { 168, 216, 92 }, - { 170, 216, 92 }, - { 173, 216, 92 }, - { 175, 217, 93 }, - { 177, 217, 93 }, - { 180, 218, 94 }, - { 182, 218, 95 }, - { 184, 219, 96 }, - { 187, 219, 97 }, - { 189, 220, 98 }, - { 191, 220, 99 }, - { 193, 221, 100 }, - { 196, 221, 101 }, - { 198, 222, 102 }, - { 200, 222, 103 }, - { 202, 223, 105 }, - { 204, 223, 106 }, - { 206, 224, 108 }, - { 208, 224, 109 }, - { 210, 225, 111 }, - { 212, 225, 112 }, - { 214, 226, 114 }, - { 216, 226, 115 }, - { 218, 227, 117 }, - { 220, 227, 119 }, - { 222, 228, 121 }, - { 224, 229, 122 }, - { 225, 229, 124 }, - { 227, 230, 126 }, - { 229, 230, 128 }, - { 231, 231, 129 }, - { 233, 231, 131 }, - { 235, 232, 133 }, - { 236, 233, 135 }, - { 238, 233, 137 }, - { 240, 234, 138 }, - { 242, 234, 140 }, - { 243, 235, 142 }, - { 245, 236, 144 }, - { 247, 236, 146 }, - { 248, 237, 148 }, - { 250, 238, 150 }, - { 252, 238, 152 }, - { 253, 239, 154 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Ice.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Ice.cs deleted file mode 100644 index 2e8dbcc13..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Ice.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Ice : IColourMap - { - public string Name => "Ice"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 4, 6, 19 }, - { 5, 6, 20 }, - { 5, 7, 21 }, - { 6, 8, 23 }, - { 7, 9, 24 }, - { 8, 10, 26 }, - { 9, 11, 27 }, - { 10, 12, 29 }, - { 11, 13, 30 }, - { 12, 13, 31 }, - { 13, 14, 33 }, - { 14, 15, 34 }, - { 15, 16, 36 }, - { 16, 17, 37 }, - { 17, 18, 39 }, - { 18, 19, 40 }, - { 19, 19, 42 }, - { 20, 20, 43 }, - { 21, 21, 44 }, - { 22, 22, 46 }, - { 23, 23, 47 }, - { 23, 24, 49 }, - { 24, 24, 50 }, - { 25, 25, 52 }, - { 26, 26, 53 }, - { 27, 27, 55 }, - { 28, 28, 56 }, - { 29, 28, 58 }, - { 30, 29, 59 }, - { 31, 30, 61 }, - { 31, 31, 62 }, - { 32, 31, 64 }, - { 33, 32, 65 }, - { 34, 33, 67 }, - { 35, 34, 68 }, - { 36, 34, 70 }, - { 37, 35, 71 }, - { 37, 36, 73 }, - { 38, 37, 74 }, - { 39, 37, 76 }, - { 40, 38, 78 }, - { 41, 39, 79 }, - { 41, 40, 81 }, - { 42, 40, 82 }, - { 43, 41, 84 }, - { 44, 42, 85 }, - { 44, 43, 87 }, - { 45, 43, 89 }, - { 46, 44, 90 }, - { 47, 45, 92 }, - { 47, 46, 94 }, - { 48, 47, 95 }, - { 49, 47, 97 }, - { 49, 48, 98 }, - { 50, 49, 100 }, - { 51, 50, 102 }, - { 51, 50, 103 }, - { 52, 51, 105 }, - { 53, 52, 107 }, - { 53, 53, 108 }, - { 54, 53, 110 }, - { 54, 54, 112 }, - { 55, 55, 113 }, - { 56, 56, 115 }, - { 56, 57, 117 }, - { 57, 57, 118 }, - { 57, 58, 120 }, - { 58, 59, 122 }, - { 58, 60, 123 }, - { 58, 61, 125 }, - { 59, 62, 127 }, - { 59, 62, 128 }, - { 60, 63, 130 }, - { 60, 64, 132 }, - { 60, 65, 133 }, - { 61, 66, 135 }, - { 61, 67, 137 }, - { 61, 68, 138 }, - { 62, 69, 140 }, - { 62, 70, 141 }, - { 62, 71, 143 }, - { 62, 72, 144 }, - { 62, 73, 146 }, - { 62, 73, 147 }, - { 63, 74, 149 }, - { 63, 75, 150 }, - { 63, 76, 151 }, - { 63, 78, 153 }, - { 63, 79, 154 }, - { 63, 80, 155 }, - { 63, 81, 157 }, - { 63, 82, 158 }, - { 63, 83, 159 }, - { 63, 84, 160 }, - { 63, 85, 161 }, - { 63, 86, 162 }, - { 63, 87, 163 }, - { 63, 88, 164 }, - { 63, 89, 165 }, - { 62, 90, 166 }, - { 62, 92, 167 }, - { 62, 93, 168 }, - { 62, 94, 169 }, - { 62, 95, 170 }, - { 62, 96, 171 }, - { 62, 97, 171 }, - { 62, 98, 172 }, - { 62, 99, 173 }, - { 62, 101, 173 }, - { 62, 102, 174 }, - { 62, 103, 175 }, - { 62, 104, 175 }, - { 62, 105, 176 }, - { 62, 106, 176 }, - { 63, 107, 177 }, - { 63, 108, 178 }, - { 63, 110, 178 }, - { 63, 111, 179 }, - { 63, 112, 179 }, - { 63, 113, 180 }, - { 64, 114, 180 }, - { 64, 115, 180 }, - { 64, 116, 181 }, - { 64, 117, 181 }, - { 65, 118, 182 }, - { 65, 120, 182 }, - { 66, 121, 183 }, - { 66, 122, 183 }, - { 66, 123, 183 }, - { 67, 124, 184 }, - { 67, 125, 184 }, - { 68, 126, 185 }, - { 68, 127, 185 }, - { 69, 128, 185 }, - { 69, 129, 186 }, - { 70, 130, 186 }, - { 70, 132, 187 }, - { 71, 133, 187 }, - { 71, 134, 187 }, - { 72, 135, 188 }, - { 73, 136, 188 }, - { 73, 137, 188 }, - { 74, 138, 189 }, - { 75, 139, 189 }, - { 75, 140, 189 }, - { 76, 141, 190 }, - { 77, 142, 190 }, - { 78, 143, 191 }, - { 78, 144, 191 }, - { 79, 145, 191 }, - { 80, 146, 192 }, - { 81, 148, 192 }, - { 81, 149, 192 }, - { 82, 150, 193 }, - { 83, 151, 193 }, - { 84, 152, 194 }, - { 85, 153, 194 }, - { 85, 154, 194 }, - { 86, 155, 195 }, - { 87, 156, 195 }, - { 88, 157, 195 }, - { 89, 158, 196 }, - { 90, 159, 196 }, - { 91, 160, 197 }, - { 92, 161, 197 }, - { 93, 162, 197 }, - { 94, 163, 198 }, - { 95, 164, 198 }, - { 95, 166, 199 }, - { 96, 167, 199 }, - { 97, 168, 199 }, - { 98, 169, 200 }, - { 99, 170, 200 }, - { 100, 171, 201 }, - { 101, 172, 201 }, - { 103, 173, 201 }, - { 104, 174, 202 }, - { 105, 175, 202 }, - { 106, 176, 203 }, - { 107, 177, 203 }, - { 108, 178, 203 }, - { 109, 179, 204 }, - { 110, 180, 204 }, - { 111, 181, 205 }, - { 113, 182, 205 }, - { 114, 184, 206 }, - { 115, 185, 206 }, - { 116, 186, 206 }, - { 117, 187, 207 }, - { 119, 188, 207 }, - { 120, 189, 208 }, - { 121, 190, 208 }, - { 123, 191, 208 }, - { 124, 192, 209 }, - { 125, 193, 209 }, - { 127, 194, 210 }, - { 128, 195, 210 }, - { 130, 196, 211 }, - { 131, 197, 211 }, - { 133, 198, 211 }, - { 134, 199, 212 }, - { 136, 200, 212 }, - { 137, 201, 213 }, - { 139, 202, 213 }, - { 140, 203, 214 }, - { 142, 204, 214 }, - { 144, 205, 215 }, - { 146, 206, 215 }, - { 147, 207, 216 }, - { 149, 208, 216 }, - { 151, 209, 217 }, - { 153, 210, 217 }, - { 154, 211, 218 }, - { 156, 212, 218 }, - { 158, 213, 219 }, - { 160, 214, 220 }, - { 162, 214, 220 }, - { 164, 215, 221 }, - { 166, 216, 222 }, - { 168, 217, 222 }, - { 169, 218, 223 }, - { 171, 219, 224 }, - { 173, 220, 224 }, - { 175, 221, 225 }, - { 177, 222, 226 }, - { 179, 223, 227 }, - { 181, 224, 227 }, - { 183, 225, 228 }, - { 185, 226, 229 }, - { 186, 227, 230 }, - { 188, 228, 231 }, - { 190, 229, 231 }, - { 192, 230, 232 }, - { 194, 230, 233 }, - { 196, 231, 234 }, - { 198, 232, 235 }, - { 200, 233, 236 }, - { 201, 234, 237 }, - { 203, 235, 238 }, - { 205, 236, 239 }, - { 207, 237, 239 }, - { 209, 238, 240 }, - { 211, 239, 241 }, - { 213, 240, 242 }, - { 214, 241, 243 }, - { 216, 242, 244 }, - { 218, 243, 245 }, - { 220, 244, 246 }, - { 222, 245, 247 }, - { 224, 246, 248 }, - { 225, 247, 249 }, - { 227, 249, 250 }, - { 229, 250, 251 }, - { 231, 251, 251 }, - { 232, 252, 252 }, - { 234, 253, 253 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Inferno.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Inferno.cs deleted file mode 100644 index e66e43b22..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Inferno.cs +++ /dev/null @@ -1,76 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Inferno : IColourMap - { - public string Name => "Inferno"; - - public (byte r, byte g, byte b) GetRGB(byte value) - { - byte[] bytes = BitConverter.GetBytes(rgb[value]); - return (bytes[2], bytes[1], bytes[0]); - } - - private readonly int[] rgb = - { - 00000003, 00000004, 00000006, 00065543, 00065801, 00065803, 00131342, 00131600, - 00197138, 00262932, 00262934, 00328728, 00394267, 00460061, 00525855, 00591393, - 00657187, 00722726, 00854056, 00919594, 00985389, 01050927, 01182258, 01247796, - 01313590, 01444665, 01510203, 01641278, 01706816, 01838147, 01903685, 02034759, - 02100298, 02231116, 02362190, 02493264, 02558802, 02689876, 02820694, 02951768, - 03017306, 03148380, 03279197, 03410271, 03475808, 03606881, 03737954, 03869028, - 03934565, 04065638, 04196710, 04262247, 04393576, 04524649, 04590185, 04721514, - 04852586, 04918379, 05049451, 05180780, 05246316, 05377644, 05443181, 05574509, - 05705581, 05771373, 05902701, 05968238, 06099566, 06230638, 06296430, 06427758, - 06493294, 06624622, 06690158, 06821486, 06952814, 07018350, 07149678, 07215214, - 07346542, 07477613, 07543405, 07674733, 07740269, 07871597, 08002669, 08068460, - 08199532, 08265324, 08396651, 08462187, 08593515, 08724586, 08790378, 08921450, - 08987241, 09118313, 09249641, 09315432, 09446504, 09512295, 09643367, 09774694, - 09840230, 09971557, 10037348, 10168420, 10234211, 10365283, 10496610, 10562401, - 10693473, 10759264, 10890335, 10956127, 11087454, 11218525, 11284316, 11415643, - 11481435, 11612506, 11678297, 11809624, 11875159, 12006486, 12072278, 12203605, - 12269396, 12400467, 12466258, 12532049, 12663376, 12729167, 12860494, 12926285, - 13057612, 13123147, 13188938, 13320265, 13386056, 13451847, 13583430, 13649220, - 13715011, 13780802, 13912129, 13977920, 14043711, 14109502, 14241085, 14306875, - 14372666, 14438457, 14504504, 14570295, 14636086, 14702132, 14833459, 14899250, - 14965297, 15031088, 15096878, 15097389, 15163180, 15229227, 15295018, 15361064, - 15426855, 15492902, 15558693, 15559203, 15625250, 15691041, 15757087, 15757342, - 15823389, 15889436, 15889690, 15955737, 15956248, 16022038, 16088085, 16088596, - 16154642, 16154897, 16220944, 16221454, 16287501, 16287756, 16288267, 16354313, - 16354824, 16355336, 16421127, 16421638, 16422150, 16422662, 16488710, 16489222, - 16489734, 16489991, 16490503, 16491016, 16491530, 16492043, 16492557, 16493070, - 16493584, 16494098, 16494612, 16494870, 16495384, 16495898, 16496412, 16496926, - 16431905, 16432419, 16432933, 16433448, 16368426, 16368940, 16369455, 16304433, - 16304948, 16305463, 16240442, 16240956, 16175935, 16176450, 16111429, 16111944, - 16046923, 16047183, 15982162, 15982678, 15983193, 15918173, 15918688, 15853668, - 15853928, 15854444, 15854960, 15855220, 15855737, 15856253, 15922049, 15922309, - 15988361, 16054157, 16119953, 16186005, 16251801, 16383133, 16448928, 16580260, - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Jet.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Jet.cs deleted file mode 100644 index 11493d04c..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Jet.cs +++ /dev/null @@ -1,76 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Jet : IColourMap - { - public string Name => "Jet"; - - public (byte r, byte g, byte b) GetRGB(byte value) - { - byte[] bytes = BitConverter.GetBytes(rgb[value]); - return (bytes[2], bytes[1], bytes[0]); - } - - private readonly int[] rgb = - { - 00000127, 00000132, 00000136, 00000141, 00000145, 00000150, 00000154, 00000159, - 00000163, 00000168, 00000172, 00000177, 00000182, 00000186, 00000191, 00000195, - 00000200, 00000204, 00000209, 00000213, 00000218, 00000222, 00000227, 00000232, - 00000236, 00000241, 00000245, 00000250, 00000254, 00000255, 00000255, 00000255, - 00000255, 00001279, 00002303, 00003327, 00004351, 00005375, 00006399, 00007423, - 00008447, 00009471, 00010495, 00011519, 00012543, 00013567, 00014591, 00015615, - 00016639, 00017663, 00018687, 00019711, 00020735, 00021759, 00022783, 00023807, - 00024831, 00025855, 00026879, 00027903, 00028927, 00029951, 00030975, 00031999, - 00033023, 00034047, 00035071, 00036095, 00037119, 00038143, 00039167, 00040191, - 00041215, 00042239, 00043263, 00044287, 00045311, 00046335, 00047359, 00048383, - 00049407, 00050431, 00051455, 00052479, 00053503, 00054527, 00055551, 00056574, - 00057594, 00058615, 00190708, 00388337, 00585965, 00849130, 01046759, 01244388, - 01441761, 01638365, 01900506, 02097111, 02293716, 02490320, 02752461, 02949066, - 03145671, 03342275, 03604416, 03801021, 03997626, 04194231, 04390835, 04652976, - 04849581, 05046186, 05242790, 05504931, 05701536, 05898141, 06094746, 06291350, - 06553491, 06750096, 06946701, 07143305, 07405446, 07602051, 07798656, 07995261, - 08191865, 08454006, 08650611, 08847216, 09043820, 09305961, 09502566, 09699171, - 09895775, 10157916, 10354521, 10551126, 10747731, 10944335, 11206476, 11403081, - 11599686, 11796290, 12058431, 12255036, 12451641, 12648246, 12844850, 13106991, - 13303596, 13500201, 13696805, 13958946, 14155551, 14352156, 14548760, 14745365, - 15007506, 15204111, 15400716, 15597320, 15858693, 16054274, 16249856, 16445440, - 16706816, 16771328, 16770304, 16769536, 16768512, 16767488, 16766720, 16765696, - 16764672, 16763648, 16762880, 16761856, 16760832, 16760064, 16759040, 16758016, - 16756992, 16756224, 16755200, 16754176, 16753408, 16752384, 16751360, 16750592, - 16749568, 16748544, 16747520, 16746752, 16745728, 16744704, 16743936, 16742912, - 16741888, 16741120, 16740096, 16739072, 16738048, 16737280, 16736256, 16735232, - 16734464, 16733440, 16732416, 16731392, 16730624, 16729600, 16728576, 16727808, - 16726784, 16725760, 16724992, 16723968, 16722944, 16721920, 16721152, 16720128, - 16719104, 16718336, 16717312, 16650752, 16387840, 16059136, 15795968, 15467264, - 15204352, 14876672, 14548992, 14286848, 13959168, 13697024, 13369344, 13107200, - 12779520, 12517376, 12189696, 11927552, 11599872, 11272192, 11010048, 10682368, - 10420224, 10092544, 09830400, 09502720, 09240576, 08912896, 08650752, 08323072, - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Magma.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Magma.cs deleted file mode 100644 index bad23b809..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Magma.cs +++ /dev/null @@ -1,76 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Magma : IColourMap - { - public string Name => "Magma"; - - public (byte r, byte g, byte b) GetRGB(byte value) - { - byte[] bytes = BitConverter.GetBytes(rgb[value]); - return (bytes[2], bytes[1], bytes[0]); - } - - private readonly int[] rgb = - { - 00000003, 00000004, 00000006, 00065543, 00065801, 00065803, 00131597, 00131599, - 00197393, 00262931, 00263189, 00328727, 00394521, 00460059, 00525853, 00591647, - 00657186, 00722980, 00788774, 00854568, 00920106, 00985900, 01051695, 01117233, - 01183027, 01314101, 01379896, 01445434, 01511228, 01576767, 01708097, 01773636, - 01839174, 01970249, 02036043, 02101581, 02232656, 02298194, 02429269, 02494807, - 02625881, 02756956, 02822494, 02953312, 03084386, 03149925, 03280999, 03412072, - 03477354, 03608428, 03739502, 03870575, 03936113, 04067186, 04198259, 04329332, - 04394869, 04525942, 04657015, 04722808, 04853881, 04919417, 05050746, 05181819, - 05247611, 05378684, 05444476, 05575549, 05706877, 05772670, 05903742, 05969534, - 06100862, 06166399, 06297727, 06363263, 06494591, 06625920, 06691456, 06822784, - 06888576, 07019648, 07085440, 07216769, 07282305, 07413633, 07544705, 07610497, - 07741825, 07807361, 07938689, 08004225, 08135553, 08266881, 08332417, 08463745, - 08529281, 08660609, 08726145, 08857473, 08988801, 09054337, 09185664, 09251200, - 09382528, 09513600, 09579392, 09710464, 09776256, 09907327, 10038655, 10104191, - 10235519, 10366590, 10432382, 10563454, 10694782, 10760317, 10891645, 10957181, - 11088508, 11219836, 11285371, 11416699, 11547771, 11613562, 11744634, 11875961, - 11941497, 12072824, 12138360, 12269687, 12401015, 12466550, 12597877, 12728949, - 12794740, 12926068, 12991603, 13122930, 13254258, 13319793, 13451120, 13516912, - 13648239, 13714030, 13845101, 13910893, 14042220, 14108011, 14239338, 14305129, - 14436457, 14502248, 14568039, 14699366, 14765158, 14830949, 14962276, 15028323, - 15094114, 15159906, 15225953, 15357280, 15423072, 15489119, 15554911, 15620958, - 15621469, 15687261, 15753309, 15819100, 15885148, 15951196, 15951707, 16017499, - 16083547, 16084059, 16150107, 16150619, 16216411, 16216924, 16282972, 16283484, - 16349532, 16350045, 16350557, 16416606, 16416862, 16417375, 16483424, 16483936, - 16484449, 16484962, 16551011, 16551523, 16552036, 16552549, 16552806, 16618855, - 16619368, 16619881, 16620394, 16620907, 16621420, 16621934, 16622191, 16622704, - 16688753, 16689267, 16689780, 16690293, 16690806, 16691064, 16691577, 16692091, - 16692604, 16693117, 16693631, 16694144, 16694402, 16694915, 16695429, 16695942, - 16696456, 16696969, 16697227, 16697741, 16698254, 16633232, 16633746, 16634259, - 16634517, 16635031, 16635544, 16636058, 16636572, 16637085, 16637343, 16637857, - 16638371, 16573349, 16573862, 16574120, 16574634, 16575148, 16575662, 16576176, - 16576689, 16576947, 16577461, 16577975, 16512953, 16513467, 16513725, 16514239, - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Matter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Matter.cs deleted file mode 100644 index 120fa28fe..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Matter.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Matter : IColourMap - { - public string Name => "Matter"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 254, 237, 176 }, - { 253, 236, 175 }, - { 253, 234, 173 }, - { 253, 233, 172 }, - { 253, 232, 171 }, - { 253, 230, 169 }, - { 253, 229, 168 }, - { 253, 227, 167 }, - { 253, 226, 165 }, - { 252, 225, 164 }, - { 252, 223, 163 }, - { 252, 222, 161 }, - { 252, 220, 160 }, - { 252, 219, 159 }, - { 252, 218, 157 }, - { 252, 216, 156 }, - { 251, 215, 155 }, - { 251, 213, 154 }, - { 251, 212, 152 }, - { 251, 211, 151 }, - { 251, 209, 150 }, - { 251, 208, 148 }, - { 251, 207, 147 }, - { 250, 205, 146 }, - { 250, 204, 145 }, - { 250, 202, 144 }, - { 250, 201, 142 }, - { 250, 200, 141 }, - { 250, 198, 140 }, - { 250, 197, 139 }, - { 249, 195, 138 }, - { 249, 194, 136 }, - { 249, 193, 135 }, - { 249, 191, 134 }, - { 249, 190, 133 }, - { 249, 189, 132 }, - { 248, 187, 131 }, - { 248, 186, 130 }, - { 248, 184, 128 }, - { 248, 183, 127 }, - { 248, 182, 126 }, - { 247, 180, 125 }, - { 247, 179, 124 }, - { 247, 178, 123 }, - { 247, 176, 122 }, - { 247, 175, 121 }, - { 246, 174, 120 }, - { 246, 172, 119 }, - { 246, 171, 118 }, - { 246, 169, 117 }, - { 245, 168, 116 }, - { 245, 167, 115 }, - { 245, 165, 114 }, - { 245, 164, 113 }, - { 245, 163, 112 }, - { 244, 161, 111 }, - { 244, 160, 110 }, - { 244, 159, 109 }, - { 244, 157, 108 }, - { 243, 156, 107 }, - { 243, 154, 106 }, - { 243, 153, 105 }, - { 242, 152, 104 }, - { 242, 150, 104 }, - { 242, 149, 103 }, - { 242, 148, 102 }, - { 241, 146, 101 }, - { 241, 145, 100 }, - { 241, 143, 99 }, - { 240, 142, 99 }, - { 240, 141, 98 }, - { 240, 139, 97 }, - { 239, 138, 96 }, - { 239, 137, 96 }, - { 239, 135, 95 }, - { 238, 134, 94 }, - { 238, 133, 94 }, - { 238, 131, 93 }, - { 237, 130, 92 }, - { 237, 129, 92 }, - { 237, 127, 91 }, - { 236, 126, 90 }, - { 236, 124, 90 }, - { 236, 123, 89 }, - { 235, 122, 89 }, - { 235, 120, 88 }, - { 234, 119, 88 }, - { 234, 118, 87 }, - { 233, 116, 87 }, - { 233, 115, 86 }, - { 233, 114, 86 }, - { 232, 112, 86 }, - { 232, 111, 85 }, - { 231, 110, 85 }, - { 231, 108, 85 }, - { 230, 107, 84 }, - { 230, 106, 84 }, - { 229, 104, 84 }, - { 229, 103, 84 }, - { 228, 102, 83 }, - { 227, 100, 83 }, - { 227, 99, 83 }, - { 226, 98, 83 }, - { 226, 96, 83 }, - { 225, 95, 83 }, - { 224, 94, 83 }, - { 224, 93, 83 }, - { 223, 91, 83 }, - { 223, 90, 83 }, - { 222, 89, 83 }, - { 221, 88, 83 }, - { 220, 86, 83 }, - { 220, 85, 83 }, - { 219, 84, 83 }, - { 218, 83, 83 }, - { 217, 81, 83 }, - { 217, 80, 83 }, - { 216, 79, 84 }, - { 215, 78, 84 }, - { 214, 77, 84 }, - { 213, 76, 84 }, - { 213, 75, 84 }, - { 212, 74, 85 }, - { 211, 72, 85 }, - { 210, 71, 85 }, - { 209, 70, 86 }, - { 208, 69, 86 }, - { 207, 68, 86 }, - { 206, 67, 86 }, - { 205, 66, 87 }, - { 204, 65, 87 }, - { 203, 64, 87 }, - { 202, 63, 88 }, - { 201, 62, 88 }, - { 200, 61, 88 }, - { 199, 61, 89 }, - { 198, 60, 89 }, - { 197, 59, 89 }, - { 196, 58, 90 }, - { 195, 57, 90 }, - { 194, 56, 90 }, - { 193, 55, 91 }, - { 192, 54, 91 }, - { 191, 54, 91 }, - { 190, 53, 92 }, - { 189, 52, 92 }, - { 187, 51, 92 }, - { 186, 50, 93 }, - { 185, 50, 93 }, - { 184, 49, 93 }, - { 183, 48, 94 }, - { 182, 47, 94 }, - { 181, 47, 94 }, - { 179, 46, 95 }, - { 178, 45, 95 }, - { 177, 45, 95 }, - { 176, 44, 95 }, - { 175, 43, 96 }, - { 174, 43, 96 }, - { 172, 42, 96 }, - { 171, 41, 96 }, - { 170, 41, 97 }, - { 169, 40, 97 }, - { 167, 40, 97 }, - { 166, 39, 97 }, - { 165, 38, 98 }, - { 164, 38, 98 }, - { 163, 37, 98 }, - { 161, 37, 98 }, - { 160, 36, 98 }, - { 159, 36, 98 }, - { 158, 35, 99 }, - { 156, 35, 99 }, - { 155, 34, 99 }, - { 154, 34, 99 }, - { 153, 34, 99 }, - { 151, 33, 99 }, - { 150, 33, 99 }, - { 149, 32, 99 }, - { 147, 32, 99 }, - { 146, 31, 99 }, - { 145, 31, 99 }, - { 144, 31, 99 }, - { 142, 30, 99 }, - { 141, 30, 99 }, - { 140, 30, 99 }, - { 138, 29, 99 }, - { 137, 29, 99 }, - { 136, 29, 99 }, - { 134, 29, 99 }, - { 133, 28, 99 }, - { 132, 28, 99 }, - { 130, 28, 99 }, - { 129, 28, 99 }, - { 128, 27, 98 }, - { 126, 27, 98 }, - { 125, 27, 98 }, - { 124, 27, 98 }, - { 122, 27, 98 }, - { 121, 26, 97 }, - { 120, 26, 97 }, - { 118, 26, 97 }, - { 117, 26, 97 }, - { 116, 26, 96 }, - { 114, 26, 96 }, - { 113, 25, 96 }, - { 112, 25, 95 }, - { 110, 25, 95 }, - { 109, 25, 94 }, - { 107, 25, 94 }, - { 106, 25, 94 }, - { 105, 25, 93 }, - { 103, 25, 93 }, - { 102, 24, 92 }, - { 101, 24, 92 }, - { 99, 24, 91 }, - { 98, 24, 91 }, - { 97, 24, 90 }, - { 95, 24, 90 }, - { 94, 24, 89 }, - { 93, 23, 88 }, - { 91, 23, 88 }, - { 90, 23, 87 }, - { 89, 23, 87 }, - { 87, 23, 86 }, - { 86, 23, 85 }, - { 85, 23, 85 }, - { 83, 22, 84 }, - { 82, 22, 83 }, - { 81, 22, 83 }, - { 79, 22, 82 }, - { 78, 22, 81 }, - { 77, 21, 81 }, - { 75, 21, 80 }, - { 74, 21, 79 }, - { 73, 21, 78 }, - { 71, 21, 78 }, - { 70, 20, 77 }, - { 69, 20, 76 }, - { 68, 20, 75 }, - { 66, 20, 75 }, - { 65, 19, 74 }, - { 64, 19, 73 }, - { 62, 19, 72 }, - { 61, 19, 71 }, - { 60, 18, 71 }, - { 59, 18, 70 }, - { 57, 18, 69 }, - { 56, 17, 68 }, - { 55, 17, 67 }, - { 54, 17, 66 }, - { 52, 17, 65 }, - { 51, 16, 65 }, - { 50, 16, 64 }, - { 48, 15, 63 }, - { 47, 15, 62 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Oxy.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Oxy.cs deleted file mode 100644 index 610f7e70d..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Oxy.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Oxy : IColourMap - { - public string Name => "Oxy"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 64, 5, 5 }, - { 65, 5, 5 }, - { 67, 6, 6 }, - { 68, 6, 6 }, - { 71, 6, 7 }, - { 72, 6, 7 }, - { 73, 6, 7 }, - { 75, 6, 8 }, - { 77, 7, 8 }, - { 79, 7, 9 }, - { 80, 7, 9 }, - { 81, 7, 9 }, - { 84, 7, 10 }, - { 85, 7, 11 }, - { 87, 7, 11 }, - { 88, 7, 11 }, - { 91, 7, 12 }, - { 92, 7, 12 }, - { 93, 7, 12 }, - { 95, 7, 13 }, - { 98, 7, 13 }, - { 99, 7, 14 }, - { 100, 7, 14 }, - { 102, 7, 14 }, - { 104, 7, 14 }, - { 106, 6, 15 }, - { 107, 6, 15 }, - { 109, 6, 15 }, - { 111, 6, 15 }, - { 113, 6, 15 }, - { 114, 6, 15 }, - { 115, 5, 15 }, - { 118, 5, 15 }, - { 120, 5, 15 }, - { 121, 5, 15 }, - { 122, 5, 15 }, - { 125, 5, 14 }, - { 126, 5, 14 }, - { 127, 6, 13 }, - { 129, 6, 13 }, - { 131, 8, 12 }, - { 132, 9, 12 }, - { 133, 10, 11 }, - { 134, 12, 11 }, - { 136, 14, 10 }, - { 137, 16, 10 }, - { 138, 17, 9 }, - { 139, 19, 9 }, - { 141, 21, 8 }, - { 142, 23, 8 }, - { 143, 24, 8 }, - { 80, 79, 79 }, - { 80, 80, 80 }, - { 81, 81, 80 }, - { 82, 81, 81 }, - { 83, 83, 83 }, - { 84, 84, 83 }, - { 85, 84, 84 }, - { 86, 85, 85 }, - { 87, 87, 86 }, - { 88, 87, 87 }, - { 89, 88, 88 }, - { 89, 89, 88 }, - { 91, 90, 90 }, - { 92, 91, 91 }, - { 92, 92, 91 }, - { 93, 93, 92 }, - { 95, 94, 94 }, - { 95, 95, 94 }, - { 96, 96, 95 }, - { 97, 96, 96 }, - { 98, 98, 97 }, - { 99, 99, 98 }, - { 100, 99, 99 }, - { 101, 100, 100 }, - { 102, 102, 101 }, - { 103, 102, 102 }, - { 104, 103, 103 }, - { 104, 104, 103 }, - { 106, 105, 105 }, - { 107, 106, 106 }, - { 107, 107, 106 }, - { 108, 108, 107 }, - { 110, 109, 109 }, - { 111, 110, 110 }, - { 111, 111, 110 }, - { 112, 112, 111 }, - { 114, 113, 113 }, - { 114, 114, 113 }, - { 115, 115, 114 }, - { 116, 115, 115 }, - { 118, 117, 116 }, - { 118, 118, 117 }, - { 119, 119, 118 }, - { 120, 119, 119 }, - { 121, 121, 120 }, - { 122, 122, 121 }, - { 123, 123, 122 }, - { 124, 123, 123 }, - { 125, 125, 124 }, - { 126, 126, 125 }, - { 127, 127, 126 }, - { 129, 128, 127 }, - { 129, 129, 128 }, - { 130, 130, 129 }, - { 131, 131, 130 }, - { 133, 132, 131 }, - { 133, 133, 132 }, - { 134, 134, 133 }, - { 135, 135, 134 }, - { 137, 136, 135 }, - { 137, 137, 136 }, - { 138, 138, 137 }, - { 139, 139, 138 }, - { 141, 140, 140 }, - { 141, 141, 140 }, - { 142, 142, 141 }, - { 143, 143, 142 }, - { 145, 144, 144 }, - { 146, 145, 144 }, - { 146, 146, 145 }, - { 147, 147, 146 }, - { 149, 149, 148 }, - { 150, 149, 149 }, - { 151, 150, 149 }, - { 151, 151, 150 }, - { 153, 153, 152 }, - { 154, 154, 153 }, - { 155, 154, 154 }, - { 156, 155, 154 }, - { 157, 157, 156 }, - { 158, 158, 157 }, - { 159, 159, 158 }, - { 160, 160, 159 }, - { 162, 161, 160 }, - { 163, 162, 161 }, - { 163, 163, 162 }, - { 164, 164, 163 }, - { 166, 166, 165 }, - { 167, 166, 166 }, - { 168, 167, 167 }, - { 169, 168, 167 }, - { 170, 170, 169 }, - { 171, 171, 170 }, - { 172, 172, 171 }, - { 173, 173, 172 }, - { 175, 174, 174 }, - { 176, 175, 174 }, - { 177, 176, 175 }, - { 177, 177, 176 }, - { 179, 179, 178 }, - { 180, 180, 179 }, - { 181, 181, 180 }, - { 183, 183, 182 }, - { 184, 183, 183 }, - { 185, 184, 183 }, - { 186, 185, 184 }, - { 187, 187, 186 }, - { 188, 188, 187 }, - { 189, 189, 188 }, - { 190, 190, 189 }, - { 192, 192, 191 }, - { 193, 193, 192 }, - { 194, 194, 193 }, - { 195, 195, 194 }, - { 197, 197, 195 }, - { 198, 197, 196 }, - { 199, 198, 197 }, - { 200, 199, 198 }, - { 202, 201, 200 }, - { 203, 202, 201 }, - { 204, 203, 202 }, - { 204, 204, 203 }, - { 206, 206, 205 }, - { 207, 207, 206 }, - { 208, 208, 207 }, - { 209, 209, 208 }, - { 211, 211, 210 }, - { 212, 212, 211 }, - { 213, 213, 212 }, - { 214, 214, 213 }, - { 216, 216, 215 }, - { 217, 217, 216 }, - { 218, 218, 217 }, - { 219, 219, 218 }, - { 221, 221, 220 }, - { 222, 222, 221 }, - { 223, 223, 222 }, - { 224, 224, 223 }, - { 226, 226, 225 }, - { 227, 227, 226 }, - { 228, 228, 227 }, - { 230, 229, 228 }, - { 232, 231, 230 }, - { 233, 232, 231 }, - { 234, 233, 232 }, - { 235, 235, 233 }, - { 237, 237, 235 }, - { 238, 238, 236 }, - { 239, 239, 238 }, - { 240, 240, 239 }, - { 242, 242, 241 }, - { 243, 243, 242 }, - { 244, 244, 243 }, - { 248, 254, 105 }, - { 246, 253, 103 }, - { 245, 252, 100 }, - { 244, 252, 98 }, - { 241, 250, 93 }, - { 240, 249, 90 }, - { 239, 248, 87 }, - { 238, 247, 84 }, - { 236, 245, 78 }, - { 235, 243, 75 }, - { 235, 242, 72 }, - { 234, 241, 69 }, - { 234, 238, 64 }, - { 234, 237, 62 }, - { 234, 235, 61 }, - { 234, 234, 59 }, - { 234, 231, 56 }, - { 233, 230, 55 }, - { 233, 228, 54 }, - { 233, 227, 52 }, - { 233, 224, 50 }, - { 232, 223, 49 }, - { 232, 221, 48 }, - { 232, 220, 48 }, - { 232, 217, 46 }, - { 231, 216, 45 }, - { 231, 215, 44 }, - { 231, 213, 43 }, - { 230, 211, 42 }, - { 230, 209, 41 }, - { 230, 208, 40 }, - { 229, 207, 40 }, - { 229, 204, 38 }, - { 229, 203, 38 }, - { 228, 201, 37 }, - { 228, 200, 37 }, - { 227, 198, 35 }, - { 227, 196, 35 }, - { 227, 195, 34 }, - { 226, 194, 33 }, - { 226, 191, 32 }, - { 225, 190, 32 }, - { 225, 189, 31 }, - { 224, 187, 31 }, - { 224, 185, 30 }, - { 223, 184, 29 }, - { 223, 182, 29 }, - { 223, 181, 28 }, - { 222, 179, 27 }, - { 221, 177, 26 }, - { 221, 176, 26 }, - { 221, 175, 25 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Phase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Phase.cs deleted file mode 100644 index a43172f40..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Phase.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Phase : IColourMap - { - public string Name => "Phase"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 168, 120, 13 }, - { 169, 119, 15 }, - { 171, 118, 17 }, - { 172, 117, 19 }, - { 174, 116, 20 }, - { 175, 115, 22 }, - { 177, 114, 24 }, - { 178, 113, 25 }, - { 179, 112, 27 }, - { 181, 111, 29 }, - { 182, 110, 30 }, - { 183, 109, 32 }, - { 185, 108, 34 }, - { 186, 107, 35 }, - { 187, 106, 37 }, - { 189, 105, 38 }, - { 190, 104, 40 }, - { 191, 103, 42 }, - { 192, 102, 43 }, - { 193, 101, 45 }, - { 194, 100, 46 }, - { 196, 98, 48 }, - { 197, 97, 50 }, - { 198, 96, 51 }, - { 199, 95, 53 }, - { 200, 94, 55 }, - { 201, 93, 56 }, - { 202, 92, 58 }, - { 203, 90, 60 }, - { 204, 89, 62 }, - { 205, 88, 63 }, - { 206, 87, 65 }, - { 207, 86, 67 }, - { 208, 84, 69 }, - { 208, 83, 71 }, - { 209, 82, 73 }, - { 210, 81, 75 }, - { 211, 79, 77 }, - { 212, 78, 79 }, - { 213, 77, 81 }, - { 213, 75, 83 }, - { 214, 74, 85 }, - { 215, 73, 87 }, - { 216, 71, 90 }, - { 216, 70, 92 }, - { 217, 69, 94 }, - { 217, 67, 97 }, - { 218, 66, 99 }, - { 219, 64, 102 }, - { 219, 63, 104 }, - { 220, 61, 107 }, - { 220, 60, 109 }, - { 221, 58, 112 }, - { 221, 57, 115 }, - { 221, 56, 118 }, - { 222, 54, 120 }, - { 222, 53, 123 }, - { 222, 51, 126 }, - { 222, 50, 129 }, - { 223, 49, 132 }, - { 223, 47, 135 }, - { 223, 46, 138 }, - { 223, 45, 141 }, - { 223, 43, 144 }, - { 223, 42, 147 }, - { 222, 41, 151 }, - { 222, 40, 154 }, - { 222, 40, 157 }, - { 222, 39, 160 }, - { 221, 38, 163 }, - { 221, 38, 166 }, - { 220, 37, 169 }, - { 220, 37, 173 }, - { 219, 37, 176 }, - { 218, 37, 179 }, - { 218, 38, 182 }, - { 217, 38, 185 }, - { 216, 39, 188 }, - { 215, 39, 190 }, - { 214, 40, 193 }, - { 213, 41, 196 }, - { 212, 42, 199 }, - { 211, 43, 201 }, - { 210, 45, 204 }, - { 209, 46, 206 }, - { 208, 47, 208 }, - { 207, 49, 211 }, - { 205, 50, 213 }, - { 204, 52, 215 }, - { 203, 53, 217 }, - { 201, 55, 219 }, - { 200, 57, 221 }, - { 198, 58, 223 }, - { 197, 60, 225 }, - { 195, 62, 226 }, - { 194, 63, 228 }, - { 192, 65, 229 }, - { 190, 67, 231 }, - { 189, 69, 232 }, - { 187, 70, 233 }, - { 185, 72, 235 }, - { 184, 74, 236 }, - { 182, 75, 237 }, - { 180, 77, 238 }, - { 178, 79, 239 }, - { 176, 80, 239 }, - { 174, 82, 240 }, - { 172, 84, 241 }, - { 170, 85, 241 }, - { 169, 87, 242 }, - { 167, 89, 243 }, - { 164, 90, 243 }, - { 162, 92, 243 }, - { 160, 93, 244 }, - { 158, 95, 244 }, - { 156, 96, 244 }, - { 154, 98, 244 }, - { 152, 99, 244 }, - { 149, 101, 244 }, - { 147, 102, 244 }, - { 145, 104, 244 }, - { 143, 105, 244 }, - { 140, 107, 243 }, - { 138, 108, 243 }, - { 135, 109, 243 }, - { 133, 111, 242 }, - { 130, 112, 241 }, - { 128, 113, 241 }, - { 125, 115, 240 }, - { 123, 116, 239 }, - { 120, 117, 239 }, - { 118, 119, 238 }, - { 115, 120, 237 }, - { 112, 121, 236 }, - { 110, 122, 235 }, - { 107, 123, 233 }, - { 104, 124, 232 }, - { 102, 126, 231 }, - { 99, 127, 230 }, - { 96, 128, 228 }, - { 93, 129, 227 }, - { 90, 130, 225 }, - { 88, 131, 223 }, - { 85, 132, 222 }, - { 82, 133, 220 }, - { 79, 134, 218 }, - { 77, 135, 216 }, - { 74, 135, 215 }, - { 71, 136, 213 }, - { 69, 137, 211 }, - { 66, 138, 209 }, - { 64, 138, 207 }, - { 61, 139, 205 }, - { 59, 140, 203 }, - { 56, 140, 201 }, - { 54, 141, 199 }, - { 52, 142, 196 }, - { 50, 142, 194 }, - { 48, 143, 192 }, - { 46, 143, 190 }, - { 44, 144, 188 }, - { 42, 144, 186 }, - { 40, 145, 184 }, - { 39, 145, 182 }, - { 37, 145, 180 }, - { 36, 146, 178 }, - { 35, 146, 176 }, - { 33, 146, 174 }, - { 32, 147, 172 }, - { 31, 147, 170 }, - { 30, 147, 168 }, - { 29, 148, 166 }, - { 28, 148, 164 }, - { 27, 148, 162 }, - { 26, 148, 160 }, - { 25, 149, 158 }, - { 25, 149, 156 }, - { 24, 149, 154 }, - { 23, 149, 152 }, - { 22, 150, 150 }, - { 21, 150, 148 }, - { 20, 150, 146 }, - { 20, 150, 144 }, - { 19, 151, 142 }, - { 18, 151, 140 }, - { 17, 151, 138 }, - { 16, 151, 136 }, - { 15, 151, 134 }, - { 14, 152, 132 }, - { 13, 152, 130 }, - { 13, 152, 128 }, - { 12, 152, 126 }, - { 12, 152, 124 }, - { 11, 153, 121 }, - { 11, 153, 119 }, - { 11, 153, 117 }, - { 12, 153, 115 }, - { 13, 153, 112 }, - { 14, 153, 110 }, - { 15, 154, 107 }, - { 17, 154, 105 }, - { 19, 154, 102 }, - { 21, 154, 99 }, - { 23, 154, 97 }, - { 25, 154, 94 }, - { 28, 154, 91 }, - { 31, 154, 88 }, - { 33, 154, 85 }, - { 36, 154, 82 }, - { 39, 154, 79 }, - { 43, 154, 76 }, - { 46, 154, 73 }, - { 49, 153, 70 }, - { 53, 153, 67 }, - { 56, 153, 64 }, - { 60, 153, 60 }, - { 64, 152, 57 }, - { 67, 152, 54 }, - { 71, 151, 50 }, - { 75, 151, 47 }, - { 79, 150, 44 }, - { 83, 150, 41 }, - { 86, 149, 38 }, - { 90, 148, 35 }, - { 94, 148, 32 }, - { 97, 147, 30 }, - { 101, 146, 27 }, - { 104, 145, 25 }, - { 107, 144, 23 }, - { 111, 144, 22 }, - { 114, 143, 20 }, - { 116, 142, 19 }, - { 119, 141, 18 }, - { 122, 140, 17 }, - { 125, 139, 16 }, - { 127, 139, 15 }, - { 130, 138, 15 }, - { 132, 137, 14 }, - { 134, 136, 14 }, - { 136, 135, 14 }, - { 139, 134, 13 }, - { 141, 133, 13 }, - { 143, 132, 13 }, - { 145, 131, 13 }, - { 147, 131, 13 }, - { 149, 130, 13 }, - { 151, 129, 13 }, - { 153, 128, 13 }, - { 155, 127, 13 }, - { 157, 126, 13 }, - { 159, 125, 13 }, - { 161, 124, 13 }, - { 162, 123, 13 }, - { 164, 122, 13 }, - { 166, 121, 13 }, - { 168, 120, 13 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Plasma.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Plasma.cs deleted file mode 100644 index 613be3c5a..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Plasma.cs +++ /dev/null @@ -1,76 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Plasma : IColourMap - { - public string Name => "Plasma"; - - public (byte r, byte g, byte b) GetRGB(byte value) - { - byte[] bytes = BitConverter.GetBytes(rgb[value]); - return (bytes[2], bytes[1], bytes[0]); - } - - private readonly int[] rgb = - { - 00788358, 01050503, 01246857, 01377930, 01574539, 01771148, 01902221, 02033038, - 02164111, 02295184, 02426257, 02557330, 02688403, 02819476, 02950292, 03081365, - 03212438, 03343511, 03409048, 03540120, 03671193, 03802266, 03867546, 03998619, - 04129692, 04195228, 04326301, 04457374, 04522910, 04653727, 04784799, 04850336, - 04981409, 05112481, 05178018, 05308834, 05374371, 05505443, 05636515, 05702052, - 05833124, 05898405, 06029477, 06160549, 06226086, 06357158, 06422694, 06553767, - 06619303, 06750375, 06815911, 06946983, 07078056, 07143592, 07274664, 07340200, - 07471272, 07536808, 07667880, 07733672, 07864744, 07930280, 08061608, 08127143, - 08258471, 08324007, 08455335, 08520871, 08652198, 08717990, 08783782, 08914853, - 08980645, 09111972, 09177764, 09309348, 09375139, 09440931, 09572258, 09638049, - 09769377, 09835168, 09900960, 10032287, 10098078, 10164126, 10295453, 10361244, - 10427035, 10492827, 10624154, 10689945, 10755736, 10821527, 10953111, 11018902, - 11084693, 11150484, 11281811, 11347602, 11413393, 11479184, 11545231, 11611023, - 11676814, 11808141, 11873932, 11939723, 12005514, 12071561, 12137352, 12203143, - 12268934, 12334725, 12400516, 12466307, 12532098, 12598145, 12663936, 12729728, - 12795519, 12861310, 12927101, 12992892, 13058683, 13124730, 13190521, 13256312, - 13322103, 13387894, 13453685, 13519477, 13585268, 13651315, 13717106, 13717361, - 13783152, 13848943, 13914734, 13980525, 14046573, 14112364, 14112619, 14178410, - 14244201, 14309992, 14375783, 14441830, 14442086, 14507877, 14573668, 14639459, - 14639714, 14705761, 14771552, 14837344, 14903135, 14903390, 14969437, 15035228, - 15035483, 15101274, 15167066, 15233113, 15233368, 15299159, 15364950, 15365205, - 15431252, 15497044, 15497299, 15563090, 15563601, 15629392, 15695183, 15695438, - 15761485, 15761741, 15827532, 15893579, 15893834, 15959625, 15959880, 16025927, - 16026183, 16091974, 16092485, 16158276, 16158531, 16159042, 16224833, 16225089, - 16291136, 16291391, 16291902, 16357693, 16357948, 16423995, 16424250, 16424762, - 16425017, 16491064, 16491319, 16491574, 16557621, 16557877, 16558388, 16558643, - 16559154, 16559409, 16625457, 16625712, 16626223, 16626478, 16626989, 16627245, - 16627756, 16628011, 16628523, 16628778, 16629289, 16629801, 16630056, 16630568, - 16630823, 16631334, 16566054, 16566566, 16567077, 16567333, 16567845, 16502820, - 16503076, 16503588, 16438564, 16438820, 16439332, 16374052, 16374564, 16309540, - 16310052, 16244772, 16245285, 16180261, 16180517, 16115494, 16116006, 16050726, - 15985702, 15986214, 15921190, 15921446, 15856422, 15791397, 15791651, 15726625, - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Rain.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Rain.cs deleted file mode 100644 index bf084618b..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Rain.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Rain : IColourMap - { - public string Name => "Rain"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 238, 237, 243 }, - { 238, 236, 241 }, - { 237, 235, 240 }, - { 236, 234, 238 }, - { 235, 233, 236 }, - { 235, 232, 235 }, - { 234, 231, 233 }, - { 233, 230, 232 }, - { 232, 229, 230 }, - { 232, 228, 229 }, - { 231, 227, 227 }, - { 230, 226, 226 }, - { 229, 225, 224 }, - { 228, 223, 223 }, - { 228, 222, 221 }, - { 227, 221, 220 }, - { 227, 220, 218 }, - { 226, 219, 216 }, - { 226, 218, 214 }, - { 225, 217, 212 }, - { 224, 216, 211 }, - { 224, 215, 209 }, - { 223, 214, 207 }, - { 223, 213, 205 }, - { 222, 212, 203 }, - { 222, 211, 201 }, - { 221, 209, 199 }, - { 221, 208, 197 }, - { 220, 207, 195 }, - { 220, 206, 193 }, - { 219, 205, 191 }, - { 219, 204, 190 }, - { 219, 203, 188 }, - { 218, 202, 186 }, - { 218, 201, 184 }, - { 217, 200, 182 }, - { 216, 199, 180 }, - { 216, 198, 178 }, - { 215, 197, 176 }, - { 215, 196, 174 }, - { 214, 195, 172 }, - { 213, 194, 170 }, - { 213, 193, 168 }, - { 212, 192, 166 }, - { 211, 191, 164 }, - { 210, 191, 162 }, - { 209, 190, 160 }, - { 208, 189, 158 }, - { 207, 188, 156 }, - { 205, 188, 155 }, - { 204, 187, 153 }, - { 203, 186, 152 }, - { 201, 186, 150 }, - { 200, 185, 149 }, - { 198, 185, 148 }, - { 196, 184, 146 }, - { 195, 183, 145 }, - { 193, 183, 144 }, - { 192, 182, 143 }, - { 190, 182, 142 }, - { 188, 181, 141 }, - { 186, 181, 141 }, - { 185, 180, 140 }, - { 183, 179, 139 }, - { 181, 179, 138 }, - { 180, 178, 137 }, - { 178, 178, 137 }, - { 176, 177, 136 }, - { 174, 177, 135 }, - { 173, 176, 135 }, - { 171, 176, 134 }, - { 169, 175, 133 }, - { 168, 174, 133 }, - { 166, 174, 132 }, - { 164, 173, 132 }, - { 162, 173, 131 }, - { 161, 172, 130 }, - { 159, 172, 130 }, - { 157, 171, 129 }, - { 156, 170, 129 }, - { 154, 170, 128 }, - { 152, 169, 128 }, - { 150, 169, 127 }, - { 149, 168, 126 }, - { 147, 168, 126 }, - { 145, 167, 125 }, - { 144, 167, 125 }, - { 142, 166, 124 }, - { 140, 165, 124 }, - { 138, 165, 123 }, - { 137, 164, 123 }, - { 135, 164, 122 }, - { 133, 163, 122 }, - { 131, 163, 121 }, - { 130, 162, 120 }, - { 128, 161, 120 }, - { 126, 161, 119 }, - { 124, 160, 119 }, - { 122, 160, 118 }, - { 121, 159, 118 }, - { 119, 159, 117 }, - { 117, 158, 117 }, - { 115, 157, 117 }, - { 113, 157, 116 }, - { 111, 156, 116 }, - { 109, 156, 115 }, - { 107, 155, 115 }, - { 105, 155, 114 }, - { 103, 154, 114 }, - { 101, 154, 114 }, - { 100, 153, 113 }, - { 97, 152, 113 }, - { 95, 152, 113 }, - { 93, 151, 112 }, - { 91, 151, 112 }, - { 89, 150, 112 }, - { 87, 149, 111 }, - { 85, 149, 111 }, - { 83, 148, 111 }, - { 81, 148, 111 }, - { 79, 147, 110 }, - { 76, 147, 110 }, - { 74, 146, 110 }, - { 72, 145, 110 }, - { 70, 145, 110 }, - { 67, 144, 110 }, - { 65, 143, 110 }, - { 63, 143, 110 }, - { 61, 142, 110 }, - { 58, 141, 109 }, - { 56, 141, 109 }, - { 54, 140, 109 }, - { 52, 139, 109 }, - { 49, 139, 110 }, - { 47, 138, 110 }, - { 45, 137, 110 }, - { 43, 137, 110 }, - { 41, 136, 110 }, - { 38, 135, 110 }, - { 36, 134, 110 }, - { 34, 134, 110 }, - { 32, 133, 110 }, - { 30, 132, 110 }, - { 28, 131, 110 }, - { 27, 130, 110 }, - { 25, 129, 110 }, - { 23, 129, 110 }, - { 21, 128, 110 }, - { 20, 127, 110 }, - { 18, 126, 110 }, - { 17, 125, 110 }, - { 15, 124, 110 }, - { 14, 124, 110 }, - { 12, 123, 110 }, - { 11, 122, 110 }, - { 10, 121, 110 }, - { 9, 120, 110 }, - { 8, 119, 110 }, - { 7, 118, 110 }, - { 6, 117, 110 }, - { 6, 116, 110 }, - { 5, 116, 110 }, - { 5, 115, 110 }, - { 4, 114, 110 }, - { 4, 113, 110 }, - { 4, 112, 109 }, - { 3, 111, 109 }, - { 3, 110, 109 }, - { 3, 109, 109 }, - { 3, 108, 109 }, - { 4, 107, 109 }, - { 4, 107, 109 }, - { 4, 106, 108 }, - { 4, 105, 108 }, - { 5, 104, 108 }, - { 5, 103, 108 }, - { 6, 102, 108 }, - { 7, 101, 107 }, - { 7, 100, 107 }, - { 8, 99, 107 }, - { 9, 98, 107 }, - { 10, 97, 106 }, - { 11, 96, 106 }, - { 12, 95, 106 }, - { 13, 95, 105 }, - { 14, 94, 105 }, - { 15, 93, 105 }, - { 16, 92, 104 }, - { 17, 91, 104 }, - { 18, 90, 103 }, - { 19, 89, 103 }, - { 20, 88, 103 }, - { 21, 87, 102 }, - { 22, 86, 102 }, - { 22, 85, 101 }, - { 23, 84, 101 }, - { 24, 83, 100 }, - { 25, 82, 100 }, - { 26, 81, 99 }, - { 26, 80, 99 }, - { 27, 79, 98 }, - { 28, 78, 97 }, - { 28, 77, 97 }, - { 29, 76, 96 }, - { 30, 75, 95 }, - { 30, 74, 95 }, - { 31, 73, 94 }, - { 31, 72, 93 }, - { 32, 72, 93 }, - { 33, 71, 92 }, - { 33, 70, 91 }, - { 33, 69, 90 }, - { 34, 68, 90 }, - { 34, 67, 89 }, - { 35, 66, 88 }, - { 35, 65, 87 }, - { 35, 64, 86 }, - { 36, 63, 86 }, - { 36, 62, 85 }, - { 36, 61, 84 }, - { 36, 60, 83 }, - { 36, 59, 82 }, - { 37, 58, 81 }, - { 37, 57, 81 }, - { 37, 56, 80 }, - { 37, 55, 79 }, - { 37, 55, 78 }, - { 37, 54, 77 }, - { 37, 53, 76 }, - { 37, 52, 76 }, - { 37, 51, 75 }, - { 37, 50, 74 }, - { 37, 49, 73 }, - { 37, 48, 72 }, - { 37, 47, 72 }, - { 37, 46, 71 }, - { 37, 45, 70 }, - { 37, 44, 69 }, - { 37, 43, 69 }, - { 37, 42, 68 }, - { 36, 41, 67 }, - { 36, 40, 66 }, - { 36, 39, 66 }, - { 36, 39, 65 }, - { 36, 38, 64 }, - { 36, 37, 63 }, - { 35, 36, 63 }, - { 35, 35, 62 }, - { 35, 34, 61 }, - { 35, 33, 61 }, - { 35, 32, 60 }, - { 34, 31, 59 }, - { 34, 30, 58 }, - { 34, 29, 58 }, - { 34, 28, 57 }, - { 34, 27, 56 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Solar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Solar.cs deleted file mode 100644 index 404cff906..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Solar.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Solar : IColourMap - { - public string Name => "Solar"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 51, 20, 24 }, - { 53, 20, 24 }, - { 54, 21, 25 }, - { 55, 21, 25 }, - { 56, 21, 26 }, - { 58, 22, 26 }, - { 59, 22, 27 }, - { 60, 23, 27 }, - { 61, 23, 28 }, - { 62, 24, 28 }, - { 64, 24, 29 }, - { 65, 24, 29 }, - { 66, 25, 29 }, - { 67, 25, 30 }, - { 69, 26, 30 }, - { 70, 26, 31 }, - { 71, 26, 31 }, - { 72, 27, 31 }, - { 74, 27, 32 }, - { 75, 27, 32 }, - { 76, 28, 32 }, - { 77, 28, 33 }, - { 79, 28, 33 }, - { 80, 29, 33 }, - { 81, 29, 34 }, - { 82, 30, 34 }, - { 84, 30, 34 }, - { 85, 30, 34 }, - { 86, 31, 35 }, - { 87, 31, 35 }, - { 89, 31, 35 }, - { 90, 32, 35 }, - { 91, 32, 35 }, - { 92, 32, 36 }, - { 94, 33, 36 }, - { 95, 33, 36 }, - { 96, 33, 36 }, - { 97, 34, 36 }, - { 99, 34, 36 }, - { 100, 34, 36 }, - { 101, 35, 36 }, - { 102, 35, 37 }, - { 104, 35, 37 }, - { 105, 36, 37 }, - { 106, 36, 37 }, - { 107, 36, 37 }, - { 109, 37, 37 }, - { 110, 37, 37 }, - { 111, 37, 37 }, - { 112, 38, 37 }, - { 114, 38, 37 }, - { 115, 39, 36 }, - { 116, 39, 36 }, - { 117, 39, 36 }, - { 119, 40, 36 }, - { 120, 40, 36 }, - { 121, 41, 36 }, - { 122, 41, 36 }, - { 123, 42, 36 }, - { 124, 42, 35 }, - { 126, 43, 35 }, - { 127, 43, 35 }, - { 128, 44, 35 }, - { 129, 44, 34 }, - { 130, 45, 34 }, - { 131, 45, 34 }, - { 132, 46, 34 }, - { 133, 46, 33 }, - { 135, 47, 33 }, - { 136, 48, 33 }, - { 137, 48, 33 }, - { 138, 49, 32 }, - { 139, 49, 32 }, - { 140, 50, 32 }, - { 141, 51, 31 }, - { 142, 52, 31 }, - { 143, 52, 31 }, - { 144, 53, 30 }, - { 145, 54, 30 }, - { 146, 54, 30 }, - { 147, 55, 29 }, - { 147, 56, 29 }, - { 148, 57, 29 }, - { 149, 58, 29 }, - { 150, 58, 28 }, - { 151, 59, 28 }, - { 152, 60, 28 }, - { 153, 61, 27 }, - { 154, 62, 27 }, - { 154, 63, 27 }, - { 155, 64, 26 }, - { 156, 64, 26 }, - { 157, 65, 26 }, - { 158, 66, 26 }, - { 159, 67, 25 }, - { 159, 68, 25 }, - { 160, 69, 25 }, - { 161, 70, 25 }, - { 162, 71, 24 }, - { 163, 72, 24 }, - { 163, 73, 24 }, - { 164, 74, 24 }, - { 165, 74, 23 }, - { 166, 75, 23 }, - { 166, 76, 23 }, - { 167, 77, 23 }, - { 168, 78, 22 }, - { 168, 79, 22 }, - { 169, 80, 22 }, - { 170, 81, 22 }, - { 171, 82, 22 }, - { 171, 83, 21 }, - { 172, 84, 21 }, - { 173, 85, 21 }, - { 173, 86, 21 }, - { 174, 87, 21 }, - { 175, 88, 20 }, - { 175, 89, 20 }, - { 176, 90, 20 }, - { 177, 91, 20 }, - { 177, 92, 20 }, - { 178, 93, 20 }, - { 178, 94, 20 }, - { 179, 95, 20 }, - { 180, 96, 19 }, - { 180, 97, 19 }, - { 181, 98, 19 }, - { 182, 99, 19 }, - { 182, 100, 19 }, - { 183, 101, 19 }, - { 183, 102, 19 }, - { 184, 104, 19 }, - { 184, 105, 19 }, - { 185, 106, 19 }, - { 186, 107, 19 }, - { 186, 108, 19 }, - { 187, 109, 19 }, - { 187, 110, 19 }, - { 188, 111, 19 }, - { 188, 112, 19 }, - { 189, 113, 19 }, - { 190, 114, 19 }, - { 190, 115, 19 }, - { 191, 116, 19 }, - { 191, 117, 19 }, - { 192, 118, 19 }, - { 192, 119, 20 }, - { 193, 121, 20 }, - { 193, 122, 20 }, - { 194, 123, 20 }, - { 194, 124, 20 }, - { 195, 125, 20 }, - { 195, 126, 21 }, - { 196, 127, 21 }, - { 196, 128, 21 }, - { 197, 129, 21 }, - { 197, 130, 21 }, - { 198, 132, 22 }, - { 198, 133, 22 }, - { 199, 134, 22 }, - { 199, 135, 22 }, - { 199, 136, 23 }, - { 200, 137, 23 }, - { 200, 138, 23 }, - { 201, 139, 24 }, - { 201, 140, 24 }, - { 202, 142, 24 }, - { 202, 143, 25 }, - { 203, 144, 25 }, - { 203, 145, 25 }, - { 203, 146, 26 }, - { 204, 147, 26 }, - { 204, 148, 26 }, - { 205, 150, 27 }, - { 205, 151, 27 }, - { 206, 152, 28 }, - { 206, 153, 28 }, - { 206, 154, 28 }, - { 207, 155, 29 }, - { 207, 156, 29 }, - { 208, 158, 30 }, - { 208, 159, 30 }, - { 208, 160, 31 }, - { 209, 161, 31 }, - { 209, 162, 32 }, - { 209, 164, 32 }, - { 210, 165, 32 }, - { 210, 166, 33 }, - { 211, 167, 33 }, - { 211, 168, 34 }, - { 211, 169, 34 }, - { 212, 171, 35 }, - { 212, 172, 36 }, - { 212, 173, 36 }, - { 213, 174, 37 }, - { 213, 175, 37 }, - { 213, 177, 38 }, - { 214, 178, 38 }, - { 214, 179, 39 }, - { 214, 180, 39 }, - { 215, 181, 40 }, - { 215, 183, 40 }, - { 215, 184, 41 }, - { 215, 185, 42 }, - { 216, 186, 42 }, - { 216, 188, 43 }, - { 216, 189, 43 }, - { 217, 190, 44 }, - { 217, 191, 44 }, - { 217, 193, 45 }, - { 217, 194, 46 }, - { 218, 195, 46 }, - { 218, 196, 47 }, - { 218, 198, 47 }, - { 218, 199, 48 }, - { 219, 200, 49 }, - { 219, 201, 49 }, - { 219, 203, 50 }, - { 219, 204, 50 }, - { 220, 205, 51 }, - { 220, 206, 52 }, - { 220, 208, 52 }, - { 220, 209, 53 }, - { 221, 210, 54 }, - { 221, 212, 54 }, - { 221, 213, 55 }, - { 221, 214, 55 }, - { 221, 215, 56 }, - { 222, 217, 57 }, - { 222, 218, 57 }, - { 222, 219, 58 }, - { 222, 221, 59 }, - { 222, 222, 59 }, - { 222, 223, 60 }, - { 223, 225, 61 }, - { 223, 226, 61 }, - { 223, 227, 62 }, - { 223, 229, 63 }, - { 223, 230, 63 }, - { 223, 231, 64 }, - { 223, 233, 65 }, - { 224, 234, 65 }, - { 224, 235, 66 }, - { 224, 237, 67 }, - { 224, 238, 67 }, - { 224, 240, 68 }, - { 224, 241, 69 }, - { 224, 242, 69 }, - { 224, 244, 70 }, - { 224, 245, 71 }, - { 224, 246, 71 }, - { 224, 248, 72 }, - { 224, 249, 73 }, - { 224, 251, 73 }, - { 225, 252, 74 }, - { 225, 253, 75 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Speed.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Speed.cs deleted file mode 100644 index 9877aec68..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Speed.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Speed : IColourMap - { - public string Name => "Speed"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 255, 253, 205 }, - { 254, 252, 203 }, - { 254, 250, 201 }, - { 253, 249, 199 }, - { 252, 248, 197 }, - { 252, 247, 194 }, - { 251, 246, 192 }, - { 250, 244, 190 }, - { 249, 243, 188 }, - { 249, 242, 186 }, - { 248, 241, 184 }, - { 247, 240, 182 }, - { 247, 238, 180 }, - { 246, 237, 177 }, - { 246, 236, 175 }, - { 245, 235, 173 }, - { 244, 234, 171 }, - { 243, 233, 169 }, - { 243, 231, 167 }, - { 242, 230, 165 }, - { 241, 229, 162 }, - { 241, 228, 160 }, - { 240, 227, 158 }, - { 239, 226, 156 }, - { 239, 225, 154 }, - { 238, 223, 152 }, - { 237, 222, 150 }, - { 237, 221, 147 }, - { 236, 220, 145 }, - { 235, 219, 143 }, - { 234, 218, 141 }, - { 234, 217, 139 }, - { 233, 216, 137 }, - { 232, 215, 134 }, - { 231, 214, 132 }, - { 231, 213, 130 }, - { 230, 212, 128 }, - { 229, 211, 126 }, - { 228, 210, 123 }, - { 227, 208, 121 }, - { 227, 207, 119 }, - { 226, 206, 117 }, - { 225, 205, 115 }, - { 224, 205, 113 }, - { 223, 204, 110 }, - { 222, 203, 108 }, - { 221, 202, 106 }, - { 220, 201, 104 }, - { 219, 200, 102 }, - { 218, 199, 100 }, - { 217, 198, 97 }, - { 216, 197, 95 }, - { 215, 196, 93 }, - { 214, 195, 91 }, - { 213, 194, 89 }, - { 212, 193, 87 }, - { 211, 193, 85 }, - { 210, 192, 83 }, - { 209, 191, 81 }, - { 208, 190, 79 }, - { 206, 189, 76 }, - { 205, 189, 74 }, - { 204, 188, 72 }, - { 203, 187, 70 }, - { 201, 186, 69 }, - { 200, 185, 67 }, - { 199, 185, 65 }, - { 197, 184, 63 }, - { 196, 183, 61 }, - { 195, 183, 59 }, - { 193, 182, 57 }, - { 192, 181, 55 }, - { 190, 180, 54 }, - { 189, 180, 52 }, - { 187, 179, 50 }, - { 186, 178, 48 }, - { 184, 178, 47 }, - { 183, 177, 45 }, - { 181, 176, 43 }, - { 180, 176, 42 }, - { 178, 175, 40 }, - { 177, 174, 39 }, - { 175, 174, 37 }, - { 173, 173, 35 }, - { 172, 173, 34 }, - { 170, 172, 32 }, - { 169, 171, 31 }, - { 167, 171, 30 }, - { 165, 170, 28 }, - { 164, 169, 27 }, - { 162, 169, 25 }, - { 160, 168, 24 }, - { 159, 168, 23 }, - { 157, 167, 21 }, - { 155, 166, 20 }, - { 154, 166, 19 }, - { 152, 165, 18 }, - { 150, 165, 16 }, - { 149, 164, 15 }, - { 147, 163, 14 }, - { 145, 163, 13 }, - { 143, 162, 12 }, - { 142, 162, 11 }, - { 140, 161, 10 }, - { 138, 160, 9 }, - { 136, 160, 8 }, - { 135, 159, 8 }, - { 133, 159, 7 }, - { 131, 158, 7 }, - { 129, 157, 6 }, - { 128, 157, 6 }, - { 126, 156, 6 }, - { 124, 156, 6 }, - { 122, 155, 6 }, - { 121, 154, 6 }, - { 119, 154, 6 }, - { 117, 153, 6 }, - { 115, 153, 6 }, - { 113, 152, 6 }, - { 112, 151, 7 }, - { 110, 151, 7 }, - { 108, 150, 7 }, - { 106, 149, 8 }, - { 104, 149, 9 }, - { 102, 148, 9 }, - { 101, 148, 10 }, - { 99, 147, 11 }, - { 97, 146, 11 }, - { 95, 146, 12 }, - { 93, 145, 13 }, - { 92, 144, 14 }, - { 90, 144, 15 }, - { 88, 143, 15 }, - { 86, 142, 16 }, - { 84, 142, 17 }, - { 82, 141, 18 }, - { 81, 140, 18 }, - { 79, 140, 19 }, - { 77, 139, 20 }, - { 75, 138, 21 }, - { 73, 138, 22 }, - { 72, 137, 22 }, - { 70, 136, 23 }, - { 68, 136, 24 }, - { 66, 135, 25 }, - { 64, 134, 25 }, - { 63, 133, 26 }, - { 61, 133, 27 }, - { 59, 132, 28 }, - { 57, 131, 28 }, - { 56, 131, 29 }, - { 54, 130, 30 }, - { 52, 129, 30 }, - { 50, 128, 31 }, - { 49, 127, 32 }, - { 47, 127, 32 }, - { 45, 126, 33 }, - { 44, 125, 33 }, - { 42, 124, 34 }, - { 40, 124, 35 }, - { 39, 123, 35 }, - { 37, 122, 36 }, - { 36, 121, 36 }, - { 34, 120, 37 }, - { 33, 120, 37 }, - { 31, 119, 38 }, - { 30, 118, 38 }, - { 28, 117, 39 }, - { 27, 116, 39 }, - { 26, 115, 39 }, - { 24, 115, 40 }, - { 23, 114, 40 }, - { 22, 113, 41 }, - { 21, 112, 41 }, - { 19, 111, 41 }, - { 18, 110, 42 }, - { 17, 109, 42 }, - { 16, 108, 42 }, - { 15, 108, 43 }, - { 15, 107, 43 }, - { 14, 106, 43 }, - { 13, 105, 43 }, - { 13, 104, 43 }, - { 12, 103, 44 }, - { 12, 102, 44 }, - { 11, 101, 44 }, - { 11, 100, 44 }, - { 11, 99, 44 }, - { 11, 99, 44 }, - { 11, 98, 45 }, - { 11, 97, 45 }, - { 11, 96, 45 }, - { 11, 95, 45 }, - { 11, 94, 45 }, - { 12, 93, 45 }, - { 12, 92, 45 }, - { 12, 91, 45 }, - { 13, 90, 45 }, - { 13, 89, 45 }, - { 14, 88, 45 }, - { 14, 87, 45 }, - { 15, 86, 44 }, - { 15, 85, 44 }, - { 16, 84, 44 }, - { 16, 84, 44 }, - { 16, 83, 44 }, - { 17, 82, 44 }, - { 17, 81, 44 }, - { 18, 80, 43 }, - { 18, 79, 43 }, - { 19, 78, 43 }, - { 19, 77, 43 }, - { 20, 76, 42 }, - { 20, 75, 42 }, - { 20, 74, 42 }, - { 21, 73, 42 }, - { 21, 72, 41 }, - { 22, 71, 41 }, - { 22, 70, 41 }, - { 22, 69, 40 }, - { 23, 68, 40 }, - { 23, 67, 39 }, - { 23, 66, 39 }, - { 23, 65, 39 }, - { 24, 64, 38 }, - { 24, 63, 38 }, - { 24, 63, 37 }, - { 24, 62, 37 }, - { 25, 61, 36 }, - { 25, 60, 36 }, - { 25, 59, 35 }, - { 25, 58, 35 }, - { 25, 57, 34 }, - { 25, 56, 34 }, - { 25, 55, 33 }, - { 25, 54, 33 }, - { 25, 53, 32 }, - { 25, 52, 31 }, - { 25, 51, 31 }, - { 25, 50, 30 }, - { 25, 49, 30 }, - { 25, 48, 29 }, - { 25, 47, 28 }, - { 25, 46, 28 }, - { 25, 45, 27 }, - { 25, 44, 26 }, - { 25, 44, 25 }, - { 25, 43, 25 }, - { 25, 42, 24 }, - { 24, 41, 23 }, - { 24, 40, 23 }, - { 24, 39, 22 }, - { 24, 38, 21 }, - { 24, 37, 20 }, - { 23, 36, 19 }, - { 23, 35, 19 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Tarn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Tarn.cs deleted file mode 100644 index ba6824b0c..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Tarn.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Tarn : IColourMap - { - public string Name => "Tarn"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 23, 35, 14 }, - { 24, 37, 14 }, - { 25, 39, 14 }, - { 27, 41, 15 }, - { 28, 42, 15 }, - { 29, 44, 15 }, - { 31, 46, 16 }, - { 32, 48, 16 }, - { 33, 49, 16 }, - { 34, 51, 16 }, - { 35, 53, 16 }, - { 37, 55, 16 }, - { 38, 56, 16 }, - { 39, 58, 16 }, - { 40, 60, 16 }, - { 42, 61, 16 }, - { 43, 63, 15 }, - { 44, 65, 15 }, - { 46, 66, 15 }, - { 47, 68, 14 }, - { 48, 70, 14 }, - { 50, 71, 13 }, - { 52, 73, 12 }, - { 54, 74, 12 }, - { 57, 75, 12 }, - { 60, 77, 13 }, - { 63, 78, 14 }, - { 66, 79, 15 }, - { 68, 80, 16 }, - { 71, 81, 17 }, - { 74, 83, 18 }, - { 77, 84, 19 }, - { 79, 85, 20 }, - { 82, 86, 21 }, - { 85, 87, 22 }, - { 87, 88, 23 }, - { 90, 89, 24 }, - { 93, 91, 25 }, - { 96, 92, 26 }, - { 98, 93, 26 }, - { 101, 94, 27 }, - { 104, 95, 28 }, - { 107, 96, 29 }, - { 109, 97, 30 }, - { 112, 98, 31 }, - { 115, 99, 32 }, - { 118, 100, 33 }, - { 120, 102, 33 }, - { 123, 103, 34 }, - { 126, 104, 35 }, - { 129, 105, 36 }, - { 132, 106, 37 }, - { 134, 107, 38 }, - { 137, 108, 39 }, - { 140, 109, 39 }, - { 143, 110, 40 }, - { 146, 111, 41 }, - { 149, 112, 42 }, - { 152, 113, 43 }, - { 155, 114, 44 }, - { 158, 115, 45 }, - { 160, 116, 46 }, - { 163, 117, 47 }, - { 166, 118, 48 }, - { 169, 119, 49 }, - { 172, 120, 50 }, - { 175, 121, 51 }, - { 178, 122, 53 }, - { 181, 123, 54 }, - { 184, 124, 55 }, - { 187, 125, 57 }, - { 190, 126, 58 }, - { 193, 127, 60 }, - { 196, 128, 62 }, - { 198, 129, 65 }, - { 201, 130, 68 }, - { 203, 132, 72 }, - { 204, 134, 76 }, - { 205, 136, 79 }, - { 206, 138, 83 }, - { 207, 140, 87 }, - { 208, 143, 90 }, - { 209, 145, 93 }, - { 210, 147, 97 }, - { 210, 150, 100 }, - { 211, 152, 104 }, - { 212, 154, 107 }, - { 213, 156, 111 }, - { 214, 159, 114 }, - { 215, 161, 117 }, - { 216, 163, 121 }, - { 217, 166, 124 }, - { 218, 168, 128 }, - { 219, 170, 131 }, - { 219, 173, 135 }, - { 220, 175, 138 }, - { 221, 177, 142 }, - { 222, 179, 145 }, - { 223, 182, 149 }, - { 224, 184, 152 }, - { 225, 186, 156 }, - { 226, 189, 159 }, - { 227, 191, 163 }, - { 228, 193, 166 }, - { 229, 196, 170 }, - { 230, 198, 173 }, - { 231, 200, 177 }, - { 232, 203, 180 }, - { 233, 205, 184 }, - { 234, 208, 187 }, - { 235, 210, 191 }, - { 236, 212, 194 }, - { 237, 215, 198 }, - { 239, 217, 201 }, - { 240, 219, 205 }, - { 241, 222, 209 }, - { 242, 224, 212 }, - { 243, 227, 216 }, - { 244, 229, 219 }, - { 246, 232, 223 }, - { 247, 234, 226 }, - { 248, 236, 229 }, - { 249, 239, 233 }, - { 250, 241, 236 }, - { 251, 243, 239 }, - { 252, 245, 242 }, - { 252, 246, 244 }, - { 252, 247, 246 }, - { 252, 247, 246 }, - { 252, 247, 245 }, - { 251, 246, 243 }, - { 251, 245, 240 }, - { 249, 244, 237 }, - { 248, 242, 234 }, - { 246, 240, 231 }, - { 244, 238, 227 }, - { 242, 236, 224 }, - { 240, 234, 220 }, - { 239, 232, 216 }, - { 237, 230, 213 }, - { 235, 228, 209 }, - { 233, 226, 205 }, - { 231, 223, 202 }, - { 229, 221, 198 }, - { 227, 219, 194 }, - { 225, 217, 191 }, - { 223, 215, 187 }, - { 221, 214, 184 }, - { 218, 212, 180 }, - { 215, 210, 178 }, - { 212, 209, 175 }, - { 209, 207, 173 }, - { 206, 206, 171 }, - { 203, 204, 170 }, - { 199, 203, 168 }, - { 196, 201, 167 }, - { 193, 200, 166 }, - { 190, 198, 165 }, - { 186, 196, 164 }, - { 183, 195, 163 }, - { 180, 193, 162 }, - { 177, 192, 161 }, - { 174, 190, 160 }, - { 171, 189, 159 }, - { 168, 187, 158 }, - { 165, 185, 157 }, - { 162, 184, 156 }, - { 159, 182, 155 }, - { 156, 181, 154 }, - { 153, 179, 153 }, - { 151, 178, 152 }, - { 148, 176, 151 }, - { 145, 174, 150 }, - { 142, 173, 149 }, - { 139, 171, 148 }, - { 136, 170, 147 }, - { 133, 168, 146 }, - { 130, 167, 146 }, - { 127, 165, 145 }, - { 124, 164, 144 }, - { 121, 162, 143 }, - { 118, 161, 142 }, - { 115, 159, 141 }, - { 112, 158, 140 }, - { 109, 156, 139 }, - { 106, 155, 138 }, - { 103, 154, 137 }, - { 100, 152, 137 }, - { 97, 151, 136 }, - { 94, 149, 135 }, - { 90, 148, 134 }, - { 87, 146, 133 }, - { 84, 145, 133 }, - { 81, 143, 132 }, - { 78, 142, 131 }, - { 74, 140, 131 }, - { 71, 139, 130 }, - { 68, 137, 130 }, - { 65, 136, 129 }, - { 61, 134, 128 }, - { 58, 133, 128 }, - { 55, 131, 127 }, - { 52, 129, 127 }, - { 49, 128, 126 }, - { 46, 126, 126 }, - { 44, 124, 125 }, - { 42, 123, 125 }, - { 39, 121, 124 }, - { 37, 119, 124 }, - { 36, 117, 123 }, - { 34, 116, 122 }, - { 33, 114, 122 }, - { 32, 112, 121 }, - { 32, 110, 120 }, - { 31, 108, 119 }, - { 31, 106, 118 }, - { 30, 105, 118 }, - { 30, 103, 117 }, - { 29, 101, 116 }, - { 29, 99, 115 }, - { 28, 97, 114 }, - { 28, 95, 113 }, - { 27, 93, 112 }, - { 26, 92, 111 }, - { 26, 90, 111 }, - { 25, 88, 110 }, - { 24, 86, 109 }, - { 24, 84, 108 }, - { 23, 83, 107 }, - { 22, 81, 107 }, - { 21, 79, 106 }, - { 20, 77, 105 }, - { 19, 75, 104 }, - { 18, 73, 104 }, - { 17, 72, 103 }, - { 16, 70, 102 }, - { 16, 68, 101 }, - { 15, 66, 101 }, - { 14, 64, 100 }, - { 13, 62, 99 }, - { 12, 60, 99 }, - { 11, 59, 98 }, - { 10, 57, 98 }, - { 9, 55, 97 }, - { 9, 53, 96 }, - { 9, 51, 96 }, - { 9, 49, 95 }, - { 10, 47, 94 }, - { 11, 45, 93 }, - { 12, 42, 91 }, - { 13, 40, 89 }, - { 14, 38, 88 }, - { 14, 36, 86 }, - { 15, 34, 84 }, - { 15, 32, 82 }, - { 16, 30, 79 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Tempo.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Tempo.cs deleted file mode 100644 index e2b14820f..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Tempo.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Tempo : IColourMap - { - public string Name => "Tempo"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 255, 246, 244 }, - { 253, 245, 243 }, - { 252, 244, 241 }, - { 251, 243, 240 }, - { 249, 242, 238 }, - { 248, 241, 237 }, - { 247, 240, 235 }, - { 245, 239, 234 }, - { 244, 238, 232 }, - { 242, 237, 231 }, - { 241, 236, 229 }, - { 240, 235, 228 }, - { 238, 234, 226 }, - { 237, 234, 225 }, - { 235, 233, 223 }, - { 234, 232, 222 }, - { 233, 231, 221 }, - { 231, 230, 219 }, - { 230, 229, 218 }, - { 228, 228, 216 }, - { 227, 227, 215 }, - { 226, 226, 214 }, - { 224, 226, 212 }, - { 223, 225, 211 }, - { 221, 224, 209 }, - { 220, 223, 208 }, - { 219, 222, 207 }, - { 217, 221, 205 }, - { 216, 221, 204 }, - { 214, 220, 203 }, - { 213, 219, 201 }, - { 211, 218, 200 }, - { 210, 217, 199 }, - { 209, 216, 197 }, - { 207, 216, 196 }, - { 206, 215, 195 }, - { 204, 214, 193 }, - { 203, 213, 192 }, - { 201, 212, 191 }, - { 200, 212, 190 }, - { 198, 211, 188 }, - { 197, 210, 187 }, - { 195, 209, 186 }, - { 194, 209, 185 }, - { 192, 208, 183 }, - { 191, 207, 182 }, - { 189, 206, 181 }, - { 188, 206, 180 }, - { 186, 205, 179 }, - { 185, 204, 178 }, - { 183, 203, 176 }, - { 182, 203, 175 }, - { 180, 202, 174 }, - { 179, 201, 173 }, - { 177, 200, 172 }, - { 176, 200, 171 }, - { 174, 199, 170 }, - { 172, 198, 169 }, - { 171, 197, 168 }, - { 169, 197, 166 }, - { 168, 196, 165 }, - { 166, 195, 164 }, - { 164, 195, 163 }, - { 163, 194, 162 }, - { 161, 193, 161 }, - { 160, 192, 160 }, - { 158, 192, 159 }, - { 156, 191, 159 }, - { 155, 190, 158 }, - { 153, 190, 157 }, - { 151, 189, 156 }, - { 150, 188, 155 }, - { 148, 188, 154 }, - { 146, 187, 153 }, - { 145, 186, 152 }, - { 143, 186, 151 }, - { 141, 185, 151 }, - { 139, 184, 150 }, - { 138, 183, 149 }, - { 136, 183, 148 }, - { 134, 182, 147 }, - { 133, 181, 147 }, - { 131, 181, 146 }, - { 129, 180, 145 }, - { 127, 179, 144 }, - { 125, 179, 144 }, - { 124, 178, 143 }, - { 122, 177, 142 }, - { 120, 177, 142 }, - { 118, 176, 141 }, - { 116, 175, 141 }, - { 114, 175, 140 }, - { 113, 174, 139 }, - { 111, 173, 139 }, - { 109, 173, 138 }, - { 107, 172, 138 }, - { 105, 171, 137 }, - { 103, 171, 137 }, - { 101, 170, 136 }, - { 99, 169, 136 }, - { 97, 169, 135 }, - { 95, 168, 135 }, - { 93, 167, 134 }, - { 91, 166, 134 }, - { 89, 166, 133 }, - { 87, 165, 133 }, - { 86, 164, 133 }, - { 84, 164, 132 }, - { 82, 163, 132 }, - { 80, 162, 132 }, - { 78, 161, 131 }, - { 75, 161, 131 }, - { 73, 160, 131 }, - { 71, 159, 130 }, - { 69, 159, 130 }, - { 67, 158, 130 }, - { 65, 157, 130 }, - { 63, 156, 129 }, - { 61, 156, 129 }, - { 59, 155, 129 }, - { 58, 154, 129 }, - { 56, 153, 129 }, - { 54, 152, 128 }, - { 52, 152, 128 }, - { 50, 151, 128 }, - { 48, 150, 128 }, - { 46, 149, 128 }, - { 44, 148, 127 }, - { 42, 147, 127 }, - { 41, 147, 127 }, - { 39, 146, 127 }, - { 37, 145, 127 }, - { 36, 144, 127 }, - { 34, 143, 126 }, - { 33, 142, 126 }, - { 31, 141, 126 }, - { 30, 141, 126 }, - { 28, 140, 126 }, - { 27, 139, 125 }, - { 26, 138, 125 }, - { 25, 137, 125 }, - { 23, 136, 125 }, - { 22, 135, 124 }, - { 22, 134, 124 }, - { 21, 133, 124 }, - { 20, 132, 124 }, - { 19, 132, 123 }, - { 19, 131, 123 }, - { 18, 130, 123 }, - { 18, 129, 123 }, - { 17, 128, 122 }, - { 17, 127, 122 }, - { 17, 126, 122 }, - { 17, 125, 121 }, - { 17, 124, 121 }, - { 17, 123, 121 }, - { 17, 122, 120 }, - { 17, 121, 120 }, - { 17, 120, 120 }, - { 17, 119, 119 }, - { 17, 118, 119 }, - { 18, 118, 118 }, - { 18, 117, 118 }, - { 18, 116, 118 }, - { 19, 115, 117 }, - { 19, 114, 117 }, - { 19, 113, 116 }, - { 20, 112, 116 }, - { 20, 111, 115 }, - { 20, 110, 115 }, - { 21, 109, 115 }, - { 21, 108, 114 }, - { 22, 107, 114 }, - { 22, 106, 113 }, - { 22, 105, 113 }, - { 23, 104, 112 }, - { 23, 103, 112 }, - { 23, 102, 111 }, - { 24, 101, 111 }, - { 24, 101, 110 }, - { 24, 100, 110 }, - { 25, 99, 109 }, - { 25, 98, 109 }, - { 25, 97, 108 }, - { 25, 96, 108 }, - { 26, 95, 107 }, - { 26, 94, 107 }, - { 26, 93, 106 }, - { 26, 92, 106 }, - { 26, 91, 105 }, - { 27, 90, 104 }, - { 27, 89, 104 }, - { 27, 88, 103 }, - { 27, 88, 103 }, - { 27, 87, 102 }, - { 27, 86, 102 }, - { 28, 85, 101 }, - { 28, 84, 101 }, - { 28, 83, 100 }, - { 28, 82, 99 }, - { 28, 81, 99 }, - { 28, 80, 98 }, - { 28, 79, 98 }, - { 28, 78, 97 }, - { 28, 77, 97 }, - { 28, 76, 96 }, - { 28, 76, 95 }, - { 28, 75, 95 }, - { 28, 74, 94 }, - { 28, 73, 94 }, - { 28, 72, 93 }, - { 28, 71, 93 }, - { 28, 70, 92 }, - { 28, 69, 91 }, - { 28, 68, 91 }, - { 28, 67, 90 }, - { 28, 66, 90 }, - { 28, 66, 89 }, - { 28, 65, 88 }, - { 28, 64, 88 }, - { 27, 63, 87 }, - { 27, 62, 87 }, - { 27, 61, 86 }, - { 27, 60, 86 }, - { 27, 59, 85 }, - { 27, 58, 84 }, - { 27, 57, 84 }, - { 27, 56, 83 }, - { 26, 55, 83 }, - { 26, 54, 82 }, - { 26, 54, 81 }, - { 26, 53, 81 }, - { 26, 52, 80 }, - { 26, 51, 80 }, - { 25, 50, 79 }, - { 25, 49, 79 }, - { 25, 48, 78 }, - { 25, 47, 77 }, - { 25, 46, 77 }, - { 24, 45, 76 }, - { 24, 44, 76 }, - { 24, 43, 75 }, - { 24, 42, 75 }, - { 24, 41, 74 }, - { 23, 40, 74 }, - { 23, 39, 73 }, - { 23, 38, 72 }, - { 23, 37, 72 }, - { 23, 36, 71 }, - { 22, 35, 71 }, - { 22, 34, 70 }, - { 22, 33, 70 }, - { 22, 32, 69 }, - { 21, 31, 69 }, - { 21, 30, 68 }, - { 21, 29, 68 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Thermal.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Thermal.cs deleted file mode 100644 index 4f13446e7..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Thermal.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Thermal : IColourMap - { - public string Name => "Thermal"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 4, 35, 51 }, - { 4, 36, 53 }, - { 4, 37, 55 }, - { 4, 37, 57 }, - { 5, 38, 59 }, - { 5, 39, 61 }, - { 5, 39, 63 }, - { 5, 40, 65 }, - { 5, 41, 67 }, - { 6, 41, 69 }, - { 6, 42, 71 }, - { 6, 43, 73 }, - { 7, 43, 75 }, - { 7, 44, 77 }, - { 7, 44, 80 }, - { 8, 45, 82 }, - { 8, 46, 84 }, - { 9, 46, 86 }, - { 9, 47, 89 }, - { 10, 47, 91 }, - { 11, 48, 93 }, - { 12, 48, 96 }, - { 12, 48, 98 }, - { 13, 49, 101 }, - { 14, 49, 103 }, - { 15, 50, 106 }, - { 16, 50, 108 }, - { 18, 50, 111 }, - { 19, 51, 114 }, - { 20, 51, 116 }, - { 22, 51, 119 }, - { 23, 51, 122 }, - { 25, 51, 124 }, - { 26, 52, 127 }, - { 28, 52, 130 }, - { 30, 52, 132 }, - { 31, 52, 135 }, - { 33, 52, 138 }, - { 35, 52, 140 }, - { 37, 52, 143 }, - { 39, 52, 145 }, - { 42, 51, 147 }, - { 44, 51, 149 }, - { 46, 51, 151 }, - { 48, 51, 153 }, - { 51, 51, 155 }, - { 53, 51, 156 }, - { 55, 51, 157 }, - { 57, 51, 158 }, - { 60, 51, 159 }, - { 62, 52, 159 }, - { 64, 52, 159 }, - { 66, 52, 160 }, - { 68, 53, 160 }, - { 70, 53, 160 }, - { 71, 54, 160 }, - { 73, 54, 159 }, - { 75, 55, 159 }, - { 77, 55, 159 }, - { 78, 56, 158 }, - { 80, 57, 158 }, - { 82, 57, 157 }, - { 83, 58, 157 }, - { 85, 59, 157 }, - { 86, 59, 156 }, - { 88, 60, 156 }, - { 89, 61, 155 }, - { 91, 61, 155 }, - { 92, 62, 154 }, - { 94, 63, 154 }, - { 95, 63, 153 }, - { 96, 64, 153 }, - { 98, 65, 152 }, - { 99, 65, 152 }, - { 101, 66, 151 }, - { 102, 67, 151 }, - { 103, 67, 150 }, - { 105, 68, 150 }, - { 106, 69, 149 }, - { 108, 69, 149 }, - { 109, 70, 148 }, - { 110, 71, 148 }, - { 112, 71, 148 }, - { 113, 72, 147 }, - { 114, 72, 147 }, - { 116, 73, 146 }, - { 117, 74, 146 }, - { 118, 74, 146 }, - { 120, 75, 145 }, - { 121, 75, 145 }, - { 122, 76, 145 }, - { 124, 77, 144 }, - { 125, 77, 144 }, - { 126, 78, 144 }, - { 128, 78, 143 }, - { 129, 79, 143 }, - { 131, 80, 143 }, - { 132, 80, 142 }, - { 133, 81, 142 }, - { 135, 81, 142 }, - { 136, 82, 141 }, - { 137, 82, 141 }, - { 139, 83, 141 }, - { 140, 83, 140 }, - { 142, 84, 140 }, - { 143, 84, 140 }, - { 144, 85, 139 }, - { 146, 85, 139 }, - { 147, 86, 139 }, - { 149, 86, 138 }, - { 150, 87, 138 }, - { 151, 87, 138 }, - { 153, 88, 137 }, - { 154, 88, 137 }, - { 156, 89, 137 }, - { 157, 89, 136 }, - { 159, 90, 136 }, - { 160, 90, 135 }, - { 162, 91, 135 }, - { 163, 91, 134 }, - { 165, 92, 134 }, - { 166, 92, 134 }, - { 168, 93, 133 }, - { 169, 93, 132 }, - { 171, 93, 132 }, - { 172, 94, 131 }, - { 174, 94, 131 }, - { 175, 95, 130 }, - { 177, 95, 130 }, - { 178, 96, 129 }, - { 180, 96, 128 }, - { 181, 97, 128 }, - { 183, 97, 127 }, - { 184, 98, 126 }, - { 186, 98, 126 }, - { 187, 98, 125 }, - { 189, 99, 124 }, - { 190, 99, 123 }, - { 192, 100, 123 }, - { 193, 100, 122 }, - { 195, 101, 121 }, - { 196, 101, 120 }, - { 198, 102, 119 }, - { 199, 102, 118 }, - { 201, 103, 117 }, - { 202, 103, 116 }, - { 204, 104, 115 }, - { 205, 104, 114 }, - { 206, 105, 113 }, - { 208, 105, 112 }, - { 209, 106, 111 }, - { 211, 106, 110 }, - { 212, 107, 109 }, - { 214, 108, 108 }, - { 215, 108, 107 }, - { 216, 109, 106 }, - { 218, 110, 105 }, - { 219, 110, 104 }, - { 220, 111, 102 }, - { 222, 112, 101 }, - { 223, 112, 100 }, - { 224, 113, 99 }, - { 225, 114, 98 }, - { 227, 114, 96 }, - { 228, 115, 95 }, - { 229, 116, 94 }, - { 230, 117, 93 }, - { 231, 118, 91 }, - { 232, 119, 90 }, - { 234, 120, 89 }, - { 235, 121, 88 }, - { 236, 121, 86 }, - { 237, 122, 85 }, - { 238, 123, 84 }, - { 238, 125, 83 }, - { 239, 126, 82 }, - { 240, 127, 80 }, - { 241, 128, 79 }, - { 242, 129, 78 }, - { 243, 130, 77 }, - { 243, 131, 76 }, - { 244, 133, 75 }, - { 245, 134, 74 }, - { 245, 135, 73 }, - { 246, 136, 72 }, - { 246, 138, 71 }, - { 247, 139, 70 }, - { 247, 140, 69 }, - { 248, 142, 68 }, - { 248, 143, 67 }, - { 249, 145, 67 }, - { 249, 146, 66 }, - { 249, 147, 65 }, - { 250, 149, 65 }, - { 250, 150, 64 }, - { 250, 152, 63 }, - { 251, 153, 63 }, - { 251, 155, 62 }, - { 251, 156, 62 }, - { 251, 158, 62 }, - { 251, 159, 61 }, - { 251, 161, 61 }, - { 252, 163, 61 }, - { 252, 164, 61 }, - { 252, 166, 60 }, - { 252, 167, 60 }, - { 252, 169, 60 }, - { 252, 170, 60 }, - { 252, 172, 60 }, - { 252, 174, 60 }, - { 252, 175, 60 }, - { 252, 177, 60 }, - { 251, 178, 61 }, - { 251, 180, 61 }, - { 251, 182, 61 }, - { 251, 183, 61 }, - { 251, 185, 62 }, - { 251, 187, 62 }, - { 251, 188, 62 }, - { 250, 190, 63 }, - { 250, 191, 63 }, - { 250, 193, 64 }, - { 250, 195, 64 }, - { 249, 196, 65 }, - { 249, 198, 65 }, - { 249, 200, 66 }, - { 248, 201, 67 }, - { 248, 203, 67 }, - { 248, 205, 68 }, - { 247, 206, 69 }, - { 247, 208, 69 }, - { 247, 210, 70 }, - { 246, 211, 71 }, - { 246, 213, 71 }, - { 245, 215, 72 }, - { 245, 216, 73 }, - { 244, 218, 74 }, - { 244, 220, 75 }, - { 243, 221, 75 }, - { 243, 223, 76 }, - { 242, 225, 77 }, - { 242, 226, 78 }, - { 241, 228, 79 }, - { 241, 230, 80 }, - { 240, 232, 81 }, - { 239, 233, 81 }, - { 239, 235, 82 }, - { 238, 237, 83 }, - { 237, 238, 84 }, - { 237, 240, 85 }, - { 236, 242, 86 }, - { 235, 244, 87 }, - { 234, 245, 88 }, - { 234, 247, 89 }, - { 233, 249, 90 }, - { 232, 250, 91 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Topo.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Topo.cs deleted file mode 100644 index e7abba01a..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Topo.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Topo : IColourMap - { - public string Name => "Topo"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 40, 26, 44 }, - { 41, 28, 47 }, - { 43, 29, 50 }, - { 44, 31, 52 }, - { 45, 32, 55 }, - { 47, 34, 58 }, - { 48, 35, 61 }, - { 49, 37, 64 }, - { 50, 38, 67 }, - { 52, 40, 70 }, - { 53, 41, 73 }, - { 54, 42, 76 }, - { 55, 44, 79 }, - { 56, 45, 82 }, - { 57, 47, 85 }, - { 58, 48, 88 }, - { 59, 50, 92 }, - { 60, 51, 95 }, - { 61, 53, 98 }, - { 62, 54, 102 }, - { 63, 56, 105 }, - { 63, 57, 108 }, - { 64, 59, 112 }, - { 64, 60, 115 }, - { 65, 62, 118 }, - { 65, 64, 122 }, - { 65, 65, 125 }, - { 66, 67, 128 }, - { 65, 69, 131 }, - { 65, 71, 133 }, - { 65, 73, 136 }, - { 65, 75, 138 }, - { 64, 77, 140 }, - { 64, 79, 141 }, - { 63, 82, 143 }, - { 63, 84, 144 }, - { 62, 86, 145 }, - { 62, 88, 146 }, - { 62, 90, 146 }, - { 62, 92, 147 }, - { 62, 95, 147 }, - { 62, 97, 148 }, - { 62, 99, 148 }, - { 62, 101, 149 }, - { 62, 103, 149 }, - { 62, 105, 150 }, - { 62, 107, 150 }, - { 63, 109, 151 }, - { 63, 111, 151 }, - { 64, 113, 151 }, - { 64, 115, 152 }, - { 64, 117, 152 }, - { 65, 119, 153 }, - { 66, 121, 153 }, - { 66, 123, 153 }, - { 67, 125, 154 }, - { 67, 127, 154 }, - { 68, 129, 155 }, - { 68, 131, 155 }, - { 69, 133, 156 }, - { 70, 135, 156 }, - { 70, 137, 157 }, - { 71, 139, 157 }, - { 72, 141, 157 }, - { 72, 143, 158 }, - { 73, 145, 158 }, - { 74, 147, 159 }, - { 74, 149, 159 }, - { 75, 151, 160 }, - { 76, 153, 160 }, - { 77, 155, 161 }, - { 77, 157, 161 }, - { 78, 159, 161 }, - { 79, 161, 162 }, - { 80, 163, 162 }, - { 81, 165, 162 }, - { 81, 167, 163 }, - { 82, 169, 163 }, - { 83, 171, 163 }, - { 85, 173, 163 }, - { 86, 175, 164 }, - { 87, 177, 164 }, - { 88, 179, 164 }, - { 90, 182, 164 }, - { 91, 184, 164 }, - { 93, 186, 164 }, - { 95, 188, 164 }, - { 97, 190, 164 }, - { 99, 192, 164 }, - { 101, 194, 164 }, - { 103, 195, 164 }, - { 106, 197, 164 }, - { 109, 199, 163 }, - { 112, 201, 163 }, - { 115, 203, 163 }, - { 118, 205, 163 }, - { 122, 206, 163 }, - { 125, 208, 163 }, - { 129, 210, 163 }, - { 133, 211, 163 }, - { 137, 213, 163 }, - { 141, 215, 163 }, - { 146, 216, 164 }, - { 150, 218, 164 }, - { 154, 219, 165 }, - { 159, 221, 165 }, - { 163, 222, 166 }, - { 167, 224, 167 }, - { 172, 225, 168 }, - { 176, 226, 169 }, - { 181, 228, 170 }, - { 185, 229, 172 }, - { 189, 231, 173 }, - { 193, 232, 175 }, - { 198, 234, 176 }, - { 202, 235, 178 }, - { 206, 236, 179 }, - { 210, 238, 181 }, - { 215, 239, 183 }, - { 219, 241, 185 }, - { 223, 242, 187 }, - { 227, 244, 189 }, - { 231, 245, 191 }, - { 235, 247, 193 }, - { 239, 248, 196 }, - { 243, 250, 198 }, - { 247, 251, 200 }, - { 251, 253, 203 }, - { 13, 37, 20 }, - { 14, 39, 21 }, - { 15, 41, 21 }, - { 16, 42, 22 }, - { 17, 44, 23 }, - { 18, 46, 23 }, - { 19, 48, 24 }, - { 20, 50, 24 }, - { 21, 51, 25 }, - { 22, 53, 26 }, - { 23, 55, 26 }, - { 23, 57, 27 }, - { 24, 58, 27 }, - { 25, 60, 28 }, - { 26, 62, 28 }, - { 27, 64, 28 }, - { 27, 65, 29 }, - { 28, 67, 29 }, - { 29, 69, 29 }, - { 30, 71, 30 }, - { 31, 72, 30 }, - { 32, 74, 30 }, - { 33, 76, 30 }, - { 35, 78, 30 }, - { 37, 79, 30 }, - { 39, 81, 30 }, - { 42, 82, 30 }, - { 45, 83, 31 }, - { 48, 85, 32 }, - { 51, 86, 34 }, - { 54, 87, 35 }, - { 57, 88, 37 }, - { 60, 90, 38 }, - { 63, 91, 40 }, - { 65, 92, 42 }, - { 68, 93, 43 }, - { 71, 95, 45 }, - { 73, 96, 47 }, - { 76, 97, 48 }, - { 78, 98, 49 }, - { 81, 99, 51 }, - { 84, 101, 52 }, - { 86, 102, 53 }, - { 89, 103, 54 }, - { 92, 104, 55 }, - { 94, 106, 56 }, - { 97, 107, 57 }, - { 100, 108, 58 }, - { 102, 109, 58 }, - { 105, 111, 59 }, - { 107, 112, 60 }, - { 110, 113, 60 }, - { 113, 114, 61 }, - { 115, 116, 61 }, - { 118, 117, 62 }, - { 121, 118, 62 }, - { 123, 119, 62 }, - { 126, 121, 63 }, - { 129, 122, 63 }, - { 131, 123, 63 }, - { 134, 124, 63 }, - { 137, 126, 64 }, - { 140, 127, 64 }, - { 142, 128, 64 }, - { 145, 129, 64 }, - { 148, 131, 64 }, - { 150, 132, 64 }, - { 153, 133, 64 }, - { 156, 134, 64 }, - { 159, 136, 64 }, - { 161, 137, 64 }, - { 164, 138, 63 }, - { 167, 140, 63 }, - { 170, 141, 63 }, - { 173, 142, 63 }, - { 176, 143, 63 }, - { 179, 145, 63 }, - { 182, 146, 63 }, - { 185, 147, 62 }, - { 188, 148, 62 }, - { 191, 149, 63 }, - { 193, 151, 65 }, - { 195, 153, 69 }, - { 196, 155, 72 }, - { 197, 157, 76 }, - { 198, 159, 80 }, - { 199, 161, 83 }, - { 200, 163, 87 }, - { 202, 165, 90 }, - { 203, 167, 94 }, - { 204, 169, 97 }, - { 205, 171, 101 }, - { 206, 173, 104 }, - { 207, 176, 108 }, - { 208, 178, 111 }, - { 209, 180, 115 }, - { 210, 182, 118 }, - { 211, 184, 122 }, - { 212, 187, 125 }, - { 213, 189, 129 }, - { 214, 191, 132 }, - { 215, 193, 136 }, - { 216, 195, 139 }, - { 218, 198, 143 }, - { 219, 200, 146 }, - { 220, 202, 150 }, - { 221, 204, 153 }, - { 222, 207, 157 }, - { 223, 209, 160 }, - { 224, 211, 164 }, - { 226, 213, 167 }, - { 227, 216, 171 }, - { 228, 218, 174 }, - { 229, 220, 178 }, - { 230, 223, 182 }, - { 232, 225, 185 }, - { 233, 227, 189 }, - { 234, 230, 192 }, - { 236, 232, 196 }, - { 237, 234, 199 }, - { 238, 237, 203 }, - { 240, 239, 207 }, - { 241, 241, 210 }, - { 242, 244, 214 }, - { 244, 246, 217 }, - { 245, 249, 221 }, - { 247, 251, 225 }, - { 249, 253, 228 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Turbid.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Turbid.cs deleted file mode 100644 index 1b2cbd370..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Turbid.cs +++ /dev/null @@ -1,298 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Turbid : IColourMap - { - public string Name => "Turbid"; - - public (byte r, byte g, byte b) GetRGB(byte value) => - (cmaplocal[value, 0], cmaplocal[value, 1], cmaplocal[value, 2]); - - private static readonly byte[,] cmaplocal = { - { 233, 246, 171 }, - { 232, 245, 170 }, - { 232, 243, 168 }, - { 231, 242, 167 }, - { 230, 241, 165 }, - { 230, 240, 164 }, - { 229, 239, 162 }, - { 229, 238, 161 }, - { 228, 236, 159 }, - { 228, 235, 158 }, - { 227, 234, 156 }, - { 227, 233, 155 }, - { 226, 232, 154 }, - { 226, 231, 152 }, - { 225, 229, 151 }, - { 224, 228, 149 }, - { 224, 227, 148 }, - { 223, 226, 146 }, - { 223, 225, 145 }, - { 222, 224, 143 }, - { 222, 223, 142 }, - { 221, 221, 141 }, - { 221, 220, 139 }, - { 220, 219, 138 }, - { 220, 218, 136 }, - { 219, 217, 135 }, - { 219, 216, 134 }, - { 218, 215, 132 }, - { 218, 213, 131 }, - { 217, 212, 130 }, - { 217, 211, 128 }, - { 217, 210, 127 }, - { 216, 209, 126 }, - { 216, 208, 124 }, - { 215, 207, 123 }, - { 215, 206, 122 }, - { 214, 204, 120 }, - { 214, 203, 119 }, - { 213, 202, 118 }, - { 213, 201, 116 }, - { 212, 200, 115 }, - { 212, 199, 114 }, - { 211, 198, 113 }, - { 211, 197, 111 }, - { 211, 195, 110 }, - { 210, 194, 109 }, - { 210, 193, 108 }, - { 209, 192, 107 }, - { 209, 191, 105 }, - { 208, 190, 104 }, - { 208, 189, 103 }, - { 207, 188, 102 }, - { 207, 187, 101 }, - { 207, 186, 100 }, - { 206, 184, 98 }, - { 206, 183, 97 }, - { 205, 182, 96 }, - { 205, 181, 95 }, - { 204, 180, 94 }, - { 204, 179, 93 }, - { 203, 178, 92 }, - { 203, 177, 91 }, - { 202, 176, 90 }, - { 202, 175, 89 }, - { 202, 174, 88 }, - { 201, 172, 87 }, - { 201, 171, 86 }, - { 200, 170, 85 }, - { 200, 169, 84 }, - { 199, 168, 83 }, - { 199, 167, 82 }, - { 198, 166, 81 }, - { 198, 165, 81 }, - { 197, 164, 80 }, - { 197, 163, 79 }, - { 196, 162, 78 }, - { 196, 161, 77 }, - { 195, 160, 77 }, - { 195, 159, 76 }, - { 194, 158, 75 }, - { 194, 156, 74 }, - { 193, 155, 74 }, - { 193, 154, 73 }, - { 192, 153, 72 }, - { 192, 152, 72 }, - { 191, 151, 71 }, - { 191, 150, 71 }, - { 190, 149, 70 }, - { 189, 148, 69 }, - { 189, 147, 69 }, - { 188, 146, 68 }, - { 188, 145, 68 }, - { 187, 144, 67 }, - { 187, 143, 67 }, - { 186, 142, 66 }, - { 185, 141, 66 }, - { 185, 140, 66 }, - { 184, 139, 65 }, - { 183, 138, 65 }, - { 183, 137, 64 }, - { 182, 137, 64 }, - { 182, 136, 64 }, - { 181, 135, 64 }, - { 180, 134, 63 }, - { 179, 133, 63 }, - { 179, 132, 63 }, - { 178, 131, 62 }, - { 177, 130, 62 }, - { 177, 129, 62 }, - { 176, 128, 62 }, - { 175, 127, 61 }, - { 175, 126, 61 }, - { 174, 125, 61 }, - { 173, 125, 61 }, - { 172, 124, 61 }, - { 172, 123, 61 }, - { 171, 122, 60 }, - { 170, 121, 60 }, - { 169, 120, 60 }, - { 168, 119, 60 }, - { 168, 119, 60 }, - { 167, 118, 60 }, - { 166, 117, 60 }, - { 165, 116, 60 }, - { 164, 115, 59 }, - { 164, 114, 59 }, - { 163, 114, 59 }, - { 162, 113, 59 }, - { 161, 112, 59 }, - { 160, 111, 59 }, - { 159, 110, 59 }, - { 158, 110, 59 }, - { 158, 109, 59 }, - { 157, 108, 59 }, - { 156, 107, 59 }, - { 155, 107, 59 }, - { 154, 106, 59 }, - { 153, 105, 59 }, - { 152, 104, 59 }, - { 151, 104, 58 }, - { 150, 103, 58 }, - { 150, 102, 58 }, - { 149, 101, 58 }, - { 148, 101, 58 }, - { 147, 100, 58 }, - { 146, 99, 58 }, - { 145, 98, 58 }, - { 144, 98, 58 }, - { 143, 97, 58 }, - { 142, 96, 58 }, - { 141, 96, 58 }, - { 140, 95, 58 }, - { 139, 94, 58 }, - { 138, 94, 58 }, - { 137, 93, 58 }, - { 136, 92, 58 }, - { 135, 92, 57 }, - { 134, 91, 57 }, - { 133, 90, 57 }, - { 132, 90, 57 }, - { 131, 89, 57 }, - { 130, 88, 57 }, - { 129, 88, 57 }, - { 128, 87, 57 }, - { 127, 86, 57 }, - { 126, 86, 57 }, - { 125, 85, 56 }, - { 124, 84, 56 }, - { 123, 84, 56 }, - { 122, 83, 56 }, - { 121, 83, 56 }, - { 120, 82, 56 }, - { 119, 81, 56 }, - { 118, 81, 56 }, - { 117, 80, 55 }, - { 116, 79, 55 }, - { 115, 79, 55 }, - { 114, 78, 55 }, - { 113, 78, 55 }, - { 112, 77, 55 }, - { 111, 76, 54 }, - { 110, 76, 54 }, - { 109, 75, 54 }, - { 108, 75, 54 }, - { 107, 74, 53 }, - { 106, 73, 53 }, - { 105, 73, 53 }, - { 103, 72, 53 }, - { 102, 72, 53 }, - { 101, 71, 52 }, - { 100, 70, 52 }, - { 99, 70, 52 }, - { 98, 69, 52 }, - { 97, 69, 51 }, - { 96, 68, 51 }, - { 95, 67, 51 }, - { 94, 67, 51 }, - { 93, 66, 50 }, - { 92, 66, 50 }, - { 91, 65, 50 }, - { 90, 65, 49 }, - { 89, 64, 49 }, - { 88, 63, 49 }, - { 87, 63, 48 }, - { 86, 62, 48 }, - { 85, 62, 48 }, - { 84, 61, 48 }, - { 83, 60, 47 }, - { 82, 60, 47 }, - { 81, 59, 47 }, - { 80, 59, 46 }, - { 79, 58, 46 }, - { 78, 57, 46 }, - { 77, 57, 45 }, - { 75, 56, 45 }, - { 74, 56, 44 }, - { 73, 55, 44 }, - { 72, 54, 44 }, - { 71, 54, 43 }, - { 70, 53, 43 }, - { 69, 53, 43 }, - { 68, 52, 42 }, - { 67, 51, 42 }, - { 66, 51, 41 }, - { 65, 50, 41 }, - { 64, 50, 41 }, - { 63, 49, 40 }, - { 62, 48, 40 }, - { 61, 48, 39 }, - { 60, 47, 39 }, - { 59, 47, 39 }, - { 58, 46, 38 }, - { 57, 45, 38 }, - { 56, 45, 37 }, - { 55, 44, 37 }, - { 54, 43, 36 }, - { 53, 43, 36 }, - { 52, 42, 36 }, - { 51, 42, 35 }, - { 50, 41, 35 }, - { 49, 40, 34 }, - { 48, 40, 34 }, - { 47, 39, 33 }, - { 46, 38, 33 }, - { 45, 38, 32 }, - { 44, 37, 32 }, - { 43, 36, 31 }, - { 42, 36, 31 }, - { 41, 35, 31 }, - { 40, 35, 30 }, - { 39, 34, 30 }, - { 38, 33, 29 }, - { 37, 33, 29 }, - { 36, 32, 28 }, - { 35, 31, 28 }, - { 34, 31, 27 } - - }; - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Turbo.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Turbo.cs deleted file mode 100644 index 71b565338..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Turbo.cs +++ /dev/null @@ -1,76 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Turbo : IColourMap - { - public string Name => "Turbo"; - - public (byte r, byte g, byte b) GetRGB(byte value) - { - byte[] bytes = BitConverter.GetBytes(argb[value]); - return (bytes[2], bytes[1], bytes[0]); - } - - private readonly int[] argb = - { - -13559489, -13493436, -13427382, -13361328, -13295018, -13228964, -13162911, -13096857, - -13030547, -12964493, -12898440, -12832130, -12766077, -12700023, -12633970, -12567660, - -12501607, -12435554, -12369245, -12303192, -12237139, -12171086, -12170313, -12104260, - -12038208, -12037436, -11971383, -11905331, -11904559, -11838507, -11837991, -11771940, - -11771168, -11770653, -11770138, -11703831, -11703316, -11702801, -11702287, -11701517, - -11701003, -11700489, -11765255, -11764742, -11764228, -11828995, -11828482, -11893506, - -11892737, -11957761, -12022785, -12022017, -12087042, -12152067, -12217092, -12347397, - -12412423, -12477448, -12542218, -12672780, -12737806, -12802577, -12933139, -12998166, - -13128729, -13193500, -13324063, -13389091, -13519654, -13584682, -13714989, -13780017, - -13910581, -13975609, -14106173, -14171201, -14301765, -14366793, -14431822, -14562386, - -14627414, -14692442, -14757471, -14822499, -14887527, -14952556, -14952048, -15017332, - -15082361, -15081853, -15147137, -15146629, -15146121, -15145869, -15145361, -15145109, - -15079065, -15078812, -15013024, -15012515, -14946726, -14880938, -14749356, -14683567, - -14617778, -14486453, -14355127, -14223801, -14092475, -13961405, -13764543, -13633217, - -13436355, -13239748, -13108422, -12911559, -12714952, -12518089, -12255946, -12059339, - -11862476, -11600333, -11403725, -11141582, -10879182, -10682575, -10420431, -10158287, - -09896143, -09633999, -09372111, -09175503, -08913359, -08651215, -08389327, -08127183, - -07865294, -07603150, -07341262, -07079117, -06817229, -06555341, -06293452, -06031308, - -05834955, -05573067, -05311178, -05114826, -04852937, -04656585, -04394952, -04198600, - -04002247, -03740358, -03544262, -03347910, -03217349, -03020997, -02824900, -02628804, - -02497987, -02301891, -02171331, -02040770, -01910210, -01779394, -01648834, -01518273, - -01387713, -01257153, -01126849, -01061824, -00931264, -00866240, -00801216, -00670656, - -00605888, -00540864, -00475840, -00411072, -00346048, -00346560, -00281792, -00282304, - -00217536, -00218048, -00153280, -00153793, -00154561, -00155073, -00155841, -00156354, - -00157122, -00157634, -00158403, -00224451, -00225219, -00291524, -00292036, -00358341, - -00424389, -00490694, -00491206, -00557511, -00623559, -00755400, -00821705, -00887754, - -00954058, -01085643, -01151948, -01283533, -01349837, -01481422, -01613263, -01679312, - -01811153, -01942738, -02074579, -02206164, -02337749, -02469590, -02601175, -02733016, - -02930137, -03061978, -03193563, -03390940, -03522526, -03654111, -03851488, -03983073, - -04180450, -04377572, -04509157, -04706534, -04838119, -05035497, -05232618, -05429739, - -05561580, -05758702, -05956079, -06153200, -06350322, -06482163, -06679284, -06876662, - -07073783, -07270904, -07468282, -07665403, -07862524, -08059902, -08257023, -08388608, - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Viridis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Viridis.cs deleted file mode 100644 index 197ed76a6..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Colour Maps/Viridis.cs +++ /dev/null @@ -1,76 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Viridis : IColourMap - { - public string Name => "Viridis"; - - public (byte r, byte g, byte b) GetRGB(byte value) - { - byte[] bytes = BitConverter.GetBytes(rgb[value]); - return (bytes[2], bytes[1], bytes[0]); - } - - private readonly int[] rgb = - { - 04456788, 04457045, 04457303, 04523352, 04523610, 04524123, 04589916, 04590430, - 04590687, 04591201, 04656994, 04657507, 04657765, 04658278, 04658535, 04658793, - 04659306, 04725099, 04725356, 04725870, 04726127, 04726384, 04726897, 04727154, - 04727411, 04727668, 04662645, 04662902, 04663159, 04663416, 04663929, 04664186, - 04664443, 04599164, 04599676, 04599933, 04600190, 04534911, 04535423, 04535680, - 04535937, 04470657, 04471170, 04405891, 04406147, 04406404, 04341124, 04341381, - 04341893, 04276614, 04276870, 04211591, 04211847, 04146567, 04147080, 04081800, - 04082057, 04016777, 04017033, 04017289, 03952010, 03952266, 03887242, 03887498, - 03822219, 03822475, 03757195, 03757451, 03692171, 03692428, 03627148, 03627404, - 03562124, 03562380, 03497100, 03497356, 03432077, 03432333, 03367053, 03367309, - 03302029, 03302285, 03237005, 03237261, 03237517, 03172237, 03172493, 03107213, - 03107469, 03042190, 03042446, 03042702, 02977422, 02977678, 02912398, 02912654, - 02912910, 02847630, 02847886, 02782606, 02782862, 02783118, 02717838, 02718094, - 02652814, 02652814, 02653070, 02587790, 02588046, 02588302, 02523022, 02523278, - 02523534, 02458254, 02458509, 02393229, 02393485, 02393741, 02328461, 02328717, - 02328973, 02263437, 02263693, 02263949, 02198669, 02198924, 02199180, 02133900, - 02134156, 02134412, 02069132, 02069387, 02069643, 02069899, 02070155, 02004874, - 02005130, 02005386, 02005386, 02005641, 02005897, 02006153, 02006408, 02006664, - 02006920, 02007175, 02072967, 02073222, 02073478, 02139269, 02139525, 02205317, - 02205572, 02271108, 02336899, 02337154, 02402946, 02468737, 02534529, 02600320, - 02666111, 02731903, 02797694, 02863485, 02929021, 03060348, 03126139, 03191930, - 03323258, 03389049, 03520376, 03586167, 03717494, 03783030, 03914357, 04045684, - 04111475, 04242802, 04374129, 04505200, 04570991, 04702318, 04833645, 04964972, - 05096043, 05227369, 05358696, 05490023, 05621350, 05752421, 05883748, 06015074, - 06211937, 06343008, 06474335, 06605661, 06802524, 06933595, 07064921, 07196248, - 07392854, 07524181, 07655508, 07852114, 07983441, 08180303, 08311374, 08508236, - 08639307, 08836169, 08967495, 09164102, 09295428, 09492035, 09623361, 09819967, - 09951294, 10147900, 10344762, 10475832, 10672695, 10869301, 11000627, 11197234, - 11394096, 11525166, 11722028, 11918635, 12049705, 12246567, 12443174, 12574500, - 12771106, 12967713, 13099039, 13295646, 13492253, 13623580, 13820187, 13951258, - 14148121, 14344728, 14475800, 14672664, 14803736, 15000344, 15197209, 15328281, - 15524890, 15656219, 15852828, 15983902, 16180767, 16311841, 16442914, 16639780, - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/ColourMap.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/ColourMap.cs deleted file mode 100644 index ac3e8f0b4..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/ColourMap.cs +++ /dev/null @@ -1,268 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class ColourMap - { - public static ColourMap Algae => new ColourMap(new Algae()); - public static ColourMap Amp => new ColourMap(new Amp()); - public static ColourMap Balance => new ColourMap(new Balance()); - public static ColourMap Blues => new ColourMap(new Blues()); - public static ColourMap Curl => new ColourMap(new Curl()); - public static ColourMap Deep => new ColourMap(new Deep()); - public static ColourMap Delta => new ColourMap(new Delta()); - public static ColourMap Dense => new ColourMap(new Dense()); - public static ColourMap Diff => new ColourMap(new Diff()); - public static ColourMap Grayscale => new ColourMap(new Grayscale()); - public static ColourMap GrayscaleR => new ColourMap(new GrayscaleR()); - public static ColourMap Greens => new ColourMap(new Greens()); - public static ColourMap Haline => new ColourMap(new Haline()); - public static ColourMap Ice => new ColourMap(new Ice()); - public static ColourMap Inferno => new ColourMap(new Inferno()); - public static ColourMap Jet => new ColourMap(new Jet()); - public static ColourMap Magma => new ColourMap(new Magma()); - public static ColourMap Matter => new ColourMap(new Matter()); - public static ColourMap Oxy => new ColourMap(new Oxy()); - public static ColourMap Phase => new ColourMap(new Phase()); - public static ColourMap Plasma => new ColourMap(new Plasma()); - public static ColourMap Rain => new ColourMap(new Rain()); - public static ColourMap Solar => new ColourMap(new Solar()); - public static ColourMap Speed => new ColourMap(new Speed()); - public static ColourMap Tarn => new ColourMap(new Tarn()); - public static ColourMap Tempo => new ColourMap(new Tempo()); - public static ColourMap Thermal => new ColourMap(new Thermal()); - public static ColourMap Topo => new ColourMap(new Topo()); - public static ColourMap Turbid => new ColourMap(new Turbid()); - public static ColourMap Turbo => new ColourMap(new Turbo()); - public static ColourMap Viridis => new ColourMap(new Viridis()); - - private readonly IColourMap ThisColourMap; - - /// - /// Name of this colormap - /// - public string Name => ThisColourMap.Name; - - private static readonly ColourMapFactory ColourMapFactory = new ColourMapFactory(); - - public ColourMap(IColourMap colormap) - { - ThisColourMap = colormap ?? ColourMapFactory.GetDefaultColourMap(); - } - - public override string ToString() => $"Colormap {Name}"; - - /// - /// Create new instances of every colormap and return them as an array. - /// - /// - public static ColourMap[] GetColourMaps() => ColourMapFactory.GetAvailableColourMaps().ToArray(); - - /// - /// Return the names of all available - /// - /// - public static string[] GetColormapNames() => ColourMapFactory.GetAvailableNames().ToArray(); - - /// - /// Create a new colormap by its name. - /// - /// colormap name - /// if false the default colormap (Viridis) will be returned - /// - public static ColourMap GetColormapByName(string name, bool throwIfNotFound = true) => - throwIfNotFound ? ColourMapFactory.CreateOrThrow(name) : ColourMapFactory.CreateOrDefault(name); - - public (byte r, byte g, byte b) GetRGB(byte value) => ThisColourMap.GetRGB(value); - - public (byte r, byte g, byte b) GetRGB(double fraction) - { - fraction = Math.Max(fraction, 0); - fraction = Math.Min(fraction, 1); - return ThisColourMap.GetRGB((byte)(fraction * 255)); - } - - public int GetInt32(byte value, byte alpha = 255) - { - var (r, g, b) = GetRGB(value); - return alpha << 24 | r << 16 | g << 8 | b; - } - - public int GetInt32(double fraction, byte alpha = 255) - { - var (r, g, b) = GetRGB(fraction); - return alpha << 24 | r << 16 | g << 8 | b; - } - - public Color GetColor(byte value, double alpha = 1.0) - { - byte alphaByte = (byte)(255 * alpha); - return Color.FromArgb(GetInt32(value, alphaByte)); - } - - public Color GetColor(double fraction, double alpha = 1.0) - { - byte alphaByte = (byte)(255 * alpha); - return Color.FromArgb(GetInt32(fraction, alphaByte)); - } - - public Color RandomColor(Random rand, double alpha = 1.0) - { - byte alphaByte = (byte)(255 * alpha); - return Color.FromArgb(GetInt32(rand.NextDouble(), alphaByte)); - } - - public void Apply(Bitmap bmp) - { - ColorPalette pal = bmp.Palette; - for (int i = 0; i < 256; i++) - { - pal.Entries[i] = GetColor((byte)i); - } - - bmp.Palette = pal; - } - - public static byte[,] IntenstitiesToRGB(double[] intensities, IColourMap cmap) - { - byte[,] output = new byte[intensities.Length, 3]; - for (int i = 0; i < intensities.Length; i++) - { - double intensity = intensities[i] * 255; - byte pixelIntensity = (byte)Math.Max(Math.Min(intensity, 255), 0); - var (r, g, b) = cmap.GetRGB(pixelIntensity); - output[i, 0] = r; - output[i, 1] = g; - output[i, 2] = b; - } - return output; - } - - public static int[] GetRGBAs(double[] intensities, ColourMap colorMap, double minimumIntensity = 0) - { - int[] rgbas = new int[intensities.Length]; - for (int i = 0; i < intensities.Length; i++) - { - byte pixelIntensity = (byte)Math.Max(Math.Min(intensities[i] * 255, 255), 0); - var (r, g, b) = colorMap.GetRGB(pixelIntensity); - byte alpha = intensities[i] < minimumIntensity ? (byte)0 : (byte)255; - byte[] argb = { b, g, r, alpha }; - rgbas[i] = BitConverter.ToInt32(argb, 0); - } - return rgbas; - } - - public static int[] GetRGBAs(double?[] intensities, ColourMap colorMap, double minimumIntensity = 0) - { - int[] rgbas = new int[intensities.Length]; - for (int i = 0; i < intensities.Length; i++) - { - if (intensities[i].HasValue) - { - byte pixelIntensity = (byte)Math.Max(Math.Min(intensities[i].Value * 255, 255), 0); - var (r, g, b) = colorMap.GetRGB(pixelIntensity); - byte alpha = intensities[i] < minimumIntensity ? (byte)0 : (byte)255; - byte[] argb = { b, g, r, alpha }; - rgbas[i] = BitConverter.ToInt32(argb, 0); - } - else - { - byte[] argb = { 0, 0, 0, 0 }; - rgbas[i] = BitConverter.ToInt32(argb, 0); - } - } - return rgbas; - } - - public static Color[] GetColours(double[] intensities, ColourMap colorMap) - { - Color[] colors = new Color[intensities.Length]; - for (int i = 0; i < intensities.Length; i++) - { - byte pixelIntensity = (byte)Math.Max(Math.Min(intensities[i] * 255, 255), 0); - var (r, g, b) = colorMap.GetRGB(pixelIntensity); - colors[i] = Color.FromArgb(255, r, g, b); - } - return colors; - } - - /// - /// Return a bitmap showing the gradient of colors in a colormap. - /// Defining min/max will create an image containing only part of the colormap. - /// - public static Bitmap Colorbar(ColourMap cmap, int width, int height, bool vertical = false, double min = 0, double max = 1) - { - if (width < 1 || height < 1) - { - return null; - } - - if (min < 0) - { - throw new ArgumentException($"{nameof(min)} must be >= 0"); - } - - if (max > 1) - { - throw new ArgumentException($"{nameof(max)} must be <= 1"); - } - - if (min >= max) - { - throw new ArgumentException($"{nameof(min)} must < {nameof(max)}"); - } - - Bitmap bmp = new(width, height); - using Graphics gfx = Graphics.FromImage(bmp); - using Pen pen = new(Color.Magenta); - - if (vertical) - { - for (int y = 0; y < height; y++) - { - double fraction = (double)y / (height); - fraction = fraction * (max - min) + min; - pen.Color = cmap.GetColor(fraction); - gfx.DrawLine(pen, 0, height - y - 1, width - 1, height - y - 1); - } - } - else - { - for (int x = 0; x < width; x++) - { - double fraction = (double)x / width; - fraction = fraction * (max - min) + min; - pen.Color = cmap.GetColor(fraction); - gfx.DrawLine(pen, x, 0, x, height - 1); - } - } - - return bmp; - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/ColourMapFactory.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/ColourMapFactory.cs deleted file mode 100644 index f69ee8bb1..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/ColourMapFactory.cs +++ /dev/null @@ -1,99 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class ColourMapFactory - { - private readonly Dictionary> ColourMaps = - new Dictionary>() - { - { "Algae", () => new Algae()}, - { "Amp", () => new Amp()}, - { "Balance", () => new Balance()}, - { "Blues", () => new Blues()}, - { "Curl", () => new Curl()}, - { "Deep", () => new Deep()}, - { "Delta", () => new Delta()}, - { "Dense", () => new Dense()}, - { "Diff", () => new Diff()}, - { "Grayscale", () => new Grayscale()}, - { "GrayscaleR", () => new GrayscaleR()}, - { "Greens", () => new Greens()}, - { "Haline", () => new Haline()}, - { "Ice", () => new Ice()}, - { "Inferno", () => new Inferno()}, - { "Jet", () => new Jet()}, - { "Magma", () => new Magma()}, - { "Matter", () => new Matter()}, - { "Oxy", () => new Oxy()}, - { "Phase", () => new Phase()}, - { "Plasma", () => new Plasma()}, - { "Rain", () => new Rain()}, - { "Solar", () => new Solar()}, - { "Speed", () => new Speed()}, - { "Tarn", () => new Tarn()}, - { "Tempo", () => new Tempo()}, - { "Thermal", () => new Thermal()}, - { "Topo", () => new Topo()}, - { "Turbid", () => new Turbid()}, - { "Turbo", () => new Turbo()}, - { "Viridis", () => new Viridis()}, - }; - - public IColourMap GetDefaultColourMap() => new Grayscale(); - - public ColourMap CreateOrDefault(string Name) - { - if (ColourMaps.TryGetValue(Name, out Func cmap)) - { - return new ColourMap(cmap()); - } - else - { - return new ColourMap(GetDefaultColourMap()); - } - } - - public ColourMap CreateOrThrow(string Name) - { - if (ColourMaps.TryGetValue(Name, out Func cmap)) - { - return new ColourMap(cmap()); - } - else - { - throw new ArgumentOutOfRangeException($"No colormap with name '{Name}'"); - } - } - - public IEnumerable GetAvailableNames() => ColourMaps.Keys; - - public IEnumerable GetAvailableColourMaps() => - ColourMaps.Values.Select(f => new ColourMap(f())); - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Font.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Font.cs deleted file mode 100644 index 14731bb97..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Font.cs +++ /dev/null @@ -1,47 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Font - { - public float Size = 12; - public Color Color = Color.Black; - public Alignment Alignment = Alignment.UpperLeft; - public bool Bold = false; - public float Rotation = 0; - - private string _Name; - public string Name - { - get => _Name; - set => _Name = InstalledFont.ValidFontName(value); // ensure only valid font names can be assigned - } - - public Font() => Name = InstalledFont.Sans(); - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/GDI.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/GDI.cs deleted file mode 100644 index 8a86e9031..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/GDI.cs +++ /dev/null @@ -1,348 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public static class GDI - { - private const float X_MULTIPLIER_LINUX = 1; - private const float Y_MULTIPLIER_LINUX = 27.16f / 22; - - private const float X_MULTIPLIER_MACOS = 82.82f / 72; - private const float Y_MULTIPLIER_MACOS = 27.16f / 20; - - /// - /// Return the display scale ratio being used. - /// A scaling ratio of 1.0 means scaling is not active. - /// - public static float GetScaleRatio() - { - const int DEFAULT_DPI = 96; - using Bitmap bmp = new(1, 1); - using Graphics gfx = Graphics(bmp); - return gfx.DpiX / DEFAULT_DPI; - } - - public static SizeF MeasureString(string text, Font font) - { - using (Bitmap bmp = new Bitmap(1, 1)) - { - using (Graphics gfx = Graphics(bmp, lowQuality: true)) - { - return MeasureString(gfx, text, font.Name, font.Size, font.Bold); - } - } - } - - public static SizeF MeasureString(Graphics gfx, string text, string fontName, double fontSize, bool bold = false) - { - var fontStyle = (bold) ? FontStyle.Bold : FontStyle.Regular; - using (var font = new System.Drawing.Font(fontName, (float)fontSize, fontStyle, GraphicsUnit.Pixel)) - { - return MeasureString(gfx, text, font); - } - } - - public static SizeF MeasureString(Graphics gfx, string text, System.Drawing.Font font) - { - SizeF size = gfx.MeasureString(text, font); - - // compensate for OS-specific differences in font scaling - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - size.Width *= X_MULTIPLIER_LINUX; - size.Height *= Y_MULTIPLIER_LINUX; - } - else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - { - size.Width *= X_MULTIPLIER_MACOS; - size.Height *= Y_MULTIPLIER_MACOS; - } - - // ensure the measured height is at least the font size - size.Height = Math.Max(font.Size, size.Height); - - return size; - } - - public static Color Mix(Color colorA, Color colorB, double fracA) - { - byte r = (byte)((colorA.R * (1 - fracA)) + colorB.R * fracA); - byte g = (byte)((colorA.G * (1 - fracA)) + colorB.G * fracA); - byte b = (byte)((colorA.B * (1 - fracA)) + colorB.B * fracA); - return Color.FromArgb(r, g, b); - } - - public static Color Mix(string hexA, string hexB, double fracA) - { - var colorA = ColorTranslator.FromHtml(hexA); - var colorB = ColorTranslator.FromHtml(hexB); - return Mix(colorA, colorB, fracA); - } - - public static Graphics Graphics(Bitmap bmp, bool lowQuality = false, double scale = 1.0) - { - Graphics gfx = System.Drawing.Graphics.FromImage(bmp); - gfx.SmoothingMode = lowQuality ? SmoothingMode.HighSpeed : SmoothingMode.AntiAlias; - gfx.TextRenderingHint = lowQuality ? TextRenderingHint.SingleBitPerPixelGridFit : TextRenderingHint.AntiAliasGridFit; - gfx.ScaleTransform((float)scale, (float)scale); - return gfx; - } - - public static Graphics Graphics(Bitmap bmp, PlotDimensions dims, bool lowQuality = false, bool clipToDataArea = true) - { - Graphics gfx = Graphics(bmp, lowQuality, dims.ScaleFactor); - - if (clipToDataArea) - { - /* These dimensions are withdrawn by 1 pixel to leave room for a 1px wide data frame. - * Rounding is intended to exactly match rounding used when frame placement is determined. - */ - float left = (int)Math.Round(dims.DataOffsetX) + 1; - float top = (int)Math.Round(dims.DataOffsetY) + 1; - float width = (int)Math.Round(dims.DataWidth) - 1; - float height = (int)Math.Round(dims.DataHeight) - 1; - gfx.Clip = new Region(new RectangleF(left, top, width, height)); - } - - return gfx; - } - - public static Pen Pen(Color color, double width = 1, LineStyle lineStyle = LineStyle.Solid, bool rounded = false) - { - var pen = new Pen(color, (float)width); - - /* WARNING: Do NOT apply a solid DashPattern! - * Setting DashPattern automatically sets a pen's DashStyle to custom. - * Custom DashStyles are slower and can cause diagonal rendering artifacts. - * Instead use the solid DashStyle. - * https://github.com/ScottPlot/ScottPlot/issues/327 - * https://github.com/ScottPlot/ScottPlot/issues/401 - */ - switch (lineStyle) - { - case LineStyle.None: - pen.DashStyle = DashStyle.Solid; - break; - case LineStyle.Solid: - pen.DashStyle = DashStyle.Solid; - break; - case LineStyle.Dash: - pen.DashPattern = new[] { 8.0F, 4.0F }; - break; - case LineStyle.DashDot: - pen.DashPattern = new[] { 8.0F, 4.0F, 2.0F, 4.0F }; - break; - case LineStyle.DashDotDot: - pen.DashPattern = new[] { 8.0F, 4.0F, 2.0F, 4.0F, 2.0F, 4.0F }; - break; - case LineStyle.Dot: - pen.DashPattern = new[] { 2.0F, 4.0F }; - break; - default: - throw new NotImplementedException("line style not supported"); - } - - if (rounded) - { - pen.StartCap = LineCap.Round; - pen.EndCap = LineCap.Round; - pen.LineJoin = LineJoin.Round; - } - - return pen; - } - - public static Brush Brush(Color color, double alpha) => new SolidBrush(Color.FromArgb((byte)(255 * alpha), color)); - - public static Brush Brush(Color color, Color? hatchColor = null, HatchStyle hatchStyle = HatchStyle.None) - { - bool isHatched = hatchStyle != HatchStyle.None; - - if (isHatched) - { - if (hatchColor is null) - { - throw new ArgumentException("hatch color must be defined if hatch style is used"); - } - else -#pragma warning disable CS8629 // Nullable value type may be null. - { - return new HatchBrush(ConvertToSDHatchStyle(hatchStyle).Value, hatchColor.Value, color); - } -#pragma warning restore CS8629 // Nullable value type may be null. - } - else - { - return new SolidBrush(color); - } - } - - [Obsolete("use Brush()", true)] - public static Brush HatchBrush(HatchStyle pattern, Color fillColor, Color hatchColor) - { - if (pattern == HatchStyle.None) - { - return new SolidBrush(fillColor); - } - else - { - return new HatchBrush(ConvertToSDHatchStyle(pattern)!.Value, hatchColor, fillColor); - } - } - - public static System.Drawing.Drawing2D.HatchStyle? ConvertToSDHatchStyle(HatchStyle pattern) - { - switch (pattern) - { - case HatchStyle.StripedUpwardDiagonal: - return System.Drawing.Drawing2D.HatchStyle.LightUpwardDiagonal; - case HatchStyle.StripedDownwardDiagonal: - return System.Drawing.Drawing2D.HatchStyle.LightDownwardDiagonal; - case HatchStyle.StripedWideUpwardDiagonal: - return System.Drawing.Drawing2D.HatchStyle.WideUpwardDiagonal; - case HatchStyle.StripedWideDownwardDiagonal: - return System.Drawing.Drawing2D.HatchStyle.WideDownwardDiagonal; - case HatchStyle.LargeCheckerBoard: - return System.Drawing.Drawing2D.HatchStyle.LargeCheckerBoard; - case HatchStyle.SmallCheckerBoard: - return System.Drawing.Drawing2D.HatchStyle.SmallCheckerBoard; - case HatchStyle.LargeGrid: - return System.Drawing.Drawing2D.HatchStyle.LargeGrid; - case HatchStyle.SmallGrid: - return System.Drawing.Drawing2D.HatchStyle.SmallGrid; - case HatchStyle.DottedDiamond: - return System.Drawing.Drawing2D.HatchStyle.DottedDiamond; - - case HatchStyle.None: - default: - return null; - - } - } - - public static System.Drawing.Font Font(Font font) => - Font(font.Name, font.Size, font.Bold); - - public static System.Drawing.Font Font(string fontName = null, float fontSize = 12, bool bold = false) - { - string validFontName = InstalledFont.ValidFontName(fontName) ?? Font().SystemFontName; - FontStyle fontStyle = bold ? FontStyle.Bold : FontStyle.Regular; - return new System.Drawing.Font(validFontName, fontSize, fontStyle, GraphicsUnit.Pixel); - } - - public static StringFormat StringFormat(Alignment algnment) - { - return algnment switch - { - Alignment.UpperLeft => StringFormat(HorizontalAlignment.Left, VerticalAlignment.Upper), - Alignment.UpperCenter => StringFormat(HorizontalAlignment.Center, VerticalAlignment.Upper), - Alignment.UpperRight => StringFormat(HorizontalAlignment.Right, VerticalAlignment.Upper), - - Alignment.MiddleLeft => StringFormat(HorizontalAlignment.Left, VerticalAlignment.Middle), - Alignment.MiddleCenter => StringFormat(HorizontalAlignment.Center, VerticalAlignment.Middle), - Alignment.MiddleRight => StringFormat(HorizontalAlignment.Right, VerticalAlignment.Middle), - - Alignment.LowerLeft => StringFormat(HorizontalAlignment.Left, VerticalAlignment.Lower), - Alignment.LowerCenter => StringFormat(HorizontalAlignment.Center, VerticalAlignment.Lower), - Alignment.LowerRight => StringFormat(HorizontalAlignment.Right, VerticalAlignment.Lower), - - _ => throw new NotImplementedException(), - }; - } - - public static StringFormat StringFormat(HorizontalAlignment h = HorizontalAlignment.Left, VerticalAlignment v = VerticalAlignment.Lower) - { - var sf = new StringFormat(); - - switch (h) - { - case HorizontalAlignment.Left: - sf.Alignment = StringAlignment.Near; - break; - case HorizontalAlignment.Right: - sf.Alignment = StringAlignment.Far; - break; - case HorizontalAlignment.Center: - sf.Alignment = StringAlignment.Center; - break; - default: - throw new NotImplementedException(); - } - - switch (v) - { - case VerticalAlignment.Upper: - sf.LineAlignment = StringAlignment.Near; - break; - case VerticalAlignment.Lower: - sf.LineAlignment = StringAlignment.Far; - break; - case VerticalAlignment.Middle: - sf.LineAlignment = StringAlignment.Center; - break; - default: - throw new NotImplementedException(); - } - - return sf; - } - - public static Bitmap Resize(System.Drawing.Image bmp, int width, int height) - { - var bmp2 = new Bitmap(width, height); - var rect = new Rectangle(0, 0, width, height); - - using (var gfx = System.Drawing.Graphics.FromImage(bmp2)) - { - using (var attribs = new ImageAttributes()) - { - gfx.CompositingMode = CompositingMode.SourceCopy; - gfx.CompositingQuality = CompositingQuality.HighQuality; - gfx.InterpolationMode = InterpolationMode.HighQualityBicubic; - gfx.SmoothingMode = SmoothingMode.HighQuality; - gfx.PixelOffsetMode = PixelOffsetMode.HighQuality; - attribs.SetWrapMode(WrapMode.TileFlipXY); - gfx.DrawImage(bmp, rect, 0, 0, bmp.Width, bmp.Height, GraphicsUnit.Pixel, attribs); - } - } - - return bmp2; - } - - public static Color Semitransparent(Color color, double alpha) - { - return (alpha == 1) ? color : Color.FromArgb((int)(color.A * alpha), color); - } - - public static Color Semitransparent(string htmlColor, double alpha) - { - Color color = ColorTranslator.FromHtml(htmlColor); - return (alpha == 1) ? color : Color.FromArgb((int)(color.A * alpha), color); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/IColourMap.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/IColourMap.cs deleted file mode 100644 index 99534fc3e..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/IColourMap.cs +++ /dev/null @@ -1,35 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public interface IColourMap - { - (byte r, byte g, byte b) GetRGB(byte value); - string Name { get; } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/InstalledFont.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/InstalledFont.cs deleted file mode 100644 index 1a7da5077..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/InstalledFont.cs +++ /dev/null @@ -1,179 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public static class InstalledFont - { - public static string Default() => Sans(); - - public static string Serif() => - ValidFontName(new string[] { "Times New Roman", "DejaVu Serif", "Times" }); - - public static string Sans() => - ValidFontName(new string[] { "Segoe UI", "DejaVu Sans", "Helvetica" }); - - public static string Monospace() => - ValidFontName(new string[] { "Consolas", "DejaVu Sans Mono", "Courier" }); - - /// - /// Returns a font name guaranteed to be installed on the system - /// - public static string ValidFontName(string fontName) - { - foreach (FontFamily installedFont in FontFamily.Families) - { - if (string.Equals(installedFont.Name, fontName, StringComparison.OrdinalIgnoreCase)) - { - return installedFont.Name; - } - } - - return SystemFonts.DefaultFont.Name; - } - - /// - /// Returns a font name guaranteed to be installed on the system - /// - public static string ValidFontName(string[] fontNames) - { - foreach (string preferredFont in fontNames) - { - foreach (FontFamily font in FontFamily.Families) - { - if (string.Equals(preferredFont, font.Name, StringComparison.OrdinalIgnoreCase)) - { - return font.Name; - } - } - } - - return SystemFonts.DefaultFont.Name; - } - } -} - -/* - -These fonts are on Azure Pipelines on Linux: - Century Schoolbook L - DejaVu Sans - DejaVu Sans Mono - DejaVu Serif - Dingbats - Liberation Mono - Liberation Sans - Liberation Sans Narrow - Liberation Serif - Nimbus Mono L - Nimbus Roman No9 L - Nimbus Sans L - Standard Symbols L - URW Bookman L - URW Chancery L - URW Gothic L - URW Palladio L - - - -These fonts are on Azure Pipelines on MacOS: - Apple Braille - Apple Color Emoji - Apple SD Gothic Neo - Apple Symbols - Arial Hebrew - Arial Hebrew Scholar - Avenir - Avenir Next - Avenir Next Condensed - Courier - Geeza Pro - Geneva - Heiti SC - Heiti TC - Helvetica - Helvetica Neue - Hiragino Kaku Gothic Pro - Hiragino Kaku Gothic ProN - Hiragino Kaku Gothic Std - Hiragino Kaku Gothic StdN - Hiragino Maru Gothic Pro - Hiragino Maru Gothic ProN - Hiragino Mincho Pro - Hiragino Mincho ProN - Hiragino Sans - Hiragino Sans GB - Kohinoor Bangla - Kohinoor Devanagari - Kohinoor Telugu - Lucida Grande - Marker Felt - Menlo - Monaco - Noteworthy - Noto Nastaliq Urdu - Optima - Palatino - PingFang HK - PingFang SC - PingFang TC - Symbol - System Font - Thonburi - Times - Zapf Dingbats - System Font - .Apple Color Emoji UI - .Apple SD Gothic NeoI - .Aqua Kana - .Aqua Kana - .Arabic UI Display - .Arabic UI Text - .Arial Hebrew Desk Interface - .Geeza Pro Interface - .Geeza Pro PUA - .Helvetica LT MM - .Helvetica Neue DeskInterface - .Hiragino Kaku Gothic Interface - .Hiragino Sans GB Interface - .Keyboard - .LastResort - .Lucida Grande UI - .Noto Nastaliq Urdu UI - .PingFang HK - .PingFang SC - .PingFang TC - .SF Compact Display - .SF Compact Rounded - .SF Compact Text - .SF NS Display Condensed - .SF NS Rounded - .SF NS Symbols - .SF NS Text Condensed - .Times LT MM - -*/ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Palette.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Palette.cs deleted file mode 100644 index 0589140a7..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Palette.cs +++ /dev/null @@ -1,97 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /* This module will be retired in ScottPlot 5 in favor of ScottPlot.Palette */ - public class ScottPlotPalette - { - /* These properties have been included for backwards compatibility. - * They are named identical to members of the old enumeration with the same name as this class. - * This list does not have to be expanded as new palettes are added. - */ - public static ScottPlotPalette Aurora => new(new Aurora()); - public static ScottPlotPalette Category10 => new(new Category10()); - public static ScottPlotPalette Category20 => new(new Category20()); - public static ScottPlotPalette ColorblindFriendly => new(new ColourBlindFriendly()); - public static ScottPlotPalette Dark => new(new Dark()); - public static ScottPlotPalette DarkPastel => new(new DarkPastel()); - public static ScottPlotPalette Frost => new(new Frost()); - public static ScottPlotPalette Microcharts => new(new Microcharts()); - public static ScottPlotPalette Nord => new(new Nord()); - public static ScottPlotPalette OneHalf => new(new OneHalf()); - public static ScottPlotPalette OneHalfDark => new(new OneHalfDark()); - public static ScottPlotPalette PolarNight => new(new PolarNight()); - public static ScottPlotPalette SnowStorm => new(new Snowstorm()); - - private readonly IPalette cset; - public readonly string Name; - - public ScottPlotPalette(IPalette colorset) - { - cset = colorset ?? new Category10(); - Name = cset.GetType().Name; - } - - public ScottPlotPalette(string[] htmlColors, string name = "Custom") - { - cset = new Custom(htmlColors); - Name = name; - } - - public override string ToString() => Name; - - public int GetInt32(int index) - { - var (r, g, b) = cset.GetRGB(index); - return 255 << 24 | r << 16 | g << 8 | b; - } - - public Color GetColour(int index) - { - return Color.FromArgb(GetInt32(index)); - } - - public Color GetColor(int index, double alpha = 1) - { - return Color.FromArgb(alpha: (int)(alpha * 255), baseColor: GetColour(index)); - } - - public Color[]? GetColors(int count, int offset = 0, double alpha = 1) - { - return Enumerable.Range(offset, count) - .Select(x => GetColor(x, alpha)) - .ToArray(); - } - - // TODO: make this a property in ScottPlot 5 - public int Count() - { - return cset.Count(); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Tools.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Tools.cs deleted file mode 100644 index a0d7ad609..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Drawing/Tools.cs +++ /dev/null @@ -1,98 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot.Drawing -{ - public static class Tools - { - /// - /// Return Xs and Ys for 2 polygons representing the input data above and below the given baseline - /// - public static (double[] xs, double[] ysAbove, double[] ysBelow) PolyAboveAndBelow(double[] xs, double[] ys, double baseline) - { - if (xs.Length != ys.Length) - { - throw new ArgumentException("xs and ys must have same length"); - } - - double[] intersectionsX = new double[ys.Length - 1]; - double[] intersectionsY = new double[ys.Length - 1]; - for (int i = 0; i < intersectionsX.Length; i++) - { - intersectionsX[i] = double.NaN; - intersectionsY[i] = double.NaN; - - double x1 = xs[i]; - double y1 = ys[i]; - double x2 = xs[i + 1]; - double y2 = ys[i + 1]; - - if ((y1 <= baseline && y2 <= baseline) || (y1 >= baseline && y2 >= baseline)) - { - continue; - } - - double deltaX = x2 - x1; - double deltaY = y2 - y1; - - double y1diff = baseline - y1; - double y2diff = y2 - baseline; - double totalDiff = y1diff + y2diff; - double frac = y1diff / totalDiff; - intersectionsX[i] = x1 + deltaX * frac; - intersectionsY[i] = y1 + deltaY * frac; - } - - List polyXs = new List(); - List polyYs = new List(); - - polyXs.Add(xs.First()); - polyYs.Add(baseline); - - for (int i = 0; i < xs.Length; i++) - { - polyXs.Add(xs[i]); - polyYs.Add(ys[i]); - - if (i < intersectionsX.Length && !double.IsNaN(intersectionsX[i])) - { - polyXs.Add(intersectionsX[i]); - polyYs.Add(intersectionsY[i]); - } - } - - polyXs.Add(xs.Last()); - polyYs.Add(baseline); - - double[] xs2 = polyXs.ToArray(); - double[] ysAbove = polyYs.Select(x => Math.Max(x, baseline)).ToArray(); - double[] ysBelow = polyYs.Select(x => Math.Min(x, baseline)).ToArray(); - - return (xs2, ysAbove, ysBelow); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/Alignment.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/Alignment.cs deleted file mode 100644 index e0d64ceaf..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/Alignment.cs +++ /dev/null @@ -1,45 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Vertical (upper/middle/lower) and Horizontal (left/center/right) alignment - /// - public enum Alignment - { - UpperLeft, - UpperRight, - UpperCenter, - MiddleLeft, - MiddleCenter, - MiddleRight, - LowerLeft, - LowerRight, - LowerCenter - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/ArrowAnchor.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/ArrowAnchor.cs deleted file mode 100644 index 6f17fe1d6..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/ArrowAnchor.cs +++ /dev/null @@ -1,47 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public enum ArrowAnchor - { - /// - /// X/Y coordinates define the base of the arrow - /// - Base, - - /// - /// X/Y coordinates define the center of the arrow - /// - Center, - - /// - /// X/Y coordinates define the tip of the arrow - /// - Tip, - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/AxisOrientation.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/AxisOrientation.cs deleted file mode 100644 index 08e91662c..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/AxisOrientation.cs +++ /dev/null @@ -1,35 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public enum AxisOrientation - { - Vertical, - Horizontal - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/Cursor.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/Cursor.cs deleted file mode 100644 index c1a730658..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/Cursor.cs +++ /dev/null @@ -1,40 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public enum Cursor - { - Arrow, - CrossHair, - Hand, - WE, - NS, - All, - Question - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/DateTimeUnit.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/DateTimeUnit.cs deleted file mode 100644 index 54e0f78e8..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/DateTimeUnit.cs +++ /dev/null @@ -1,45 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public enum DateTimeUnit - { - ThousandYear, - HundredYear, - TenYear, - Year, - Month, - Day, - Hour, - Minute, - Second, - DeciSecond, - CentiSecond, - Millisecond - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/EqualScaleMode.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/EqualScaleMode.cs deleted file mode 100644 index 5c3b3e249..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/EqualScaleMode.cs +++ /dev/null @@ -1,72 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Defines if/how axis scales (units per pixel) are matched between horizontal and vertical axes. - /// - public enum EqualScaleMode - { - /// - /// Horizontal and vertical axes can be scaled independently. - /// Squares and circles may stretch to rectangles and ovals. - /// - Disabled, - - /// - /// Axis scales are locked so geometry of squares and circles is preserved. - /// After axes are set, the vertical scale (units per pixel) is applied to the horizontal axis. - /// - PreserveY, - - /// - /// Axis scales are locked so geometry of squares and circles is preserved. - /// After axes are set, the horizontal scale (units per pixel) is applied to the vertical axis. - /// - PreserveX, - - /// - /// Axis scales are locked so geometry of squares and circles is preserved. - /// After axes are set, the largest scale (most units per pixel) is applied to both axes. - /// Apply the most zoomed-out scale to both axes. - /// - ZoomOut, - - - /// - /// Apply the scale of the larger axis to both axes. - /// - PreserveLargest, - - - /// - /// Apply the scale of the smaller axis to both axes. - /// - PreserveSmallest - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/FillType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/FillType.cs deleted file mode 100644 index 5b320a82d..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/FillType.cs +++ /dev/null @@ -1,37 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public enum FillType - { - NoFill, - FillAbove, - FillBelow, - FillAboveAndBelow - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/HatchStyle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/HatchStyle.cs deleted file mode 100644 index 943f89419..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/HatchStyle.cs +++ /dev/null @@ -1,43 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public enum HatchStyle - { - None, - StripedUpwardDiagonal, - StripedDownwardDiagonal, - StripedWideUpwardDiagonal, - StripedWideDownwardDiagonal, - LargeCheckerBoard, - SmallCheckerBoard, - LargeGrid, - SmallGrid, - DottedDiamond - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/HorizontalAlignment.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/HorizontalAlignment.cs deleted file mode 100644 index baa43fbfc..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/HorizontalAlignment.cs +++ /dev/null @@ -1,36 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public enum HorizontalAlignment - { - Left, - Right, - Center - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/ImagePlacement.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/ImagePlacement.cs deleted file mode 100644 index 9d1112ef5..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/ImagePlacement.cs +++ /dev/null @@ -1,44 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Defines how an image will be placed in Radar and CoxComb charts - /// - public enum ImagePlacement - { - /// - /// Images will be aligned at the arms of the chart - /// - Outside, - /// - /// Images will be aligned halfway in the space between arms of the chart - /// - Inside - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/IntensityMode.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/IntensityMode.cs deleted file mode 100644 index 902efc047..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/IntensityMode.cs +++ /dev/null @@ -1,35 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public enum IntensityMode - { - Gaussian, - Density - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/LineStyle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/LineStyle.cs deleted file mode 100644 index b38b5e037..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/LineStyle.cs +++ /dev/null @@ -1,39 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public enum LineStyle - { - None, - Solid, - Dash, - DashDot, - DashDotDot, - Dot - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/MarkerShape.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/MarkerShape.cs deleted file mode 100644 index 248551277..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/MarkerShape.cs +++ /dev/null @@ -1,50 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public enum MarkerShape - { - // TODO: replace this with ScottPlot.Marker in the next major version of ScottPlot - None, - FilledCircle, - FilledSquare, - OpenCircle, - OpenSquare, - FilledDiamond, - OpenDiamond, - Asterisk, - HashTag, - Cross, - Eks, - VerticalBar, - TriUp, - TriDown, - } - - // TODO: add hex, binary, scientific notation, etc? -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/MinorTickDistribution.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/MinorTickDistribution.cs deleted file mode 100644 index b4257a99a..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/MinorTickDistribution.cs +++ /dev/null @@ -1,35 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public enum MinorTickDistribution - { - Even, - Log - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/PlotOrientation.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/PlotOrientation.cs deleted file mode 100644 index ccbd3cb9f..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/PlotOrientation.cs +++ /dev/null @@ -1,35 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public enum PlotOrientation - { - Horizontal, - Vertical - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/QualityMode.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/QualityMode.cs deleted file mode 100644 index 264fe5939..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/QualityMode.cs +++ /dev/null @@ -1,48 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public enum QualityMode - { - /// - /// Anti-aliasing always off - /// - Low, - - - /// - /// Anti-aliasing off while dragging (more responsive) but on otherwise - /// - LowWhileDragging, - - /// - /// Anti-aliasing always on - /// - High, - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/RadarAxis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/RadarAxis.cs deleted file mode 100644 index 57eb74048..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/RadarAxis.cs +++ /dev/null @@ -1,36 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public enum RadarAxis - { - Circle, - Polygon, - None - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/RadialGaugeMode.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/RadialGaugeMode.cs deleted file mode 100644 index 28ed02505..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/RadialGaugeMode.cs +++ /dev/null @@ -1,47 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public enum RadialGaugeMode - { - /// - /// Successive gauges start outward from the center but start at the same angle - /// - Stacked, - - /// - /// Successive gauges start outward from the center and start at sequential angles - /// - Sequential, - - /// - /// Gauges are all the same distance from the center but start at sequential angles - /// - SingleGauge - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/RenderType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/RenderType.cs deleted file mode 100644 index cf3b19dcc..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/RenderType.cs +++ /dev/null @@ -1,74 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Describes how a render should be performed with respect to quality. - /// High quality enables anti-aliasing but is slower. - /// Some options describe multiple renders, with or without a delay between them. - /// - public enum RenderType - - { - /// - /// Only render using low quality (anti-aliasing off) - /// - LowQuality, - - /// - /// Only render using high quality (anti-aliasing on) - /// - HighQuality, - - /// - /// Perform a high quality render after a delay. - /// This is the best render type to use when resizing windows. - /// - HighQualityDelayed, - - /// - /// Render low quality and display it, then if no new render requests - /// have been received immediately render a high quality version and display it. - /// This is the best render option to use when requesting renders programmatically - /// - LowQualityThenHighQuality, - - /// - /// Render low quality and display it, wait a small period of time for new render requests to arrive, - /// and if no new requests have been received render a high quality version and display it. - /// This is the best render option to use for mouse interaction. - /// - LowQualityThenHighQualityDelayed, - - /// - /// Process mouse events only (pan, zoom, etc) and do not render graphics on a Bitmap, - /// then if no new requests have been received render using the last-used render type. - /// - ProcessMouseEventsOnly, - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/TickLabelFormatOptions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/TickLabelFormatOptions.cs deleted file mode 100644 index 9a4f95e7b..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/TickLabelFormatOptions.cs +++ /dev/null @@ -1,35 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public enum TickLabelFormatOptions - { - Numeric, - DateTime - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/VerticalAlignment.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/VerticalAlignment.cs deleted file mode 100644 index f2ea5a245..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Enumerations/VerticalAlignment.cs +++ /dev/null @@ -1,36 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public enum VerticalAlignment - { - Upper, - Lower, - Middle - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Amber.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Amber.cs deleted file mode 100644 index c24ae4ebf..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Amber.cs +++ /dev/null @@ -1,40 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -/* Sourced from Material Design - * https://material.io/design/color/the-color-system.html - */ -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Amber : HexColourset, IPalette - { - public override string[] hexColors => new string[] - { - "#FF6F00","#FF8F00","#FFA000","#FFB300","#FFC107" - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Aurora.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Aurora.cs deleted file mode 100644 index d7197ee34..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Aurora.cs +++ /dev/null @@ -1,41 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -/* Sourced from Nord: - * https://github.com/arcticicestudio/nord - * https://www.nordtheme.com/docs/colors-and-palettes - */ -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Aurora : HexColourset, IPalette - { - public override string[] hexColors => new string[] - { - "#BF616A", "#D08770", "#EBCB8B", "#A3BE8C", "#B48EAD", - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Category10.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Category10.cs deleted file mode 100644 index d70200000..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Category10.cs +++ /dev/null @@ -1,38 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Category10 : HexColourset, IPalette - { - public override string[] hexColors => new string[] - { - "#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", - "#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf", - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Category20.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Category20.cs deleted file mode 100644 index 82537075e..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Category20.cs +++ /dev/null @@ -1,40 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Category20 : HexColourset, IPalette - { - public override string[] hexColors => new string[] - { - "#1f77b4", "#aec7e8", "#ff7f0e", "#ffbb78", "#2ca02c", - "#98df8a", "#d62728", "#ff9896", "#9467bd", "#c5b0d5", - "#8c564b", "#c49c94", "#e377c2", "#f7b6d2", "#7f7f7f", - "#c7c7c7", "#bcbd22", "#dbdb8d", "#17becf", "#9edae5", - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/ColourBlindFriendly.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/ColourBlindFriendly.cs deleted file mode 100644 index 616513ad5..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/ColourBlindFriendly.cs +++ /dev/null @@ -1,43 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -/* This color palette was sourced from the examples provided in: - * Wong 2011, https://www.nature.com/articles/nmeth.1618.pdf - * This 8-color palette has good overall variability and can be - * differentiated by individuals with red-green color blindness. - */ -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class ColourBlindFriendly : HexColourset, IPalette - { - public override string[] hexColors => new string[] - { - "#000000", "#E69F00", "#56B4E9", "#009E73", "#F0E442", - "#0072B2", "#D55E00", "#CC79A7", - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Custom.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Custom.cs deleted file mode 100644 index 82512b726..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Custom.cs +++ /dev/null @@ -1,49 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Custom : HexColourset, IPalette - { - public override string[] hexColors { get; } = new string[] { }; - - public Custom(string[] htmlColors) - { - if (htmlColors is null) - { - throw new ArgumentNullException("must provide at least one color"); - } - - if (htmlColors.Length == 0) - { - throw new ArgumentException("must provide at least one color"); - } - - hexColors = htmlColors; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Dark.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Dark.cs deleted file mode 100644 index e4142e10c..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Dark.cs +++ /dev/null @@ -1,38 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Dark : HexColourset, IPalette - { - public override string[] hexColors => new string[] - { - "#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e", - "#e6ab02","#a6761d","#666666", - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/DarkPastel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/DarkPastel.cs deleted file mode 100644 index f4ae3e79d..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/DarkPastel.cs +++ /dev/null @@ -1,38 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class DarkPastel : HexColourset, IPalette - { - public override string[] hexColors => new string[] - { - "#66c2a5", "#fc8d62", "#8da0cb", "#e78ac3", "#a6d854", - "#ffd92f", "#e5c494", "#b3b3b3", - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Frost.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Frost.cs deleted file mode 100644 index 4c2020c97..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Frost.cs +++ /dev/null @@ -1,41 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -/* Sourced from Nord: - * https://github.com/arcticicestudio/nord - * https://www.nordtheme.com/docs/colors-and-palettes - */ -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Frost : HexColourset, IPalette - { - public override string[] hexColors => new string[] - { - "#8FBCBB", "#88C0D0", "#81A1C1", "#5E81AC", - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/HexColourset.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/HexColourset.cs deleted file mode 100644 index 18d824ff9..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/HexColourset.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - // hex colorsets store web-formatted colors (e.g., '#FFAA66') in a string array. - - public abstract class HexColourset : IPalette - { - public (byte r, byte g, byte b) GetRGB(int index) - { - index %= hexColors.Length; - - string hexColor = hexColors[index]; - if (!hexColor.StartsWith("#")) - { - hexColor = $"#{hexColor}"; - } - - if (hexColor.Length != 7) - { - throw new InvalidOperationException("invalid hex color string"); - } - - Color color = ColorTranslator.FromHtml(hexColor); - - return (color.R, color.G, color.B); - } - - public int Count() => hexColors is null ? 0 : hexColors.Length; - - public abstract string[] hexColors { get; } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/IPalette.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/IPalette.cs deleted file mode 100644 index 92b1fe740..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/IPalette.cs +++ /dev/null @@ -1,43 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -/* - * A color set is a collection of colors, like a color palette. - * - * System.Drawing.Color is intentionally avoided here to simplify - * porting to other rendering systems down the road. - * - **/ - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public interface IPalette - { - (byte r, byte g, byte b) GetRGB(int index); - int Count(); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Microcharts.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Microcharts.cs deleted file mode 100644 index c7208e684..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Microcharts.cs +++ /dev/null @@ -1,39 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Microcharts : HexColourset, IPalette - { - public override string[] hexColors => new string[] - { - "#266489", "#68B9C0", "#90D585", "#F3C151", "#F37F64", - "#424856", "#8F97A4", "#DAC096", "#76846E", "#DABFAF", - "#A65B69", "#97A69D", - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Nero.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Nero.cs deleted file mode 100644 index b7c661220..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Nero.cs +++ /dev/null @@ -1,37 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Nero : HexColourset, IPalette - { - public override string[] hexColors => new string[] - { - "#013A20","#478C5C","#94C973","#BACC81","#CDD193" - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Nord.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Nord.cs deleted file mode 100644 index 050ac06d9..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Nord.cs +++ /dev/null @@ -1,42 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -/* Sourced from NordConEmu: - * https://github.com/arcticicestudio/nord-conemu - * Seems to be an extended version of Aurora - */ -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Nord : HexColourset, IPalette - { - // suggested background: #2e3440 - public override string[] hexColors => new string[] - { - "#bf616a", "#a3be8c", "#ebcb8b", "#81a1c1", "#b48ead", "#88c0d0", "#e5e9f0", - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/OneHalf.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/OneHalf.cs deleted file mode 100644 index 73c73367a..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/OneHalf.cs +++ /dev/null @@ -1,40 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -/* Sourced from Son A. Pham's Sublime color scheme by the same name - * https://github.com/sonph/onehalf - */ -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class OneHalf : HexColourset, IPalette - { - public override string[] hexColors => new string[] - { - "#383a42", "#e4564a", "#50a14f", "#c18402", "#0084bc", "#a626a4", "#0897b3" - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/OneHalfDark.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/OneHalfDark.cs deleted file mode 100644 index ceab7ea75..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/OneHalfDark.cs +++ /dev/null @@ -1,41 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -/* Sourced from Son A. Pham's Sublime color scheme by the same name - * https://github.com/sonph/onehalf - */ -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class OneHalfDark : HexColourset, IPalette - { - // suggested background: #2e3440 - public override string[] hexColors => new string[] - { - "#e06c75", "#98c379", "#e5c07b", "#61aff0", "#c678dd", "#56b6c2", "#dcdfe4" - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/PolarNight.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/PolarNight.cs deleted file mode 100644 index 7df924a04..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/PolarNight.cs +++ /dev/null @@ -1,41 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -/* Sourced from Nord: - * https://github.com/arcticicestudio/nord - * https://www.nordtheme.com/docs/colors-and-palettes - */ -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class PolarNight : HexColourset, IPalette - { - public override string[] hexColors => new string[] - { - "#2E3440", "#3B4252", "#434C5E", "#4C566A", - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Redness.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Redness.cs deleted file mode 100644 index d2a8748b1..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Redness.cs +++ /dev/null @@ -1,42 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -/* Sourced from Color Hex: - * https://www.color-hex.com/ - * https://www.color-hex.com/color-palette/616 - */ - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Redness : HexColourset, IPalette - { - public override string[] hexColors => new string[] - { - "#FF0000", "#FF4F00", "#FFA900", "#900303", "#FF8181" - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Snowstorm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Snowstorm.cs deleted file mode 100644 index 5475b5016..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Snowstorm.cs +++ /dev/null @@ -1,41 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -/* Sourced from Nord: - * https://github.com/arcticicestudio/nord - * https://www.nordtheme.com/docs/colors-and-palettes - */ -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Snowstorm : HexColourset, IPalette - { - public override string[] hexColors => new string[] - { - "#D8DEE9", "#E5E9F0", "#ECEFF4" - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/SummerSplash.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/SummerSplash.cs deleted file mode 100644 index 3245afe99..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/SummerSplash.cs +++ /dev/null @@ -1,37 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class SummerSplash : HexColourset, IPalette - { - public override string[] hexColors => new string[] - { - "#05445E", "#189AB4", "#75E6DA" , "#D4F1F4" - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Tsitsulin.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Tsitsulin.cs deleted file mode 100644 index 8d6ab5af4..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Palettes/Tsitsulin.cs +++ /dev/null @@ -1,47 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -/* A 25-color pelette based on Anton Tsitsulin's 12-color palette - * http://tsitsul.in/blog/coloropt - * https://github.com/xgfs/coloropt - */ -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Tsitsulin : HexColourset, IPalette - { - public override string[] hexColors => new string[] - { - "#ebac23", "#b80058", "#008cf9", "#006e00", "#00bbad", - "#d163e6", "#b24502", "#ff9287", "#5954d6", "#00c6f8", - "#878500", "#00a76c", - "#f6da9c", "#ff5caa", "#8accff", "#4bff4b", "#6efff4", - "#edc1f5", "#feae7c", "#ffc8c3", "#bdbbef", "#bdf2ff", - "#fffc43", "#65ffc8", - "#aaaaaa", - }; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plot/Plot.Add.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plot/Plot.Add.cs deleted file mode 100644 index 49b17b43b..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plot/Plot.Add.cs +++ /dev/null @@ -1,1175 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public partial class Plot - { - /// - /// Display text in the data area at a pixel location (not a X/Y coordinates) - /// - public Annotation AddAnnotation(string label, double x, double y) - { - var plottable = new Annotation() { Label = label, X = x, Y = y }; - Add(plottable); - return plottable; - } - - /// - /// Display an arrow pointing to a spot in coordinate space - /// - public ArrowCoordinated AddArrow(double xTip, double yTip, double xBase, double yBase, float lineWidth = 5, Color? color = null) - { - /* - double[] xs = { xBase, xTip }; - double[] ys = { yBase, yTip }; - var plottable = new ScatterPlot(xs, ys) - { - LineWidth = lineWidth, - MarkerSize = 0, - Color = color ?? GetNextColor(), - ArrowheadLength = 3, - ArrowheadWidth = 3 - }; - */ - var plottable = new ArrowCoordinated(xBase, yBase, xTip, yTip) - { - LineWidth = lineWidth, - Color = color ?? GetNextColor(), - }; - Add(plottable); - return plottable; - } - - /// - /// Add a Cleveland Dot plot for the given values. Cleveland Dots will be placed at X positions 0, 1, 2, etc. - /// - public ClevelandDotPlot AddClevelandDot(double[] ys1, double[] ys2) - { - double[] xs = DataGen.Consecutive(ys1.Length); - var plottable = new ClevelandDotPlot(xs, ys1, ys2); - Add(plottable); - return plottable; - } - - /// - /// Add a Cleveland Dot plot for the given values using defined dot positions. - /// - public ClevelandDotPlot AddClevelandDot(double[] ys1, double[] ys2, double[] positions) - { - var plottable = new ClevelandDotPlot(positions, ys1, ys2); - Add(plottable); - return plottable; - } - - /// - /// Add a Lollipop plot for the given values. Lollipops will be placed at X positions 0, 1, 2, etc. - /// - public LollipopPlot AddLollipop(double[] values, Color? color = null) - { - double[] xs = DataGen.Consecutive(values.Length); - var plottable = new LollipopPlot(xs, values) - { - LollipopColor = color ?? GetNextColor() - }; - Add(plottable); - return plottable; - } - - /// - /// Add a lollipop plot for the given values using defined lollipop positions - /// - public LollipopPlot AddLollipop(double[] values, double[] positions, Color? color = null) - { - var plottable = new LollipopPlot(positions, values) - { - LollipopColor = color ?? GetNextColor() - }; - Add(plottable); - return plottable; - } - - /// - /// Add a bar plot for the given values. Bars will be placed at X positions 0, 1, 2, etc. - /// - public BarPlot AddBar(double[] values, Color? color = null) - { - double[] xs = DataGen.Consecutive(values.Length); - var plottable = new BarPlot(xs, values, null, null) - { - FillColor = color ?? GetNextColor() - }; - Add(plottable); - return plottable; - } - - /// - /// Add a bar plot for the given values using defined bar positions - /// - public BarPlot AddBar(double[] values, double[] positions, Color? color = null) - { - var plottable = new BarPlot(positions, values, null, null) - { - FillColor = color ?? GetNextColor() - }; - Add(plottable); - return plottable; - } - - /// - /// Add a bar plot (values +/- errors) using defined positions - /// - public BarPlot AddBar(double[] values, double[]? errors, double[] positions, Color? color = null) - { - var plottable = new BarPlot(positions, values, errors, null) - { - FillColor = color ?? GetNextColor(), - FillColorNegative = color ?? GetNextColor(), - }; - Add(plottable); - return plottable; - } - - /// - /// Create a series of bar plots and customize the ticks and legend - /// - public BarPlot[] AddBarGroups(string[] groupLabels, string[] seriesLabels, double[][] ys, double[][] yErr) - { - if (groupLabels is null || seriesLabels is null || ys is null) - { - throw new ArgumentException("labels and ys cannot be null"); - } - - if (seriesLabels.Length != ys.Length) - { - throw new ArgumentException("groupLabels and ys must be the same length"); - } - - foreach (double[] subArray in ys) - { - if (subArray.Length != groupLabels.Length) - { - throw new ArgumentException("all arrays inside ys must be the same length as groupLabels"); - } - } - - double groupWidthFraction = 0.8; - double barWidthFraction = 0.8; - double errorCapSize = 0.38; - - int seriesCount = ys.Length; - double barWidth = groupWidthFraction / seriesCount; - BarPlot[] bars = new BarPlot[seriesCount]; - bool containsNegativeY = false; - for (int i = 0; i < seriesCount; i++) - { - double[] barYs = ys[i]; - double[]? barYerr = yErr?[i]; - double[] barXs = DataGen.Consecutive(barYs.Length); - containsNegativeY |= barYs.Where(y => y < 0).Any(); - var bar = new BarPlot(barXs, barYs, barYerr, null) - { - Label = seriesLabels[i], - BarWidth = barWidth * barWidthFraction, - PositionOffset = i * barWidth, - ErrorCapSize = errorCapSize, - FillColor = GetNextColor() - }; - bars[i] = bar; - Add(bar); - } - - if (containsNegativeY) - { - AxisAuto(); - } - - double[] groupPositions = DataGen.Consecutive(groupLabels.Length, offset: (groupWidthFraction - barWidth) / 2); - XTicks(groupPositions, groupLabels); - - return bars; - } - - /// - /// Add an empty bubble plot. Call it's Add() method to add bubbles with custom position and styling. - /// - public BubblePlot AddBubblePlot() - { - BubblePlot bubblePlot = new(); - Add(bubblePlot); - return bubblePlot; - } - - /// - /// Add a bubble plot with multiple bubbles at the given positions all styled the same. - /// Call the Add() method to add bubbles manually, allowing further customization of size and style. - /// - public BubblePlot AddBubblePlot(double[] xs, double[] ys, double radius = 10, Color? fillColor = null, double edgeWidth = 1, Color? edgeColor = null) - { - BubblePlot bubblePlot = new(); - bubblePlot.Add(xs, ys, radius, fillColor ?? GetNextColor(), edgeWidth, edgeColor ?? Color.Black); - Add(bubblePlot); - return bubblePlot; - } - - /// - /// Add candlesticks to the chart from OHLC (open, high, low, close) data - /// - public FinancePlot AddCandlesticks(OHLC[] ohlcs) - { - FinancePlot plottable = new FinancePlot(ohlcs) - { - Candle = true, - ColorUp = ColorTranslator.FromHtml("#26a69a"), - ColorDown = ColorTranslator.FromHtml("#ef5350"), - }; - Add(plottable); - return plottable; - } - - /// - /// Add a colorbar to display a colormap beside the data area - /// - /// Colormap to display in this colorbar - /// The size of the right axis will be set to this number of pixels to make room for the colorbar - /// the colorbar that was just created - public Colorbar AddColourbar(ColourMap? colormap = null, int space = 100) - { - var cb = new Colorbar(colormap); - Add(cb); - YAxis2.SetSizeLimit(min: space); - return cb; - } - - /// - /// Add a colorbar initialized with settings from a heatmap - /// - /// A heatmap-containing plottable to connect with this colorbar - /// The size of the right axis will be set to this number of pixels to make room for the colorbar - /// the colorbar that was just created - public Colorbar AddColourbar(IHasColormap heatmap, int space = 100) - { - var cb = new Colorbar(heatmap); - Add(cb); - YAxis2.SetSizeLimit(min: space); - return cb; - } - - /// - /// Add a crosshair to the plot - /// - /// position of vertical line (axis units) - /// position of horizontal line (axis units) - /// the crosshair that was just created - public Crosshair AddCrosshair(double x, double y) - { - Crosshair ch = new() { X = x, Y = y }; - Add(ch); - return ch; - } - - /// - /// Create a polygon to fill the area between Y values and a baseline. - /// - public Polygon AddFill(double[] xs, double[] ys, double baseline = 0, Color? color = null) - { - var plottable = new Polygon( - xs: Tools.Pad(xs, cloneEdges: true), - ys: Tools.Pad(ys, 1, baseline, baseline)) - { - Fill = true, - FillColor = color ?? GetNextColor(.5), - }; - Add(plottable); - return plottable; - } - - /// - /// Create a polygon to fill the area between two Y curves that share the same X positions. - /// - public Polygon AddFill(double[] xs, double[] ys1, double[] ys2, Color? color = null) - { - double[] polyXs = xs.Concat(xs.Reverse()).ToArray(); - double[] polyYs = ys1.Concat(ys2.Reverse()).ToArray(); - - var plottable = new Polygon(polyXs, polyYs) - { - Fill = true, - FillColor = color ?? GetNextColor(.5), - LineWidth = 0, - }; - - Add(plottable); - return plottable; - } - - /// - /// Create a polygon to fill the area between Y values of two curves. - /// - public Polygon AddFill(double[] xs1, double[] ys1, double[] xs2, double[] ys2, Color? color = null) - { - // combine xs and ys to make one big curve - int pointCount = xs1.Length + xs2.Length; - double[] bothX = new double[pointCount]; - double[] bothY = new double[pointCount]; - - // copy the first dataset as-is - Array.Copy(xs1, 0, bothX, 0, xs1.Length); - Array.Copy(ys1, 0, bothY, 0, ys1.Length); - - // copy the second dataset in reverse order - for (int i = 0; i < xs2.Length; i++) - { - bothX[xs1.Length + i] = xs2[xs2.Length - 1 - i]; - bothY[ys1.Length + i] = ys2[ys2.Length - 1 - i]; - } - - var plottable = new Polygon(bothX, bothY) - { - Fill = true, - FillColor = color ?? GetNextColor(.5), - }; - Add(plottable); - return plottable; - } - - /// - /// Create a polygon to fill the area between Y values and a baseline - /// that uses two different colors for area above and area below the baseline. - /// - public (Polygon polyAbove, Polygon polyBelow) AddFillAboveAndBelow(double[] xs, double[] ys, double baseline = 0, Color? colorAbove = null, Color? colorBelow = null) - { - var (xs2, ysAbove, ysBelow) = Drawing.Tools.PolyAboveAndBelow(xs, ys, baseline); - - var polyAbove = new Polygon(xs2, ysAbove) { FillColor = colorAbove ?? Color.Green }; - var polyBelow = new Polygon(xs2, ysBelow) { FillColor = colorBelow ?? Color.Red }; - Add(polyAbove); - Add(polyBelow); - - return (polyAbove, polyBelow); - } - - /// - /// Add a line plot that uses a function (rather than X/Y points) to place the curve - /// - public FunctionPlot AddFunction(Func function, Color? color = null, double lineWidth = 1, LineStyle lineStyle = LineStyle.Solid) - { - FunctionPlot plottable = new FunctionPlot(function) - { - Color = color ?? settings.GetNextColor(), - LineWidth = lineWidth, - LineStyle = lineStyle - }; - Add(plottable); - return plottable; - } - - /// - /// Add a heatmap to the plot automatically-sized so each cell is 1x1. - /// - /// 2D array of intensities. - /// WARNING: Rendering artifacts may appear for arrays larger than Bitmap can support (~10M total values). - /// - /// If true, AxisScaleLock() will be called to ensure heatmap cells will be square. - /// - /// Returns the heatmap that was added to the plot. - /// Act on its public fields and methods to customize it or update its data. - /// - public Heatmap AddHeatmap(double?[,] intensities, ColourMap colormap = null, bool lockScales = true) - { - var plottable = new Heatmap(); - plottable.Update(intensities, colormap); - Add(plottable); - - if (lockScales) - { - AxisScaleLock(true); - } - - return plottable; - } - - /// - /// Add a heatmap to the plot automatically-sized so each cell is 1x1. - /// - /// 2D array of intensities. - /// WARNING: Rendering artifacts may appear for arrays larger than Bitmap can support (~10M total values). - /// - /// If true, AxisScaleLock() will be called to ensure heatmap cells will be square. - /// - /// Returns the heatmap that was added to the plot. - /// Act on its public fields and methods to customize it or update its data. - /// - public Heatmap AddHeatmap(double[,] intensities, ColourMap colormap = null, bool lockScales = true) - { - var plottable = new Heatmap(); - plottable.Update(intensities, colormap); - Add(plottable); - - if (lockScales) - { - AxisScaleLock(true); - } - - return plottable; - } - - /// - /// Add heatmap to the plot stretched to fit the given dimensions. - /// Unlike the regular heatmap which gives each cell a size of 1x1 and starts at the axis origin, - /// this heatmap stretches the array so that it covers the defined X and Y spans. - /// - /// 2D array of intensities. - /// WARNING: Rendering artifacts may appear for arrays larger than Bitmap can support (~10M total values). - /// position of the left edge of the far left column - /// position of the left edge of the far right column - /// position of the upper edge of the bottom row - /// position of the upper edge of the top row - /// - /// - /// Returns the heatmap that was added to the plot. - /// Act on its public fields and methods to customize it or update its data. - /// - [Obsolete("This plot type has been deprecated. (min/max functionality now exists in Heatmap)")] - public CoordinatedHeatmap AddHeatmapCoordinated(double?[,] intensities, double? xMin = null, double? xMax = null, double? yMin = null, double? yMax = null, ColourMap colormap = null) - { - var plottable = new CoordinatedHeatmap(); - - // Solve all possible null combinations, if the boundaries are only partially provided use Step = 1; - if (xMin == null && xMax == null) - { - plottable.XMin = 0; - plottable.XMax = 0 + intensities.GetLength(0); - } - else if (xMin == null) - { - plottable.XMax = xMax.Value; - plottable.XMin = xMax.Value - intensities.GetLength(0); - } - else if (xMax == null) - { - plottable.XMin = xMin.Value; - plottable.XMax = xMin.Value + intensities.GetLength(0); - } - else - { - plottable.XMin = xMin.Value; - plottable.XMax = xMax.Value; - } - - if (yMin == null && yMax == null) - { - plottable.YMin = 0; - plottable.YMax = 0 + intensities.GetLength(1); - } - else if (yMin == null) - { - plottable.YMax = yMax.Value; - plottable.YMin = yMax.Value - intensities.GetLength(1); - } - else if (yMax == null) - { - plottable.YMin = yMin.Value; - plottable.YMax = yMin.Value + intensities.GetLength(1); - } - else - { - plottable.YMin = yMin.Value; - plottable.YMax = yMax.Value; - } - - plottable.Update(intensities, colormap); - Add(plottable); - - return plottable; - } - - /// - /// Add heatmap to the plot stretched to fit the given dimensions. - /// Unlike the regular heatmap which gives each cell a size of 1x1 and starts at the axis origin, - /// this heatmap stretches the array so that it covers the defined X and Y spans. - /// - /// 2D array of intensities. - /// WARNING: Rendering artifacts may appear for arrays larger than Bitmap can support (~10M total values). - /// position of the left edge of the far left column - /// position of the left edge of the far right column - /// position of the upper edge of the bottom row - /// position of the upper edge of the top row - /// - /// - /// Returns the heatmap that was added to the plot. - /// Act on its public fields and methods to customize it or update its data. - /// - [Obsolete("This plot type has been deprecated. Use a regular heatmap and modify its Offset and CellSize fields.")] - public CoordinatedHeatmap AddHeatmapCoordinated(double[,] intensities, double? xMin = null, double? xMax = null, double? yMin = null, double? yMax = null, ColourMap colormap = null) - { - var plottable = new CoordinatedHeatmap(); - - // Solve all possible null combinations, if the boundaries are only partially provided use Step = 1; - if (xMin == null && xMax == null) - { - plottable.XMin = 0; - plottable.XMax = 0 + intensities.GetLength(0); - } - else if (xMin == null) - { - plottable.XMax = xMax.Value; - plottable.XMin = xMax.Value - intensities.GetLength(0); - } - else if (xMax == null) - { - plottable.XMin = xMin.Value; - plottable.XMax = xMin.Value + intensities.GetLength(0); - } - else - { - plottable.XMin = xMin.Value; - plottable.XMax = xMax.Value; - } - - if (yMin == null && yMax == null) - { - plottable.YMin = 0; - plottable.YMax = 0 + intensities.GetLength(1); - } - else if (yMin == null) - { - plottable.YMax = yMax.Value; - plottable.YMin = yMax.Value - intensities.GetLength(1); - } - else if (yMax == null) - { - plottable.YMin = yMin.Value; - plottable.YMax = yMin.Value + intensities.GetLength(1); - } - else - { - plottable.YMin = yMin.Value; - plottable.YMax = yMax.Value; - } - - plottable.Update(intensities, colormap); - Add(plottable); - - return plottable; - } - - /// - /// Add a horizontal axis line at a specific Y position - /// - public HLine AddHorizontalLine(double y, Color? color = null, float width = 1, LineStyle style = LineStyle.Solid, string label = null) - { - HLine plottable = new HLine() - { - Y = y, - Color = color ?? settings.GetNextColor(), - LineWidth = width, - LineStyle = style, - Label = label, - }; - Add(plottable); - return plottable; - } - - /// - /// Add a horizontal span (shades the region between two X positions) - /// - public HSpan AddHorizontalSpan(double xMin, double xMax, Color? color = null, string label = null) - { - var plottable = new HSpan() - { - X1 = xMin, - X2 = xMax, - Color = color ?? GetNextColor(.5), - Label = label, - }; - Add(plottable); - return plottable; - } - - /// - /// Display an image at a specific coordinate - /// - public Image AddImage(Bitmap bitmap, double x, double y) - { - Image plottable = new Image() - { - Bitmap = bitmap, - X = x, - Y = y, - }; - - settings.Plottables.Add(plottable); - return plottable; - } - - /// - /// Add a line (a scatter plot with two points) to the plot - /// - public ScatterPlot AddLine(double x1, double y1, double x2, double y2, Color? color = null, float lineWidth = 1) - { - return AddScatter(new double[] { x1, x2 }, new double[] { y1, y2 }, color, lineWidth, 0); - } - - /// - /// Add a line (a scatter plot with two points) to the plot - /// - public ScatterPlot AddLine(double slope, double offset, (double x1, double x2) xLimits, Color? color = null, float lineWidth = 1) - { - double y1 = xLimits.x1 * slope + offset; - double y2 = xLimits.x2 * slope + offset; - return AddScatter(new double[] { xLimits.x1, xLimits.x2 }, new double[] { y1, y2 }, color, lineWidth, 0); - } - - /// - /// Add a marker at a specific X/Y position. - /// This method really creates a scatter plot with a single point. - /// - public MarkerPlot AddMarker(double x, double y, MarkerShape shape = MarkerShape.FilledCircle, double size = 10, Color? color = null, string label = null) - { - var plottable = new MarkerPlot() - { - X = x, - Y = y, - MarkerShape = shape, - MarkerSize = size, - Color = color ?? GetNextColor(), - Label = label, - }; - Add(plottable); - return plottable; - } - - /// - /// Add OHLC (open, high, low, close) data to the plot - /// - public FinancePlot AddOHLCs(OHLC[] ohlcs) - { - FinancePlot plottable = new FinancePlot(ohlcs) - { - Candle = false, - ColorUp = ColorTranslator.FromHtml("#26a69a"), - ColorDown = ColorTranslator.FromHtml("#ef5350"), - }; - Add(plottable); - return plottable; - } - - /// - /// Add a pie chart to the plot - /// - public PiePlot AddPie(double[] values, bool hideGridAndFrame = true) - { - Color[] colors = Enumerable.Range(0, values.Length) - .Select(i => settings.PlottablePalette.GetColor(i)) - .ToArray(); - - PiePlot pie = new PiePlot(values, null, colors); - Add(pie); - - if (hideGridAndFrame) - { - Grid(false); - Frameless(); - } - - return pie; - } - - /// - /// Add a point (a scatter plot with a single marker) - /// - /// - /// - /// color of the marker - /// size of the marker - /// maker shape - /// text to appear in the legend - /// - /// The scatter plot that was created and added to the plot. - /// Interact with its public fields and methods to customize style and update data. - /// - public MarkerPlot AddPoint(double x, double y, Color? color = null, float size = 5, MarkerShape shape = MarkerShape.FilledCircle, string label = null) - { - var plottable = new MarkerPlot() - { - X = x, - Y = y, - MarkerShape = shape, - MarkerSize = size, - Color = color ?? GetNextColor(), - Label = label, - }; - Add(plottable); - return plottable; - } - - /// - /// Add a polygon to the plot - /// - public Polygon AddPolygon(double[] xs, double[] ys, Color? fillColor = null, double lineWidth = 0, Color? lineColor = null) - { - var plottable = new Polygon(xs, ys) - { - LineWidth = lineWidth, - LineColor = lineColor ?? Color.Black, - FillColor = fillColor ?? settings.GetNextColor(), - }; - Add(plottable); - return plottable; - } - - /// - /// Add many polygons using an optimized rendering method - /// - public Polygons AddPolygons(List> polys, Color? fillColor = null, double lineWidth = 0, Color? lineColor = null) - { - var plottable = new Polygons(polys) - { - LineWidth = lineWidth, - LineColor = lineColor ?? Color.Black, - FillColor = fillColor ?? settings.GetNextColor(), - }; - Add(plottable); - return plottable; - } - - /// - /// Add a population to the plot - /// - public PopulationPlot AddPopulation(Population population, string label = null) - { - var plottable = new PopulationPlot(population, label, settings.GetNextColor()); - Add(plottable); - return plottable; - } - - /// - /// Add multiple populations to the plot as a single series - /// - public PopulationPlot AddPopulations(Population[] populations, string label = null) - { - var plottable = new PopulationPlot(populations, label, settings.GetNextColor()); - Add(plottable); - return plottable; - } - - /// - /// Add multiple populations to the plot as a single series - /// - public PopulationPlot AddPopulations(PopulationMultiSeries multiSeries) - { - for (int i = 0; i < multiSeries.multiSeries.Length; i++) - { - multiSeries.multiSeries[i].color = settings.PlottablePalette.GetColor(i); - } - - var plottable = new PopulationPlot(multiSeries); - Add(plottable); - return plottable; - } - - /// - /// Add a radar plot (a two-dimensional chart of three or more quantitative variables represented on axes starting from the same point) - /// - /// 2D array containing categories (columns) and groups (rows) - /// if true, axis (category) values are scaled independently - /// if provided, each category (column) is normalized to these values - /// also make the plot frameless and disable its grid - /// the radar plot that was just created and added to the plot - public RadarPlot AddRadar(double[,] values, bool independentAxes = false, double[] maxValues = null, bool disableFrameAndGrid = true) - { - - Color[] colors = Enumerable.Range(0, values.Length) - .Select(i => settings.PlottablePalette.GetColor(i)) - .ToArray(); - - Color[] fills = colors.Select(x => Color.FromArgb(50, x)).ToArray(); - - RadarPlot plottable = new(values, colors, fills, independentAxes, maxValues); - Add(plottable); - - if (disableFrameAndGrid) - { - Frameless(); - Grid(enable: false); - } - - return plottable; - } - - /// - /// Add a radial gauge plot (a chart where data is represented by concentric circular gauges) - /// - /// Array of gauge values - /// Also make the plot frameless and disable its grid - /// The radial gaugle plot that was just created and added to the plot - public RadialGaugePlot AddRadialGauge(double[] values, bool disableFrameAndGrid = true) - { - Color[]? colors = Palette.GetColors(values.Length); - RadialGaugePlot plottable = new(values, colors); - Add(plottable); - - if (disableFrameAndGrid) - { - Frameless(); - Grid(enable: false); - } - - return plottable; - } - - /// - /// A Pie chart where the angle of slices is constant but the radii are not. - /// - /// The data to plot - /// Whether to make the plot frameless and disable the grid - public CoxcombPlot AddCoxcomb(double[] values, bool hideGridAndFrame = true) - { - Color[] colors = Enumerable.Range(0, values.Length) - .Select(i => settings.PlottablePalette.GetColor(i)) - .ToArray(); - - CoxcombPlot plottable = new(values, colors); - Add(plottable); - - if (hideGridAndFrame) - { - Grid(false); - Frameless(); - } - - return plottable; - - } - - /// - /// Add an L-shaped scalebar to the corner of the plot - /// - public ScaleBar AddScaleBar(double width, double height, string xLabel = null, string yLabel = null) - { - var scalebar = new ScaleBar() - { - Width = width, - Height = height, - HorizontalLabel = xLabel, - VerticalLabel = yLabel, - }; - Add(scalebar); - return scalebar; - } - - /// - /// Add a scatter plot from X/Y pairs. - /// Lines and markers are shown by default. - /// Scatter plots are slower than Signal plots. - /// - public ScatterPlot AddScatter( - double[] xs, - double[] ys, - Color? color = null, - float lineWidth = 1, - float markerSize = 5, - MarkerShape markerShape = MarkerShape.FilledCircle, - LineStyle lineStyle = LineStyle.Solid, - string label = null) - { - var plottable = new ScatterPlot(xs, ys, null, null) - { - Color = color ?? GetNextColor(), - LineWidth = lineWidth, - MarkerSize = markerSize, - Label = label, - MarkerShape = markerShape, - LineStyle = lineStyle - }; - Add(plottable); - return plottable; - } - - /// - /// Add a scatter plot from X/Y pairs connected by lines (no markers). - /// Scatter plots are slower than Signal plots. - /// - public ScatterPlot AddScatterLines( - double[] xs, - double[] ys, - Color? color = null, - float lineWidth = 1, - LineStyle lineStyle = LineStyle.Solid, - string label = null) - { - var plottable = new ScatterPlot(xs, ys, null, null) - { - Color = color ?? GetNextColor(), - LineWidth = lineWidth, - MarkerSize = 0, - Label = label, - LineStyle = lineStyle - }; - Add(plottable); - return plottable; - } - - /// - /// Add a scatter plot from X/Y pairs using markers at points (no lines). - /// Scatter plots are slower than Signal plots. - /// - public ScatterPlot AddScatterPoints( - double[] xs, - double[] ys, - Color? color = null, - float markerSize = 5, - MarkerShape markerShape = MarkerShape.FilledCircle, - string label = null) - { - var plottable = new ScatterPlot(xs, ys, null, null) - { - Color = color ?? GetNextColor(), - LineWidth = 0, - MarkerSize = markerSize, - Label = label, - MarkerShape = markerShape - }; - Add(plottable); - return plottable; - } - - /// - /// Add a step plot is a type of line plot where points are connected with right angles instead of straight lines. - /// - public ScatterPlot AddScatterStep( - double[] xs, - double[] ys, - Color? color = null, - float lineWidth = 1, - string label = null) - { - var plottable = new ScatterPlot(xs, ys, null, null) - { - Color = color ?? GetNextColor(), - LineWidth = lineWidth, - Label = label, - MarkerSize = 0, - StepDisplay = true - }; - Add(plottable); - return plottable; - } - - /// - /// Scatter plot with Add() and Clear() methods for updating data - /// - public ScatterPlotList AddScatterList( - Color? color = null, - float lineWidth = 1, - float markerSize = 5, - string label = null, - MarkerShape markerShape = MarkerShape.FilledCircle, - LineStyle lineStyle = LineStyle.Solid) - { - var spl = new ScatterPlotList() - { - Color = color ?? GetNextColor(), - LineWidth = lineWidth, - MarkerSize = markerSize, - Label = label, - MarkerShape = markerShape, - LineStyle = lineStyle - }; - - Add(spl); - return spl; - } - - /// - /// Signal plots have evenly-spaced X points and render very fast. - /// - public SignalPlot AddSignal(double[] ys, double sampleRate = 1, Color? color = null, string label = null) - { - SignalPlot signal = new SignalPlot() - { - Ys = ys, - SampleRate = sampleRate, - Color = color ?? settings.GetNextColor(), - Label = label, - - // TODO: FIX THIS!!! - MinRenderIndex = 0, - MaxRenderIndex = ys.Length - 1, - }; - Add(signal); - return signal; - } - - /// - /// SignalConts plots have evenly-spaced X points and render faster than Signal plots - /// but data in source arrays cannot be changed after it is loaded. - /// Methods can be used to update all or portions of the data. - /// - public SignalPlotConst AddSignalConst(T[] ys, double sampleRate = 1, Color? color = null, string label = null) where T : struct, IComparable - { - SignalPlotConst plottable = new SignalPlotConst() - { - Ys = ys, - SampleRate = sampleRate, - Color = color ?? settings.GetNextColor(), - Label = label, - MinRenderIndex = 0, - MaxRenderIndex = ys.Length - 1, - }; - Add(plottable); - return plottable; - } - - /// - /// Speed-optimized plot for Ys with unevenly-spaced ascending Xs - /// - public SignalPlotXY AddSignalXY(double[] xs, double[] ys, Color? color = null, string label = null) - { - SignalPlotXY plottable = new SignalPlotXY() - { - Xs = xs, - Ys = ys, - Color = color ?? settings.GetNextColor(), - Label = label, - MinRenderIndex = 0, - MaxRenderIndex = ys.Length - 1, - }; - Add(plottable); - return plottable; - } - - - /// - /// Speed-optimized plot for Ys with unevenly-spaced ascending Xs. - /// Faster than SignalXY but values cannot be modified after loading. - /// - public SignalPlotXYConst AddSignalXYConst(TX[] xs, TY[] ys, Color? color = null, string label = null) - where TX : struct, IComparable where TY : struct, IComparable - { - SignalPlotXYConst signal = new SignalPlotXYConst() - { - Xs = xs, - Ys = ys, - Color = color ?? settings.GetNextColor(), - Label = label, - MinRenderIndex = 0, - MaxRenderIndex = ys.Length - 1, - }; - Add(signal); - return signal; - } - - /// - /// Display text at specific X/Y coordinates - /// - public Text AddText(string label, double x, double y, float size = 12, Color? color = null) => - AddText(label, x, y, new Font() { Size = size, Color = color ?? GetNextColor() }); - - /// - /// Display text at specific X/Y coordinates - /// - public Text AddText(string label, double x, double y, Font font) - { - var plottable = new Text() - { - Label = label, - X = x, - Y = y, - Font = font - }; - Add(plottable); - return plottable; - } - - /// - /// Display a text bubble that points to an X/Y location on the plot - /// - public Tooltip AddTooltip(string label, double x, double y) - { - var plottable = new Tooltip() { Label = label, X = x, Y = y }; - Add(plottable); - return plottable; - } - - /// - /// Add a 2D vector field to the plot - /// - public VectorField AddVectorField( - Vector2[,] vectors, - double[] xs, - double[] ys, - string label = null, - Color? color = null, - ColourMap colormap = null, - double scaleFactor = 1 - ) - { - // TODO: refactor constructor to eliminate styling arguments - var vectorField = new VectorField(vectors, xs, ys, - colormap, scaleFactor, color ?? settings.GetNextColor()) - { Label = label }; - - Add(vectorField); - return vectorField; - } - - /// - /// Add a vertical axis line at a specific Y position - /// - public VLine AddVerticalLine(double x, Color? color = null, float width = 1, LineStyle style = LineStyle.Solid, string label = null) - { - VLine plottable = new VLine() - { - X = x, - Color = color ?? settings.GetNextColor(), - LineWidth = width, - LineStyle = style, - Label = label - }; - Add(plottable); - return plottable; - } - - /// - /// Add a horizontal span (shades the region between two X positions) - /// - public VSpan AddVerticalSpan(double yMin, double yMax, Color? color = null, string label = null) - { - var plottable = new VSpan() - { - Y1 = yMin, - Y2 = yMax, - Color = color ?? GetNextColor(.5), - Label = label, - }; - Add(plottable); - return plottable; - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plot/Plot.Axis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plot/Plot.Axis.cs deleted file mode 100644 index 8acd920d0..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plot/Plot.Axis.cs +++ /dev/null @@ -1,745 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public partial class Plot - { - #region shortcuts: primary axes - - /// - /// Axis on the bottom edge of the plot - /// - public Axis XAxis => settings.XAxis; - - /// - /// Axis on the top edge of the plot - /// - public Axis XAxis2 => settings.XAxis2; - - /// - /// Axis on the left edge of the plot - /// - public Axis YAxis => settings.YAxis; - - /// - /// Axis on the right edge of the plot - /// - public Axis YAxis2 => settings.YAxis2; - - #endregion - - #region shortcuts: axis label, tick, and grid - - /// - /// Set the label for the vertical axis to the right of the plot (XAxis) - /// - /// new text - public void XLabel(string label) => XAxis.Label(label); - - /// - /// Set the label for the vertical axis to the right of the plot (YAxis2) - /// - /// new text - public void YLabel(string label) => YAxis.Label(label); - - /// - /// Set the label for the horizontal axis above the plot (XAxis2) - /// - /// new text - /// controls font weight - public void Title(string label, bool bold = true) => XAxis2.Label(label, bold: bold); - - /// - /// Configure color and visibility of the frame that outlines the data area. - /// Note that the axis lines of all 4 primary axes touch each other, - /// giving the appearance of a rectangle framing the data area. - /// This method allows the user to customize these lines as a group or individually. - /// - /// visibility of the frames for the 4 primary axes - /// color for the 4 primary axis lines - /// visibility of the left axis (YAxis) line - /// visibility of the right axis (YAxis2) line - /// visibility of the bottom axis (XAxis) line - /// visibility of the top axis (XAxis2) line - [Obsolete("This method has been deprecated. Visibility and customization can be controlled with methods like YAxis.Hide(), YAxis.Line(), etc.", true)] - public void Frame(bool? visible = null, Color? color = null, bool? left = null, bool? right = null, bool? bottom = null, bool? top = null) - { - var primaryAxes = new Axis[] { XAxis, XAxis2, YAxis, YAxis2 }; - - foreach (var axis in primaryAxes) - { - axis.Line(visible, color); - } - - YAxis.Line(visible: left); - YAxis2.Line(visible: right); - XAxis.Line(visible: bottom); - XAxis2.Line(visible: top); - } - - /// - /// Give the plot a frameless appearance by hiding all axes. - /// Axes are hidden by making them invisible and setting their size to zero. - /// This causes the data area to go right up to the edge of the plot. - /// - public void Frameless(bool hideAllAxes = true) - { - foreach (var axis in settings.Axes) - { - axis.Hide(hideAllAxes); - } - } - - /// - /// Control visibility of axes. - /// - [Obsolete("This method is deprecated. Call Frameless() to control axis visibility.")] - public void Frame(bool enable) => Frameless(!enable); - - /// - /// Customize basic options for the primary X and Y axes. - /// Call XAxis.Grid() and YAxis.Grid() to further customize grid settings. - /// - /// sets visibility of X and Y grid lines - /// sets color of of X and Y grid lines - /// defines the style for X and Y grid lines - public void Grid(bool? enable = null, Color? color = null, LineStyle? lineStyle = null) - { - if (enable.HasValue) - { - XAxis.Grid(enable.Value); - YAxis.Grid(enable.Value); - } - - XAxis.MajorGrid(color: color, lineStyle: lineStyle); - YAxis.MajorGrid(color: color, lineStyle: lineStyle); - } - - /// - /// Set padding around the data area by defining the minimum size and padding for all axes - /// - /// YAxis size (in pixels) that defines the area to the left of the plot - /// YAxis2 size (in pixels) that defines the area to the right of the plot - /// XAxis size (in pixels) that defines the area to the bottom of the plot - /// XAxis2 size (in pixels) that defines the area to the top of the plot - /// Customize the default padding between axes and the edge of the plot - public void Layout(float? left = null, float? right = null, float? bottom = null, float? top = null, float? padding = 5) - { - YAxis.Layout(padding, left); - YAxis2.Layout(padding, right); - XAxis.Layout(padding, bottom); - XAxis2.Layout(padding, top); - } - - /// - /// Adjust this axis layout based on the layout of a source plot - /// - /// plot to use for layout reference - /// if true, horizontal layout will be matched - /// if true, vertical layout will be matched - public void MatchLayout(Plot sourcePlot, bool horizontal = true, bool vertical = true) - { - var sourceSettings = sourcePlot.GetSettings(false); - - if (horizontal) - { - YAxis.SetSizeLimit(sourceSettings.YAxis.GetSize()); - YAxis2.SetSizeLimit(sourceSettings.YAxis2.GetSize()); - } - - if (vertical) - { - XAxis.SetSizeLimit(sourceSettings.XAxis.GetSize()); - XAxis2.SetSizeLimit(sourceSettings.XAxis2.GetSize()); - } - } - - /// - /// Get the axis limits for the given plot and apply them to this plot - /// - public void MatchAxis(Plot sourcePlot, bool horizontal = true, bool vertical = true) - { - var sourceLimits = sourcePlot.GetAxisLimits(); - - AxisAuto(); - - if (horizontal) - { - SetAxisLimitsX(sourceLimits.XMin, sourceLimits.XMax); - } - - if (vertical) - { - SetAxisLimitsY(sourceLimits.YMin, sourceLimits.YMax); - } - } - - /// - /// Manually define X axis tick labels using consecutive integer positions (0, 1, 2, etc.) - /// - /// new tick labels for the X axis - public void XTicks(string[] labels) => XTicks(DataGen.Consecutive(labels.Length), labels); - - /// - /// Manually define X axis tick positions and labels - /// - /// positions on the X axis - /// new tick labels for the X axis - public void XTicks(double[] positions = null, string[] labels = null) => - XAxis.ManualTickPositions(positions, labels); - - /// - /// Manually define Y axis tick labels using consecutive integer positions (0, 1, 2, etc.) - /// - /// new tick labels for the Y axis - public void YTicks(string[] labels) => YTicks(DataGen.Consecutive(labels.Length), labels); - - /// - /// Manually define Y axis tick positions and labels - /// - /// positions on the Y axis - /// new tick labels for the Y axis - public void YTicks(double[] positions = null, string[] labels = null) => - YAxis.ManualTickPositions(positions, labels); - - /// - /// Set the culture to use for number-to-string converstion for tick labels of all axes. - /// - /// standard culture - public void SetCulture(CultureInfo culture) - { - foreach (var axis in settings.Axes) - { - axis.SetCulture(culture); - } - } - - /// - /// Set the culture to use for number-to-string converstion for tick labels of all axes. - /// This overload allows you to manually define every format string, - /// allowing extensive customization of number and date formatting. - /// - /// - /// Separates the decimal digits - /// Separates large numbers ito groups of digits for readability - /// Number of digits after the numberDecimalSeparator - /// Appearance of negative numbers - /// Sizes of decimal groups which are separated by the numberGroupSeparator - public void SetCulture(string shortDatePattern = null, string decimalSeparator = null, string numberGroupSeparator = null, - int? decimalDigits = null, int? numberNegativePattern = null, int[] numberGroupSizes = null) - { - foreach (var axis in settings.Axes) - { - axis.SetCulture(shortDatePattern, decimalSeparator, numberGroupSeparator, decimalDigits, numberNegativePattern, numberGroupSizes); - } - } - - #endregion - - #region Axis creation - - /// - /// Create and return an additional axis - /// - /// Edge of the plot the new axis will belong to - /// Only plottables with the same axis index will use this axis - /// defualt label to use for the axis - /// defualt color to use for the axis - /// The axis that was just created and added to the plot. You can further customize it by interacting with it. - public Axis AddAxis(Edge edge, int axisIndex, string title = null, Color? color = null) - { - if (axisIndex <= 1) - { - throw new ArgumentException("The default axes already occupy indexes 0 and 1. Additional axes require higher indexes."); - } - - Axis axis; - - if (edge == Edge.Left) - { - axis = new AdditionalLeftAxis(axisIndex, title); - } - else if (edge == Edge.Right) - { - axis = new AdditionalRightAxis(axisIndex, title); - } - else if (edge == Edge.Bottom) - { - axis = new AdditionalBottomAxis(axisIndex, title); - } - else if (edge == Edge.Top) - { - axis = new AdditionalTopAxis(axisIndex, title); - } - else - { - throw new NotImplementedException("unsupported edge"); - } - - if (color.HasValue) - { - axis.Color(color.Value); - } - - settings.Axes.Add(axis); - return axis; - } - - #endregion - - #region coordinate/pixel conversions - - /// - /// Return the coordinate (in coordinate space) for the given pixel - /// - /// horizontal pixel location - /// vertical pixel location - /// point in coordinate space - public (double x, double y) GetCoordinate(float xPixel, float yPixel) => - (settings.XAxis.Dims.GetUnit(xPixel), settings.YAxis.Dims.GetUnit(yPixel)); - - /// - /// Return the X position (in coordinate space) for the given pixel column - /// - /// horizontal pixel location - /// horizontal position in coordinate space - public double GetCoordinateX(float xPixel) => settings.XAxis.Dims.GetUnit(xPixel); - - /// - /// Return the Y position (in coordinate space) for the given pixel row - /// - /// vertical pixel location - /// vertical position in coordinate space - public double GetCoordinateY(float yPixel) => settings.YAxis.Dims.GetUnit(yPixel); - - /// - /// Return the pixel for the given point in coordinate space - /// - /// horizontal coordinate - /// vertical coordinate - /// pixel location - public (float xPixel, float yPixel) GetPixel(double x, double y) => - (settings.XAxis.Dims.GetPixel(x), settings.YAxis.Dims.GetPixel(y)); - - /// - /// Return the horizontal pixel location given position in coordinate space - /// - /// horizontal coordinate - /// horizontal pixel position - public float GetPixelX(double x) => settings.XAxis.Dims.GetPixel(x); - - /// - /// Return the vertical pixel location given position in coordinate space - /// - /// vertical coordinate - /// vertical pixel position - public float GetPixelY(double y) => settings.YAxis.Dims.GetPixel(y); - - #endregion - - #region axis limits: get and set - - /// - /// Returns the current limits for a given pair of axes. - /// - /// which axis index to reference - /// which axis index to reference - /// current limits - public AxisLimits GetAxisLimits(int xAxisIndex = 0, int yAxisIndex = 0) - { - (double xMin, double xMax) = settings.GetXAxis(xAxisIndex).Dims.RationalLimits(); - (double yMin, double yMax) = settings.GetYAxis(yAxisIndex).Dims.RationalLimits(); - return new AxisLimits(xMin, xMax, yMin, yMax); - } - - /// - /// Set limits for the a given pair of axes - /// - /// lower limit of the horizontal axis - /// upper limit of the horizontal axis - /// lower limit of the vertical axis - /// upper limit of the vertical axis - /// index of the axis the horizontal limits apply to - /// index of the axis the vertical limits apply to - public void SetAxisLimits( - double? xMin = null, double? xMax = null, - double? yMin = null, double? yMax = null, - int xAxisIndex = 0, int yAxisIndex = 0) - { - bool notAllAxesDefined = xMin is null || xMax is null || yMin is null || yMax is null; - if (notAllAxesDefined) - { - settings.AxisAutoUnsetAxes(); - } - - settings.AxisSet(xMin, xMax, yMin, yMax, xAxisIndex, yAxisIndex); - } - - /// - /// Set limits for the primary X axis - /// - /// lower limit of the horizontal axis - /// upper limit of the horizontal axis - public void SetAxisLimitsX(double xMin, double xMax) => SetAxisLimits(xMin, xMax, null, null); - - /// - /// Set limits for the primary Y axis - /// - /// lower limit of the vertical axis - /// upper limit of the vertical axis - public void SetAxisLimitsY(double yMin, double yMax) => SetAxisLimits(null, null, yMin, yMax); - - /// - /// Set limits for a pair of axes - /// - /// new limits - /// index of the axis the horizontal limits apply to - /// index of the axis the vertical limits apply to - public void SetAxisLimits(AxisLimits limits, int xAxisIndex = 0, int yAxisIndex = 0) => - settings.AxisSet(limits, xAxisIndex, yAxisIndex); - - /// - /// Set maximum outer limits beyond which the plot cannot be zoomed-out or panned. - /// - [Obsolete("use SetOuterViewLimits() or SetInnerViewLimits()", true)] - public void SetViewLimits( - double xMin = double.NegativeInfinity, double xMax = double.PositiveInfinity, - double yMin = double.NegativeInfinity, double yMax = double.PositiveInfinity) => - SetOuterViewLimits(xMin, xMax, yMin, yMax); - - /// - /// Set maximum outer limits beyond which the plot cannot be zoomed-out or panned. - /// - public void SetOuterViewLimits( - double xMin = double.NegativeInfinity, double xMax = double.PositiveInfinity, - double yMin = double.NegativeInfinity, double yMax = double.PositiveInfinity, - int xAxisIndex = 0, int yAxisIndex = 0) - { - settings.GetXAxis(xAxisIndex).Dims.SetBoundsOuter(xMin, xMax); - settings.GetYAxis(yAxisIndex).Dims.SetBoundsOuter(yMin, yMax); - } - - /// - /// Set minimum innter limits which will always be visible on the plot. - /// - public void SetInnerViewLimits( - double xMin = double.NegativeInfinity, double xMax = double.PositiveInfinity, - double yMin = double.NegativeInfinity, double yMax = double.PositiveInfinity, - int xAxisIndex = 0, int yAxisIndex = 0) - { - settings.GetXAxis(xAxisIndex).Dims.SetBoundsInner(xMin, xMax); - settings.GetYAxis(yAxisIndex).Dims.SetBoundsInner(yMin, yMax); - } - - #endregion - - #region axis limits: fit to plottable data - - /// - /// Auto-scale the axis limits to fit the data. This function is an alias for AxisAuto(). - /// - /// horizontal margin in the range [0, 1] - /// vertical margin in the range [0, 1] - /// Current default margins for automatic axis scaling - public (double x, double y) Margins(double? x = null, double? y = null) - { - return Margins(x, y, 0, 0); - } - - /// - /// Auto-scale the axis limits to fit the data. This function is an alias for AxisAuto(). - /// This overload is for multi-axis plots (plots with multiple X and Y axes) and will only adjust the specified axes. - /// - /// horizontal margin in the range [0, 1] - /// vertical margin in the range [0, 1] - /// Only adjust the specified axis (for plots with multiple X axes) - /// Only adjust the specified axis (for plots with multiple Y axes) - /// Current default margins for automatic axis scaling - public (double x, double y) Margins(double? x, double? y, int xAxisIndex, int yAxisIndex) - { - AxisAuto(x, y, xAxisIndex, yAxisIndex); - return (settings.MarginsX, settings.MarginsY); - } - - /// - /// Automatically set axis limits to fit the data. - /// - /// Extra space (fraction) to add to the left and right of the limits of the data - /// Extra space (fraction) to add above and below the limits of the data - public void AxisAuto(double? horizontalMargin = null, double? verticalMargin = null) - { - AxisAuto(horizontalMargin, verticalMargin, xAxisIndex: 0, yAxisIndex: 0); - } - - /// - /// Automatically set axis limits to fit the data. - /// This overload is designed for multi-axis plots (with multiple X axes or multiple Y axes). - /// - /// Extra space (fraction) to add to the left and right of the limits of the data - /// Extra space (fraction) to add above and below the limits of the data - /// Only adjust the specified axis (for plots with multiple X axes) - /// Only adjust the specified axis (for plots with multiple Y axes) - public void AxisAuto(double? horizontalMargin, double? verticalMargin, int xAxisIndex, int yAxisIndex) - { - settings.MarginsX = horizontalMargin ?? settings.MarginsX; - settings.MarginsY = verticalMargin ?? settings.MarginsY; - - settings.AxisAutoX(xAxisIndex, settings.MarginsX); - settings.AxisAutoY(yAxisIndex, settings.MarginsY); - } - - /// - /// Automatically adjust axis limits to fit the data - /// - /// amount of space to the left and right of the data (as a fraction of its width) - public void AxisAutoX(double margin = .05) - { - // TODO: improve support for non-primary axis indexes - - if (settings.Plottables.Count == 0) - { - SetAxisLimits(yMin: -10, yMax: 10); - return; - } - - AxisLimits originalLimits = GetAxisLimits(); - AxisAuto(horizontalMargin: margin); - SetAxisLimits(yMin: originalLimits.YMin, yMax: originalLimits.YMax); - } - - /// - /// Automatically adjust axis limits to fit the data (with a little extra margin) - /// - /// amount of space above and below the data (as a fraction of its height) - public void AxisAutoY(double margin = .1) - { - // TODO: improve support for non-primary axis indexes - - if (settings.Plottables.Count == 0) - { - SetAxisLimits(xMin: -10, xMax: 10); - return; - } - - AxisLimits originalLimits = GetAxisLimits(); - AxisAuto(verticalMargin: margin); - SetAxisLimits(xMin: originalLimits.XMin, xMax: originalLimits.XMax); - } - - #endregion - - #region axis limits: scaling - - /// - /// Adjust axis limits to achieve a certain pixel scale (units per pixel) - /// - /// zoom so 1 pixel equals this many horizontal units in coordinate space - /// zoom so 1 pixel equals this many vertical units in coordinate space - public void AxisScale(double? unitsPerPixelX = null, double? unitsPerPixelY = null) - { - if (unitsPerPixelX != null) - { - double spanX = unitsPerPixelX.Value * settings.XAxis.Dims.DataSizePx; - SetAxisLimits(xMin: settings.XAxis.Dims.Center - spanX / 2, xMax: settings.XAxis.Dims.Center + spanX / 2); - } - - if (unitsPerPixelY != null) - { - double spanY = unitsPerPixelY.Value * settings.YAxis.Dims.DataSizePx; - SetAxisLimits(xMin: settings.YAxis.Dims.Center - spanY / 2, xMax: settings.YAxis.Dims.Center + spanY / 2); - } - } - - /// - /// Lock X and Y axis scales (units per pixel) together to protect symmetry of circles and squares - /// - /// if true, scales are locked such that zooming one zooms the other - /// defines behavior for how to adjust axis limits to achieve equal scales - public void AxisScaleLock(bool enable, EqualScaleMode scaleMode = EqualScaleMode.PreserveSmallest) - { - settings.AxisAutoUnsetAxes(); - settings.EqualScaleMode = enable ? scaleMode : EqualScaleMode.Disabled; - settings.LayoutAuto(); - settings.EnforceEqualAxisScales(); - } - - #endregion - - #region axis limits: pan and zoom - - /// - /// Zoom in or out. The amount of zoom is defined as a fraction of the current axis span. - /// - /// horizontal zoom (>1 means zoom in) - /// vertical zoom (>1 means zoom in) - /// if defined, zoom will be centered at this point - /// if defined, zoom will be centered at this point - /// index of the axis to zoom - /// index of the axis to zoom - public void AxisZoom( - double xFrac = 1, double yFrac = 1, - double? zoomToX = null, double? zoomToY = null, - int xAxisIndex = 0, int yAxisIndex = 0) - { - var xAxis = settings.GetXAxis(xAxisIndex); - var yAxis = settings.GetYAxis(yAxisIndex); - - if (xAxis.Dims.HasBeenSet == false || yAxis.Dims.HasBeenSet == false) - { - settings.AxisAutoAll(); - } - - xAxis.Dims.Zoom(xFrac, zoomToX ?? xAxis.Dims.Center); - yAxis.Dims.Zoom(yFrac, zoomToY ?? yAxis.Dims.Center); - } - - /// - /// Pan the primary X and Y axis without affecting zoom - /// - /// horizontal distance to pan (in coordinate units) - /// vertical distance to pan (in coordinate units) - public void AxisPan(double dx = 0, double dy = 0) - { - if (!settings.AllAxesHaveBeenSet) - { - settings.AxisAutoAll(); - } - - settings.XAxis.Dims.Pan(dx); - settings.YAxis.Dims.Pan(dy); - } - - #endregion - - #region obsolete - - [Obsolete("Use SetAxisLimits() and GetAxisLimits()", true)] - public AxisLimits AxisLimits(int xAxisIndex = 0, int yAxisIndex = 0) => throw new NotImplementedException(); - - [Obsolete("use GetCoordinateX()", true)] - public double CoordinateFromPixelX(float pixelX) => throw new NotImplementedException(); - - [Obsolete("use GetCoordinateY()", true)] - public double CoordinateFromPixelY(float pixelY) => throw new NotImplementedException(); - - [Obsolete("use GetCoordinateX()", true)] - public double CoordinateFromPixelX(double pixelX) => throw new NotImplementedException(); - - [Obsolete("use GetCoordinateY()", true)] - public double CoordinateFromPixelY(double pixelY) => throw new NotImplementedException(); - - [Obsolete("use GetCoordinate(), GetCoordinateX() or GetCoordinateY()", true)] - public PointF CoordinateFromPixel(int pixelX, int pixelY) => throw new NotImplementedException(); - - [Obsolete("use GetCoordinate(), GetCoordinateX() or GetCoordinateY()", true)] - public PointF CoordinateFromPixel(float pixelX, float pixelY) => throw new NotImplementedException(); - - [Obsolete("use GetCoordinate(), GetCoordinateX() or GetCoordinateY()", true)] - public PointF CoordinateFromPixel(double pixelX, double pixelY) => throw new NotImplementedException(); - - [Obsolete("use GetCoordinate(), GetCoordinateX() or GetCoordinateY()", true)] - public PointF CoordinateFromPixel(Point pixel) => throw new NotImplementedException(); - - [Obsolete("use GetCoordinate(), GetCoordinateX() or GetCoordinateY()", true)] - public PointF CoordinateFromPixel(PointF pixel) => throw new NotImplementedException(); - - [Obsolete("use GetPixel, GetPixelX(), or GetPixelY()", true)] - public PointF CoordinateToPixel(PointF location) => throw new NotImplementedException(); - - [Obsolete("use GetPixel, GetPixelX(), or GetPixelY()", true)] - public PointF CoordinateToPixel(double locationX, double locationY) => throw new NotImplementedException(); - - [Obsolete("use GetPixelX()", true)] - public float CoordinateToPixelX(double locationX) => throw new NotImplementedException(); - - [Obsolete("use GetPixelY()", true)] - public float CoordinateToPixelY(double locationY) => throw new NotImplementedException(); - - [Obsolete("use GetAxisLimits() and SetAxisLimits()", true)] - public AxisLimits Axis(double? x1 = null, double? x2 = null, double? y1 = null, double? y2 = null) - => throw new NotImplementedException(); - - [Obsolete("use GetAxisLimits() and SetAxisLimits()", true)] - public void Axis(double[] axisLimits, int xAxisIndex = 0, int yAxisIndex = 0) => throw new NotImplementedException(); - - [Obsolete("use GetAxisLimits() and SetAxisLimits()", true)] - public double[]? Axis(double? x1 = null, double? x2 = null, double? y1 = null, double? y2 = null, double? _ = null) => null; - - [Obsolete("use GetAxisLimits() and SetAxisLimits()", true)] - public double[] Axis(double[] axisLimits) => null; - - [Obsolete("use GetAxisLimits() and SetAxisLimits()", true)] - public void Axis(AxisLimits limits, int xAxisIndex = 0, int yAxisIndex = 0) => throw new NotImplementedException(); - - [Obsolete("use AxisScaleLock()", true)] - public bool EqualAxis; - - [Obsolete("Use AxisAuto() or Margins()", true)] - public double[] AutoAxis() => null; - - [Obsolete("Use AxisAuto() or Margins()", true)] - public double[] AutoScale() => null; - - - [Obsolete("Individual axes (e.g., XAxis and YAxis) have their own tick configuration methods", true)] - public void Ticks( - bool? displayTicksX = null, - bool? displayTicksY = null, - bool? displayTicksXminor = null, - bool? displayTicksYminor = null, - bool? displayTickLabelsX = null, - bool? displayTickLabelsY = null, - Color? color = null, - bool? useMultiplierNotation = null, - bool? useOffsetNotation = null, - bool? useExponentialNotation = null, - bool? dateTimeX = null, - bool? dateTimeY = null, - bool? rulerModeX = null, - bool? rulerModeY = null, - bool? invertSignX = null, - bool? invertSignY = null, - string fontName = null, - float? fontSize = null, - float? xTickRotation = null, - bool? logScaleX = null, - bool? logScaleY = null, - string numericFormatStringX = null, - string numericFormatStringY = null, - bool? snapToNearestPixel = null, - int? baseX = null, - int? baseY = null, - string prefixX = null, - string prefixY = null, - string dateTimeFormatStringX = null, - string dateTimeFormatStringY = null - ) => throw new NotImplementedException(); - - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plot/Plot.Obsolete.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plot/Plot.Obsolete.cs deleted file mode 100644 index 2e22840d1..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plot/Plot.Obsolete.cs +++ /dev/null @@ -1,1245 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public partial class Plot - { - [Obsolete("Use AddHeatmapCoordinated (note capitalization)")] - [EditorBrowsable(EditorBrowsableState.Never)] // Prevents suggestions in Intellisense for downstream users. Still shows up while editing this assembly. - public CoordinatedHeatmap AddHeatMapCoordinated(double?[,] intensities, double? xMin = null, double? xMax = null, double? yMin = null, double? yMax = null, ColourMap colormap = null) - { - return AddHeatmapCoordinated(intensities, xMin, xMax, yMin, yMax, colormap); - } - - [Obsolete("Use AddHeatmapCoordinated (note capitalization)")] - [EditorBrowsable(EditorBrowsableState.Never)] // Prevents suggestions in Intellisense for downstream users. Still shows up while editing this assembly. - public CoordinatedHeatmap AddHeatMapCoordinated(double[,] intensities, double? xMin = null, double? xMax = null, double? yMin = null, double? yMax = null, ColourMap colormap = null) - { - return AddHeatmapCoordinated(intensities, xMin, xMax, yMin, yMax, colormap); - } - - - [Obsolete("Use AddAnnotation() and customize the object it returns")] - public Annotation PlotAnnotation( - string label, - double xPixel = 10, - double yPixel = 10, - double fontSize = 12, - string fontName = "Segoe UI", - Color? fontColor = null, - double fontAlpha = 1, - bool fill = true, - Color? fillColor = null, - double fillAlpha = .2, - double lineWidth = 1, - Color? lineColor = null, - double lineAlpha = 1, - bool shadow = false - ) - { - fontColor ??= Color.Black; - fillColor ??= Color.Yellow; - lineColor ??= Color.Black; - - fontColor = Color.FromArgb((int)(255 * fontAlpha), fontColor.Value.R, fontColor.Value.G, fontColor.Value.B); - fillColor = Color.FromArgb((int)(255 * fillAlpha), fillColor.Value.R, fillColor.Value.G, fillColor.Value.B); - lineColor = Color.FromArgb((int)(255 * lineAlpha), lineColor.Value.R, lineColor.Value.G, lineColor.Value.B); - - var plottable = new Annotation() - { - X = xPixel, - Y = yPixel, - Label = label, - Background = fill, - BackgroundColor = fillColor.Value, - BorderWidth = (float)lineWidth, - BorderColor = lineColor.Value, - Shadow = shadow - }; - - plottable.Font.Size = (float)fontSize; - plottable.Font.Name = fontName; - plottable.Font.Color = fontColor.Value; - - Add(plottable); - return plottable; - } - - [Obsolete("Use AddArrow() and customize the object it returns")] - public ScatterPlot PlotArrow( - double tipX, - double tipY, - double baseX, - double baseY, - double lineWidth = 5, - float arrowheadWidth = 3, - float arrowheadLength = 3, - Color? color = null, - string label = null - ) - { - var scatter = PlotScatter( - xs: new double[] { baseX, tipX }, - ys: new double[] { baseY, tipY }, - color: color, - lineWidth: lineWidth, - label: label, - markerSize: 0 - ); - - scatter.ArrowheadLength = arrowheadLength; - scatter.ArrowheadWidth = arrowheadWidth; - return scatter; - } - - [Obsolete("Use AddBar() and customize the object it returns")] - public BarPlot PlotBar( - double[] xs, - double[] ys, - double[]? errorY = null, - string label = null, - double barWidth = .8, - double xOffset = 0, - bool fill = true, - Color? fillColor = null, - double outlineWidth = 1, - Color? outlineColor = null, - double errorLineWidth = 1, - double errorCapSize = .38, - Color? errorColor = null, - bool horizontal = false, - bool showValues = false, - Color? valueColor = null, - bool autoAxis = true, - double[]? yOffsets = null, - Color? negativeColor = null - ) - { - Color nextColor = settings.GetNextColor(); - BarPlot barPlot = new BarPlot(xs, ys, errorY, yOffsets) - { - BarWidth = barWidth, - XOffset = xOffset, - FillColor = fillColor ?? nextColor, - Label = label, - ErrorLineWidth = (float)errorLineWidth, - ErrorCapSize = errorCapSize, - ErrorColor = errorColor ?? Color.Black, - BorderLineWidth = (float)outlineWidth, - BorderColor = outlineColor ?? Color.Black, - VerticalOrientation = !horizontal, - ShowValuesAboveBars = showValues, - FillColorNegative = negativeColor ?? nextColor - }; - barPlot.Font.Color = valueColor ?? Color.Black; - Add(barPlot); - - if (autoAxis) - { - // perform a tight axis adjustment - AxisAuto(0, 0); - var tightAxisLimits = GetAxisLimits(); - - // now loosen it up a bit - AxisAuto(); - - // now set one of the axis edges to zero - if (horizontal) - { - if (tightAxisLimits.XMin == 0) - { - SetAxisLimits(xMin: 0); - } - else if (tightAxisLimits.XMax == 0) - { - SetAxisLimits(xMax: 0); - } - } - else - { - if (tightAxisLimits.YMin == 0) - { - SetAxisLimits(yMin: 0); - } - else if (tightAxisLimits.YMax == 0) - { - SetAxisLimits(yMax: 0); - } - } - } - - return barPlot; - } - - /// - /// Create a series of bar plots given a 2D dataset - /// - [Obsolete("Use AddBarGroups() and customize the object it returns")] - public BarPlot[] PlotBarGroups( - string[] groupLabels, - string[] seriesLabels, - double[][] ys, - double[][] yErr = null, - double groupWidthFraction = 0.8, - double barWidthFraction = 0.8, - double errorCapSize = 0.38, - bool showValues = false - ) - { - if (groupLabels is null || seriesLabels is null || ys is null) - { - throw new ArgumentException("labels and ys cannot be null"); - } - - if (seriesLabels.Length != ys.Length) - { - throw new ArgumentException("groupLabels and ys must be the same length"); - } - - foreach (double[] subArray in ys) - { - if (subArray.Length != groupLabels.Length) - { - throw new ArgumentException("all arrays inside ys must be the same length as groupLabels"); - } - } - - int seriesCount = ys.Length; - double barWidth = groupWidthFraction / seriesCount; - BarPlot[] bars = new BarPlot[seriesCount]; - bool containsNegativeY = false; - for (int i = 0; i < seriesCount; i++) - { - double offset = i * barWidth; - double[] barYs = ys[i]; - double[]? barYerr = yErr?[i]; - double[] barXs = DataGen.Consecutive(barYs.Length); - containsNegativeY |= barYs.Where(y => y < 0).Any(); - bars[i] = PlotBar(barXs, barYs, barYerr, seriesLabels[i], barWidth * barWidthFraction, offset, errorCapSize: errorCapSize, showValues: showValues); - } - - if (containsNegativeY) - { - AxisAuto(); - } - - double[] groupPositions = DataGen.Consecutive(groupLabels.Length, offset: (groupWidthFraction - barWidth) / 2); - XTicks(groupPositions, groupLabels); - - return bars; - } - - [Obsolete("Use AddImage() and customize the object it returns.")] - public Image PlotBitmap( - Bitmap bitmap, - double x, - double y, - string label = null, - Alignment alignment = Alignment.MiddleLeft, - double rotation = 0, - Color? frameColor = null, - int frameSize = 0 - ) - { - Image plottableImage = new Image() - { - Bitmap = bitmap, - X = x, - Y = y, - Label = label, - Alignment = alignment, - Rotation = rotation, - BorderColor = frameColor ?? Color.White, - BorderSize = frameSize - }; - - settings.Plottables.Add(plottableImage); - return plottableImage; - } - - [Obsolete("use AddCandlesticks() and customize the object it returns")] - public FinancePlot PlotCandlestick( - OHLC[] ohlcs, - Color? colorUp = null, - Color? colorDown = null, - bool autoWidth = true, - bool sequential = false - ) - { - FinancePlot plottable = new FinancePlot(ohlcs) - { - Candle = true, - Sequential = sequential, - ColorUp = colorUp ?? ColorTranslator.FromHtml("#26a69a"), - ColorDown = colorDown ?? ColorTranslator.FromHtml("#ef5350") - }; - Add(plottable); - return plottable; - } - - [Obsolete("Use AddScatter() and customize it for no line, no marker, and errorbars as desired")] - public void PlotErrorBars( - double[] xs, - double[] ys, - double[] xPositiveError = null, - double[] xNegativeError = null, - double[] yPositiveError = null, - double[] yNegativeError = null, - Color? color = null, - double lineWidth = 1, - double capWidth = 3, - string label = null - ) => throw new NotImplementedException(); - - [Obsolete("Use AddFill() and customize the object it returns")] - public Polygon PlotFill( - double[] xs, - double[] ys, - string label = null, - double lineWidth = 0, - Color? lineColor = null, - bool fill = true, - Color? fillColor = null, - double fillAlpha = 1, - double baseline = 0 - ) - { - if (xs.Length != ys.Length) - { - throw new ArgumentException("xs and ys must all have the same length"); - } - - double[] xs2 = Tools.Pad(xs, cloneEdges: true); - double[] ys2 = Tools.Pad(ys, padWithLeft: baseline, padWithRight: baseline); - - return PlotPolygon(xs2, ys2, label, lineWidth, lineColor, fill, fillColor, fillAlpha); - } - - [Obsolete("Use AddFill() and customize the object it returns")] - public Polygon PlotFill( - double[] xs1, - double[] ys1, - double[] xs2, - double[] ys2, - string label = null, - double lineWidth = 0, - Color? lineColor = null, - bool fill = true, - Color? fillColor = null, - double fillAlpha = 1, - double baseline = 0 - ) - { - if ((xs1.Length != ys1.Length) || (xs2.Length != ys2.Length)) - { - throw new ArgumentException("xs and ys for each dataset must have the same length"); - } - - int pointCount = xs1.Length + xs2.Length; - double[] bothX = new double[pointCount]; - double[] bothY = new double[pointCount]; - - // copy the first dataset as-is - Array.Copy(xs1, 0, bothX, 0, xs1.Length); - Array.Copy(ys1, 0, bothY, 0, ys1.Length); - - // copy the second dataset in reverse order - for (int i = 0; i < xs2.Length; i++) - { - bothX[xs1.Length + i] = xs2[xs2.Length - 1 - i]; - bothY[ys1.Length + i] = ys2[ys2.Length - 1 - i]; - } - - return PlotPolygon(bothX, bothY, label, lineWidth, lineColor, fill, fillColor, fillAlpha); - } - - [Obsolete("Use AddFill() and customize the object it returns")] - public (Polygon, Polygon) PlotFillAboveBelow( - double[] xs, - double[] ys, - string labelAbove = null, - string labelBelow = null, - double lineWidth = 1, - Color? lineColor = null, - bool fill = true, - Color? fillColorAbove = null, - Color? fillColorBelow = null, - double fillAlpha = 1, - double baseline = 0 - ) - { - if (xs.Length != ys.Length) - { - throw new ArgumentException("xs and ys must all have the same length"); - } - - double[] xs2 = Tools.Pad(xs, cloneEdges: true); - double[] ys2 = Tools.Pad(ys, padWithLeft: baseline, padWithRight: baseline); - - double[] ys2below = new double[ys2.Length]; - double[] ys2above = new double[ys2.Length]; - for (int i = 0; i < ys2.Length; i++) - { - if (ys2[i] < baseline) - { - ys2below[i] = ys2[i]; - ys2above[i] = baseline; - } - else - { - ys2above[i] = ys2[i]; - ys2below[i] = baseline; - } - } - - if (fillColorAbove is null) - { - fillColorAbove = Color.Green; - } - - if (fillColorBelow is null) - { - fillColorBelow = Color.Red; - } - - if (lineColor is null) - { - lineColor = Color.Black; - } - - var polyAbove = PlotPolygon(xs2, ys2above, labelAbove, lineWidth, lineColor, fill, fillColorAbove, fillAlpha); - var polyBelow = PlotPolygon(xs2, ys2below, labelBelow, lineWidth, lineColor, fill, fillColorBelow, fillAlpha); - - return (polyBelow, polyAbove); - } - - [Obsolete("Use AddFunction() and customize the object it returns")] - public FunctionPlot PlotFunction( - Func function, - Color? color = null, - double lineWidth = 1, - double markerSize = 0, - string label = "f(x)", - MarkerShape markerShape = MarkerShape.None, - LineStyle lineStyle = LineStyle.Solid - ) - { - if (markerShape != MarkerShape.None || markerSize != 0) - { - throw new ArgumentException("function plots do not use markers"); - } - - FunctionPlot functionPlot = new FunctionPlot(function) - { - Color = color ?? settings.GetNextColor(), - LineWidth = lineWidth, - LineStyle = lineStyle, - Label = label - }; - - Add(functionPlot); - return functionPlot; - } - - [Obsolete("Use AddHeatmap() and customize the object it returns")] - public Heatmap PlotHeatmap( - double[,] intensities, - ColourMap colormap = null, - string label = null, - double[] axisOffsets = null, - double[] axisMultipliers = null, - double? scaleMin = null, - double? scaleMax = null, - double? transparencyThreshold = null, - Bitmap backgroundImage = null, - bool displayImageAbove = false, - bool drawAxisLabels = true - ) - { - double?[,] tmp = new double?[intensities.GetLength(0), intensities.GetLength(1)]; - for (int i = 0; i < intensities.GetLength(0); i++) - { - for (int j = 0; j < intensities.GetLength(1); j++) - { - tmp[i, j] = intensities[i, j]; - } - } - - return PlotHeatmap(tmp, colormap, label, axisOffsets, axisMultipliers, scaleMin, scaleMax, transparencyThreshold, backgroundImage, displayImageAbove, drawAxisLabels); - } - - [Obsolete("Create this plottable manually with new, then Add() it to the plot.")] - public Heatmap PlotHeatmap( - double?[,] intensities, - ColourMap colormap = null, - string label = null, - double[] axisOffsets = null, - double[] axisMultipliers = null, - double? scaleMin = null, - double? scaleMax = null, - double? transparencyThreshold = null, - Bitmap backgroundImage = null, - bool displayImageAbove = false, - bool drawAxisLabels = true - ) - { - Heatmap heatmap = new Heatmap() - { - Label = label, - TransparencyThreshold = transparencyThreshold, - BackgroundImage = backgroundImage, - DisplayImageAbove = displayImageAbove, - ShowAxisLabels = drawAxisLabels, - }; - heatmap.Update(intensities, colormap ?? ColourMap.Viridis, scaleMin, scaleMax); - - Add(heatmap); - Layout(top: 180); - - return heatmap; - } - - [Obsolete("Use AddHorizontalLine() and customize the object it returns")] - public HLine PlotHLine( - double y, - Color? color = null, - double lineWidth = 1, - string label = null, - bool draggable = false, - double dragLimitLower = double.NegativeInfinity, - double dragLimitUpper = double.PositiveInfinity, - LineStyle lineStyle = LineStyle.Solid - ) - { - var hline = new HLine() - { - Y = y, - Color = color ?? settings.GetNextColor(), - LineWidth = (float)lineWidth, - Label = label, - DragEnabled = draggable, - LineStyle = lineStyle, - DragLimitMin = dragLimitLower, - DragLimitMax = dragLimitUpper - }; - Add(hline); - return hline; - } - - [Obsolete("Use AddHorizontalSpan() and customize the object it returns")] - public HSpan PlotHSpan( - double x1, - double x2, - Color? color = null, - double alpha = .5, - string label = null, - bool draggable = false, - bool dragFixedSize = false, - double dragLimitLower = double.NegativeInfinity, - double dragLimitUpper = double.PositiveInfinity - ) - { - var axisSpan = new HSpan() - { - X1 = x1, - X2 = x2, - Color = color ?? GetNextColor(alpha), - Label = label, - DragEnabled = draggable, - DragFixedSize = dragFixedSize, - DragLimitMin = dragLimitLower, - DragLimitMax = dragLimitUpper, - }; - Add(axisSpan); - return axisSpan; - } - - [Obsolete("use AddLine() and customize the object it returns")] - public ScatterPlot PlotLine( - double x1, - double y1, - double x2, - double y2, - Color? color = null, - double lineWidth = 1, - string label = null, - LineStyle lineStyle = LineStyle.Solid - ) - { - return PlotScatter( - xs: new double[] { x1, x2 }, - ys: new double[] { y1, y2 }, - color: color, - lineWidth: lineWidth, - label: label, - lineStyle: lineStyle, - markerSize: 0 - ); - } - - [Obsolete("use AddLine() and customize the object it returns")] - public ScatterPlot PlotLine( - double slope, - double offset, - (double x1, double x2) xLimits, - Color? color = null, - double lineWidth = 1, - string label = null, - LineStyle lineStyle = LineStyle.Solid - ) - { - double y1 = xLimits.x1 * slope + offset; - double y2 = xLimits.x2 * slope + offset; - return PlotScatter( - xs: new double[] { xLimits.x1, xLimits.x2 }, - ys: new double[] { y1, y2 }, - color: color, - lineWidth: lineWidth, - label: label, - lineStyle: lineStyle, - markerSize: 0 - ); - } - - [Obsolete("use AddOHLC() and customize the object it returns")] - public FinancePlot PlotOHLC( - OHLC[] ohlcs, - Color? colorUp = null, - Color? colorDown = null, - bool autoWidth = true, - bool sequential = false - ) - { - FinancePlot plottable = new FinancePlot(ohlcs) - { - Candle = false, - Sequential = sequential, - ColorUp = colorUp ?? ColorTranslator.FromHtml("#26a69a"), - ColorDown = colorDown ?? ColorTranslator.FromHtml("#ef5350") - }; - Add(plottable); - return plottable; - } - - [Obsolete("use AddPie() and customize the object it returns")] - public PiePlot PlotPie( - double[] values, - string[] sliceLabels = null, - Color[] colors = null, - bool explodedChart = false, - bool showValues = false, - bool showPercentages = false, - bool showLabels = true, - string label = null - ) - { - colors ??= Enumerable.Range(0, values.Length).Select(i => settings.PlottablePalette.GetColor(i)).ToArray(); - - PiePlot pie = new PiePlot(values, sliceLabels, colors) - { - Explode = explodedChart, - ShowValues = showValues, - ShowPercentages = showPercentages, - ShowLabels = showLabels, - Label = label - }; - - Add(pie); - return pie; - } - - [Obsolete("Use AddPoint() and customize the object it returns")] - public ScatterPlot PlotPoint(double x, double y, Color? color = null, double markerSize = 5, string label = null, - double? errorX = null, double? errorY = null, double errorLineWidth = 1, double errorCapSize = 3, - MarkerShape markerShape = MarkerShape.FilledCircle, LineStyle lineStyle = LineStyle.Solid) - => throw new NotImplementedException(); - - [Obsolete("Use AddScatter() and customize the object it returns")] - public ScatterPlot PlotScatter( - double[] xs, - double[] ys, - Color? color = null, - double lineWidth = 1, - double markerSize = 5, - string label = null, - double[] errorX = null, - double[] errorY = null, - double errorLineWidth = 1, - double errorCapSize = 3, - MarkerShape markerShape = MarkerShape.FilledCircle, - LineStyle lineStyle = LineStyle.Solid - ) - { - var scatterPlot = new ScatterPlot(xs, ys, errorX, errorY) - { - Color = color ?? settings.GetNextColor(), - LineWidth = lineWidth, - MarkerSize = (float)markerSize, - Label = label, - ErrorLineWidth = (float)errorLineWidth, - ErrorCapSize = (float)errorCapSize, - StepDisplay = false, - MarkerShape = markerShape, - LineStyle = lineStyle - }; - - Add(scatterPlot); - return scatterPlot; - } - [Obsolete("AddScatter() then AddPoint() and move the point around")] - public ScatterPlotHighlight PlotScatterHighlight( - double[] xs, - double[] ys, - Color? color = null, - double lineWidth = 1, - double markerSize = 5, - string label = null, - double[] errorX = null, - double[] errorY = null, - double errorLineWidth = 1, - double errorCapSize = 3, - MarkerShape markerShape = MarkerShape.FilledCircle, - LineStyle lineStyle = LineStyle.Solid, - MarkerShape highlightedShape = MarkerShape.OpenCircle, - Color? highlightedColor = null, - double? highlightedMarkerSize = null - ) - { - if (color is null) - { - color = settings.GetNextColor(); - } - - if (highlightedColor is null) - { - highlightedColor = Color.Red; - } - - if (highlightedMarkerSize is null) - { - highlightedMarkerSize = 2 * markerSize; - } - - var scatterPlot = new ScatterPlotHighlight(xs, ys, errorX, errorY) - { - Color = (Color)color, - LineWidth = lineWidth, - MarkerSize = (float)markerSize, - Label = label, - ErrorLineWidth = (float)errorLineWidth, - ErrorCapSize = (float)errorCapSize, - StepDisplay = false, - MarkerShape = markerShape, - LineStyle = lineStyle, - highlightedShape = highlightedShape, - highlightedColor = highlightedColor.Value, - highlightedMarkerSize = (float)highlightedMarkerSize.Value - }; - - Add(scatterPlot); - return scatterPlot; - } - - [Obsolete("Use AddSignal() and customize the object it returns")] - public SignalPlot PlotSignal( - double[] ys, - double sampleRate = 1, - double xOffset = 0, - double yOffset = 0, - Color? color = null, - double lineWidth = 1, - double markerSize = 5, - string label = null, - Color[] colorByDensity = null, - int? minRenderIndex = null, - int? maxRenderIndex = null, - LineStyle lineStyle = LineStyle.Solid, - bool useParallel = true - ) - { - SignalPlot signal = new SignalPlot() - { - Ys = ys, - SampleRate = sampleRate, - OffsetX = xOffset, - OffsetY = yOffset, - Color = color ?? settings.GetNextColor(), - LineWidth = lineWidth, - MarkerSize = (float)markerSize, - Label = label, - DensityColors = colorByDensity, - MinRenderIndex = minRenderIndex ?? 0, - MaxRenderIndex = maxRenderIndex ?? ys.Length - 1, - LineStyle = lineStyle, - UseParallel = useParallel, - }; - - Add(signal); - return signal; - } - - [Obsolete("Use AddSignalConst() and customize the object it returns")] - public SignalPlotConst PlotSignalConst( - T[] ys, - double sampleRate = 1, - double xOffset = 0, - T yOffset = default(T), - Color? color = null, - double lineWidth = 1, - double markerSize = 5, - string label = null, - Color[] colorByDensity = null, - int? minRenderIndex = null, - int? maxRenderIndex = null, - LineStyle lineStyle = LineStyle.Solid, - bool useParallel = true - ) where T : struct, IComparable - { - SignalPlotConst signal = new SignalPlotConst() - { - Ys = ys, - SampleRate = sampleRate, - OffsetX = xOffset, - OffsetY = yOffset, - Color = color ?? settings.GetNextColor(), - LineWidth = lineWidth, - MarkerSize = (float)markerSize, - Label = label, - DensityColors = colorByDensity, - MinRenderIndex = minRenderIndex ?? 0, - MaxRenderIndex = maxRenderIndex ?? ys.Length - 1, - LineStyle = lineStyle, - UseParallel = useParallel - }; - - Add(signal); - return signal; - } - - [Obsolete("Use AddSignalXY() and customize the object it returns")] - public SignalPlotXY PlotSignalXY( - double[] xs, - double[] ys, - Color? color = null, - double lineWidth = 1, - double markerSize = 5, - string label = null, - int? minRenderIndex = null, - int? maxRenderIndex = null, - LineStyle lineStyle = LineStyle.Solid, - bool useParallel = true - ) - { - SignalPlotXY signal = new SignalPlotXY() - { - Xs = xs, - Ys = ys, - Color = color ?? settings.GetNextColor(), - LineWidth = lineWidth, - MarkerSize = (float)markerSize, - Label = label, - MinRenderIndex = minRenderIndex ?? 0, - MaxRenderIndex = maxRenderIndex ?? ys.Length - 1, - LineStyle = lineStyle, - UseParallel = useParallel - }; - - Add(signal); - return signal; - } - - [Obsolete("Use AddSignalXYConst() and customize the object it returns")] - public SignalPlotXYConst PlotSignalXYConst( - TX[] xs, - TY[] ys, - Color? color = null, - double lineWidth = 1, - double markerSize = 5, - string label = null, - int? minRenderIndex = null, - int? maxRenderIndex = null, - LineStyle lineStyle = LineStyle.Solid, - bool useParallel = true - ) where TX : struct, IComparable where TY : struct, IComparable - - { - SignalPlotXYConst signal = new SignalPlotXYConst() - { - Xs = xs, - Ys = ys, - Color = color ?? settings.GetNextColor(), - LineWidth = lineWidth, - MarkerSize = (float)markerSize, - Label = label, - MinRenderIndex = minRenderIndex ?? 0, - MaxRenderIndex = maxRenderIndex ?? ys.Length - 1, - LineStyle = lineStyle, - UseParallel = useParallel - }; - - Add(signal); - return signal; - } - - [Obsolete("Use AddScatterStep() and customize the object it returns")] - public ScatterPlot PlotStep( - double[] xs, - double[] ys, - Color? color = null, - double lineWidth = 1, - string label = null - ) - { - if (color == null) - { - color = settings.GetNextColor(); - } - - ScatterPlot stepPlot = new ScatterPlot(xs, ys) - { - Color = (Color)color, - LineWidth = lineWidth, - MarkerSize = 0, - Label = label, - ErrorLineWidth = 0, - ErrorCapSize = 0, - StepDisplay = true, - MarkerShape = MarkerShape.None, - LineStyle = LineStyle.Solid - }; - - Add(stepPlot); - return stepPlot; - } - - [Obsolete("Use AddPolygon() and customize the object it returns")] - public Polygon PlotPolygon( - double[] xs, - double[] ys, - string label = null, - double lineWidth = 0, - Color? lineColor = null, - bool fill = true, - Color? fillColor = null, - double fillAlpha = 1 - ) - { - var plottable = new Polygon(xs, ys) - { - Label = label, - LineWidth = lineWidth, - LineColor = lineColor ?? Color.Black, - Fill = fill, - FillColor = fillColor ?? GetNextColor(fillAlpha), - }; - - Add(plottable); - return plottable; - } - - [Obsolete("Use AddPolygons() and customize the object it returns")] - public Polygons PlotPolygons( - List> polys, - string label = null, - double lineWidth = 0, - Color? lineColor = null, - bool fill = true, - Color? fillColor = null, - double fillAlpha = 1 - ) - { - var plottable = new Polygons(polys) - { - Label = label, - LineWidth = lineWidth, - LineColor = lineColor ?? Color.Black, - Fill = fill, - FillColor = Color.FromArgb((byte)(255 * fillAlpha), fillColor ?? GetNextColor()), - }; - - Add(plottable); - return plottable; - } - - [Obsolete("Use AddPopulation() and customize the object it returns")] - public PopulationPlot PlotPopulations(Population population, string label = null) - { - var plottable = new PopulationPlot(population, label, settings.GetNextColor()); - Add(plottable); - return plottable; - } - - [Obsolete("Use AddPopulations() and customize the object it returns")] - public PopulationPlot PlotPopulations(Population[] populations, string label = null) - { - var plottable = new PopulationPlot(populations, label); - Add(plottable); - return plottable; - } - - [Obsolete("Use AddPopulations() and customize the object it returns")] - public PopulationPlot PlotPopulations(PopulationSeries series, string label = null) - { - series.color = settings.GetNextColor(); - if (label != null) - { - series.seriesLabel = label; - } - - var plottable = new PopulationPlot(series); - Add(plottable); - return plottable; - } - - [Obsolete("Use AddPopulations() and customize the object it returns")] - public PopulationPlot PlotPopulations(PopulationMultiSeries multiSeries) - { - for (int i = 0; i < multiSeries.multiSeries.Length; i++) - { - multiSeries.multiSeries[i].color = settings.PlottablePalette.GetColor(i); - } - - var plottable = new PopulationPlot(multiSeries); - Add(plottable); - return plottable; - } - - [Obsolete("Use AddRader() and customize the object it returns")] - public RadarPlot PlotRadar( - double[,] values, - string[] categoryNames = null, - string[] groupNames = null, - Color[] fillColors = null, - double fillAlpha = .4, - Color? webColor = null, - bool independentAxes = false, - double[] maxValues = null - ) - { - Color[] colors = fillColors ?? Enumerable.Range(0, values.Length).Select(i => settings.PlottablePalette.GetColor(i)).ToArray(); - Color[] colorsAlpha = colors.Select(x => Color.FromArgb((byte)(255 * fillAlpha), x)).ToArray(); - - var plottable = new RadarPlot(values, colors, fillColors ?? colorsAlpha, independentAxes, maxValues) - { - CategoryLabels = categoryNames, - GroupLabels = groupNames, - WebColor = webColor ?? Color.Gray - }; - Add(plottable); - - return plottable; - } - - [Obsolete("use AddScalebar() and customize the object it returns")] - public ScaleBar PlotScaleBar( - double sizeX, - double sizeY, - string labelX = null, - string labelY = null, - double thickness = 2, - double fontSize = 12, - Color? color = null, - double padPx = 10 - ) - { - var scalebar = new ScaleBar() - { - Width = sizeX, - Height = sizeY, - HorizontalLabel = labelX, - VerticalLabel = labelY, - LineWidth = (float)thickness, - FontSize = (float)fontSize, - FontColor = color ?? Color.Black, - LineColor = color ?? Color.Black, - Padding = (float)padPx - }; - Add(scalebar); - return scalebar; - } - - [Obsolete("Use AddText() and customize the object it returns")] - public Text PlotText( - string text, - double x, - double y, - Color? color = null, - string fontName = null, - double fontSize = 12, - bool bold = false, - string label = null, - Alignment alignment = Alignment.MiddleLeft, - double rotation = 0, - bool frame = false, - Color? frameColor = null - ) - { - if (!string.IsNullOrWhiteSpace(label)) - { - Debug.WriteLine("WARNING: the PlotText() label argument is ignored"); - } - - Text plottableText = new Text() - { - Label = text, - X = x, - Y = y, - Color = color ?? settings.GetNextColor(), - FontName = fontName, - FontSize = (float)fontSize, - FontBold = bold, - Alignment = alignment, - Rotation = (float)rotation, - BackgroundFill = frame, - BackgroundColor = frameColor ?? Color.White - }; - Add(plottableText); - return plottableText; - } - - [Obsolete("Create a VectorField manually then call Add()")] - public VectorField PlotVectorField( - Vector2[,] vectors, - double[] xs, - double[] ys, - string label = null, - Color? color = null, - ColourMap colormap = null, - double scaleFactor = 1 - ) - { - var vectorField = new VectorField(vectors, xs, ys, - colormap, scaleFactor, color ?? settings.GetNextColor()) - { Label = label }; - - Add(vectorField); - return vectorField; - } - - [Obsolete("Use AddVerticalLine() and customize the object it returns")] - public VLine PlotVLine( - double x, - Color? color = null, - double lineWidth = 1, - string label = null, - bool draggable = false, - double dragLimitLower = double.NegativeInfinity, - double dragLimitUpper = double.PositiveInfinity, - LineStyle lineStyle = LineStyle.Solid - ) - { - VLine axLine = new VLine() - { - X = x, - Color = color ?? settings.GetNextColor(), - LineWidth = (float)lineWidth, - Label = label, - DragEnabled = draggable, - LineStyle = lineStyle, - DragLimitMin = dragLimitLower, - DragLimitMax = dragLimitUpper - }; - Add(axLine); - return axLine; - } - - [Obsolete("Use AddVerticalSpan() and customize the object it returns")] - public VSpan PlotVSpan( - double y1, - double y2, - Color? color = null, - double alpha = .5, - string label = null, - bool draggable = false, - bool dragFixedSize = false, - double dragLimitLower = double.NegativeInfinity, - double dragLimitUpper = double.PositiveInfinity - ) - { - var axisSpan = new VSpan() - { - Y1 = y1, - Y2 = y2, - Color = color ?? GetNextColor(alpha), - Label = label, - DragEnabled = draggable, - DragFixedSize = dragFixedSize, - DragLimitMin = dragLimitLower, - DragLimitMax = dragLimitUpper - }; - Add(axisSpan); - return axisSpan; - } - - [Obsolete("This method has been replaced by AddBar() and one line of Linq (see cookbook)")] - public BarPlot PlotWaterfall( - double[] xs, - double[] ys, - double[]? errorY = null, - string label = null, - double barWidth = .8, - double xOffset = 0, - bool fill = true, - Color? fillColor = null, - double outlineWidth = 1, - Color? outlineColor = null, - double errorLineWidth = 1, - double errorCapSize = .38, - Color? errorColor = null, - bool horizontal = false, - bool showValues = false, - Color? valueColor = null, - bool autoAxis = true, - Color? negativeColor = null - ) - { - double[]? yOffsets = Enumerable.Range(0, ys.Length).Select(count => ys.Take(count).Sum()).ToArray(); - return PlotBar( - xs, - ys, - errorY, - label, - barWidth, - xOffset, - fill, - fillColor, - outlineWidth, - outlineColor, - errorLineWidth, - errorCapSize, - errorColor, - horizontal, - showValues, - valueColor, - autoAxis, - yOffsets, - negativeColor - ); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plot/Plot.Render.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plot/Plot.Render.cs deleted file mode 100644 index 7eb574536..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plot/Plot.Render.cs +++ /dev/null @@ -1,277 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - partial class Plot - { - #region primary render system - - /// - /// Render the plot onto an existing bitmap - /// - /// an existing bitmap to render onto - /// - /// scale the size of the output image by this fraction (without resizing the plot) - /// the same bitmap that was passed in (but was rendered onto) - public Bitmap Render(Bitmap bmp, bool lowQuality = false, double scale = 1.0) - { - while (IsRenderLocked) { } - IsRendering = true; - - settings.BenchmarkMessage.Restart(); - settings.Resize((int)(bmp.Width / scale), (int)(bmp.Height / scale)); - settings.CopyPrimaryLayoutToAllAxes(); - settings.AxisAutoUnsetAxes(); - settings.EnforceEqualAxisScales(); - settings.LayoutAuto(); - if (settings.EqualScaleMode != EqualScaleMode.Disabled) - { - settings.EnforceEqualAxisScales(); - settings.LayoutAuto(); - } - - PlotDimensions primaryDims = settings.GetPlotDimensions(0, 0, scale); - RenderClear(bmp, lowQuality, primaryDims); - if (primaryDims.DataWidth > 0 && primaryDims.DataHeight > 0) - { - RenderBeforePlottables(bmp, lowQuality, primaryDims); - RenderPlottables(bmp, lowQuality, scale); - RenderAfterPlottables(bmp, lowQuality, primaryDims); - } - - IsRendering = false; - return bmp; - } - - private void RenderClear(Bitmap bmp, bool lowQuality, PlotDimensions primaryDims) - { - settings.FigureBackground.Render(primaryDims, bmp, lowQuality); - } - - private void RenderBeforePlottables(Bitmap bmp, bool lowQuality, PlotDimensions dims) - { - settings.DataBackground.Render(dims, bmp, lowQuality); - - foreach (var axis in settings.Axes) - { - PlotDimensions dims2 = axis.IsHorizontal ? - settings.GetPlotDimensions(axis.AxisIndex, 0, dims.ScaleFactor) : - settings.GetPlotDimensions(0, axis.AxisIndex, dims.ScaleFactor); - - try - { - axis.Render(dims2, bmp, lowQuality); - } - catch (OverflowException) - { - throw new InvalidOperationException("data cannot contain Infinity"); - } - } - } - - private void RenderPlottables(Bitmap bmp, bool lowQuality, double scaleFactor) - { - foreach (var plottable in settings.Plottables) - { - if (plottable.IsVisible == false) - { - continue; - } - - plottable.ValidateData(deep: false); - - PlotDimensions dims = (plottable is IPlottable p) ? - settings.GetPlotDimensions(p.XAxisIndex, p.YAxisIndex, scaleFactor) : - settings.GetPlotDimensions(0, 0, scaleFactor); - - try - { - plottable.Render(dims, bmp, lowQuality); - } - catch (OverflowException) - { - Debug.WriteLine($"OverflowException plotting: {plottable}"); - } - } - } - - private void RenderAfterPlottables(Bitmap bmp, bool lowQuality, PlotDimensions dims) - { - settings.CornerLegend.UpdateLegendItems(GetPlottables()); - settings.CornerLegend.Render(dims, bmp, lowQuality); - - settings.BenchmarkMessage.Stop(); - - settings.ZoomRectangle.Render(dims, bmp, lowQuality); - settings.BenchmarkMessage.Render(dims, bmp, lowQuality); - settings.ErrorMessage.Render(dims, bmp, lowQuality); - } - - #endregion - - #region render lock - - private bool IsRendering = false; // Becomes true only while the render loop is running and not locked - private bool IsRenderLocked = false; // RenderBitmap() will hang infinitely while this is true - - /// - /// Wait for the current render to finish, then prevent future renders until RenderUnlock() is called. - /// Locking rendering is required if you intend to modify plottables while rendering is occurring in another thread. - /// - public void RenderLock() - { - IsRenderLocked = true; // prevent new renders from starting - while (IsRendering) { } // wait for the current render to finish - } - - /// - /// Release the render lock, allowing renders to proceed. - /// - public void RenderUnlock() - { - IsRenderLocked = false; // allow new renders to occur - } - - #endregion - - #region render helper methods - - /// - /// Render the plot onto a new Bitmap (using the size given when the plot was created or resized) - /// - /// if true, anti-aliasing will be disabled for this render - /// the Bitmap that was created - public Bitmap Render(bool lowQuality = false) => - Render(settings.Width, settings.Height, lowQuality); - - /// - /// Render the plot onto a new Bitmap of the given dimensions - /// - /// resize the plot to this width (pixels) before rendering - /// resize the plot to this height (pixels) before rendering - /// if true, anti-aliasing will be disabled for this render - /// scale the size of the output image by this fraction (without resizing the plot) - /// the Bitmap that was created - public Bitmap Render(int width, int height, bool lowQuality = false, double scale = 1.0) - { - // allow a bitmap to always be created even if invalid dimensions are provided - width = Math.Max(1, (int)(width * scale)); - height = Math.Max(1, (int)(height * scale)); - - Bitmap bmp = new(width, height, PixelFormat.Format32bppPArgb); - Render(bmp, lowQuality, scale); - return bmp; - } - - /// - /// Create a new Bitmap, render the plot onto it, and return it - /// - public Bitmap GetBitmap(bool lowQuality = false, double scale = 1.0) => Render(settings.Width, settings.Height, lowQuality, scale); - - /// - /// Render the plot and return the bytes for a PNG file. - /// This method is useful for rendering in stateless cloud environments that do not use a traditional filesystem. - /// - /// - public byte[] GetImageBytes(bool lowQuality = false, double scale = 1.0) - { - using MemoryStream stream = new(); - Bitmap bmp = GetBitmap(lowQuality, scale); - bmp.Save(stream, ImageFormat.Png); - byte[] imageBytes = stream.ToArray(); - return imageBytes; - } - - /// - /// Return a new Bitmap containing only the legend - /// - /// new bitmap containing the legend - public Bitmap RenderLegend(bool lowQuality = false, double scale = 1.0) - { - Render(lowQuality); - var originalEdgeColor = settings.CornerLegend.OutlineColor; - settings.CornerLegend.OutlineColor = Color.Transparent; - var bmp = settings.CornerLegend.GetBitmap(lowQuality, scale); - settings.CornerLegend.OutlineColor = originalEdgeColor; - return bmp; - } - - /// - /// Save the plot as an image - /// - /// file path for the images (existing files will be overwritten) - /// resize the plot to this width (pixels) before rendering - /// resize the plot to this height (pixels) before rendering - /// if true, anti-aliasing will be disabled for this render. Default false - /// scale the size of the output image by this fraction (without resizing the plot) - /// Full path for the image that was saved - public string SaveFig(string filePath, int? width = null, int? height = null, bool lowQuality = false, double scale = 1.0) - { - Bitmap bmp = Render(width: width ?? settings.Width, height: height ?? settings.Height, lowQuality, scale); - - filePath = Path.GetFullPath(filePath); - string fileFolder = Path.GetDirectoryName(filePath); - if (!Directory.Exists(fileFolder)) - { - throw new Exception($"ERROR: folder does not exist: {fileFolder}"); - } - - ImageFormat imageFormat; - string extension = Path.GetExtension(filePath).ToUpper(); - - switch (extension) - { - case @".JPG": - imageFormat = ImageFormat.Jpeg; - break; - case @".JPEG": - imageFormat = ImageFormat.Jpeg; - break; - case @".PNG": - imageFormat = ImageFormat.Png; - break; - case @".TIF": - imageFormat = ImageFormat.Tiff; - break; - case @".TIFF": - imageFormat = ImageFormat.Tiff; - break; - case @".BMP": - imageFormat = ImageFormat.Bmp; - break; - default: - throw new NotImplementedException($"Extension not supported: {extension}"); - } - - bmp.Save(filePath, imageFormat); - return filePath; - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plot/Plot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plot/Plot.cs deleted file mode 100644 index 75d850080..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plot/Plot.cs +++ /dev/null @@ -1,392 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public partial class Plot - { - /// - /// The settings object stores all state (configuration and data) for a plot - /// - private readonly Settings settings = new Settings(); - - /// - /// Plot image width (pixels) - /// - public float Width { get => settings.Width; set => Resize(value, settings.Height); } - - /// - /// Plot image height (pixels) - /// - public float Height { get => settings.Height; set => Resize(settings.Width, value); } - - /// - /// A ScottPlot stores data in plottable objects and draws it on a bitmap when Render() is called - /// - /// default width (pixels) to use when rendering - /// default height (pixels) to use when rendering - public Plot(int width = 800, int height = 600) - { - if (width <= 0 || height <= 0) - { - throw new ArgumentException("width and height must each be greater than 0"); - } - - Style(ScottPlot.Style.Default); - Resize(width, height); - } - - /// - /// Brief description of this plot - /// - /// plot description - public override string ToString() => - $"ScottPlot ({settings.Width}x{settings.Height}) with {settings.Plottables.Count:n0} plottables"; - - /// - /// ScottPlot version in the format "1.2.3" (or "1.2.3-beta" for pre-releases) - /// - public static string Version - { - get - { - Version v = typeof(Plot).Assembly.GetName().Version; - string versionString = $"{v.Major}.{v.Minor}.{v.Build}"; - return versionString; - } - } - - #region add, clear, and remove plottables - - /// - /// Add a plottable to the plot - /// - /// a plottable the user created - public void Add(IPlottable plottable) - { - settings.Plottables.Add(plottable); - } - - /// - /// Clear all plottables - /// - public void Clear() - { - settings.Plottables.Clear(); - settings.ResetAxisLimits(); - } - - /// - /// Remove all plottables of the given type - /// - /// all plottables of this type will be removed - public void Clear(Type plottableType) - { - var plottablesWithSameType = settings.Plottables.Where(x => x.GetType() == plottableType).ToList(); - - while (plottablesWithSameType.Count > 0) - { - settings.Plottables.Remove(plottablesWithSameType[0]); - plottablesWithSameType.RemoveAt(0); - } - - if (settings.Plottables.Count == 0) - { - settings.ResetAxisLimits(); - } - } - - /// - /// Remove a specific plottable - /// - /// The plottable to remove - public void Remove(IPlottable plottable) - { - settings.Plottables.Remove(plottable); - - if (settings.Plottables.Count == 0) - { - settings.ResetAxisLimits(); - } - } - - /// - /// Remove the plottable at the specified index of the list - /// - /// The zero-based index of the element to remove - public void RemoveAt(int index) - { - settings.Plottables.RemoveAt(index); - - if (settings.Plottables.Count == 0) - { - settings.ResetAxisLimits(); - } - } - - /// - /// Move a plottable in the list. Plottables near the end are rendered last (on top). - /// - public void Move(int oldIndex, int newIndex) => settings.Plottables.Move(oldIndex, newIndex); - - /// - /// Move a plottable to the front so it is rendered first and appears beneath all others. - /// - public void MoveFirst(IPlottable plottable) - { - settings.Plottables.Remove(plottable); - settings.Plottables.Insert(0, plottable); - } - - /// - /// Move a plottable to the end so it is rendered last and appears above all others. - /// - public void MoveLast(IPlottable plottable) - { - settings.Plottables.Remove(plottable); - settings.Plottables.Add(plottable); - } - - /// - /// Return a copy of the list of plottables - /// - /// list of plottables - public IPlottable[] GetPlottables() => settings.Plottables.ToArray(); - - #endregion - - #region plottable validation - - /// - /// Throw an exception if any plottable contains an invalid state. - /// - /// Check every individual value for validity. This is more thorough, but slower. - public void Validate(bool deep = true) - { - foreach (var plottable in settings.Plottables) - { - plottable.ValidateData(deep); - } - } - - #endregion - - #region plot settings and styling - - /// - /// The Settings module stores manages plot state and advanced configuration. - /// Its class structure changes frequently, and users are highly advised not to interact with it directly. - /// This method returns the settings module for advanced users and developers to interact with. - /// - /// Show a warning message indicating this method is only intended for developers - /// Settings used by the plot - public Settings GetSettings(bool showWarning = true) - { - if (showWarning) - { - Debug.WriteLine("WARNING: GetSettings() is only for development and testing. " + - "Be aware its class structure changes frequently!"); - } - - return settings; - } - - /// - /// Update the default size for new renders - /// - /// width (pixels) for future renders - /// height (pixels) for future renders - public void Resize(float width, float height) => settings.Resize(width, height); - - /// - /// Return a new color from the Pallette based on the number of plottables already in the plot. - /// Use this to ensure every plottable gets a unique color. - /// - /// value from 0 (transparent) to 1 (opaque) - /// new color - public Color GetNextColor(double alpha = 1) => Color.FromArgb((byte)(alpha * 255), settings.GetNextColor()); - - /// - /// The palette defines default colors to use for new plottables. - /// - public ScottPlotPalette Palette - { - get => settings.PlottablePalette; - set => settings.PlottablePalette = value ?? throw new ArgumentNullException(); - } - - /// - /// Set the colors and fonts of many plot components at once using a predefined theme - /// - public void Style(IStyle style) - { - if (style is null) - { - throw new ArgumentException(nameof(style)); - } - - settings.FigureBackground.Color = style.FigureBackgroundColor; - settings.DataBackground.Color = style.DataBackgroundColor; - - foreach (var axis in settings.Axes) - { - axis.LabelStyle(color: style.AxisLabelColor, fontName: style.AxisLabelFontName); - axis.TickLabelStyle(color: style.TickLabelColor, fontName: style.TickLabelFontName); - axis.MajorGrid(color: style.GridLineColor); - axis.MinorGrid(color: style.GridLineColor); - axis.TickMarkColor(majorColor: style.TickMajorColor, minorColor: style.TickMinorColor); - axis.Line(color: style.FrameColor); - } - - XAxis2.LabelStyle(color: style.TitleFontColor, fontName: style.TitleFontName); - } - - /// - /// Set the color of specific plot components - /// - /// Color for area beneath the axis ticks and labels and around the data area - /// Color for area inside the data frame but beneath the grid and plottables - /// Color for grid lines - /// Color for axis tick marks and frame lines - /// Color for axis labels and tick labels - /// Color for the top axis label (XAxis2's title) - public void Style( - Color? figureBackground = null, - Color? dataBackground = null, - Color? grid = null, - Color? tick = null, - Color? axisLabel = null, - Color? titleLabel = null) - { - settings.FigureBackground.Color = figureBackground ?? settings.FigureBackground.Color; - settings.DataBackground.Color = dataBackground ?? settings.DataBackground.Color; - - foreach (var axis in settings.Axes) - { - axis.Label(color: axisLabel); - axis.TickLabelStyle(color: tick); - axis.MajorGrid(color: grid); - axis.MinorGrid(color: grid); - if (tick.HasValue) - { - axis.TickMarkColor(color: tick.Value); - } - - axis.Line(color: tick); - } - - XAxis2.Label(color: titleLabel); - } - - #endregion - - #region renderable customization - /// - /// If enabled, the benchmark displays render information in the corner of the plot. - /// - /// True/false defines whether benchmark is enabled. Null will not change the benchmark. - /// true if the benchmark is enabled - public bool Benchmark(bool? enable = true) - { - if (enable.HasValue) - { - settings.BenchmarkMessage.IsVisible = enable.Value; - } - - return settings.BenchmarkMessage.IsVisible; - } - - /// - /// Configure legend visibility and location. - /// Optionally you can further customize the legend by interacting with the object it returns. - /// - /// whether or not the legend is visible - /// position of the legend relative to the data area - /// The legend itself. Use public fields to further customize its appearance and behavior. - public Legend Legend(bool enable = true, Alignment location = Alignment.LowerRight) - { - settings.CornerLegend.IsVisible = enable; - settings.CornerLegend.Location = location; - return settings.CornerLegend; - } - - #endregion - - #region copy and equals - - /// - /// Return a new Plot with all the same Plottables (and some of the styles) of this one. - /// - /// A new plot similar to this one. - public Plot Copy() - { - Settings oldSettings = settings; - Plot oldPlot = this; - - Plot newPlot = new Plot(oldSettings.Width, oldSettings.Height); - - foreach (IPlottable oldPlottable in oldPlot.GetPlottables()) - { - newPlot.Add(oldPlottable); - } - - newPlot.AxisAuto(); - - newPlot.XLabel(oldSettings.XAxis.Label()); - newPlot.YLabel(oldSettings.YAxis.Label()); - newPlot.Title(oldSettings.XAxis2.Label()); - - return newPlot; - } - - /// - /// The GUID helps identify individual plots - /// - private readonly Guid Guid = Guid.NewGuid(); - - /// - /// Every plot has a globally unique ID (GUID) that can help differentiate it from other plots - /// - /// A string representing the GUID - public string GetGuid() => Guid.ToString(); - - /// - /// Returns true if the given plot is the exact same plot as this one - /// - /// the plot to compare this one to - /// true if the two plots have the same GUID - public override bool Equals(object obj) => obj.GetHashCode() == GetHashCode(); - - /// - /// Returns an integer unique to this instance (based on the GUID) - /// - /// An integer representing the GUID - public override int GetHashCode() => Guid.GetHashCode(); - - #endregion - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Annotation.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Annotation.cs deleted file mode 100644 index fa5075b82..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Annotation.cs +++ /dev/null @@ -1,123 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Text placed at a location relative to the data area that does not move when the axis limits change - /// - public class Annotation : IPlottable - { - /// - /// Horizontal location (in pixel units) relative to the data area - /// - public double X; - - /// - /// Vertical position (in pixel units) relative to the data area - /// - public double Y; - - /// - /// Text displayed in the annotation - /// - public string Label; - - public readonly Font Font = new Font(); - - public bool Background = true; - public Color BackgroundColor = Color.Yellow; - - public bool Shadow = true; - public Color ShadowColor = Color.FromArgb(25, Color.Black); - - public bool Border = true; - public float BorderWidth = 1; - public Color BorderColor = Color.Black; - - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - - public override string ToString() => $"PlottableAnnotation at ({X} px, {Y} px)"; - public LegendItem[]? GetLegendItems() => null; - public AxisLimits GetAxisLimits() => new AxisLimits(double.NaN, double.NaN, double.NaN, double.NaN); - - public void ValidateData(bool deep = false) - { - if (double.IsNaN(X) || double.IsInfinity(X)) - { - throw new InvalidOperationException("xPixel must be a valid number"); - } - - if (double.IsNaN(Y) || double.IsInfinity(Y)) - { - throw new InvalidOperationException("xPixel must be a valid number"); - } - } - - // TODO: the negative coordiante thing is silly. Use alignment fields to control this behavior. - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - if (!IsVisible) - { - return; - } - - using var gfx = GDI.Graphics(bmp, dims, lowQuality, false); - using var font = GDI.Font(Font); - using var fontBrush = new SolidBrush(Font.Color); - using var shadowBrush = new SolidBrush(ShadowColor); - using var backgroundBrush = new SolidBrush(BackgroundColor); - using var borderPen = new Pen(BorderColor, BorderWidth); - - SizeF size = GDI.MeasureString(gfx, Label, font); - - double x = (X >= 0) ? X : dims.DataWidth + X - size.Width; - double y = (Y >= 0) ? Y : dims.DataHeight + Y - size.Height; - PointF location = new PointF((float)x + dims.DataOffsetX, (float)y + dims.DataOffsetY); - - if (Background && Shadow) - { - gfx.FillRectangle(shadowBrush, location.X + 5, location.Y + 5, size.Width, size.Height); - } - - if (Background) - { - gfx.FillRectangle(backgroundBrush, location.X, location.Y, size.Width, size.Height); - } - - if (Border) - { - gfx.DrawRectangle(borderPen, location.X, location.Y, size.Width, size.Height); - } - - gfx.DrawString(Label, font, fontBrush, location); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/ArrowCoordinated.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/ArrowCoordinated.cs deleted file mode 100644 index 27d4463b6..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/ArrowCoordinated.cs +++ /dev/null @@ -1,166 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// An arrow with X/Y coordinates for the base and the tip - /// - public class ArrowCoordinated : IPlottable - { - /// - /// Location of the arrow base in coordinate space - /// - public readonly Coordinate Base = new(0, 0); - - /// - /// Location of the arrow base in coordinate space - /// - public readonly Coordinate Tip = new(0, 0); - - /// - /// Color of the arrow and arrowhead - /// - public Color Color = Color.Black; - - /// - /// Thickness of the arrow line - /// - public double LineWidth = 2; - - /// - /// Style of the arrow line - /// - public LineStyle LineStyle = LineStyle.Solid; - - /// - /// Label to appear in the legend - /// - public string Label; - - /// - /// Width of the arrowhead (pixels) - /// - public double ArrowheadWidth = 3; - - /// - /// Height of the arrowhead (pixels) - /// - public double ArrowheadLength = 3; - - /// - /// The arrow will be lengthened to ensure it is at least this size on the screen - /// - public float MinimumLengthPixels = 0; - - /// - /// Marker to be drawn at the base (if MarkerSize > 0) - /// - public MarkerShape MarkerShape = MarkerShape.FilledCircle; - - /// - /// Size of marker (in pixels) to draw at the base - /// - public float MarkerSize = 0; - - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - - public ArrowCoordinated(Coordinate arrowBase, Coordinate arrowTip) - { - Base.X = arrowBase.X; - Base.Y = arrowTip.Y; - Tip.X = arrowTip.X; - Tip.Y = arrowTip.Y; - } - - public ArrowCoordinated(double xBase, double yBase, double xTip, double yTip) - { - Base.X = xBase; - Base.Y = yBase; - Tip.X = xTip; - Tip.Y = yTip; - } - - public AxisLimits GetAxisLimits() - { - double xMin = Math.Min(Base.X, Tip.X); - double xMax = Math.Max(Base.X, Tip.X); - double yMin = Math.Min(Base.Y, Tip.Y); - double yMax = Math.Max(Base.Y, Tip.Y); - return new AxisLimits(xMin, xMax, yMin, yMax); - } - - public LegendItem[] GetLegendItems() - { - var item = new LegendItem() - { - label = Label - }; - return new[] { item }; - } - - public void ValidateData(bool deep = false) - { - if (!Base.IsFinite() || !Tip.IsFinite()) - { - throw new InvalidOperationException("Base and Tip coordinates must be finite"); - } - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - if (IsVisible == false) - { - return; - } - - using Graphics gfx = GDI.Graphics(bmp, dims, lowQuality); - using Pen penLine = GDI.Pen(Color, LineWidth, LineStyle, true); - - Pixel basePixel = dims.GetPixel(Base); - Pixel tipPixel = dims.GetPixel(Tip); - - float lengthPixels = basePixel.Distance(tipPixel); - if (lengthPixels < MinimumLengthPixels) - { - float expandBy = MinimumLengthPixels / lengthPixels; - float dX = tipPixel.X - basePixel.X; - float dY = tipPixel.Y - basePixel.Y; - basePixel.X = tipPixel.X - dX * expandBy; - basePixel.Y = tipPixel.Y - dY * expandBy; - } - - MarkerTools.DrawMarker(gfx, new(basePixel.X, basePixel.Y), MarkerShape, MarkerSize, Color); - - penLine.CustomEndCap = new AdjustableArrowCap((float)ArrowheadWidth, (float)ArrowheadLength, true); - penLine.StartCap = LineCap.Flat; - gfx.DrawLine(penLine, basePixel.X, basePixel.Y, tipPixel.X, tipPixel.Y); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/AxisLine.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/AxisLine.cs deleted file mode 100644 index 00d9c0728..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/AxisLine.cs +++ /dev/null @@ -1,324 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public abstract class AxisLine : IDraggable, IPlottable - { - /// - /// Location of the line (Y position if horizontal line, X position if vertical line) - /// - protected double Position; - - /// - /// If True, the position will be labeled on the axis using the PositionFormatter - /// - public bool PositionLabel = false; - - /// - /// Font to use for position labels (labels drawn over the axis) - /// - public Font PositionLabelFont = new() { Color = Color.White, Bold = true }; - - /// - /// Color to use behind the position labels - /// - public Color PositionLabelBackground = Color.Black; - - /// - /// If true the position label will be drawn on the right or top of the data area. - /// - public bool PositionLabelOppositeAxis = false; - - /// - /// This method generates the position label text for numeric (non-DateTime) axes. - /// For DateTime axes assign your own format string that uses DateTime.FromOADate(position). - /// - public Func PositionFormatter = position => position.ToString("F2"); - - /// - /// Position of the axis line in DateTime (OADate) units. - /// - public DateTime DateTime - { - get => DateTime.FromOADate(Position); - set => Position = value.ToOADate(); - } - - /// - /// Indicates whether the line is horizontal (position in Y units) or vertical (position in X units) - /// - private readonly bool _isHorizontal; - - /// - /// If true, AxisAuto() will ignore the position of this line when determining axis limits - /// - public bool IgnoreAxisAuto = false; - - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - public LineStyle LineStyle = LineStyle.Solid; - public float LineWidth = 1; - public Color Color = Color.Black; - - /// - /// Text that appears in the legend - /// - public string Label; - - /// - /// Indicates whether this line is draggable in user controls. - /// - public bool DragEnabled { get; set; } = false; - - /// - /// Cursor to display while hovering over this line if dragging is enabled. - /// - public Cursor DragCursor => _isHorizontal ? Cursor.NS : Cursor.WE; - - /// - /// If dragging is enabled the line cannot be dragged more negative than this position - /// - public double DragLimitMin = double.NegativeInfinity; - - /// - /// If dragging is enabled the line cannot be dragged more positive than this position - /// - public double DragLimitMax = double.PositiveInfinity; - - /// - /// This event is invoked after the line is dragged - /// - public event EventHandler Dragged = delegate { }; - - /// - /// The lower bound of the axis line. - /// - public double Min = double.NegativeInfinity; - - /// - /// The upper bound of the axis line. - /// - public double Max = double.PositiveInfinity; - - public AxisLine(bool isHorizontal) - { - _isHorizontal = isHorizontal; - } - - public AxisLimits GetAxisLimits() - { - if (IgnoreAxisAuto) - { - return new AxisLimits(double.NaN, double.NaN, double.NaN, double.NaN); - } - - if (_isHorizontal) - { - return new AxisLimits(double.NaN, double.NaN, Position, Position); - } - else - { - return new AxisLimits(Position, Position, double.NaN, double.NaN); - } - } - - public void ValidateData(bool deep = false) - { - if (double.IsNaN(Position) || double.IsInfinity(Position)) - { - throw new InvalidOperationException("position must be a valid number"); - } - - if (PositionFormatter is null) - { - throw new NullReferenceException(nameof(PositionFormatter)); - } - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - if (!IsVisible) - { - return; - } - - RenderLine(dims, bmp, lowQuality); - - if (PositionLabel) - { - RenderPositionLabel(dims, bmp, lowQuality); - } - } - - public void RenderLine(PlotDimensions dims, Bitmap bmp, bool lowQuality) - { - using var gfx = GDI.Graphics(bmp, dims, lowQuality); - using var pen = GDI.Pen(Color, LineWidth, LineStyle, true); - - if (_isHorizontal) - { - float pixelY = dims.GetPixelY(Position); - - double xMin = Math.Max(Min, dims.XMin); - double xMax = Math.Min(Max, dims.XMax); - float pixelX1 = dims.GetPixelX(xMin); - float pixelX2 = dims.GetPixelX(xMax); - - gfx.DrawLine(pen, pixelX1, pixelY, pixelX2, pixelY); - } - else - { - float pixelX = dims.GetPixelX(Position); - - double yMin = Math.Max(Min, dims.YMin); - double yMax = Math.Min(Max, dims.YMax); - float pixelY1 = dims.GetPixelY(yMin); - float pixelY2 = dims.GetPixelY(yMax); - - gfx.DrawLine(pen, pixelX, pixelY1, pixelX, pixelY2); - } - } - - private void RenderPositionLabel(PlotDimensions dims, Bitmap bmp, bool lowQuality) - { - using var gfx = GDI.Graphics(bmp, dims, lowQuality, clipToDataArea: false); - using var pen = GDI.Pen(Color, LineWidth, LineStyle, true); - - using var fnt = GDI.Font(PositionLabelFont); - using var fillBrush = GDI.Brush(PositionLabelBackground); - using var fontBrush = GDI.Brush(PositionLabelFont.Color); - - if (_isHorizontal) - { - if (Position > dims.YMax || Position < dims.YMin) - { - return; - } - - float pixelY = dims.GetPixelY(Position); - string yLabel = PositionFormatter(Position); - SizeF yLabelSize = GDI.MeasureString(yLabel, PositionLabelFont); - float xPos = PositionLabelOppositeAxis ? dims.DataOffsetX + dims.DataWidth : dims.DataOffsetX - yLabelSize.Width; - float yPos = pixelY - yLabelSize.Height / 2; - RectangleF xLabelRect = new(xPos, yPos, yLabelSize.Width, yLabelSize.Height); - gfx.FillRectangle(fillBrush, xLabelRect); - var sf = GDI.StringFormat(HorizontalAlignment.Left, VerticalAlignment.Middle); - gfx.DrawString(yLabel, fnt, fontBrush, xPos, pixelY, sf); - } - else - { - if (Position > dims.XMax || Position < dims.XMin) - { - return; - } - - float pixelX = dims.GetPixelX(Position); - string xLabel = PositionFormatter(Position); - SizeF xLabelSize = GDI.MeasureString(xLabel, PositionLabelFont); - float xPos = pixelX - xLabelSize.Width / 2; - float yPos = PositionLabelOppositeAxis ? dims.DataOffsetY - xLabelSize.Height : dims.DataOffsetY + dims.DataHeight; - RectangleF xLabelRect = new(xPos, yPos, xLabelSize.Width, xLabelSize.Height); - gfx.FillRectangle(fillBrush, xLabelRect); - var sf = GDI.StringFormat(HorizontalAlignment.Center, VerticalAlignment.Upper); - gfx.DrawString(xLabel, fnt, fontBrush, pixelX, yPos, sf); - } - } - - /// - /// Move the line to a new coordinate in plot space. - /// - /// new X position - /// new Y position - /// This argument is ignored - public void DragTo(double coordinateX, double coordinateY, bool fixedSize) - { - if (!DragEnabled) - { - return; - } - - if (_isHorizontal) - { - if (coordinateY < DragLimitMin) - { - coordinateY = DragLimitMin; - } - - if (coordinateY > DragLimitMax) - { - coordinateY = DragLimitMax; - } - - Position = coordinateY; - } - else - { - if (coordinateX < DragLimitMin) - { - coordinateX = DragLimitMin; - } - - if (coordinateX > DragLimitMax) - { - coordinateX = DragLimitMax; - } - - Position = coordinateX; - } - - Dragged(this, EventArgs.Empty); - } - - /// - /// Return True if the line is within a certain number of pixels (snap) to the mouse - /// - /// mouse position (coordinate space) - /// mouse position (coordinate space) - /// snap distance (pixels) - /// snap distance (pixels) - /// - public bool IsUnderMouse(double coordinateX, double coordinateY, double snapX, double snapY) => - _isHorizontal ? - Math.Abs(Position - coordinateY) <= snapY : - Math.Abs(Position - coordinateX) <= snapX; - - public LegendItem[] GetLegendItems() - { - var singleItem = new LegendItem() - { - label = Label, - color = Color, - lineStyle = LineStyle, - lineWidth = LineWidth, - markerShape = MarkerShape.None - }; - return new[] { singleItem }; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/AxisSpan.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/AxisSpan.cs deleted file mode 100644 index 7dacddab4..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/AxisSpan.cs +++ /dev/null @@ -1,271 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Shaded horizontal region between two X values - /// - public class HSpan : AxisSpan - { - public double X1 { get => Position1; set => Position1 = value; } - public double X2 { get => Position2; set => Position2 = value; } - public HSpan() : base(true) { } - public override string ToString() => $"Horizontal span between Y1={X1} and Y2={X2}"; - } - - /// - /// Shade the region between two Y values - /// - public class VSpan : AxisSpan - { - public double Y1 { get => Position1; set => Position1 = value; } - public double Y2 { get => Position2; set => Position2 = value; } - public VSpan() : base(false) { } - public override string ToString() => $"Vertical span between X1={Y1} and X2={Y2}"; - } - - public abstract class AxisSpan : IPlottable, IDraggable - { - // location and orientation - protected double Position1; - protected double Position2; - private double Min => Math.Min(Position1, Position2); - private double Max => Math.Max(Position1, Position2); - readonly bool _isHorizontal; - - /// - /// If true, AxisAuto() will ignore the position of this span when determining axis limits - /// - public bool IgnoreAxisAuto = false; - - // configuration - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - public bool IsVisible { get; set; } = true; - public Color Color = Color.FromArgb(128, Color.Magenta); - public string Label; - - // mouse interaction - public bool DragEnabled { get; set; } - public bool DragFixedSize { get; set; } - public double DragLimitMin = double.NegativeInfinity; - public double DragLimitMax = double.PositiveInfinity; - public Cursor DragCursor => _isHorizontal ? Cursor.WE : Cursor.NS; - - /// - /// This event is invoked after the line is dragged - /// - public event EventHandler Dragged = delegate { }; - - public AxisSpan(bool isHorizontal) - { - _isHorizontal = isHorizontal; - } - - public void ValidateData(bool deep = false) - { - if (double.IsNaN(Position1) || double.IsInfinity(Position1)) - { - throw new InvalidOperationException("position1 must be a valid number"); - } - - if (double.IsNaN(Position2) || double.IsInfinity(Position2)) - { - throw new InvalidOperationException("position2 must be a valid number"); - } - } - - public LegendItem[]? GetLegendItems() - { - var singleItem = new LegendItem() - { - label = Label, - color = Color, - markerSize = 0, - lineWidth = 10 - }; - return new[] { singleItem }; - } - - public AxisLimits GetAxisLimits() - { - if (IgnoreAxisAuto) - { - return new AxisLimits(double.NaN, double.NaN, double.NaN, double.NaN); - } - - if (_isHorizontal) - { - return new AxisLimits(Min, Max, double.NaN, double.NaN); - } - else - { - return new AxisLimits(double.NaN, double.NaN, Min, Max); - } - } - - private enum Edge { Edge1, Edge2, Neither }; - Edge _edgeUnderMouse = Edge.Neither; - - /// - /// Return True if either span edge is within a certain number of pixels (snap) to the mouse - /// - /// mouse position (coordinate space) - /// mouse position (coordinate space) - /// snap distance (pixels) - /// snap distance (pixels) - /// - public bool IsUnderMouse(double coordinateX, double coordinateY, double snapX, double snapY) - { - if (_isHorizontal) - { - if (Math.Abs(Position1 - coordinateX) <= snapX) - { - _edgeUnderMouse = Edge.Edge1; - } - else if (Math.Abs(Position2 - coordinateX) <= snapX) - { - _edgeUnderMouse = Edge.Edge2; - } - else - { - _edgeUnderMouse = Edge.Neither; - } - } - else - { - if (Math.Abs(Position1 - coordinateY) <= snapY) - { - _edgeUnderMouse = Edge.Edge1; - } - else if (Math.Abs(Position2 - coordinateY) <= snapY) - { - _edgeUnderMouse = Edge.Edge2; - } - else - { - _edgeUnderMouse = Edge.Neither; - } - } - - return _edgeUnderMouse != Edge.Neither; - } - - /// - /// Move the span to a new coordinate in plot space. - /// - /// new X position - /// new Y position - /// if True, both edges will be moved to maintain the size of the span - public void DragTo(double coordinateX, double coordinateY, bool fixedSize) - { - if (!DragEnabled) - { - return; - } - - if (_isHorizontal) - { - coordinateX = Math.Max(coordinateX, DragLimitMin); - coordinateX = Math.Min(coordinateX, DragLimitMax); - } - else - { - coordinateY = Math.Max(coordinateY, DragLimitMin); - coordinateY = Math.Min(coordinateY, DragLimitMax); - } - - double sizeBeforeDrag = Position2 - Position1; - if (_edgeUnderMouse == Edge.Edge1) - { - Position1 = _isHorizontal ? coordinateX : coordinateY; - if (DragFixedSize || fixedSize) - { - Position2 = Position1 + sizeBeforeDrag; - } - } - else if (_edgeUnderMouse == Edge.Edge2) - { - Position2 = _isHorizontal ? coordinateX : coordinateY; - if (DragFixedSize || fixedSize) - { - Position1 = Position2 - sizeBeforeDrag; - } - } - else - { - Debug.WriteLine("DragTo() called but no side selected. Call IsUnderMouse() to select a side."); - } - - // ensure fixed-width spans stay entirely inside the allowable range - double belowLimit = DragLimitMin - Position1; - double aboveLimit = Position2 - DragLimitMax; - if (belowLimit > 0) - { - Position1 += belowLimit; - Position2 += belowLimit; - } - if (aboveLimit > 0) - { - Position1 -= aboveLimit; - Position2 -= aboveLimit; - } - - Dragged(this, EventArgs.Empty); - } - - private RectangleF GetClippedRectangle(PlotDimensions dims) - { - // clip the rectangle to the size of the data area to avoid GDI rendering errors - float ClippedPixelX(double x) => dims.GetPixelX(Math.Max(dims.XMin, Math.Min(x, dims.XMax))); - float ClippedPixelY(double y) => dims.GetPixelY(Math.Max(dims.YMin, Math.Min(y, dims.YMax))); - - float left = _isHorizontal ? ClippedPixelX(Min) : dims.DataOffsetX; - float right = _isHorizontal ? ClippedPixelX(Max) : dims.DataOffsetX + dims.DataWidth; - float top = _isHorizontal ? dims.DataOffsetY : ClippedPixelY(Max); - float bottom = _isHorizontal ? dims.DataOffsetY + dims.DataHeight : ClippedPixelY(Min); - - float width = right - left + 1; - float height = bottom - top + 1; - - return new RectangleF(left, top, width, height); - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - using (var gfx = GDI.Graphics(bmp, dims, lowQuality)) - { - using (var brush = GDI.Brush(Color)) - { - RectangleF rect = GetClippedRectangle(dims); - gfx.FillRectangle(brush, rect); - } - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/BarPlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/BarPlot.cs deleted file mode 100644 index 14d6afc04..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/BarPlot.cs +++ /dev/null @@ -1,215 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Bar plots display a series of bars. - /// Positions are defined by Xs. - /// Heights are defined by Ys (relative to BaseValue and YOffsets). - /// - public class BarPlot : BarPlotBase, IPlottable - { - public string Label; - public Color FillColor = Color.Green; - public Color FillColorNegative = Color.Red; - public Color FillColorHatch = Color.Blue; - public HatchStyle HatchStyle = HatchStyle.None; - public float BorderLineWidth = 1; - - public BarPlot(double[] xs, double[] ys, double[]? yErr, double[]? yOffsets) : base() - { - if (ys is null || ys.Length == 0) - { - throw new InvalidOperationException("ys must be an array that contains elements"); - } - - if (xs != null && ys.Length != xs.Length) - { - throw new ArgumentException("bar plot Xs and Ys must have the same number of elements"); - } - - Values = ys; - Positions = xs ?? DataGen.Consecutive(ys.Length); - ValueErrors = yErr ?? DataGen.Zeros(ys.Length); - ValueOffsets = yOffsets ?? DataGen.Zeros(ys.Length); - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - using Graphics gfx = GDI.Graphics(bmp, dims, lowQuality); - for (int barIndex = 0; barIndex < Values.Length; barIndex++) - { - if (Orientation == PlotOrientation.Vertical) - { - RenderBarVertical(dims, gfx, Positions[barIndex] + PositionOffset, Values[barIndex], ValueErrors[barIndex], ValueOffsets[barIndex]); - } - else - { - RenderBarHorizontal(dims, gfx, Positions[barIndex] + PositionOffset, Values[barIndex], ValueErrors[barIndex], ValueOffsets[barIndex]); - } - } - } - - private void RenderBarVertical(PlotDimensions dims, Graphics gfx, double position, double value, double valueError, double yOffset) - { - // bar body - float centerPx = dims.GetPixelX(position); - double edge1 = position - BarWidth / 2; - double value1 = Math.Min(ValueBase, value) + yOffset; - double value2 = Math.Max(ValueBase, value) + yOffset; - double valueSpan = value2 - value1; - - var rect = new RectangleF( - x: dims.GetPixelX(edge1), - y: dims.GetPixelY(value2), - width: (float)(BarWidth * dims.PxPerUnitX), - height: (float)(valueSpan * dims.PxPerUnitY)); - - // errorbar - double error1 = value > 0 ? value2 - Math.Abs(valueError) : value1 - Math.Abs(valueError); - double error2 = value > 0 ? value2 + Math.Abs(valueError) : value1 + Math.Abs(valueError); - float capPx1 = dims.GetPixelX(position - ErrorCapSize * BarWidth / 2); - float capPx2 = dims.GetPixelX(position + ErrorCapSize * BarWidth / 2); - float errorPx2 = dims.GetPixelY(error2); - float errorPx1 = dims.GetPixelY(error1); - - RenderBarFromRect(rect, value < 0, gfx); - - if (ErrorLineWidth > 0 && valueError > 0) - { - using var errorPen = new Pen(ErrorColor, ErrorLineWidth); - gfx.DrawLine(errorPen, centerPx, errorPx1, centerPx, errorPx2); - gfx.DrawLine(errorPen, capPx1, errorPx1, capPx2, errorPx1); - gfx.DrawLine(errorPen, capPx1, errorPx2, capPx2, errorPx2); - } - - if (ShowValuesAboveBars) - { - using (var valueTextFont = GDI.Font(Font)) - { - using (var valueTextBrush = GDI.Brush(Font.Color)) - { - using (var sf = new StringFormat() { LineAlignment = StringAlignment.Far, Alignment = StringAlignment.Center }) - { - gfx.DrawString(value.ToString(CultureInfo.InvariantCulture), valueTextFont, valueTextBrush, centerPx, rect.Y, sf); - } - } - } - } - } - - private void RenderBarHorizontal(PlotDimensions dims, Graphics gfx, double position, double value, double valueError, double yOffset) - { - // bar body - float centerPx = dims.GetPixelY(position); - double edge2 = position + BarWidth / 2; - double value1 = Math.Min(ValueBase, value) + yOffset; - double value2 = Math.Max(ValueBase, value) + yOffset; - double valueSpan = value2 - value1; - var rect = new RectangleF( - x: dims.GetPixelX(value1), - y: dims.GetPixelY(edge2), - height: (float)(BarWidth * dims.PxPerUnitY), - width: (float)(valueSpan * dims.PxPerUnitX)); - - RenderBarFromRect(rect, value < 0, gfx); - - // errorbar - double error1 = value > 0 ? value2 - Math.Abs(valueError) : value1 - Math.Abs(valueError); - double error2 = value > 0 ? value2 + Math.Abs(valueError) : value1 + Math.Abs(valueError); - float capPx1 = dims.GetPixelY(position - ErrorCapSize * BarWidth / 2); - float capPx2 = dims.GetPixelY(position + ErrorCapSize * BarWidth / 2); - float errorPx2 = dims.GetPixelX(error2); - float errorPx1 = dims.GetPixelX(error1); - - if (ErrorLineWidth > 0 && valueError > 0) - { - using var errorPen = new Pen(ErrorColor, ErrorLineWidth); - gfx.DrawLine(errorPen, errorPx1, centerPx, errorPx2, centerPx); - gfx.DrawLine(errorPen, errorPx1, capPx2, errorPx1, capPx1); - gfx.DrawLine(errorPen, errorPx2, capPx2, errorPx2, capPx1); - } - - if (ShowValuesAboveBars) - { - using (var valueTextFont = GDI.Font(Font)) - { - using (var valueTextBrush = GDI.Brush(Font.Color)) - { - using (var sf = new StringFormat() { LineAlignment = StringAlignment.Center, Alignment = StringAlignment.Near }) - { - gfx.DrawString(value.ToString(CultureInfo.InvariantCulture), valueTextFont, valueTextBrush, rect.X + rect.Width, centerPx, sf); - } - } - } - } - } - - protected void RenderBarFromRect(RectangleF rect, bool negative, Graphics gfx) - { - using (var outlinePen = new Pen(BorderColor, BorderLineWidth)) - { - using (var fillBrush = GDI.Brush(negative ? FillColorNegative : FillColor, FillColorHatch, HatchStyle)) - { - gfx.FillRectangle(fillBrush, rect.X, rect.Y, rect.Width, rect.Height); - if (BorderLineWidth > 0) - { - gfx.DrawRectangle(outlinePen, rect.X, rect.Y, rect.Width, rect.Height); - } - } - } - } - - public override string ToString() - { - string label = string.IsNullOrWhiteSpace(Label) ? "" : $" ({Label})"; - return $"PlottableBar{label} with {Values.Length} bars"; - } - - public LegendItem[] GetLegendItems() - { - var singleItem = new LegendItem() - { - label = Label, - color = FillColor, - lineWidth = 10, - markerShape = MarkerShape.None, - hatchColor = FillColorHatch, - hatchStyle = HatchStyle, - borderColor = BorderColor, - borderWith = BorderLineWidth - }; - return new[] { singleItem }; - } - - public void ValidateData(bool deep = false) - { - // TODO: refactor entire data validation system for all plot types (triaged March 2021) - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/BarPlotBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/BarPlotBase.cs deleted file mode 100644 index a15c6d8d8..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/BarPlotBase.cs +++ /dev/null @@ -1,181 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public abstract class BarPlotBase - { - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - - /// - /// Orientation of the bars. - /// Default behavior is vertical so values are on the Y axis and positions are on the X axis. - /// - public PlotOrientation Orientation = PlotOrientation.Vertical; - - /// - /// The position of each bar defines where the left edge of the bar should be. - /// To center the bar at each position, adjust this value to be negative one-half of the BarWidth. - /// - public double PositionOffset { get; set; } - - /// - /// Size of each bar (along the axis defined by Orientation) relative to ValueBase - /// - public double[] Values { get; set; } - - /// - /// Location of the left edge of each bar. - /// To center bars on these positions, adjust PositionOffset to be negative one-half of the BarWidth. - /// - public double[] Positions { get; set; } - - /// - /// This array defines the base of each bar. - /// Unless the user specifically defines it, this will be an array of zeros. - /// - public double[] ValueOffsets { get; set; } - - /// - /// If populated, this array describes the height of errorbars for each bar - /// - public double[] ValueErrors { get; set; } - - /// - /// If true, errorbars will be drawn according to the values in the YErrors array - /// - public bool ShowValuesAboveBars { get; set; } - - /// - /// Bars are drawn from this level and extend according to the sizes defined in Values[] - /// - public double ValueBase { get; set; } - - /// - /// Width of bars defined in axis units. - /// If bars are evenly spaced, consider setting this to a fraction of the distance between the first two Positions. - /// - public double BarWidth = .8; - - /// - /// Width of the errorbar caps defined in axis units. - /// - public double ErrorCapSize = .4; - - /// - /// Thickness of the errorbar lines (pixel units) - /// - public float ErrorLineWidth = 1; - - /// - /// Outline each bar with this color. - /// Set this to transparent to disable outlines. - /// - public Color BorderColor = Color.Black; - - /// - /// Color of errorbar lines. - /// - public Color ErrorColor = Color.Black; - - /// - /// Font settings for labels drawn above the bars - /// - public readonly Font Font = new(); - - public virtual AxisLimits GetAxisLimits() - { - double valueMin = double.PositiveInfinity; - double valueMax = double.NegativeInfinity; - double positionMin = double.PositiveInfinity; - double positionMax = double.NegativeInfinity; - - for (int i = 0; i < Positions.Length; i++) - { - valueMin = Math.Min(valueMin, Values[i] - ValueErrors[i] + ValueOffsets[i]); - valueMax = Math.Max(valueMax, Values[i] + ValueErrors[i] + ValueOffsets[i]); - positionMin = Math.Min(positionMin, Positions[i]); - positionMax = Math.Max(positionMax, Positions[i]); - } - - valueMin = Math.Min(valueMin, ValueBase); - valueMax = Math.Max(valueMax, ValueBase); - - if (ShowValuesAboveBars) - { - valueMax += (valueMax - valueMin) * .1; // increase by 10% to accommodate label - } - - positionMin -= BarWidth / 2; - positionMax += BarWidth / 2; - - positionMin += PositionOffset; - positionMax += PositionOffset; - - return Orientation == PlotOrientation.Vertical ? - new AxisLimits(positionMin, positionMax, valueMin, valueMax) : - new AxisLimits(valueMin, valueMax, positionMin, positionMax); - } - - [Obsolete("Reference the 'Orientation' field instead of this field")] - public bool VerticalOrientation - { - get => Orientation == PlotOrientation.Vertical; - set => Orientation = value ? PlotOrientation.Vertical : PlotOrientation.Horizontal; - } - - [Obsolete("Reference the 'Orientation' field instead of this field")] - public bool HorizontalOrientation - { - get => Orientation == PlotOrientation.Horizontal; - set => Orientation = value ? PlotOrientation.Horizontal : PlotOrientation.Vertical; - } - - [Obsolete("Reference the 'Values' field instead of this field")] - public double[] Ys - { - get => Values; - set => Values = value; - } - - [Obsolete("Reference the 'Positions' field instead of this field")] - public double[] Xs - { - get => Positions; - set => Positions = value; - } - - [Obsolete("Reference the 'PositionOffset' field instead of this field", true)] - public double XOffset - { - get => PositionOffset; - set => PositionOffset = value; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/BubblePlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/BubblePlot.cs deleted file mode 100644 index b494ec129..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/BubblePlot.cs +++ /dev/null @@ -1,173 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Display circles of user-defined sizes and colors at specific X/Y positions - /// - public class BubblePlot : IPlottable - { - private struct Bubble - { - public double X; - public double Y; - public float Radius; - public Color FillColor; - public float EdgeWidth; - public Color EdgeColor; - } - - private readonly List Bubbles = new(); - - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - public override string ToString() => $"BubblePlot with {Bubbles.Count} bubbles"; - - /// - /// Clear all bubbles - /// - public void Clear() => Bubbles.Clear(); - - /// - /// Add a single bubble - /// - /// horizontal position (in coordinate space) - /// horizontal vertical (in coordinate space) - /// size of the bubble (in pixels) - /// - /// size of the outline (in pixels) - /// - public void Add(double x, double y, double radius, Color fillColor, double edgeWidth, Color edgeColor) - { - Bubbles.Add(new Bubble() - { - X = x, - Y = y, - Radius = (float)radius, - FillColor = fillColor, - EdgeWidth = (float)edgeWidth, - EdgeColor = edgeColor - }); - } - - /// - /// Add many bubbles with the same size and style - /// - public void Add(double[] xs, double[] ys, double size, Color fillColor, double edgeWidth, Color edgeColor) - { - if (xs is null || ys is null) - { - throw new ArgumentException("xs and ys cannot be null"); - } - - if (xs.Length != ys.Length) - { - throw new ArgumentException("xs and ys must have the same number of elements"); - } - - for (int i = 0; i < xs.Length; i++) - { - Bubbles.Add(new Bubble() - { - X = xs[i], - Y = ys[i], - Radius = (float)size, - FillColor = fillColor, - EdgeWidth = (float)edgeWidth, - EdgeColor = edgeColor - }); - } - } - - public LegendItem[]? GetLegendItems() => null; // does not appear in legend - - public AxisLimits GetAxisLimits() - { - if (Bubbles.Count == 0) - { - return new AxisLimits(double.NaN, double.NaN, double.NaN, double.NaN); - } - - var xs = Bubbles.Select(b => b.X); - var ys = Bubbles.Select(b => b.Y); - return new AxisLimits(xs.Min(), xs.Max(), ys.Min(), ys.Max()); - } - - public void ValidateData(bool deep = false) - { - foreach (Bubble bubble in Bubbles) - { - if (double.IsNaN(bubble.X) || double.IsNaN(bubble.Y) || double.IsNaN(bubble.Radius) || double.IsNaN(bubble.EdgeWidth)) - { - throw new InvalidOperationException("Bubble positions and sizes must not be NaN"); - } - - if (double.IsInfinity(bubble.X) || double.IsInfinity(bubble.Y) || double.IsInfinity(bubble.Radius) || double.IsInfinity(bubble.EdgeWidth)) - { - throw new InvalidOperationException("Bubble position and size must real"); - } - - if (bubble.Radius < 0 || bubble.EdgeWidth < 0) - { - throw new InvalidOperationException("Bubble sizes cannot be negative"); - } - } - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - if (IsVisible == false) - { - return; - } - - using Graphics gfx = GDI.Graphics(bmp, dims, lowQuality); - using Brush brush = GDI.Brush(Color.Magenta); - using Pen pen = GDI.Pen(Color.Black); - - foreach (Bubble bubble in Bubbles) - { - float pixelX = dims.GetPixelX(bubble.X); - float pixelY = dims.GetPixelY(bubble.Y); - float radiusPx = (float)bubble.Radius; - - PointF location = new(pixelX - radiusPx, pixelY - radiusPx); - SizeF size = new(radiusPx * 2, radiusPx * 2); - RectangleF rect = new(location, size); - - ((SolidBrush)brush).Color = bubble.FillColor; - gfx.FillEllipse(brush, rect); - - pen.Color = bubble.EdgeColor; - pen.Width = bubble.EdgeWidth; - gfx.DrawEllipse(pen, rect); - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/ClevelandDotPlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/ClevelandDotPlot.cs deleted file mode 100644 index b37409507..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/ClevelandDotPlot.cs +++ /dev/null @@ -1,352 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Cleveland Dot plots display a series of paired p[oints. - /// Positions are defined by Xs. - /// Heights are defined by Ys1 and Ys2 (internally done with Ys and YOffsets). - /// - public class ClevelandDotPlot : BarPlotBase, IPlottable - { - /// - /// Color for the line - /// - public Color StemColor = Color.Gray; - - /// - /// Size of the markers at the ends of each line - /// - public float DotRadius { get; set; } = 5; - - // TODO: don't expose these, instead put them behind an Update() method - // that lets the user update one or both arrays. This can also perform length checking. - public double[] Ys1 - { - get => ValueOffsets; - set - { - double[] diff = (Ys1 ?? DataGen.Zeros(value.Length)).Zip(value, (y, v) => y - v).ToArray(); - ValueOffsets = value; - - if (Ys2 != null) - { - Ys2 = (Ys2 ?? DataGen.Zeros(value.Length)).Zip(diff, (y, v) => y + v).ToArray(); - } - } - } - - public double[] Ys2 - { - get - { - if (Values == null) - { - return null; - } - - double[] offsets = Ys1 ?? DataGen.Zeros(Values.Length); - return Values.Select((y, i) => y + offsets[i]).ToArray(); - } - set - { - double[] offsets = Ys1 ?? DataGen.Zeros(value.Length); - Values = value.Select((y, i) => y - offsets[i]).ToArray(); - } - } - - /// - /// Text to display in the legend associated with the series 1 data - /// - private string Label1; - - /// - /// Color for one of the markers - /// - private Color Color1 = Color.Green; - - /// - /// Marker to use for the series 1 data - /// - private MarkerShape MarkerShape1 = MarkerShape.FilledCircle; - - /// - /// Text to display in the legend associated with the series 2 data - /// - private string Label2; - - /// - /// Color for one of the markers - /// - private Color Color2 = Color.Red; - - /// - /// Marker to use for the series 2 data - /// - private MarkerShape MarkerShape2 = MarkerShape.FilledCircle; - - /// - /// Allows customizing the first point (set by ys1) - /// - /// The color of the dot, null for no change. - /// The shape of the dot, null for no change. - /// The label of the dot in the legend, null for no change - public void SetPoint1Style(Color? color = null, MarkerShape? markerShape = null, string label = null) - { - Label1 = label ?? Label1; - MarkerShape1 = markerShape ?? MarkerShape1; - Color1 = color ?? Color1; - } - - /// - /// Allows customizing the second point (set by ys2) - /// - /// The color of the dot, null for no change. - /// The shape of the dot, null for no change. - /// The label of the dot in the legend, null for no change - public void SetPoint2Style(Color? color = null, MarkerShape? markerShape = null, string label = null) - { - Label2 = label ?? Label2; - MarkerShape2 = markerShape ?? MarkerShape2; - Color2 = color ?? Color2; - } - - public ClevelandDotPlot(double[] xs, double[] ys1, double[] ys2) : base() - { - Ys1 = ys1; - Ys2 = ys2; - Positions = xs; - ValueErrors = DataGen.Zeros(ys1.Length); - } - - public override AxisLimits GetAxisLimits() - { - double valueMin = double.PositiveInfinity; - double valueMax = double.NegativeInfinity; - double positionMin = double.PositiveInfinity; - double positionMax = double.NegativeInfinity; - - for (int i = 0; i < Positions.Length; i++) - { - valueMin = new double[] { valueMin, Values[i] - ValueErrors[i] + ValueOffsets[i], ValueOffsets[i] }.Min(); - valueMax = new double[] { valueMax, Values[i] + ValueErrors[i] + ValueOffsets[i], ValueOffsets[i] }.Max(); - positionMin = Math.Min(positionMin, Positions[i]); - positionMax = Math.Max(positionMax, Positions[i]); - } - - valueMin = Math.Min(valueMin, ValueBase); - valueMax = Math.Max(valueMax, ValueBase); - - if (ShowValuesAboveBars) - { - valueMax += (valueMax - valueMin) * .1; // increase by 10% to accomodate label - } - - positionMin -= BarWidth / 2; - positionMax += BarWidth / 2; - - positionMin += PositionOffset; - positionMax += PositionOffset; - - return Orientation == PlotOrientation.Vertical ? - new AxisLimits(positionMin, positionMax, valueMin, valueMax) : - new AxisLimits(valueMin, valueMax, positionMin, positionMax); - } - - public LegendItem[]? GetLegendItems() - { - var firstDot = new LegendItem() - { - label = Label1, - color = Color1, - lineStyle = LineStyle.None, - markerShape = MarkerShape1, - markerSize = 5, - }; - var secondDot = new LegendItem() - { - label = Label2, - color = Color2, - lineStyle = LineStyle.None, - markerShape = MarkerShape2, - markerSize = 5, - }; - - return new LegendItem[] { firstDot, secondDot }; - } - - #region Render Implementation - - // NOTE: These render methods contains a lot of code and complexity not required to render this plot type. - // TODO: Delete as much of this code as possible and simplify the render methods. - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - using Graphics gfx = GDI.Graphics(bmp, dims, lowQuality); - for (int barIndex = 0; barIndex < Values.Length; barIndex++) - { - if (Orientation == PlotOrientation.Vertical) - { - RenderBarVertical(dims, gfx, Positions[barIndex] + PositionOffset, Values[barIndex], ValueErrors[barIndex], ValueOffsets[barIndex]); - } - else - { - RenderBarHorizontal(dims, gfx, Positions[barIndex] + PositionOffset, Values[barIndex], ValueErrors[barIndex], ValueOffsets[barIndex]); - } - } - } - - private void RenderBarFromRect(RectangleF rect, bool negative, Graphics gfx) - { - float centerPx = Orientation == PlotOrientation.Horizontal - ? rect.Y + rect.Height / 2 - : rect.X + rect.Width / 2; - - using var stemPen = new Pen(StemColor); - using var dot1Brush = GDI.Brush(Color1); - using var dot2Brush = GDI.Brush(Color2); - PointF[] points = new PointF[2]; - if (Orientation == PlotOrientation.Horizontal) - { - points[0] = new PointF(negative ? rect.X + rect.Width : rect.X, centerPx - DotRadius / 2); - points[1] = new PointF(negative ? rect.X : rect.X + rect.Width, centerPx - DotRadius / 2); - } - else - { - points[0] = new PointF(centerPx - DotRadius / 2, !negative ? rect.Y + rect.Height : rect.Y); - points[1] = new PointF(centerPx - DotRadius / 2, !negative ? rect.Y : rect.Y + rect.Height); - } - - gfx.DrawLine(stemPen, points[0], points[1]); - MarkerTools.DrawMarker(gfx, points[1], MarkerShape2, DotRadius, Color2); - MarkerTools.DrawMarker(gfx, points[0], MarkerShape1, DotRadius, Color1); // First point should be drawn overtop the second. - } - - private void RenderBarVertical(PlotDimensions dims, Graphics gfx, double position, double value, double valueError, double yOffset) - { - // bar body - float centerPx = dims.GetPixelX(position); - double edge1 = position - BarWidth / 2; - double value1 = Math.Min(ValueBase, value) + yOffset; - double value2 = Math.Max(ValueBase, value) + yOffset; - double valueSpan = value2 - value1; - - var rect = new RectangleF( - x: dims.GetPixelX(edge1), - y: dims.GetPixelY(value2), - width: (float)(BarWidth * dims.PxPerUnitX), - height: (float)(valueSpan * dims.PxPerUnitY)); - - // errorbar - double error1 = value > 0 ? value2 - Math.Abs(valueError) : value1 - Math.Abs(valueError); - double error2 = value > 0 ? value2 + Math.Abs(valueError) : value1 + Math.Abs(valueError); - float capPx1 = dims.GetPixelX(position - ErrorCapSize * BarWidth / 2); - float capPx2 = dims.GetPixelX(position + ErrorCapSize * BarWidth / 2); - float errorPx2 = dims.GetPixelY(error2); - float errorPx1 = dims.GetPixelY(error1); - - RenderBarFromRect(rect, value < 0, gfx); - - if (ErrorLineWidth > 0 && valueError > 0) - { - using var errorPen = new Pen(ErrorColor, ErrorLineWidth); - gfx.DrawLine(errorPen, centerPx, errorPx1, centerPx, errorPx2); - gfx.DrawLine(errorPen, capPx1, errorPx1, capPx2, errorPx1); - gfx.DrawLine(errorPen, capPx1, errorPx2, capPx2, errorPx2); - } - - if (ShowValuesAboveBars) - { - using (var valueTextFont = GDI.Font(Font)) - { - using (var valueTextBrush = GDI.Brush(Font.Color)) - { - using (var sf = new StringFormat() { LineAlignment = StringAlignment.Far, Alignment = StringAlignment.Center }) - { - gfx.DrawString(value.ToString(), valueTextFont, valueTextBrush, centerPx, rect.Y, sf); - } - } - } - } - } - - private void RenderBarHorizontal(PlotDimensions dims, Graphics gfx, double position, double value, double valueError, double yOffset) - { - // bar body - float centerPx = dims.GetPixelY(position); - double edge2 = position + BarWidth / 2; - double value1 = Math.Min(ValueBase, value) + yOffset; - double value2 = Math.Max(ValueBase, value) + yOffset; - double valueSpan = value2 - value1; - var rect = new RectangleF( - x: dims.GetPixelX(value1), - y: dims.GetPixelY(edge2), - height: (float)(BarWidth * dims.PxPerUnitY), - width: (float)(valueSpan * dims.PxPerUnitX)); - - RenderBarFromRect(rect, value < 0, gfx); - - // errorbar - double error1 = value > 0 ? value2 - Math.Abs(valueError) : value1 - Math.Abs(valueError); - double error2 = value > 0 ? value2 + Math.Abs(valueError) : value1 + Math.Abs(valueError); - float capPx1 = dims.GetPixelY(position - ErrorCapSize * BarWidth / 2); - float capPx2 = dims.GetPixelY(position + ErrorCapSize * BarWidth / 2); - float errorPx2 = dims.GetPixelX(error2); - float errorPx1 = dims.GetPixelX(error1); - - if (ErrorLineWidth > 0 && valueError > 0) - { - using var errorPen = new Pen(ErrorColor, ErrorLineWidth); - gfx.DrawLine(errorPen, errorPx1, centerPx, errorPx2, centerPx); - gfx.DrawLine(errorPen, errorPx1, capPx2, errorPx1, capPx1); - gfx.DrawLine(errorPen, errorPx2, capPx2, errorPx2, capPx1); - } - - if (ShowValuesAboveBars) - { - using (var valueTextFont = GDI.Font(Font)) - { - using (var valueTextBrush = GDI.Brush(Font.Color)) - { - using (var sf = new StringFormat() { LineAlignment = StringAlignment.Center, Alignment = StringAlignment.Near }) - { - gfx.DrawString(value.ToString(), valueTextFont, valueTextBrush, rect.X + rect.Width, centerPx, sf); - } - } - } - } - } - - #endregion - - public void ValidateData(bool deep = false) - { - // TODO: refactor entire data validation system for all plot types (triaged March 2021) - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Colorbar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Colorbar.cs deleted file mode 100644 index ce3c07baa..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Colorbar.cs +++ /dev/null @@ -1,315 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// A colorbar translates numeric intensity values to colors. - /// The Colorbar plot type displays a Colorbar along an edge of the plot. - /// - public class Colorbar : IPlottable - { - public Edge Edge = Edge.Right; - - private ColourMap _colormap; - private Bitmap? _bmpScale; - - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get => 0; set { } } - public int YAxisIndex { get => 0; set { } } - - /// - /// Width of the colorbar rectangle - /// - public int Width = 20; - - public readonly Font TickLabelFont = new(); - public Color TickMarkColor = Color.Black; - public float TickMarkLength = 3; - public float TickMarkWidth = 1; - - private readonly List _manualTicks = new(); - private bool _automaticTickEnable = true; - private int _automaticTickMinimumSpacing = 40; - private Func _automaticTickFormatter = position => $"{position:F2}"; - - private double _minValue; - public double MinValue - { - get => (_plottable is IHasColormap p) ? p.ColormapMin : _minValue; - set => _minValue = value; - } - - private double _maxValue = 1; - public double MaxValue - { - get => (_plottable is IHasColormap p) ? p.ColormapMax : _maxValue; - set => _maxValue = value; - } - - private bool _minIsClipped = false; - public bool MinIsClipped - { - get => (_plottable is IHasColormap p) ? p.ColormapMinIsClipped : _minIsClipped; - set => _minIsClipped = value; - } - - private bool _maxIsClipped = false; - public bool MaxIsClipped - { - get => (_plottable is IHasColormap p) ? p.ColormapMaxIsClipped : _maxIsClipped; - set => _maxIsClipped = value; - } - - private double _minColor; - public double MinColor { get => _minColor; set { _minColor = value; UpdateBitmap(); } } - - private double _maxColor = 1; - public double MaxColor { get => _maxColor; set { _maxColor = value; UpdateBitmap(); } } - - /// - /// If populated, this object holds the plottable containing the heatmap and value data this colorbar represents - /// - private IHasColormap? _plottable; - - public Colorbar(ColourMap? colormap = null) - { - UpdateColormap(colormap ?? ColourMap.Viridis); - } - - public Colorbar(IHasColormap plottable) - { - _plottable = plottable; - UpdateColormap(plottable.Colormap); - } - - /// - /// Configure ticks that are automatically generated in the absense of manually-added ticks - /// - /// - /// Minimum number of vertical pixels between tick positions - /// Optional custom string formatter to translate tick positions to labels - public void AutomaticTicks(bool enable = true, int? minimumSpacing = null, Func? formatter = null) - { - if (enable) - { - _manualTicks.Clear(); - } - - _automaticTickEnable = enable; - _automaticTickMinimumSpacing = minimumSpacing ?? _automaticTickMinimumSpacing; - _automaticTickFormatter = formatter ?? _automaticTickFormatter; - } - - /// - /// Clear the list of manually-defined ticks. - /// To enable automatic tick placement call - /// - public void ClearTicks() - { - _manualTicks.Clear(); - } - - /// - /// Add a tick to the list of manually-defined ticks (disabling automatic tick placement) - /// - /// from 0 (darkest) to 1 (brightest) - /// string displayed beside the tick - public void AddTick(double fraction, string label) - { - _manualTicks.Add(new(fraction, label, true, false)); - } - - /// - /// Manually define ticks (disabling automatic tick placement) - /// - /// from 0 (darkest) to 1 (brightest) - /// strings displayed beside the ticks - public void AddTicks(double[] fractions, string[] labels) - { - if (fractions.Length != labels.Length) - { - throw new("fractions and labels must have the same length"); - } - - for (int i = 0; i < fractions.Length; i++) - { - _manualTicks.Add(new(fractions[i], labels[i], true, false)); - } - } - - /// - /// Manually define ticks (disabling automatic tick placement) - /// - /// from 0 (darkest) to 1 (brightest) - /// strings displayed beside the ticks - public void SetTicks(double[] fractions, string[] labels) - { - if (fractions.Length != labels.Length) - { - throw new("fractions and labels must have the same length"); - } - - ClearTicks(); - AddTicks(fractions, labels); - } - - public LegendItem[]? GetLegendItems() => null; - - public AxisLimits GetAxisLimits() => new(double.NaN, double.NaN, double.NaN, double.NaN); - - public void ValidateData(bool deep = false) { } - - /// - /// Re-Render the colorbar using a new colormap - /// - public void UpdateColormap(ColourMap? newColormap) - { - _colormap = newColormap ?? ColourMap.Viridis; - UpdateBitmap(); - } - - private void UpdateBitmap() - { - _bmpScale?.Dispose(); - _bmpScale = GetBitmap(); - } - - /// - /// Return a Bitmap of just the color portion of the colorbar. - /// The width is defined by the Width field - /// The height will be 256 - /// - /// - public Bitmap GetBitmap() => - ColourMap.Colorbar(_colormap, Width, 256, true, MinColor, MaxColor); - - /// - /// Return a Bitmap of just the color portion of the colorbar - /// - /// width of the Bitmap - /// height of the Bitmap - /// if true, colormap will be vertically oriented (tall and skinny) - /// - public Bitmap GetBitmap(int width, int height, bool vertical = true) => - ColourMap.Colorbar(_colormap, width, height, vertical, MinColor, MaxColor); - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - if (_bmpScale is null) - { - UpdateBitmap(); - } - - RectangleF colorbarRect = RenderColorbar(dims, bmp); - - RenderTicks(dims, bmp, lowQuality, colorbarRect); - } - - /// - /// Return a list of ticks evenly spaced between the min and max values. - /// - /// height of the vertical colorbar - /// minimum pixel distance between adjacent ticks - /// - private List GetEvenlySpacedTicks(float height, double tickSpacing) - { - List ticks = new(); - int tickCount = (int)(height / tickSpacing); - tickCount = Math.Max(tickCount, 1); - double tickSpacingFraction = 1.0 / tickCount; - double valueSpan = MaxValue - MinValue; - for (int i = 0; i <= tickCount; i++) - { - double colorbarFraction = tickSpacingFraction * i; - double tickPosition = MinValue + colorbarFraction * valueSpan; - - string tickLabel = _automaticTickFormatter(tickPosition); - if (MinIsClipped && i == 0) - { - tickLabel = $"\u2264{tickLabel}"; - } - - if (MaxIsClipped && i == tickCount) - { - tickLabel = $"\u2265{tickLabel}"; - } - - Tick tick = new(colorbarFraction, tickLabel, isMajor: true, isDateTime: false); - ticks.Add(tick); - } - - return ticks; - } - - private RectangleF RenderColorbar(PlotDimensions dims, Bitmap bmp) - { - float scaleLeftPad = 10; - - PointF location = new(dims.DataOffsetX + dims.DataWidth + scaleLeftPad, dims.DataOffsetY); - SizeF size = new(Width, dims.DataHeight); - RectangleF rect = new(location, size); - - using (Graphics gfx = GDI.Graphics(bmp, dims, lowQuality: true, clipToDataArea: false)) - { - using (var pen = GDI.Pen(Color.Black)) - { - if (_bmpScale != null) - { - gfx.DrawImage(_bmpScale, location.X, location.Y, size.Width, size.Height + 1); - } - gfx.DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height); - } - } - - return rect; - } - - private void RenderTicks(PlotDimensions dims, Bitmap bmp, bool lowQuality, RectangleF colorbarRect) - { - float tickLeftPx = colorbarRect.Right; - float tickRightPx = tickLeftPx + TickMarkLength; - float tickLabelPx = tickRightPx + 2; - - using Graphics gfx = GDI.Graphics(bmp, dims, lowQuality, false); - using var tickMarkPen = GDI.Pen(TickMarkColor, TickMarkWidth); - using var tickLabelBrush = GDI.Brush(TickLabelFont.Color); - using var tickFont = GDI.Font(TickLabelFont); - using var sf = new StringFormat() { LineAlignment = StringAlignment.Center }; - - bool useManualTicks = (_manualTicks.Count > 0 || _automaticTickEnable == false); - List ticks = useManualTicks ? _manualTicks : GetEvenlySpacedTicks(colorbarRect.Height, _automaticTickMinimumSpacing); - - foreach (Tick tick in ticks) - { - float y = colorbarRect.Top + (float)((1 - tick.Position) * colorbarRect.Height); - gfx.DrawLine(tickMarkPen, tickLeftPx, y, tickRightPx, y); - gfx.DrawString(tick.Label, tickFont, tickLabelBrush, tickLabelPx, y, sf); - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/CoordinatedHeatmap.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/CoordinatedHeatmap.cs deleted file mode 100644 index bdf832de6..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/CoordinatedHeatmap.cs +++ /dev/null @@ -1,66 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - [Obsolete("This plot type has been deprecated. Min/max and interpolation settings are exposed in the regular Heatmap.")] - public class CoordinatedHeatmap : Heatmap - { - protected override void RenderHeatmap(PlotDimensions dims, Bitmap bmp, bool lowQuality) - { - using Graphics gfx = GDI.Graphics(bmp, dims, lowQuality); - - gfx.InterpolationMode = Interpolation; - gfx.PixelOffsetMode = PixelOffsetMode.Half; - - int drawFromX = (int)Math.Round(dims.GetPixelX(XMin)); - int drawFromY = (int)Math.Round(dims.GetPixelY(YMax)); - int drawWidth = (int)Math.Round(dims.GetPixelX(XMax) - drawFromX); - int drawHeight = (int)Math.Round(dims.GetPixelY(YMin) - drawFromY); - Rectangle destRect = new Rectangle(drawFromX, drawFromY, drawWidth, drawHeight); - ImageAttributes attr = new ImageAttributes(); - attr.SetWrapMode(WrapMode.TileFlipXY); - - if (BackgroundImage != null && !DisplayImageAbove) - { - gfx.DrawImage(BackgroundImage, destRect, 0, 0, BackgroundImage.Width, BackgroundImage.Height, GraphicsUnit.Pixel, attr); - } - - gfx.DrawImage(BmpHeatmap, destRect, 0, 0, BmpHeatmap.Width, BmpHeatmap.Height, GraphicsUnit.Pixel, attr); - - if (BackgroundImage != null && DisplayImageAbove) - { - gfx.DrawImage(BackgroundImage, destRect, 0, 0, BackgroundImage.Width, BackgroundImage.Height, GraphicsUnit.Pixel, attr); - } - } - - public override AxisLimits GetAxisLimits() - { - return new AxisLimits(XMin, XMax, YMin, YMax); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/CoxcombPlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/CoxcombPlot.cs deleted file mode 100644 index f4815d01e..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/CoxcombPlot.cs +++ /dev/null @@ -1,191 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -// ReSharper disable UnusedVariable -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// A Pie chart where the angle of slices is constant but the radii are not. - /// - public class CoxcombPlot : IPlottable - { - private double[] _values; - - /// - /// The data to be plotted - /// - public double[] Values - { - get => _values; - set - { - _values = value; - _normalized = Normalize(value); - } - } - /// - /// The colors of each slice - /// - public Color[] FillColors { get; set; } - - /// - /// The color to draw the axis in - /// - public Color WebColor { get; set; } = Color.Gray; - - /// - /// Controls rendering style of the concentric circles (ticks) of the web - /// - public RadarAxis AxisType { get; set; } = RadarAxis.Circle; - - /// - /// If true, each value will be written in text on the plot. - /// - public bool ShowAxisValues { get; set; } = true; - - /// - /// Labels for each category. - /// Length must be equal to the number of columns (categories) in the original data. - /// - public string[] SliceLabels; - - /// - /// Icons for each category. - /// Length must be equal to the number of columns (categories) in the original data. - /// - public System.Drawing.Image[] CategoryImages { get; set; } - - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - - public string Label; - - private double[] _normalized; - - public CoxcombPlot(double[] values, Color[] fillColors) - { - Values = values; - FillColors = fillColors; - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - int numCategories = _normalized.Length; - PointF origin = new PointF(dims.GetPixelX(0), dims.GetPixelY(0)); - double sweepAngle = 360f / numCategories; - double maxRadiusPixels = new[] { dims.PxPerUnitX, dims.PxPerUnitX }.Min(); - double maxDiameterPixels = maxRadiusPixels * 2; - - - using Graphics gfx = GDI.Graphics(bmp, dims, lowQuality); - using SolidBrush sliceFillBrush = (SolidBrush)GDI.Brush(Color.Black); - - RenderAxis(gfx, dims, bmp, lowQuality); - - double start = -90; - for (int i = 0; i < numCategories; i++) - { - double angle = (Math.PI / 180) * ((sweepAngle + 2 * start) / 2); - float diameter = (float)(maxDiameterPixels * _normalized[i]); - sliceFillBrush.Color = FillColors[i]; - - gfx.FillPie(brush: sliceFillBrush, - x: (int)origin.X - diameter / 2, - y: (int)origin.Y - diameter / 2, - width: diameter, - height: diameter, - startAngle: (float)start, - sweepAngle: (float)sweepAngle); - - start += sweepAngle; - } - } - - private void RenderAxis(Graphics gfx, PlotDimensions dims, Bitmap bmp, bool lowQuality) - { - double[,] norm = new double[_normalized.Length, 1]; - for (int i = 0; i < _normalized.Length; i++) - { - norm[i, 0] = _normalized[i]; - } - - StarAxisTick[] ticks = new[] { 0.25, 0.5, 1 } - .Select(x => new StarAxisTick(x, Values.Max())) - .ToArray(); - - StarAxis axis = new() - { - Ticks = ticks, - CategoryLabels = SliceLabels, - AxisType = AxisType, - WebColor = WebColor, - ShowAxisValues = ShowAxisValues, - CategoryImages = CategoryImages, - Graphics = gfx, - ShowCategoryLabels = false, - NumberOfSpokes = Values.Length, - ImagePlacement = ImagePlacement.Inside - }; - - axis.Render(dims, bmp, lowQuality); - } - - private static double[] Normalize(double[] values) - { - double max = values.Max(); - - if (max == 0) - { - return values.Select(_ => 0.0).ToArray(); - } - - return values.Select(v => v / max).ToArray(); - } - - public LegendItem[] GetLegendItems() - { - return Enumerable - .Range(0, Values.Length) - .Select(i => new LegendItem() { label = SliceLabels[i], color = FillColors[i], lineWidth = 10 }) - .ToArray(); - } - - public AxisLimits GetAxisLimits() => new(-2.5, 2.5, -2.5, 2.5); - - public override string ToString() - { - string label = string.IsNullOrWhiteSpace(Label) ? "" : $" ({Label})"; - return $"PlottableCoxcomb {label} with {Values.Length} categories"; - } - - public void ValidateData(bool deep = false) - { - // TODO - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Crosshair.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Crosshair.cs deleted file mode 100644 index a0cc959a3..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Crosshair.cs +++ /dev/null @@ -1,269 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// The Crosshair plot type draws a vertical and horizontal line to label a point - /// on the plot and displays the coordinates of that point in labels that overlap - /// the axis tick labels. - /// - /// This plot type is typically used in combination with - /// MouseMove events to track the location of the mouse and/or with plot types that - /// have GetPointNearest() methods. - /// - public class Crosshair : IPlottable - { - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - - public readonly HLine HorizontalLine = new(); - - public readonly VLine? VerticalLine = new(); - - /// - /// X position (axis units) of the vertical line - /// - public double X { get => VerticalLine!.X; set => VerticalLine!.X = value; } - - /// - /// X position (axis units) of the horizontal line - /// - public double Y { get => HorizontalLine.Y; set => HorizontalLine.Y = value; } - - /// - /// Sets style for horizontal and vertical lines - /// - public LineStyle LineStyle - { - set - { - HorizontalLine.LineStyle = value; - if (VerticalLine != null) - { - VerticalLine.LineStyle = value; - } - } - [Obsolete("The get method only remain for the compatibility. Get HorizontalLine.LineStyle and VerticalLine.LineStyle instead.")] - get => HorizontalLine.LineStyle; - } - - /// - /// Sets the line width for vertical and horizontal lines - /// - public float LineWidth - { - set - { - HorizontalLine.LineWidth = value; - if (VerticalLine != null) - { - VerticalLine.LineWidth = value; - } - } - [Obsolete("The get method only remain for the compatibility. Get HorizontalLine.LineWidth and VerticalLine.LineWidth instead.")] - get => HorizontalLine.LineWidth; - } - - /// - /// Sets font of the position labels for horizontal and vertical lines - /// - public Font LabelFont - { - set - { - HorizontalLine.PositionLabelFont = value; - if (VerticalLine != null) - { - VerticalLine.PositionLabelFont = value; - } - } - [Obsolete("The get method only remain for the compatibility. Get HorizontalLine.PositionLabelFont and VerticalLine.PositionLabelFont instead.")] - get => HorizontalLine.PositionLabelFont; - } - - /// - /// Sets background color of the position labels for horizontal and vertical lines - /// - public Color LabelBackgroundColor - { - set - { - HorizontalLine.PositionLabelBackground = value; - if (VerticalLine != null) - { - VerticalLine.PositionLabelBackground = value; - } - } - [Obsolete("The get method only remain for the compatibility. Get HorizontalLine.PositionLabelBackground and VerticalLine.PositionLabelBackground instead.")] - get => HorizontalLine.PositionLabelBackground; - } - - /// - /// Sets visibility of the text labels for each line drawn over the axis - /// - public bool PositionLabel - { - set - { - HorizontalLine.PositionLabel = value; - if (VerticalLine != null) - { - VerticalLine.PositionLabel = value; - } - } - } - - /// - /// Sets color for horizontal and vertical lines and their position label backgrounds - /// - public Color Color - { - set - { - HorizontalLine.Color = value; - if (VerticalLine != null) - { - VerticalLine.Color = value; - } - HorizontalLine.PositionLabelBackground = value; - if (VerticalLine != null) - { - VerticalLine.PositionLabelBackground = value; - } - } - } - - public Crosshair() - { - LineStyle = LineStyle.Dash; - LineWidth = 1; - Color = Color.FromArgb(200, Color.Red); - PositionLabel = true; - } - - public AxisLimits GetAxisLimits() => new(double.NaN, double.NaN, double.NaN, double.NaN); - - public LegendItem[]? GetLegendItems() => null; - - public void ValidateData(bool deep = false) { } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - if (IsVisible == false) - { - return; - } - - HorizontalLine.Render(dims, bmp, lowQuality); - VerticalLine?.Render(dims, bmp, lowQuality); - } - - [Obsolete("Use VerticalLine.PositionFormatter()")] - public bool IsDateTimeX - { - get => _isDateTimeX; - set - { - _isDateTimeX = value; - if (VerticalLine != null) - { - VerticalLine.PositionFormatter = value - ? position => DateTime.FromOADate(position).ToString(_stringFormatX) - : position => position.ToString(_stringFormatX); - } - } - } - - [Obsolete] - private bool _isDateTimeX; - - [Obsolete("Use VerticalLine.PositionFormatter()")] - public string StringFormatX - { - get => _stringFormatX; - set - { - _stringFormatX = value; - if (VerticalLine != null) - { - VerticalLine.PositionFormatter = _isDateTimeX ? position => DateTime.FromOADate(position).ToString(_stringFormatX) : position => position.ToString(_stringFormatX); - } - } - } - - [Obsolete] - private string _stringFormatX = "F2"; - - [Obsolete("Use VerticalLine.IsVisible")] - public bool IsVisibleX - { - get => VerticalLine!.IsVisible; - set => VerticalLine!.IsVisible = value; - } - - [Obsolete("Use HorizontalLine.PositionFormatter()")] - public bool IsDateTimeY - { - get => _isDateTimeY; - set - { - _isDateTimeY = value; - HorizontalLine.PositionFormatter = value ? - position => DateTime.FromOADate(position).ToString(_stringFormatY) : - (position) => position.ToString(_stringFormatY); - } - } - - [Obsolete] - private bool _isDateTimeY; - - [Obsolete("Use HorizontalLine.PositionFormat()")] - public string StringFormatY - { - get => _stringFormatY; - set - { - _stringFormatY = value; - HorizontalLine.PositionFormatter = _isDateTimeY ? - position => DateTime.FromOADate(position).ToString(_stringFormatY) : - position => position.ToString(_stringFormatY); - } - } - - [Obsolete] - private string _stringFormatY = "F2"; - - [Obsolete("Use HorizontalLine.IsVisible")] - public bool IsVisibleY - { - get => HorizontalLine.IsVisible; - set => HorizontalLine.IsVisible = value; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/DataStructures/DataSet.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/DataStructures/DataSet.cs deleted file mode 100644 index 661dc87b4..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/DataStructures/DataSet.cs +++ /dev/null @@ -1,51 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Represents a series of data values with a common name. Values from several DataSets can be grouped (by value index). - /// - public class DataSet - { - public string _label; - public double[] _values; - public double[]? _errors; - - public DataSet(string label, double[] values, double[]? errors = null) - { - _values = values; - _label = label; - _errors = errors; - - if (errors != null && errors.Length != values.Length) - { - throw new ArgumentException("values and errors must have identical length"); - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/DataStructures/OHLC.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/DataStructures/OHLC.cs deleted file mode 100644 index e454263cc..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/DataStructures/OHLC.cs +++ /dev/null @@ -1,113 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// This class holds open/high/low/close (OHLC) price data over a time range. - /// - public class OHLC - { - public double Open; - public double High; - public double Low; - public double Close; - public DateTime DateTime; - public TimeSpan TimeSpan; - - private bool IsNanOrInfinity(double val) => double.IsInfinity(val) || double.IsNaN(val); - - public bool IsValid - { - get - { - if (IsNanOrInfinity(Open)) - { - return false; - } - - if (IsNanOrInfinity(High)) - { - return false; - } - - if (IsNanOrInfinity(Low)) - { - return false; - } - - if (IsNanOrInfinity(Close)) - { - return false; - } - - return true; - } - } - - public override string ToString() => - $"OHLC: open={Open}, high={High}, low={Low}, close={Close}, start={DateTime}, span={TimeSpan}"; - - /// - /// OHLC price over a specific period of time - /// - /// opening price - /// maximum price - /// minimum price - /// closing price - /// open time - /// width of the OHLC - public OHLC(double open, double high, double low, double close, DateTime timeStart, TimeSpan timeSpan) - { - Open = open; - High = high; - Low = low; - Close = close; - DateTime = timeStart; - TimeSpan = timeSpan; - } - - /// - /// OHLC price over a specific period of time - /// - /// opening price - /// maximum price - /// minimum price - /// closing price - /// open time (DateTime.ToOADate() units) - /// width of the OHLC in days - public OHLC(double open, double high, double low, double close, double timeStart, double timeSpan = 1) - { - Open = open; - High = high; - Low = low; - Close = close; - DateTime = DateTime.FromOADate(timeStart); - TimeSpan = TimeSpan.FromDays(timeSpan); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/DataStructures/SegmentedTree.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/DataStructures/SegmentedTree.cs deleted file mode 100644 index 1aa7c7953..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/DataStructures/SegmentedTree.cs +++ /dev/null @@ -1,377 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -using System.Linq.Expressions; - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class SegmentedTree where T : struct, IComparable - { - private T[] _sourceArray; - - private T[]? _treeMin; - private T[]? _treeMax; - private int _n = 0; // size of each Tree - public bool TreesReady = false; - // precompiled lambda expressions for fast math on generic - private static Func _minExp; - private static Func _maxExp; - private static Func _equalExp; - private static Func _maxValue; - private static Func _minValue; - private static Func _lessThanExp; - private static Func _greaterThanExp; - - public T[] SourceArray - { - get => _sourceArray; - set - { - _sourceArray = value ?? throw new ArgumentNullException("Source Array cannot be null"); - UpdateTrees(); - } - } - - public SegmentedTree() - { - try // runtime check - { - Convert.ToDouble(new T()); - } - catch - { - throw new ArgumentOutOfRangeException($"Unsupported data type, provide convertable to double data types"); - } - InitExp(); - } - - public SegmentedTree(T[] data) - { - UpdateTreesInBackground(); - } - - public async Task SetSourceAsync(T[] data) - { - _sourceArray = data ?? throw new ArgumentNullException($"Data cannot be null"); - await Task.Run(() => UpdateTrees()); - } - - private void InitExp() - { - ParameterExpression paramA = Expression.Parameter(typeof(T), "a"); - ParameterExpression paramB = Expression.Parameter(typeof(T), "b"); - // add the parameters together - ConditionalExpression bodyMin = Expression.Condition(Expression.LessThanOrEqual(paramA, paramB), paramA, paramB); - ConditionalExpression bodyMax = Expression.Condition(Expression.GreaterThanOrEqual(paramA, paramB), paramA, paramB); - BinaryExpression bodyEqual = Expression.Equal(paramA, paramB); - MemberExpression bodyMaxValue = Expression.MakeMemberAccess(null, typeof(T).GetField("MaxValue")); - MemberExpression bodyMinValue = Expression.MakeMemberAccess(null, typeof(T).GetField("MinValue")); - BinaryExpression bodyLessThan = Expression.LessThan(paramA, paramB); - BinaryExpression bodyGreaterThan = Expression.GreaterThan(paramA, paramB); - // compile it - _minExp = Expression.Lambda>(bodyMin, paramA, paramB).Compile(); - _maxExp = Expression.Lambda>(bodyMax, paramA, paramB).Compile(); - _equalExp = Expression.Lambda>(bodyEqual, paramA, paramB).Compile(); - _maxValue = Expression.Lambda>(bodyMaxValue).Compile(); - _minValue = Expression.Lambda>(bodyMinValue).Compile(); - _lessThanExp = Expression.Lambda>(bodyLessThan, paramA, paramB).Compile(); - _greaterThanExp = Expression.Lambda>(bodyGreaterThan, paramA, paramB).Compile(); - } - - public void UpdateElement(int index, T newValue) - { - _sourceArray[index] = newValue; - // Update Tree, can be optimized - if (index == _sourceArray.Length - 1) // last elem haven't pair - { - _treeMin[_n / 2 + index / 2] = _sourceArray[index]; - _treeMax[_n / 2 + index / 2] = _sourceArray[index]; - } - else if (index % 2 == 0) // even elem have right pair - { - _treeMin[_n / 2 + index / 2] = _minExp(_sourceArray[index], _sourceArray[index + 1]); - _treeMax[_n / 2 + index / 2] = _maxExp(_sourceArray[index], _sourceArray[index + 1]); - } - else // odd elem have left pair - { - _treeMin[_n / 2 + index / 2] = _minExp(_sourceArray[index], _sourceArray[index - 1]); - _treeMax[_n / 2 + index / 2] = _maxExp(_sourceArray[index], _sourceArray[index - 1]); - } - - T candidate; - for (int i = (_n / 2 + index / 2) / 2; i > 0; i /= 2) - { - candidate = _minExp(_treeMin[i * 2], _treeMin[i * 2 + 1]); - if (_equalExp(_treeMin[i], candidate)) // if node same then new value don't need to recalc all upper - { - break; - } - - _treeMin[i] = candidate; - } - for (int i = (_n / 2 + index / 2) / 2; i > 0; i /= 2) - { - candidate = _maxExp(_treeMax[i * 2], _treeMax[i * 2 + 1]); - if (_equalExp(_treeMax[i], candidate)) // if node same then new value don't need to recalc all upper - { - break; - } - - _treeMax[i] = candidate; - } - } - - public void UpdateRange(int from, int to, T[] newData, int fromData = 0) // RangeUpdate - { - //update source signal - for (int i = from; i < to; i++) - { - _sourceArray[i] = newData[i - from + fromData]; - } - - for (int i = _n / 2 + from / 2; i < _n / 2 + to / 2; i++) - { - _treeMin[i] = _minExp(_sourceArray[i * 2 - _n], _sourceArray[i * 2 + 1 - _n]); - _treeMax[i] = _maxExp(_sourceArray[i * 2 - _n], _sourceArray[i * 2 + 1 - _n]); - } - if (to == _sourceArray.Length) // last elem haven't pair - { - _treeMin[_n / 2 + to / 2] = _sourceArray[to - 1]; - _treeMax[_n / 2 + to / 2] = _sourceArray[to - 1]; - } - else if (to % 2 == 1) //last elem even(to-1) and not last - { - _treeMin[_n / 2 + to / 2] = _minExp(_sourceArray[to - 1], _sourceArray[to]); - _treeMax[_n / 2 + to / 2] = _maxExp(_sourceArray[to - 1], _sourceArray[to]); - } - - from = (_n / 2 + from / 2) / 2; - to = (_n / 2 + to / 2) / 2; - - T candidate; - while (from != 0) // up to root elem, that is [1], [0] - is free elem - { - if (from != to) - { - for (int i = from; i <= to; i++) // Recalc all level nodes in range - { - _treeMin[i] = _minExp(_treeMin[i * 2], _treeMin[i * 2 + 1]); - _treeMax[i] = _maxExp(_treeMax[i * 2], _treeMax[i * 2 + 1]); - } - } - else - { - // left == rigth, so no need more from to loop - for (int i = from; i > 0; i /= 2) // up to root node - { - candidate = _minExp(_treeMin[i * 2], _treeMin[i * 2 + 1]); - if (_equalExp(_treeMin[i], candidate)) // if node same then new value don't need to recalc all upper - { - break; - } - - _treeMin[i] = candidate; - } - - for (int i = from; i > 0; i /= 2) // up to root node - { - candidate = _maxExp(_treeMax[i * 2], _treeMax[i * 2 + 1]); - if (_equalExp(_treeMax[i], candidate)) // if node same then new value don't need to recalc all upper - { - break; - } - - _treeMax[i] = candidate; - } - // all work done exit while loop - break; - } - // level up - from = from / 2; - to = to / 2; - } - } - - public void UpdateData(int from, T[] newData) - { - UpdateRange(from, newData.Length, newData); - } - - public void UpdateData(T[] newData) - { - UpdateRange(0, newData.Length, newData); - } - - public void UpdateTreesInBackground() - { - Task.Run(() => { UpdateTrees(); }); - } - - public void UpdateTrees() - { - // O(n) to build trees - TreesReady = false; - try - { - if (_sourceArray.Length == 0) - { - throw new ArgumentOutOfRangeException($"Array cant't be empty"); - } - - // Size up to pow2 - if (_sourceArray.Length > 0x40_00_00_00) // pow 2 must be more then int.MaxValue - { - throw new ArgumentOutOfRangeException($"Array higher than {0x40_00_00_00} not supported by SignalConst"); - } - - int pow2 = 1; - while (pow2 < 0x40_00_00_00 && pow2 < _sourceArray.Length) - pow2 <<= 1; - _n = pow2; - _treeMin = new T[_n]; - _treeMax = new T[_n]; - T maxValue = _maxValue(); - T minValue = _minValue(); - - // fill bottom layer of tree - for (int i = 0; i < _sourceArray.Length / 2; i++) // with source array pairs min/max - { - _treeMin[_n / 2 + i] = _minExp(_sourceArray[i * 2], _sourceArray[i * 2 + 1]); - _treeMax[_n / 2 + i] = _maxExp(_sourceArray[i * 2], _sourceArray[i * 2 + 1]); - } - if (_sourceArray.Length % 2 == 1) // if array size odd, last element haven't pair to compare - { - _treeMin[_n / 2 + _sourceArray.Length / 2] = _sourceArray[_sourceArray.Length - 1]; - _treeMax[_n / 2 + _sourceArray.Length / 2] = _sourceArray[_sourceArray.Length - 1]; - } - for (int i = _n / 2 + (_sourceArray.Length + 1) / 2; i < _n; i++) // min/max for pairs of nonexistent elements - { - _treeMin[i] = minValue; - _treeMax[i] = maxValue; - } - // fill other layers - for (int i = _n / 2 - 1; i > 0; i--) - { - _treeMin[i] = _minExp(_treeMin[2 * i], _treeMin[2 * i + 1]); - _treeMax[i] = _maxExp(_treeMax[2 * i], _treeMax[2 * i + 1]); - } - TreesReady = true; - } - catch (OutOfMemoryException) - { - _treeMin = null; - _treeMax = null; - TreesReady = false; - return; - } - } - - // O(log(n)) for each range min/max query - public void MinMaxRangeQuery(int l, int r, out double lowestValue, out double highestValue) - { - T lowestValueT; - T highestValueT; - // if the tree calculation isn't finished or if it crashed - if (!TreesReady) - { - // use the original (slower) min/max calculated method - lowestValueT = _sourceArray[l]; - highestValueT = _sourceArray[l]; - for (int i = l; i < r; i++) - { - if (_lessThanExp(_sourceArray[i], lowestValueT)) - { - lowestValueT = _sourceArray[i]; - } - - if (_greaterThanExp(_sourceArray[i], highestValueT)) - { - highestValueT = _sourceArray[i]; - } - } - lowestValue = Convert.ToDouble(lowestValueT); - highestValue = Convert.ToDouble(highestValueT); - return; - } - - lowestValueT = _maxValue(); - highestValueT = _minValue(); - if (l == r) - { - lowestValue = highestValue = Convert.ToDouble(_sourceArray[l]); - return; - } - // first iteration on source array that virtualy bottom of tree - if ((l & 1) == 1) // l is right child - { - lowestValueT = _minExp(lowestValueT, _sourceArray[l]); - highestValueT = _maxExp(highestValueT, _sourceArray[l]); - } - if ((r & 1) != 1) // r is left child - { - lowestValueT = _minExp(lowestValueT, _sourceArray[r]); - highestValueT = _maxExp(highestValueT, _sourceArray[r]); - } - // go up from array to bottom of Tree - l = (l + _n + 1) / 2; - r = (r + _n - 1) / 2; - // next iterations on tree - while (l <= r) - { - if ((l & 1) == 1) // l is right child - { - if (_treeMin != null) - { - lowestValueT = _minExp(lowestValueT, _treeMin[l]); - } - - if (_treeMax != null) - { - highestValueT = _maxExp(highestValueT, _treeMax[l]); - } - } - if ((r & 1) != 1) // r is left child - { - if (_treeMin != null) - { - lowestValueT = _minExp(lowestValueT, _treeMin[r]); - } - - if (_treeMax != null) - { - highestValueT = _maxExp(highestValueT, _treeMax[r]); - } - } - // go up one level - l = (l + 1) / 2; - r = (r - 1) / 2; - } - lowestValue = Convert.ToDouble(lowestValueT); - highestValue = Convert.ToDouble(highestValueT); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/FinancePlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/FinancePlot.cs deleted file mode 100644 index 20c612618..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/FinancePlot.cs +++ /dev/null @@ -1,367 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Finance plots display open/high/low/close (OHLC) data - /// - public class FinancePlot : IPlottable - { - private readonly List OHLCs = new List(); - - /// - /// Returns the last element of OHLCs so users can modify FinancePlots in real time. - /// - public OHLC Last() => OHLCs.Last(); - - /// - /// Display prices as filled candlesticks (otherwise display as OHLC lines) - /// - public bool Candle; - - /// - /// If True, OHLC timestamps are ignored and candles are placed at consecutive integers and all given a width of 1 - /// - public bool Sequential; - - /// - /// Color of the candle if it closes at or above its open value - /// - public Color ColorUp = Color.LightGreen; - - /// - /// Color of the candle if it closes below its open value - /// - public Color ColorDown = Color.LightCoral; - - /// - /// This field controls the color of the wick and rectangular candle border. - /// If null, the wick is the same color as the candle and no border is applied. - /// - public Color? WickColor = null; - - public bool IsVisible { get; set; } = true; - public override string ToString() => $"FinancePlot with {OHLCs.Count} OHLC indicators"; - public LegendItem[]? GetLegendItems() => null; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - - /// - /// Create an empty finance plot. - /// Call Add() and AddRange() to add data. - /// - public FinancePlot() { } - - /// - /// Create a finance plot from existing OHLC data. - /// - /// - public FinancePlot(OHLC[] ohlcs) => AddRange(ohlcs); - - /// - /// Add a single candle representing a defined time span - /// - /// - /// - /// - /// - /// - /// - public void Add(double open, double high, double low, double close, DateTime timeStart, TimeSpan timeSpan) => - Add(new OHLC(open, high, low, close, timeStart, timeSpan)); - - /// - /// Add a single candle to the end of the list assuming each candle is spaced 1 horizontal unit apart - /// - /// - /// - /// - /// - public void Add(double open, double high, double low, double close) => - Add(new OHLC(open, high, low, close, OHLCs.Count)); - - /// - /// Add a single OHLC to the plot - /// - /// - public void Add(OHLC ohlc) - { - if (ohlc is null) - { - throw new ArgumentNullException(); - } - - OHLCs.Add(ohlc); - } - - /// - /// Add multiple OHLCs to the plot - /// - /// - public void AddRange(OHLC[] ohlcs) - { - if (ohlcs is null) - { - throw new ArgumentNullException(); - } - - foreach (var ohlc in ohlcs) - { - if (ohlc is null) - { - throw new ArgumentNullException("no OHLCs may be null"); - } - } - - OHLCs.AddRange(ohlcs); - } - - /// - /// Clear all OHLCs - /// - public void Clear() => OHLCs.Clear(); - - public AxisLimits GetAxisLimits() - { - if (OHLCs.Count() == 0) - { - return new AxisLimits(double.NaN, double.NaN, double.NaN, double.NaN); - } - - // TODO: dont use an array here - double[] limits = new double[4]; - limits[0] = OHLCs[0].DateTime.ToOADate(); - limits[1] = OHLCs[0].DateTime.ToOADate(); - limits[2] = OHLCs[0].Low; - limits[3] = OHLCs[0].High; - - for (int i = 1; i < OHLCs.Count; i++) - { - if (OHLCs[i].DateTime.ToOADate() < limits[0]) - { - limits[0] = OHLCs[i].DateTime.ToOADate(); - } - - if (OHLCs[i].DateTime.ToOADate() > limits[1]) - { - limits[1] = OHLCs[i].DateTime.ToOADate(); - } - - if (OHLCs[i].Low < limits[2]) - { - limits[2] = OHLCs[i].Low; - } - - if (OHLCs[i].High > limits[3]) - { - limits[3] = OHLCs[i].High; - } - } - - if (Sequential) - { - limits[0] = 0; - limits[1] = OHLCs.Count - 1; - } - - return new AxisLimits(limits[0], limits[1], limits[2], limits[3]); - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - if (Candle) - { - RenderCandles(dims, bmp, lowQuality); - } - else - { - RenderOhlc(dims, bmp, lowQuality); - } - } - - public void ValidateData(bool deepValidation = false) - { - if (OHLCs is null) - { - throw new InvalidOperationException("ohlcs cannot be null"); - } - - for (int i = 0; i < OHLCs.Count; i++) - { - if (OHLCs[i] is null) - { - throw new InvalidOperationException($"ohlcs[{i}] cannot be null"); - } - - if (!OHLCs[i].IsValid) - { - throw new InvalidOperationException($"ohlcs[{i}] does not contain valid data"); - } - } - } - - private void RenderCandles(PlotDimensions dims, Bitmap bmp, bool lowQuality) - { - double fractionalTickWidth = .7; - - using Graphics gfx = GDI.Graphics(bmp, dims, lowQuality); - using Pen pen = new Pen(Color.Magenta); - using SolidBrush brush = new SolidBrush(Color.Magenta); - for (int i = 0; i < OHLCs.Count; i++) - { - var ohlc = OHLCs[i]; - bool closedHigher = ohlc.Close >= ohlc.Open; - double highestOpenClose = Math.Max(ohlc.Open, ohlc.Close); - double lowestOpenClose = Math.Min(ohlc.Open, ohlc.Close); - - var ohlcTime = Sequential ? i : ohlc.DateTime.ToOADate(); - var ohlcSpan = Sequential ? 1 : ohlc.TimeSpan.TotalDays; - float pixelX = dims.GetPixelX(ohlcTime); - - float boxWidth = (float)(ohlcSpan * dims.PxPerUnitX / 2 * fractionalTickWidth); - - Color priceChangeColor = closedHigher ? ColorUp : ColorDown; - pen.Color = WickColor ?? priceChangeColor; - pen.Width = (boxWidth >= 2) ? 2 : 1; - - // draw the wick below the box - PointF wickLowBot = new PointF(pixelX, dims.GetPixelY(ohlc.Low)); - PointF wickLowTop = new PointF(pixelX, dims.GetPixelY(lowestOpenClose)); - gfx.DrawLine(pen, wickLowBot, wickLowTop); - - // draw the wick above the box - PointF wickHighBot = new PointF(pixelX, dims.GetPixelY(highestOpenClose)); - PointF wickHighTop = new PointF(pixelX, dims.GetPixelY(ohlc.High)); - gfx.DrawLine(pen, wickHighBot, wickHighTop); - - // draw the candle body - PointF boxLowerLeft = new PointF(pixelX, dims.GetPixelY(lowestOpenClose)); - PointF boxUpperRight = new PointF(pixelX, dims.GetPixelY(highestOpenClose)); - if (ohlc.Open == ohlc.Close) - { - // draw OHLC (non-filled) candle - gfx.DrawLine(pen, boxLowerLeft.X - boxWidth, boxLowerLeft.Y, boxLowerLeft.X + boxWidth, boxLowerLeft.Y); - } - else - { - // draw a filled candle - brush.Color = priceChangeColor; - gfx.FillRectangle( - brush: brush, - x: boxLowerLeft.X - boxWidth, - y: boxUpperRight.Y, - width: boxWidth * 2, - height: boxLowerLeft.Y - boxUpperRight.Y); - - if (WickColor != null) - { - gfx.DrawRectangle( - pen: pen, - x: boxLowerLeft.X - boxWidth, - y: boxUpperRight.Y, - width: boxWidth * 2, - height: boxLowerLeft.Y - boxUpperRight.Y); - } - } - } - } - - private void RenderOhlc(PlotDimensions dims, Bitmap bmp, bool lowQuality) - { - double fractionalTickWidth = .7; - - using Graphics gfx = GDI.Graphics(bmp, dims, lowQuality); - using Pen pen = new Pen(Color.Magenta); - for (int i = 0; i < OHLCs.Count; i++) - { - var ohlc = OHLCs[i]; - bool closedHigher = ohlc.Close >= ohlc.Open; - - var ohlcTime = (Sequential) ? i : ohlc.DateTime.ToOADate(); - var ohlcSpan = Sequential ? 1 : ohlc.TimeSpan.TotalDays; - float pixelX = dims.GetPixelX(ohlcTime); - - float boxWidth = (float)(ohlcSpan * dims.PxPerUnitX / 2 * fractionalTickWidth); - - pen.Color = closedHigher ? ColorUp : ColorDown; - pen.Width = (boxWidth >= 2) ? 2 : 1; - - // the main line - PointF wickTop = new PointF(pixelX, dims.GetPixelY(ohlc.Low)); - PointF wickBot = new PointF(pixelX, dims.GetPixelY(ohlc.High)); - gfx.DrawLine(pen, wickBot, wickTop); - - // open and close lines - float xPx = wickTop.X; - float yPxOpen = dims.GetPixelY(ohlc.Open); - float yPxClose = dims.GetPixelY(ohlc.Close); - gfx.DrawLine(pen, xPx - boxWidth, yPxOpen, xPx, yPxOpen); - gfx.DrawLine(pen, xPx + boxWidth, yPxClose, xPx, yPxClose); - } - } - - /// - /// Return the simple moving average (SMA) of the OHLC closing prices. - /// The returned ys are SMA where each point is the average of N points. - /// The returned xs are times in OATime units. - /// The returned xs and ys arrays will be the length of the OHLC data minus N. - /// - /// each returned value represents the average of N points - /// times and averages of the OHLC closing prices - public (double[] xs, double[] ys) GetSMA(int N) - { - if (N >= OHLCs.Count) - { - throw new ArgumentException("can not analyze more points than are available in the OHLCs"); - } - - double[] xs = OHLCs.Skip(N).Select(x => x.DateTime.ToOADate()).ToArray(); - double[] ys = Finance.SMA(OHLCs.ToArray(), N); - return (xs, ys); - } - - /// - /// Return Bollinger bands (mean +/- 2*SD) for the OHLC closing prices. - /// The returned xs are times in OATime units. - /// The returned xs and ys arrays will be the length of the OHLC data minus N (points). - /// - /// each returned value represents the average of N points - /// times, averages, and both Bollinger bands for the OHLC closing prices - public (double[] xs, double[] sma, double[] lower, double[] upper) GetBollingerBands(int N) - { - if (N >= OHLCs.Count) - { - throw new ArgumentException("can not analyze more points than are available in the OHLCs"); - } - - double[] xs = OHLCs.Skip(N).Select(x => x.DateTime.ToOADate()).ToArray(); - (var sma, var lower, var upper) = Finance.Bollinger(OHLCs.ToArray(), N); - return (xs, sma, lower, upper); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/FunctionPlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/FunctionPlot.cs deleted file mode 100644 index 5adad5173..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/FunctionPlot.cs +++ /dev/null @@ -1,151 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -using System.Data; - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// A function plot displays a curve using a function (Y as a function of X) - /// - public class FunctionPlot : IPlottable - { - /// - /// The function to translate an X to a Y (or null if undefined) - /// - public Func Function; - - // customizations - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - public double LineWidth = 1; - public LineStyle LineStyle = LineStyle.Solid; - public string Label; - public Color Color = Color.Black; - - public FunctionPlot(Func function) - { - Function = function; - } - - public AxisLimits GetAxisLimits() - { - double max = double.NegativeInfinity; - double min = double.PositiveInfinity; - - foreach (double x in DataGen.Range(-10, 10, .1)) - { - double? y = Function(x); - if (y != null) - { - max = Math.Max(max, y.Value); - min = Math.Min(min, y.Value); - } - } - - // TODO: should X limits be null or NaN? - return new AxisLimits(-10, 10, min, max); - } - - public int PointCount { get; private set; } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - List xList = new List(); - List yList = new List(); - - PointCount = (int)dims.DataWidth; - for (int columnIndex = 0; columnIndex < dims.DataWidth; columnIndex++) - { - double x = columnIndex * dims.UnitsPerPxX + dims.XMin; - try - { - double? y = Function(x); - - if (y is null) - { - throw new NoNullAllowedException(); - } - - if (double.IsNaN(y.Value) || double.IsInfinity(y.Value)) - { - throw new ArithmeticException("not a real number"); - } - - xList.Add(x); - yList.Add(y.Value); - } - catch (Exception e) //Domain error, such log(-1) or 1/0 - { - Debug.WriteLine($"Y({x}) failed because {e}"); - } - } - - // create a temporary scatter plot and use it for rendering - double[] xs = xList.ToArray(); - double[] ys = yList.ToArray(); - var scatter = new ScatterPlot(xs, ys) - { - Color = Color, - LineWidth = LineWidth, - MarkerSize = 0, - Label = Label, - MarkerShape = MarkerShape.None, - LineStyle = LineStyle - }; - scatter.Render(dims, bmp, lowQuality); - } - - public void ValidateData(bool deepValidation = false) - { - if (Function is null) - { - throw new InvalidOperationException("function cannot be null"); - } - } - - public override string ToString() - { - string label = string.IsNullOrWhiteSpace(Label) ? "" : $" ({Label})"; - return $"PlottableFunction{label} displaying {PointCount} points"; - } - - public LegendItem[] GetLegendItems() - { - var singleLegendItem = new LegendItem() - { - label = Label, - color = Color, - lineStyle = LineStyle, - lineWidth = LineWidth, - markerShape = MarkerShape.None - }; - return new[] { singleLegendItem }; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/HLine.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/HLine.cs deleted file mode 100644 index df3d59b4e..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/HLine.cs +++ /dev/null @@ -1,42 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Horizontal line at a Y position - /// - public class HLine : AxisLine - { - /// - /// Y position to render the line - /// - public double Y { get => Position; set => Position = value; } - public override string ToString() => $"Horizontal line at Y={Y}"; - public HLine() : base(true) { } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Heatmap.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Heatmap.cs deleted file mode 100644 index 87bc518f2..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Heatmap.cs +++ /dev/null @@ -1,428 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -// ReSharper disable UnusedVariable -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// A heatmap displays a 2D array of intensities as small rectangles on the plot - /// colored according to their intensity value according to a colormap. - /// - public class Heatmap : IPlottable, IHasColormap - { - /// - /// Minimum heatmap value - /// - private double _min; - - /// - /// Maximum heatmap value - /// - private double _max; - - /// - /// Number of columns in the heatmap data - /// - private int _dataWidth; - - /// - /// Number of rows in the heatmap data - /// - private int _dataHeight; - - /// - /// Pre-rendered heatmap image - /// - protected Bitmap? BmpHeatmap; - - /// - /// Horizontal location of the lower-left cell - /// - public double OffsetX; - - /// - /// Vertical location of the lower-left cell - /// - public double OffsetY; - - /// - /// Width of each cell composing the heatmap - /// - public double CellWidth = 1; - - /// - /// Width of each cell composing the heatmap - /// - public double CellHeight = 1; - - /// - /// Position of the left edge of the heatmap - /// - public double XMin - { - get => OffsetX; - set => OffsetX = value; - } - - /// - /// Position of the right edge of the heatmap - /// - public double XMax - { - get => OffsetX + _dataWidth * CellWidth; - set => CellWidth = (value - OffsetX) / _dataWidth; - } - - public double YMin - { - get => OffsetY; - set => OffsetY = value; - } - - public double YMax - { - get => OffsetY + _dataHeight * CellHeight; - set => CellHeight = (value - OffsetY) / _dataHeight; - } - - /// - /// Text to appear in the legend - /// - public string Label { get; set; } - - /// - /// Colormap used to translate heatmap values to colors - /// - public ColourMap Colormap { get; private set; } = ColourMap.Viridis; - - /// - /// If defined, colors will be "clipped" to this value such that lower values (lower colors) will not be shown - /// - public double? ScaleMin { get; set; } - - /// - /// If defined, colors will be "clipped" to this value such that greater values (higher colors) will not be shown - /// - public double? ScaleMax { get; set; } - - /// - /// Heatmap values below this number (if defined) will be made transparent - /// - public double? TransparencyThreshold { get; set; } - - [Obsolete("This feature has been deprecated. Use AddImage() to place a bitmap beneath or above the heatmap.", true)] - public Bitmap BackgroundImage { get; set; } - - [Obsolete("This feature has been deprecated. Use AddImage() to place a bitmap beneath or above the heatmap.", true)] - public bool DisplayImageAbove { get; set; } - - [Obsolete("This feature has been deprecated. Use Plot.AddText() to add text to the plot.", true)] - public bool ShowAxisLabels; - - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - - /// - /// Value of the the lower edge of the colormap - /// - public double ColormapMin => ScaleMin ?? _min; - - /// - /// Value of the the upper edge of the colormap - /// - public double ColormapMax => ScaleMax ?? _max; - - /// - /// Indicates whether values extend beyond the lower edge of the colormap - /// - public bool ColormapMinIsClipped { get; private set; } - - /// - /// Indicates whether values extend beyond the upper edge of the colormap - /// - public bool ColormapMaxIsClipped { get; private set; } - - /// - /// If true, heatmap squares will be smoothed using high quality bicubic interpolation. - /// If false, heatmap squares will look like sharp rectangles (nearest neighbor interpolation). - /// - public bool Smooth - { - get => Interpolation != InterpolationMode.NearestNeighbor; - set => Interpolation = value ? InterpolationMode.HighQualityBicubic : InterpolationMode.NearestNeighbor; - } - - /// - /// Controls which interpolation mode is used when zooming into the heatmap. - /// - public InterpolationMode Interpolation { get; set; } = InterpolationMode.NearestNeighbor; - - /// - /// This method analyzes the intensities and colormap to create a bitmap - /// with a single pixel for every intensity value. The bitmap is stored - /// and displayed (without anti-alias interpolation) when Render() is called. - /// - /// 2D array of data for the heatmap (null values are not shown) - /// update the Colormap to use this colormap - /// minimum intensity (according to the colormap) - /// maximum intensity (according to the colormap) - public void Update(double?[,] intensities, ColourMap? colormap = null, double? min = null, double? max = null) - { - _dataWidth = intensities.GetLength(1); - _dataHeight = intensities.GetLength(0); - Colormap = colormap ?? Colormap; - ScaleMin = min; - ScaleMax = max; - - double?[] intensitiesFlattened = intensities.Cast().ToArray(); - _min = double.PositiveInfinity; - _max = double.NegativeInfinity; - - foreach (double? curr in intensitiesFlattened) - { - if (curr != null) - { - if (double.IsNaN(curr.Value)) - { - throw new ArgumentException("Heatmaps do not support intensities of double.NaN"); - } - - if (curr.HasValue) - { - throw new ArgumentException("Heatmaps do not support intensities of double.NaN"); - } - - if (curr.Value < _min) - { - _min = curr.Value; - } - - if (curr.Value > _max) - { - _max = curr.Value; - } - } - } - - ColormapMinIsClipped = ScaleMin.HasValue && ScaleMin > _min; - ColormapMaxIsClipped = ScaleMax.HasValue && ScaleMax < _max; - - double normalizeMin = (ScaleMin.HasValue && ScaleMin.Value < _min) ? ScaleMin.Value : _min; - double normalizeMax = (ScaleMax.HasValue && ScaleMax.Value > _max) ? ScaleMax.Value : _max; - - if (TransparencyThreshold.HasValue) - { - TransparencyThreshold = Normalize(TransparencyThreshold.Value, _min, _max, ScaleMin, ScaleMax); - } - - double?[] normalizedIntensities = Normalize(intensitiesFlattened, null, null, ScaleMin, ScaleMax); - - int[] flatArgb = ColourMap.GetRGBAs(normalizedIntensities, Colormap, minimumIntensity: TransparencyThreshold ?? 0); - double?[] normalizedValues = Normalize(Enumerable.Range(0, 256).Select(i => (double?)i).Reverse().ToArray(), null, null, ScaleMin, ScaleMax); - int[] scaleRgba = ColourMap.GetRGBAs(normalizedValues, Colormap); - - BmpHeatmap?.Dispose(); - BmpHeatmap = new Bitmap(_dataWidth, _dataHeight, PixelFormat.Format32bppArgb); - Rectangle rect = new(0, 0, BmpHeatmap.Width, BmpHeatmap.Height); - BitmapData bmpData = BmpHeatmap.LockBits(rect, ImageLockMode.ReadWrite, BmpHeatmap.PixelFormat); - Marshal.Copy(flatArgb, 0, bmpData.Scan0, flatArgb.Length); - BmpHeatmap.UnlockBits(bmpData); - } - - - /// - /// This method analyzes the intensities and colormap to create a bitmap - /// with a single pixel for every intensity value. The bitmap is stored - /// and displayed (without anti-alias interpolation) when Render() is called. - /// - /// 2D array of data for the heatmap (all values are shown) - /// update the Colormap to use this colormap - /// minimum intensity (according to the colormap) - /// maximum intensity (according to the colormap) - public void Update(double[,] intensities, ColourMap? colormap = null, double? min = null, double? max = null) - { - double?[,] tmp = new double?[intensities.GetLength(0), intensities.GetLength(1)]; - for (int i = 0; i < intensities.GetLength(0); i++) - { - for (int j = 0; j < intensities.GetLength(1); j++) - { - tmp[i, j] = intensities[i, j]; - } - } - - Update(tmp, colormap, min, max); - } - - private double? Normalize(double? input, double? min = null, double? max = null, double? scaleMin = null, double? scaleMax = null) - => Normalize(new[] { input }, min, max, scaleMin, scaleMax)[0]; - - private double?[] Normalize(double?[] input, double? min = null, double? max = null, double? scaleMin = null, double? scaleMax = null) - { - double? NormalizePreserveNull(double? i) - { - if (i.HasValue) - { - if (min != null) - { - if (max != null) - { - return (i.Value - min.Value) / (max.Value - min.Value); - } - } - } - return null; - } - - min ??= input.Min(); - max ??= input.Max(); - - min = (scaleMin.HasValue && scaleMin.Value < min) ? scaleMin.Value : min; - max = (scaleMax.HasValue && scaleMax.Value > max) ? scaleMax.Value : max; - - double?[] normalized = input.AsParallel().AsOrdered().Select(i => NormalizePreserveNull(i)).ToArray(); - - if (scaleMin.HasValue) - { - if (min != null) - { - if (max != null) - { - double threshold = (scaleMin.Value - min.Value) / (max.Value - min.Value); - normalized = normalized.AsParallel().AsOrdered().Select(i => i < threshold ? threshold : i).ToArray(); - } - } - } - - if (scaleMax.HasValue) - { - if (min != null) - { - if (max != null) - { - double threshold = (scaleMax.Value - min.Value) / (max.Value - min.Value); - normalized = normalized.AsParallel().AsOrdered().Select(i => i > threshold ? threshold : i).ToArray(); - } - } - } - - return normalized; - } - - public LegendItem[] GetLegendItems() - { - var singleLegendItem = new LegendItem() - { - label = Label, - color = Color.Gray, - lineWidth = 10, - markerShape = MarkerShape.None - }; - return new[] { singleLegendItem }; - } - - public virtual AxisLimits GetAxisLimits() - { - if (BmpHeatmap is null) - { - return new AxisLimits(); - } - - return new AxisLimits( - xMin: OffsetX, - xMax: OffsetX + _dataWidth * CellWidth, - yMin: OffsetY, - yMax: OffsetY + _dataHeight * CellHeight); - } - - public void ValidateData(bool deepValidation = false) - { - if (BmpHeatmap is null) - { - throw new InvalidOperationException("Update() was not called prior to rendering"); - } - - if (deepValidation) - { - if (_dataWidth > 1e6 || _dataHeight > 1e6) - { - throw new ArgumentException("Heatmaps may be unreliable for arrays with edges larger than 1 million values"); - } - - if (_dataWidth * _dataHeight > 1e7) - { - throw new ArgumentException("Heatmaps may be unreliable for arrays with more than 10 million values"); - } - } - } - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - RenderHeatmap(dims, bmp, lowQuality); - } - - protected virtual void RenderHeatmap(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - using Graphics gfx = GDI.Graphics(bmp, dims, lowQuality); - - gfx.InterpolationMode = Interpolation; - gfx.PixelOffsetMode = PixelOffsetMode.Half; - - int fromX = (int)Math.Round(dims.GetPixelX(OffsetX)); - int fromY = (int)Math.Round(dims.GetPixelY(OffsetY + _dataHeight * CellHeight)); - int width = (int)Math.Round(dims.GetPixelX(OffsetX + _dataWidth * CellWidth) - fromX); - int height = (int)Math.Round(dims.GetPixelY(OffsetY) - fromY); - - Rectangle destRect = new(fromX, fromY, width, height); - - ImageAttributes attr = new(); - attr.SetWrapMode(WrapMode.TileFlipXY); - - if (BmpHeatmap != null) - { - gfx.DrawImage( - image: BmpHeatmap, - destRect: destRect, - srcX: 0, - srcY: 0, - BmpHeatmap.Width, - BmpHeatmap.Height, - GraphicsUnit.Pixel, - attr); - } - } - - public override string ToString() - { - if (BmpHeatmap != null) - { - return $"PlottableHeatmap ({BmpHeatmap.Size})"; - } - - return base.ToString(); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/IDraggable.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/IDraggable.cs deleted file mode 100644 index bbb2d9f6b..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/IDraggable.cs +++ /dev/null @@ -1,38 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public interface IDraggable - { - bool DragEnabled { get; set; } - Cursor DragCursor { get; } - bool IsUnderMouse(double coordinateX, double coordinateY, double snapX, double snapY); - void DragTo(double coordinateX, double coordinateY, bool fixedSize); - event EventHandler Dragged; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/IHasColormap.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/IHasColormap.cs deleted file mode 100644 index fd3920fdb..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/IHasColormap.cs +++ /dev/null @@ -1,38 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public interface IHasColormap - { - ColourMap Colormap { get; } - double ColormapMin { get; } - double ColormapMax { get; } - bool ColormapMinIsClipped { get; } - bool ColormapMaxIsClipped { get; } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/IHasHighlightablePoints.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/IHasHighlightablePoints.cs deleted file mode 100644 index 1376e0ae4..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/IHasHighlightablePoints.cs +++ /dev/null @@ -1,38 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - interface IHasHighlightablePoints - { - (double x, double y, int index) HighlightPoint(int index); - (double x, double y, int index) HighlightPointNearestX(double x); - (double x, double y, int index) HighlightPointNearestY(double y); - (double x, double y, int index) HighlightPointNearest(double x, double y); - void HighlightClear(); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/IHasPoints.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/IHasPoints.cs deleted file mode 100644 index 7acc889ad..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/IHasPoints.cs +++ /dev/null @@ -1,64 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Indicates a plottable has data distributed along both axes - /// and can return the X/Y location of the point nearest a given X/Y location. - /// - public interface IHasPoints : IHasPointsGeneric - { - } - - /// - /// Indicates a plottable has data distributed along the horizontal axis - /// and can return the X/Y location of the point nearest a given X value. - /// - public interface IHasPointsGenericX - { - (TX x, TY y, int index) GetPointNearestX(TX x); - } - - /// - /// Indicates a plottable has data distributed along the vertical axis - /// and can return the X/Y location of the point nearest a given Y value. - /// - public interface IHasPointsGenericY - { - (TX x, TY y, int index) GetPointNearestY(TY y); - } - - /// - /// Indicates a plottable has data distributed along both axes - /// and can return the X/Y location of the point nearest a given X/Y location. - /// - public interface IHasPointsGeneric : IHasPointsGenericX, IHasPointsGenericY - { - (TX x, TY y, int index) GetPointNearest(TX x, TY y, TX xyRatio); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/IPlottable.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/IPlottable.cs deleted file mode 100644 index f14b9c716..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/IPlottable.cs +++ /dev/null @@ -1,57 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public interface IPlottable - { - bool IsVisible { get; set; } - void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false); - - int XAxisIndex { get; set; } - int YAxisIndex { get; set; } - - /// - /// Returns items to show in the legend. Most plottables return a single item. in this array will appear in the legend. - /// Plottables which never appear in the legend can return null. - /// - LegendItem[]? GetLegendItems(); - - /// - /// Return min and max of the horizontal and vertical data contained in this plottable. - /// Double.NaN is used for axes not containing data. - /// - /// - AxisLimits GetAxisLimits(); - - /// - /// Throw InvalidOperationException if ciritical variables are null or have incorrect sizes. - /// Deep validation is slower but also checks every value for NaN and Infinity. - /// - void ValidateData(bool deep = false); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Image.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Image.cs deleted file mode 100644 index 5d86c6eb7..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Image.cs +++ /dev/null @@ -1,114 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Display a Bitmap at X/Y coordinates in unit space - /// - public class Image : IPlottable - { - public bool IsVisible { get; set; } = true; - public double X; - public double Y; - public double Rotation; - public Bitmap Bitmap; - public Alignment Alignment; - public Color BorderColor; - public float BorderSize; - public string Label; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - - public override string ToString() => $"PlottableImage Size(\"{Bitmap.Size}\") at ({X}, {Y})"; - public AxisLimits GetAxisLimits() => new AxisLimits(X, X, Y, Y); - public LegendItem[]? GetLegendItems() => null; - - public void ValidateData(bool deep = false) - { - if (double.IsNaN(X) || double.IsInfinity(X)) - { - throw new InvalidOperationException("x must be a real value"); - } - - if (double.IsNaN(Y) || double.IsInfinity(Y)) - { - throw new InvalidOperationException("y must be a real value"); - } - - if (double.IsNaN(Rotation) || double.IsInfinity(Rotation)) - { - throw new InvalidOperationException("rotation must be a real value"); - } - - if (Bitmap is null) - { - throw new InvalidOperationException("image cannot be null"); - } - } - - private PointF TextLocation(PointF input) - { - return Alignment switch - { - Alignment.LowerCenter => new PointF(input.X - Bitmap.Width / 2, input.Y - Bitmap.Height), - Alignment.LowerLeft => new PointF(input.X, input.Y - Bitmap.Height), - Alignment.LowerRight => new PointF(input.X - Bitmap.Width, input.Y - Bitmap.Height), - Alignment.MiddleLeft => new PointF(input.X, input.Y - Bitmap.Height / 2), - Alignment.MiddleRight => new PointF(input.X - Bitmap.Width, input.Y - Bitmap.Height / 2), - Alignment.UpperCenter => new PointF(input.X - Bitmap.Width / 2, input.Y), - Alignment.UpperLeft => new PointF(input.X, input.Y), - Alignment.UpperRight => new PointF(input.X - Bitmap.Width, input.Y), - Alignment.MiddleCenter => new PointF(input.X - Bitmap.Width / 2, input.Y - Bitmap.Height / 2), - _ => throw new InvalidEnumArgumentException(), - }; - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - PointF defaultPoint = new PointF(dims.GetPixelX(X), dims.GetPixelY(Y)); - PointF textLocationPoint = (Rotation == 0) ? TextLocation(defaultPoint) : defaultPoint; - - using (Graphics gfx = GDI.Graphics(bmp, dims, lowQuality)) - { - using (var framePen = new Pen(BorderColor, BorderSize * 2)) - { - gfx.TranslateTransform((int)textLocationPoint.X, (int)textLocationPoint.Y); - gfx.RotateTransform((float)Rotation); - - if (BorderSize > 0) - { - gfx.DrawRectangle(framePen, new Rectangle(0, 0, Bitmap.Width - 1, Bitmap.Height - 1)); - } - - gfx.DrawImage(Bitmap, new PointF(0, 0)); - gfx.ResetTransform(); - } - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/LegendItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/LegendItem.cs deleted file mode 100644 index 76878fe75..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/LegendItem.cs +++ /dev/null @@ -1,52 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// This class describes a single item that appears in the figure legend. - /// - public class LegendItem - { - public string label; - public Color color; - public Color hatchColor; - public Color borderColor; - public float borderWith; - - public LineStyle lineStyle; - public double lineWidth; - public MarkerShape markerShape; - public double markerSize; - public HatchStyle hatchStyle; - public bool IsRectangle - { - get => lineWidth >= 10; - set => lineWidth = 10; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/LollipopPlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/LollipopPlot.cs deleted file mode 100644 index aeb37f23a..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/LollipopPlot.cs +++ /dev/null @@ -1,233 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Lollipop plots display a series of "Lollipops" in place of bars. - /// Positions are defined by Xs. - /// Heights are defined by Ys (relative to BaseValue and YOffsets). - /// - public class LollipopPlot : BarPlotBase, IPlottable - { - /// - /// Name for this series of values that will appear in the legend - /// - public string Label { get; set; } - - /// - /// Color of all lollipop components (the stick and the circle) - /// - public Color LollipopColor { get; set; } - - /// - /// Size of the circle at the end of each lollipop - /// - public float LollipopRadius { get; set; } = 5; - - /// - /// Create a lollipop plot from arrays of positions and sizes - /// - /// position of each lollipop - /// height of each lollipop - public LollipopPlot(double[] positions, double[] values) - { - if (positions is null || positions.Length == 0 || values is null || values.Length == 0) - { - throw new InvalidOperationException("xs and ys must be arrays that contains elements"); - } - - if (values.Length != positions.Length) - { - throw new InvalidOperationException("xs and ys must have the same number of elements"); - } - - ValueErrors = DataGen.Zeros(values.Length); - ValueOffsets = DataGen.Zeros(values.Length); - Values = values; - Positions = positions; - } - - public LegendItem[] GetLegendItems() - { - var singleItem = new LegendItem() - { - label = Label, - color = LollipopColor, - lineWidth = 10, - markerShape = MarkerShape.None, - borderColor = BorderColor, - borderWith = 1 - }; - return new[] { singleItem }; - } - - #region Render Implementation - - // NOTE: These render methods contains a lot of code and complexity not required to render this plot type. - // TODO: Delete as much of this code as possible and simplify the render methods. - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - using Graphics gfx = GDI.Graphics(bmp, dims, lowQuality); - for (int barIndex = 0; barIndex < Values.Length; barIndex++) - { - if (Orientation == PlotOrientation.Vertical) - { - RenderBarVertical(dims, gfx, Positions[barIndex] + PositionOffset, Values[barIndex], ValueErrors[barIndex], ValueOffsets[barIndex]); - } - else - { - RenderBarHorizontal(dims, gfx, Positions[barIndex] + PositionOffset, Values[barIndex], ValueErrors[barIndex], ValueOffsets[barIndex]); - } - } - } - - private void RenderBarFromRect(RectangleF rect, bool negative, Graphics gfx) - { - float centerPx = Orientation == PlotOrientation.Horizontal - ? rect.Y + rect.Height / 2 - : rect.X + rect.Width / 2; - - using var fillPen = new Pen(LollipopColor); - using var fillBrush = GDI.Brush(LollipopColor); - - if (Orientation == PlotOrientation.Horizontal) - { - gfx.FillEllipse(fillBrush, negative ? rect.X : rect.X + rect.Width, centerPx - LollipopRadius / 2, LollipopRadius, LollipopRadius); - gfx.DrawLine(fillPen, rect.X, centerPx, rect.X + rect.Width, centerPx); - } - else - { - gfx.FillEllipse(fillBrush, centerPx - LollipopRadius / 2, !negative ? rect.Y : rect.Y + rect.Height, LollipopRadius, LollipopRadius); - gfx.DrawLine(fillPen, centerPx, rect.Y, centerPx, rect.Y + rect.Height); - } - } - - private void RenderBarVertical(PlotDimensions dims, Graphics gfx, double position, double value, double valueError, double yOffset) - { - // bar body - float centerPx = dims.GetPixelX(position); - double edge1 = position - BarWidth / 2; - double value1 = Math.Min(ValueBase, value) + yOffset; - double value2 = Math.Max(ValueBase, value) + yOffset; - double valueSpan = value2 - value1; - - var rect = new RectangleF( - x: dims.GetPixelX(edge1), - y: dims.GetPixelY(value2), - width: (float)(BarWidth * dims.PxPerUnitX), - height: (float)(valueSpan * dims.PxPerUnitY)); - - // errorbar - double error1 = value > 0 ? value2 - Math.Abs(valueError) : value1 - Math.Abs(valueError); - double error2 = value > 0 ? value2 + Math.Abs(valueError) : value1 + Math.Abs(valueError); - float capPx1 = dims.GetPixelX(position - ErrorCapSize * BarWidth / 2); - float capPx2 = dims.GetPixelX(position + ErrorCapSize * BarWidth / 2); - float errorPx2 = dims.GetPixelY(error2); - float errorPx1 = dims.GetPixelY(error1); - - RenderBarFromRect(rect, value < 0, gfx); - - if (ErrorLineWidth > 0 && valueError > 0) - { - using var errorPen = new Pen(ErrorColor, ErrorLineWidth); - gfx.DrawLine(errorPen, centerPx, errorPx1, centerPx, errorPx2); - gfx.DrawLine(errorPen, capPx1, errorPx1, capPx2, errorPx1); - gfx.DrawLine(errorPen, capPx1, errorPx2, capPx2, errorPx2); - } - - if (ShowValuesAboveBars) - { - using (var valueTextFont = GDI.Font(Font)) - { - using (var valueTextBrush = GDI.Brush(Font.Color)) - { - using (var sf = new StringFormat() { LineAlignment = StringAlignment.Far, Alignment = StringAlignment.Center }) - { - gfx.DrawString(value.ToString(CultureInfo.InvariantCulture), valueTextFont, valueTextBrush, centerPx, rect.Y, sf); - } - } - } - } - } - - private void RenderBarHorizontal(PlotDimensions dims, Graphics gfx, double position, double value, double valueError, double yOffset) - { - // bar body - float centerPx = dims.GetPixelY(position); - double edge2 = position + BarWidth / 2; - double value1 = Math.Min(ValueBase, value) + yOffset; - double value2 = Math.Max(ValueBase, value) + yOffset; - double valueSpan = value2 - value1; - var rect = new RectangleF( - x: dims.GetPixelX(value1), - y: dims.GetPixelY(edge2), - height: (float)(BarWidth * dims.PxPerUnitY), - width: (float)(valueSpan * dims.PxPerUnitX)); - - RenderBarFromRect(rect, value < 0, gfx); - - // errorbar - double error1 = value > 0 ? value2 - Math.Abs(valueError) : value1 - Math.Abs(valueError); - double error2 = value > 0 ? value2 + Math.Abs(valueError) : value1 + Math.Abs(valueError); - float capPx1 = dims.GetPixelY(position - ErrorCapSize * BarWidth / 2); - float capPx2 = dims.GetPixelY(position + ErrorCapSize * BarWidth / 2); - float errorPx2 = dims.GetPixelX(error2); - float errorPx1 = dims.GetPixelX(error1); - - if (ErrorLineWidth > 0 && valueError > 0) - { - using var errorPen = new Pen(ErrorColor, ErrorLineWidth); - gfx.DrawLine(errorPen, errorPx1, centerPx, errorPx2, centerPx); - gfx.DrawLine(errorPen, errorPx1, capPx2, errorPx1, capPx1); - gfx.DrawLine(errorPen, errorPx2, capPx2, errorPx2, capPx1); - } - - if (ShowValuesAboveBars) - { - using (var valueTextFont = GDI.Font(Font)) - { - using (var valueTextBrush = GDI.Brush(Font.Color)) - { - using (var sf = new StringFormat() { LineAlignment = StringAlignment.Center, Alignment = StringAlignment.Near }) - { - gfx.DrawString(value.ToString(CultureInfo.InvariantCulture), valueTextFont, valueTextBrush, rect.X + rect.Width, centerPx, sf); - } - } - } - } - } - - #endregion - - public void ValidateData(bool deep = false) - { - // TODO: refactor entire data validation system for all plot types (triaged March 2021) - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/MarkerPlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/MarkerPlot.cs deleted file mode 100644 index 42e13856f..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/MarkerPlot.cs +++ /dev/null @@ -1,99 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class MarkerPlot : IPlottable - { - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - - /// - /// Horizontal position in coordinate space - /// - public double X { get; set; } - - /// - /// Vertical position in coordinate space - /// - public double Y { get; set; } - - /// - /// Marker to draw at this point - /// - public MarkerShape MarkerShape { get; set; } = MarkerShape.FilledCircle; - - /// - /// Size of the marker in pixel units - /// - public double MarkerSize { get; set; } = 10; - - /// - /// Color of the marker to display at this point - /// - public Color Color { get; set; } - - /// - /// Text to appear in the legend (if populated) - /// - public string Label { get; set; } - - public AxisLimits GetAxisLimits() => new(X, X, Y, Y); - - public LegendItem[] GetLegendItems() - { - LegendItem item = new() - { - label = Label, - markerShape = MarkerShape, - color = Color - }; - - return new[] { item }; - } - - public void ValidateData(bool deep = false) - { - Validate.AssertIsReal(nameof(X), X); - Validate.AssertIsReal(nameof(Y), Y); - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - if (!IsVisible) - { - return; - } - - PointF point = new(dims.GetPixelX(X), dims.GetPixelY(Y)); - - using Graphics gfx = GDI.Graphics(bmp, lowQuality); - MarkerTools.DrawMarker(gfx, point, MarkerShape, (float)MarkerSize, Color); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/MinMaxSearchStrategies/IMinMaxSearchStrategy.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/MinMaxSearchStrategies/IMinMaxSearchStrategy.cs deleted file mode 100644 index b3db56da4..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/MinMaxSearchStrategies/IMinMaxSearchStrategy.cs +++ /dev/null @@ -1,38 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public interface IMinMaxSearchStrategy - { - T[] SourceArray { get; set; } - void MinMaxRangeQuery(int l, int r, out double lowestValue, out double highestValue); - void updateElement(int index, T newValue); - void updateRange(int from, int to, T[] newData, int fromData = 0); - double SourceElement(int index); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/MinMaxSearchStrategies/LinearDoubleOnlyMinMaxStrategy.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/MinMaxSearchStrategies/LinearDoubleOnlyMinMaxStrategy.cs deleted file mode 100644 index 816674639..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/MinMaxSearchStrategies/LinearDoubleOnlyMinMaxStrategy.cs +++ /dev/null @@ -1,75 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class LinearDoubleOnlyMinMaxStrategy : IMinMaxSearchStrategy - { - double[] sourceArray; - public double[] SourceArray - { - get => sourceArray; - set => sourceArray = value; - } - - public void MinMaxRangeQuery(int l, int r, out double lowestValue, out double highestValue) - { - lowestValue = sourceArray[l]; - highestValue = sourceArray[l]; - for (int i = l; i <= r; i++) - { - if (sourceArray[i] < lowestValue) - { - lowestValue = sourceArray[i]; - } - - if (sourceArray[i] > highestValue) - { - highestValue = sourceArray[i]; - } - } - } - - public double SourceElement(int index) - { - return sourceArray[index]; - } - - public void updateElement(int index, double newValue) - { - sourceArray[index] = newValue; - } - - public void updateRange(int from, int to, double[] newData, int fromData = 0) - { - for (int i = from; i < to; i++) - { - sourceArray[i] = newData[i - from + fromData]; - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/MinMaxSearchStrategies/LinearFastDoubleMinMaxSearchStrategy.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/MinMaxSearchStrategies/LinearFastDoubleMinMaxSearchStrategy.cs deleted file mode 100644 index 95233835a..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/MinMaxSearchStrategies/LinearFastDoubleMinMaxSearchStrategy.cs +++ /dev/null @@ -1,80 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class LinearFastDoubleMinMaxSearchStrategy : LinearMinMaxSearchStrategy where T : struct, IComparable - { - private double[] sourceArrayDouble; - - public override T[] SourceArray - { - get => base.SourceArray; - set - { - sourceArrayDouble = value as double[]; - base.SourceArray = value; - } - } - - public override void MinMaxRangeQuery(int l, int r, out double lowestValue, out double highestValue) - { - if (sourceArrayDouble != null) - { - lowestValue = sourceArrayDouble[l]; - highestValue = sourceArrayDouble[l]; - for (int i = l; i <= r; i++) - { - if (sourceArrayDouble[i] < lowestValue) - { - lowestValue = sourceArrayDouble[i]; - } - - if (sourceArrayDouble[i] > highestValue) - { - highestValue = sourceArrayDouble[i]; - } - } - return; - } - else - { - base.MinMaxRangeQuery(l, r, out lowestValue, out highestValue); - } - } - - public override double SourceElement(int index) - { - if (sourceArrayDouble != null) - { - return sourceArrayDouble[index]; - } - - return Convert.ToDouble(SourceArray[index]); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/MinMaxSearchStrategies/LinearMinMaxSearchStrategy.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/MinMaxSearchStrategies/LinearMinMaxSearchStrategy.cs deleted file mode 100644 index b7360e213..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/MinMaxSearchStrategies/LinearMinMaxSearchStrategy.cs +++ /dev/null @@ -1,100 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -using System.Linq.Expressions; - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class LinearMinMaxSearchStrategy : IMinMaxSearchStrategy where T : struct, IComparable - { - private T[] _sourceArray; - public virtual T[] SourceArray - { - get => _sourceArray; - set => _sourceArray = value; - } - - // precompiled lambda expressions for fast math on generic - private static Func _lessThanExp; - private static Func _greaterThanExp; - private void InitExp() - { - ParameterExpression paramA = Expression.Parameter(typeof(T), "a"); - ParameterExpression paramB = Expression.Parameter(typeof(T), "b"); - // add the parameters together - BinaryExpression bodyLessThan = Expression.LessThan(paramA, paramB); - BinaryExpression bodyGreaterThan = Expression.GreaterThan(paramA, paramB); - // compile it - _lessThanExp = Expression.Lambda>(bodyLessThan, paramA, paramB).Compile(); - _greaterThanExp = Expression.Lambda>(bodyGreaterThan, paramA, paramB).Compile(); - } - - public LinearMinMaxSearchStrategy() - { - InitExp(); - } - - public virtual void MinMaxRangeQuery(int l, int r, out double lowestValue, out double highestValue) - { - T lowestValueT = _sourceArray[l]; - T highestValueT = _sourceArray[l]; - for (int i = l; i <= r; i++) - { - if (_lessThanExp(_sourceArray[i], lowestValueT)) - { - lowestValueT = _sourceArray[i]; - } - - if (_greaterThanExp(_sourceArray[i], highestValueT)) - { - highestValueT = _sourceArray[i]; - } - } - lowestValue = Convert.ToDouble(lowestValueT); - highestValue = Convert.ToDouble(highestValueT); - } - - public virtual double SourceElement(int index) - { - return Convert.ToDouble(_sourceArray[index]); - } - - public void updateElement(int index, T newValue) - { - _sourceArray[index] = newValue; - } - - public void updateRange(int from, int to, T[] newData, int fromData = 0) - { - // TODO: Turn this into a foreach loop - for (int i = from; i < to; i++) - { - _sourceArray[i] = newData[i - from + fromData]; - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/MinMaxSearchStrategies/SegmentedTreeMinMaxSearchStrategy.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/MinMaxSearchStrategies/SegmentedTreeMinMaxSearchStrategy.cs deleted file mode 100644 index bcbf7d5d6..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/MinMaxSearchStrategies/SegmentedTreeMinMaxSearchStrategy.cs +++ /dev/null @@ -1,71 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class SegmentedTreeMinMaxSearchStrategy : IMinMaxSearchStrategy where T : struct, IComparable - { - private SegmentedTree segmentedTree; - - public bool TreesReady => segmentedTree.TreesReady; - public SegmentedTreeMinMaxSearchStrategy() - { - segmentedTree = new SegmentedTree(); - } - - public SegmentedTreeMinMaxSearchStrategy(T[] data) : this() - { - SourceArray = data; - } - - public T[] SourceArray - { - get => segmentedTree.SourceArray; - set => segmentedTree.SourceArray = value; - } - - public void MinMaxRangeQuery(int l, int r, out double lowestValue, out double highestValue) - { - segmentedTree.MinMaxRangeQuery(l, r, out lowestValue, out highestValue); - } - - public double SourceElement(int index) - { - return Convert.ToDouble(SourceArray[index]); - } - - public void updateElement(int index, T newValue) - { - segmentedTree.UpdateElement(index, newValue); - } - - public void updateRange(int from, int to, T[] newData, int fromData = 0) - { - segmentedTree.UpdateRange(from, to, newData, fromData); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/PiePlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/PiePlot.cs deleted file mode 100644 index 6abaa1d10..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/PiePlot.cs +++ /dev/null @@ -1,246 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// A pie plot displays a collection of values as a circle. - /// Pie plots with a hollow center are donut plots. - /// - public class PiePlot : IPlottable - { - public double[] Values; - public string Label; - public string[] SliceLabels; - - public Color[] SliceFillColors; - public Color[] SliceLabelColors; - public Color BackgroundColor; - - public bool Explode; - public bool ShowValues; - public bool ShowPercentages; - public bool ShowLabels; - - public double DonutSize; - public string DonutLabel; - public readonly Font CenterFont = new(); - public readonly Font SliceFont = new(); - - public float OutlineSize = 0; - public Color OutlineColor = Color.Black; - - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - - public PiePlot(double[] values, string[] groupNames, Color[] colors) - { - Values = values; - SliceLabels = groupNames; - SliceFillColors = colors; - - SliceFont.Size = 18; - SliceFont.Bold = true; - SliceFont.Color = Color.White; - - CenterFont.Size = 48; - CenterFont.Bold = true; - } - - public override string ToString() - { - string label = string.IsNullOrWhiteSpace(Label) ? "" : $" ({Label})"; - return $"PlottablePie{label} with {PointCount} points"; - } - - public LegendItem[] GetLegendItems() - { - return Enumerable - .Range(0, Values.Length) - .Select(i => new LegendItem() { label = SliceLabels[i], color = SliceFillColors[i], lineWidth = 10 }) - .ToArray(); - } - - public AxisLimits GetAxisLimits() => new(-0.5, 0.5, -1, 1); - - public int PointCount => Values.Length; - - public void ValidateData(bool deep = false) - { - Validate.AssertHasElements("values", Values); - Validate.AssertHasElements("colors", SliceFillColors); - Validate.AssertAllReal("values", Values); - // TODO: ensure the length of colors and group names matches expected length - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - using (Graphics gfx = GDI.Graphics(bmp, dims, lowQuality)) - { - using (Pen backgroundPen = GDI.Pen(BackgroundColor)) - { - using (Pen outlinePen = GDI.Pen(OutlineColor, OutlineSize)) - { - using (Brush sliceFillBrush = GDI.Brush(Color.Black)) - { - using (var sliceFont = GDI.Font(SliceFont)) - { - using (SolidBrush sliceFontBrush = (SolidBrush)GDI.Brush(SliceFont.Color)) - { - using (var centerFont = GDI.Font(CenterFont)) - { - using (Brush centerFontBrush = GDI.Brush(CenterFont.Color)) - { - using (StringFormat sfCenter = new StringFormat() { LineAlignment = StringAlignment.Center, Alignment = StringAlignment.Center }) - { - double[] proportions = Values.Select(x => x / Values.Sum()).ToArray(); - - double centreX = 0; - double centreY = 0; - float diameterPixels = .9f * Math.Min(dims.DataWidth, dims.DataHeight); - - // record label details and draw them after slices to prevent cover-ups - double[] labelXs = new double[Values.Length]; - double[] labelYs = new double[Values.Length]; - string[] labelStrings = new string[Values.Length]; - - RectangleF boundingRectangle = new RectangleF( - dims.GetPixelX(centreX) - diameterPixels / 2, - dims.GetPixelY(centreY) - diameterPixels / 2, - diameterPixels, - diameterPixels); - - if (DonutSize > 0) - { - GraphicsPath graphicsPath = new GraphicsPath(); - float donutDiameterPixels = (float)DonutSize * diameterPixels; - RectangleF donutHoleBoundingRectangle = new RectangleF( - dims.GetPixelX(centreX) - donutDiameterPixels / 2, - dims.GetPixelY(centreY) - donutDiameterPixels / 2, - donutDiameterPixels, - donutDiameterPixels); - graphicsPath.AddEllipse(donutHoleBoundingRectangle); - Region excludedRegion = new Region(graphicsPath); - gfx.ExcludeClip(excludedRegion); - } - - double start = -90; - for (int i = 0; i < Values.Length; i++) - { - // determine where the slice is to be drawn - double sweep = proportions[i] * 360; - double sweepOffset = Explode ? -1 : 0; - double angle = (Math.PI / 180) * ((sweep + 2 * start) / 2); - double xOffset = Explode ? 3 * Math.Cos(angle) : 0; - double yOffset = Explode ? 3 * Math.Sin(angle) : 0; - - // record where and what to label the slice - double sliceLabelR = 0.35 * diameterPixels; - labelXs[i] = (boundingRectangle.X + diameterPixels / 2 + xOffset + Math.Cos(angle) * sliceLabelR); - labelYs[i] = (boundingRectangle.Y + diameterPixels / 2 + yOffset + Math.Sin(angle) * sliceLabelR); - string sliceLabelValue = (ShowValues) ? $"{Values[i]}" : ""; - string sliceLabelPercentage = ShowPercentages ? $"{proportions[i] * 100:f1}%" : ""; - string sliceLabelName = (ShowLabels && SliceLabels != null) ? SliceLabels[i] : ""; - labelStrings[i] = $"{sliceLabelValue}\n{sliceLabelPercentage}\n{sliceLabelName}".Trim(); - - ((SolidBrush)sliceFillBrush).Color = SliceFillColors[i]; - gfx.FillPie(brush: sliceFillBrush, - x: (int)(boundingRectangle.X + xOffset), - y: (int)(boundingRectangle.Y + yOffset), - width: boundingRectangle.Width, - height: boundingRectangle.Height, - startAngle: (float)start, - sweepAngle: (float)(sweep + sweepOffset)); - - if (Explode) - { - gfx.DrawPie( - pen: backgroundPen, - x: (int)(boundingRectangle.X + xOffset), - y: (int)(boundingRectangle.Y + yOffset), - width: boundingRectangle.Width, - height: boundingRectangle.Height, - startAngle: (float)start, - sweepAngle: (float)(sweep + sweepOffset)); - } - start += sweep; - } - - // TODO: move length checking logic into new validation system (triaged March, 2021) - bool useCustomLabelColors = SliceLabelColors.Length == Values.Length; - - for (int i = 0; i < Values.Length; i++) - { - if (!string.IsNullOrWhiteSpace(labelStrings[i])) - { - if (useCustomLabelColors) - { - sliceFontBrush.Color = SliceLabelColors[i]; - } - - gfx.DrawString(labelStrings[i], sliceFont, sliceFontBrush, (float)labelXs[i], (float)labelYs[i], sfCenter); - } - } - - if (OutlineSize > 0) - { - gfx.DrawEllipse( - outlinePen, - boundingRectangle.X, - boundingRectangle.Y, - boundingRectangle.Width, - boundingRectangle.Height); - } - - gfx.ResetClip(); - - gfx.DrawString(DonutLabel, centerFont, centerFontBrush, dims.GetPixelX(0), dims.GetPixelY(0), sfCenter); - - if (Explode) - { - // draw a background-colored circle around the perimeter to make it look like all pieces are the same size - backgroundPen.Width = 20; - gfx.DrawEllipse( - pen: backgroundPen, - x: boundingRectangle.X, - y: boundingRectangle.Y, - width: boundingRectangle.Width, - height: boundingRectangle.Height); - } - } - } - } - } - } - } - } - } - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Polygon.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Polygon.cs deleted file mode 100644 index dd2f5b431..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Polygon.cs +++ /dev/null @@ -1,144 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// A polygon is a collection of X/Y points that are all connected to form a closed shape. - /// Polygons can be optionally filled with a color or a gradient. - /// - public class Polygon : IPlottable - { - // data - public double[] Xs; - public double[] Ys; - - // configuration - public string Label; - public double LineWidth = 1; - public Color LineColor = Color.Black; - public bool Fill = true; - public Color FillColor = Color.Gray; - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - public Color HatchColor = Color.Transparent; - public HatchStyle HatchStyle = HatchStyle.None; - - public Polygon(double[] xs, double[] ys) - { - Xs = xs; - Ys = ys; - } - - public override string ToString() - { - string label = string.IsNullOrWhiteSpace(Label) ? "" : $" ({Label})"; - return $"PlottablePolygon{label} with {PointCount} points"; - } - - public int PointCount => Xs.Length; - - public AxisLimits GetAxisLimits() - { - double xMin = Xs[0]; - double xMax = Xs[0]; - double yMin = Ys[0]; - double yMax = Ys[0]; - - for (int i = 1; i < Xs.Length; i++) - { - xMin = Math.Min(xMin, Xs[i]); - xMax = Math.Max(xMax, Xs[i]); - yMin = Math.Min(yMin, Ys[i]); - yMax = Math.Max(yMax, Ys[i]); - } - - return new AxisLimits(xMin, xMax, yMin, yMax); - } - - public LegendItem[] GetLegendItems() - { - var singleLegendItem = new LegendItem() - { - label = Label, - color = Fill ? FillColor : LineColor, - lineWidth = Fill ? 10 : LineWidth, - markerShape = MarkerShape.None, - hatchColor = HatchColor, - hatchStyle = HatchStyle - }; - return new[] { singleLegendItem }; - } - - public void ValidateData(bool deep = false) - { - Validate.AssertHasElements("xs", Xs); - Validate.AssertHasElements("ys", Ys); - Validate.AssertEqualLength("xs and ys", Xs, Ys); - - if (Xs.Length < 3) - { - throw new InvalidOperationException("polygons must contain at least 3 points"); - } - - if (deep) - { - Validate.AssertAllReal("xs", Xs); - Validate.AssertAllReal("ys", Ys); - } - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - PointF[] points = new PointF[Xs.Length]; - for (int i = 0; i < Xs.Length; i++) - { - points[i] = new PointF(dims.GetPixelX(Xs[i]), dims.GetPixelY(Ys[i])); - } - - using (Graphics gfx = GDI.Graphics(bmp, dims, lowQuality)) - { - using (Brush fillBrush = GDI.Brush(FillColor, HatchColor, HatchStyle)) - { - using (Pen outlinePen = GDI.Pen(LineColor, (float)LineWidth)) - { - if (Fill) - { - gfx.FillPolygon(fillBrush, points); - } - - if (LineWidth > 0) - { - gfx.DrawPolygon(outlinePen, points); - } - } - } - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Polygons.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Polygons.cs deleted file mode 100644 index beef6f47f..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Polygons.cs +++ /dev/null @@ -1,216 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Polygons are multiple Polygon objects. - /// This plot type is faster alternative for rendering a large number of polygons - /// compared to adding a bunch of individual Polygon objects to the plot. - /// - public class Polygons : IPlottable - { - // data - public readonly List> Polys; - - // customization - public string Label; - public double LineWidth; - public Color LineColor; - public bool Fill = true; - public Color FillColor; - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - public Color HatchColor = Color.Transparent; - public HatchStyle HatchStyle = HatchStyle.None; - public bool SkipOffScreenPolygons = true; - public bool RenderSmallPolygonsAsSinglePixels = true; - - public Polygons(List> polys) - { - Polys = polys; - } - - public override string ToString() - { - string label = string.IsNullOrWhiteSpace(Label) ? "" : $" ({Label})"; - return $"PlottablePolygons {label} with {PointCount} polygons"; - } - - public void ValidateData(bool deep = false) - { - if (deep == false) - { - return; - } - - foreach (var poly in Polys) - { - foreach (var point in poly) - { - if (double.IsNaN(point.x) || double.IsNaN(point.y)) - { - throw new InvalidOperationException("points cannot contain NaN"); - } - - if (double.IsInfinity(point.x) || double.IsInfinity(point.y)) - { - throw new InvalidOperationException("points cannot contain Infinity"); - } - } - } - } - - public int PointCount => Polys.Count; - - public AxisLimits GetAxisLimits() - { - double xMin = Polys[0][0].x; - double xMax = Polys[0][0].x; - double yMin = Polys[0][0].y; - double yMax = Polys[0][0].y; - - foreach (var poly in Polys) - { - foreach (var (x, y) in poly) - { - xMin = Math.Min(xMin, x); - xMax = Math.Max(xMax, x); - yMin = Math.Min(yMin, y); - yMax = Math.Max(yMax, y); - } - } - - return new AxisLimits(xMin, xMax, yMin, yMax); - } - - public LegendItem[]? GetLegendItems() - { - var singleLegendItem = new LegendItem() - { - label = Label, - color = Fill ? FillColor : LineColor, - lineWidth = Fill ? 10 : LineWidth, - markerShape = MarkerShape.None, - hatchColor = HatchColor, - hatchStyle = HatchStyle - }; - return new LegendItem[] { singleLegendItem }; - } - - private bool IsBiggerThenPixel(List<(double x, double y)> poly, double UnitsPerPixelX, double UnitsPerPixelY) - { - double minX = poly[0].x; - double maxX = poly[0].x; - double minY = poly[0].y; - double maxY = poly[0].y; - double smallerThenPixelX = 0.5 * UnitsPerPixelX; - double smallerThenPixelY = 0.5 * UnitsPerPixelY; - for (int i = 1; i < poly.Count; i++) - { - if (poly[i].x < minX) - { - minX = poly[i].x; - if (maxX - minX > smallerThenPixelX) - { - return true; - } - } - if (poly[i].x > maxX) - { - maxX = poly[i].x; - if (maxX - minX > smallerThenPixelX) - { - return true; - } - } - if (poly[i].y < minX) - { - minY = poly[i].y; - if (maxY - minY > smallerThenPixelY) - { - return true; - } - } - if (poly[i].y > maxX) - { - maxY = poly[i].y; - if (maxY - minY > smallerThenPixelY) - { - return true; - } - } - } - return (maxX - minX > smallerThenPixelX || maxY - minY > smallerThenPixelY); - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - using (Graphics gfx = GDI.Graphics(bmp, dims, lowQuality)) - { - using (Brush brush = GDI.Brush(FillColor, HatchColor, HatchStyle)) - { - using (Pen pen = GDI.Pen(LineColor, LineWidth)) - { - foreach (List<(double x, double y)> poly in Polys) - { - if (SkipOffScreenPolygons && - poly.Where(pt => pt.x >= dims.XMin && pt.x <= dims.XMax && - pt.y >= dims.YMin && pt.y <= dims.YMax) - .Count() == 0) - { - continue; - } - - var polyArray = RenderSmallPolygonsAsSinglePixels && !IsBiggerThenPixel(poly, dims.UnitsPerPxX, dims.UnitsPerPxY) ? - new PointF[] { new PointF(dims.GetPixelX(poly[0].x), dims.GetPixelY(poly[0].y)) } : - poly.Select(point => new PointF(dims.GetPixelX(point.x), dims.GetPixelY(point.y))).ToArray(); - - if (Fill) - { - if (polyArray.Length >= 3) - { - gfx.FillPolygon(brush, polyArray); - } - else - { - gfx.FillRectangle(brush, polyArray[0].X, polyArray[0].Y, 1, 1); - } - } - - if (LineWidth > 0) - { - gfx.DrawPolygon(pen, polyArray); - } - } - } - } - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/PopulationPlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/PopulationPlot.cs deleted file mode 100644 index 0dc5cf8a1..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/PopulationPlot.cs +++ /dev/null @@ -1,541 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Population plots are designed to show collections of data. - /// A Population is a 1D array of values, and statistics are calculated automatically. - /// Populations can be displayed as bar plots, box plots, or scatter plots. - /// Public methods, fields, and properties allow extensive customization. - /// This plottable supports higher-order grouping (groups of groups). - /// - public class PopulationPlot : IPlottable - { - public readonly PopulationMultiSeries MultiSeries; - public int GroupCount => MultiSeries.groupCount; - public int SeriesCount => MultiSeries.seriesCount; - public string[] SeriesLabels => MultiSeries.seriesLabels; - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - public enum DisplayItems { BoxOnly, BoxAndScatter, ScatterAndBox, ScatterOnly }; - public enum BoxStyle { BarMeanStDev, BarMeanStdErr, BoxMeanStdevStderr, BoxMedianQuartileOutlier, MeanAndStdev, MeanAndStderr }; - public bool DistributionCurve = true; - public LineStyle DistributionCurveLineStyle = LineStyle.Solid; - public Color DistributionCurveColor = Color.Black; - public Color ScatterOutlineColor = Color.Black; - public DisplayItems DataFormat = DisplayItems.BoxAndScatter; - public BoxStyle DataBoxStyle = BoxStyle.BoxMedianQuartileOutlier; - - public PopulationPlot(PopulationMultiSeries groupedSeries) - { - MultiSeries = groupedSeries; - } - - public PopulationPlot(Population[] populations, string label = null, Color? color = null) - { - var ps = new PopulationSeries(populations, label, color ?? Color.LightGray); - MultiSeries = new PopulationMultiSeries(new PopulationSeries[] { ps }); - } - - public PopulationPlot(PopulationSeries populationSeries) - { - MultiSeries = new PopulationMultiSeries(new PopulationSeries[] { populationSeries }); - } - - public PopulationPlot(Population population, string label = null, Color? color = null) - { - var populations = new Population[] { population }; - var ps = new PopulationSeries(populations, label, color ?? Color.LightGray); - MultiSeries = new PopulationMultiSeries(new PopulationSeries[] { ps }); - } - - public override string ToString() - { - return $"PlottableSeries with {MultiSeries.groupCount} groups, {MultiSeries.seriesCount} series, and {PointCount} total points"; - } - - public int PointCount - { - get - { - int pointCount = 0; - foreach (var group in MultiSeries.multiSeries) - { - foreach (var population in group.populations) - { - pointCount += population.count; - } - } - - return pointCount; - } - } - - public void ValidateData(bool deep = false) - { - if (MultiSeries is null) - { - throw new InvalidOperationException("population multi-series cannot be null"); - } - } - - public LegendItem[]? GetLegendItems() => MultiSeries.multiSeries - .Select(x => new LegendItem() { label = x.seriesLabel, color = x.color, lineWidth = 10 }) - .ToArray(); - - public AxisLimits GetAxisLimits() - { - double minValue = double.PositiveInfinity; - double maxValue = double.NegativeInfinity; - - foreach (var series in MultiSeries.multiSeries) - { - foreach (var population in series.populations) - { - minValue = Math.Min(minValue, population.min); - minValue = Math.Min(minValue, population.minus3stDev); - maxValue = Math.Max(maxValue, population.max); - maxValue = Math.Max(maxValue, population.plus3stDev); - } - } - - double positionMin = 0; - double positionMax = MultiSeries.groupCount - 1; - - // padd slightly - positionMin -= .5; - positionMax += .5; - - return new AxisLimits(positionMin, positionMax, minValue, maxValue); - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - Random rand = new Random(0); - double groupWidth = .8; - var popWidth = groupWidth / SeriesCount; - - for (int seriesIndex = 0; seriesIndex < SeriesCount; seriesIndex++) - { - for (int groupIndex = 0; groupIndex < GroupCount; groupIndex++) - { - var series = MultiSeries.multiSeries[seriesIndex]; - var population = series.populations[groupIndex]; - var groupLeft = groupIndex - groupWidth / 2; - var popLeft = groupLeft + popWidth * seriesIndex; - - Position scatterPos, boxPos; - switch (DataFormat) - { - case DisplayItems.BoxAndScatter: - boxPos = Position.Left; - scatterPos = Position.Right; - break; - case DisplayItems.BoxOnly: - boxPos = Position.Center; - scatterPos = Position.Hide; - break; - case DisplayItems.ScatterAndBox: - boxPos = Position.Right; - scatterPos = Position.Left; - break; - case DisplayItems.ScatterOnly: - boxPos = Position.Hide; - scatterPos = Position.Center; - break; - default: - throw new NotImplementedException(); - } - - Scatter(dims, bmp, lowQuality, population, rand, popLeft, popWidth, series.color, ScatterOutlineColor, 128, scatterPos); - - if (DistributionCurve) - { - Distribution(dims, bmp, lowQuality, population, rand, popLeft, popWidth, DistributionCurveColor, scatterPos, DistributionCurveLineStyle); - } - - switch (DataBoxStyle) - { - case BoxStyle.BarMeanStdErr: - Bar(dims, bmp, lowQuality, population, rand, popLeft, popWidth, series.color, boxPos, useStdErr: true); - break; - case BoxStyle.BarMeanStDev: - Bar(dims, bmp, lowQuality, population, rand, popLeft, popWidth, series.color, boxPos, useStdErr: false); - break; - case BoxStyle.BoxMeanStdevStderr: - Box(dims, bmp, lowQuality, population, rand, popLeft, popWidth, series.color, boxPos, BoxFormat.StdevStderrMean); - break; - case BoxStyle.BoxMedianQuartileOutlier: - Box(dims, bmp, lowQuality, population, rand, popLeft, popWidth, series.color, boxPos, BoxFormat.OutlierQuartileMedian); - break; - case BoxStyle.MeanAndStderr: - MeanAndError(dims, bmp, lowQuality, population, rand, popLeft, popWidth, series.color, boxPos, useStdErr: true); - break; - case BoxStyle.MeanAndStdev: - MeanAndError(dims, bmp, lowQuality, population, rand, popLeft, popWidth, series.color, boxPos, useStdErr: false); - break; - default: - throw new NotImplementedException(); - } - } - } - } - - public enum Position { Hide, Center, Left, Right } - - private static void Scatter(PlotDimensions dims, Bitmap bmp, bool lowQuality, Population pop, Random rand, - double popLeft, double popWidth, Color fillColor, Color edgeColor, byte alpha, Position position) - { - // adjust edges to accomodate special positions - if (position == Position.Hide) - { - return; - } - - if (position == Position.Left || position == Position.Right) - { - popWidth /= 2; - } - - if (position == Position.Right) - { - popLeft += popWidth; - } - - // contract edges slightly to encourage padding between elements - double edgePaddingFrac = 0.2; - popLeft += popWidth * edgePaddingFrac; - popWidth -= (popWidth * edgePaddingFrac) * 2; - - float radius = 5; - - using (Graphics gfx = GDI.Graphics(bmp, dims, lowQuality)) - { - using (Pen penEdge = GDI.Pen(Color.FromArgb(alpha, edgeColor))) - { - using (Brush brushFill = GDI.Brush(Color.FromArgb(alpha, fillColor))) - { - foreach (double value in pop.values) - { - double yPx = dims.GetPixelY(value); - double xPx = dims.GetPixelX(popLeft + rand.NextDouble() * popWidth); - gfx.FillEllipse(brushFill, (float)(xPx - radius), (float)(yPx - radius), radius * 2, radius * 2); - gfx.DrawEllipse(penEdge, (float)(xPx - radius), (float)(yPx - radius), radius * 2, radius * 2); - } - } - } - } - } - - private static void Distribution(PlotDimensions dims, Bitmap bmp, bool lowQuality, Population pop, Random rand, - double popLeft, double popWidth, Color color, Position position, LineStyle lineStyle) - { - // adjust edges to accomodate special positions - if (position == Position.Hide) - { - return; - } - - if (position == Position.Left || position == Position.Right) - { - popWidth /= 2; - } - - if (position == Position.Right) - { - popLeft += popWidth; - } - - // contract edges slightly to encourage padding between elements - double edgePaddingFrac = 0.2; - popLeft += popWidth * edgePaddingFrac; - popWidth -= (popWidth * edgePaddingFrac) * 2; - - double[] ys = DataGen.Range(pop.minus3stDev, pop.plus3stDev, dims.UnitsPerPxY); - if (ys.Length == 0) - { - return; - } - - double[] ysFrac = pop.GetDistribution(ys, normalize: false); - - PointF[] points = new PointF[ys.Length]; - for (int i = 0; i < ys.Length; i++) - { - float x = (float)dims.GetPixelX(popLeft + popWidth * ysFrac[i]); - float y = (float)dims.GetPixelY(ys[i]); - points[i] = new PointF(x, y); - } - - using (Graphics gfx = GDI.Graphics(bmp, dims, lowQuality)) - { - using (Pen pen = GDI.Pen(color, 1, lineStyle, true)) - { - gfx.DrawLines(pen, points); - } - } - } - - private static void MeanAndError(PlotDimensions dims, Bitmap bmp, bool lowQuality, Population pop, Random rand, - double popLeft, double popWidth, Color color, Position position, bool useStdErr = false) - { - // adjust edges to accomodate special positions - if (position == Position.Hide) - { - return; - } - - if (position == Position.Left || position == Position.Right) - { - popWidth /= 2; - } - - if (position == Position.Right) - { - popLeft += popWidth; - } - - // determine the center point and calculate bounds - double centerX = popLeft + popWidth / 2; - double xPx = dims.GetPixelX(centerX); - double yPx = dims.GetPixelY(pop.mean); - - double errorMaxPx, errorMinPx; - if (useStdErr) - { - errorMaxPx = dims.GetPixelY(pop.mean + pop.stdErr); - errorMinPx = dims.GetPixelY(pop.mean - pop.stdErr); - } - else - { - errorMaxPx = dims.GetPixelY(pop.mean + pop.stDev); - errorMinPx = dims.GetPixelY(pop.mean - pop.stDev); - } - - // make cap width a fraction of available space - double capWidthFrac = .38; - double capWidth = popWidth * capWidthFrac; - double capPx1 = dims.GetPixelX(centerX - capWidth / 2); - double capPx2 = dims.GetPixelX(centerX + capWidth / 2); - float radius = 5; - - using (Graphics gfx = GDI.Graphics(bmp, dims, lowQuality)) - { - using (Pen pen = GDI.Pen(color, 2)) - { - using (Brush brush = GDI.Brush(color)) - { - gfx.FillEllipse(brush, (float)(xPx - radius), (float)(yPx - radius), radius * 2, radius * 2); - gfx.DrawLine(pen, (float)xPx, (float)errorMinPx, (float)xPx, (float)errorMaxPx); - gfx.DrawLine(pen, (float)capPx1, (float)errorMinPx, (float)capPx2, (float)errorMinPx); - gfx.DrawLine(pen, (float)capPx1, (float)errorMaxPx, (float)capPx2, (float)errorMaxPx); - } - } - } - } - - private static void Bar(PlotDimensions dims, Bitmap bmp, bool lowQuality, Population pop, Random rand, - double popLeft, double popWidth, Color color, Position position, bool useStdErr = false) - { - // adjust edges to accomodate special positions - if (position == Position.Hide) - { - return; - } - - if (position == Position.Left || position == Position.Right) - { - popWidth /= 2; - } - - if (position == Position.Right) - { - popLeft += popWidth; - } - - // determine the center point and calculate bounds - double centerX = popLeft + popWidth / 2; - double xPx = dims.GetPixelX(centerX); - double yPxTop = dims.GetPixelY(pop.mean); - double yPxBase = dims.GetPixelY(0); - - double errorMaxPx, errorMinPx; - if (useStdErr) - { - errorMaxPx = dims.GetPixelY(pop.mean + pop.stdErr); - errorMinPx = dims.GetPixelY(pop.mean - pop.stdErr); - } - else - { - errorMaxPx = dims.GetPixelY(pop.mean + pop.stDev); - errorMinPx = dims.GetPixelY(pop.mean - pop.stDev); - } - - // make cap width a fraction of available space - double capWidthFrac = .38; - double capWidth = popWidth * capWidthFrac; - double capPx1 = dims.GetPixelX(centerX - capWidth / 2); - double capPx2 = dims.GetPixelX(centerX + capWidth / 2); - - // contract edges slightly to encourage padding between elements - double edgePaddingFrac = 0.2; - popLeft += popWidth * edgePaddingFrac; - popWidth -= (popWidth * edgePaddingFrac) * 2; - double leftPx = dims.GetPixelX(popLeft); - double rightPx = dims.GetPixelX(popLeft + popWidth); - - RectangleF rect = new RectangleF((float)leftPx, (float)yPxTop, (float)(rightPx - leftPx), (float)(yPxBase - yPxTop)); - - using (Graphics gfx = GDI.Graphics(bmp, dims, lowQuality)) - { - using (Pen pen = GDI.Pen(Color.Black)) - { - using (Brush brush = GDI.Brush(color)) - { - gfx.FillRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height); - gfx.DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height); - gfx.DrawLine(pen, (float)xPx, (float)errorMinPx, (float)xPx, (float)errorMaxPx); - gfx.DrawLine(pen, (float)capPx1, (float)errorMinPx, (float)capPx2, (float)errorMinPx); - gfx.DrawLine(pen, (float)capPx1, (float)errorMaxPx, (float)capPx2, (float)errorMaxPx); - } - } - } - } - - public enum BoxFormat { StdevStderrMean, OutlierQuartileMedian } - public enum HorizontalAlignment { Left, Center, Right } - - private static void Box(PlotDimensions dims, Bitmap bmp, bool lowQuality, Population pop, Random rand, - double popLeft, double popWidth, Color color, Position position, BoxFormat boxFormat, - HorizontalAlignment errorAlignment = HorizontalAlignment.Right) - { - // adjust edges to accomodate special positions - if (position == Position.Hide) - { - return; - } - - if (position == Position.Left || position == Position.Right) - { - popWidth /= 2; - } - - if (position == Position.Right) - { - popLeft += popWidth; - } - - double errorMaxPx, errorMinPx; - double yPxTop, yPxBase; - double yPx; - if (boxFormat == BoxFormat.StdevStderrMean) - { - errorMaxPx = dims.GetPixelY(pop.mean + pop.stDev); - errorMinPx = dims.GetPixelY(pop.mean - pop.stDev); - yPxTop = dims.GetPixelY(pop.mean + pop.stdErr); - yPxBase = dims.GetPixelY(pop.mean - pop.stdErr); - yPx = dims.GetPixelY(pop.mean); - } - else if (boxFormat == BoxFormat.OutlierQuartileMedian) - { - errorMaxPx = dims.GetPixelY(pop.maxNonOutlier); - errorMinPx = dims.GetPixelY(pop.minNonOutlier); - yPxTop = dims.GetPixelY(pop.Q3); - yPxBase = dims.GetPixelY(pop.Q1); - yPx = dims.GetPixelY(pop.median); - } - else - { - throw new NotImplementedException(); - } - - // make cap width a fraction of available space - double capWidthFrac = .38; - double capWidth = popWidth * capWidthFrac; - - // contract edges slightly to encourage padding between elements - double edgePaddingFrac = 0.2; - popLeft += popWidth * edgePaddingFrac; - popWidth -= (popWidth * edgePaddingFrac) * 2; - double leftPx = dims.GetPixelX(popLeft); - double rightPx = dims.GetPixelX(popLeft + popWidth); - RectangleF rect = new RectangleF( - x: (float)leftPx, - y: (float)yPxTop, - width: (float)(rightPx - leftPx), - height: (float)(yPxBase - yPxTop)); - - // determine location of errorbars and caps - double capPx1, capPx2, errorPxX; - switch (errorAlignment) - { - case HorizontalAlignment.Center: - double centerX = popLeft + popWidth / 2; - errorPxX = dims.GetPixelX(centerX); - capPx1 = dims.GetPixelX(centerX - capWidth / 2); - capPx2 = dims.GetPixelX(centerX + capWidth / 2); - break; - case HorizontalAlignment.Right: - errorPxX = dims.GetPixelX(popLeft + popWidth); - capPx1 = dims.GetPixelX(popLeft + popWidth - capWidth / 2); - capPx2 = dims.GetPixelX(popLeft + popWidth); - break; - case HorizontalAlignment.Left: - errorPxX = dims.GetPixelX(popLeft); - capPx1 = dims.GetPixelX(popLeft); - capPx2 = dims.GetPixelX(popLeft + capWidth / 2); - break; - default: - throw new NotImplementedException(); - } - - using (Graphics gfx = GDI.Graphics(bmp, dims, lowQuality)) - { - using (Pen pen = GDI.Pen(Color.Black)) - { - using (Brush brush = GDI.Brush(color)) - { - // draw the box - gfx.FillRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height); - gfx.DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height); - - // draw the line in the center - gfx.DrawLine(pen, rect.X, (float)yPx, rect.X + rect.Width, (float)yPx); - - // draw errorbars and caps - gfx.DrawLine(pen, (float)errorPxX, (float)errorMinPx, (float)errorPxX, rect.Y + rect.Height); - gfx.DrawLine(pen, (float)errorPxX, (float)errorMaxPx, (float)errorPxX, rect.Y); - gfx.DrawLine(pen, (float)capPx1, (float)errorMinPx, (float)capPx2, (float)errorMinPx); - gfx.DrawLine(pen, (float)capPx1, (float)errorMaxPx, (float)capPx2, (float)errorMaxPx); - } - } - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/RadarPlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/RadarPlot.cs deleted file mode 100644 index 50d1f33c0..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/RadarPlot.cs +++ /dev/null @@ -1,364 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -// ReSharper disable UnusedVariable -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// A radar chart is a graphical method of displaying multivariate data in the form of - /// a two-dimensional chart of three or more quantitative variables represented on axes - /// starting from the same point. - /// - /// Data is managed using 2D arrays where groups (colored shapes) are rows and categories (arms of the web) are columns. - /// - public class RadarPlot : IPlottable - { - /// - /// Values for every group (rows) and category (columns) normalized from 0 to 1. - /// - private double[,] _norm; - - /// - /// Single value to normalize all values against for all groups/categories. - /// - private double _normMax; - - /// - /// Individual values (one per category) to use for normalization. - /// Length must be equal to the number of columns (categories) in the original data. - /// - private double[]? _normMaxes; - - /// - /// Labels for each category. - /// Length must be equal to the number of columns (categories) in the original data. - /// - /// - /// If showing icons, labels will be ignored. - /// - public string[] CategoryLabels; - - /// - /// Icons for each category. - /// Length must be equal to the number of columns (categories) in the original data. - /// - /// - /// If showing icons, labels will be ignored. - /// - public System.Drawing.Image[] CategoryImages; - - /// - /// Labels for each group. - /// Length must be equal to the number of rows (groups) in the original data. - /// - public string[]? GroupLabels; - - /// - /// Colors (typically semi-transparent) to shade the inner area of each group. - /// Length must be equal to the number of rows (groups) in the original data. - /// - public Color[] FillColors; - - /// - /// Colors to outline the shape for each group. - /// Length must be equal to the number of rows (groups) in the original data. - /// - public Color[] LineColors; - - /// - /// Color of the axis lines and concentric circles representing ticks - /// - public Color WebColor = Color.Gray; - - /// - /// Controls if values along each category axis are scaled independently or uniformly across all axes. - /// - public bool IndependentAxes; - - /// - /// Font used for labeling values on the plot - /// - public Font Font = new(); - - /// - /// If true, each value will be written in text on the plot. - /// - public bool ShowAxisValues { get; set; } = true; - - /// - /// If true, each category name will be written in text at every corner of the radar - /// - public bool ShowCategoryLabels { get; set; } = true; - - /// - /// Controls rendering style of the concentric circles (ticks) of the web - /// - public RadarAxis AxisType { get; set; } = RadarAxis.Circle; - - /// - /// Determines the width of each spoke and the axis lines. - /// - public int LineWidth { get; set; } = 1; - - /// - /// Determines the width of the line at the edge of each area polygon. - /// - public float OutlineWidth { get; set; } = 1; - - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - - public RadarPlot(double[,] values, Color[] lineColors, Color[] fillColors, bool independentAxes, double[]? maxValues = null) - { - LineColors = lineColors; - FillColors = fillColors; - IndependentAxes = independentAxes; - Update(values, independentAxes, maxValues); - } - - public override string ToString() => - $@"PlottableRadar with {PointCount} points and {_norm.GetUpperBound(1) + 1} categories."; - - /// - /// Replace the data values with new ones. - /// - /// 2D array of groups (rows) of values for each category (columns) - /// Controls if values along each category axis are scaled independently or uniformly across all axes - /// If provided, these values will be used to normalize each category (columns) - public void Update(double[,] values, bool independentAxes = false, double[]? maxValues = null) - { - IndependentAxes = independentAxes; - _norm = new double[values.GetLength(0), values.GetLength(1)]; - Array.Copy(values, 0, _norm, 0, values.Length); - - if (IndependentAxes) - { - _normMaxes = NormalizeSeveralInPlace(_norm, maxValues); - } - else - { - _normMax = NormalizeInPlace(_norm, maxValues); - } - } - - public void ValidateData(bool deep = false) - { - if (GroupLabels != null && GroupLabels.Length != _norm.GetLength(0)) - { - throw new InvalidOperationException("group names must match size of values"); - } - - if (CategoryLabels != null && CategoryLabels.Length != _norm.GetLength(1)) - { - throw new InvalidOperationException("category names must match size of values"); - } - } - - /// - /// Normalize a 2D array by dividing all values by the maximum value. - /// - /// maximum value in the array before normalization - private double NormalizeInPlace(double[,] input, double[]? maxValues = null) - { - double max; - if (maxValues != null && maxValues.Length == 1) - { - max = maxValues[0]; - } - else - { - max = input[0, 0]; - for (int i = 0; i < input.GetLength(0); i++) - { - for (int j = 0; j < input.GetLength(1); j++) - { - max = Math.Max(max, input[i, j]); - } - } - } - - for (int i = 0; i < input.GetLength(0); i++) - { - for (int j = 0; j < input.GetLength(1); j++) - { - input[i, j] /= max; - } - } - - return max; - } - - /// - /// Normalize each row of a 2D array independently by dividing all values by the maximum value. - /// - /// maximum value in each row of the array before normalization - private double[] NormalizeSeveralInPlace(double[,] input, double[]? maxValues = null) - { - double[]? maxes; - if (maxValues != null && input.GetLength(1) == maxValues.Length) - { - maxes = maxValues; - } - else - { - maxes = new double[input.GetLength(1)]; - for (int i = 0; i < input.GetLength(1); i++) - { - double max = input[0, i]; - for (int j = 0; j < input.GetLength(0); j++) - { - max = Math.Max(input[j, i], max); - } - maxes[i] = max; - } - } - - for (int i = 0; i < input.GetLength(0); i++) - { - for (int j = 0; j < input.GetLength(1); j++) - { - if (maxes[j] == 0) - { - input[i, j] = 0; - } - else - { - input[i, j] /= maxes[j]; - } - } - } - - return maxes; - } - - public LegendItem[]? GetLegendItems() - { - if (GroupLabels is null) - { - return null; - } - - List legendItems = new List(); - for (int i = 0; i < GroupLabels.Length; i++) - { - var item = new LegendItem() - { - label = GroupLabels[i], - color = FillColors[i], - lineWidth = 10, - markerShape = MarkerShape.None - }; - legendItems.Add(item); - } - - return legendItems.ToArray(); - } - - public AxisLimits GetAxisLimits() => - (GroupLabels != null) ? new AxisLimits(-3.5, 3.5, -3.5, 3.5) : new AxisLimits(-2.5, 2.5, -2.5, 2.5); - - public int PointCount => _norm.Length; - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - int numGroups = _norm.GetUpperBound(0) + 1; - int numCategories = _norm.GetUpperBound(1) + 1; - double sweepAngle = 2 * Math.PI / numCategories; - double minScale = new[] { dims.PxPerUnitX, dims.PxPerUnitX }.Min(); - PointF origin = new PointF(dims.GetPixelX(0), dims.GetPixelY(0)); - - using (Graphics gfx = GDI.Graphics(bmp, dims, lowQuality)) - { - using (Pen pen = GDI.Pen(WebColor, OutlineWidth)) - { - using (Brush brush = GDI.Brush(Color.Black)) - { - using (StringFormat sf = new StringFormat() { LineAlignment = StringAlignment.Center }) - { - using (StringFormat sf2 = new StringFormat()) - { - using (System.Drawing.Font font = GDI.Font(Font)) - { - using (Brush fontBrush = GDI.Brush(Font.Color)) - { - RenderAxis(gfx, dims, bmp, lowQuality); - - for (int i = 0; i < numGroups; i++) - { - PointF[] points = new PointF[numCategories]; - for (int j = 0; j < numCategories; j++) - { - points[j] = new PointF( - (float)(_norm[i, j] * Math.Cos(sweepAngle * j - Math.PI / 2) * minScale + origin.X), - (float)(_norm[i, j] * Math.Sin(sweepAngle * j - Math.PI / 2) * minScale + origin.Y)); - } - - ((SolidBrush)brush).Color = FillColors[i]; - pen.Color = LineColors[i]; - gfx.FillPolygon(brush, points); - gfx.DrawPolygon(pen, points); - } - } - } - } - } - } - } - } - } - - private StarAxisTick GetTick(double location) => - IndependentAxes - ? new StarAxisTick(location, _normMaxes!.Select(x => x * location).ToArray()) - : new StarAxisTick(location, _normMax); - - private void RenderAxis(Graphics gfx, PlotDimensions dims, Bitmap bmp, bool lowQuality) - { - double[] tickLocations = new[] { 0.25, 0.5, 1 }; - StarAxisTick[] ticks = tickLocations.Select(x => GetTick(x)).ToArray(); - - StarAxis axis = new() - { - Ticks = ticks, - CategoryLabels = CategoryLabels, - CategoryImages = CategoryImages, - NumberOfSpokes = _norm.GetLength(1), - AxisType = AxisType, - WebColor = WebColor, - LineWidth = LineWidth, - ShowCategoryLabels = ShowCategoryLabels, - LabelEachSpoke = IndependentAxes, - ShowAxisValues = ShowAxisValues, - Graphics = gfx, - ImagePlacement = ImagePlacement.Outside - }; - - axis.Render(dims, bmp, lowQuality); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/RadialGauge.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/RadialGauge.cs deleted file mode 100644 index 5a32965db..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/RadialGauge.cs +++ /dev/null @@ -1,284 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// This class represents a single radial gauge. - /// It has level and styling options and can be rendered onto an existing bitmap using any radius. - /// - internal class RadialGauge - { - /// - /// Location of the base of the gauge (degrees) - /// - public double StartAngle; - - /// - /// Current level of this gauge (degrees) - /// - public double SweepAngle; - - /// - /// Maximum size of the gauge (degrees) - /// - public double MaximumSizeAngle; - - /// - /// Angle where the background starts (degrees) - /// - public double BackStartAngle; - - /// - /// If true angles end clockwise relative to their base - /// - public bool Clockwise; - - /// - /// BackStartAngle plus rotation considering MaximumSizeAngle or CircularBackground - /// - public double BackEndAngle - { - get - { - double maxBackAngle = CircularBackground ? 360 : MaximumSizeAngle; - if (!Clockwise) - { - maxBackAngle = -maxBackAngle; - } - - return maxBackAngle; - } - } - - /// - /// If true the background will always be drawn as a complete circle regardless of MaximumSizeAngle - /// - public bool CircularBackground = true; - - /// - /// Font used to render values at the tip of the gauge - /// - public Font Font; - - /// - /// Size of the font relative to the line thickness - /// - public double FontSizeFraction; - - /// - /// Text to display on top of the label - /// - public string Label; - - /// - /// Location of the label text along the length of the gauge. - /// Low values place the label near the base and high values place the label at its tip. - /// - public double LabelPositionFraction; - - /// - /// Size of the gauge (pixels) - /// - public double Width; - - /// - /// Color of the gauge foreground - /// - public Color Color; - - /// - /// Color of the gauge background - /// - public Color BackgroundColor; - - /// - /// Style of the base of the gauge - /// - public LineCap StartCap = LineCap.Round; - - /// - /// Style of the tip of the gauge - /// - public LineCap EndCap = LineCap.Round; - - /// - /// Defines the location of each gauge relative to the start angle and distance from the center - /// - public RadialGaugeMode Mode; - - /// - /// Indicates whether or not labels will be rendered as text - /// - public bool ShowLabels; - - /// - /// Render the gauge onto an existing Bitmap - /// - /// active graphics object - /// pixel location on the bitmap to center the gauge on - /// distance from the center (pixel units) to render the gauge - public void Render(Graphics gfx, PointF centerPixel, float radius) - { - RenderBackground(gfx, centerPixel, radius); - RenderGaugeForeground(gfx, centerPixel, radius); - RenderGaugeLabels(gfx, centerPixel, radius); - } - - private void RenderBackground(Graphics gfx, PointF center, float radius) - { - if (Mode == RadialGaugeMode.SingleGauge) - { - return; - } - - using Pen backgroundPen = GDI.Pen(BackgroundColor); - backgroundPen.Width = (float)Width; - backgroundPen.StartCap = LineCap.Round; - backgroundPen.EndCap = LineCap.Round; - - gfx.DrawArc(backgroundPen, - (center.X - radius), - (center.Y - radius), - (radius * 2), - (radius * 2), - (float)BackStartAngle, - (float)BackEndAngle); - } - - public void RenderGaugeForeground(Graphics gfx, PointF center, float radius) - { - using Pen pen = GDI.Pen(Color); - pen.Width = (float)Width; - pen.StartCap = StartCap; - pen.EndCap = EndCap; - - gfx.DrawArc( - pen, - (center.X - radius), - (center.Y - radius), - (radius * 2), - (radius * 2), - (float)StartAngle, - (float)SweepAngle); - } - - private const double DEG_PER_RAD = 180.0 / Math.PI; - - private void RenderGaugeLabels(Graphics gfx, PointF center, float radius) - { - if (!ShowLabels) - { - return; - } - - // TODO: use this so font size is in pixels not pt - //Font.Size = lineWidth * (float)FontSizeFraction; - //using System.Drawing.Font fontGauge = GDI.Font(Font); - - using Brush brush = GDI.Brush(Font.Color); - using System.Drawing.Font font = new(Font.Name, (float)Width * (float)FontSizeFraction, FontStyle.Bold); - - using StringFormat sf = GDI.StringFormat(HorizontalAlignment.Center, VerticalAlignment.Middle); - - RectangleF[] letterRectangles = MeasureCharacters(gfx, font, Label); - double totalLetterWidths = letterRectangles.Select(rect => rect.Width).Sum(); - double textWidthFrac = totalLetterWidths / radius; - - double angle = ReduceAngle(StartAngle + SweepAngle * LabelPositionFraction); - double angle2 = (1 - 2 * LabelPositionFraction) * DEG_PER_RAD * textWidthFrac / 2; - bool isPositive = (SweepAngle > 0); - angle += isPositive ? angle2 : -angle2; - - bool isBelow = angle < 180 && angle > 0; - int sign = isBelow ? 1 : -1; - double theta = angle * Math.PI / 180; - theta += textWidthFrac / 2 * sign; - - for (int i = 0; i < Label.Length; i++) - { - theta -= letterRectangles[i].Width / 2 / radius * sign; - double rotation = (theta - Math.PI / 2 * sign) * DEG_PER_RAD; - float x = center.X + radius * (float)Math.Cos(theta); - float y = center.Y + radius * (float)Math.Sin(theta); - - gfx.RotateTransform((float)rotation); - gfx.TranslateTransform(x, y, MatrixOrder.Append); - gfx.DrawString(Label[i].ToString(), font, brush, 0, 0, sf); - gfx.ResetTransform(); - - theta -= letterRectangles[i].Width / 2 / radius * sign; - } - } - - /// - /// Return an array indicating the size of each character in a string. - /// Specifiy the maximum expected size to avoid issues associated with text wrapping. - /// - private static RectangleF[] MeasureCharacters(Graphics gfx, System.Drawing.Font font, string text, int maxWidth = 800, int maxHeight = 100) - { - using StringFormat stringFormat = new() - { - Alignment = StringAlignment.Center, - LineAlignment = StringAlignment.Center, - Trimming = StringTrimming.None, - FormatFlags = StringFormatFlags.MeasureTrailingSpaces, - }; - - CharacterRange[] charRanges = Enumerable.Range(0, text.Length) - .Select(x => new CharacterRange(x, 1)) - .ToArray(); - - stringFormat.SetMeasurableCharacterRanges(charRanges); - - RectangleF imageRectangle = new(0, 0, maxWidth, maxHeight); - Region[] characterRegions = gfx.MeasureCharacterRanges(text, font, imageRectangle, stringFormat); - RectangleF[] characterRectangles = characterRegions.Select(x => x.GetBounds(gfx)).ToArray(); - - return characterRectangles; - } - - /// - /// Reduces an angle into the range [0°-360°]. - /// Angles greater than 360 will roll-over (370º becomes 10º). - /// Angles less than 0 will roll-under (-10º becomes 350º). - /// - /// Angle value - /// Angle whithin [0°-360°] - public static double ReduceAngle(double angle) - { - angle %= 360; - - if (angle < 0) - { - angle += 360; - } - - return angle; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/RadialGaugePlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/RadialGaugePlot.cs deleted file mode 100644 index 970077127..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/RadialGaugePlot.cs +++ /dev/null @@ -1,354 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -// This plot type was inspired by MicroCharts: -// https://github.com/dotnet-ad/Microcharts/blob/main/Sources/Microcharts/Charts/RadialGaugeChart.cs - -// ReSharper disable PossibleLossOfFraction -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// A radial gauge chart is a graphical method of displaying scalar data in the form of - /// a chart made of circular gauges so that each scalar is represented by each gauge. - /// - public class RadialGaugePlot : IPlottable - { - /// - /// This array holds the original levels passed-in by the user. - /// These levels are used to calculate radial gauge positions on every render. - /// - public double[] Levels { get; private set; } - - /// - /// Number of gauges. - /// - public int GaugeCount => Levels.Length; - - /// - /// Maximum size (degrees) for the gauge. - /// 180 is a semicircle and 360 is a full circle. - /// - public double MaximumAngle = 360; - - /// - /// Controls whether the backgrounds of the gauges are full circles or stop at the maximum angle. - /// - public bool CircularBackground = true; - - /// - /// Labels that appear in the legend for each gauge. - /// Number of labels must equal number of gauges. - /// May be null if gauges are not to appear in the legend. - /// - public string[] Labels; - - /// - /// Colors for each gauge. - /// Number of colors must equal number of gauges. - /// - public Color[] Colors; - - /// - /// Describes how transparent the unfilled background of each gauge is (0 to 1). - /// The larger the number the darker the background becomes. - /// - public double BackgroundTransparencyFraction = .15; - - /// - /// Indicates whether gauges fill clockwise as levels increase. - /// If false, gauges will fill counter-clockwise (anti-clockwise). - /// - public bool Clockwise = true; - - /// - /// Determines whether the gauges are drawn stacked (dafault value), sequentially, or as a single gauge (ressembling a pie plot). - /// - public RadialGaugeMode GaugeMode = RadialGaugeMode.Stacked; - - /// - /// Controls whether gauges will be dwan inside-out (true) or outside-in (false) - /// - public bool OrderInsideOut = true; - - /// - /// Defines where the gauge label is written on the gage as a fraction of its length. - /// Low values place the label near the base and high values place the label at its tip. - /// - public double LabelPositionFraction = 1; - - /// - /// Angle (degrees) at which the gauges start. - /// 270° for North (default value), 0° for East, 90° for South, 180° for West, etc. - /// Expected values in the range [0°-360°], otherwise unexpected side-effects might happen. - /// - public float StartingAngle = 270; - - /// - /// The empty space between gauges as a fraction of the gauge width. - /// - public double SpaceFraction = .5f; - - /// - /// Size of the gague label text as a fraction of the gauge width. - /// - public double FontSizeFraction = .75; - - /// - /// Describes labels drawn on each gauge. - /// - public readonly Font Font = new() { Bold = true, Color = Color.White }; - - /// - /// Controls if value labels are shown inside the gauges. - /// - public bool ShowLevels { get; set; } = true; - - /// - /// String formatter to use for converting gauge levels to text - /// - public string LevelTextFormat = "0.##"; - - /// - /// Style of the tip of the gauge - /// - public LineCap EndCap { get; set; } = LineCap.Triangle; - - /// - /// Style of the base of the gauge - /// - public LineCap StartCap { get; set; } = LineCap.Round; - - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - - public RadialGaugePlot(double[] levels, Color[]? colors) - { - Update(levels, colors); - } - - public override string ToString() => $"RadialGaugePlot with {GaugeCount} gauges."; - - /// - /// Replace gauge levels with new ones. - /// - public void Update(double[] levels, Color[]? colors = null) - { - if (levels is null || levels.Length == 0) - { - throw new ArgumentException("values must not be null or empty"); - } - - bool numberOfGroupsChanged = (Levels is null) || (levels.Length != Levels.Length); - if (numberOfGroupsChanged) - { - if (colors is null || colors.Length != levels.Length) - { - throw new ArgumentException("when changing the number of values a new colors array must be provided"); - } - - Colors = new Color[colors.Length]; - Array.Copy(colors, 0, Colors, 0, colors.Length); - } - - Levels = levels; - } - - /// - /// Calculate the rotational angles for each gauge from the original data values - /// - private static (double[] startAngles, double[] sweepAngles, double backStartAngle) GetGaugeAngles( - double[] values, - double angleStart, - double angleRange, - bool clockwise, - RadialGaugeMode mode) - { - double scaleMin = Math.Min(0, values.Min()); - double scaleMax = values.Max(x => Math.Abs(x)); - - if (mode == RadialGaugeMode.Sequential || mode == RadialGaugeMode.SingleGauge) - { - scaleMax = values.Sum(x => Math.Abs(x)); - scaleMin = 0; - } - - double scaleRange = scaleMax - scaleMin; - - int gaugeCount = values.Length; - double[] startAngles = new double[gaugeCount]; - double[] sweepAngles = new double[gaugeCount]; - - angleStart = RadialGauge.ReduceAngle(angleStart); - double angleSum = angleStart; - for (int i = 0; i < gaugeCount; i++) - { - double angleSwept = 0; - if (scaleRange > 0) - { - angleSwept = angleRange * values[i] / scaleRange; - } - - if (!clockwise) - { - angleSwept *= -1; - } - - double initialAngle = (mode == RadialGaugeMode.Stacked) ? angleStart : angleSum; - angleSum += angleSwept; - - startAngles[i] = initialAngle; - sweepAngles[i] = angleSwept; - } - - double backOffset = angleRange * scaleMin / scaleRange; - if (!clockwise) - { - backOffset *= -1; - } - - double backStartAngle = angleStart + backOffset; - - return (startAngles, sweepAngles, backStartAngle); - } - - public void ValidateData(bool deep = false) - { - if (Colors.Length != GaugeCount) - { - throw new InvalidOperationException($"{nameof(Colors)} must be an array with length equal to number of values"); - } - - if (Labels != null && Labels.Length != GaugeCount) - { - throw new InvalidOperationException($"If {nameof(Labels)} is not null, it must be the same length as the number of values"); - } - - if (MaximumAngle < 0 || MaximumAngle > 360) - { - throw new InvalidOperationException($"{nameof(MaximumAngle)} must be [0-360]"); - } - - if (LabelPositionFraction < 0 || LabelPositionFraction > 1) - { - throw new InvalidOperationException($"{nameof(LabelPositionFraction)} must be a value from 0 to 1"); - } - - if (SpaceFraction < 0 || SpaceFraction > 1) - { - throw new InvalidOperationException($"{nameof(SpaceFraction)} must be from 0 to 1"); - } - } - - public LegendItem[] GetLegendItems() - { - List legendItems = new(); - for (int i = 0; i < Labels.Length; i++) - { - var item = new LegendItem() - { - label = Labels[i], - color = Colors[i], - lineWidth = 10, - markerShape = MarkerShape.None - }; - legendItems.Add(item); - } - - return legendItems.ToArray(); - } - - public AxisLimits GetAxisLimits() - { - double radius = GaugeCount / 4; - return new AxisLimits(-radius, radius, -radius, radius); - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - ValidateData(); - - (double[] startAngles, double[] sweepAngles, double startingAngleBackGauges) = GetGaugeAngles( - values: Levels, - angleStart: StartingAngle, - angleRange: MaximumAngle, - clockwise: Clockwise, - mode: GaugeMode); - - PointF centerPixel = new(dims.GetPixelX(0), dims.GetPixelY(0)); - using Graphics gfx = GDI.Graphics(bmp, dims, lowQuality); - - float pxPerUnit = (float)Math.Min(dims.PxPerUnitX, dims.PxPerUnitY); - float gaugeWidthPx = pxPerUnit / (GaugeCount * ((float)SpaceFraction + 1)); - float radiusPixels = gaugeWidthPx * ((float)SpaceFraction + 1); - - int backgroundAlpha = (int)(255 * BackgroundTransparencyFraction); - backgroundAlpha = Math.Max(0, backgroundAlpha); - backgroundAlpha = Math.Min(255, backgroundAlpha); - - int index; - int position; - for (int i = 0; i < GaugeCount; i++) - { - if (GaugeMode == RadialGaugeMode.SingleGauge) - { - index = GaugeCount - i - 1; - position = GaugeCount; - } - else - { - index = i; - position = OrderInsideOut ? i + 1 : (GaugeCount - i); - } - - RadialGauge gauge = new() - { - MaximumSizeAngle = MaximumAngle, - StartAngle = startAngles[index], - SweepAngle = sweepAngles[index], - Color = Colors[index], - BackgroundColor = Color.FromArgb(backgroundAlpha, Colors[index]), - Width = gaugeWidthPx, - CircularBackground = CircularBackground, - Clockwise = Clockwise, - BackStartAngle = startingAngleBackGauges, - StartCap = StartCap, - EndCap = EndCap, - Mode = GaugeMode, - Font = Font, - FontSizeFraction = FontSizeFraction, - Label = Levels[index].ToString(LevelTextFormat), - LabelPositionFraction = LabelPositionFraction, - ShowLabels = ShowLevels, - }; - - float radiusPx = position * radiusPixels; - gauge.Render(gfx, centerPixel, radiusPx); - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/ScaleBar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/ScaleBar.cs deleted file mode 100644 index 32bebe1e9..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/ScaleBar.cs +++ /dev/null @@ -1,125 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -// ReSharper disable UnusedVariable -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// An L-shaped scalebar rendered in the corner of the data area - /// - public class ScaleBar : IPlottable - { - /// - /// Width of the scalebar in cooridinate units - /// - public double Width; - - /// - /// Height of the scalebar in cooridinate units - /// - public double Height; - - /// - /// Distance in pixels from the edge of the data area - /// - public float Padding = 10; - - public string HorizontalLabel; - public string VerticalLabel; - public float LineWidth = 2; - public Color LineColor = Color.Black; - public readonly Font Font = new Font(); - public float FontSize { set => Font.Size = value; } - public Color FontColor { set => Font.Color = value; } - public bool FontBold { set => Font.Bold = value; } - public Color Color { set => (LineColor, FontColor) = (value, value); } - - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - - public override string ToString() => $@"PlottableScaleBar ({HorizontalLabel}={Width}, {VerticalLabel}={Height})"; - public AxisLimits GetAxisLimits() => new AxisLimits(double.NaN, double.NaN, double.NaN, double.NaN); - public LegendItem[]? GetLegendItems() => null; - - public void ValidateData(bool deep = false) - { - if (double.IsNaN(Width) || double.IsNaN(Height)) - { - throw new InvalidOperationException("Width and Height cannot be NaN"); - } - - if (double.IsInfinity(Width) || double.IsInfinity(Height)) - { - throw new InvalidOperationException("Width and Height cannot be Infinity"); - } - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - using (var gfx = GDI.Graphics(bmp, dims, lowQuality)) - { - using (var font = GDI.Font(Font)) - { - using (var fontBrush = new SolidBrush(Font.Color)) - { - using (var linePen = new Pen(LineColor, LineWidth)) - { - using (var sfNorth = new StringFormat() { LineAlignment = StringAlignment.Near, Alignment = StringAlignment.Center }) - { - using (var sfWest = new StringFormat() { LineAlignment = StringAlignment.Center, Alignment = StringAlignment.Near }) - { - // determine where the corner of the scalebar will be - float widthPx = (float)(Width * dims.PxPerUnitX); - float heightPx = (float)(Height * dims.PxPerUnitY); - PointF cornerPoint = new PointF(dims.GetPixelX(dims.XMax) - Padding, dims.GetPixelY(dims.YMin) - Padding); - - // move the corner point away from the edge to accommodate label size - var xLabelSize = GDI.MeasureString(gfx, HorizontalLabel, font); - var yLabelSize = GDI.MeasureString(gfx, VerticalLabel, font); - cornerPoint.X -= yLabelSize.Width * 1.2f; - cornerPoint.Y -= yLabelSize.Height; - - // determine all other points relative to the corner point - PointF horizPoint = new PointF(cornerPoint.X - widthPx, cornerPoint.Y); - PointF vertPoint = new PointF(cornerPoint.X, cornerPoint.Y - heightPx); - PointF horizMidPoint = new PointF((cornerPoint.X + horizPoint.X) / 2, cornerPoint.Y); - PointF vertMidPoint = new PointF(cornerPoint.X, (cornerPoint.Y + vertPoint.Y) / 2); - - // draw the scalebar - gfx.DrawLines(linePen, new[] { horizPoint, cornerPoint, vertPoint }); - gfx.DrawString(HorizontalLabel, font, fontBrush, horizMidPoint.X, cornerPoint.Y, sfNorth); - gfx.DrawString(VerticalLabel, font, fontBrush, cornerPoint.X, vertMidPoint.Y, sfWest); - } - } - } - } - } - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/ScatterPlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/ScatterPlot.cs deleted file mode 100644 index 440ff63ba..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/ScatterPlot.cs +++ /dev/null @@ -1,455 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// The scatter plot renders X/Y pairs as points and/or connected lines. - /// Scatter plots can be extremely slow for large datasets, so use Signal plots in these situations. - /// - public class ScatterPlot : IPlottable, IHasPoints - { - // data - public double[] Xs { get; private set; } - public double[] Ys { get; private set; } - public double[] XError { get; set; } - public double[] YError { get; set; } - - /// - /// Add this value to each X value before plotting (axis units) - /// - public double OffsetX { get; set; } = 0; - - /// - /// Add this value to each Y value before plotting (axis units) - /// - public double OffsetY { get; set; } = 0; - - public int PointCount => Ys.Length; - - // customization - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - public string Label; - public Color Color = Color.Black; - public LineStyle LineStyle = LineStyle.Solid; - public MarkerShape MarkerShape = MarkerShape.FilledCircle; - public double LineWidth = 1; - public float ErrorLineWidth = 1; - public float ErrorCapSize = 3; - public float MarkerSize = 5; - public bool StepDisplay = false; - - [Obsolete("Scatter plot arrowheads have been deprecated. Use the Arrow plot type instead.", true)] - public bool IsArrow => ArrowheadWidth > 0 && ArrowheadLength > 0; - - [Obsolete("Scatter plot arrowheads have been deprecated. Use the Arrow plot type instead.", true)] - public float ArrowheadWidth = 0; - - [Obsolete("Scatter plot arrowheads have been deprecated. Use the Arrow plot type instead.", true)] - public float ArrowheadLength = 0; - - // TODO: think about better/additional API ? - public int? MinRenderIndex { get; set; } - public int? MaxRenderIndex { get; set; } - - public ScatterPlot(double[] xs, double[] ys, double[] errorX = null, double[] errorY = null) - { - Xs = xs; - Ys = ys; - XError = errorX; - YError = errorY; - } - - /// - /// Replace the Xs array with a new one - /// - public void UpdateX(double[] xs) - { - if (xs is null) - { - throw new ArgumentException("xs must not be null"); - } - - if (xs.Length != Ys.Length) - { - throw new ArgumentException("xs and ys must have the same length"); - } - - Xs = xs; - } - - /// - /// Replace the Ys array with a new one - /// - public void UpdateY(double[] ys) - { - if (ys is null) - { - throw new ArgumentException("ys must not be null"); - } - - if (Xs.Length != ys.Length) - { - throw new ArgumentException("xs and ys must have the same length"); - } - - Ys = ys; - } - - /// - /// Replace Xs and Ys arrays with new ones - /// - public void Update(double[] xs, double[] ys) - { - if (xs is null) - { - throw new ArgumentException("xs must not be null"); - } - - if (ys is null) - { - throw new ArgumentException("ys must not be null"); - } - - if (xs.Length != ys.Length) - { - throw new ArgumentException("xs and ys must have the same length"); - } - - Xs = xs; - Ys = ys; - } - - public void ValidateData(bool deep = false) - { - Validate.AssertHasElements("xs", Xs); - Validate.AssertHasElements("ys", Ys); - Validate.AssertEqualLength("xs and ys", Xs, Ys); - - if (MaxRenderIndex != null) - { - if ((MaxRenderIndex > Ys.Length - 1) || MaxRenderIndex < 0) - { - throw new IndexOutOfRangeException("maxRenderIndex must be a valid index for ys[]"); - } - } - - if (MinRenderIndex != null) - { - if (MinRenderIndex < 0) - { - throw new IndexOutOfRangeException("minRenderIndex must be between 0 and maxRenderIndex"); - } - - if (MaxRenderIndex != null && MinRenderIndex > MaxRenderIndex) - { - throw new IndexOutOfRangeException("minRenderIndex must be between 0 and maxRenderIndex"); - } - } - - - if (XError != null) - { - Validate.AssertHasElements("errorX", Xs); - Validate.AssertEqualLength("xs and errorX", Xs, XError); - } - - if (YError != null) - { - Validate.AssertHasElements("errorY", Ys); - Validate.AssertEqualLength("ys and errorY", Ys, YError); - } - - if (deep) - { - Validate.AssertAllReal("xs", Xs); - Validate.AssertAllReal("ys", Ys); - - if (XError != null) - { - Validate.AssertAllReal("errorX", XError); - } - - if (YError != null) - { - Validate.AssertAllReal("errorY", YError); - } - } - } - - public override string ToString() - { - string label = string.IsNullOrWhiteSpace(Label) ? "" : $" ({Label})"; - return $"PlottableScatter{label} with {PointCount} points"; - } - - public AxisLimits GetAxisLimits() - { - ValidateData(deep: false); - int from = MinRenderIndex ?? 0; - int to = MaxRenderIndex ?? (Xs.Length - 1); - - // TODO: don't use an array for this - double[] limits = new double[4]; - - if (XError == null) - { - var XsRange = Xs.Skip(from).Take(to - from + 1); - limits[0] = XsRange.Min(); - limits[1] = XsRange.Max(); - } - else - { - var XsAndError = Xs.Zip(XError, (x, e) => (x, e)).Skip(from).Take(to - from + 1); - limits[0] = XsAndError.Min(p => p.x - p.e); - limits[1] = XsAndError.Max(p => p.x + p.e); - } - - if (YError == null) - { - var YsRange = Ys.Skip(from).Take(to - from + 1); - limits[2] = YsRange.Min(); - limits[3] = YsRange.Max(); - } - else - { - var YsAndError = Ys.Zip(YError, (y, e) => (y, e)).Skip(from).Take(to - from + 1); - limits[2] = YsAndError.Min(p => p.y - p.e); - limits[3] = YsAndError.Max(p => p.y + p.e); - } - - if (double.IsNaN(limits[0]) || double.IsNaN(limits[1])) - { - throw new InvalidOperationException("X data must not contain NaN"); - } - - if (double.IsNaN(limits[2]) || double.IsNaN(limits[3])) - { - throw new InvalidOperationException("Y data must not contain NaN"); - } - - if (double.IsInfinity(limits[0]) || double.IsInfinity(limits[1])) - { - throw new InvalidOperationException("X data must not contain Infinity"); - } - - if (double.IsInfinity(limits[2]) || double.IsInfinity(limits[3])) - { - throw new InvalidOperationException("Y data must not contain Infinity"); - } - - return new AxisLimits( - xMin: limits[0] + OffsetX, - xMax: limits[1] + OffsetX, - yMin: limits[2] + OffsetY, - yMax: limits[3] + OffsetY); - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - if (IsVisible == false) - { - return; - } - - using (var gfx = GDI.Graphics(bmp, dims, lowQuality)) - { - using (var penLine = GDI.Pen(Color, LineWidth, LineStyle, true)) - { - using (var penLineError = GDI.Pen(Color, ErrorLineWidth, LineStyle.Solid, true)) - { - int from = MinRenderIndex ?? 0; - int to = MaxRenderIndex ?? (Xs.Length - 1); - PointF[] points = new PointF[to - from + 1]; - for (int i = from; i <= to; i++) - { - float x = dims.GetPixelX(Xs[i] + OffsetX); - float y = dims.GetPixelY(Ys[i] + OffsetY); - if (float.IsNaN(x) || float.IsNaN(y)) - { - throw new NotImplementedException("Data must not contain NaN"); - } - - points[i - from] = new PointF(x, y); - } - - if (YError != null) - { - for (int i = 0; i < points.Count(); i++) - { - double yWithOffset = Ys[i] + OffsetY; - float yBot = dims.GetPixelY(yWithOffset - YError[i + from]); - float yTop = dims.GetPixelY(yWithOffset + YError[i + from]); - gfx.DrawLine(penLineError, points[i].X, yBot, points[i].X, yTop); - gfx.DrawLine(penLineError, points[i].X - ErrorCapSize, yBot, points[i].X + ErrorCapSize, yBot); - gfx.DrawLine(penLineError, points[i].X - ErrorCapSize, yTop, points[i].X + ErrorCapSize, yTop); - } - } - - if (XError != null) - { - for (int i = 0; i < points.Length; i++) - { - double xWithOffset = Xs[i] + OffsetX; - float xLeft = dims.GetPixelX(xWithOffset - XError[i + from]); - float xRight = dims.GetPixelX(xWithOffset + XError[i + from]); - gfx.DrawLine(penLineError, xLeft, points[i].Y, xRight, points[i].Y); - gfx.DrawLine(penLineError, xLeft, points[i].Y - ErrorCapSize, xLeft, points[i].Y + ErrorCapSize); - gfx.DrawLine(penLineError, xRight, points[i].Y - ErrorCapSize, xRight, points[i].Y + ErrorCapSize); - } - } - - // draw the lines connecting points - if (LineWidth > 0 && points.Length > 1 && LineStyle != LineStyle.None) - { - if (StepDisplay) - { - PointF[] pointsStep = new PointF[points.Length * 2 - 1]; - for (int i = 0; i < points.Length - 1; i++) - { - pointsStep[i * 2] = points[i]; - pointsStep[i * 2 + 1] = new PointF(points[i + 1].X, points[i].Y); - } - pointsStep[pointsStep.Length - 1] = points[points.Length - 1]; - gfx.DrawLines(penLine, pointsStep); - } - else - { - gfx.DrawLines(penLine, points); - } - } - - // draw a marker at each point - if ((MarkerSize > 0) && (MarkerShape != MarkerShape.None)) - { - for (int i = 0; i < points.Length; i++) - { - MarkerTools.DrawMarker(gfx, points[i], MarkerShape, MarkerSize, Color); - } - } - } - } - } - } - - public LegendItem[]? GetLegendItems() - { - var singleLegendItem = new LegendItem() - { - label = Label, - color = Color, - lineStyle = LineStyle, - lineWidth = LineWidth, - markerShape = MarkerShape, - markerSize = MarkerSize - }; - return new LegendItem[] { singleLegendItem }; - } - - /// - /// Return the X/Y coordinates of the point nearest the X position - /// - /// X position in plot space - /// - public (double x, double y, int index) GetPointNearestX(double x) - { - int from = MinRenderIndex ?? 0; - int to = MaxRenderIndex ?? (Xs.Length - 1); - double minDistance = Math.Abs(Xs[from] - x); - int minIndex = 0; - for (int i = from; i <= to; i++) - { - double currDistance = Math.Abs(Xs[i] - x); - if (currDistance < minDistance) - { - minIndex = i; - minDistance = currDistance; - } - } - - return (Xs[minIndex], Ys[minIndex], minIndex); - } - - /// - /// Return the X/Y coordinates of the point nearest the Y position - /// - /// Y position in plot space - /// - public (double x, double y, int index) GetPointNearestY(double y) - { - int from = MinRenderIndex ?? 0; - int to = MaxRenderIndex ?? (Ys.Length - 1); - double minDistance = Math.Abs(Ys[from] - y); - int minIndex = 0; - for (int i = from; i <= to; i++) - { - double currDistance = Math.Abs(Ys[i] - y); - if (currDistance < minDistance) - { - minIndex = i; - minDistance = currDistance; - } - } - - return (Xs[minIndex], Ys[minIndex], minIndex); - } - - /// - /// Return the position and index of the data point nearest the given coordinate - /// - /// location in coordinate space - /// location in coordinate space - /// Ratio of pixels per unit (X/Y) when rendered - public (double x, double y, int index) GetPointNearest(double x, double y, double xyRatio = 1) - { - int from = MinRenderIndex ?? 0; - int to = MaxRenderIndex ?? (Ys.Length - 1); - - List<(double x, double y)> points = Xs.Zip(Ys, (first, second) => (first, second)).Skip(from).Take(to - from + 1).ToList(); - - double xyRatioSquared = xyRatio * xyRatio; - double pointDistanceSquared(double x1, double y1) => - (x1 - x) * (x1 - x) * xyRatioSquared + (y1 - y) * (y1 - y); - - double minDistance = pointDistanceSquared(points[0].x, points[0].y); - int minIndex = 0; - for (int i = 1; i < points.Count; i++) - { - double currDistance = pointDistanceSquared(points[i].x, points[i].y); - if (currDistance < minDistance) - { - minIndex = i; - minDistance = currDistance; - } - } - - return (Xs[minIndex], Ys[minIndex], minIndex); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/ScatterPlotHighlight.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/ScatterPlotHighlight.cs deleted file mode 100644 index bc23de8ed..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/ScatterPlotHighlight.cs +++ /dev/null @@ -1,48 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - [Obsolete("This plot type is deprecated: Use a regular scatter plot and call GetPointNearest(). See examples in documentation.", true)] - public class ScatterPlotHighlight : ScatterPlot, IPlottable, IHasPoints, IHasHighlightablePoints - { - public MarkerShape highlightedShape = MarkerShape.OpenCircle; - public float highlightedMarkerSize = 10; - public Color highlightedColor = Color.Red; - protected bool[] isHighlighted; - - public ScatterPlotHighlight(double[] xs, double[] ys, double[] xErr = null, double[] yErr = null) : - base(xs, ys, xErr, yErr) => HighlightClear(); - - public new void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) => throw new NotImplementedException(); - public void HighlightClear() => throw new NotImplementedException(); - public (double x, double y, int index) HighlightPoint(int index) => throw new NotImplementedException(); - public (double x, double y, int index) HighlightPointNearestX(double x) => throw new NotImplementedException(); - public (double x, double y, int index) HighlightPointNearestY(double y) => throw new NotImplementedException(); - public (double x, double y, int index) HighlightPointNearest(double x, double y) => throw new NotImplementedException(); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/ScatterPlotList.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/ScatterPlotList.cs deleted file mode 100644 index ffa6734f6..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/ScatterPlotList.cs +++ /dev/null @@ -1,181 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// A collection of X/Y coordinates that can be displayed as markers and/or connected lines. - /// Unlike the regular ScatterPlot, this plot type has Add() methods to easily add data. - /// - public class ScatterPlotList : IPlottable - { - private readonly List _xs = new(); - private readonly List _ys = new(); - public int Count => _xs.Count; - - public string Label; - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - public Color Color = Color.Black; - public float LineWidth = 1; - public LineStyle LineStyle = LineStyle.Solid; - public float MarkerSize = 3; - public MarkerShape MarkerShape = MarkerShape.FilledCircle; - - public void ValidateData(bool deep = false) - { - if (_xs.Count != _ys.Count) - { - throw new InvalidOperationException("Xs and Ys must be same length"); - } - - if (deep) - { - for (int i = 0; i < _xs.Count; i++) - { - if (double.IsNaN(_xs[i]) || double.IsNaN(_ys[i])) - { - throw new InvalidOperationException("Xs and Ys cannot contain NaN"); - } - - if (double.IsInfinity(_xs[i]) || double.IsInfinity(_ys[i])) - { - throw new InvalidOperationException("Xs and Ys cannot contain Infinity"); - } - } - } - } - - /// - /// Clear the list of points - /// - public void Clear() - { - _xs.Clear(); - _ys.Clear(); - } - - /// - /// Add a single point to the list - /// - public void Add(double x, double y) - { - _xs.Add(x); - _ys.Add(y); - } - - /// - /// Add multiple points to the list - /// - public void AddRange(double[] xs, double[] ys) - { - if (xs is null) - { - throw new ArgumentException("xs must not be null"); - } - - if (ys is null) - { - throw new ArgumentException("ys must not be null"); - } - - if (xs.Length != ys.Length) - { - throw new ArgumentException("xs and ys must have the same length"); - } - - _xs.AddRange(xs); - _ys.AddRange(ys); - } - - public AxisLimits GetAxisLimits() - { - if (Count == 0) - { - return new AxisLimits(double.NaN, double.NaN, double.NaN, double.NaN); - } - - double xMin = _xs[0]; - double xMax = _xs[0]; - double yMin = _ys[0]; - double yMax = _ys[0]; - - for (int i = 1; i < Count; i++) - { - xMin = Math.Min(xMin, _xs[i]); - xMax = Math.Max(xMax, _xs[i]); - yMin = Math.Min(yMin, _ys[i]); - yMax = Math.Max(yMax, _ys[i]); - } - - return new AxisLimits(xMin, xMax, yMin, yMax); - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - PointF[] points = new PointF[Count]; - for (int i = 0; i < Count; i++) - { - points[i] = new PointF(dims.GetPixelX(_xs[i]), dims.GetPixelY(_ys[i])); - } - - using (var gfx = GDI.Graphics(bmp, dims, lowQuality)) - { - using (var linePen = GDI.Pen(Color, LineWidth, LineStyle, true)) - { - if (LineStyle != LineStyle.None && LineWidth > 0 && Count > 1) - { - gfx.DrawLines(linePen, points); - } - - if (MarkerShape != MarkerShape.None && MarkerSize > 0 && Count > 0) - { - foreach (PointF point in points) - { - MarkerTools.DrawMarker(gfx, point, MarkerShape, MarkerSize, Color); - } - } - } - } - } - - public LegendItem[] GetLegendItems() - { - var singleLegendItem = new LegendItem() - { - label = Label, - color = Color, - lineStyle = LineStyle, - lineWidth = LineWidth, - markerShape = MarkerShape, - markerSize = MarkerSize - }; - return new[] { singleLegendItem }; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/SignalPlot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/SignalPlot.cs deleted file mode 100644 index d410b3529..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/SignalPlot.cs +++ /dev/null @@ -1,48 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// A signal plot displays evenly-spaced data. - /// Instead of X/Y pairs, signal plots take Y values and a sample rate. - /// Optional X and Y offsets can further customize the data. - /// - public class SignalPlot : SignalPlotBase - { - public SignalPlot() : base() - { - Strategy = new LinearDoubleOnlyMinMaxStrategy(); - } - - public override string ToString() - { - string label = string.IsNullOrWhiteSpace(Label) ? "" : $" ({Label})"; - return $"PlottableSignal{label} with {PointCount} points"; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/SignalPlotBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/SignalPlotBase.cs deleted file mode 100644 index 1190cba23..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/SignalPlotBase.cs +++ /dev/null @@ -1,1005 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -using System.Linq.Expressions; - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public abstract class SignalPlotBase : IPlottable, IHasPointsGenericX where T : struct, IComparable - { - protected IMinMaxSearchStrategy Strategy = new SegmentedTreeMinMaxSearchStrategy(); - protected bool MaxRenderIndexLowerYsPromise = false; - protected bool MaxRenderIndexHigherMinRenderIndexPromise = false; - protected bool FillColor1MustBeSetPromise = false; - protected bool FillColor2MustBeSetPromise = false; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - public bool IsVisible { get; set; } = true; - public bool StepDisplay { get; set; } = false; - public float MarkerSize { get; set; } = 5; - public double OffsetX { get; set; } = 0; - public T OffsetY { get; set; } = default; - public double LineWidth { get; set; } = 1; - public string? Label { get; set; } = null; - public Color Color { get; set; } = Color.Green; - public LineStyle LineStyle { get; set; } = LineStyle.Solid; - - /// - /// If enabled, parallel processing will be used to calculate pixel positions for high density datasets. - /// - public bool UseParallel { get; set; } = true; - - - /// - /// If fill above and/or below is enabled, this defines the baseline level. - /// - public double BaselineY { get; set; } = 0; - - /// - /// If fill is enabled, a baseline will be drawn using this color. - /// - public Color BaselineColor { get; set; } = Color.Black; - - /// - /// If fill is enabled, a baseline will be drawn using this width. - /// - public float BaselineWidth { get; set; } = 1; - - /// - /// If fill is enabled, this color will be used to fill the area below the curve above BaselineY. - /// - [Obsolete("Use the Fill() methods of this object to configure this setting")] - public Color? GradientFillColor1 { get => _GradientFillColor1; set => _GradientFillColor1 = value; } - public Color? _GradientFillColor1 = null; - - /// - /// If fill is enabled, this color will be used to fill the area above the curve below BaselineY. - /// - [Obsolete("Use the Fill() methods of this object to configure this setting")] - public Color? GradientFillColor2 { get => _GradientFillColor2; set => _GradientFillColor2 = value; } - public Color? _GradientFillColor2 = null; - - protected FillType _FillType = FillType.NoFill; - protected Color? _FillColor1 = null; - protected Color? _FillColor2 = null; - - /// - /// When markers are visible on the line (low density mode) this is True - /// - private bool ShowMarkersInLegend { get; set; } = false; - - protected T[] _Ys; - public virtual T[] Ys - { - get => _Ys; - set - { - if (value == null) - { - throw new Exception("Y data cannot be null"); - } - - MaxRenderIndexLowerYsPromise = MaxRenderIndex > value.Length - 1; - - _Ys = value; - Strategy.SourceArray = _Ys; - } - } - - private double _SampleRate = 1; - public double SampleRate - { - get => _SampleRate; - set - { - if (value <= 0) - { - throw new Exception("SampleRate must be greater then zero"); - } - - _SampleRate = value; - _SamplePeriod = 1.0 / value; - } - } - - private double _SamplePeriod = 1; - public double SamplePeriod - { - get => _SamplePeriod; - set - { - if (_SamplePeriod <= 0) - { - throw new Exception("SamplePeriod must be greater then zero"); - } - - _SamplePeriod = value; - _SampleRate = 1.0 / value; - } - } - - protected int _MinRenderIndex = 0; - public int MinRenderIndex - { - get => _MinRenderIndex; - set - { - if (value < 0) - { - throw new ArgumentException("MinRenderIndex must be positive"); - } - - MaxRenderIndexHigherMinRenderIndexPromise = value > MaxRenderIndex; - - _MinRenderIndex = value; - } - } - protected int _maxRenderIndex = 0; - public int MaxRenderIndex - { - get => _maxRenderIndex; - set - { - if (value < 0) - { - throw new ArgumentException("MaxRenderIndex must be positive"); - } - - MaxRenderIndexHigherMinRenderIndexPromise = MinRenderIndex > value; - - MaxRenderIndexLowerYsPromise = value > _Ys.Length - 1; - - _maxRenderIndex = value; - } - } - - private int DensityLevelCount = 0; - private Color[] PenColorsByDensity; - public Color[] DensityColors - { - set - { - if (value != null) - { - // turn the ramp into a pen triangle - DensityLevelCount = value.Length * 2 - 1; - PenColorsByDensity = new Color[DensityLevelCount]; - for (int i = 0; i < value.Length; i++) - { - PenColorsByDensity[i] = value[i]; - PenColorsByDensity[DensityLevelCount - 1 - i] = value[i]; - } - } - } - } - - [Obsolete("Use the Fill() methods of this object to configure this setting")] - public FillType FillType - { - get => _FillType; - set - { - FillColor1MustBeSetPromise = (_FillColor1 == null && value != FillType.NoFill); - - FillColor2MustBeSetPromise = (_FillColor2 == null && value == FillType.FillAboveAndBelow); - - _FillType = value; - } - } - - [Obsolete("Use the Fill() methods of this object to configure this setting")] - public Color? FillColor1 - { - get => _FillColor1; - set - { - FillColor1MustBeSetPromise = (value == null && FillType != FillType.NoFill); - - _FillColor1 = value; - } - } - - [Obsolete("Use the Fill() methods of this object to configure this setting")] - public Color? FillColor2 - { - get => _FillColor2; - set - { - FillColor2MustBeSetPromise = (value == null && FillType == FillType.FillAboveAndBelow); - - _FillColor2 = value; - } - } - - /// - /// This expression adds two parameters of the generic type used by this signal plot. - /// - private readonly Func AddYsGenericExpression; - - /// - /// Add two Y values (of the generic type used by this signal plot) and return the result as a double - /// - private double AddYs(T y1, T y2) => Convert.ToDouble(AddYsGenericExpression(y1, y2)); - - /// - /// Add two Y values (of the generic type used by this signal plot) and return the result as a the same type - /// - private T AddYsGeneric(T y1, T y2) => AddYsGenericExpression(y1, y2); - - public SignalPlotBase() - { - ParameterExpression paramA = Expression.Parameter(typeof(T), "a"); - ParameterExpression paramB = Expression.Parameter(typeof(T), "b"); - BinaryExpression bodyAdd = Expression.Add(paramA, paramB); - AddYsGenericExpression = Expression.Lambda>(bodyAdd, paramA, paramB).Compile(); - } - - /// - /// Replace a single Y value - /// - /// array index to replace - /// new value - public void Update(int index, T newValue) => Strategy.updateElement(index, newValue); - - /// - /// Replace a range of Y values - /// - /// index to begin replacing - /// last index to replace - /// source for new data - /// source data offset - public void Update(int firstIndex, int lastIndex, T[] newData, int fromData = 0) => - Strategy.updateRange(firstIndex, lastIndex, newData, fromData); - - /// - /// Replace all Y values from the given index through the end of the array - /// - /// first index to begin replacing - /// new values - public void Update(int firstIndex, T[] newData) => Update(firstIndex, newData.Length, newData); - - /// - /// Replace all Y values with new ones - /// - /// new Y values - public void Update(T[] newData) => Update(0, newData.Length, newData); - - public virtual AxisLimits GetAxisLimits() - { - double xMin = _SamplePeriod * MinRenderIndex; - double xMax = _SamplePeriod * MaxRenderIndex; - Strategy.MinMaxRangeQuery(MinRenderIndex, MaxRenderIndex, out double yMin, out double yMax); - - if (double.IsNaN(yMin) || double.IsNaN(yMax)) - { - throw new InvalidOperationException("Signal data must not contain NaN"); - } - - if (double.IsInfinity(yMin) || double.IsInfinity(yMax)) - { - throw new InvalidOperationException("Signal data must not contain Infinity"); - } - - double offsetY = Convert.ToDouble(OffsetY); - return new AxisLimits( - xMin: xMin + OffsetX, - xMax: xMax + OffsetX, - yMin: yMin + offsetY, - yMax: yMax + offsetY); - } - - /// - /// Render when the data is zoomed out so much that it just looks like a vertical line. - /// - private void RenderSingleLine(PlotDimensions dims, Graphics gfx, Pen penHD) - { - // this function is for when the graph is zoomed so far out its entire display is a single vertical pixel column - Strategy.MinMaxRangeQuery(MinRenderIndex, MaxRenderIndex, out double yMin, out double yMax); - double offsetY = Convert.ToDouble(OffsetY); - PointF point1 = new(dims.GetPixelX(OffsetX), dims.GetPixelY(yMin + offsetY)); - PointF point2 = new(dims.GetPixelX(OffsetX), dims.GetPixelY(yMax + offsetY)); - gfx.DrawLine(penHD, point1, point2); - } - - /// - /// Render when the data is zoomed in such that there is more than 1 column per data point. - /// Rendering is accomplished by drawing a straight line from point to point. - /// - private void RenderLowDensity(PlotDimensions dims, Graphics gfx, int visibleIndex1, int visibleIndex2, Brush brush, Pen penLD, Pen penHD) - { - int capacity = visibleIndex2 - visibleIndex1 + 2; - List linePoints = new(capacity); - if (visibleIndex2 > _Ys.Length - 2) - { - visibleIndex2 = _Ys.Length - 2; - } - - if (visibleIndex2 > MaxRenderIndex - 1) - { - visibleIndex2 = MaxRenderIndex - 1; - } - - if (visibleIndex1 < 0) - { - visibleIndex1 = 0; - } - - if (visibleIndex1 < MinRenderIndex) - { - visibleIndex1 = MinRenderIndex; - } - - for (int i = visibleIndex1; i <= visibleIndex2 + 1; i++) - { - double yCoordinateWithOffset = AddYs(Ys[i], OffsetY); - float yPixel = dims.GetPixelY(yCoordinateWithOffset); - float xPixel = dims.GetPixelX(_SamplePeriod * i + OffsetX); - PointF linePoint = new(xPixel, yPixel); - linePoints.Add(linePoint); - } - - if (linePoints.Count > 1) - { - - PointF[] pointsArray = linePoints.ToArray(); - ValidatePoints(pointsArray); - - if (StepDisplay) - { - pointsArray = GetStepPoints(pointsArray); - } - - if (penLD.Width > 0) - { - gfx.DrawLines(penLD, pointsArray); - } - - switch (_FillType) - { - case FillType.NoFill: - break; - case FillType.FillAbove: - FillToInfinity(dims, gfx, linePoints[0].X, linePoints[linePoints.Count - 1].X, pointsArray, true); - break; - case FillType.FillBelow: - FillToInfinity(dims, gfx, linePoints[0].X, linePoints[linePoints.Count - 1].X, pointsArray, false); - break; - case FillType.FillAboveAndBelow: - FillToBaseline(dims, gfx, linePoints[0].X, linePoints[linePoints.Count - 1].X, pointsArray, BaselineY); - break; - default: - throw new InvalidOperationException("unsupported fill type"); - } - - if (MarkerSize > 0) - { - // make markers transition away smoothly by making them smaller as the user zooms out - float pixelsBetweenPoints = (float)(_SamplePeriod * dims.DataWidth / dims.XSpan); - float zoomTransitionScale = Math.Min(1, pixelsBetweenPoints / 10); - float markerPxDiameter = MarkerSize * zoomTransitionScale; - float markerPxRadius = markerPxDiameter / 2; - if (markerPxRadius > .25) - { - ShowMarkersInLegend = true; - - // adjust marker offset to improve rendering on Linux and MacOS - float markerOffsetX = (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) ? 0 : 1; - foreach (PointF point in linePoints) - { - gfx.FillEllipse(brush: brush, - x: point.X - markerPxRadius + markerOffsetX, y: point.Y - markerPxRadius, - width: markerPxDiameter, height: markerPxDiameter); - } - } - else - { - ShowMarkersInLegend = false; - } - } - } - } - - /// - /// Convert scatter plot points (connected by diagnal lines) to step plot points (connected by right angles) - /// by inserting an extra point between each of the original data points. - /// - protected PointF[] GetStepPoints(PointF[] pointsArray) - { - PointF[] pointsStep = new PointF[pointsArray.Length * 2 - 1]; - - for (int i = 0; i < pointsArray.Length - 1; i++) - { - pointsStep[i * 2] = pointsArray[i]; - pointsStep[i * 2 + 1] = new PointF(pointsArray[i + 1].X, pointsArray[i].Y); - } - - pointsStep[pointsStep.Length - 1] = pointsArray[pointsArray.Length - 1]; - - return pointsStep; - } - - private class IntervalMinMax - { - public float x; - public float Min; - public float Max; - public IntervalMinMax(float x, float Min, float Max) - { - this.x = x; - this.Min = Min; - this.Max = Max; - } - public IEnumerable GetPoints() - { - yield return new PointF(x, Min); - yield return new PointF(x, Max); - } - } - - private IntervalMinMax CalcInterval(int xPx, double offsetPoints, double columnPointCount, PlotDimensions dims) - { - int index1 = (int)(offsetPoints + columnPointCount * xPx); - int index2 = (int)(offsetPoints + columnPointCount * (xPx + 1)); - - if (index1 < 0) - { - index1 = 0; - } - - if (index1 < MinRenderIndex) - { - index1 = MinRenderIndex; - } - - if (index2 > _Ys.Length - 1) - { - index2 = _Ys.Length - 1; - } - - if (index2 > MaxRenderIndex) - { - index2 = MaxRenderIndex; - } - - // get the min and max value for this column - Strategy.MinMaxRangeQuery(index1, index2, out double lowestValue, out double highestValue); - float yPxHigh = dims.GetPixelY(lowestValue + Convert.ToDouble(OffsetY)); - float yPxLow = dims.GetPixelY(highestValue + Convert.ToDouble(OffsetY)); - return new IntervalMinMax(xPx, yPxLow, yPxHigh); - } - - /// - /// Render the data when there is more than one data point per pixel column. - /// Each pixel column therefore represents multiple data points. - /// Rendering is optimized by determining the min/max for each pixel column, then a single line is drawn connecting those values. - /// - private void RenderHighDensity(PlotDimensions dims, Graphics gfx, double offsetPoints, double columnPointCount, Pen penHD) - { - int dataColumnFirst = (int)Math.Ceiling((-1 - offsetPoints + MinRenderIndex) / columnPointCount - 1); - int dataColumnLast = (int)Math.Ceiling((MaxRenderIndex - offsetPoints) / columnPointCount); - dataColumnFirst = Math.Max(0, dataColumnFirst); - dataColumnLast = Math.Min((int)dims.DataWidth, dataColumnLast); - if (dataColumnFirst >= dataColumnLast) - { - return; - } - - var columns = Enumerable.Range(dataColumnFirst, dataColumnLast - dataColumnFirst); - float xPixelStart = dataColumnFirst + dims.DataOffsetX; - float xPixelEnd = dataColumnLast + dims.DataOffsetX; - - IEnumerable intervals; - if (UseParallel) - { - intervals = columns - .AsParallel() - .AsOrdered() - .Select(xPx => CalcInterval(xPx, offsetPoints, columnPointCount, dims)) - .AsSequential(); - } - else - { - intervals = columns - .Select(xPx => CalcInterval(xPx, offsetPoints, columnPointCount, dims)); - } - - PointF[] linePoints = intervals - .SelectMany(c => c.GetPoints()) - .ToArray(); - - // adjust order of points to enhance anti-aliasing - PointF buf; - for (int i = 1; i < linePoints.Length / 2; i++) - { - if (linePoints[i * 2].Y >= linePoints[i * 2 - 1].Y) - { - buf = linePoints[i * 2]; - linePoints[i * 2] = linePoints[i * 2 + 1]; - linePoints[i * 2 + 1] = buf; - } - } - - for (int i = 0; i < linePoints.Length; i++) - { - linePoints[i].X += dims.DataOffsetX; - } - - if (linePoints.Length > 0) - { - ValidatePoints(linePoints); - gfx.DrawLines(penHD, linePoints); - } - - switch (_FillType) - { - case FillType.NoFill: - break; - case FillType.FillAbove: - FillToInfinity(dims, gfx, xPixelStart, xPixelEnd, linePoints, true); - break; - case FillType.FillBelow: - FillToInfinity(dims, gfx, xPixelStart, xPixelEnd, linePoints, false); - break; - case FillType.FillAboveAndBelow: - FillToBaseline(dims, gfx, xPixelStart, xPixelEnd, linePoints, BaselineY); - break; - default: - throw new InvalidOperationException("unsupported fill type"); - } - } - - /// - /// Shade the region abvove or below the curve (to infinity) by drawing a polygon to the edge of the visible plot area. - /// - internal void FillToInfinity(PlotDimensions dims, Graphics gfx, float xPxStart, float xPxEnd, PointF[] linePoints, bool fillToPositiveInfinity) - { - float minVal = 0; - float maxVal = (dims.DataHeight * (fillToPositiveInfinity ? -1 : 1)) + dims.DataOffsetY; - - PointF first = new(xPxStart, maxVal); - PointF last = new(xPxEnd, maxVal); - - PointF[] points = new PointF[] { first } - .Concat(linePoints) - .Concat(new PointF[] { last }) - .ToArray(); - - Rectangle gradientRectangle = new( - x: (int)first.X, - y: (int)minVal - (fillToPositiveInfinity ? 2 : 0), - width: (int)(last.X - first.X), - height: (int)dims.Height); - - using var brush = new LinearGradientBrush(gradientRectangle, _FillColor1.Value, _GradientFillColor1 ?? _FillColor1.Value, LinearGradientMode.Vertical); - gfx.FillPolygon(brush, points); - } - - private PointF? GetIntersection(PointF point1, PointF point2, PointF baselineStart, PointF baselineEnd) - { - double a1 = point2.Y - point1.Y; - double b1 = point1.X - point2.X; - double c1 = a1 * (point1.X) + b1 * (point1.Y); - - double a2 = baselineEnd.Y - baselineStart.Y; - double b2 = baselineStart.X - baselineEnd.X; - double c2 = a2 * (baselineStart.X) + b2 * (baselineStart.Y); - - double d = a1 * b2 - a2 * b1; - - if (d == 0) - { - // Lines do not intersect. This could also be the case if the plot is zoomed out too much. - return null; - } - else - { - double x = (b2 * c1 - b1 * c2) / d; - double y = (a1 * c2 - a2 * c1) / d; - return new PointF((float)x, (float)y); - } - } - - /// - /// Shade the region abvove and below the curve (to the baseline level) by drawing two polygons - /// - internal void FillToBaseline(PlotDimensions dims, Graphics gfx, float xPxStart, float xPxEnd, PointF[] linePoints, double baselineY) - { - int baseline = (int)dims.GetPixelY(baselineY); - - PointF first = new(xPxStart, baseline); - PointF last = new(xPxEnd, baseline); - - PointF[] points = new PointF[] { first } - .Concat(linePoints) - .Concat(new PointF[] { last }) - .ToArray(); - - PointF baselinePointStart = new(linePoints[0].X, baseline); - PointF baselinePointEnd = new(linePoints[linePoints.Length - 1].X, baseline); - - var pointList = points.ToList(); - int newlyAddedItems = 0; - for (int i = 1; i < points.Length + newlyAddedItems; ++i) - { - if ((pointList[i - 1].Y > baseline && pointList[i].Y < baseline) || - (pointList[i - 1].Y < baseline && pointList[i].Y > baseline)) - { - var intersection = GetIntersection(pointList[i], pointList[i - 1], baselinePointStart, baselinePointEnd); - if (intersection != null) - { - pointList.Insert(i, intersection.Value); - newlyAddedItems++; - i++; - } - } - } - - var dataAreaRect = new Rectangle(0, 0, (int)dims.Width, (int)dims.Height); - - // Above graph - if (dataAreaRect.Height > 0 && dataAreaRect.Width > 0) - { - var color = _GradientFillColor1 ?? _FillColor1.Value; - var edgeColor = _FillColor1.Value; - using var brush = new LinearGradientBrush(dataAreaRect, color, edgeColor, LinearGradientMode.Vertical); - gfx.FillPolygon(brush, - new PointF[] { first } - .Concat(pointList.Where(p => p.Y <= baseline).ToArray()) - .Concat(new PointF[] { last }) - .ToArray()); - } - - // Below graph - if (dataAreaRect.Height > 0 && dataAreaRect.Width > 0) - { - var color = _FillColor2.Value; - var edgeColor = _GradientFillColor2 ?? _FillColor2.Value; - using var brush = new LinearGradientBrush(dataAreaRect, color, edgeColor, LinearGradientMode.Vertical); - gfx.FillPolygon(brush, - new PointF[] { first } - .Concat(pointList.Where(p => p.Y >= baseline).ToArray()) - .Concat(new PointF[] { last }) - .ToArray()); - } - - // Draw baseline - using var baselinePen = GDI.Pen(BaselineColor, BaselineWidth); - gfx.DrawLine(baselinePen, baselinePointStart, baselinePointEnd); - } - - /// - /// Render similar to high density mode except use multiple colors to represent density distributions. - /// - private void RenderHighDensityDistributionParallel(PlotDimensions dims, Graphics gfx, double offsetPoints, double columnPointCount) - { - int xPxStart = (int)Math.Ceiling((-1 - offsetPoints) / columnPointCount - 1); - int xPxEnd = (int)Math.Ceiling((_Ys.Length - offsetPoints) / columnPointCount); - xPxStart = Math.Max(0, xPxStart); - xPxEnd = Math.Min((int)dims.DataWidth, xPxEnd); - if (xPxStart >= xPxEnd) - { - return; - } - - int capacity = (xPxEnd - xPxStart) * 2 + 1; - List linePoints = new(capacity); - - var levelValues = Enumerable.Range(xPxStart, xPxEnd - xPxStart) - .AsParallel() - .AsOrdered() - .Select(xPx => - { - // determine data indexes for this pixel column - int index1 = (int)(offsetPoints + columnPointCount * xPx); - int index2 = (int)(offsetPoints + columnPointCount * (xPx + 1)); - - if (index1 < 0) - { - index1 = 0; - } - - if (index1 > _Ys.Length - 1) - { - index1 = _Ys.Length - 1; - } - - if (index2 > _Ys.Length - 1) - { - index2 = _Ys.Length - 1; - } - - var indexes = Enumerable.Range(0, DensityLevelCount + 1).Select(x => x * (index2 - index1 - 1) / (DensityLevelCount)); - - var levelsValues = new ArraySegment(_Ys, index1, index2 - index1) - .OrderBy(x => x) - .Where((y, i) => indexes.Contains(i)).ToArray(); - return (xPx, levelsValues); - }) - .ToArray(); - - List linePointsLevels = levelValues - .Select(x => x.levelsValues - .Select(y => new PointF( - x: x.xPx + dims.DataOffsetX, - y: dims.GetPixelY(AddYs(y, OffsetY)))) - .ToArray()) - .ToList(); - - for (int i = 0; i < DensityLevelCount; i++) - { - linePoints.Clear(); - for (int j = 0; j < linePointsLevels.Count; j++) - { - if (i + 1 < linePointsLevels[j].Length) - { - linePoints.Add(linePointsLevels[j][i]); - linePoints.Add(linePointsLevels[j][i + 1]); - } - } - - PointF[] pointsArray = linePoints.ToArray(); - ValidatePoints(pointsArray); - - using (Pen densityPen = GDI.Pen(PenColorsByDensity[i])) - { - gfx.DrawLines(densityPen, pointsArray); - } - - switch (_FillType) - { - case FillType.NoFill: - break; - case FillType.FillAbove: - FillToInfinity(dims, gfx, xPxStart, xPxEnd, pointsArray, true); - break; - case FillType.FillBelow: - FillToInfinity(dims, gfx, xPxStart, xPxEnd, pointsArray, false); - break; - case FillType.FillAboveAndBelow: - FillToBaseline(dims, gfx, xPxStart, xPxEnd, pointsArray, BaselineY); - break; - default: - throw new InvalidOperationException("unsupported fill type"); - } - } - } - - public override string ToString() - { - string label = string.IsNullOrWhiteSpace(Label) ? "" : $" ({Label})"; - return $"PlottableSignalBase{label} with {PointCount} points ({typeof(T).Name})"; - } - - public int PointCount => _Ys.Length; - - public LegendItem[]? GetLegendItems() - { - var singleLegendItem = new LegendItem() - { - label = Label, - color = Color, - lineStyle = LineStyle, - lineWidth = LineWidth, - markerShape = ShowMarkersInLegend ? MarkerShape.FilledCircle : MarkerShape.None, - markerSize = ShowMarkersInLegend ? MarkerSize : 0 - }; - return new LegendItem[] { singleLegendItem }; - } - - public virtual void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - using var gfx = GDI.Graphics(bmp, dims, lowQuality); - using var brush = GDI.Brush(Color); - using var penLD = GDI.Pen(Color, (float)LineWidth, LineStyle, true); - using var penHD = GDI.Pen(Color, (float)LineWidth, LineStyle.Solid, true); - - double dataSpanUnits = _Ys.Length * _SamplePeriod; - double columnSpanUnits = dims.XSpan / dims.DataWidth; - double columnPointCount = (columnSpanUnits / dataSpanUnits) * _Ys.Length; - double offsetUnits = dims.XMin - OffsetX; - double offsetPoints = offsetUnits / _SamplePeriod; - int visibleIndex1 = (int)(offsetPoints); - int visibleIndex2 = (int)(offsetPoints + columnPointCount * (dims.DataWidth + 1)); - int visiblePointCount = visibleIndex2 - visibleIndex1; - double pointsPerPixelColumn = visiblePointCount / dims.DataWidth; - double dataWidthPx2 = visibleIndex2 - visibleIndex1 + 2; - bool densityLevelsAvailable = DensityLevelCount > 0 && pointsPerPixelColumn > DensityLevelCount; - double firstPointX = dims.GetPixelX(OffsetX); - double lastPointX = dims.GetPixelX(_SamplePeriod * (_Ys.Length - 1) + OffsetX); - double dataWidthPx = lastPointX - firstPointX; - double columnsWithData = Math.Min(dataWidthPx, dataWidthPx2); - - if (columnsWithData < 1) - { - RenderSingleLine(dims, gfx, penHD); - } - else if (pointsPerPixelColumn > 1) - { - if (densityLevelsAvailable) - { - RenderHighDensityDistributionParallel(dims, gfx, offsetPoints, columnPointCount); - } - else - { - RenderHighDensity(dims, gfx, offsetPoints, columnPointCount, penHD); - } - } - else - { - RenderLowDensity(dims, gfx, visibleIndex1, visibleIndex2, brush, penLD, penHD); - } - } - - protected void ValidatePoints(PointF[] points) - { - foreach (PointF pt in points) - { - if (float.IsNaN(pt.Y)) - { - throw new InvalidOperationException("Data must not contain NaN"); - } - } - } - - public void ValidateData(bool deep = false) - { - // check Y values - if (Ys is null) - { - throw new InvalidOperationException("ys cannot be null"); - } - - if (deep) - { - Validate.AssertAllReal("ys", Ys); - } - - // check render indexes - if (MinRenderIndex < 0 || MinRenderIndex > MaxRenderIndex) - { - throw new IndexOutOfRangeException("minRenderIndex must be between 0 and maxRenderIndex"); - } - - if ((MaxRenderIndex > Ys.Length - 1) || MaxRenderIndex < 0) - { - throw new IndexOutOfRangeException("maxRenderIndex must be a valid index for ys[]"); - } - - if (MaxRenderIndexLowerYsPromise) - { - throw new IndexOutOfRangeException("maxRenderIndex must be a valid index for ys[]"); - } - - if (MaxRenderIndexHigherMinRenderIndexPromise) - { - throw new IndexOutOfRangeException("minRenderIndex must be lower maxRenderIndex"); - } - - // check misc styling options - if (FillColor1MustBeSetPromise) - { - throw new InvalidOperationException($"A Color must be assigned to FillColor1 to use fill type '{_FillType}'"); - } - - if (FillColor2MustBeSetPromise) - { - throw new InvalidOperationException($"A Color must be assigned to FillColor2 to use fill type '{_FillType}'"); - } - } - - /// - /// Return the X/Y coordinates of the point nearest the X position - /// - /// X position in plot space - /// - public (double x, T y, int index) GetPointNearestX(double x) - { - int index = (int)((x - OffsetX) / SamplePeriod); - index = Math.Max(index, MinRenderIndex); - index = Math.Min(index, MaxRenderIndex); - return (OffsetX + index * SamplePeriod, AddYsGeneric(Ys[index], OffsetY), index); - } - - /// - /// Configure the signal plot to only show the curve with no filled area above or below it - /// - public void FillDisable() - { - _FillType = FillType.FillBelow; - _GradientFillColor1 = null; - _GradientFillColor2 = null; - } - - /// - /// Show a solid color beneath the curve - /// - public void FillBelow(Color? color = null, double alpha = .2) - { - _FillType = FillType.FillBelow; - _FillColor1 = GDI.Semitransparent(color ?? Color, alpha); - } - - /// - /// Show a two-color gradient beneath the curve - /// - public void FillBelow(Color upperColor, Color lowerColor, double alpha = .2) - { - _FillType = FillType.FillBelow; - _FillColor1 = GDI.Semitransparent(upperColor, alpha); - _GradientFillColor1 = GDI.Semitransparent(lowerColor, alpha); - } - - /// - /// Show a solid color above the curve - /// - public void FillAbove(Color? color = null, double alpha = .2) - { - _FillType = FillType.FillAbove; - _FillColor1 = GDI.Semitransparent(color ?? Color, alpha); - } - - /// - /// Show a two-color gradient above the curve - /// - public void FillAbove(Color lowerColor, Color upperColor, double alpha = .2) - { - _FillType = FillType.FillAbove; - _FillColor1 = GDI.Semitransparent(upperColor, alpha); - _GradientFillColor1 = GDI.Semitransparent(lowerColor, alpha); - } - - /// - /// Fill the area between the curve and the value - /// - public void FillAboveAndBelow(Color colorAbove, Color colorBelow, double alpha = .2) - { - _FillType = FillType.FillAboveAndBelow; - _FillColor1 = GDI.Semitransparent(colorAbove, alpha); - _FillColor2 = GDI.Semitransparent(colorBelow, alpha); - } - - /// - /// Fill the area between the curve and the edge of the display area using two gradients - /// - /// Color above the line next to the curve - /// Color above the line next to the upper edge of the plot area - /// Color below the line next to the curve - /// Color below the line next to the lower edge of the plot area - /// Apply this opacity to all colors - public void FillAboveAndBelow(Color above1, Color above2, - Color below1, Color below2, double alpha = .2) - { - _FillType = FillType.FillAboveAndBelow; - - _FillColor1 = GDI.Semitransparent(above1, alpha); - _GradientFillColor1 = GDI.Semitransparent(above2, alpha); - - _FillColor2 = GDI.Semitransparent(below2, alpha); - _GradientFillColor2 = GDI.Semitransparent(below1, alpha); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/SignalPlotConst.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/SignalPlotConst.cs deleted file mode 100644 index e5570fee5..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/SignalPlotConst.cs +++ /dev/null @@ -1,61 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - // Variation of PlottableSignal that uses a segmented tree for faster min/max range queries - // - frequent min/max lookups are a bottleneck displaying large signals - // - double[] limited to 60M points (250M in x64 mode) due to memory (tree uses from 2X to 4X memory) - // - smaller data types have higher points count limits - // - in x64 mode limit can be up to maximum array size (2G points) with special solution and 64 GB RAM (not tested) - // - if source array is changed UpdateTrees() must be called - // - source array can be change by call updateData(), updating by ranges much faster. - - /// - /// This plot type is a potentially faster version of the SignalPlot. - /// It pre-calculates min/max values for various segments of data, greatly speeding-up rendering - /// for extremely large datasets (10s of millions of points). - /// Note that these pre-calculations require more memory and an up-front calculation delay. - /// If the underlying data is updated, you must call Update() methods to recalculate the min/max values. - /// - /// - public class SignalPlotConst : SignalPlotBase where T : struct, IComparable - { - public bool TreesReady => (Strategy as SegmentedTreeMinMaxSearchStrategy)?.TreesReady ?? false; - - public SignalPlotConst() : base() - { - Strategy = new SegmentedTreeMinMaxSearchStrategy(); - } - - public override string ToString() - { - string label = string.IsNullOrWhiteSpace(Label) ? "" : $" ({Label})"; - return $"PlottableSignalConst{label} with {PointCount} points ({typeof(T).Name})"; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/SignalPlotXY.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/SignalPlotXY.cs deleted file mode 100644 index 9d38bde16..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/SignalPlotXY.cs +++ /dev/null @@ -1,47 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// A variation of the SignalPlot optimized for unevenly-spaced ascending X values. - /// - public class SignalPlotXY : SignalPlotXYGeneric - { - - public SignalPlotXY() : base() - { - Strategy = new LinearDoubleOnlyMinMaxStrategy(); - } - - public override string ToString() - { - string label = string.IsNullOrWhiteSpace(Label) ? "" : $" ({Label})"; - return $"PlottableSignalXY{label} with {PointCount} points"; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/SignalPlotXYConst.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/SignalPlotXYConst.cs deleted file mode 100644 index ca7fce4ca..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/SignalPlotXYConst.cs +++ /dev/null @@ -1,50 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// A variation of the SignalPlotConst optimized for unevenly-spaced ascending X values. - /// - /// - /// - public class SignalPlotXYConst : SignalPlotXYGeneric where TX : struct, IComparable where TY : struct, IComparable - { - public bool TreesReady => (Strategy as SegmentedTreeMinMaxSearchStrategy)?.TreesReady ?? false; - - public SignalPlotXYConst() : base() - { - Strategy = new SegmentedTreeMinMaxSearchStrategy(); - } - - public override string ToString() - { - string label = string.IsNullOrWhiteSpace(Label) ? "" : $" ({Label})"; - return $"PlottableSignalXYConst{label} with {PointCount} points ({typeof(TX).Name}, {typeof(TY).Name})"; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/SignalPlotXYGeneric.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/SignalPlotXYGeneric.cs deleted file mode 100644 index 1730b7724..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/SignalPlotXYGeneric.cs +++ /dev/null @@ -1,376 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -using System.Linq.Expressions; - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// A variation of the SignalPlotConst optimized for unevenly-spaced ascending X values. - /// - /// - /// - public class SignalPlotXYGeneric : SignalPlotBase, IHasPointsGenericX where TX : struct, IComparable where TY : struct, IComparable - { - private TX[] _Xs; - public TX[] Xs - { - get => _Xs; - set - { - if (value == null) - { - throw new ArgumentException("XS cannot be null"); - } - - if (value.Length == 0) - { - throw new ArgumentException("XS must have at least one element"); - } - - for (int i = 1; i < value.Length; i++) - { - if (value[i].CompareTo(value[i - 1]) < 0) - { - throw new ArgumentException("Xs must only contain ascending values"); - } - } - - _Xs = value; - } - } - - public override TY[] Ys - { - get => _Ys; - set - { - if (value.Length == 0) - { - throw new ArgumentException("YS must have at least one element"); - } - - base.Ys = value; - } - } - - public SignalPlotXYGeneric() : base() - { - InitExp(); - } - - public override AxisLimits GetAxisLimits() - { - var baseLimits = base.GetAxisLimits(); - var newXMin = Convert.ToDouble(Xs[MinRenderIndex]) + OffsetX; - var newXMax = Convert.ToDouble(Xs[MaxRenderIndex]) + OffsetX; - return new AxisLimits(newXMin, newXMax, baseLimits.YMin, baseLimits.YMax); - } - - /// - /// TODO: document this - /// - /// - /// - /// - /// - /// - public IEnumerable ProcessInterval(int x, int from, int length, PlotDimensions dims) - { - TX start = (TX)Convert.ChangeType(dims.XMin + dims.XSpan / dims.DataWidth * x - OffsetX, typeof(TX)); - TX end = (TX)Convert.ChangeType(dims.XMin + dims.XSpan / dims.DataWidth * (x + 1) - OffsetX, typeof(TX)); - - int startIndex = Array.BinarySearch(Xs, from, length, start); - if (startIndex < 0) - { - startIndex = ~startIndex; - } - - int endIndex = Array.BinarySearch(Xs, from, length, end); - if (endIndex < 0) - { - endIndex = ~endIndex; - } - - if (startIndex == endIndex) - { - yield break; - } - - Strategy.MinMaxRangeQuery(startIndex, endIndex - 1, out double min, out double max); - - var pointsCount = endIndex - startIndex; - - yield return new PointF(x + dims.DataOffsetX, dims.GetPixelY(Strategy.SourceElement(startIndex) + Convert.ToDouble(OffsetY))); - if (pointsCount > 1) - { - yield return new PointF(x + dims.DataOffsetX, dims.GetPixelY(min + Convert.ToDouble(OffsetY))); - yield return new PointF(x + dims.DataOffsetX, dims.GetPixelY(max + Convert.ToDouble(OffsetY))); - yield return new PointF(x + dims.DataOffsetX, dims.GetPixelY(Strategy.SourceElement(endIndex - 1) + Convert.ToDouble(OffsetY))); - } - } - - public override void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - using (Graphics gfx = GDI.Graphics(bmp, dims, lowQuality)) - { - using (var brush = new SolidBrush(Color)) - { - using (var penHD = GDI.Pen(Color, (float)LineWidth, LineStyle, true)) - { - - PointF[] PointBefore; - PointF[] PointAfter; - int searchFrom; - int searchTo; - - // Calculate point before displayed points - int pointBeforeIndex = Array.BinarySearch(Xs, MinRenderIndex, MaxRenderIndex - MinRenderIndex + 1, Convert.ChangeType(dims.XMin - OffsetX, typeof(TX))); - if (pointBeforeIndex < 0) - { - pointBeforeIndex = ~pointBeforeIndex; - } - - if (pointBeforeIndex > MinRenderIndex) - { - PointBefore = new PointF[] - { - new PointF(dims.GetPixelX(Convert.ToDouble(Xs[pointBeforeIndex - 1]) + OffsetX), - dims.GetPixelY(Strategy.SourceElement(pointBeforeIndex - 1) + Convert.ToDouble(OffsetY))) - }; - searchFrom = pointBeforeIndex; - } - else - { - PointBefore = new PointF[] { }; - searchFrom = MinRenderIndex; - } - - // Calculate point after displayed points - int pointAfterIndex = Array.BinarySearch(Xs, MinRenderIndex, MaxRenderIndex - MinRenderIndex + 1, Convert.ChangeType(dims.XMax - OffsetX, typeof(TX))); - if (pointAfterIndex < 0) - { - pointAfterIndex = ~pointAfterIndex; - } - - if (pointAfterIndex <= MaxRenderIndex) - { - PointAfter = new PointF[] - { - new PointF(dims.GetPixelX(Convert.ToDouble(Xs[pointAfterIndex]) + OffsetX), - dims.GetPixelY(Strategy.SourceElement(pointAfterIndex) + Convert.ToDouble(OffsetY))) - }; - searchTo = pointAfterIndex; - } - else - { - PointAfter = new PointF[] { }; - searchTo = MaxRenderIndex; - } - - IEnumerable VisiblePoints; - if (UseParallel) - { - VisiblePoints = Enumerable.Range(0, (int)Math.Round(dims.DataWidth)) - .AsParallel() - .AsOrdered() - .Select(x => ProcessInterval(x, searchFrom, searchTo - searchFrom + 1, dims)) - .SelectMany(x => x); - - } - else - { - VisiblePoints = Enumerable.Range(0, (int)Math.Round(dims.DataWidth)) - .Select(x => ProcessInterval(x, searchFrom, searchTo - searchFrom + 1, dims)) - .SelectMany(x => x); - } - - PointF[] PointsToDraw = PointBefore.Concat(VisiblePoints).Concat(PointAfter).ToArray(); - - // Interpolate before displayed point to make it x = -1 (close to visible area) - // this fix extreme zoom in bug - if (PointBefore.Length > 0 && PointsToDraw.Length >= 2) - { - float x0 = -1 + dims.DataOffsetX; - float y0 = PointsToDraw[1].Y + (PointsToDraw[0].Y - PointsToDraw[1].Y) * (x0 - PointsToDraw[1].X) / (PointsToDraw[0].X - PointsToDraw[1].X); - PointsToDraw[0] = new PointF(x0, y0); - } - // Interpolate after displayed point to make it x = datasize.Width(close to visible area) - // this fix extreme zoom in bug - if (PointAfter.Length > 0 && PointsToDraw.Length >= 2) - { - PointF lastPoint = PointsToDraw[PointsToDraw.Length - 2]; - PointF afterPoint = PointsToDraw[PointsToDraw.Length - 1]; - - float x1 = dims.DataWidth + dims.DataOffsetX; - float y1 = lastPoint.Y + (afterPoint.Y - lastPoint.Y) * (x1 - lastPoint.X) / (afterPoint.X - lastPoint.X); - PointsToDraw[PointsToDraw.Length - 1] = new PointF(x1, y1); - } - - // Fill below the line - switch (_FillType) - { - case FillType.NoFill: - break; - case FillType.FillAbove: - FillToInfinity(dims, gfx, PointsToDraw[0].X, PointsToDraw[PointsToDraw.Length - 1].X, PointsToDraw, true); - break; - case FillType.FillBelow: - FillToInfinity(dims, gfx, PointsToDraw[0].X, PointsToDraw[PointsToDraw.Length - 1].X, PointsToDraw, false); - break; - case FillType.FillAboveAndBelow: - FillToBaseline(dims, gfx, PointsToDraw[0].X, PointsToDraw[PointsToDraw.Length - 1].X, PointsToDraw, BaselineY); - break; - default: - throw new InvalidOperationException("unsupported fill type"); - } - - // Draw lines - if (PointsToDraw.Length > 1) - { - PointF[] pointsArray = PointsToDraw.ToArray(); - ValidatePoints(pointsArray); - - if (StepDisplay) - { - pointsArray = GetStepPoints(pointsArray); - } - - gfx.DrawLines(penHD, pointsArray); - } - - // draw markers - if (PointsToDraw.Length > 1) - { - float dataSpanXPx = PointsToDraw[PointsToDraw.Length - 1].X - PointsToDraw[0].X; - float markerPxRadius = .3f * dataSpanXPx / PointsToDraw.Length; - markerPxRadius = Math.Min(markerPxRadius, MarkerSize / 2); - if (markerPxRadius > .3) - { - // skip not visible before and after points - var PointsWithMarkers = PointsToDraw - .Skip(PointBefore.Length) - .Take(PointsToDraw.Length - PointBefore.Length - PointAfter.Length); - foreach (PointF pt in PointsWithMarkers) - { - // adjust marker offset to improve rendering on Linux and MacOS - float markerOffsetX = (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) ? 0 : 1; - - gfx.FillEllipse(brush, - x: pt.X - markerPxRadius + markerOffsetX, - y: pt.Y - markerPxRadius, - width: markerPxRadius * 2, - height: markerPxRadius * 2); - } - } - } - } - } - } - } - - public new void ValidateData(bool deep = false) - { - base.ValidateData(deep); - Validate.AssertEqualLength("xs and ys", Xs, Ys); - Validate.AssertHasElements("xs", Xs); - Validate.AssertAscending("xs", Xs); - } - - public override string ToString() - { - string label = string.IsNullOrWhiteSpace(Label) ? "" : $" ({Label})"; - return $"PlottableSignalXYGeneric{label} with {PointCount} points ({typeof(TX).Name}, {typeof(TY).Name})"; - } - - private (TX x, TY y, int index) GetPointByIndex(int index) - { - return (Xs[index], Ys[index], index); - } - - /// - /// Return the X/Y coordinates of the point nearest the X position - /// - /// X position in plot space - /// - public (TX x, TY y, int index) GetPointNearestX(TX x) - { - int index = Array.BinarySearch(Xs, MinRenderIndex, MaxRenderIndex - 1, x); - if (index < 0) - { - index = ~index; - } - else // x equal to XS element - { - return GetPointByIndex(index); - } - if (index <= MinRenderIndex) // x lower then any MinRenderIndex - { - return GetPointByIndex(MinRenderIndex); - } - - if (index > MaxRenderIndex) // x higher then MaxRenderIndex - { - return GetPointByIndex(MaxRenderIndex); - } - - TX distLeft = SubstractExp(x, Xs[index - 1]); - TX distRight = SubstractExp(Xs[index], x); - if (LessThanOrEqualExp(distLeft, distRight)) // x closer to XS[index -1] - { - return GetPointByIndex(index - 1); - } - else // x closer to XS[index] - { - return GetPointByIndex(index); - } - } - - /// - /// This method to pass test only - /// - /// X position in plot space - /// - private new(double x, TY y, int index) GetPointNearestX(double x) - { - throw new NotImplementedException(); - } - - private static Func SubstractExp; - private static Func LessThanOrEqualExp; - - private void InitExp() - { - ParameterExpression paramA = Expression.Parameter(typeof(TX), "a"); - ParameterExpression paramB = Expression.Parameter(typeof(TX), "b"); - BinaryExpression bodySubstract = Expression.Subtract(paramA, paramB); - BinaryExpression bodyLessOrEqual = Expression.LessThanOrEqual(paramA, paramB); - SubstractExp = Expression.Lambda>(bodySubstract, paramA, paramB).Compile(); - LessThanOrEqualExp = Expression.Lambda>(bodyLessOrEqual, paramA, paramB).Compile(); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Text.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Text.cs deleted file mode 100644 index aaf83e624..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Text.cs +++ /dev/null @@ -1,114 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Display a text label at an X/Y position in coordinate space - /// - public class Text : IPlottable - { - // data - public double X; - public double Y; - public string Label; - - // customization - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - public bool BackgroundFill = false; - public Color BackgroundColor; - public Font Font = new Font(); - public Color Color { set => Font.Color = value; } - public string FontName { set => Font.Name = value; } - public float FontSize { set => Font.Size = value; } - public bool FontBold { set => Font.Bold = value; } - public Alignment Alignment { set => Font.Alignment = value; } - public float Rotation { set => Font.Rotation = value; } - - public override string ToString() => $"PlottableText \"{Label}\" at ({X}, {Y})"; - public AxisLimits GetAxisLimits() => new AxisLimits(X, X, Y, Y); - public LegendItem[]? GetLegendItems() => null; - - public void ValidateData(bool deep = false) - { - if (double.IsNaN(X) || double.IsNaN(Y)) - { - throw new InvalidOperationException("X and Y cannot be NaN"); - } - - if (double.IsInfinity(X) || double.IsInfinity(Y)) - { - throw new InvalidOperationException("X and Y cannot be Infinity"); - } - - if (string.IsNullOrWhiteSpace(Label)) - { - throw new InvalidOperationException("text cannot be null or whitespace"); - } - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - if (string.IsNullOrWhiteSpace(Label) || IsVisible == false) - { - return; - } - - using (Graphics gfx = GDI.Graphics(bmp, dims, lowQuality)) - { - using (var font = GDI.Font(Font)) - { - using (var fontBrush = new SolidBrush(Font.Color)) - { - using (var frameBrush = new SolidBrush(BackgroundColor)) - { - float pixelX = dims.GetPixelX(X); - float pixelY = dims.GetPixelY(Y); - SizeF stringSize = GDI.MeasureString(gfx, Label, font); - - gfx.TranslateTransform(pixelX, pixelY); - gfx.RotateTransform(Font.Rotation); - - if (BackgroundFill) - { - RectangleF stringRect = new RectangleF(0, 0, stringSize.Width, stringSize.Height); - gfx.FillRectangle(frameBrush, stringRect); - } - - StringFormat sf = GDI.StringFormat(Font.Alignment); - gfx.DrawString(Label, font, fontBrush, new PointF(0, 0), sf); - - gfx.ResetTransform(); - } - } - } - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Tooltip.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Tooltip.cs deleted file mode 100644 index b132fb704..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/Tooltip.cs +++ /dev/null @@ -1,143 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// A tooltip displays a text bubble pointing to a specific location in X/Y space. - /// The position of the bubble moves according to the axis limits to best display the text in the data area. - /// - public class Tooltip : IPlottable - { - public string Label { get; set; } - public bool IsVisible { get; set; } = true; - public Color BorderColor { get; set; } = Color.DarkGray; - public float BorderWidth = 2; - public Color FillColor { get; set; } = Color.White; - public int XAxisIndex { get; set; } - public int YAxisIndex { get; set; } - - public readonly Font Font = new Font(); - public int ArrowSize = 5; - public int LabelPadding = 10; - - /// - /// Tooltip position in coordinate space - /// - public double X; - - /// - /// Tooltip position in coordinate space - /// - public double Y; - - public LegendItem[]? GetLegendItems() => null; - - public AxisLimits GetAxisLimits() => new AxisLimits(double.NaN, double.NaN, double.NaN, double.NaN); - - public void ValidateData(bool deep = false) - { - if (string.IsNullOrEmpty(Label)) - { - throw new InvalidOperationException("Label may not be empty"); - } - - if (double.IsNaN(X) || double.IsInfinity(X)) - { - throw new InvalidOperationException("X must be a real number"); - } - - if (double.IsNaN(Y) || double.IsInfinity(Y)) - { - throw new InvalidOperationException("Y must be a real number"); - } - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - if (!IsVisible) - { - return; - } - - using (var gfx = GDI.Graphics(bmp, dims, lowQuality, clipToDataArea: true)) - { - using (var font = GDI.Font(Font)) - { - using (var fillBrush = GDI.Brush(FillColor)) - { - using (var fontBrush = GDI.Brush(Font.Color)) - { - using (var pen = GDI.Pen(BorderColor, BorderWidth)) - { - SizeF labelSize = gfx.MeasureString(Label, font); - - bool labelIsOnRight = dims.DataWidth - dims.GetPixelX(X) - labelSize.Width > 0; - int sign = labelIsOnRight ? 1 : -1; - - PointF arrowHeadLocation = new PointF(dims.GetPixelX(X), dims.GetPixelY(Y)); - - float contentBoxInsideEdgeX = arrowHeadLocation.X + sign * ArrowSize; - PointF upperArrowVertex = new PointF(contentBoxInsideEdgeX, arrowHeadLocation.Y - ArrowSize); - PointF lowerArrowVertex = new PointF(contentBoxInsideEdgeX, arrowHeadLocation.Y + ArrowSize); - - float contentBoxTopEdge = upperArrowVertex.Y - LabelPadding; - float contentBoxBottomEdge = Math.Max(contentBoxTopEdge + labelSize.Height, lowerArrowVertex.Y) + 2 * LabelPadding; - - PointF[] points = - { - arrowHeadLocation, - upperArrowVertex, - new PointF(contentBoxInsideEdgeX, upperArrowVertex.Y - LabelPadding), - new PointF(contentBoxInsideEdgeX + sign * (labelSize.Width + LabelPadding), upperArrowVertex.Y - LabelPadding), - new PointF(contentBoxInsideEdgeX + sign * (labelSize.Width + LabelPadding), contentBoxBottomEdge), - new PointF(contentBoxInsideEdgeX, contentBoxBottomEdge), - lowerArrowVertex, - arrowHeadLocation, - // add one more point to prevent render artifacts where thick line ends meet - upperArrowVertex, - }; - - byte[] pathPointTypes = Enumerable.Range(0, points.Length).Select(_ => (byte)PathPointType.Line).ToArray(); - - var path = new GraphicsPath(points, pathPointTypes); - - gfx.FillPath(fillBrush, path); - gfx.DrawPath(pen, path); - - float labelOffsetX = labelIsOnRight ? 0 : -labelSize.Width; - float labelX = contentBoxInsideEdgeX + labelOffsetX + sign * LabelPadding / 2; - float labelY = upperArrowVertex.Y; - gfx.DrawString(Label, font, fontBrush, labelX, labelY); - } - } - } - } - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/VLine.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/VLine.cs deleted file mode 100644 index 65ca0fde4..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/VLine.cs +++ /dev/null @@ -1,42 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Vertical line at an X position - /// - public class VLine : AxisLine - { - /// - /// X position to render the line - /// - public double X { get => Position; set => Position = value; } - public override string ToString() => $"Vertical line at X={X}"; - public VLine() : base(false) { } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/VectorField.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/VectorField.cs deleted file mode 100644 index 860e869ba..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Plottable/VectorField.cs +++ /dev/null @@ -1,158 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -// ReSharper disable UnusedParameter.Local -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// The VectorField displays arrows representing a 2D array of 2D vectors - /// - public class VectorField : IPlottable - { - private readonly double[] _xs; - private readonly double[] _ys; - private readonly Vector2[,] _vectors; - private readonly Color[] _vectorColors; - public string Label; - public bool IsVisible { get; set; } = true; - public int XAxisIndex { get; set; } = 0; - public int YAxisIndex { get; set; } = 0; - - private readonly ArrowStyle _arrowStyle = new(); - - /// - /// Describes which part of the vector line will be placed at the data coordinates. - /// - public ArrowAnchor Anchor { get => _arrowStyle.Anchor; set => _arrowStyle.Anchor = value; } - - /// - /// If enabled arrowheads will be drawn as lines scaled to each vector's magnitude. - /// - public bool ScaledArrowheads { get => _arrowStyle.ScaledArrowheads; set => _arrowStyle.ScaledArrowheads = value; } - - /// - /// When using scaled arrowheads this defines the width of the arrow relative to the vector line's length. - /// - public double ScaledArrowheadWidth { get => _arrowStyle.ScaledArrowheadWidth; set => _arrowStyle.ScaledArrowheadWidth = value; } - - /// - /// When using scaled arrowheads this defines length of the arrowhead relative to the vector line's length. - /// - public double ScaledArrowheadLength { get => _arrowStyle.ScaledArrowheadLength; set => _arrowStyle.ScaledArrowheadLength = value; } - - /// - /// Marker drawn at each coordinate - /// - public MarkerShape MarkerShape { get => _arrowStyle.MarkerShape; set => _arrowStyle.MarkerShape = value; } - - /// - /// Size of markers to be drawn at each coordinate - /// - public float MarkerSize { get => _arrowStyle.MarkerSize; set => _arrowStyle.MarkerSize = value; } - - public VectorField(Vector2[,] vectors, double[] xs, double[] ys, ColourMap colormap, double scaleFactor, Color defaultColor) - { - double minMagnitudeSquared = vectors[0, 0].LengthSquared(); - double maxMagnitudeSquared = vectors[0, 0].LengthSquared(); - for (int i = 0; i < xs.Length; i++) - { - for (int j = 0; j < ys.Length; j++) - { - if (vectors[i, j].LengthSquared() > maxMagnitudeSquared) - { - maxMagnitudeSquared = vectors[i, j].LengthSquared(); - } - else if (vectors[i, j].LengthSquared() < minMagnitudeSquared) - { - minMagnitudeSquared = vectors[i, j].LengthSquared(); - } - } - } - double minMagnitude = Math.Sqrt(minMagnitudeSquared); - double maxMagnitude = Math.Sqrt(maxMagnitudeSquared); - - double[,] intensities = new double[xs.Length, ys.Length]; - for (int i = 0; i < xs.Length; i++) - { - for (int j = 0; j < ys.Length; j++) - { - if (colormap != null) - { - intensities[i, j] = (vectors[i, j].Length() - minMagnitude) / (maxMagnitude - minMagnitude); - } - - vectors[i, j] = Vector2.Multiply(vectors[i, j], (float)(scaleFactor / (maxMagnitude * 1.2))); - } - } - - double[] flattenedIntensities = intensities.Cast().ToArray(); - _vectorColors = colormap is null ? - Enumerable.Range(0, flattenedIntensities.Length).Select(x => defaultColor).ToArray() : - ColourMap.GetColours(flattenedIntensities, colormap); - - _vectors = vectors; - _xs = xs; - _ys = ys; - } - - public void ValidateData(bool deep = false) { /* validation occurs in constructor */ } - - public LegendItem[] GetLegendItems() - { - var singleLegendItem = new LegendItem() - { - label = Label, - color = _vectorColors[0], - lineWidth = 10, - markerShape = MarkerShape.None - }; - return new[] { singleLegendItem }; - } - - public AxisLimits GetAxisLimits() => new(_xs.Min() - 1, _xs.Max() + 1, _ys.Min() - 1, _ys.Max() + 1); - - public int PointCount => _vectors.Length; - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - if (IsVisible == false) - { - return; - } - - using Graphics gfx = GDI.Graphics(bmp, dims, lowQuality); - - _arrowStyle.Render(dims, gfx, _xs, _ys, _vectors, _vectorColors); - } - - public override string ToString() - { - string label = string.IsNullOrWhiteSpace(Label) ? "" : $" ({Label})"; - return $"PlottableVectorField{label} with {PointCount} vectors"; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/ArrowStyle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/ArrowStyle.cs deleted file mode 100644 index 6ddfb7320..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/ArrowStyle.cs +++ /dev/null @@ -1,170 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class ArrowStyle - { - /// - /// Describes which part of the vector line will be placed at the data coordinates. - /// - public ArrowAnchor Anchor = ArrowAnchor.Center; - - /// - /// If enabled arrowheads will be drawn as lines scaled to each vector's magnitude. - /// - public bool ScaledArrowheads; - - /// - /// When using scaled arrowheads this defines the width of the arrow relative to the vector line's length. - /// - public double ScaledArrowheadWidth = 0.15; - - /// - /// When using scaled arrowheads this defines length of the arrowhead relative to the vector line's length. - /// - public double ScaledArrowheadLength = 0.5; - - /// - /// Size of the arrowhead if custom/scaled arrowheads are not in use - /// - public float NonScaledArrowheadWidth = 2; - - /// - /// Size of the arrowhead if custom/scaled arrowheads are not in use - /// - public float NonScaledArrowheadLength = 2; - - /// - /// Marker drawn at each coordinate - /// - public MarkerShape MarkerShape = MarkerShape.FilledCircle; - - /// - /// Size of markers to be drawn at each coordinate - /// - public float MarkerSize = 0; - - public (float tipScale, float headAngle) GetTipDimensions() - { - float tipScale = (float)Math.Sqrt(ScaledArrowheadLength * ScaledArrowheadLength + ScaledArrowheadWidth * ScaledArrowheadWidth); - float headAngle = (float)Math.Atan2(ScaledArrowheadWidth, ScaledArrowheadLength); - return (tipScale, headAngle); - } - - /// - /// Render an evenly-spaced 2D vector field. - /// - public void Render(PlotDimensions dims, Graphics gfx, double[] xs, double[] ys, Vector2[,] vectors, Color[] colors) - { - (float tipScale, float headAngle) = GetTipDimensions(); // precalculate angles for fancy arrows - - using Pen pen = GDI.Pen(Color.Black); - if (!ScaledArrowheads) - { - pen.CustomEndCap = new AdjustableArrowCap(NonScaledArrowheadWidth, NonScaledArrowheadLength); - } - - for (int i = 0; i < xs.Length; i++) - { - for (int j = 0; j < ys.Length; j++) - { - Vector2 v = vectors[i, j]; - float tailX, tailY, endX, endY; - - switch (Anchor) - { - case ArrowAnchor.Base: - tailX = dims.GetPixelX(xs[i]); - tailY = dims.GetPixelY(ys[j]); - endX = dims.GetPixelX(xs[i] + v.X); - endY = dims.GetPixelY(ys[j] + v.Y); - break; - case ArrowAnchor.Center: - tailX = dims.GetPixelX(xs[i] - v.X / 2); - tailY = dims.GetPixelY(ys[j] - v.Y / 2); - endX = dims.GetPixelX(xs[i] + v.X / 2); - endY = dims.GetPixelY(ys[j] + v.Y / 2); - break; - case ArrowAnchor.Tip: - tailX = dims.GetPixelX(xs[i] - v.X); - tailY = dims.GetPixelY(ys[j] - v.Y); - endX = dims.GetPixelX(xs[i]); - endY = dims.GetPixelY(ys[j]); - break; - default: - throw new NotImplementedException("unsupported anchor type"); - } - - pen.Color = colors[i * ys.Length + j]; - if (ScaledArrowheads) - { - DrawFancyArrow(gfx, pen, tailX, tailY, endX, endY, headAngle, tipScale); - } - else - { - gfx.DrawLine(pen, tailX, tailY, endX, endY); - } - - if (MarkerShape != MarkerShape.None && MarkerSize > 0) - { - PointF markerPoint = new PointF(dims.GetPixelX(xs[i]), dims.GetPixelY(ys[j])); - MarkerTools.DrawMarker(gfx, markerPoint, MarkerShape, MarkerSize, pen.Color); - } - } - } - } - - private void DrawFancyArrow(Graphics gfx, Pen pen, float x1, float y1, float x2, float y2, float headAngle, float tipScale) - { - var dx = x2 - x1; - var dy = y2 - y1; - var arrowAngle = (float)Math.Atan2(dy, dx); - var sinA1 = (float)Math.Sin(headAngle - arrowAngle); - var cosA1 = (float)Math.Cos(headAngle - arrowAngle); - var sinA2 = (float)Math.Sin(headAngle + arrowAngle); - var cosA2 = (float)Math.Cos(headAngle + arrowAngle); - var len = (float)Math.Sqrt(dx * dx + dy * dy); - var hypLen = len * tipScale; - - var corner1X = x2 - hypLen * cosA1; - var corner1Y = y2 + hypLen * sinA1; - var corner2X = x2 - hypLen * cosA2; - var corner2Y = y2 - hypLen * sinA2; - - PointF[] arrowPoints = - { - new PointF(x1, y1), - new PointF(x2, y2), - new PointF(corner1X, corner1Y), - new PointF(x2, y2), - new PointF(corner2X, corner2Y), - }; - gfx.DrawLines(pen, arrowPoints); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/Axis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/Axis.cs deleted file mode 100644 index 5f22cb47f..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/Axis.cs +++ /dev/null @@ -1,558 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -/* The Axis module seeks to provide a simple facade to a lot of complex logic. - * - * Axes have many functions: - * - Unit/Pixel conversions - * - Configuring axis limits and boundaries - * - Axis labels (XLabel, YLabel, Title, etc) - * - Adding multiple axes - * - Grid lines - * - Tick marks - * - Tick labels - * - */ - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// An Axis stores dimensions (axis limits and pixel/unit conversion methods) and can render - /// itself including axis label, tick marks, tick labels, and grid lines - /// - public class Axis : IRenderable - { - /// - /// Axis dimensions and methods for pixel/unit conversions - /// - public readonly AxisDimensions Dims = new AxisDimensions(); - - /// - /// Plottables with this axis index will use pixel/unit conversions from this axis - /// - public int AxisIndex = 0; - - public bool IsVisible { get; set; } = true; - - private Edge _Edge; - public Edge Edge - { - get => _Edge; - set - { - _Edge = value; - AxisLine.Edge = value; - AxisLabel.Edge = value; - AxisTicks.Edge = value; - bool isVertical = (value == Edge.Left || value == Edge.Right); - AxisTicks.TickCollection.Orientation = isVertical ? AxisOrientation.Vertical : AxisOrientation.Horizontal; - Dims.IsInverted = isVertical; - } - } - public bool IsHorizontal => Edge == Edge.Top || Edge == Edge.Bottom; - public bool IsVertical => Edge == Edge.Left || Edge == Edge.Right; - - // private renderable components - private readonly AxisLabel AxisLabel = new AxisLabel(); - private readonly AxisTicks AxisTicks = new AxisTicks(); - private readonly AxisLineOptional AxisLine = new AxisLineOptional(); - - /// - /// Return configuration objects to allow deep customization of axis settings. - /// WARNING: This API may not be stable across future versions. - /// - public (AxisLabel, AxisTicks, AxisLineOptional) GetSettings(bool showWarning = true) - { - if (showWarning) - { - Debug.WriteLine( - "WARNING: GetSettings() is only for development and testing. " + - "Not all features may be fully implemented. " + - "Its API may not be stable across future versions."); - } - - return (AxisLabel, AxisTicks, AxisLine); - } - - /// - /// Define the minimum and maximum limits for the pixel size of this axis - /// - public void SetSizeLimit(float? min = null, float? max = null, float? pad = null) - { - PixelSizeMinimum = min ?? PixelSizeMinimum; - PixelSizeMaximum = max ?? PixelSizeMaximum; - PixelSizePadding = pad ?? PixelSizePadding; - } - - /// - /// Size this axis to an exact number of pixels - /// - public void SetSizeLimit(float px) => SetSizeLimit(px, px, 0); - - // private styling variables - private float PixelSize; // how large this axis is - private float PixelOffset; // distance from the data area - private bool Collapsed = false; // true if axes are hidden - private float PixelSizeMinimum = 5; - private float PixelSizeMaximum = float.PositiveInfinity; - private float PixelSizePadding = 3; - - /// - /// Define how many pixels away from the data area this axis will be. - /// TightenLayout() populates this value (based on other PixelSize values) to stack axes beside each other. - /// - public void SetOffset(float pixels) => PixelOffset = pixels; - - /// - /// Returns the number of pixels occupied by this axis - /// - public float GetSize() => IsVisible ? PixelSize + PixelSizePadding : 0; - - public override string ToString() => $"{Edge} axis from {Dims.Min} to {Dims.Max}"; - - /// - /// Use the latest configuration (size, font settings, axis limits) to determine tick mark positions - /// - public void RecalculateTickPositions(PlotDimensions dims) => - AxisTicks.TickCollection.Recalculate(dims, AxisTicks.TickLabelFont); - - /// - /// Render all components of this axis onto the given Bitmap - /// - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - if (IsVisible == false) - { - return; - } - - AxisLabel.PixelSizePadding = PixelSizePadding; - AxisTicks.PixelOffset = PixelOffset; - AxisLabel.PixelOffset = PixelOffset; - AxisLabel.PixelSize = PixelSize; - AxisLine.PixelOffset = PixelOffset; - - using (var gfx = GDI.Graphics(bmp, dims, lowQuality, false)) - { - AxisTicks.Render(dims, bmp, lowQuality); - AxisLabel.Render(dims, bmp, lowQuality); - AxisLine.Render(dims, bmp, lowQuality); - } - } - - /// - /// DateTime format assumes axis represents DateTime.ToOATime() units and displays tick labels accordingly. - /// - public void DateTimeFormat(bool enable) => AxisTicks.TickCollection.LabelFormat = - enable - ? TickLabelFormatOptions.DateTime - : TickLabelFormatOptions.Numeric; - - /// - /// Configure the label of this axis - /// - public string Label(string label = null, Color? color = null, float? size = null, bool? bold = null, string fontName = null) - { - AxisLabel.IsVisible = true; -#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type. - AxisLabel.ImageLabel = null; -#pragma warning restore CS8625 // Cannot convert null literal to non-nullable reference type. - AxisLabel.Label = label ?? AxisLabel.Label; - AxisLabel.Font.Color = color ?? AxisLabel.Font.Color; - AxisLabel.Font.Size = size ?? AxisLabel.Font.Size; - AxisLabel.Font.Bold = bold ?? AxisLabel.Font.Bold; - AxisLabel.Font.Name = fontName ?? AxisLabel.Font.Name; - return AxisLabel.Label; - } - - /// - /// Display a custom image as the axis label instead of text - /// - /// The image to display where the label should go - /// pixels of padding between the inner image edge and the data area - /// pixels of padding between the outer image edge and the figure edge - public void ImageLabel(Bitmap img, float padInside = 5, float padOutside = 5) - { - - IsVisible = true; - AxisLabel.ImageLabel = img; - AxisLabel.ImagePaddingToDataArea = padInside; - AxisLabel.ImagePaddingToFigureEdge = padOutside; - } - - /// - /// Set color of every component of this axis (label, line, tick marks, and tick labels) - /// - public void Color(Color color) - { - Label(color: color); - TickLabelStyle(color: color); - AxisTicks.MajorTickColor = color; - AxisTicks.MinorTickColor = color; - AxisLine.Color = color; - } - - /// - /// Use a custom function to generate tick label strings - /// - public void TickLabelFormat(Func tickFormatter) - { - AxisTicks.TickCollection.ManualTickFormatter = tickFormatter; - } - - /// - /// Manually define the string format to use for translating tick positions to tick labels - /// - public void TickLabelFormat(string format, bool dateTimeFormat) - { - if (dateTimeFormat) - { - AxisTicks.TickCollection.dateTimeFormatString = format; - DateTimeFormat(true); - } - else - { - AxisTicks.TickCollection.numericFormatString = format; - DateTimeFormat(false); - } - } - - /// - /// Customize string settings for the tick labels - /// - public void TickLabelNotation( - bool? multiplier = null, - bool? offset = null, - bool? exponential = null, - bool? invertSign = null, - int? radix = null, - string prefix = null) - { - AxisTicks.TickCollection.useMultiplierNotation = multiplier ?? AxisTicks.TickCollection.useMultiplierNotation; - AxisTicks.TickCollection.useOffsetNotation = offset ?? AxisTicks.TickCollection.useOffsetNotation; - AxisTicks.TickCollection.useExponentialNotation = exponential ?? AxisTicks.TickCollection.useExponentialNotation; - AxisTicks.TickCollection.LabelUsingInvertedSign = invertSign ?? AxisTicks.TickCollection.LabelUsingInvertedSign; - AxisTicks.TickCollection.radix = radix ?? AxisTicks.TickCollection.radix; - AxisTicks.TickCollection.prefix = prefix ?? AxisTicks.TickCollection.prefix; - } - - /// - /// Define a manual spacing between major ticks (and major grid lines) - /// - public void ManualTickSpacing(double manualSpacing) - { - // TODO: cutt X and Y out of this - AxisTicks.TickCollection.manualSpacingX = manualSpacing; - AxisTicks.TickCollection.manualSpacingY = manualSpacing; - } - - /// - /// Define a manual spacing between major ticks (and major grid lines) for axes configured to display using DateTime format - /// - public void ManualTickSpacing(double manualSpacing, DateTimeUnit manualSpacingDateTimeUnit) - { - ManualTickSpacing(manualSpacing); - AxisTicks.TickCollection.manualDateTimeSpacingUnitX = manualSpacingDateTimeUnit; - } - - /// - /// Manually define major tick (and grid) positions and labels - /// - public void ManualTickPositions(double[] positions, string[] labels) - { - TickCollectionStorage.manualTickPositions = positions; - TickCollectionStorage.manualTickLabels = labels; - } - - /// - /// Ruler mode draws long tick marks and offsets tick labels for a ruler appearance - /// - public void RulerMode(bool enable) => AxisTicks.RulerMode = enable; - - /// - /// Enable this to snap major ticks (and grid lines) to the nearest pixel to avoid anti-aliasing artifacts - /// - /// - public void PixelSnap(bool enable) => AxisTicks.SnapPx = enable; - - /// - /// Apply the same color to major and minor tick marks - /// - public void TickMarkColor(Color color) - { - AxisTicks.MajorTickColor = color; - AxisTicks.MinorTickColor = color; - } - - /// - /// Set colors for major and minor tick marks - /// - public void TickMarkColor(Color majorColor, Color minorColor) - { - AxisTicks.MajorTickColor = majorColor; - AxisTicks.MinorTickColor = minorColor; - } - - /// - /// Set the culture to use for unit-to-string tick mark conversion - /// - public void SetCulture(CultureInfo culture) => AxisTicks.TickCollection.Culture = culture; - - /// - /// Manually define culture to use for unit-to-string tick mark conversion - /// - public void SetCulture( - string shortDatePattern = null, string decimalSeparator = null, string numberGroupSeparator = null, - int? decimalDigits = null, int? numberNegativePattern = null, int[] numberGroupSizes = null) => - AxisTicks.TickCollection.SetCulture(shortDatePattern, decimalSeparator, numberGroupSeparator, - decimalDigits, numberNegativePattern, numberGroupSizes); - - /// - /// Customize styling of the tick labels - /// - public void TickLabelStyle( - Color? color = null, - string fontName = null, - float? fontSize = null, - bool? fontBold = null, - float? rotation = null) - { - AxisTicks.TickLabelFont.Color = color ?? AxisTicks.TickLabelFont.Color; - AxisTicks.TickLabelFont.Name = fontName ?? AxisTicks.TickLabelFont.Name; - AxisTicks.TickLabelFont.Size = fontSize ?? AxisTicks.TickLabelFont.Size; - AxisTicks.TickLabelFont.Bold = fontBold ?? AxisTicks.TickLabelFont.Bold; - AxisTicks.TickLabelRotation = rotation ?? AxisTicks.TickLabelRotation; - } - - /// - /// Customize styling of the label (without changing its content) - /// - public void LabelStyle( - Color? color = null, - string fontName = null, - float? fontSize = null) - { - AxisLabel.Font.Color = color ?? AxisLabel.Font.Color; - AxisLabel.Font.Name = fontName ?? AxisLabel.Font.Name; - AxisLabel.Font.Size = fontSize ?? AxisLabel.Font.Size; - } - - /// - /// Set visibility of all ticks - /// - public void Ticks(bool enable) - { - AxisTicks.MajorTickVisible = enable; - AxisTicks.TickLabelVisible = enable; - AxisTicks.MinorTickVisible = enable; - } - - /// - /// Set visibility of individual tick components - /// - public void Ticks(bool major, bool minor, bool majorLabels = true) - { - AxisTicks.MajorTickVisible = major; - AxisTicks.TickLabelVisible = majorLabels; - AxisTicks.MinorTickVisible = minor; - } - - /// - /// This value defines the packing density of tick labels. - /// A density of 1.0 means labels fit tightly based on measured maximum label size. - /// Higher densities place more ticks but tick labels may oberlap. - /// - public void TickDensity(double ratio = 1.0) - { - AxisTicks.TickCollection.TickDensity = (float)ratio; - } - - /// - /// Define the smallest distance between major ticks, grid lines, and tick labels in coordinate units. - /// This only works for numeric tick systems (DateTime ticks are not supported). - /// - public void MinimumTickSpacing(double spacing) - { - AxisTicks.TickCollection.MinimumTickSpacing = spacing; - } - - /// - /// Sets whether minor ticks are evenly spaced or log-distributed between major tick positions - /// - public void MinorLogScale(bool enable, bool roundMajorTicks = true) - { - AxisTicks.TickCollection.MinorTickDistribution = enable ? MinorTickDistribution.Log : MinorTickDistribution.Even; - if (roundMajorTicks) - { - AxisTicks.TickCollection.IntegerPositionsOnly = roundMajorTicks; - } - } - - /// - /// Configure the line drawn along the edge of the axis - /// - public void Line(bool? visible = null, Color? color = null, float? width = null) - { - AxisLine.IsVisible = visible ?? AxisLine.IsVisible; - AxisLine.Color = color ?? AxisLine.Color; - AxisLine.Width = width ?? AxisLine.Width; - } - - /// - /// Set the minimum size and padding of the axis - /// - public void Layout(float? padding = null, float? minimumSize = null, float? maximumSize = null) - { - PixelSizePadding = padding ?? PixelSizePadding; - PixelSizeMinimum = minimumSize ?? PixelSizeMinimum; - PixelSizeMaximum = maximumSize ?? PixelSizeMaximum; - } - - /// - /// Configure visibility and styling of the major grid - /// - public void MajorGrid( - bool? enable = null, - Color? color = null, - float? lineWidth = null, - LineStyle? lineStyle = null) - { - AxisTicks.MajorGridVisible = enable ?? AxisTicks.MajorGridVisible; - AxisTicks.MajorGridColor = color ?? AxisTicks.MajorGridColor; - AxisTicks.MajorGridWidth = lineWidth ?? AxisTicks.MajorGridWidth; - AxisTicks.MajorGridStyle = lineStyle ?? AxisTicks.MajorGridStyle; - } - - /// - /// Configure visibility and styling of the minor grid - /// - public void MinorGrid( - bool? enable = null, - Color? color = null, - float? lineWidth = null, - LineStyle? lineStyle = null, - bool? logScale = null) - { - AxisTicks.MinorGridVisible = enable ?? AxisTicks.MinorGridVisible; - AxisTicks.MinorGridColor = color ?? AxisTicks.MinorGridColor; - AxisTicks.MinorGridWidth = lineWidth ?? AxisTicks.MinorGridWidth; - AxisTicks.MinorGridStyle = lineStyle ?? AxisTicks.MinorGridStyle; - if (logScale.HasValue) - { - AxisTicks.TickCollection.MinorTickDistribution = logScale.Value - ? MinorTickDistribution.Log - : MinorTickDistribution.Even; - } - } - - /// - /// Hide this axis by forcing its size to always be zero. - /// - public void Hide(bool hidden = true) - { - // NOTE: Don't set this.IsVisible because that will control the grid - AxisTicks.MajorTickVisible = !hidden; - AxisTicks.MinorTickVisible = !hidden; - AxisTicks.TickLabelVisible = !hidden; - AxisLine.IsVisible = !hidden; - Collapsed = hidden; - } - - /// - /// Set visibility for major tick grid lines - /// - public void Grid(bool enable) => AxisTicks.MajorGridVisible = enable; - - /// - /// Set pixel size based on the latest axis label, tick marks, and tick label - /// - public void RecalculateAxisSize() - { - if (Collapsed) - { - PixelSize = 0; - return; - } - - using (var tickFont = GDI.Font(AxisTicks.TickLabelFont)) - { - using (var titleFont = GDI.Font(AxisLabel.Font)) - { - PixelSize = 0; - - if (AxisLabel.IsVisible) - { - PixelSize += AxisLabel.Measure().Height; - } - - if (AxisTicks.TickLabelVisible) - { - // determine how many pixels the largest tick label occupies - float maxHeight = AxisTicks.TickCollection.LargestLabelHeight; - float maxWidth = AxisTicks.TickCollection.LargestLabelWidth * 1.2f; - - // calculate the width and height of the rotated label - float largerEdgeLength = Math.Max(maxWidth, maxHeight); - float shorterEdgeLength = Math.Min(maxWidth, maxHeight); - float differenceInEdgeLengths = largerEdgeLength - shorterEdgeLength; - double radians = AxisTicks.TickLabelRotation * Math.PI / 180; - double fraction = IsHorizontal ? Math.Sin(radians) : Math.Cos(radians); - double rotatedSize = shorterEdgeLength + differenceInEdgeLengths * fraction; - - // add the rotated label size to the size of this axis - PixelSize += (float)rotatedSize; - } - - if (AxisTicks.MajorTickVisible) - { - PixelSize += AxisTicks.MajorTickLength; - } - - PixelSize = Math.Max(PixelSize, PixelSizeMinimum); - PixelSize = Math.Min(PixelSize, PixelSizeMaximum); - PixelSize += PixelSizePadding; - } - } - } - - /// - /// Lock min/max limits so it cannot be changed (until it's unlocked) - /// - public void LockLimits(bool locked = true) - { - Dims.LockLimits(locked); - } - - /// - /// Return the ticks displayed in the previous render - /// - public Tick[] GetTicks() - { - return AxisTicks.TickCollection.GetTicks(); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/AxisDimensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/AxisDimensions.cs deleted file mode 100644 index adc71693e..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/AxisDimensions.cs +++ /dev/null @@ -1,344 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// This class stores MUTABLE axis limits and pixel size information for a SINGLE AXIS. - /// Unlike PlotDimensions(immutable objects created just before rendering), - /// values in this class are intended for long term storage. - /// - public class AxisDimensions - { - /// - /// Size of the entire figure (in pixels) if it were to be exported as an image - /// - public float FigureSizePx { get; private set; } - - /// - /// Side of just the data area (in pixels). - /// The data area is the inner rectangle that displays plots. - /// - public float DataSizePx { get; private set; } - - /// - /// Offset of the data area (in pixels) relative to the left or top edge of the figure. - /// - public float DataOffsetPx { get; private set; } - - /// - /// Indicates whether pixel values ascend in the same direciton as axis unit values. - /// Horizontal axes are not inverted (both ascend from left to right). - /// Vertical axes are inverted (units ascend from bottom to top but pixel positions ascend from top to bottom). - /// - public bool IsInverted; - - /// - /// Lower edge of the data area (axis units). - /// - public double Min { get; private set; } = double.NaN; - - /// - /// Upper edge of the data area (axis units). - /// - public double Max { get; private set; } = double.NaN; - - /// - /// Limit beyond which the plot cannot be zoomed in - /// - public double OuterBoundaryMin { get; private set; } = double.NegativeInfinity; - - /// - /// Limit beyond which the plot cannot be zoomed in - /// - public double OuterBoundaryMax { get; private set; } = double.PositiveInfinity; - - /// - /// Limit which will always be visible on the data area - /// - public double InnerBoundaryMin { get; private set; } = double.PositiveInfinity; - - /// - /// Limit which will always be visible on the data area - /// - public double InnerBoundaryMax { get; private set; } = double.NegativeInfinity; - - /// - /// Size of the view boundaries. - /// This should always be greater or equal to the Span. - /// - public double SpanBound => OuterBoundaryMax - OuterBoundaryMin; - - /// - /// False until axes are intentionally set. - /// Unset axes default to NaN min/max limits. - /// - public bool HasBeenSet { get; private set; } = false; - - /// - /// True if min or max is NaN. - /// - public bool IsNan => double.IsNaN(Min) || double.IsNaN(Max); - - /// - /// Size of the data area (axis units) - /// - public double Span => Max - Min; - - /// - /// Center of the data area (axis units) - /// - public double Center => (Max + Min) / 2; - - /// - /// Number of pixels for each axis unit - /// - public double PxPerUnit => DataSizePx / Span; - - /// - /// Size of 1 screen pixel in axis units - /// - public double UnitsPerPx => Span / DataSizePx; - - public override string ToString() => - $"Axis ({Min} to {Max}), figure size {FigureSizePx}, data size {DataSizePx}"; - - /// - /// Limit remember/recall is used while mouse dragging - /// - private double MinRemembered = double.NaN; - - /// - /// Limit remember/recall is used while mouse dragging - /// - private double MaxRemembered = double.NaN; - - /// - /// If true, min/max cannot bet set. - /// - private bool LockedLimits = false; - - /// - /// Limit remember/recall is used while mouse dragging - /// - public void Remember() => (MinRemembered, MaxRemembered) = (Min, Max); - - /// - /// Limit remember/recall is used while mouse dragging - /// - public void Recall() => (Min, Max) = (MinRemembered, MaxRemembered); - - /// - /// Return limits that contain no NaNs. - /// NaNs will be replaced with +/- 10. - /// - /// - public (double min, double max) RationalLimits() - { - double min = double.IsNaN(Min) ? -10 : Min; - double max = double.IsNaN(Max) ? 10 : Max; - return (min == max) ? (min - .5, max + .5) : (min, max); - } - - /// - /// Reset the axis as if it were never set. - /// - public void ResetLimits() - { - Min = double.NaN; - Max = double.NaN; - HasBeenSet = false; - } - - /// - /// Resize/reposition this axis according to the given pixel units - /// - public void Resize(float figureSizePx, float? dataSizePx = null, float? dataOffsetPx = null) - { - FigureSizePx = figureSizePx; - DataSizePx = dataSizePx ?? DataSizePx; - DataOffsetPx = dataOffsetPx ?? DataOffsetPx; - } - - /// - /// Set data size and offset based on desired padding between the edge of the figure and data area - /// - public void SetPadding(float padBefore, float padAfter) - { - DataOffsetPx = padBefore; - DataSizePx = FigureSizePx - padBefore - padAfter; - } - - /// - /// Set boundaries beyond which this axis cannot be panned or zoomed - /// - public void SetBoundsOuter(double lower = double.NegativeInfinity, double upper = double.PositiveInfinity) - { - OuterBoundaryMin = lower; - OuterBoundaryMax = upper; - } - - /// - /// Set boundaries beyond which this axis cannot be panned or zoomed - /// - public void SetBoundsInner(double lower = double.NegativeInfinity, double upper = double.PositiveInfinity) - { - InnerBoundaryMin = lower; - InnerBoundaryMax = upper; - } - - /// - /// Modify axis limits such that none extend beyond the boundaries. - /// - private void ApplyBounds() - { - if (Span > SpanBound) - { - Min = OuterBoundaryMin; - Max = OuterBoundaryMax; - return; - } - - if (Min < OuterBoundaryMin) - { - double span = Span; - Min = OuterBoundaryMin; - Max = OuterBoundaryMin + span; - } - - if (Max > OuterBoundaryMax) - { - double span = Span; - Max = OuterBoundaryMax; - Min = OuterBoundaryMax - span; - } - - if (Min > InnerBoundaryMin) - { - Min = InnerBoundaryMin; - } - - if (Max < InnerBoundaryMax) - { - Max = InnerBoundaryMax; - } - } - - /// - /// Set axis limits - /// - public void SetAxis(double? min, double? max) - { - if (LockedLimits) - { - return; - } - - HasBeenSet = true; - Min = min ?? Min; - Max = max ?? Max; - ApplyBounds(); - } - - /// - /// Shift min and max by the given number of units - /// - public void Pan(double units) - { - if (LockedLimits) - { - return; - } - - Min += units; - Max += units; - ApplyBounds(); - } - - /// - /// Shift min and max by the given number of pixels - /// - public void PanPx(float pixels) - { - if (LockedLimits) - { - return; - } - - Pan(pixels * UnitsPerPx); - } - - /// - /// Zoom by simultaneously adjusting Min and Max - /// - /// 1 for no change, 2 zooms in, .5 zooms out. - /// If given, zoom toward/from this alternative center point. - public void Zoom(double frac = 1, double? zoomTo = null) - { - if (LockedLimits) - { - return; - } - - zoomTo ??= Center; - (Min, Max) = RationalLimits(); - double spanLeft = zoomTo.Value - Min; - double spanRight = Max - zoomTo.Value; - Min = zoomTo.Value - spanLeft / frac; - Max = zoomTo.Value + spanRight / frac; - ApplyBounds(); - } - - /// - /// Get the pixel location on the figure for a given position in axis units - /// - public float GetPixel(double unit) - { - double unitsFromMin = IsInverted ? Max - unit : unit - Min; - double pxFromMin = unitsFromMin * PxPerUnit; - double pixel = DataOffsetPx + pxFromMin; - return (float)pixel; - } - - /// - /// Get the axis unit position for the given pixel location on the figure - /// - public double GetUnit(float pixel) - { - double pxFromMin = IsInverted ? DataSizePx + DataOffsetPx - pixel : pixel - DataOffsetPx; - return pxFromMin * UnitsPerPx + Min; - } - - /// - /// Sets a flag indicating whether axis limits are mutable. - /// - public void LockLimits(bool locked = true) - { - LockedLimits = locked; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/AxisLabel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/AxisLabel.cs deleted file mode 100644 index 1e5955de4..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/AxisLabel.cs +++ /dev/null @@ -1,211 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class AxisLabel : IRenderable - { - /// - /// Controls whether this axis occupies space and is displayed - /// - public bool IsVisible { get; set; } = true; - - /// - /// Edge of the data area this axis represents - /// - public Edge Edge; - - /// - /// Axis title - /// - public string Label = null; - - /// - /// Font options for the axis title - /// - public Font Font = new Font() { Size = 16 }; - - /// - /// Set this field to display a bitmap instead of a text axis label - /// - public Bitmap ImageLabel = null; - - /// - /// Padding (in pixels) between the image and the edge of the data area - /// - public float ImagePaddingToDataArea = 5; - - /// - /// Padding (in pixels) between the image and the edge of the figure - /// - public float ImagePaddingToFigureEdge = 5; - - /// - /// Total amount (in pixels) to pad the image when measuring axis size - /// - public float ImagePadding => ImagePaddingToDataArea + ImagePaddingToFigureEdge; - - /// - /// Amount of padding (in pixels) to surround the contents of this axis - /// - public float PixelSizePadding; - - /// - /// Distance to offset this axis to account for multiple axes - /// - public float PixelOffset; - - /// - /// Exact size (in pixels) of the contents of this this axis - /// - public float PixelSize; - - /// - /// Return the size of the contents of this axis. - /// Returned dimensions are screen-accurate (even if this axis is rotated). - /// - /// - public SizeF Measure() - { - if (ImageLabel != null) - { - return (Edge == Edge.Bottom || Edge == Edge.Top) - ? new SizeF(ImageLabel.Width, ImageLabel.Height + ImagePadding) - : new SizeF(ImageLabel.Height, ImageLabel.Width + ImagePadding); - } - else - { - return GDI.MeasureString(Label, Font); - } - } - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - if (IsVisible == false || (string.IsNullOrWhiteSpace(Label) && ImageLabel == null)) - { - return; - } - - using var gfx = GDI.Graphics(bmp, dims, lowQuality, false); - (float x, float y) = GetAxisCenter(dims); - - if (ImageLabel is null) - { - RenderTextLabel(gfx, x, y); - } - else - { - RenderImageLabel(gfx, x, y); - } - } - - private void RenderImageLabel(Graphics gfx, float x, float y) - { - // TODO: use ImagePadding instead of fractional padding - - float xOffset = Edge switch - { - Edge.Left => ImagePaddingToFigureEdge, - Edge.Right => -ImageLabel.Width - ImagePaddingToFigureEdge, - Edge.Bottom => -ImageLabel.Width, - Edge.Top => -ImageLabel.Width, - _ => throw new NotImplementedException() - }; - - float yOffset = Edge switch - { - Edge.Left => -ImageLabel.Height, - Edge.Right => -ImageLabel.Height, - Edge.Bottom => -ImageLabel.Height - ImagePaddingToFigureEdge, - Edge.Top => 0 + ImagePaddingToFigureEdge, - _ => throw new NotImplementedException() - }; - - gfx.TranslateTransform(x, y); - gfx.DrawImage(ImageLabel, xOffset, yOffset); - gfx.ResetTransform(); - } - - private void RenderTextLabel(Graphics gfx, float x, float y) - { - // TODO: should padding be inverted if "bottom or right"? - float padding = (Edge == Edge.Bottom) ? -PixelSizePadding : PixelSizePadding; - - int rotation = Edge switch - { - Edge.Left => -90, - Edge.Right => 90, - Edge.Bottom => 0, - Edge.Top => 0, - _ => throw new NotImplementedException() - }; - - using var font = GDI.Font(Font); - using var brush = GDI.Brush(Font.Color); - using var sf = GDI.StringFormat(HorizontalAlignment.Center, VerticalAlignment.Lower); - sf.LineAlignment = Edge switch - { - Edge.Left => StringAlignment.Near, - Edge.Right => StringAlignment.Near, - Edge.Bottom => StringAlignment.Far, - Edge.Top => StringAlignment.Near, - _ => throw new NotImplementedException() - }; - - gfx.TranslateTransform(x, y); - gfx.RotateTransform(rotation); - gfx.DrawString(Label, font, brush, 0, padding, sf); - gfx.ResetTransform(); - } - - /// - /// Return the point and rotation representing the center of the base of this axis - /// - private (float x, float y) GetAxisCenter(PlotDimensions dims) - { - float x = Edge switch - { - Edge.Left => dims.DataOffsetX - PixelOffset - PixelSize, - Edge.Right => dims.DataOffsetX + dims.DataWidth + PixelOffset + PixelSize, - Edge.Bottom => dims.DataOffsetX + dims.DataWidth / 2, - Edge.Top => dims.DataOffsetX + dims.DataWidth / 2, - _ => throw new NotImplementedException() - }; - - float y = Edge switch - { - Edge.Left => dims.DataOffsetY + dims.DataHeight / 2, - Edge.Right => dims.DataOffsetY + dims.DataHeight / 2, - Edge.Bottom => dims.DataOffsetY + dims.DataHeight + PixelOffset + PixelSize, - Edge.Top => dims.DataOffsetY - PixelOffset - PixelSize, - _ => throw new NotImplementedException() - }; - - return (x, y); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/AxisLine.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/AxisLine.cs deleted file mode 100644 index 64a2fee8c..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/AxisLine.cs +++ /dev/null @@ -1,78 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class AxisLineOptional : IRenderable - { - public bool IsVisible { get; set; } = true; - public Color Color = Color.Black; - public float Width = 1; - public Edge Edge; - public float PixelOffset; - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - if (IsVisible == false) - { - return; - } - - using (var gfx = GDI.Graphics(bmp, dims, lowQuality, false)) - { - using (var pen = GDI.Pen(Color, Width)) - { - float left = dims.DataOffsetX; - float right = dims.DataOffsetX + dims.DataWidth; - float top = dims.DataOffsetY; - float bottom = dims.DataOffsetY + dims.DataHeight; - - if (Edge == Edge.Bottom) - { - gfx.DrawLine(pen, left, bottom + PixelOffset, right, bottom + PixelOffset); - } - else if (Edge == Edge.Left) - { - gfx.DrawLine(pen, left - PixelOffset, bottom, left - PixelOffset, top); - } - else if (Edge == Edge.Right) - { - gfx.DrawLine(pen, right + PixelOffset, bottom, right + PixelOffset, top); - } - else if (Edge == Edge.Top) - { - gfx.DrawLine(pen, left, top - PixelOffset, right, top - PixelOffset); - } - else - { - throw new NotImplementedException(); - } - } - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/AxisTicks.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/AxisTicks.cs deleted file mode 100644 index 6bf841ecc..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/AxisTicks.cs +++ /dev/null @@ -1,121 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -/* The AxisTicks object contains: - * - A TickCollection responsible for calculating tick positions and labels - * - major tick label styling - * - major/minor tick mark styling - * - major/minor grid line styling - */ - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class AxisTicks : IRenderable - { - // the tick collection determines where ticks should go and what tick labels should say - public readonly TickCollection TickCollection = new TickCollection(); - - // tick label styling - public bool TickLabelVisible = true; - public float TickLabelRotation = 0; - public Font TickLabelFont = new Font() { Size = 11 }; - - // major tick/grid styling - public bool MajorTickVisible = true; - public float MajorTickLength = 5; - public Color MajorTickColor = Color.Black; - public bool MajorGridVisible = false; - public LineStyle MajorGridStyle = LineStyle.Solid; - public Color MajorGridColor = ColorTranslator.FromHtml("#efefef"); - public float MajorGridWidth = 1; - - // minor tick/grid styling - public bool MinorTickVisible = true; - public float MinorTickLength = 2; - public Color MinorTickColor = Color.Black; - public bool MinorGridVisible = false; - public LineStyle MinorGridStyle = LineStyle.Solid; - public Color MinorGridColor = ColorTranslator.FromHtml("#efefef"); - public float MinorGridWidth = 1; - - // misc configuration - public Edge Edge; - public bool IsHorizontal => Edge == Edge.Top || Edge == Edge.Bottom; - public bool IsVertical => Edge == Edge.Left || Edge == Edge.Right; - - public bool IsVisible { get; set; } = true; - - public bool RulerMode = false; - public bool SnapPx = true; - public float PixelOffset = 0; - - // TODO: store the TickCollection in the Axis module, not in the Ticks module. - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - if (!IsVisible) - { - return; - } - - using Graphics gfx = GDI.Graphics(bmp, dims, lowQuality, false); - - double[] visibleMajorTicks = TickCollection.GetVisibleMajorTicks(dims) - .Select(t => t.Position) - .ToArray(); - - double[] visibleMinorTicks = TickCollection.GetVisibleMinorTicks(dims) - .Select(t => t.Position) - .ToArray(); - - if (MajorTickVisible) - { - AxisTicksRender.RenderTickMarks(dims, gfx, visibleMajorTicks, RulerMode ? MajorTickLength * 4 : MajorTickLength, MajorTickColor, Edge, PixelOffset); - } - - if (TickLabelVisible) - { - AxisTicksRender.RenderTickLabels(dims, gfx, TickCollection, TickLabelFont, Edge, TickLabelRotation, RulerMode, PixelOffset, MajorTickLength, MinorTickLength); - } - - if (MinorTickVisible) - { - AxisTicksRender.RenderTickMarks(dims, gfx, visibleMinorTicks, MinorTickLength, MinorTickColor, Edge, PixelOffset); - } - - if (MajorGridVisible) - { - AxisTicksRender.RenderGridLines(dims, gfx, visibleMajorTicks, MajorGridStyle, MajorGridColor, MajorGridWidth, Edge); - } - - if (MinorGridVisible) - { - AxisTicksRender.RenderGridLines(dims, gfx, visibleMinorTicks, MinorGridStyle, MinorGridColor, MinorGridWidth, Edge); - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/AxisTicksRender.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/AxisTicksRender.cs deleted file mode 100644 index aa03f4d51..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/AxisTicksRender.cs +++ /dev/null @@ -1,256 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - static class AxisTicksRender - { - private static bool EdgeIsVertical(Edge edge) => (edge == Edge.Left || edge == Edge.Right); - - private static bool EdgeIsHorizontal(Edge edge) => (edge == Edge.Top || edge == Edge.Bottom); - - public static void RenderGridLines(PlotDimensions dims, Graphics gfx, double[] positions, - LineStyle gridLineStyle, Color gridLineColor, float gridLineWidth, Edge edge) - { - if (positions is null || positions.Length == 0 || gridLineStyle == LineStyle.None) - { - return; - } - - // don't draw grid lines on the last pixel to prevent drawing over the data frame - float xEdgeLeft = dims.DataOffsetX + 1; - float xEdgeRight = dims.DataOffsetX + dims.DataWidth - 1; - float yEdgeTop = dims.DataOffsetY + 1; - float yEdgeBottom = dims.DataOffsetY + dims.DataHeight - 1; - - if (EdgeIsVertical(edge)) - { - float x = (edge == Edge.Left) ? dims.DataOffsetX : dims.DataOffsetX + dims.DataWidth; - float x2 = (edge == Edge.Left) ? dims.DataOffsetX + dims.DataWidth : dims.DataOffsetX; - var ys = positions.Select(i => dims.GetPixelY(i)).Where(y => yEdgeTop < y && y < yEdgeBottom); - if (gridLineStyle != LineStyle.None) - { - using (var pen = GDI.Pen(gridLineColor, gridLineWidth, gridLineStyle)) - { - foreach (float y in ys) - { - gfx.DrawLine(pen, x, y, x2, y); - } - } - } - } - - if (EdgeIsHorizontal(edge)) - { - float y = (edge == Edge.Top) ? dims.DataOffsetY : dims.DataOffsetY + dims.DataHeight; - float y2 = (edge == Edge.Top) ? dims.DataOffsetY + dims.DataHeight : dims.DataOffsetY; - var xs = positions.Select(i => dims.GetPixelX(i)).Where(x => xEdgeLeft < x && x < xEdgeRight); - if (gridLineStyle != LineStyle.None) - { - using (var pen = GDI.Pen(gridLineColor, gridLineWidth, gridLineStyle)) - { - foreach (float x in xs) - { - gfx.DrawLine(pen, x, y, x, y2); - } - } - } - } - } - - public static void RenderTickMarks(PlotDimensions dims, Graphics gfx, double[] positions, float tickLength, Color tickColor, Edge edge, float pixelOffset) - { - if (positions is null || positions.Length == 0) - { - return; - } - - if (EdgeIsVertical(edge)) - { - float x = (edge == Edge.Left) ? dims.DataOffsetX - pixelOffset : dims.DataOffsetX + dims.DataWidth + pixelOffset; - float tickDelta = (edge == Edge.Left) ? -tickLength : tickLength; - - var ys = positions.Select(i => dims.GetPixelY(i)); - using (var pen = GDI.Pen(tickColor)) - { - foreach (float y in ys) - { - gfx.DrawLine(pen, x, y, x + tickDelta, y); - } - } - } - - if (EdgeIsHorizontal(edge)) - { - float y = (edge == Edge.Top) ? dims.DataOffsetY - pixelOffset : dims.DataOffsetY + dims.DataHeight + pixelOffset; - float tickDelta = (edge == Edge.Top) ? -tickLength : tickLength; - - var xs = positions.Select(i => dims.GetPixelX(i)); - using (var pen = GDI.Pen(tickColor)) - { - foreach (float x in xs) - { - gfx.DrawLine(pen, x, y, x, y + tickDelta); - } - } - } - } - - public static void RenderTickLabels(PlotDimensions dims, Graphics gfx, TickCollection tc, Font tickFont, Edge edge, float rotation, bool rulerMode, float PixelOffset, float MajorTickLength, float MinorTickLength) - { - if (TickCollectionStorage.tickLabels is null || TickCollectionStorage.tickLabels.Length == 0) - { - return; - } - - using var font = GDI.Font(tickFont); - using var brush = GDI.Brush(tickFont.Color); - using var sf = GDI.StringFormat(); - - Tick[] visibleMajorTicks = tc.GetVisibleMajorTicks(dims); - - switch (edge) - { - case Edge.Bottom: - for (int i = 0; i < visibleMajorTicks.Length; i++) - { - float x = dims.GetPixelX(visibleMajorTicks[i].Position); - float y = dims.DataOffsetY + dims.DataHeight + MajorTickLength; - - gfx.TranslateTransform(x, y); - gfx.RotateTransform(-rotation); - sf.Alignment = rotation == 0 ? StringAlignment.Center : StringAlignment.Far; - if (rulerMode) - { - sf.Alignment = StringAlignment.Near; - } - - sf.LineAlignment = rotation == 0 ? StringAlignment.Near : StringAlignment.Center; - gfx.DrawString(visibleMajorTicks[i].Label, font, brush, 0, 0, sf); - gfx.ResetTransform(); - } - break; - - case Edge.Top: - for (int i = 0; i < visibleMajorTicks.Length; i++) - { - float x = dims.GetPixelX(visibleMajorTicks[i].Position); - float y = dims.DataOffsetY - MajorTickLength; - - gfx.TranslateTransform(x, y); - gfx.RotateTransform(-rotation); - sf.Alignment = rotation == 0 ? StringAlignment.Center : StringAlignment.Near; - if (rulerMode) - { - sf.Alignment = StringAlignment.Near; - } - - sf.LineAlignment = rotation == 0 ? StringAlignment.Far : StringAlignment.Center; - gfx.DrawString(visibleMajorTicks[i].Label, font, brush, 0, 0, sf); - gfx.ResetTransform(); - } - break; - - case Edge.Left: - for (int i = 0; i < visibleMajorTicks.Length; i++) - { - float x = dims.DataOffsetX - PixelOffset - MajorTickLength; - float y = dims.GetPixelY(visibleMajorTicks[i].Position); - - gfx.TranslateTransform(x, y); - gfx.RotateTransform(-rotation); - sf.Alignment = StringAlignment.Far; - sf.LineAlignment = rulerMode ? StringAlignment.Far : StringAlignment.Center; - if (rotation == 90) - { - sf.Alignment = StringAlignment.Center; - sf.LineAlignment = StringAlignment.Far; - } - gfx.DrawString(visibleMajorTicks[i].Label, font, brush, 0, 0, sf); - gfx.ResetTransform(); - } - break; - - case Edge.Right: - for (int i = 0; i < visibleMajorTicks.Length; i++) - { - float x = dims.DataOffsetX + PixelOffset + MajorTickLength + dims.DataWidth; - float y = dims.GetPixelY(visibleMajorTicks[i].Position); - - gfx.TranslateTransform(x, y); - gfx.RotateTransform(-rotation); - sf.Alignment = StringAlignment.Near; - sf.LineAlignment = rulerMode ? StringAlignment.Far : StringAlignment.Center; - if (rotation == 90) - { - sf.Alignment = StringAlignment.Center; - sf.LineAlignment = StringAlignment.Near; - } - gfx.DrawString(visibleMajorTicks[i].Label, font, brush, 0, 0, sf); - gfx.ResetTransform(); - } - break; - - default: - throw new NotImplementedException($"unsupported edge type {edge}"); - } - - if (!string.IsNullOrWhiteSpace(tc.CornerLabel)) - { - switch (edge) - { - case Edge.Bottom: - sf.Alignment = StringAlignment.Far; - sf.LineAlignment = StringAlignment.Near; - gfx.DrawString(s: $"\n{tc.CornerLabel}", - x: dims.DataOffsetX + dims.DataWidth, - y: dims.DataOffsetY + dims.DataHeight + MajorTickLength, - font: font, brush: brush, format: sf); - break; - - case Edge.Left: - sf.Alignment = StringAlignment.Near; - sf.LineAlignment = StringAlignment.Far; - gfx.DrawString(s: $"\n{tc.CornerLabel}", - x: dims.DataOffsetX, - y: dims.DataOffsetY, - font: font, brush: brush, format: sf); - break; - - case Edge.Top: - throw new NotImplementedException("multiplier and offset notation is not supported for right and top axes"); - - case Edge.Right: - throw new NotImplementedException("multiplier and offset notation is not supported for right and top axes"); - - default: - throw new NotImplementedException($"unsupported edge type {edge}"); - } - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/DataBackground.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/DataBackground.cs deleted file mode 100644 index 83c417a23..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/DataBackground.cs +++ /dev/null @@ -1,47 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class DataBackground : IRenderable - { - public Color Color { get; set; } = Color.White; - public bool IsVisible { get; set; } = true; - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - using (var gfx = GDI.Graphics(bmp, dims, lowQuality: true, false)) - { - using (var brush = GDI.Brush(Color)) - { - var dataRect = new RectangleF(x: dims.DataOffsetX, y: dims.DataOffsetY, width: dims.DataWidth, height: dims.DataHeight); - gfx.FillRectangle(brush, dataRect); - } - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/DefaultAxes.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/DefaultAxes.cs deleted file mode 100644 index bc7c79e8e..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/DefaultAxes.cs +++ /dev/null @@ -1,117 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class DefaultBottomAxis : Axis - { - public DefaultBottomAxis() - { - Edge = Edge.Bottom; - Grid(true); - } - } - - public class DefaultTopAxis : Axis - { - public DefaultTopAxis() - { - Edge = Edge.Top; - AxisIndex = 1; - Grid(false); - Ticks(false); - } - } - - public class DefaultLeftAxis : Axis - { - public DefaultLeftAxis() - { - Edge = Edge.Left; - Grid(true); - } - } - - public class DefaultRightAxis : Axis - { - public DefaultRightAxis() - { - Edge = Edge.Right; - AxisIndex = 1; - Grid(false); - Ticks(false); - } - } - - public class AdditionalRightAxis : Axis - { - public AdditionalRightAxis(int yAxisIndex, string title) - { - Edge = Edge.Right; - AxisIndex = yAxisIndex; - Grid(false); - Ticks(true); - Label(title); - } - } - - public class AdditionalLeftAxis : Axis - { - public AdditionalLeftAxis(int yAxisIndex, string title) - { - Edge = Edge.Left; - AxisIndex = yAxisIndex; - Grid(false); - Ticks(true); - Label(title); - } - } - - public class AdditionalTopAxis : Axis - { - public AdditionalTopAxis(int xAxisIndex, string title) - { - Edge = Edge.Top; - AxisIndex = xAxisIndex; - Grid(false); - Ticks(true); - Label(title); - } - } - - public class AdditionalBottomAxis : Axis - { - public AdditionalBottomAxis(int xAxisIndex, string title) - { - Edge = Edge.Bottom; - AxisIndex = xAxisIndex; - Grid(false); - Ticks(true); - Label(title); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/Edge.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/Edge.cs deleted file mode 100644 index 9046a6c0a..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/Edge.cs +++ /dev/null @@ -1,31 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public enum Edge { Left, Right, Bottom, Top }; -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/FigureBackground.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/FigureBackground.cs deleted file mode 100644 index 31a409460..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/FigureBackground.cs +++ /dev/null @@ -1,43 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class FigureBackground : IRenderable - { - public Color Color { get; set; } = Color.White; - public bool IsVisible { get; set; } = true; - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - using (var gfx = GDI.Graphics(bmp, dims, lowQuality: true, false)) - { - gfx.Clear(Color); - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/IRenderable.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/IRenderable.cs deleted file mode 100644 index 784e0eedc..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/IRenderable.cs +++ /dev/null @@ -1,38 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// A "renderable" is any object which can be drawn on the figure. - /// - public interface IRenderable - { - bool IsVisible { get; set; } - void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/Legend.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/Legend.cs deleted file mode 100644 index 52f60f6ba..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/Legend.cs +++ /dev/null @@ -1,252 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Legend : IRenderable - { - public Alignment Location = Alignment.LowerRight; - public bool FixedLineWidth = false; - public bool ReverseOrder = false; - public bool AntiAlias = true; - public bool IsVisible { get; set; } = false; - - public Color FillColor = Color.White; - public Color OutlineColor = Color.Black; - public Color ShadowColor = Color.FromArgb(50, Color.Black); - public float ShadowOffsetX = 2; - public float ShadowOffsetY = 2; - - public Font Font = new Font(); - public string FontName { set => Font.Name = value; } - public float FontSize { set => Font.Size = value; } - public Color FontColor { set => Font.Color = value; } - public bool FontBold { set => Font.Bold = value; } - - public float Padding = 5; - private float SymbolWidth => 40 * Font.Size / 12; - private float SymbolPad => Font.Size / 3; - private float MarkerWidth => Font.Size / 2; - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - if (IsVisible is false || LegendItems is null || LegendItems.Length == 0) - { - return; - } - - using (var gfx = GDI.Graphics(bmp, dims, lowQuality, false)) - { - using (var font = GDI.Font(Font)) - { - var (maxLabelWidth, maxLabelHeight, width, height) = GetDimensions(gfx, LegendItems, font); - var (x, y) = GetLocationPx(dims, width, height); - RenderOnBitmap(gfx, LegendItems, font, x, y, width, height, maxLabelHeight); - } - } - } - - public Bitmap GetBitmap(bool lowQuality = false, double scale = 1.0) - { - if (LegendItems is null) - { - throw new InvalidOperationException("must render the plot at least once before getting the legend bitmap"); - } - - if (LegendItems.Length == 0) - { - throw new InvalidOperationException("The legend is empty (there are no visible plot objects with a label)"); - } - - // use a temporary bitmap and graphics (without scaling) to measure how large the final image should be - using var tempBitmap = new Bitmap(1, 1); - using var tempGfx = GDI.Graphics(tempBitmap, lowQuality, scale); - using var legendFont = GDI.Font(Font); - var (maxLabelWidth, maxLabelHeight, totalLabelWidth, totalLabelHeight) = GetDimensions(tempGfx, LegendItems, legendFont); - - // create the actual legend bitmap based on the scaled measured size - int width = (int)(totalLabelWidth * scale); - int height = (int)(totalLabelHeight * scale); - Bitmap bmp = new(width, height, PixelFormat.Format32bppPArgb); - using var gfx = GDI.Graphics(bmp, lowQuality, scale); - RenderOnBitmap(gfx, LegendItems, legendFont, 0, 0, totalLabelWidth, totalLabelHeight, maxLabelHeight); - - return bmp; - } - - private (float maxLabelWidth, float maxLabelHeight, float width, float height) - GetDimensions(Graphics gfx, LegendItem[] items, System.Drawing.Font font) - { - // determine maximum label size and use it to define legend size - float maxLabelWidth = 0; - float maxLabelHeight = 0; - for (int i = 0; i < items.Length; i++) - { - var labelSize = gfx.MeasureString(items[i].label, font); - maxLabelWidth = Math.Max(maxLabelWidth, labelSize.Width); - maxLabelHeight = Math.Max(maxLabelHeight, labelSize.Height); - } - - float width = SymbolWidth + maxLabelWidth + SymbolPad; - float height = maxLabelHeight * items.Length; - - return (maxLabelWidth, maxLabelHeight, width, height); - } - - private void RenderOnBitmap(Graphics gfx, LegendItem[] items, System.Drawing.Font font, - float locationX, float locationY, float width, float height, float maxLabelHeight, - bool shadow = true, bool outline = true) - { - using (var fillBrush = new SolidBrush(FillColor)) - { - using (var shadowBrush = new SolidBrush(ShadowColor)) - { - using (var textBrush = new SolidBrush(Font.Color)) - { - using (var outlinePen = new Pen(OutlineColor)) - { - RectangleF rectShadow = new RectangleF(locationX + ShadowOffsetX, locationY + ShadowOffsetY, width, height); - RectangleF rectFill = new RectangleF(locationX, locationY, width, height); - - if (shadow) - { - gfx.FillRectangle(shadowBrush, rectShadow); - } - - gfx.FillRectangle(fillBrush, rectFill); - - if (outline) - { - gfx.DrawRectangle(outlinePen, Rectangle.Round(rectFill)); - } - - for (int i = 0; i < items.Length; i++) - { - var item = items[i]; - float verticalOffset = i * maxLabelHeight; - - // draw text - gfx.DrawString(item.label, font, textBrush, locationX + SymbolWidth, locationY + verticalOffset); - - // prepare values for drawing a line - outlinePen.Color = item.color; - outlinePen.Width = 1; - float lineY = locationY + verticalOffset + maxLabelHeight / 2; - float lineX1 = locationX + SymbolPad; - float lineX2 = lineX1 + SymbolWidth - SymbolPad * 2; - - // prepare values for drawing a rectangle - PointF rectOrigin = new PointF(lineX1, (float)(lineY - item.lineWidth / 2)); - SizeF rectSize = new SizeF(lineX2 - lineX1, (float)item.lineWidth); - RectangleF rect = new RectangleF(rectOrigin, rectSize); - - if (item.IsRectangle) - { - // draw a rectangle - using (var legendItemFillBrush = GDI.Brush(item.color, item.hatchColor, item.hatchStyle)) - { - using (var legendItemOutlinePen = new Pen(item.borderColor, item.borderWith)) - { - gfx.FillRectangle(legendItemFillBrush, rect); - gfx.DrawRectangle(legendItemOutlinePen, rect.X, rect.Y, rect.Width, rect.Height); - } - } - } - else - { - // draw a line - if (item.lineWidth > 0 && item.lineStyle != LineStyle.None) - { - using var linePen = GDI.Pen(item.color, item.lineWidth, item.lineStyle, false); - gfx.DrawLine(linePen, lineX1, lineY, lineX2, lineY); - } - - // and perhaps a marker in the middle of the line - float lineXcenter = (lineX1 + lineX2) / 2; - PointF markerPoint = new PointF(lineXcenter, lineY); - if ((item.markerShape != MarkerShape.None) && (item.markerSize > 0)) - { - MarkerTools.DrawMarker(gfx, markerPoint, item.markerShape, MarkerWidth, item.color); - } - } - } - } - } - } - } - } - - private LegendItem[] LegendItems; - public void UpdateLegendItems(IPlottable[] renderables) - { - LegendItems = renderables.Where(x => x.GetLegendItems() != null) - .Where(x => x.IsVisible) - .SelectMany(x => x.GetLegendItems()) - .Where(x => !string.IsNullOrWhiteSpace(x.label)) - .ToArray(); - if (ReverseOrder) - { - Array.Reverse(LegendItems); - } - } - - private (float x, float y) GetLocationPx(PlotDimensions dims, float width, float height) - { - float leftX = dims.DataOffsetX + Padding; - float rightX = dims.DataOffsetX + dims.DataWidth - Padding - width; - float centerX = dims.DataOffsetX + dims.DataWidth / 2 - width / 2; - - float topY = dims.DataOffsetY + Padding; - float bottomY = dims.DataOffsetY + dims.DataHeight - Padding - height; - float centerY = dims.DataOffsetY + dims.DataHeight / 2 - height / 2; - - switch (Location) - { - case Alignment.UpperLeft: - return (leftX, topY); - case Alignment.UpperCenter: - return (centerX, topY); - case Alignment.UpperRight: - return (rightX, topY); - case Alignment.MiddleRight: - return (rightX, centerY); - case Alignment.LowerRight: - return (rightX, bottomY); - case Alignment.LowerCenter: - return (centerX, bottomY); - case Alignment.LowerLeft: - return (leftX, bottomY); - case Alignment.MiddleLeft: - return (leftX, centerY); - case Alignment.MiddleCenter: - return (centerX, centerY); - default: - throw new NotImplementedException(); - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/Message.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/Message.cs deleted file mode 100644 index 73f4f2bf6..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/Message.cs +++ /dev/null @@ -1,146 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class BenchmarkMessage : Message - { - private readonly Stopwatch Sw = new Stopwatch(); - public double MSec => Sw.ElapsedTicks * 1000.0 / Stopwatch.Frequency; - public double Hz => (MSec > 0) ? 1000.0 / MSec : 0; - public string Message => $"Rendered in {MSec:00.00} ms ({Hz:0000.00} Hz)"; - - public void Restart() => Sw.Restart(); - public void Stop() - { - Sw.Stop(); - Text = Message; - } - - public BenchmarkMessage() - { - HAlign = HorizontalAlignment.Left; - VAlign = VerticalAlignment.Lower; - FontColor = Color.Black; - FillColor = Color.FromArgb(200, Color.Yellow); - BorderColor = Color.Black; - } - } - - public class ErrorMessage : Message - { - public ErrorMessage() - { - HAlign = HorizontalAlignment.Left; - VAlign = VerticalAlignment.Upper; - FontColor = Color.Black; - FillColor = Color.FromArgb(50, Color.Red); - BorderColor = Color.Black; - } - } - - public class Message : IRenderable - { - public string Text; - - public HorizontalAlignment HAlign; - public VerticalAlignment VAlign; - - public Color FontColor = Color.Black; - public string FontName = InstalledFont.Monospace(); - public float FontSize = 12; - public bool FontBold = false; - - public Color FillColor = Color.LightGray; - public Color BorderColor = Color.Black; - public float BorderWidth = 1; - - public float Padding = 3; - - public bool IsVisible { get; set; } = false; - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - if (!IsVisible || string.IsNullOrWhiteSpace(Text)) - { - return; - } - - using (var gfx = GDI.Graphics(bmp, dims, lowQuality, false)) - { - using (var font = GDI.Font(FontName, FontSize, FontBold)) - { - using (var fontBrush = new SolidBrush(FontColor)) - { - using (var fillBrush = new SolidBrush(FillColor)) - { - using (var borderPen = new Pen(BorderColor, BorderWidth)) - { - SizeF textSize = GDI.MeasureString(gfx, Text, font); - float textHeight = textSize.Height; - float textWidth = textSize.Width; - - float textY = 0; - if (VAlign == VerticalAlignment.Upper) - { - textY = dims.DataOffsetY + Padding; - } - else if (VAlign == VerticalAlignment.Middle) - { - textY = dims.DataOffsetY + dims.DataHeight / 2 - textHeight / 2; - } - else if (VAlign == VerticalAlignment.Lower) - { - textY = dims.DataOffsetY + dims.DataHeight - textHeight - Padding; - } - - float textX = 0; - if (HAlign == HorizontalAlignment.Left) - { - textX = dims.DataOffsetX + Padding; - } - else if (HAlign == HorizontalAlignment.Center) - { - textX = dims.DataOffsetX + dims.DataWidth / 2 - textWidth / 2; - } - else if (HAlign == HorizontalAlignment.Right) - { - textX = dims.DataOffsetX + dims.DataWidth - textWidth - Padding; - } - - RectangleF textRect = new RectangleF(textX, textY, textWidth, textHeight); - gfx.FillRectangle(fillBrush, textRect); - gfx.DrawRectangle(borderPen, Rectangle.Round(textRect)); - gfx.DrawString(Text, font, fontBrush, textX, textY); - } - } - } - } - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/ZoomRectangle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/ZoomRectangle.cs deleted file mode 100644 index d215ccc22..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Renderable/ZoomRectangle.cs +++ /dev/null @@ -1,66 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class ZoomRectangle : IRenderable - { - private float X; - private float Y; - private float Width; - private float Height; - - public Color FillColor { get; set; } = Color.FromArgb(50, Color.Red); - public Color BorderColor { get; set; } = Color.FromArgb(100, Color.Red); - public bool IsVisible { get; set; } = true; - - public void Clear() => IsVisible = false; - - public void Set(float x, float y, float width, float height) => - (X, Y, Width, Height, IsVisible) = (x, y, width, height, true); - - public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) - { - if (!IsVisible) - { - return; - } - - using (var gfx = GDI.Graphics(bmp, dims, lowQuality: true, false)) - { - using (var fillBrush = GDI.Brush(FillColor)) - { - using (var borderPen = GDI.Pen(BorderColor)) - { - gfx.FillRectangle(fillBrush, X + dims.DataOffsetX, Y + dims.DataOffsetY, Width, Height); - gfx.DrawRectangle(borderPen, X + dims.DataOffsetX, Y + dims.DataOffsetY, Width, Height); - } - } - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/BasicStats.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/BasicStats.cs deleted file mode 100644 index f506ffe14..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/BasicStats.cs +++ /dev/null @@ -1,59 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class BasicStats - { - public readonly int Count; - public readonly double Min; - public readonly double Max; - public readonly double Sum; - public readonly double Mean; - public readonly double StDev; - public readonly double StdErr; - - public BasicStats(double[] values) - { - if (values is null) - { - throw new ArgumentNullException(); - } - - if (values.Length == 0) - { - throw new ArgumentException("input cannot be empty"); - } - - Count = values.Length; - (Min, Max, Sum) = Common.MinMaxSum(values); - Mean = Sum / Count; - StDev = Common.StDev(values, Mean); - StdErr = StDev / Math.Sqrt(Count); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Common.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Common.cs deleted file mode 100644 index 5fc76551f..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Common.cs +++ /dev/null @@ -1,461 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public static class Common - { - private readonly static RNGCryptoServiceProvider Rand = new(); - - /// - /// Return the minimum, and maximum, and sum of a given array. - /// - public static (double min, double max, double sum) MinMaxSum(double[] values) - { - if (values is null) - { - throw new ArgumentNullException(nameof(values)); - } - - if (values.Length == 0) - { - throw new ArgumentException("input cannot be empty"); - } - - double min = double.MaxValue; - double max = double.MinValue; - double sum = 0; - - for (int i = 0; i < values.Length; i++) - { - min = Math.Min(min, values[i]); - max = Math.Max(max, values[i]); - sum += values[i]; - } - - return (min, max, sum); - } - - /// - /// Return the standard deviation of the given values. - /// - public static double StDev(double[] values) => StDev(values, Mean(values)); - - /// - /// Return the standard deviation of the given values. - /// This overload is faster because the mean of the values is provided. - /// - public static double StDev(double[] values, double mean) - { - double sumVariancesSquared = 0; - for (int i = 0; i < values.Length; i++) - { - double pointVariance = Math.Abs(mean - values[i]); - double pointVarianceSquared = Math.Pow(pointVariance, 2); - sumVariancesSquared += pointVarianceSquared; - } - double meanVarianceSquared = sumVariancesSquared / values.Length; - double stDev = Math.Sqrt(meanVarianceSquared); - return stDev; - } - - /// - /// Return the standard error of the given values - /// - public static double StdErr(double[] values) => StDev(values) / Math.Sqrt(values.Length); - - /// - /// Return the mean of the given values - /// - public static double Mean(double[] values) - { - double sum = 0; - for (int i = 0; i < values.Length; i++) - { - sum += values[i]; - } - - double mean = sum / values.Length; - return mean; - } - - /// - /// Return the Nth smallest value in the given array. - /// - public static double NthOrderStatistic(double[] values, int n) - { - if (n < 1 || n > values.Length) - { - throw new ArgumentException("n must be a number from 1 to the length of the array"); - } - - double[] valuesCopy = new double[values.Length]; - Array.Copy(values, valuesCopy, values.Length); - return QuickSelect(valuesCopy, 0, values.Length - 1, n - 1); - } - - /// - /// Return the value of the Nth quantile. - /// - public static double Quantile(double[] values, int n, int quantileCount) - { - if (n == 0) - { - return values.Min(); - } - else if (n == quantileCount) - { - return values.Max(); - } - else - { - return NthOrderStatistic(values, n * values.Length / quantileCount); - } - } - - /// - /// Return the value of the Nth quartile - /// - /// - /// quartile 1, 2, or 3 - public static double Quartile(double[] values, int quartile) => Quantile(values, quartile, 4); - - /// - /// Return the percentile of the given array - /// - /// - /// number from 0 to 100 - /// - public static double Percentile(double[] values, int percentile) => Quantile(values, percentile, 100); - - /// - /// Return the percentile of the given array - /// - /// - /// number from 0 to 100 - public static double Percentile(double[] values, double percentile) - { - if (percentile == 0) - { - return values.Min(); - } - else if (percentile == 100) - { - return values.Max(); - } - - int percentileIndex = (int)(percentile / 100.0 * (values.Length - 1)); - - double[] copiedValues = new double[values.Length]; - Array.Copy(values, copiedValues, values.Length); - return NthOrderStatistic(values, percentileIndex + 1); - } - - /// - /// Return the median of the given array. - /// If the length of the array is even, this value is the mean of the upper and lower medians. - /// - public static double Median(double[] values) - { - if (values.Length % 2 == 1) - { - return NthOrderStatistic(values, values.Length / 2 + 1); - } - else - { - double lowerMedian = NthOrderStatistic(values, values.Length / 2); - double upperMedian = NthOrderStatistic(values, values.Length / 2 + 1); - return (lowerMedian + upperMedian) / 2; - } - } - - /// - /// Return the kth smallest value from a range of the given array. - /// WARNING: values will be mutated. - /// - /// - /// inclusive lower bound - /// inclusive upper bound - /// number starting at 0 - /// - private static double QuickSelect(double[] values, int leftIndex, int rightIndex, int k) - { - /* - * QuickSelect (aka Hoare's Algorithm) is a selection algorithm - * - Given an integer k it returns the kth smallest element in a sequence) with O(n) expected time. - * - In the worst case it is O(n^2), i.e. when the chosen pivot is always the max or min at each call. - * - The use of a random pivot virtually assures linear time performance. - * - https://en.wikipedia.org/wiki/Quickselect - */ - - if (leftIndex == rightIndex) - { - return values[leftIndex]; - } - - if (k == 0) - { - double min = values[leftIndex]; - for (int j = leftIndex; j <= rightIndex; j++) - { - if (values[j] < min) - { - min = values[j]; - } - } - - return min; - } - - if (k == rightIndex - leftIndex) - { - double max = values[leftIndex]; - for (int j = leftIndex; j <= rightIndex; j++) - { - if (values[j] > max) - { - max = values[j]; - } - } - - return max; - } - - int partitionIndex = Partition(values, leftIndex, rightIndex); - int pivotIndex = partitionIndex - leftIndex; - - if (k == pivotIndex) - { - return values[partitionIndex]; - } - else if (k < pivotIndex) - { - return QuickSelect(values, leftIndex, partitionIndex - 1, k); - } - else - { - return QuickSelect(values, partitionIndex + 1, rightIndex, k - pivotIndex - 1); - } - } - - /// - /// Return a random integer from within the given range - /// - /// inclusive lower bound - /// exclusive upper bound - /// - public static int GetRandomInt(int min, int max) - { - byte[] randomBytes = new byte[sizeof(int)]; - Rand.GetBytes(randomBytes); - int randomInt = BitConverter.ToInt32(randomBytes, 0); - return Math.Abs(randomInt % (max - min + 1)) + min; - } - - /// - /// Partition the array between the defined bounds according to elements above and below a randomly chosen pivot value - /// - /// - /// - /// - /// index of the pivot used - private static int Partition(double[] values, int leftIndex, int rightIndex) - { - // Moving the pivot to the end is far easier than handling it where it is - // This also allows you to turn this into the non-randomized Partition - int initialPivotIndex = GetRandomInt(leftIndex, rightIndex); - double swap = values[initialPivotIndex]; - values[initialPivotIndex] = values[rightIndex]; - values[rightIndex] = swap; - - double pivotValue = values[rightIndex]; - - int pivotIndex = leftIndex - 1; - for (int j = leftIndex; j < rightIndex; j++) - { - if (values[j] <= pivotValue) - { - pivotIndex++; - double tmp1 = values[j]; - values[j] = values[pivotIndex]; - values[pivotIndex] = tmp1; - } - } - - pivotIndex++; - double tmp2 = values[rightIndex]; - values[rightIndex] = values[pivotIndex]; - values[pivotIndex] = tmp2; - - return pivotIndex; - } - - /// - /// Given a dataset of values return the probability density function. - /// The returned function is a Gaussian curve from 0 to 1 (not normalized) - /// - /// original dataset - /// Function to return Y for a given X - public static Func ProbabilityDensityFunction(double[] values) - { - var stats = new BasicStats(values); - return x => Math.Exp(-.5 * Math.Pow((x - stats.Mean) / stats.StDev, 2)); - } - - /// - /// Given a dataset of values return the probability density function at specific X positions. - /// Returned values will be normalized such that their integral is 1. - /// - /// original dataset - /// Positions (Xs) for which probabilities (Ys) will be returned - /// if True, output will be multiplied by 100 - /// Densities (Ys) for each of the given Xs - public static double[] ProbabilityDensity(double[] values, double[] xs, bool percent = false) - { - var f = ProbabilityDensityFunction(values); -#pragma warning disable CS8629 // Nullable value type may be null. - double[] ys = xs.Select(x => (double)f(x)).ToArray(); -#pragma warning restore CS8629 // Nullable value type may be null. - double sum = ys.Sum(); - if (percent) - { - sum /= 100; - } - - for (int i = 0; i < ys.Length; i++) - { - ys[i] /= sum; - } - - return ys; - } - - /// - /// Return the cumulative sum of the given data - /// - /// - /// - public static double[] CumulativeSum(double[] values) - { - double[] sum = new double[values.Length]; - - sum[0] = values[0]; - - for (int i = 1; i < values.Length; i++) - { - sum[i] = sum[i - 1] + values[i]; - } - - return sum; - } - - /// - /// Compute the histogram of a dataset. - /// - /// Input data - /// Lower edge of the first bin (inclusive). If NaN, minimum of input values will be used. - /// High edge of the largest bin (inclusive). If NaN, maximum of input values will be used. - /// Width of each bin. - /// If False, the result will contain the number of samples in each bin. If True, the result is the value of the probability density function at the bin (the sum of all values will be 1 if the bin size is 1). - public static (double[] hist, double[] binEdges) Histogram(double[] values, double min, double max, double binSize, bool density = false) - { - int binCount = (int)((max - min) / binSize); - return Histogram(values, binCount, density, min, max); - } - - /// - /// Compute the histogram of a dataset. - /// - /// Input data - /// Number of equal-width bins - /// If False, the result will contain the number of samples in each bin. If True, the result is the value of the probability density function at the bin (the sum of all values will be 1 if the bin size is 1). - /// Lower edge of the first bin (inclusive). If NaN, minimum of input values will be used. - /// High edge of the largest bin (inclusive). If NaN, maximum of input values will be used. - /// - public static (double[] hist, double[] binEdges) Histogram(double[] values, int binCount, bool density = false, double min = double.NaN, double max = double.NaN) - { - /* note: function signature loosely matches numpy: - * https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - */ - - // determine min/max based on the data (if not provided) - if (double.IsNaN(min) || double.IsNaN(max)) - { - var stats = new BasicStats(values); - if (double.IsNaN(min)) - { - min = stats.Min; - } - - if (double.IsNaN(max)) - { - max = stats.Max; - } - } - - // create evenly sized bins - double binWidth = (max - min) / binCount; - double[] binEdges = new double[binCount + 1]; - for (int i = 0; i < binEdges.Length; i++) - { - binEdges[i] = min + binWidth * i; - } - - // place values in histogram - double[] hist = new double[binCount]; - for (int i = 0; i < values.Length; i++) - { - if (values[i] < min || values[i] > max) - { - continue; - } - - if (values[i] == max) - { - hist[hist.Length - 1] += 1; - continue; - } - - double distanceFromMin = values[i] - min; - int binsFromMin = (int)(distanceFromMin / binWidth); - hist[binsFromMin] += 1; - } - - // optionally normalize the data - if (density) - { - double binScale = hist.Sum() * binWidth; - for (int i = 0; i < hist.Length; i++) - { - hist[i] /= binScale; - } - } - - return (hist, binEdges); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Finance.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Finance.cs deleted file mode 100644 index d915f0010..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Finance.cs +++ /dev/null @@ -1,170 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public static class Finance - { - /// - /// Simple moving average - /// - /// number of values to use for each calculation - /// number of values to use for each calculation - /// only return data where values are present for the whole period - public static double[] SMA(double[] values, int period, bool trimNan = true) - { - if (period < 2) - { - throw new ArgumentException("period must be 2 or greater"); - } - - if (period > values.Length) - { - throw new ArgumentException("period cannot be longer than number of values"); - } - - double[] sma = new double[values.Length]; - for (int i = 0; i < values.Length; i++) - { - if (i < period) - { - sma[i] = double.NaN; - } - else - { - // TODO: could optimize this for perforance by not copying - // to do this create a Common.Mean overload - var periodValues = new double[period]; - Array.Copy(values, i - period + 1, periodValues, 0, period); - sma[i] = Common.Mean(periodValues); - } - } - - return trimNan ? sma.Skip(period).ToArray() : sma; - } - - /// - /// Simple moving standard deviation - /// - /// - /// number of values to use for each calculation - public static double[] SMStDev(double[] values, int period) - { - if (period < 2) - { - throw new ArgumentException("period must be 2 or greater"); - } - - if (period > values.Length) - { - throw new ArgumentException("period cannot be longer than number of values"); - } - - double[] stDev = new double[values.Length]; - for (int i = 0; i < values.Length; i++) - { - if (i < period) - { - stDev[i] = double.NaN; - continue; - } - else - { - var periodValues = new double[period]; - Array.Copy(values, i - period + 1, periodValues, 0, period); - stDev[i] = Common.StDev(periodValues); - } - } - return stDev; - } - - /// - /// Return the simple moving average (SMA) of the OHLC closing prices. - /// The returned data will be shorter than the input data by N points. - /// - /// price data to analyze - /// each returned price represents the average of N prices - public static double[] SMA(OHLC[] ohlcs, int N) - { - double[] closingPrices = new double[ohlcs.Length]; - for (int i = 0; i < ohlcs.Length; i++) - { - closingPrices[i] = ohlcs[i].Close; - } - - return SMA(closingPrices, N); - } - - /// - /// Return the SMA and upper/lower Bollinger bands for the given price data. - /// The returned data will NOT be shorter than the input data. It will contain NaN values at the front. - /// - /// price data to use for analysis - /// each returned price represents the average of N prices - /// number of standard deviations from the mean to use for the Bollinger bands - public static (double[] sma, double[] lower, double[] upper) Bollinger(double[] prices, int N, double sdCoeff = 2) - { - double[] sma = SMA(prices, N, trimNan: false); - double[] smstd = SMStDev(prices, N); - - double[] bolU = new double[prices.Length]; - double[] bolL = new double[prices.Length]; - for (int i = 0; i < prices.Length; i++) - { - bolL[i] = sma[i] - sdCoeff * smstd[i]; - bolU[i] = sma[i] + sdCoeff * smstd[i]; - } - - return (sma, bolL, bolU); - } - - /// - /// Return the SMA and upper/lower Bollinger bands for the closing price of the given OHLCs. - /// The returned data will be shorter than the input data by N values. - /// - /// price data to use for analysis - /// each returned price represents the average of N prices - /// number of standard deviations from the mean to use for the Bollinger bands - public static (double[] sma, double[] lower, double[] upper) Bollinger(OHLC[] ohlcs, int N, double sdCoeff = 2) - { - double[] closingPrices = new double[ohlcs.Length]; - for (int i = 0; i < ohlcs.Length; i++) - { - closingPrices[i] = ohlcs[i].Close; - } - - var (sma, lower, upper) = Bollinger(closingPrices, N, sdCoeff); - - // skip the first points which all contain NaN - sma = sma.Skip(N).ToArray(); - lower = lower.Skip(N).ToArray(); - upper = upper.Skip(N).ToArray(); - - return (sma, lower, upper); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Interpolation/EndSlopeSpline.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Interpolation/EndSlopeSpline.cs deleted file mode 100644 index 173538d40..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Interpolation/EndSlopeSpline.cs +++ /dev/null @@ -1,113 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// The End Slope Spline is a Natural Spline whose first and last point slopes can be defined - /// - public class EndSlopeSpline : SplineInterpolator - { - public EndSlopeSpline(double[] xs, double[] ys, - int resolution = 10, double firstSlopeDegrees = 0, double lastSlopeDegrees = 0) : - base(xs, ys, resolution) - { - m = new Matrix(n); - gauss = new MatrixSolver(n, m); - - a = new double[n]; - b = new double[n]; - c = new double[n]; - d = new double[n]; - h = new double[n]; - - CalcParameters(firstSlopeDegrees, lastSlopeDegrees); - Integrate(); - Interpolate(); - } - - public void CalcParameters(double alpha, double beta) - { - for (int i = 0; i < n; i++) - { - a[i] = givenYs[i]; - } - - for (int i = 0; i < n - 1; i++) - { - h[i] = givenXs[i + 1] - givenXs[i]; - } - - m.a[0, 0] = 2.0 * h[0]; - m.a[0, 1] = h[0]; - m.y[0] = 3 * ((a[1] - a[0]) / h[0] - Math.Tan(alpha * Math.PI / 180)); - - for (int i = 0; i < n - 2; i++) - { - m.a[i + 1, i] = h[i]; - m.a[i + 1, i + 1] = 2.0 * (h[i] + h[i + 1]); - if (i < n - 2) - { - m.a[i + 1, i + 2] = h[i + 1]; - } - - if ((h[i] != 0.0) && (h[i + 1] != 0.0)) - { - m.y[i + 1] = ((a[i + 2] - a[i + 1]) / h[i + 1] - (a[i + 1] - a[i]) / h[i]) * 3.0; - } - else - { - m.y[i + 1] = 0.0; - } - } - - m.a[n - 1, n - 2] = h[n - 2]; - m.a[n - 1, n - 1] = 2.0 * h[n - 2]; - m.y[n - 1] = 3.0 * (Math.Tan(beta * Math.PI / 180) - (a[n - 1] - a[n - 2]) / h[n - 2]); - - if (gauss.Eliminate() == false) - { - throw new InvalidOperationException(); - } - - gauss.Solve(); - - for (int i = 0; i < n; i++) - { - c[i] = m.x[i]; - } - for (int i = 0; i < n; i++) - { - if (h[i] != 0.0) - { - d[i] = 1.0 / 3.0 / h[i] * (c[i + 1] - c[i]); - b[i] = 1.0 / h[i] * (a[i + 1] - a[i]) - h[i] / 3.0 * (c[i + 1] + 2 * c[i]); - } - } - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Interpolation/Matrix.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Interpolation/Matrix.cs deleted file mode 100644 index 0cc7e0135..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Interpolation/Matrix.cs +++ /dev/null @@ -1,45 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Matrix - { - public double[,] a; - - public double[] y, x; - - public Matrix(int size) - { - a = new double[size, size]; - - y = new double[size]; - - x = new double[size]; - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Interpolation/MatrixSolver.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Interpolation/MatrixSolver.cs deleted file mode 100644 index 9c5bbafcb..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Interpolation/MatrixSolver.cs +++ /dev/null @@ -1,115 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - // Matrix equation solver using the Gaussian elimination algorithm - public class MatrixSolver - { - public readonly Matrix m; - public readonly int maxOrder; - public bool calcError; - - public MatrixSolver(int size, Matrix mi) - { - maxOrder = size; - m = mi; - } - - void SwitchRows(int n) - { - double tempD; - int i, j; - for (i = n; i <= maxOrder - 2; i++) - { - for (j = 0; j <= maxOrder - 1; j++) - { - tempD = m.a[i, j]; - m.a[i, j] = m.a[i + 1, j]; - m.a[i + 1, j] = tempD; - } - tempD = m.y[i]; - m.y[i] = m.y[i + 1]; - m.y[i + 1] = tempD; - } - } - - public bool Eliminate() - { - int i, k, l; - calcError = false; - for (k = 0; k <= maxOrder - 2; k++) - { - for (i = k; i <= maxOrder - 2; i++) - { - if (Math.Abs(m.a[i + 1, i]) < 1e-8) - { - SwitchRows(i + 1); - } - if (m.a[i + 1, k] != 0.0) - { - for (l = k + 1; l <= maxOrder - 1; l++) - { - if (!calcError) - { - m.a[i + 1, l] = m.a[i + 1, l] * m.a[k, k] - m.a[k, l] * m.a[i + 1, k]; - if (m.a[i + 1, l] > 10E260) - { - m.a[i + 1, k] = 0; - calcError = true; - } - } - } - m.y[i + 1] = m.y[i + 1] * m.a[k, k] - m.y[k] * m.a[i + 1, k]; - m.a[i + 1, k] = 0; - } - } - } - return !calcError; - } - - public void Solve() - { - int k, l; - for (k = maxOrder - 1; k >= 0; k--) - { - for (l = maxOrder - 1; l >= k; l--) - { - m.y[k] = m.y[k] - m.x[l] * m.a[k, l]; - } - if (m.a[k, k] != 0) - { - m.x[k] = m.y[k] / m.a[k, k]; - } - else - { - m.x[k] = 0; - } - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Interpolation/NaturalSpline.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Interpolation/NaturalSpline.cs deleted file mode 100644 index 771ba65e6..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Interpolation/NaturalSpline.cs +++ /dev/null @@ -1,125 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// Natural Spline data interpolator - /// - public class NaturalSpline : SplineInterpolator - { - public NaturalSpline(double[] xs, double[] ys, int resolution = 10) : base(xs, ys, resolution) - { - m = new Matrix(n - 2); - gauss = new MatrixSolver(n - 2, m); - - a = new double[n]; - b = new double[n]; - c = new double[n]; - d = new double[n]; - h = new double[n - 1]; - - CalcParameters(); - Integrate(); - Interpolate(); - } - - public void CalcParameters() - { - for (int i = 0; i < n; i++) - { - a[i] = givenYs[i]; - } - - for (int i = 0; i < n - 1; i++) - { - h[i] = givenXs[i + 1] - givenXs[i]; - } - - for (int i = 0; i < n - 2; i++) - { - for (int k = 0; k < n - 2; k++) - { - m.a[i, k] = 0.0; - m.y[i] = 0.0; - m.x[i] = 0.0; - } - } - - for (int i = 0; i < n - 2; i++) - { - if (i == 0) - { - m.a[i, 0] = 2.0 * (h[0] + h[1]); - m.a[i, 1] = h[1]; - } - else - { - m.a[i, i - 1] = h[i]; - m.a[i, i] = 2.0 * (h[i] + h[i + 1]); - if (i < n - 3) - { - m.a[i, i + 1] = h[i + 1]; - } - } - - if ((h[i] != 0.0) && (h[i + 1] != 0.0)) - { - m.y[i] = ((a[i + 2] - a[i + 1]) / h[i + 1] - (a[i + 1] - a[i]) / h[i]) * 3.0; - } - else - { - m.y[i] = 0.0; - } - } - - if (gauss.Eliminate() == false) - { - throw new InvalidOperationException("error in matrix calculation"); - } - - gauss.Solve(); - - c[0] = 0.0; - c[n - 1] = 0.0; - - for (int i = 1; i < n - 1; i++) - { - c[i] = m.x[i - 1]; - } - - for (int i = 0; i < n - 1; i++) - { - if (h[i] != 0.0) - { - d[i] = 1.0 / 3.0 / h[i] * (c[i + 1] - c[i]); - b[i] = 1.0 / h[i] * (a[i + 1] - a[i]) - h[i] / 3.0 * (c[i + 1] + 2 * c[i]); - } - } - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Interpolation/PeriodicSpline.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Interpolation/PeriodicSpline.cs deleted file mode 100644 index 2f5d54848..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Interpolation/PeriodicSpline.cs +++ /dev/null @@ -1,129 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// The Periodic Spline is a Natural Spline whose first and last point slopes are equal - /// - public class PeriodicSpline : SplineInterpolator - { - public PeriodicSpline(double[] xs, double[] ys, int resolution = 10) : base(xs, ys, resolution) - { - m = new Matrix(n - 1); - gauss = new MatrixSolver(n - 1, m); - - a = new double[n + 1]; - b = new double[n + 1]; - c = new double[n + 1]; - d = new double[n + 1]; - h = new double[n]; - - CalcParameters(); - Integrate(); - Interpolate(); - } - - public void CalcParameters() - { - for (int i = 0; i < n; i++) - { - a[i] = givenYs[i]; - } - - for (int i = 0; i < n - 1; i++) - { - h[i] = givenXs[i + 1] - givenXs[i]; - } - - a[n] = givenYs[1]; - h[n - 1] = h[0]; - - for (int i = 0; i < n - 1; i++) - { - for (int k = 0; k < n - 1; k++) - { - m.a[i, k] = 0.0; - m.y[i] = 0.0; - m.x[i] = 0.0; - } - } - - for (int i = 0; i < n - 1; i++) - { - if (i == 0) - { - m.a[i, 0] = 2.0 * (h[0] + h[1]); - m.a[i, 1] = h[1]; - } - else - { - m.a[i, i - 1] = h[i]; - m.a[i, i] = 2.0 * (h[i] + h[i + 1]); - if (i < n - 2) - { - m.a[i, i + 1] = h[i + 1]; - } - } - if ((h[i] != 0.0) && (h[i + 1] != 0.0)) - { - m.y[i] = ((a[i + 2] - a[i + 1]) / h[i + 1] - (a[i + 1] - a[i]) / h[i]) * 3.0; - } - else - { - m.y[i] = 0.0; - } - } - - m.a[0, n - 2] = h[0]; - m.a[n - 2, 0] = h[0]; - - if (gauss.Eliminate() == false) - { - throw new InvalidOperationException(); - } - - gauss.Solve(); - - for (int i = 1; i < n; i++) - { - c[i] = m.x[i - 1]; - } - - c[0] = c[n - 1]; - - for (int i = 0; i < n; i++) - { - if (h[i] != 0.0) - { - d[i] = 1.0 / 3.0 / h[i] * (c[i + 1] - c[i]); - b[i] = 1.0 / h[i] * (a[i + 1] - a[i]) - h[i] / 3.0 * (c[i + 1] + 2 * c[i]); - } - } - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Interpolation/SplineInterpolator.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Interpolation/SplineInterpolator.cs deleted file mode 100644 index 1b14003f0..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Interpolation/SplineInterpolator.cs +++ /dev/null @@ -1,117 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public abstract class SplineInterpolator - { - public double[] givenYs, givenXs; - public double[] interpolatedXs, interpolatedYs; - - protected Matrix m; - protected MatrixSolver gauss; - - protected readonly int n; - protected double[] a, b, c, d, h; - - protected SplineInterpolator(double[] xs, double[] ys, int resolution = 10) - { - if (xs is null || ys is null) - { - throw new ArgumentException("xs and ys cannot be null"); - } - - if (xs.Length != ys.Length) - { - throw new ArgumentException("xs and ys must have the same length"); - } - - if (xs.Length < 4) - { - throw new ArgumentException("xs and ys must have a length of 4 or greater"); - } - - if (resolution < 1) - { - throw new ArgumentException("resolution must be 1 or greater"); - } - - givenXs = xs; - givenYs = ys; - n = xs.Length; - - interpolatedXs = new double[n * resolution]; - interpolatedYs = new double[n * resolution]; - } - - public void Interpolate() - { - int resolution = interpolatedXs.Length / n; - for (int i = 0; i < h.Length; i++) - { - for (int k = 0; k < resolution; k++) - { - double deltaX = (double)k / resolution * h[i]; - double termA = a[i]; - double termB = b[i] * deltaX; - double termC = c[i] * deltaX * deltaX; - double termD = d[i] * deltaX * deltaX * deltaX; - int interpolatedIndex = i * resolution + k; - interpolatedXs[interpolatedIndex] = deltaX + givenXs[i]; - interpolatedYs[interpolatedIndex] = termA + termB + termC + termD; - } - } - - // After interpolation the last several values of the interpolated arrays - // contain uninitialized data. This section identifies the values which are - // populated with values and copies just the useful data into new arrays. - int pointsToKeep = resolution * (n - 1) + 1; - double[] interpolatedXsCopy = new double[pointsToKeep]; - double[] interpolatedYsCopy = new double[pointsToKeep]; - Array.Copy(interpolatedXs, 0, interpolatedXsCopy, 0, pointsToKeep - 1); - Array.Copy(interpolatedYs, 0, interpolatedYsCopy, 0, pointsToKeep - 1); - interpolatedXs = interpolatedXsCopy; - interpolatedYs = interpolatedYsCopy; - interpolatedXs[pointsToKeep - 1] = givenXs[n - 1]; - interpolatedYs[pointsToKeep - 1] = givenYs[n - 1]; - } - - public double Integrate() - { - double integral = 0; - for (int i = 0; i < h.Length; i++) - { - double termA = a[i] * h[i]; - double termB = b[i] * Math.Pow(h[i], 2) / 2.0; - double termC = c[i] * Math.Pow(h[i], 3) / 3.0; - double termD = d[i] * Math.Pow(h[i], 4) / 4.0; - integral += termA + termB + termC + termD; - } - return integral; - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Population.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Population.cs deleted file mode 100644 index e3380a510..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Population.cs +++ /dev/null @@ -1,193 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// This module holds an array of values and provides popultation statistics (mean, median, standard deviation, etc) - /// - public class Population - { - public double[] values { get; private set; } - public double[] sortedValues { get; private set; } - public double min { get; private set; } - public double max { get; private set; } - public double median { get; private set; } - public double sum { get; private set; } - public int count { get; private set; } - public double mean { get; private set; } - public double stDev { get; private set; } - public double plus3stDev { get; private set; } - public double minus3stDev { get; private set; } - public double plus2stDev { get; private set; } - public double minus2stDev { get; private set; } - public double stdErr { get; private set; } - public double Q1 { get; private set; } - public double Q3 { get; private set; } - public double IQR { get; private set; } - public double[] lowOutliers { get; private set; } - public double[] highOutliers { get; private set; } - public double maxNonOutlier { get; private set; } - public double minNonOutlier { get; private set; } - public int n => values.Length; - public double span => sortedValues.Last() - sortedValues.First(); - - /// - /// Generate random values with a normal distribution - /// - public Population(Random rand, int pointCount, double mean = .5, double stdDev = .5) - { - values = DataGen.RandomNormal(rand, pointCount, mean, stdDev); - Recalculate(); - } - - /// - /// Calculate population stats from the given array of values - /// - public Population(double[] values) - { - if (values is null) - { - throw new ArgumentException("values cannot be null"); - } - - this.values = values; - Recalculate(); - } - - [Obsolete("This constructor overload is deprecated. Please remove the fullAnalysis argument.")] - public Population(double[] values, bool fullAnalysis = true) - { - if (values is null) - { - throw new ArgumentException("values cannot be null"); - } - - this.values = values; - if (fullAnalysis) - { - Recalculate(); - } - } - - public void Recalculate() - { - count = values.Length; - - int QSize = (int)Math.Floor(count / 4.0); - - sortedValues = new double[count]; - Array.Copy(values, 0, sortedValues, 0, count); - Array.Sort(sortedValues); - - min = sortedValues.First(); - max = sortedValues.Last(); - median = sortedValues[count / 2]; - - Q1 = sortedValues[QSize]; - Q3 = sortedValues[sortedValues.Length - QSize - 1]; - IQR = Q3 - Q1; - - double lowerBoundary = Q1 - 1.5 * IQR; - double upperBoundary = Q3 + 1.5 * IQR; - - int minNonOutlierIndex = 0; - int maxNonOutlierIndex = 0; - - for (int i = 0; i < sortedValues.Length; i++) - { - if (sortedValues[i] < lowerBoundary) - { - - } - else - { - minNonOutlierIndex = i; - break; - } - } - - for (int i = sortedValues.Length - 1; i >= 0; i--) - { - if (sortedValues[i] > upperBoundary) - { - - } - else - { - maxNonOutlierIndex = i; - break; - } - } - - lowOutliers = new double[minNonOutlierIndex]; - highOutliers = new double[sortedValues.Length - maxNonOutlierIndex - 1]; - Array.Copy(sortedValues, 0, lowOutliers, 0, lowOutliers.Length); - Array.Copy(sortedValues, maxNonOutlierIndex + 1, highOutliers, 0, highOutliers.Length); - minNonOutlier = sortedValues[minNonOutlierIndex]; - maxNonOutlier = sortedValues[maxNonOutlierIndex]; - - sum = values.Sum(); - mean = sum / count; - - double sumVariancesSquared = 0; - for (int i = 0; i < values.Length; i++) - { - double pointVariance = Math.Abs(mean - values[i]); - double pointVarianceSquared = Math.Pow(pointVariance, 2); - sumVariancesSquared += pointVarianceSquared; - } - double meanVarianceSquared = sumVariancesSquared / values.Length; - stDev = Math.Sqrt(meanVarianceSquared); - plus2stDev = mean + stDev * 2; - minus2stDev = mean - stDev * 2; - plus3stDev = mean + stDev * 3; - minus3stDev = mean - stDev * 3; - stdErr = stDev / Math.Sqrt(count); - } - - public double[] GetDistribution(double[] xs, bool normalize) - { - double[] ys = new double[xs.Length]; - for (int i = 0; i < xs.Length; i++) - { - ys[i] = Math.Exp(-.5 * Math.Pow((xs[i] - mean) / stDev, 2)); - } - - if (normalize) - { - double sum = ys.Sum(); - for (int i = 0; i < ys.Length; i++) - { - ys[i] /= sum; - } - } - - return ys; - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/PopulationMultiSeries.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/PopulationMultiSeries.cs deleted file mode 100644 index bc9924d80..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/PopulationMultiSeries.cs +++ /dev/null @@ -1,56 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class PopulationMultiSeries - { - public PopulationSeries[] multiSeries; - - public string[] seriesLabels { get { return multiSeries.Select(x => x.seriesLabel).ToArray(); } } - public int seriesCount => multiSeries.Length; - public int groupCount => multiSeries[0].populations.Length; - - public PopulationMultiSeries(PopulationSeries[] multiSeries) - { - if (multiSeries is null) - { - throw new ArgumentException("groupedSeries cannot be null"); - } - - foreach (var series in multiSeries) - { - if (series.populations.Length != multiSeries[0].populations.Length) - { - throw new ArgumentException("All series must have the same number of populations"); - } - } - - this.multiSeries = multiSeries; - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/PopulationSeries.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/PopulationSeries.cs deleted file mode 100644 index 716a7dc37..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/PopulationSeries.cs +++ /dev/null @@ -1,46 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// A population series is a collection of similar PopulationStats objects. - /// - public class PopulationSeries - { - public Population[] populations; - public string seriesLabel; - public Color color; - - public PopulationSeries(Population[] populations, string seriesLabel = null, Color? color = null) - { - this.populations = populations; - this.seriesLabel = seriesLabel ?? string.Empty; - this.color = (color is null) ? Color.LightGray : color.Value; - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Regression.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Regression.cs deleted file mode 100644 index 2345c7c0a..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Regression.cs +++ /dev/null @@ -1,138 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class LinearRegressionLine - { - public readonly double slope; - public readonly double offset; - public readonly double rSquared; - - private readonly int pointCount; - private readonly double[] xs; - private readonly double[] ys; - - public LinearRegressionLine(double[] xs, double[] ys) - { - if ((xs.Length != ys.Length) || (xs.Length < 2)) - { - throw new ArgumentException("xs and ys must be the same length and have at least 2 points"); - } - - pointCount = ys.Length; - this.xs = xs; - this.ys = ys; - (slope, offset, rSquared) = GetCoefficients(xs, ys); - } - - public LinearRegressionLine(double[] ys, double firstX, double xSpacing) - { - // this constructor doesn't require an X array to be passed in at all - pointCount = ys.Length; - double[] xs = new double[pointCount]; - for (int i = 0; i < pointCount; i++) - { - xs[i] = firstX + xSpacing * i; - } - this.xs = xs; - this.ys = ys; - (slope, offset, rSquared) = GetCoefficients(xs, ys); - } - - public override string ToString() - { - return $"Linear fit for {pointCount} points: Y = {slope}x + {offset} (R² = {rSquared})"; - } - - private static (double, double, double) GetCoefficients(double[] xs, double[] ys) - { - double sumXYResidual = 0; - double sumXSquareResidual = 0; - - double meanX = xs.Average(); - double meanY = ys.Average(); - - for (int i = 0; i < xs.Length; i++) - { - sumXYResidual += (xs[i] - meanX) * (ys[i] - meanY); - sumXSquareResidual += (xs[i] - meanX) * (xs[i] - meanX); - } - - // Note: least-squares regression line always passes through (x̅,y̅) - double slope = sumXYResidual / sumXSquareResidual; - double offset = meanY - (slope * meanX); - - // calcualte R squared (https://en.wikipedia.org/wiki/Coefficient_of_determination) - double ssTot = 0; - double ssRes = 0; - for (int i = 0; i < ys.Length; i++) - { - double thisY = ys[i]; - - double distanceFromMeanSquared = Math.Pow(thisY - meanY, 2); - ssTot += distanceFromMeanSquared; - - double modelY = slope * xs[i] + offset; - double distanceFromModelSquared = Math.Pow(thisY - modelY, 2); - ssRes += distanceFromModelSquared; - } - double rSquared = 1 - ssRes / ssTot; - - return (slope, offset, rSquared); - } - - public double GetValueAt(double x) - { - return offset + slope * x; - } - - public double[] GetValues() - { - double[] values = new double[pointCount]; - for (int i = 0; i < pointCount; i++) - { - values[i] = GetValueAt(xs[i]); - } - return values; - } - - public double[] GetResiduals() - { - // the residual is the difference between the actual and predicted value - - double[] residuals = new double[ys.Length]; - - for (int i = 0; i < ys.Length; i++) - { - residuals[i] = ys[i] - GetValueAt(xs[i]); - } - - return residuals; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Vector2.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Vector2.cs deleted file mode 100644 index 9f82d4fae..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Statistics/Vector2.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - // A simpler double-precision floating point alternative to the System.Numerics.Vectors package - // https://github.com/microsoft/referencesource/blob/master/System.Numerics/System/Numerics/Vector2.cs - - public struct Vector2 - { - public double X; - public double Y; - - public Vector2(double x, double y) - { - (X, Y) = (x, y); - } - - public double LengthSquared() - { - return X * X + Y * Y; - } - - public double Length() - { - return Math.Sqrt(LengthSquared()); - } - - public static Vector2 Multiply(Vector2 left, double right) - { - return new Vector2(left.X * right, left.Y * right); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Black.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Black.cs deleted file mode 100644 index 719fe8e03..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Black.cs +++ /dev/null @@ -1,42 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Black : Default - { - public override Color FigureBackgroundColor => Color.Black; - public override Color DataBackgroundColor => Color.Black; - public override Color FrameColor => ColorTranslator.FromHtml("#757575"); - public override Color GridLineColor => ColorTranslator.FromHtml("#2d2d2d"); - public override Color TitleFontColor => Color.White; - public override Color AxisLabelColor => ColorTranslator.FromHtml("#b9b9ba"); - public override Color TickLabelColor => ColorTranslator.FromHtml("#757575"); - public override Color TickMajorColor => ColorTranslator.FromHtml("#757575"); - public override Color TickMinorColor => ColorTranslator.FromHtml("#757575"); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Blue1.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Blue1.cs deleted file mode 100644 index 25ed0a665..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Blue1.cs +++ /dev/null @@ -1,42 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Blue1 : Default - { - public override Color FigureBackgroundColor => ColorTranslator.FromHtml("#07263b"); - public override Color DataBackgroundColor => ColorTranslator.FromHtml("#0b3049"); - public override Color FrameColor => ColorTranslator.FromHtml("#145665"); - public override Color GridLineColor => ColorTranslator.FromHtml("#0e3d54"); - public override Color AxisLabelColor => ColorTranslator.FromHtml("#b5bec5"); - public override Color TitleFontColor => ColorTranslator.FromHtml("#d0dae2"); - public override Color TickLabelColor => ColorTranslator.FromHtml("#b5bec5"); - public override Color TickMajorColor => ColorTranslator.FromHtml("#145665"); - public override Color TickMinorColor => ColorTranslator.FromHtml("#145665"); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Blue2.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Blue2.cs deleted file mode 100644 index 14276eab8..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Blue2.cs +++ /dev/null @@ -1,42 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - internal class Blue2 : Default - { - public override Color FigureBackgroundColor => ColorTranslator.FromHtml("#1b2138"); - public override Color DataBackgroundColor => ColorTranslator.FromHtml("#252c48"); - public override Color FrameColor => ColorTranslator.FromHtml("#bbbdc4"); - public override Color GridLineColor => ColorTranslator.FromHtml("#2c334e"); - public override Color AxisLabelColor => ColorTranslator.FromHtml("#bbbdc4"); - public override Color TitleFontColor => ColorTranslator.FromHtml("#d8dbe3"); - public override Color TickLabelColor => ColorTranslator.FromHtml("#bbbdc4"); - public override Color TickMajorColor => ColorTranslator.FromHtml("#bbbdc4"); - public override Color TickMinorColor => ColorTranslator.FromHtml("#bbbdc4"); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Blue3.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Blue3.cs deleted file mode 100644 index 8464584eb..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Blue3.cs +++ /dev/null @@ -1,42 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - internal class Blue3 : Default - { - public override Color FigureBackgroundColor => ColorTranslator.FromHtml("#001021"); - public override Color DataBackgroundColor => ColorTranslator.FromHtml("#021d38"); - public override Color FrameColor => ColorTranslator.FromHtml("#d3d3d3"); - public override Color GridLineColor => ColorTranslator.FromHtml("#273c51"); - public override Color AxisLabelColor => ColorTranslator.FromHtml("#d3d3d3"); - public override Color TitleFontColor => ColorTranslator.FromHtml("#FFFFFF"); - public override Color TickLabelColor => ColorTranslator.FromHtml("#d3d3d3"); - public override Color TickMajorColor => ColorTranslator.FromHtml("#d3d3d3"); - public override Color TickMinorColor => ColorTranslator.FromHtml("#d3d3d3"); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Burgundy.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Burgundy.cs deleted file mode 100644 index 9e88587f9..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Burgundy.cs +++ /dev/null @@ -1,42 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Burgundy : Default - { - public override Color FigureBackgroundColor => ColorTranslator.FromHtml("#ffffff"); - public override Color DataBackgroundColor => ColorTranslator.FromHtml("#fffdfd"); - public override Color FrameColor => ColorTranslator.FromHtml("#560013"); - public override Color GridLineColor => ColorTranslator.FromHtml("#ffdae3"); - public override Color AxisLabelColor => ColorTranslator.FromHtml("#5e0015"); - public override Color TitleFontColor => ColorTranslator.FromHtml("#560013"); - public override Color TickLabelColor => ColorTranslator.FromHtml("#5e0015"); - public override Color TickMajorColor => ColorTranslator.FromHtml("#560013"); - public override Color TickMinorColor => ColorTranslator.FromHtml("#560013"); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Control.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Control.cs deleted file mode 100644 index 4228c586e..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Control.cs +++ /dev/null @@ -1,34 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - internal class Control : Default - { - public override Color FigureBackgroundColor => SystemColors.Control; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Default.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Default.cs deleted file mode 100644 index 84106a161..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Default.cs +++ /dev/null @@ -1,46 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Default : IStyle - { - public virtual Color FigureBackgroundColor => Color.White; - public virtual Color DataBackgroundColor => Color.White; - public virtual Color GridLineColor => ColorTranslator.FromHtml("#efefef"); - public virtual Color FrameColor => Color.Black; - public virtual Color TitleFontColor => Color.Black; - public virtual Color AxisLabelColor => Color.Black; - public virtual Color TickLabelColor => Color.Black; - public virtual Color TickMajorColor => Color.Black; - public virtual Color TickMinorColor => Color.Black; - - public virtual string TitleFontName => InstalledFont.Default(); - public virtual string AxisLabelFontName => InstalledFont.Default(); - public virtual string TickLabelFontName => InstalledFont.Default(); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Earth.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Earth.cs deleted file mode 100644 index 7a9d0c97c..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Earth.cs +++ /dev/null @@ -1,45 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - internal class Earth : Default - { - - public override Color FigureBackgroundColor => Color.SandyBrown; - public override Color DataBackgroundColor => Color.SaddleBrown; - public override Color GridLineColor => Color.Sienna; - public override Color FrameColor => Color.Brown; - public override Color TitleFontColor => Color.Brown; - public override Color AxisLabelColor => Color.Brown; - public override Color TickLabelColor => Color.Brown; - public override Color TickMajorColor => Color.Brown; - public override Color TickMinorColor => Color.Brown; - - - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Gray1.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Gray1.cs deleted file mode 100644 index c0682e8a7..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Gray1.cs +++ /dev/null @@ -1,42 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Gray1 : Default - { - public override Color FigureBackgroundColor => ColorTranslator.FromHtml("#31363a"); - public override Color DataBackgroundColor => ColorTranslator.FromHtml("#3a4149"); - public override Color FrameColor => ColorTranslator.FromHtml("#757a80"); - public override Color GridLineColor => ColorTranslator.FromHtml("#444b52"); - public override Color AxisLabelColor => ColorTranslator.FromHtml("#d6d7d8"); - public override Color TitleFontColor => ColorTranslator.FromHtml("#FFFFFF"); - public override Color TickLabelColor => ColorTranslator.FromHtml("#757a80"); - public override Color TickMajorColor => ColorTranslator.FromHtml("#757a80"); - public override Color TickMinorColor => ColorTranslator.FromHtml("#757a80"); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Gray2.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Gray2.cs deleted file mode 100644 index ba4c09a40..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Gray2.cs +++ /dev/null @@ -1,42 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - internal class Gray2 : Default - { - public override Color FigureBackgroundColor => ColorTranslator.FromHtml("#131519"); - public override Color DataBackgroundColor => ColorTranslator.FromHtml("#262626"); - public override Color FrameColor => ColorTranslator.FromHtml("#757575"); - public override Color GridLineColor => ColorTranslator.FromHtml("#2d2d2d"); - public override Color AxisLabelColor => ColorTranslator.FromHtml("#b9b9ba"); - public override Color TitleFontColor => ColorTranslator.FromHtml("#FFFFFF"); - public override Color TickLabelColor => ColorTranslator.FromHtml("#757575"); - public override Color TickMajorColor => ColorTranslator.FromHtml("#757575"); - public override Color TickMinorColor => ColorTranslator.FromHtml("#757575"); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Hazel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Hazel.cs deleted file mode 100644 index 168a6e824..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Hazel.cs +++ /dev/null @@ -1,42 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Hazel : Default - { - public override Color FigureBackgroundColor => ColorTranslator.FromHtml("#221a0f"); - public override Color DataBackgroundColor => ColorTranslator.FromHtml("#362712"); - public override Color FrameColor => Color.White; - public override Color GridLineColor => ColorTranslator.FromHtml("#221a0f"); - public override Color AxisLabelColor => Color.White; - public override Color TitleFontColor => Color.White; - public override Color TickLabelColor => Color.Gray; - public override Color TickMajorColor => ColorTranslator.FromHtml("#757575"); - public override Color TickMinorColor => ColorTranslator.FromHtml("#757575"); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/IStyle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/IStyle.cs deleted file mode 100644 index 9ddfec6c2..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/IStyle.cs +++ /dev/null @@ -1,49 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - /// - /// A theme describes a collection of colors and fonts that can be used to style a plot - /// - public interface IStyle - { - Color FigureBackgroundColor { get; } - Color DataBackgroundColor { get; } - Color FrameColor { get; } - Color GridLineColor { get; } - Color AxisLabelColor { get; } - Color TitleFontColor { get; } - Color TickLabelColor { get; } - Color TickMajorColor { get; } - Color TickMinorColor { get; } - - string AxisLabelFontName { get; } - string TitleFontName { get; } - string TickLabelFontName { get; } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Light1.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Light1.cs deleted file mode 100644 index 1c2b8a389..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Light1.cs +++ /dev/null @@ -1,37 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - internal class Light1 : Default - { - public override Color FrameColor => ColorTranslator.FromHtml("#7f7f7f"); - public override Color TickLabelColor => ColorTranslator.FromHtml("#7f7f7f"); - public override Color TickMajorColor => ColorTranslator.FromHtml("#7f7f7f"); - public override Color TickMinorColor => ColorTranslator.FromHtml("#7f7f7f"); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Light2.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Light2.cs deleted file mode 100644 index 913060e9b..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Light2.cs +++ /dev/null @@ -1,40 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - internal class Light2 : Default - { - public override Color FigureBackgroundColor => ColorTranslator.FromHtml("#e4e6ec"); - public override Color DataBackgroundColor => ColorTranslator.FromHtml("#f1f3f7"); - public override Color FrameColor => ColorTranslator.FromHtml("#145665"); - public override Color GridLineColor => ColorTranslator.FromHtml("#e5e7ea"); - public override Color TickLabelColor => ColorTranslator.FromHtml("#77787b"); - public override Color TickMajorColor => ColorTranslator.FromHtml("#77787b"); - public override Color TickMinorColor => ColorTranslator.FromHtml("#77787b"); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Monospace.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Monospace.cs deleted file mode 100644 index 7575808fb..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Monospace.cs +++ /dev/null @@ -1,36 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class Monospace : Default - { - public override string TitleFontName => InstalledFont.Monospace(); - public override string AxisLabelFontName => InstalledFont.Monospace(); - public override string TickLabelFontName => InstalledFont.Monospace(); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Pink.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Pink.cs deleted file mode 100644 index dacc9dfc0..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Pink.cs +++ /dev/null @@ -1,40 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - internal class Pink : Default - { - public override Color FigureBackgroundColor => ColorTranslator.FromHtml("#d7c0d0"); - public override Color DataBackgroundColor => ColorTranslator.FromHtml("#f7c7db"); - public override Color FrameColor => ColorTranslator.FromHtml("#f79ad3"); - public override Color GridLineColor => ColorTranslator.FromHtml("#c86fc9"); - public override Color TickLabelColor => ColorTranslator.FromHtml("#8e518d"); - public override Color TickMajorColor => ColorTranslator.FromHtml("#d7c0d0"); - public override Color TickMinorColor => ColorTranslator.FromHtml("#f79ad3"); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Seaborn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Seaborn.cs deleted file mode 100644 index bd998ac5c..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Styles/Seaborn.cs +++ /dev/null @@ -1,41 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - internal class Seaborn : Default - { - public override Color DataBackgroundColor => ColorTranslator.FromHtml("#eaeaf2"); - public override Color FrameColor => Color.Transparent; - public override Color GridLineColor => Color.White; - public override Color AxisLabelColor => ColorTranslator.FromHtml("#777777"); - public override Color TitleFontColor => ColorTranslator.FromHtml("#777777"); - public override Color TickLabelColor => ColorTranslator.FromHtml("#AAAAAA"); - public override Color TickMajorColor => ColorTranslator.FromHtml("#eaeaf2"); - public override Color TickMinorColor => ColorTranslator.FromHtml("#eaeaf2"); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/DateTimeTickUnitBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/DateTimeTickUnitBase.cs deleted file mode 100644 index 8b37f7e4b..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/DateTimeTickUnitBase.cs +++ /dev/null @@ -1,111 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class DateTimeTickUnitBase : IDateTimeUnit - { - // base class implements Seconds Unit - protected DateTimeUnit kind = DateTimeUnit.Second; - protected CultureInfo culture; - protected int[] deltas = new int[] { 1, 2, 5, 10, 15, 30 }; - protected int maxTickCount; - - public DateTimeTickUnitBase(CultureInfo culture, int maxTickCount, int? manualSpacing) - { - this.culture = culture; - this.maxTickCount = maxTickCount; - if (manualSpacing.HasValue) - { - deltas = new int[] { manualSpacing.Value }; - } - } - - protected virtual DateTime Floor(DateTime value) - { - return new DateTime(value.Year, value.Month, value.Day, value.Hour, value.Minute, 0); - } - - protected virtual DateTime Increment(DateTime value, int delta) - { - return value.AddSeconds(delta); - } - - protected virtual string GetTickLabel(DateTime value) - { - string date = value.ToString("d", culture); // short date - string time = value.ToString("T", culture); // long time - return $"{date}\n{time}"; - } - - public (double[] Ticks, string[] Labels) GetTicksAndLabels(DateTime from, DateTime to, string format) - { - DateTime[] ticks = GetTicks(from, to, deltas, maxTickCount); - string[] labels = (format is null) ? - ticks.Select(t => GetTickLabel(t)).ToArray() : - ticks.Select(t => t.ToString(format, culture)).ToArray(); - return (ticks.Select(t => t.ToOADate()).ToArray(), labels); - } - - protected DateTime[] GetTicks(DateTime from, DateTime to, int[] deltas, int maxTickCount) - { - DateTime[] result = new DateTime[] { }; - foreach (var delta in deltas) - { - result = GetTicks(from, to, delta); - if (result.Length <= maxTickCount) - { - return result; - } - } - return result; - } - - protected virtual DateTime[] GetTicks(DateTime from, DateTime to, int delta) - { - var dates = new List(); - DateTime dt = Floor(from); - while (dt <= to) - { - if (dt >= from) - { - dates.Add(dt); - } - - try - { - dt = Increment(dt, delta); - } - catch - { - break; // our date is larger than possible - } - } - return dates.ToArray(); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/DateTimeUnitFactory.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/DateTimeUnitFactory.cs deleted file mode 100644 index d9f627b5a..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/DateTimeUnitFactory.cs +++ /dev/null @@ -1,106 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class DateTimeUnitFactory - { - public IDateTimeUnit Create(DateTimeUnit kind, CultureInfo culture, int maxTickCount, int? manualSpacing) - { - switch (kind) - { - case DateTimeUnit.ThousandYear: - return new DateTimeTickThousandYear(culture, maxTickCount, manualSpacing); - case DateTimeUnit.HundredYear: - return new DateTimeTickHundredYear(culture, maxTickCount, manualSpacing); - case DateTimeUnit.TenYear: - return new DateTimeTickTenYear(culture, maxTickCount, manualSpacing); - case DateTimeUnit.Year: - return new DateTimeTickYear(culture, maxTickCount, manualSpacing); - case DateTimeUnit.Month: - return new DateTimeTickMonth(culture, maxTickCount, manualSpacing); - case DateTimeUnit.Day: - return new DateTimeTickDay(culture, maxTickCount, manualSpacing); - case DateTimeUnit.Hour: - return new DateTimeTickHour(culture, maxTickCount, manualSpacing); - case DateTimeUnit.Minute: - return new DateTimeTickMinute(culture, maxTickCount, manualSpacing); - case DateTimeUnit.Second: - return new DateTimeTickSecond(culture, maxTickCount, manualSpacing); - case DateTimeUnit.DeciSecond: - return new DateTimeTickDecisecond(culture, maxTickCount, manualSpacing); - case DateTimeUnit.CentiSecond: - return new DateTimeTickCentisecond(culture, maxTickCount, manualSpacing); - case DateTimeUnit.Millisecond: - return new DateTimeTickMillisecond(culture, maxTickCount, manualSpacing); - default: - throw new NotImplementedException("unrecognized TickUnit"); - } - } - - public IDateTimeUnit CreateBestUnit(DateTime from, DateTime to, CultureInfo culture, int maxTickCount) - { - double daysApart = to.ToOADate() - from.ToOADate(); - - int halfDensity = maxTickCount / 2; - - // tick unit borders in days - var tickUnitBorders = new List<(DateTimeUnit kind, double border)?> - { - (DateTimeUnit.ThousandYear, 365 * 1_000 * halfDensity), - (DateTimeUnit.HundredYear, 365 * 100 * halfDensity), - (DateTimeUnit.TenYear, 365 * 10 * halfDensity), - (DateTimeUnit.Year, 365 * halfDensity), - (DateTimeUnit.Month, 30 * halfDensity), - (DateTimeUnit.Day, 1 * halfDensity), - (DateTimeUnit.Hour, 1.0 / 24 * halfDensity), - (DateTimeUnit.Minute, 1.0 / 24 / 60 * halfDensity), - (DateTimeUnit.Second, 1.0 / 24 / 3600 * halfDensity), - (DateTimeUnit.DeciSecond, 1.0 / 24 / 3600 / 10 * halfDensity), - (DateTimeUnit.CentiSecond, 1.0 / 24 / 3600 / 100 * halfDensity), - (DateTimeUnit.Millisecond, 1.0 / 24 / 3600 / 1000 * halfDensity), - }; - - var bestTickUnitKind = tickUnitBorders.FirstOrDefault(tr => daysApart > tr.Value.border); - bestTickUnitKind = bestTickUnitKind ?? tickUnitBorders.Last(); // last tickUnit if not found best - - return Create(bestTickUnitKind.Value.kind, culture, maxTickCount, null); - } - - public IDateTimeUnit CreateUnit(DateTime from, DateTime to, CultureInfo culture, int maxTickCount, DateTimeUnit? manualUnits, int? manualSpacing) - { - if (manualUnits == null) - { - return CreateBestUnit(from, to, culture, maxTickCount); - } - else - { - return Create(manualUnits.Value, culture, maxTickCount, manualSpacing); - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/IDateTimeUnit.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/IDateTimeUnit.cs deleted file mode 100644 index 25c7e57ed..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/IDateTimeUnit.cs +++ /dev/null @@ -1,34 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public interface IDateTimeUnit - { - (double[] Ticks, string[] Labels) GetTicksAndLabels(DateTime from, DateTime to, string format); - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/MonthToMinutes/DateTimeTickDay.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/MonthToMinutes/DateTimeTickDay.cs deleted file mode 100644 index a633c4df2..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/MonthToMinutes/DateTimeTickDay.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class DateTimeTickDay : DateTimeTickUnitBase - { - public DateTimeTickDay(CultureInfo culture, int maxTickCount, int? manualSpacing) : base(culture, maxTickCount, manualSpacing) - { - kind = DateTimeUnit.Day; - if (manualSpacing == null) - { - deltas = new int[] { 1, 2, 5, 10, 20 }; - } - } - - protected override DateTime Floor(DateTime value) - { - return new DateTime(value.Year, value.Month, 1); - } - - protected override DateTime Increment(DateTime value, int delta) - { - return value.AddDays(delta); - } - - protected override string GetTickLabel(DateTime value) - { - var dt = new DateTime(value.Year, value.Month, value.Day); - string localizedLabel = dt.ToString("d", culture); // short date pattern - return $"{localizedLabel.Replace("T", "\n")}\n "; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/MonthToMinutes/DateTimeTickHour.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/MonthToMinutes/DateTimeTickHour.cs deleted file mode 100644 index f1794e16a..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/MonthToMinutes/DateTimeTickHour.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class DateTimeTickHour : DateTimeTickUnitBase - { - public DateTimeTickHour(CultureInfo culture, int maxTickCount, int? manualSpacing) : base(culture, maxTickCount, manualSpacing) - { - kind = DateTimeUnit.Hour; - if (manualSpacing == null) - { - deltas = new int[] { 1, 2, 4, 8, 12 }; - } - } - - protected override DateTime Floor(DateTime value) - { - return new DateTime(value.Year, value.Month, value.Day); - } - - protected override DateTime Increment(DateTime value, int delta) - { - return value.AddHours(delta); - } - - protected override string GetTickLabel(DateTime value) - { - string date = value.ToString("d", culture); // short date - string time = value.ToString("t", culture); // short time - return $"{date}\n{time}"; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/MonthToMinutes/DateTimeTickMinute.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/MonthToMinutes/DateTimeTickMinute.cs deleted file mode 100644 index 70d401854..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/MonthToMinutes/DateTimeTickMinute.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class DateTimeTickMinute : DateTimeTickUnitBase - { - public DateTimeTickMinute(CultureInfo culture, int maxTickCount, int? manualSpacing) : base(culture, maxTickCount, manualSpacing) - { - kind = DateTimeUnit.Minute; - if (manualSpacing == null) - { - deltas = new int[] { 1, 2, 5, 10, 15, 30 }; - } - } - - protected override DateTime Floor(DateTime value) - { - return new DateTime(value.Year, value.Month, value.Day, value.Hour, 0, 0); - } - - protected override DateTime Increment(DateTime value, int delta) - { - return value.AddMinutes(delta); - } - - protected override string GetTickLabel(DateTime value) - { - string date = value.ToString("d", culture); // short date - string time = value.ToString("t", culture); // short time - return $"{date}\n{time}"; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/MonthToMinutes/DateTimeTickMonth.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/MonthToMinutes/DateTimeTickMonth.cs deleted file mode 100644 index ab5ae6c78..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/MonthToMinutes/DateTimeTickMonth.cs +++ /dev/null @@ -1,68 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class DateTimeTickMonth : DateTimeTickUnitBase - { - public DateTimeTickMonth(CultureInfo culture, int maxTickCount, int? manualSpacing) : base(culture, maxTickCount, manualSpacing) - { - kind = DateTimeUnit.Month; - if (manualSpacing == null) - { - deltas = new int[] { 1, 2, 3, 6 }; - } - } - - protected override DateTime Floor(DateTime value) - { - return new DateTime(value.Year, 1, 1); - } - - protected override DateTime Increment(DateTime value, int delta) - { - return value.AddMonths(delta); - } - - protected override string GetTickLabel(DateTime value) - { - var dt = new DateTime(value.Year, value.Month, 1); - string localizedLabel = dt.ToString("Y", culture); // year and month pattern - // replace only first space " " - int pos = localizedLabel.IndexOf(" "); - if (pos < 0) - { - return $"{localizedLabel}\n"; - } - else - { - return - $"{localizedLabel.Substring(0, pos)}\n{localizedLabel.Substring(pos + 1, localizedLabel.Length - pos - 1)}"; - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/SecondsAndLess/DateTimeTickCentisecond.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/SecondsAndLess/DateTimeTickCentisecond.cs deleted file mode 100644 index 9725d102e..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/SecondsAndLess/DateTimeTickCentisecond.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class DateTimeTickCentisecond : DateTimeTickUnitBase - { - public DateTimeTickCentisecond(CultureInfo culture, int maxTickCount, int? manualSpacing) : base(culture, maxTickCount, manualSpacing) - { - kind = DateTimeUnit.CentiSecond; - if (manualSpacing == null) - { - deltas = new int[] { 1, 2, 5 }; - } - } - - protected override DateTime Floor(DateTime value) - { - return new DateTime(value.Year, value.Month, value.Day, value.Hour, value.Minute, value.Second); - } - - protected override DateTime Increment(DateTime value, int delta) - { - return value.AddMilliseconds(delta * 10); - } - - protected override string GetTickLabel(DateTime value) - { - string date = value.ToString("d", culture); // short date - string time = value.ToString("hh:mm:ss.ff", culture); // long time - return $"{date}\n{time}"; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/SecondsAndLess/DateTimeTickDecisecond.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/SecondsAndLess/DateTimeTickDecisecond.cs deleted file mode 100644 index c3369fdea..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/SecondsAndLess/DateTimeTickDecisecond.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - class DateTimeTickDecisecond : DateTimeTickUnitBase - { - public DateTimeTickDecisecond(CultureInfo culture, int maxTickCount, int? manualSpacing) : base(culture, maxTickCount, manualSpacing) - { - kind = DateTimeUnit.DeciSecond; - if (manualSpacing == null) - { - deltas = new int[] { 1, 2, 5 }; - } - } - - protected override DateTime Floor(DateTime value) - { - return new DateTime(value.Year, value.Month, value.Day, value.Hour, value.Minute, value.Second); - } - - protected override DateTime Increment(DateTime value, int delta) - { - return value.AddMilliseconds(delta * 100); - } - - protected override string GetTickLabel(DateTime value) - { - string date = value.ToString("d", culture); // short date - string time = value.ToString("hh:mm:ss.f", culture); // long time - return $"{date}\n{time}"; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/SecondsAndLess/DateTimeTickMillisecond.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/SecondsAndLess/DateTimeTickMillisecond.cs deleted file mode 100644 index bbbafb79d..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/SecondsAndLess/DateTimeTickMillisecond.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class DateTimeTickMillisecond : DateTimeTickUnitBase - { - public DateTimeTickMillisecond(CultureInfo culture, int maxTickCount, int? manualSpacing) : base(culture, maxTickCount, manualSpacing) - { - kind = DateTimeUnit.Millisecond; - if (manualSpacing == null) - { - deltas = new int[] { 1, 2, 5 }; - } - } - - protected override DateTime Floor(DateTime value) - { - return new DateTime(value.Year, value.Month, value.Day, value.Hour, value.Minute, value.Second); - } - - protected override DateTime Increment(DateTime value, int delta) - { - return value.AddMilliseconds(delta); - } - - protected override string GetTickLabel(DateTime value) - { - string date = value.ToString("d", culture); // short date - string time = value.ToString("hh:mm:ss.fff", culture); // long time - return $"{date}\n{time}"; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/SecondsAndLess/DateTimeTickSecond.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/SecondsAndLess/DateTimeTickSecond.cs deleted file mode 100644 index 08a22c764..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/SecondsAndLess/DateTimeTickSecond.cs +++ /dev/null @@ -1,36 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - class DateTimeTickSecond : DateTimeTickUnitBase - { - public DateTimeTickSecond(CultureInfo culture, int maxTickCount, int? manualSpacing) : base(culture, maxTickCount, manualSpacing) - { - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/Years/DateTimeTickHundredYear.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/Years/DateTimeTickHundredYear.cs deleted file mode 100644 index d1ac4ecf5..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/Years/DateTimeTickHundredYear.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class DateTimeTickHundredYear : DateTimeTickUnitBase - { - public DateTimeTickHundredYear(CultureInfo culture, int maxTickCount, int? manualSpacing) : base(culture, maxTickCount, manualSpacing) - { - kind = DateTimeUnit.HundredYear; - if (manualSpacing == null) - { - deltas = new int[] { 1, 2, 5 }; - } - } - - protected override DateTime Floor(DateTime value) - { - return new DateTime(value.Year - (value.Year % 100), 1, 1); - } - - protected override DateTime Increment(DateTime value, int delta) - { - return value.AddYears(delta * 100); - } - - protected override string GetTickLabel(DateTime value) - { - var dt = new DateTime(value.Year, 1, 1); - string localizedLabel = dt.ToString("yyyy", culture); // year only - return $"{localizedLabel}\n "; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/Years/DateTimeTickTenYear.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/Years/DateTimeTickTenYear.cs deleted file mode 100644 index 44d1dfd4b..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/Years/DateTimeTickTenYear.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class DateTimeTickTenYear : DateTimeTickUnitBase - { - public DateTimeTickTenYear(CultureInfo culture, int maxTickCount, int? manualSpacing) : base(culture, maxTickCount, manualSpacing) - { - kind = DateTimeUnit.TenYear; - if (manualSpacing == null) - { - deltas = new int[] { 1, 2, 5 }; - } - } - - protected override DateTime Floor(DateTime value) - { - return new DateTime(value.Year - (value.Year % 10), 1, 1); - } - - protected override DateTime Increment(DateTime value, int delta) - { - return value.AddYears(delta * 10); - } - - protected override string GetTickLabel(DateTime value) - { - var dt = new DateTime(value.Year, 1, 1); - string localizedLabel = dt.ToString("yyyy", culture); // year only - return $"{localizedLabel}\n "; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/Years/DateTimeTickThousandYear.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/Years/DateTimeTickThousandYear.cs deleted file mode 100644 index dfad090b5..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/Years/DateTimeTickThousandYear.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class DateTimeTickThousandYear : DateTimeTickUnitBase - { - public DateTimeTickThousandYear(CultureInfo culture, int maxTickCount, int? manualSpacing) : base(culture, maxTickCount, manualSpacing) - { - kind = DateTimeUnit.ThousandYear; - if (manualSpacing == null) - { - deltas = new int[] { 1, 2, 5 }; - } - } - - protected override DateTime Floor(DateTime value) - { - return new DateTime(value.Year - (value.Year % 1000), 1, 1); - } - - protected override DateTime Increment(DateTime value, int delta) - { - return value.AddYears(delta * 1000); - } - - protected override string GetTickLabel(DateTime value) - { - var dt = new DateTime(value.Year, 1, 1); - string localizedLabel = dt.ToString("yyyy", culture); // year only - return $"{localizedLabel}\n "; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/Years/DateTimeTickYear.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/Years/DateTimeTickYear.cs deleted file mode 100644 index c9db2e476..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/DateTimeTickUnits/Years/DateTimeTickYear.cs +++ /dev/null @@ -1,60 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class DateTimeTickYear : DateTimeTickUnitBase - { - public DateTimeTickYear(CultureInfo culture, int maxTickCount, int? manualSpacing) : base(culture, maxTickCount, manualSpacing) - { - kind = DateTimeUnit.Year; - if (manualSpacing != null) - { - throw new NotImplementedException("can't display years with fixed spacing (use numeric axis instead)"); - } - - deltas = new int[] { 1, 2, 5 }; - } - - protected override DateTime Floor(DateTime value) - { - return new DateTime(value.Year, 1, 1); - } - - protected override DateTime Increment(DateTime value, int delta) - { - return value.AddYears(delta); - } - - protected override string GetTickLabel(DateTime value) - { - var dt = new DateTime(value.Year, 1, 1); - string localizedLabel = dt.ToString("yyyy", culture); // year only - return $"{localizedLabel}\n "; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/Tick.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/Tick.cs deleted file mode 100644 index 163e0fa46..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/Tick.cs +++ /dev/null @@ -1,54 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public struct Tick - { - public readonly double Position; - public readonly string Label; - public readonly bool IsMajor; - public readonly bool IsDateTime; - public DateTime DateTime => DateTime.FromOADate(Position); - - public Tick(double position, string label, bool isMajor, bool isDateTime) - { - Position = position; - Label = label; - IsMajor = isMajor; - IsDateTime = isDateTime; - } - - public override string ToString() - { - string tickType = IsMajor ? "Major Tick" : "Minor Tick"; - string tickLabel = string.IsNullOrEmpty(Label) ? "(unlabeled)" : $"labeled '{Label}'"; - string tickPosition = IsDateTime ? DateTime.ToString() : Position.ToString(); - return $"{tickType} at {tickPosition} {tickLabel}"; - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/TickCollection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/TickCollection.cs deleted file mode 100644 index 06e9ec0c2..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/TickCollection.cs +++ /dev/null @@ -1,693 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class TickCollection - { - // This class creates pretty tick labels (with offset and exponent) uses graph settings - // to inspect the tick font and ensure tick labels will not overlap. - // It also respects manually defined tick spacing settings set via plt.Grid(). - - /// - /// Label to show in the corner when using multiplier or offset notation - /// - public string CornerLabel { get; private set; } - - /// - /// Measured size of the largest tick label - /// - public float LargestLabelWidth { get; private set; } = 15; - - /// - /// Measured size of the largest tick label - /// - public float LargestLabelHeight { get; private set; } = 12; - - /// - /// Controls how to translate positions to strings - /// - public TickLabelFormatOptions LabelFormat = TickLabelFormatOptions.Numeric; - - /// - /// If True, these ticks are placed along a vertical (Y) axis. - /// This is used to determine whether tick density should be based on tick label width or height. - /// - public AxisOrientation Orientation; - - /// - /// If True, the sign of numeric tick labels will be inverted. - /// This is used to give the appearance of descending ticks. - /// - public bool LabelUsingInvertedSign; - - /// - /// Define how minor ticks are distributed (evenly vs. log scale) - /// - public MinorTickDistribution MinorTickDistribution; - - public string numericFormatString; - public string dateTimeFormatString; - - /// - /// If defined, this function will be used to generate tick labels from positions - /// - public Func ManualTickFormatter = null; - - public int radix = 10; - public string prefix = null; - - public double manualSpacingX = 0; - public double manualSpacingY = 0; - public DateTimeUnit? manualDateTimeSpacingUnitX = null; - public DateTimeUnit? manualDateTimeSpacingUnitY = null; - - public CultureInfo Culture = CultureInfo.DefaultThreadCurrentCulture; - - public bool useMultiplierNotation = false; - public bool useOffsetNotation = false; - public bool useExponentialNotation = true; - - /// - /// Optimally packed tick labels have a density 1.0 and lower densities space ticks farther apart. - /// - public float TickDensity = 1.0f; - - /// - /// Defines the minimum distance (in coordinate units) for major ticks. - /// - public double MinimumTickSpacing = 0; - - /// - /// If True, non-integer tick positions will not be used. - /// This may be desired for log10-scaled axes so tick marks are even powers of 10. - /// - public bool IntegerPositionsOnly = false; - - public void Recalculate(PlotDimensions dims, Font tickFont) - { - if (TickCollectionStorage.manualTickPositions is null) - { - // first pass uses forced density with manual label sizes to consistently approximate labels - if (LabelFormat == TickLabelFormatOptions.DateTime) - { - RecalculatePositionsAutomaticDatetime(dims, 20, 24, (int)(10 * TickDensity)); - } - else - { - RecalculatePositionsAutomaticNumeric(dims, 15, 12, (int)(10 * TickDensity)); - } - - // second pass calculates density using measured labels produced by the first pass - (LargestLabelWidth, LargestLabelHeight) = MaxLabelSize(tickFont); - if (LabelFormat == TickLabelFormatOptions.DateTime) - { - RecalculatePositionsAutomaticDatetime(dims, LargestLabelWidth, LargestLabelHeight, null); - } - else - { - RecalculatePositionsAutomaticNumeric(dims, LargestLabelWidth, LargestLabelHeight, null); - } - } - else - { - double min = Orientation == AxisOrientation.Vertical ? dims.YMin : dims.XMin; - double max = Orientation == AxisOrientation.Vertical ? dims.YMax : dims.XMax; - - var visibleIndexes = Enumerable.Range(0, TickCollectionStorage.manualTickPositions.Count()) - .Where(i => TickCollectionStorage.manualTickPositions[i] >= min) - .Where(i => TickCollectionStorage.manualTickPositions[i] <= max); - - TickCollectionStorage.tickPositionsMajor = visibleIndexes.Select(x => TickCollectionStorage.manualTickPositions[x]).ToArray(); - TickCollectionStorage.tickPositionsMinor = null; - TickCollectionStorage.tickLabels = visibleIndexes.Select(x => TickCollectionStorage.manualTickLabels[x]).ToArray(); - CornerLabel = null; - (LargestLabelWidth, LargestLabelHeight) = MaxLabelSize(tickFont); - } - } - - public void SetCulture( - string shortDatePattern = null, - string decimalSeparator = null, - string numberGroupSeparator = null, - int? decimalDigits = null, - int? numberNegativePattern = null, -#pragma warning disable CS8632 - int[]? numberGroupSizes = null -#pragma warning restore CS8632 - ) - { - // Culture may be null if the thread culture is the same is the system culture. - // If it is null, assigning it to a clone of the current culture solves this and also makes it mutable. - Culture = Culture ?? (CultureInfo)CultureInfo.CurrentCulture.Clone(); - Culture.DateTimeFormat.ShortDatePattern = shortDatePattern ?? Culture.DateTimeFormat.ShortDatePattern; - Culture.NumberFormat.NumberDecimalDigits = decimalDigits ?? Culture.NumberFormat.NumberDecimalDigits; - Culture.NumberFormat.NumberDecimalSeparator = decimalSeparator ?? Culture.NumberFormat.NumberDecimalSeparator; - Culture.NumberFormat.NumberGroupSeparator = numberGroupSeparator ?? Culture.NumberFormat.NumberGroupSeparator; - Culture.NumberFormat.NumberGroupSizes = numberGroupSizes ?? Culture.NumberFormat.NumberGroupSizes; - Culture.NumberFormat.NumberNegativePattern = numberNegativePattern ?? Culture.NumberFormat.NumberNegativePattern; - } - - private (float width, float height) MaxLabelSize(Font tickFont) - { - if (TickCollectionStorage.tickLabels is null || TickCollectionStorage.tickLabels.Length == 0) - { - return (0, 0); - } - - string largestString = ""; - foreach (string s in TickCollectionStorage.tickLabels.Where(x => string.IsNullOrEmpty(x) == false)) - { - if (s.Length > largestString.Length) - { - largestString = s; - } - } - - if (LabelFormat == TickLabelFormatOptions.DateTime) - { - // widen largest string based on the longest month name - foreach (string s in new DateTimeFormatInfo().MonthGenitiveNames) - { - string s2 = $"{s}\n1985"; - if (s2.Length > largestString.Length) - { - largestString = s2; - } - } - } - - var maxLabelSize = GDI.MeasureString(largestString.Trim(), tickFont); - return (maxLabelSize.Width, maxLabelSize.Height); - } - - private void RecalculatePositionsAutomaticDatetime(PlotDimensions dims, float labelWidth, float labelHeight, int? forcedTickCount) - { - double low, high; - int tickCount; - - if (MinimumTickSpacing > 0) - { - throw new InvalidOperationException("minimum tick spacing does not support DateTime ticks"); - } - - if (Orientation == AxisOrientation.Vertical) - { - low = dims.YMin - dims.UnitsPerPxY; // add an extra pixel to capture the edge tick - high = dims.YMax + dims.UnitsPerPxY; // add an extra pixel to capture the edge tick - tickCount = (int)(dims.DataHeight / labelHeight * TickDensity); - tickCount = forcedTickCount ?? tickCount; - } - else - { - low = dims.XMin - dims.UnitsPerPxX; // add an extra pixel to capture the edge tick - high = dims.XMax + dims.UnitsPerPxX; // add an extra pixel to capture the edge tick - tickCount = (int)(dims.DataWidth / labelWidth * TickDensity); - tickCount = forcedTickCount ?? tickCount; - } - - if (low < high) - { - low = Math.Max(low, new DateTime(0100, 1, 1, 0, 0, 0).ToOADate()); // minimum OADate value - high = Math.Min(high, DateTime.MaxValue.ToOADate()); - - var dtManualUnits = (Orientation == AxisOrientation.Vertical) ? manualDateTimeSpacingUnitY : manualDateTimeSpacingUnitX; - var dtManualSpacing = (Orientation == AxisOrientation.Vertical) ? manualSpacingY : manualSpacingX; - - try - { - DateTime from = DateTime.FromOADate(low); - DateTime to = DateTime.FromOADate(high); - - var unitFactory = new DateTimeUnitFactory(); - IDateTimeUnit tickUnit = unitFactory.CreateUnit(from, to, Culture, tickCount, dtManualUnits, (int)dtManualSpacing); - (TickCollectionStorage.tickPositionsMajor, TickCollectionStorage.tickLabels) = tickUnit.GetTicksAndLabels(from, to, dateTimeFormatString); - TickCollectionStorage.tickLabels = TickCollectionStorage.tickLabels.Select(x => x.Trim()).ToArray(); - } - catch - { - TickCollectionStorage.tickPositionsMajor = new double[] { }; // far zoom out can produce FromOADate() exception - } - } - else - { - TickCollectionStorage.tickPositionsMajor = new double[] { }; - } - - // dont forget to set all the things - TickCollectionStorage.tickPositionsMinor = null; -#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type. - CornerLabel = null; -#pragma warning restore CS8625 // Cannot convert null literal to non-nullable reference type. - } - - private void RecalculatePositionsAutomaticNumeric(PlotDimensions dims, float labelWidth, float labelHeight, int? forcedTickCount) - { - double low, high, tickSpacing; - int maxTickCount; - - if (Orientation == AxisOrientation.Vertical) - { - low = dims.YMin - dims.UnitsPerPxY; // add an extra pixel to capture the edge tick - high = dims.YMax + dims.UnitsPerPxY; // add an extra pixel to capture the edge tick - maxTickCount = (int)(dims.DataHeight / labelHeight * TickDensity); - maxTickCount = forcedTickCount ?? maxTickCount; - tickSpacing = (manualSpacingY != 0) ? manualSpacingY : GetIdealTickSpacing(low, high, maxTickCount, radix); - tickSpacing = Math.Max(tickSpacing, MinimumTickSpacing); - } - else - { - low = dims.XMin - dims.UnitsPerPxX; // add an extra pixel to capture the edge tick - high = dims.XMax + dims.UnitsPerPxX; // add an extra pixel to capture the edge tick - maxTickCount = (int)(dims.DataWidth / labelWidth * TickDensity); - maxTickCount = forcedTickCount ?? maxTickCount; - tickSpacing = (manualSpacingX != 0) ? manualSpacingX : GetIdealTickSpacing(low, high, maxTickCount, radix); - tickSpacing = Math.Max(tickSpacing, MinimumTickSpacing); - } - - // now that tick spacing is known, populate the list of ticks and labels - double firstTickOffset = low % tickSpacing; - int tickCount = (int)((high - low) / tickSpacing) + 2; - tickCount = tickCount > 1000 ? 1000 : tickCount; - tickCount = tickCount < 1 ? 1 : tickCount; - TickCollectionStorage.tickPositionsMajor = Enumerable.Range(0, tickCount) - .Select(x => low - firstTickOffset + tickSpacing * x) - .Where(x => low <= x && x <= high) - .ToArray(); - - if (TickCollectionStorage.tickPositionsMajor.Length < 2) - { - double tickBelow = low - firstTickOffset; - double firstTick = TickCollectionStorage.tickPositionsMajor.Length > 0 ? TickCollectionStorage.tickPositionsMajor[0] : tickBelow; - double nextTick = tickBelow + tickSpacing; - TickCollectionStorage.tickPositionsMajor = new double[] { firstTick, nextTick }; - } - - if (IntegerPositionsOnly) - { - int firstTick = (int)TickCollectionStorage.tickPositionsMajor[0]; - TickCollectionStorage.tickPositionsMajor = TickCollectionStorage.tickPositionsMajor.Where(x => x == (int)x).Distinct().ToArray(); - - if (TickCollectionStorage.tickPositionsMajor.Length < 2) - { - TickCollectionStorage.tickPositionsMajor = new double[] { firstTick - 1, firstTick, firstTick + 1 }; - } - } - - (TickCollectionStorage.tickLabels, CornerLabel) = GetPrettyTickLabels( - TickCollectionStorage.tickPositionsMajor, - useMultiplierNotation, - useOffsetNotation, - useExponentialNotation, - invertSign: LabelUsingInvertedSign, - culture: Culture - ); - - if (MinorTickDistribution == MinorTickDistribution.Log) - { - TickCollectionStorage.tickPositionsMinor = MinorFromMajorLog(TickCollectionStorage.tickPositionsMajor, low, high); - } - else - { - TickCollectionStorage.tickPositionsMinor = MinorFromMajor(TickCollectionStorage.tickPositionsMajor, 5, low, high); - } - } - - public override string ToString() - { - string allTickLabels = string.Join(", ", TickCollectionStorage.tickLabels); - return $"Tick Collection: [{allTickLabels}] {CornerLabel}"; - } - - private static double GetIdealTickSpacing(double low, double high, int maxTickCount, int radix = 10) - { - double range = high - low; - int exponent = (int)Math.Log(range, radix); - List tickSpacings = new List() { Math.Pow(radix, exponent) }; - tickSpacings.Add(tickSpacings.Last()); - tickSpacings.Add(tickSpacings.Last()); - - double[] divBy; - if (radix == 10) - { - divBy = new double[] { 2, 2, 2.5 }; // 10, 5, 2.5, 1 - } - else if (radix == 16) - { - divBy = new double[] { 2, 2, 2, 2 }; // 16, 8, 4, 2, 1 - } - else - { - throw new ArgumentException($"radix {radix} is not supported"); - } - - int divisions = 0; - int tickCount = 0; - while ((tickCount < maxTickCount) && (tickSpacings.Count < 1000)) - { - tickSpacings.Add(tickSpacings.Last() / divBy[divisions++ % divBy.Length]); - tickCount = (int)(range / tickSpacings.Last()); - } - - return tickSpacings[tickSpacings.Count - 3]; - } - - private string FormatLocal(double value, CultureInfo culture) - { - // if a custom format string exists use it - if (numericFormatString != null) - { - return value.ToString(numericFormatString, culture); - } - - // if the number is round or large, use the numeric format - // https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#the-numeric-n-format-specifier - bool isRoundNumber = ((int)value == value); - bool isLargeNumber = (Math.Abs(value) > 1000); - if (isRoundNumber || isLargeNumber) - { - return value.ToString("N0", culture); - } - - // otherwise the number is probably small or very precise to use the general format (with slight rounding) - // https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#the-general-g-format-specifier - return Math.Round(value, 10).ToString("G", culture); - } - - public (string[], string) GetPrettyTickLabels( - double[] positions, - bool useMultiplierNotation, - bool useOffsetNotation, - bool useExponentialNotation, - bool invertSign, - CultureInfo culture - ) - { - // given positions returns nicely-formatted labels (with offset and multiplier) - - string[] labels = new string[positions.Length]; - string cornerLabel = ""; - - if (positions.Length == 0) - { - return (labels, cornerLabel); - } - - double range = positions.Last() - positions.First(); - - double exponent = (int)(Math.Log10(range)); - - double multiplier = 1; - if (useMultiplierNotation) - { - if (Math.Abs(exponent) > 2) - { - multiplier = Math.Pow(10, exponent); - } - } - - double offset = 0; - if (useOffsetNotation) - { - offset = positions.First(); - if (Math.Abs(offset / range) < 10) - { - offset = 0; - } - } - - for (int i = 0; i < positions.Length; i++) - { - double adjustedPosition = (positions[i] - offset) / multiplier; - if (invertSign) - { - adjustedPosition *= -1; - } - - labels[i] = ManualTickFormatter is null ? FormatLocal(adjustedPosition, culture) : ManualTickFormatter(adjustedPosition); - if (labels[i] == "-0") - { - labels[i] = "0"; - } - } - - if (useExponentialNotation) - { - if (multiplier != 1) - { - cornerLabel += $"e{exponent} "; - } - - if (offset != 0) - { - cornerLabel += Tools.ScientificNotation(offset); - } - } - else - { - if (multiplier != 1) - { - cornerLabel += FormatLocal(multiplier, culture); - } - - if (offset != 0) - { - cornerLabel += $" +{FormatLocal(offset, culture)}"; - } - - cornerLabel = cornerLabel.Replace("+-", "-"); - } - - return (labels, cornerLabel); - } - -#pragma warning disable CS8632 - public double[]? MinorFromMajor(double[] majorTicks, double minorTicksPerMajorTick, double lowerLimit, double upperLimit) -#pragma warning restore CS8632 - { - if ((majorTicks == null) || (majorTicks.Length < 2)) - { - return null; - } - - double majorTickSpacing = majorTicks[1] - majorTicks[0]; - double minorTickSpacing = majorTickSpacing / minorTicksPerMajorTick; - - List majorTicksWithPadding = new List(); - majorTicksWithPadding.Add(majorTicks[0] - majorTickSpacing); - majorTicksWithPadding.AddRange(majorTicks); - - List minorTicks = new List(); - foreach (var majorTickPosition in majorTicksWithPadding) - { - for (int i = 1; i < minorTicksPerMajorTick; i++) - { - double minorTickPosition = majorTickPosition + minorTickSpacing * i; - if ((minorTickPosition > lowerLimit) && (minorTickPosition < upperLimit)) - { - minorTicks.Add(minorTickPosition); - } - } - } - - return minorTicks.ToArray(); - } - - /// - /// Return an array of log-spaced minor tick marks for the given range - /// - /// Locations of visible major ticks. Must be evenly spaced. - /// Do not include minor ticks less than this value. - /// Do not include minor ticks greater than this value. - /// Number of minor ranges to divide each major range into. (A range is the space between tick marks) - /// Array of minor tick positions (empty at positions occupied by major ticks) - public double[] MinorFromMajorLog(double[] majorTickPositions, double min, double max, int divisions = 5) - { - if ((majorTickPositions is null) || (majorTickPositions.Length < 2)) - { - // if too few major ticks are visible, don't attempt to render minor ticks - return null; - } - - double majorTickSpacing = majorTickPositions[1] - majorTickPositions[0]; - double lowerBound = majorTickPositions.First() - majorTickSpacing; - double upperBound = majorTickPositions.Last() + majorTickSpacing; - - double[] offsets = Enumerable.Range(1, divisions - 1).Select(x => majorTickSpacing * Math.Log10(x * 10 / divisions)).ToArray(); - - List minorTicks = new(); - for (double majorTick = lowerBound; majorTick <= upperBound; majorTick += majorTickSpacing) - { - minorTicks.AddRange(offsets.Select(x => majorTick + x)); - } - - return minorTicks.Where(x => x >= min && x <= max).ToArray(); - } - - public static string[] GetDateLabels(double[] ticksOADate, CultureInfo culture) - { - - TimeSpan dtTickSep; - string dtFmt = null; - - try - { - // TODO: replace this with culture-aware format - dtTickSep = DateTime.FromOADate(ticksOADate[1]) - DateTime.FromOADate(ticksOADate[0]); - if (dtTickSep.TotalDays > 365 * 5) - { - dtFmt = "{0:yyyy}"; - } - else if (dtTickSep.TotalDays > 365) - { - dtFmt = "{0:yyyy-MM}"; - } - else if (dtTickSep.TotalDays > .5) - { - dtFmt = "{0:yyyy-MM-dd}"; - } - else if (dtTickSep.TotalMinutes > .5) - { - dtFmt = "{0:yyyy-MM-dd\nH:mm}"; - } - else - { - dtFmt = "{0:yyyy-MM-dd\nH:mm:ss}"; - } - } - catch - { - } - - string[] labels = new string[ticksOADate.Length]; - for (int i = 0; i < ticksOADate.Length; i++) - { - try - { - DateTime dt = DateTime.FromOADate(ticksOADate[i]); - string lbl = string.Format(culture, dtFmt, dt); - labels[i] = lbl; - } - catch - { - labels[i] = "?"; - } - } - return labels; - } - - private Tick[] GetMajorTicks() - { - if (TickCollectionStorage.tickPositionsMajor is null || TickCollectionStorage.tickPositionsMajor.Length == 0) - { - return new Tick[] { }; - } - - Tick[] ticks = new Tick[TickCollectionStorage.tickPositionsMajor.Length]; - for (int i = 0; i < ticks.Length; i++) - { - ticks[i] = new Tick( - position: TickCollectionStorage.tickPositionsMajor[i], - label: TickCollectionStorage.tickLabels[i], - isMajor: true, - isDateTime: LabelFormat == TickLabelFormatOptions.DateTime); - } - - return ticks; - } - - private Tick[] GetMinorTicks() - { - if (TickCollectionStorage.tickPositionsMinor is null || TickCollectionStorage.tickPositionsMinor.Length == 0) - { - return new Tick[] { }; - } - - Tick[] ticks = new Tick[TickCollectionStorage.tickPositionsMinor.Length]; - for (int i = 0; i < ticks.Length; i++) - { -#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type. - ticks[i] = new Tick( - position: TickCollectionStorage.tickPositionsMinor[i], - label: null, - isMajor: false, - isDateTime: LabelFormat == TickLabelFormatOptions.DateTime); -#pragma warning restore CS8625 // Cannot convert null literal to non-nullable reference type. - } - - return ticks; - } - - public Tick[] GetTicks() - { - return GetMajorTicks().Concat(GetMinorTicks()).ToArray(); - } - - public Tick[] GetVisibleMajorTicks(PlotDimensions dims) - { - double high, low; - if (Orientation == AxisOrientation.Vertical) - { - low = dims.YMin - dims.UnitsPerPxY; // add an extra pixel to capture the edge tick - high = dims.YMax + dims.UnitsPerPxY; // add an extra pixel to capture the edge tick - } - else - { - low = dims.XMin - dims.UnitsPerPxX; // add an extra pixel to capture the edge tick - high = dims.XMax + dims.UnitsPerPxX; // add an extra pixel to capture the edge tick - } - - return GetMajorTicks() - .Where(t => t.Position >= low && t.Position <= high) - .ToArray(); - } - - public Tick[] GetVisibleMinorTicks(PlotDimensions dims) - { - double high, low; - if (Orientation == AxisOrientation.Vertical) - { - low = dims.YMin - dims.UnitsPerPxY; // add an extra pixel to capture the edge tick - high = dims.YMax + dims.UnitsPerPxY; // add an extra pixel to capture the edge tick - } - else - { - low = dims.XMin - dims.UnitsPerPxX; // add an extra pixel to capture the edge tick - high = dims.XMax + dims.UnitsPerPxX; // add an extra pixel to capture the edge tick - } - - return GetMinorTicks() - .Where(t => t.Position >= low && t.Position <= high) - .ToArray(); - } - - public Tick[] GetVisibleTicks(PlotDimensions dims) - { - return GetVisibleMajorTicks(dims).Concat(GetVisibleMinorTicks(dims)).ToArray(); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/TickCollectionStorage.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/TickCollectionStorage.cs deleted file mode 100644 index 3b7f28fdb..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/Ticks/TickCollectionStorage.cs +++ /dev/null @@ -1,40 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class TickCollectionStorage - { - public static double[] tickPositionsMajor; -#pragma warning disable CS8632 - public static double[]? tickPositionsMinor; -#pragma warning restore CS8632 - public static string[] tickLabels; - public static double[] manualTickPositions; - public static string[] manualTickLabels; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/UX/PlotViewer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/UX/PlotViewer.cs deleted file mode 100644 index 141c4a3f4..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/UX/PlotViewer.cs +++ /dev/null @@ -1,100 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class PlotViewer : KryptonForm - { - #region Design Code - private KryptonPanel kryptonPanel1; - private FormsPlot fpViewer; - - private void InitializeComponent() - { - kryptonPanel1 = new KryptonPanel(); - fpViewer = new FormsPlot(); - ((ISupportInitialize)(kryptonPanel1)).BeginInit(); - kryptonPanel1.SuspendLayout(); - SuspendLayout(); - // - // kryptonPanel1 - // - kryptonPanel1.Controls.Add(fpViewer); - kryptonPanel1.Dock = DockStyle.Fill; - kryptonPanel1.Location = new Point(0, 0); - kryptonPanel1.Name = "kryptonPanel1"; - kryptonPanel1.Size = new Size(584, 361); - kryptonPanel1.TabIndex = 0; - // - // fpViewer - // - fpViewer.BackColor = Color.Transparent; - fpViewer.Dock = DockStyle.Fill; - fpViewer.Location = new Point(0, 0); - fpViewer.Name = "fpViewer"; - fpViewer.Size = new Size(584, 361); - fpViewer.TabIndex = 1; - // - // PlotViewer - // - ClientSize = new Size(584, 361); - Controls.Add(kryptonPanel1); - Name = "PlotViewer"; - Text = "ScottPlot Viewer"; - ((ISupportInitialize)(kryptonPanel1)).EndInit(); - kryptonPanel1.ResumeLayout(false); - ResumeLayout(false); - - } - #endregion - - #region Property - - public FormsPlot Plot => fpViewer; - - #endregion - - #region Constructor - - public PlotViewer(Plot plot, int windowWidth = 600, int windowHeight = 400, string windowTitle = "ScottPlot Viewer") - { - InitializeComponent(); - - Width = windowWidth; - - Height = windowHeight; - - Text = windowTitle; - - fpViewer.Reset(plot); - - fpViewer.Refresh(); - } - - #endregion - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/UX/ScottPlotHelp.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/UX/ScottPlotHelp.cs deleted file mode 100644 index 66be1685a..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Scott Plot/UX/ScottPlotHelp.cs +++ /dev/null @@ -1,118 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Data.Visualisation.ScottPlot -{ - public class ScottPlotHelp : KryptonForm - { - private KryptonPanel kryptonPanel1; - private KryptonPanel kryptonPanel2; - private KryptonBorderEdge kryptonBorderEdge1; - private KryptonLabel kryptonLabel1; - private KryptonButton kbtnOk; - - private void InitializeComponent() - { - kryptonPanel1 = new KryptonPanel(); - kbtnOk = new KryptonButton(); - kryptonPanel2 = new KryptonPanel(); - kryptonBorderEdge1 = new KryptonBorderEdge(); - kryptonLabel1 = new KryptonLabel(); - ((ISupportInitialize)(kryptonPanel1)).BeginInit(); - kryptonPanel1.SuspendLayout(); - ((ISupportInitialize)(kryptonPanel2)).BeginInit(); - kryptonPanel2.SuspendLayout(); - SuspendLayout(); - // - // kryptonPanel1 - // - kryptonPanel1.Controls.Add(kryptonBorderEdge1); - kryptonPanel1.Controls.Add(kbtnOk); - kryptonPanel1.Dock = DockStyle.Bottom; - kryptonPanel1.Location = new Point(0, 557); - kryptonPanel1.Name = "kryptonPanel1"; - kryptonPanel1.PanelBackStyle = PaletteBackStyle.PanelAlternate; - kryptonPanel1.Size = new Size(639, 55); - kryptonPanel1.TabIndex = 1; - // - // kbtnOk - // - kbtnOk.DialogResult = DialogResult.OK; - kbtnOk.Location = new Point(292, 18); - kbtnOk.Name = "kbtnOk"; - kbtnOk.Size = new Size(54, 25); - kbtnOk.TabIndex = 3; - kbtnOk.Values.Text = "O&k"; - // - // kryptonPanel2 - // - kryptonPanel2.Controls.Add(kryptonLabel1); - kryptonPanel2.Dock = DockStyle.Fill; - kryptonPanel2.Location = new Point(0, 0); - kryptonPanel2.Name = "kryptonPanel2"; - kryptonPanel2.Size = new Size(639, 557); - kryptonPanel2.TabIndex = 2; - // - // kryptonBorderEdge1 - // - kryptonBorderEdge1.BorderStyle = PaletteBorderStyle.HeaderSecondary; - kryptonBorderEdge1.Dock = DockStyle.Top; - kryptonBorderEdge1.Location = new Point(0, 0); - kryptonBorderEdge1.Name = "kryptonBorderEdge1"; - kryptonBorderEdge1.Size = new Size(639, 1); - kryptonBorderEdge1.Text = "kryptonBorderEdge1"; - // - // kryptonLabel1 - // - kryptonLabel1.Dock = DockStyle.Fill; - kryptonLabel1.Location = new Point(0, 0); - kryptonLabel1.Name = "kryptonLabel1"; - kryptonLabel1.Size = new Size(639, 557); - kryptonLabel1.TabIndex = 0; - kryptonLabel1.Values.Text = "kryptonLabel1"; - // - // ScottPlotHelp - // - ClientSize = new Size(639, 612); - Controls.Add(kryptonPanel2); - Controls.Add(kryptonPanel1); - FormBorderStyle = FormBorderStyle.Fixed3D; - MaximizeBox = false; - MinimizeBox = false; - Name = "ScottPlotHelp"; - ShowInTaskbar = false; - ((ISupportInitialize)(kryptonPanel1)).EndInit(); - kryptonPanel1.ResumeLayout(false); - kryptonPanel1.PerformLayout(); - ((ISupportInitialize)(kryptonPanel2)).EndInit(); - kryptonPanel2.ResumeLayout(false); - kryptonPanel2.PerformLayout(); - ResumeLayout(false); - - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Classes/MasterMultiDetailView.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Classes/MasterMultiDetailView.cs index 02bdfc673..1ab6d4df1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Classes/MasterMultiDetailView.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Classes/MasterMultiDetailView.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Classes/MasterSingleDetailView.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Classes/MasterSingleDetailView.cs index 67af3a607..ce2dd53f8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Classes/MasterSingleDetailView.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Classes/MasterSingleDetailView.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Classes/SimpleFilteredList.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Classes/SimpleFilteredList.cs index 30c383f92..cef80eac5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Classes/SimpleFilteredList.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Classes/SimpleFilteredList.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Classes/SingleDetailView.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Classes/SingleDetailView.cs index f07129869..38b58b560 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Classes/SingleDetailView.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Classes/SingleDetailView.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Designers/MasterMultiDetailViewDesigner.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Designers/MasterMultiDetailViewDesigner.cs index 587a363ca..2a01bc2e6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Designers/MasterMultiDetailViewDesigner.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Designers/MasterMultiDetailViewDesigner.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Designers/MasterSingleDetailViewDesigner.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Designers/MasterSingleDetailViewDesigner.cs index 097d48d84..0786d698f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Designers/MasterSingleDetailViewDesigner.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Designers/MasterSingleDetailViewDesigner.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/EnumConditionalFormatType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/EnumConditionalFormatType.cs index 3dab13bcb..0f94bc782 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/EnumConditionalFormatType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/EnumConditionalFormatType.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/ColourHelper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/ColourHelper.cs index 190ae5292..484a4c5ba 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/ColourHelper.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/ColourHelper.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -220,9 +220,9 @@ public static HSVColour ToHSV(int red, int green, int blue) s = deltaMax / varMax; // Hue - float deltaR = (((varMax - varR) / 6f) + (deltaMax / 2f)) / deltaMax; - float deltaG = (((varMax - varG) / 6f) + (deltaMax / 2f)) / deltaMax; - float deltaB = (((varMax - varB) / 6f) + (deltaMax / 2f)) / deltaMax; + float deltaR = ((varMax - varR) / 6f + deltaMax / 2f) / deltaMax; + float deltaG = ((varMax - varG) / 6f + deltaMax / 2f) / deltaMax; + float deltaB = ((varMax - varB) / 6f + deltaMax / 2f) / deltaMax; if (varR == varMax) { @@ -230,11 +230,11 @@ public static HSVColour ToHSV(int red, int green, int blue) } else if (varG == varMax) { - h = (1f / 3f) + deltaR - deltaB; + h = 1f / 3f + deltaR - deltaB; } else if (varB == varMax) { - h = (2f / 3f) + deltaG - deltaR; + h = 2f / 3f + deltaG - deltaR; } if (h < 0f) @@ -299,14 +299,14 @@ public static Color FromHSL(float h, float s, float l) return Color.FromArgb(grayValue, grayValue, grayValue); } - var var2 = l < 0.5f ? l * (1f + s) : (l + s) - (s * l); + var var2 = l < 0.5f ? l * (1f + s) : l + s - s * l; var var1 = 2f * l - var2; var hval = h / 360f; - int red = Convert.ToInt32(255f * FromHueToRGB(var1, var2, hval + (1f / 3f))); + int red = Convert.ToInt32(255f * FromHueToRGB(var1, var2, hval + 1f / 3f)); int green = Convert.ToInt32(255f * FromHueToRGB(var1, var2, hval)); - int blue = Convert.ToInt32(255f * FromHueToRGB(var1, var2, hval - (1f / 3f))); + int blue = Convert.ToInt32(255f * FromHueToRGB(var1, var2, hval - 1f / 3f)); return Color.FromArgb(red, green, blue); } @@ -325,17 +325,17 @@ private static float FromHueToRGB(float var1, float var2, float hue) hue -= 1f; } - if ((6f * hue) < 1f) + if (6f * hue < 1f) { - rgbColor = (var1 + (var2 - var1) * 6f * hue); + rgbColor = var1 + (var2 - var1) * 6f * hue; } - else if ((2f * hue) < 1f) + else if (2f * hue < 1f) { rgbColor = var2; } - else if ((3f * hue) < 2f) + else if (3f * hue < 2f) { - rgbColor = (var1 + (var2 - var1) * ((2f / 3f) - hue) * 6f); + rgbColor = var1 + (var2 - var1) * (2f / 3f - hue) * 6f; } else { @@ -387,9 +387,9 @@ public static HSLColour ToHSL(int red, int green, int blue) } // Hue - float deltaR = (((varMax - varR) / 6f) + (deltaMax / 2f)) / deltaMax; - float deltaG = (((varMax - varG) / 6f) + (deltaMax / 2f)) / deltaMax; - float deltaB = (((varMax - varB) / 6f) + (deltaMax / 2f)) / deltaMax; + float deltaR = ((varMax - varR) / 6f + deltaMax / 2f) / deltaMax; + float deltaG = ((varMax - varG) / 6f + deltaMax / 2f) / deltaMax; + float deltaB = ((varMax - varB) / 6f + deltaMax / 2f) / deltaMax; if (varR == varMax) { @@ -397,11 +397,11 @@ public static HSLColour ToHSL(int red, int green, int blue) } else if (varG == varMax) { - h = (1f / 3f) + deltaR - deltaB; + h = 1f / 3f + deltaR - deltaB; } else if (varB == varMax) { - h = (2f / 3f) + deltaG - deltaR; + h = 2f / 3f + deltaG - deltaR; } if (h < 0f) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/CondtionalFormatting.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/CondtionalFormatting.cs index dfafe7b8c..32ff2c2a5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/CondtionalFormatting.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/CondtionalFormatting.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/KryptonByteViewer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/KryptonByteViewer.cs index b0bd25b59..ab5739cd0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/KryptonByteViewer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/KryptonByteViewer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -132,7 +132,7 @@ private int CellToIndex(int column, int row) private byte[] ComposeLineBuffer(int startLine, int line) { int num = startLine * _columnCount; - byte[] array = (num + (line + 1) * _columnCount <= _dataBuf.Length) ? new byte[_columnCount] : new byte[_dataBuf.Length % _columnCount]; + byte[] array = num + (line + 1) * _columnCount <= _dataBuf.Length ? new byte[_columnCount] : new byte[_dataBuf.Length % _columnCount]; for (int i = 0; i < array.Length; i++) { array[i] = _dataBuf[num + CellToIndex(i, line)]; @@ -170,7 +170,7 @@ private void DrawClient(Graphics g) private static bool CharIsPrintable(char c) { UnicodeCategory unicodeCategory = char.GetUnicodeCategory(c); - return unicodeCategory != UnicodeCategory.Control || unicodeCategory == UnicodeCategory.OtherNotAssigned; + return unicodeCategory is not UnicodeCategory.Control or UnicodeCategory.OtherNotAssigned; } private void DrawDump(Graphics g, byte[] lineBuffer, int line) @@ -439,7 +439,7 @@ protected override void OnLayout(LayoutEventArgs e) _scrollBar.Enabled = false; } } - _displayLinesCount = ((_startLine + _rowCount < _linesCount) ? _rowCount : (_linesCount - _startLine)); + _displayLinesCount = _startLine + _rowCount < _linesCount ? _rowCount : _linesCount - _startLine; } } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/Params/BarParams.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/Params/BarParams.cs index 42c9e17a6..b89dd1c4b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/Params/BarParams.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/Params/BarParams.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/Params/ThreeColoursParams.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/Params/ThreeColoursParams.cs index 77d6da33a..3eb094ff5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/Params/ThreeColoursParams.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/Params/ThreeColoursParams.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/Params/TwoColoursParams.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/Params/TwoColoursParams.cs index a8649bc00..74ffa7ea7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/Params/TwoColoursParams.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/Formatting/Params/TwoColoursParams.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/IFormatParams.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/IFormatParams.cs index 6fb790370..8ad01a711 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/IFormatParams.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/IFormatParams.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewBinaryCell.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewBinaryCell.cs index bf8fe8fd9..9f6eb9fd3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewBinaryCell.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewBinaryCell.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewBinaryColumn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewBinaryColumn.cs index 136182dc9..5a206fed9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewBinaryColumn.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewBinaryColumn.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -126,7 +126,7 @@ public override DataGridViewCell CellTemplate set { - if ((value != null) && value is not KryptonDataGridViewBinaryCell) + if (value != null && value is not KryptonDataGridViewBinaryCell) { throw new InvalidCastException("Can only assign a object of type KryptonDataGridViewBinaryCell"); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewFormattingColumn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewFormattingColumn.cs index 9c0eee4ed..05b55c1c8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewFormattingColumn.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewFormattingColumn.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -84,8 +84,8 @@ public class FormattingCell : KryptonDataGridViewTextBoxCell private static Color ContrastColour(Color colour) { // Counting the perceptive luminance - human eye favors green color... - double a = (1 - (((0.299 * colour.R) + ((0.587 * colour.G) + (0.114 * colour.B))) - / 255)); + double a = 1 - (0.299 * colour.R + (0.587 * colour.G + 0.114 * colour.B)) + / 255; var d = a < 0.5 ? 0 : 255; // dark colors - white font diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewPercentageColumn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewPercentageColumn.cs index 442a94154..8dd228d83 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewPercentageColumn.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewPercentageColumn.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -69,7 +69,7 @@ public override DataGridViewCell CellTemplate set { // Ensure that the cell used for the template is a DataGridViewPercentageCell. - if ((value != null) && !value.GetType().IsAssignableFrom(typeof(DataGridViewPercentageCell))) + if (value != null && !value.GetType().IsAssignableFrom(typeof(DataGridViewPercentageCell))) { throw new InvalidCastException("Must be a DataGridViewPercentageCell"); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewRatingColumn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewRatingColumn.cs index f45afa012..474ef8ffd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewRatingColumn.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewRatingColumn.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -114,7 +114,7 @@ protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle } } // suppress painting of selection - base.Paint(graphics, clipBounds, cellBounds, rowIndex, elementState, value, cellImage, errorText, cellStyle, advancedBorderStyle, (paintParts & ~DataGridViewPaintParts.SelectionBackground)); + base.Paint(graphics, clipBounds, cellBounds, rowIndex, elementState, value, cellImage, errorText, cellStyle, advancedBorderStyle, paintParts & ~DataGridViewPaintParts.SelectionBackground); } /// @@ -168,16 +168,16 @@ private int GetStarFromMouse(Rectangle cellBounds, Point mouseLocation) { if (cellBounds.Contains(mouseLocation)) { - int mouseXRelativeToCell = (mouseLocation.X - cellBounds.X); - int imageXArea = (cellBounds.Width / 2) - (Imagewidth / 2); - if (((mouseXRelativeToCell + 4) < imageXArea) || (mouseXRelativeToCell >= (imageXArea + Imagewidth))) + int mouseXRelativeToCell = mouseLocation.X - cellBounds.X; + int imageXArea = cellBounds.Width / 2 - Imagewidth / 2; + if (mouseXRelativeToCell + 4 < imageXArea || mouseXRelativeToCell >= imageXArea + Imagewidth) { return -1; } else { - int oo = (int)Math.Round((((float)(mouseXRelativeToCell - imageXArea + 2) / (float)Imagewidth) * 10f), MidpointRounding.AwayFromZero); - if (oo > 10 || oo < 0) + int oo = (int)Math.Round((float)(mouseXRelativeToCell - imageXArea + 2) / (float)Imagewidth * 10f, MidpointRounding.AwayFromZero); + if (oo is > 10 or < 0) { System.Diagnostics.Debugger.Break(); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewTextAndImageColumn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewTextAndImageColumn.cs index 09189826c..3050638d2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewTextAndImageColumn.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewTextAndImageColumn.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -194,7 +194,7 @@ public override DataGridViewCell CellTemplate set { - if ((value != null) && !(value is KryptonDataGridViewTextAndImageCell)) + if (value != null && !(value is KryptonDataGridViewTextAndImageCell)) { throw new InvalidCastException("Can only assign a object of type KryptonDataGridViewTextAndImageCell"); } @@ -407,7 +407,7 @@ protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle // Draw the image clipped to the cell. GraphicsContainer container = graphics.BeginContainer(); graphics.SetClip(cellBounds); - graphics.DrawImage(((TextAndImage)Value).Image, new Rectangle(cellBounds.Location.X + 2, cellBounds.Location.Y + ((cellBounds.Height - 16) / 2) - 1, 16, 16)); + graphics.DrawImage(((TextAndImage)Value).Image, new Rectangle(cellBounds.Location.X + 2, cellBounds.Location.Y + (cellBounds.Height - 16) / 2 - 1, 16, 16)); graphics.EndContainer(container); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewTokenColumn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewTokenColumn.cs index 05d242a2a..fcb3011ef 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewTokenColumn.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/ExtColumns/KryptonDataGridViewTokenColumn.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -143,8 +143,8 @@ public override string ToString() /// protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, int rowIndex, DataGridViewElementStates elementState, object value, object formattedValue, string errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts) { - float factorX = graphics.DpiX > 96 ? (1f * graphics.DpiX / 96) : 1f; - float factorY = graphics.DpiY > 96 ? (1f * graphics.DpiY / 96) : 1f; + float factorX = graphics.DpiX > 96 ? 1f * graphics.DpiX / 96 : 1f; + float factorY = graphics.DpiY > 96 ? 1f * graphics.DpiY / 96 : 1f; int nextPosition = cellBounds.X + (int)(1 * factorX); if (KryptonManager.CurrentGlobalPalette != null) @@ -178,8 +178,8 @@ protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle /// protected override Size GetPreferredSize(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex, Size constraintSize) { - float factorX = graphics.DpiX > 96 ? (1f * graphics.DpiX / 96) : 1f; - float factorY = graphics.DpiY > 96 ? (1f * graphics.DpiY / 96) : 1f; + float factorX = graphics.DpiX > 96 ? 1f * graphics.DpiX / 96 : 1f; + float factorY = graphics.DpiY > 96 ? 1f * graphics.DpiY / 96 : 1f; Size tmpSize = base.GetPreferredSize(graphics, cellStyle, rowIndex, constraintSize); if (KryptonManager.CurrentGlobalPalette != null) @@ -262,8 +262,8 @@ public TokenListCell() /// protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, int rowIndex, DataGridViewElementStates elementState, object value, object formattedValue, string errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts) { - float factorX = graphics.DpiX > 96 ? (1f * graphics.DpiX / 96) : 1f; - float factorY = graphics.DpiY > 96 ? (1f * graphics.DpiY / 96) : 1f; + float factorX = graphics.DpiX > 96 ? 1f * graphics.DpiX / 96 : 1f; + float factorY = graphics.DpiY > 96 ? 1f * graphics.DpiY / 96 : 1f; int nextPosition = cellBounds.X + (int)(1 * factorX); if (KryptonManager.CurrentGlobalPalette != null) @@ -296,8 +296,8 @@ protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle /// protected override Size GetPreferredSize(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex, Size constraintSize) { - float factorX = graphics.DpiX > 96 ? (1f * graphics.DpiX / 96) : 1f; - float factorY = graphics.DpiY > 96 ? (1f * graphics.DpiY / 96) : 1f; + float factorX = graphics.DpiX > 96 ? 1f * graphics.DpiX / 96 : 1f; + float factorY = graphics.DpiY > 96 ? 1f * graphics.DpiY / 96 : 1f; Size tmpSize = base.GetPreferredSize(graphics, cellStyle, rowIndex, constraintSize); if (KryptonManager.CurrentGlobalPalette != null) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Globals/GlobalDeclarations.cs index b982b2230..2bde7b3ca 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Implementation/IDetailView.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Implementation/IDetailView.cs index 8780c45fe..278112f57 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Implementation/IDetailView.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Implementation/IDetailView.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Implementation/MasterDetailGridView.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Implementation/MasterDetailGridView.cs index 0afd80fda..666583e7e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Implementation/MasterDetailGridView.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Implementation/MasterDetailGridView.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Implementation/MasterDetailGridViewBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Implementation/MasterDetailGridViewBase.cs index 46c0299af..ba6719650 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Implementation/MasterDetailGridViewBase.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Implementation/MasterDetailGridViewBase.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -96,10 +96,10 @@ public void SetMasterSource(string tableName, string masterColumn, DataGridViewC base.DataSource = new DataView(DataSet.Tables[tableName]); ForeignKey = masterColumn; var keyType = DataSet.Tables[tableName].Columns[masterColumn].GetType(); - if ((keyType == typeof(int)) - || (keyType == typeof(float)) - || (keyType == typeof(double)) - || (keyType == typeof(decimal)) + if (keyType == typeof(int) + || keyType == typeof(float) + || keyType == typeof(double) + || keyType == typeof(decimal) ) { FilterFormat = @"={0}"; @@ -178,10 +178,10 @@ protected enum RowHeaderIcons private void MasterDetailGridViewBase_CellClick(object sender, DataGridViewCellEventArgs e) { - if ((SelectionMode == DataGridViewSelectionMode.FullRowSelect) + if (SelectionMode == DataGridViewSelectionMode.FullRowSelect && ExpandDetailsWhenFullRowSelectClicked - && (e.ColumnIndex >= 0) - && (e.RowIndex >= 0) + && e.ColumnIndex >= 0 + && e.RowIndex >= 0 ) { ExpandAndCollapseOther(e.RowIndex); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Implementation/Portable.System.ValueTuple.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Implementation/Portable.System.ValueTuple.cs index 11457bd16..20c1ee86c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Implementation/Portable.System.ValueTuple.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Implementation/Portable.System.ValueTuple.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Krypton.Toolkit.Suite.Extended.DataGridView 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Krypton.Toolkit.Suite.Extended.DataGridView 2022.csproj index 28d0d2f00..d0beb57b7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Krypton.Toolkit.Suite.Extended.DataGridView 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Krypton.Toolkit.Suite.Extended.DataGridView 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - + - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements additional extensions to the Krypton standard toolkit DataGridView, including Column types and Master-Detail views. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements additional extensions to the Krypton standard toolkit DataGridView, including Column types and Master-Detail views. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -87,7 +75,7 @@ - + @@ -97,7 +85,7 @@ - + @@ -107,7 +95,7 @@ - + @@ -117,7 +105,7 @@ - + @@ -148,7 +136,7 @@ - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Krypton.Toolkit.Suite.Extended.DataGridViewExt.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Krypton.Toolkit.Suite.Extended.DataGridViewExt.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Krypton.Toolkit.Suite.Extended.DataGridViewExt.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Krypton.Toolkit.Suite.Extended.DataGridViewExt.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/MultiDetailView.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/MultiDetailView.cs index 77ec3c004..528c67a8c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/MultiDetailView.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/MultiDetailView.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Debug.Tools/General/DebugUtilities.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Debug.Tools/General/DebugUtilities.cs new file mode 100644 index 000000000..b3004ba8c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Debug.Tools/General/DebugUtilities.cs @@ -0,0 +1,66 @@ +#region MIT License +/* + * + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Debug.Tools +{ + /// Allow Krypton to be improved by getting help from users. + public static class DebugUtilities + { + #region Implementation + + public static Exception NotImplemented(string outOfRange, [CallerFilePath] string callingFilePath = "", + [CallerLineNumber] int lineNumber = 0, [CallerMemberName] string? callingMethod = "") + { + DialogResult result = MessageBox.Show($"If you are seeing this message, please submit a new bug report here.\n\nAdditional details:-\nMethod Signature: {callingMethod}\nFunction: {callingMethod}\nFile: {callingFilePath}\nLine Number: {lineNumber}", + @"Not Implemented - Please submit ?", MessageBoxButtons.YesNo, MessageBoxIcon.Error, + MessageBoxDefaultButton.Button2); + + if (result == DialogResult.Yes) + { + Process.Start(@"https://github.com/Krypton-Suite/Extended-Toolkit/issues/new/choose"); + } + + return new ArgumentOutOfRangeException(outOfRange) + { + Source = callingMethod, + }; + } + + public static void WriteLine(object value) => System.Diagnostics.Debug.WriteLine(value); + + public static void WriteLine(object value, string category) => System.Diagnostics.Debug.WriteLine(value, category); + + public static void WriteLine(string format, params object[] args) => System.Diagnostics.Debug.WriteLine(format, args); + + public static void WriteLine(string? message) => System.Diagnostics.Debug.WriteLine(message); + + public static void WriteLine(string? message, string category) => System.Diagnostics.Debug.WriteLine(message, category); + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Debug.Tools/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Debug.Tools/Globals/GlobalDeclarations.cs new file mode 100644 index 000000000..ee2bca4ef --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Debug.Tools/Globals/GlobalDeclarations.cs @@ -0,0 +1,32 @@ +#region MIT License +/* + * + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +global using System; +global using System.Runtime.CompilerServices; +global using System.Diagnostics; +global using System.Windows.Forms; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Debug.Tools/Krypton.Toolkit.Suite.Extended.Debug.Tools 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Debug.Tools/Krypton.Toolkit.Suite.Extended.Debug.Tools 2022.csproj new file mode 100644 index 000000000..d3e8a79cf --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Debug.Tools/Krypton.Toolkit.Suite.Extended.Debug.Tools 2022.csproj @@ -0,0 +1,78 @@ + + + + + + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows + + + + + + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows + + + + + + library + Krypton.Toolkit.Suite.Extended.Debug.Tools + Krypton.Toolkit.Suite.Extended.Debug.Tools + + false + True + StrongKrypton.snk + true + Debug;Release;Nightly;Canary + preview + enable + 6 + true + + + + + + + Krypton.Toolkit.Suite.Extended.Debug.Tools.Canary + + + + + + Krypton.Toolkit.Suite.Extended.Debug.Tools.Nightly + + + + + + Krypton.Toolkit.Suite.Extended.Debug.Tools + + + + + Krypton.Toolkit.Suite.Extended.Debug.Tools + + + + + + + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements debug utilities that are fundamental to the extended toolkit. + + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. + Also, all libraries are included targeting each specific framework version for performance purposes. + + To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md + + + + + + ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.Debug.Tools\Krypton.Toolkit.Suite.Extended.Debug.Tools.xml + ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.Debug.Tools\ + False + enable + + + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/StrongKrypton.snk b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Debug.Tools/StrongKrypton.snk similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/StrongKrypton.snk rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Debug.Tools/StrongKrypton.snk diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Classes/General/ApplicationUtilities.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Classes/General/ApplicationUtilities.cs index 671ec29f3..e2d0a606e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Classes/General/ApplicationUtilities.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Classes/General/ApplicationUtilities.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -42,21 +42,15 @@ public ApplicationUtilities() #endregion #region Methods - public static void UnderConstruction(string message = null, string caption = "Under Construction", Font? typeface = null) + public static void UnderConstruction(string? message = null, string? caption = "Under Construction", Font? typeface = null) { - Image _underConstruction = Properties.Resources.UnderConstruction; + Image underConstruction = Properties.Resources.UnderConstruction; - if (message == null) - { - message = "This feature is under construction, and will be available in a future update.\nThis window will now close.\n(If you are an end-user seeing this message, then please contact the developer for more information.)"; - } + message ??= "This feature is under construction, and will be available in a future update.\nThis window will now close.\n(If you are an end-user seeing this message, then please contact the developer for more information.)"; - if (caption == null) - { - caption = "Under Construction"; - } + caption ??= "Under Construction"; - KryptonMessageBoxExtended.Show(message, caption, ExtendedMessageBoxButtons.OK, ExtendedMessageBoxCustomButtonOptions.None, ExtendedMessageBoxIcon.Custom, messageboxTypeface: typeface, customMessageBoxIcon: _underConstruction); + KryptonMessageBoxExtended.Show(message, caption, ExtendedMessageBoxButtons.OK, ExtendedMessageBoxCustomButtonOptions.None, ExtendedMessageBoxIcon.Custom, messageboxTypeface: typeface, customMessageBoxIcon: underConstruction); } /// Displays the developer information. diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Classes/General/ExceptionCapture.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Classes/General/ExceptionCapture.cs deleted file mode 100644 index 8cb62f336..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Classes/General/ExceptionCapture.cs +++ /dev/null @@ -1,134 +0,0 @@ -#region MIT License -/* - * - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Developer.Utilities -{ - /* - /// For use in try/catch blocks. Uses the standard to display exception messages. - public static class ExceptionCapture - { - #region Variables - private static bool? _useDebugConsole, _useExtendedMessageBox, _printStackTrace; - - private static MessageBoxButtons? _buttons; - - private static MessageBoxIcon? _icon; - - private static string _title, _className, _methodSignature, _messageStart, _messageMiddleClass, _messageMiddleMethodSignature; - - private static Exception _exception; - #endregion - - #region Methods - public static void CaptureException(Exception exception, bool? useDebugConsole, bool? useExtendedMessageBox, bool? printStackTrace, - MessageBoxIcon? icon, MessageBoxButtons? buttons, string title, string className, - string methodSignature, string messageStart, string messageMiddleClass, - string messageMiddleMethodSignature) - { - #region Store Values - _useDebugConsole = useDebugConsole ?? false; - - _useExtendedMessageBox = useExtendedMessageBox ?? false; - - _printStackTrace = printStackTrace ?? false; - - _icon = icon ?? MessageBoxIcon.Warning; - - _buttons = buttons ?? MessageBoxButtons.OK; - - _title = title ?? @"Exception Caught"; - - _className = className ?? string.Empty; - - _methodSignature = methodSignature ?? string.Empty; - - _messageStart = messageStart ?? "An unexpected error has occurred: "; - - _messageMiddleClass = messageMiddleClass ?? ".\n\nError in class: "; - - _messageMiddleMethodSignature = messageMiddleMethodSignature ?? "\n\nError in method: "; - #endregion - - #region Logic - if (className != string.Empty) - { - if (useExtendedMessageBox != null) - { - - } - else - { - KryptonMessageBox.Show($"{messageStart}{exception.Message}{messageMiddleClass}'{className}.cs'.", title, buttons, icon); - } - } - else if (methodSignature != string.Empty) - { - if (useExtendedMessageBox != null) - { - - } - else - { - - } - } - else if (className != string.Empty && methodSignature != string.Empty) - { - if (useExtendedMessageBox != null) - { - - } - else - { - - } - } - else - { - if (useExtendedMessageBox != null) - { - - } - else - { - - } - } - #endregion - - if (useDebugConsole != null) - { - KryptonDeveloperDebugConsole debugConsole = new KryptonDeveloperDebugConsole(exception); - - debugConsole.Show(); - } - } - #endregion - } - */ -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Classes/General/ExceptionCaptureOld.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Classes/General/ExceptionCaptureOld.cs deleted file mode 100644 index 6dac74d42..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Classes/General/ExceptionCaptureOld.cs +++ /dev/null @@ -1,253 +0,0 @@ -#region MIT License -/* - * - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Developer.Utilities -{ - // TODO: Rewrite this class! - /// For use in try/catch blocks. Uses the standard to display exception messages. - public class ExceptionCapture - { - #region Constructor - /// Initializes a new instance of the class. - public ExceptionCapture() - { - - } - #endregion - - #region Methods - /// - /// Captures the exception. - /// - /// The exception. - /// The title. - /// The buttons. - /// The icon. - /// Name of the class. - /// The method signature. - /// Use the debug console. - /// Dumps the exception data to a file. - public static void CaptureException(Exception exception, string title = @"Exception Caught", KryptonMessageBoxButtons buttons = KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon icon = KryptonMessageBoxIcon.Error, string className = "", string methodSignature = "", bool useDebugConsole = false, bool dumpException = false, MessageBoxButtons win32Buttons = MessageBoxButtons.OK) - { - 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); - } - - if (useDebugConsole) - { - KryptonDeveloperDebugConsole debugConsole = new KryptonDeveloperDebugConsole(exception); - - debugConsole.Show(); - } - } - - /// Captures the exception. - /// The exception. - /// The current window. - /// The control. - /// The title. - /// The buttons. - /// The icon. - /// Name of the class. - /// The method signature. - public static void CaptureException(Exception exception, KryptonForm currentWindow, Control control = null, string title = @"Exception Caught", KryptonMessageBoxButtons buttons = KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon icon = KryptonMessageBoxIcon.Error, string className = "", string methodSignature = "", MessageBoxButtons win32Buttons = MessageBoxButtons.OK) - { - 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 the exception. - /// The exception message. - /// if set to true [use krypton message box]. - /// if set to true [use extended krypton message box]. - /// if set to true [use win32 message box]. - /// if set to true [use console]. - /// if set to true [use tool strip label]. - /// The tool strip label. - /// The arguments. - /// The caption. - /// The buttons. - /// The default button. - /// The icon. - /// The options. - public void CaptureException(string exceptionMessage, bool useKryptonMessageBox = false, bool useExtendedKryptonMessageBox = false, bool useWin32MessageBox = false, bool useConsole = false, bool useToolStripLabel = false, ToolStripLabel toolStripLabel = null, object args = null, string caption = "Exception Caught", KryptonMessageBoxButtons buttons = KryptonMessageBoxButtons.OK, KryptonMessageBoxDefaultButton defaultButton = KryptonMessageBoxDefaultButton.Button4, KryptonMessageBoxIcon icon = KryptonMessageBoxIcon.Error, MessageBoxOptions options = MessageBoxOptions.DefaultDesktopOnly, MessageBoxIcon winFormsIcon = MessageBoxIcon.Error, MessageBoxDefaultButton winFormsDefaultButton = MessageBoxDefaultButton.Button3, MessageBoxButtons win32Buttons = MessageBoxButtons.OK) - { - if (useKryptonMessageBox) - { - KryptonMessageBox.Show(exceptionMessage, caption, buttons, icon, defaultButton, options); - } - else if (useExtendedKryptonMessageBox) - { - // Note: Enter code - } - else if (useWin32MessageBox) - { - MessageBox.Show(exceptionMessage, caption, win32Buttons, winFormsIcon, winFormsDefaultButton, options); - } - else if (useConsole) - { - Console.WriteLine($@"[ {DateTime.Now} ]: {exceptionMessage}"); - } - } - - /// Captures the exception. - /// The exception message. - /// The title. - /// The buttons. - /// The icon. - public static void CaptureException(string exceptionMessage, string title, KryptonMessageBoxButtons buttons, - KryptonMessageBoxIcon icon) => KryptonMessageBox.Show(exceptionMessage, title, buttons, icon); - - /* -#if !NET40_OR_GREATER - /// - /// Captures a stacktrace of the exception. - /// - /// The incoming exception. - /// The file to write the exception stacktrace to. - public static void PrintStackTrace(Exception exc, string fileName) - { - try - { - System.Runtime.ExceptionServices.ExceptionDispatchInfo exceptionInfo = null; - - if (!File.Exists(fileName)) - { - File.Create(fileName); - } - - exceptionInfo = ExceptionDispatchInfo.Capture(exc); - - StreamWriter writer = new StreamWriter(fileName); - - writer.Write(exc.ToString()); - - writer.Close(); - - writer.Dispose(); - } - catch (Exception ex) - { - CaptureException(ex); - } - } -#endif - */ - - /// - /// Captures a stacktrace of the exception. - /// - /// The incoming exception. - /// The file to write the exception stacktrace to. - public static void PrintExceptionStackTrace(Exception exc, string fileName) - { - try - { - if (!File.Exists(fileName)) - { - File.Create(fileName); - } - - StreamWriter writer = new StreamWriter(fileName); - - writer.Write(exc.StackTrace); - - writer.Close(); - - writer.Dispose(); - } - catch (Exception e) - { - CaptureException(e); - } - } - - private void DumpException(Exception e) - { - try - { - string fileName = $"Exception Log - {CultureInfo.CurrentCulture.DateTimeFormat.LongDatePattern}.log"; - - File.Create(fileName); - - StreamWriter writer = new StreamWriter(fileName); - - writer.Write(e.Data.ToString()); - - writer.Close(); - - writer.Dispose(); - - DialogResult result = KryptonMessageBox.Show($"Log file created at: '{Path.GetFullPath(fileName)}'. Open now?", "Log File Created", KryptonMessageBoxButtons.YesNo, KryptonMessageBoxIcon.Information); - - if (result == DialogResult.Yes) - { - Process.Start(@"Notepad.exe", Path.GetFullPath(fileName)); - } - } - catch (Exception exception) - { - CaptureException(e); - } - } - - #endregion - - #region Destruction - /// Finalizes an instance of the class. - ~ExceptionCapture() => GC.SuppressFinalize(this); - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Classes/General/LoremIpsumUtilities.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Classes/General/LoremIpsumUtilities.cs index e84ee4307..3817d1cd5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Classes/General/LoremIpsumUtilities.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Classes/General/LoremIpsumUtilities.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -// ReSharper disable PossibleNullReferenceException +// ReSharper disable PossibleNullReferenceException namespace Krypton.Toolkit.Suite.Extended.Developer.Utilities { @@ -60,7 +55,7 @@ public static long Number(long min, long max) RandomHelper.Instance.NextBytes(buf); long longRand = BitConverter.ToInt64(buf, 0); - return (Math.Abs(longRand % ((max + 1) - min)) + min); + return Math.Abs(longRand % (max + 1 - min)) + min; } #region DateTime diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Classes/General/MethodHelpers.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Classes/General/MethodHelpers.cs index 3ddc4c9be..8c9e019a2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Classes/General/MethodHelpers.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Classes/General/MethodHelpers.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Controls Visuals/KryptonDeveloperDebugConsole.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Controls Visuals/KryptonDeveloperDebugConsole.cs index 98e94e873..762764592 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Controls Visuals/KryptonDeveloperDebugConsole.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Controls Visuals/KryptonDeveloperDebugConsole.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -49,9 +49,9 @@ private void InitializeComponent() this.kryptonPanel2 = new(); this.krtbDebugBox = new(); this.kbtnSaveToFile = new(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); this.SuspendLayout(); // @@ -70,7 +70,7 @@ private void InitializeComponent() // // kbtnClose // - this.kbtnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.kbtnClose.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kbtnClose.Location = new(625, 13); this.kbtnClose.Name = "kbtnClose"; @@ -81,7 +81,7 @@ private void InitializeComponent() // // kbtnCopy // - this.kbtnCopy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.kbtnCopy.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); this.kbtnCopy.Location = new(12, 13); this.kbtnCopy.Name = "kbtnCopy"; this.kbtnCopy.Size = new(90, 25); @@ -109,9 +109,9 @@ private void InitializeComponent() // // krtbDebugBox // - this.krtbDebugBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.krtbDebugBox.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom + | System.Windows.Forms.AnchorStyles.Left + | System.Windows.Forms.AnchorStyles.Right); this.krtbDebugBox.Location = new(13, 13); this.krtbDebugBox.Name = "krtbDebugBox"; this.krtbDebugBox.ReadOnly = true; @@ -122,7 +122,7 @@ private void InitializeComponent() // // kbtnSaveToFile // - this.kbtnSaveToFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.kbtnSaveToFile.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); this.kbtnSaveToFile.Location = new(108, 13); this.kbtnSaveToFile.Name = "kbtnSaveToFile"; this.kbtnSaveToFile.Size = new(127, 25); @@ -136,17 +136,17 @@ private void InitializeComponent() this.Controls.Add(this.kryptonPanel2); this.Controls.Add(this.kryptonPanel1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon"); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "KryptonDeveloperDebugConsole"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Debug Console"; - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); this.ResumeLayout(false); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Controls Visuals/KryptonMessageBoxExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Controls Visuals/KryptonMessageBoxExtended.cs index f18eb7859..d7bb48cc7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Controls Visuals/KryptonMessageBoxExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Controls Visuals/KryptonMessageBoxExtended.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -45,14 +45,14 @@ private void InitialiseComponent() _button2 = new(); _copyButton = new(); _optionalCheckBox = new(); - ((ISupportInitialize)(_panelMessage)).BeginInit(); + ((ISupportInitialize)_panelMessage).BeginInit(); _panelMessage.SuspendLayout(); - ((ISupportInitialize)(_panelMessageText)).BeginInit(); + ((ISupportInitialize)_panelMessageText).BeginInit(); _panelMessageText.SuspendLayout(); - ((ISupportInitialize)(_panelMessageIcon)).BeginInit(); + ((ISupportInitialize)_panelMessageIcon).BeginInit(); _panelMessageIcon.SuspendLayout(); - ((ISupportInitialize)(_messageIcon)).BeginInit(); - ((ISupportInitialize)(_panelButtons)).BeginInit(); + ((ISupportInitialize)_messageIcon).BeginInit(); + ((ISupportInitialize)_panelButtons).BeginInit(); _panelButtons.SuspendLayout(); SuspendLayout(); // @@ -225,15 +225,15 @@ private void InitialiseComponent() TopMost = true; Load += InternalKryptonMessageBoxExtended_Load; FormClosing += InternalKryptonMessageBoxExtended_FormClosing; - ((ISupportInitialize)(_panelMessage)).EndInit(); + ((ISupportInitialize)_panelMessage).EndInit(); _panelMessage.ResumeLayout(false); _panelMessage.PerformLayout(); - ((ISupportInitialize)(_panelMessageText)).EndInit(); + ((ISupportInitialize)_panelMessageText).EndInit(); _panelMessageText.ResumeLayout(false); - ((ISupportInitialize)(_panelMessageIcon)).EndInit(); + ((ISupportInitialize)_panelMessageIcon).EndInit(); _panelMessageIcon.ResumeLayout(false); - ((ISupportInitialize)(_messageIcon)).EndInit(); - ((ISupportInitialize)(_panelButtons)).EndInit(); + ((ISupportInitialize)_messageIcon).EndInit(); + ((ISupportInitialize)_panelButtons).EndInit(); _panelButtons.ResumeLayout(false); _panelButtons.PerformLayout(); ResumeLayout(false); @@ -243,7 +243,10 @@ private void InitialiseComponent() #endregion #region Variables - private readonly string _text, _optionalCheckBoxText, _copyButtonText, _buttonOneText, _buttonTwoText, _buttonThreeText; + private readonly string? _text; + private readonly string? _optionalCheckBoxText; + private readonly string? _copyButtonText; + private readonly string _buttonOneText, _buttonTwoText, _buttonThreeText; private readonly string _caption; private readonly ExtendedMessageBoxButtons _buttons; private readonly ExtendedMessageBoxCustomButtonOptions _customButtonOptions; @@ -255,12 +258,13 @@ private void InitialiseComponent() private CheckState _optionalCheckBoxCheckState; private DialogResult _buttonOneResult, _buttonTwoResult, _buttonThreeResult; private Double _fadeIn, _fadeOut; - public static bool _isOptionalCheckBoxChecked; + public bool _isOptionalCheckBoxChecked; private KryptonPanel _panelMessage; private KryptonPanel _panelMessageText; private KryptonWrapLabel _messageText; private KryptonPanel _panelMessageIcon; - private int _fadeSleepTimer, _timeOut; + private readonly int _fadeSleepTimer; + private int _timeOut; private PictureBox _messageIcon; private KryptonPanel _panelButtons; private MessageButton _button1; @@ -269,9 +273,9 @@ private void InitialiseComponent() private MessageButton _copyButton; private KryptonCheckBox _optionalCheckBox; private KryptonBorderEdge _borderEdge; - private HelpInformation _helpInformation; - private Font _messageboxTypeface; - private Image _customMessageBoxIcon; + private HelpInformation? _helpInformation; + private readonly Font _messageboxTypeface; + private Image? _customMessageBoxIcon; private Point _optionalCheckBoxLocation; #endregion @@ -384,10 +388,10 @@ protected override void WndProc(ref Message m) if (IgnoreAltF4) { // Extract the keys being pressed - Keys keys = ((Keys)((int)m.WParam.ToInt64())); + Keys keys = (Keys)(int)m.WParam.ToInt64(); // If the user standard combination ALT + F4 - if ((keys == Keys.F4) && ((ModifierKeys & Keys.Alt) == Keys.Alt)) + if (keys == Keys.F4 && (ModifierKeys & Keys.Alt) == Keys.Alt) { // Eat the message, so standard window proc does not close the window return; @@ -440,17 +444,17 @@ public KryptonMessageBoxExtended() { } /// The action for the first button to take. /// The action for the second button to take. /// The action for the third button to take. - private KryptonMessageBoxExtended(IWin32Window showOwner, string text, string caption, + private KryptonMessageBoxExtended(IWin32Window? showOwner, string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions? customButtonOptions, ExtendedMessageBoxIcon icon, MessageBoxDefaultButton defaultButton, - MessageBoxOptions options, HelpInformation helpInformation, bool? showCtrlCopy, - Font messageboxTypeface, bool showOptionalCheckBox, string optionalCheckBoxText, + MessageBoxOptions options, HelpInformation? helpInformation, bool? showCtrlCopy, + Font? messageboxTypeface, bool showOptionalCheckBox, string? optionalCheckBoxText, bool isOptionalCheckBoxChecked, CheckState? optionalCheckBoxCheckState, AnchorStyles? optionalCheckBoxAnchor, Point? optionalCheckBoxLocation, - Image customMessageBoxIcon, bool showCopyButton, string copyButtonText, - bool? fade, int? fadeSleepTimer, string buttonOneCustomText, - string buttonTwoCustomText, string buttonThreeCustomText, + Image? customMessageBoxIcon, bool showCopyButton, string? copyButtonText, + bool? fade, int? fadeSleepTimer, string? buttonOneCustomText, + string? buttonTwoCustomText, string? buttonThreeCustomText, DialogResult? buttonOneCustomDialogResult, DialogResult? buttonTwoCustomDialogResult, DialogResult? buttonThreeCustomDialogResult, bool? showToolTips) { @@ -568,14 +572,12 @@ protected override void Dispose(bool disposing) /// Allows the message box to fade in and out. /// The speed of the fading effect. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(string text, bool? showCtrlCopy = null, Font messageboxTypeface = null, - bool showOptionalCheckBox = false, string optionalCheckBoxText = null, + public static DialogResult Show(string? text, bool? showCtrlCopy = null, Font? messageboxTypeface = null, + bool showOptionalCheckBox = false, string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, Point? optionalCheckBoxLocation = null, - bool showCopyButton = false, string copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50) - { - return InternalShow(null, text, string.Empty, ExtendedMessageBoxButtons.OK, null, ExtendedMessageBoxIcon.None, MessageBoxDefaultButton.Button1, 0, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, null, showCopyButton, copyButtonText, fade, fadeSleepTimer); - } + bool showCopyButton = false, string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50) => + InternalShow(null, text, string.Empty, ExtendedMessageBoxButtons.OK, null, ExtendedMessageBoxIcon.None, MessageBoxDefaultButton.Button1, 0, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, null, showCopyButton, copyButtonText, fade, fadeSleepTimer); /// /// Displays a message box in front of the specified object and with the specified text. @@ -595,15 +597,13 @@ public static DialogResult Show(string text, bool? showCtrlCopy = null, Font mes /// Allows the message box to fade in and out. /// The speed of the fading effect. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(IWin32Window owner, string text, bool? showCtrlCopy = null, Font messageboxTypeface = null, - bool showOptionalCheckBox = false, string optionalCheckBoxText = null, + public static DialogResult Show(IWin32Window? owner, string? text, bool? showCtrlCopy = null, Font? messageboxTypeface = null, + bool showOptionalCheckBox = false, string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, Point? optionalCheckBoxLocation = null, bool showCopyButton = false, - string copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50) - { - return InternalShow(owner, text, string.Empty, ExtendedMessageBoxButtons.OK, null, ExtendedMessageBoxIcon.None, MessageBoxDefaultButton.Button1, 0, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, null, showCopyButton, copyButtonText, fade, fadeSleepTimer); - } + string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50) => + InternalShow(owner, text, string.Empty, ExtendedMessageBoxButtons.OK, null, ExtendedMessageBoxIcon.None, MessageBoxDefaultButton.Button1, 0, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, null, showCopyButton, copyButtonText, fade, fadeSleepTimer); /// /// Displays a message box with specified text and caption. @@ -623,12 +623,12 @@ public static DialogResult Show(IWin32Window owner, string text, bool? showCtrlC /// Allows the message box to fade in and out. /// The speed of the fading effect. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(string text, string caption, bool? showCtrlCopy = null, Font messageboxTypeface = null, - bool showOptionalCheckBox = false, string optionalCheckBoxText = null, + public static DialogResult Show(string? text, string caption, bool? showCtrlCopy = null, Font? messageboxTypeface = null, + bool showOptionalCheckBox = false, string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, Point? optionalCheckBoxLocation = null, bool showCopyButton = false, - string copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50) + string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50) { return InternalShow(null, text, caption, ExtendedMessageBoxButtons.OK, null, ExtendedMessageBoxIcon.None, MessageBoxDefaultButton.Button1, 0, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, null, showCopyButton, copyButtonText, fade, fadeSleepTimer); } @@ -652,16 +652,14 @@ public static DialogResult Show(string text, string caption, bool? showCtrlCopy /// Allows the message box to fade in and out. /// The speed of the fading effect. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(IWin32Window owner, - string text, string caption, bool? showCtrlCopy = null, Font messageboxTypeface = null, - bool showOptionalCheckBox = false, string optionalCheckBoxText = null, + public static DialogResult Show(IWin32Window? owner, + string? text, string caption, bool? showCtrlCopy = null, Font? messageboxTypeface = null, + bool showOptionalCheckBox = false, string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, Point? optionalCheckBoxLocation = null, bool showCopyButton = false, - string copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50) - { - return InternalShow(owner, text, caption, ExtendedMessageBoxButtons.OK, null, ExtendedMessageBoxIcon.None, MessageBoxDefaultButton.Button1, 0, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, null, showCopyButton, copyButtonText, fade, fadeSleepTimer); - } + string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50) => + InternalShow(owner, text, caption, ExtendedMessageBoxButtons.OK, null, ExtendedMessageBoxIcon.None, MessageBoxDefaultButton.Button1, 0, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, null, showCopyButton, copyButtonText, fade, fadeSleepTimer); /// /// Displays a message box with specified text, caption, and buttons. @@ -689,25 +687,23 @@ public static DialogResult Show(IWin32Window owner, /// The action for the second button to take. /// The action for the third button to take. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(string text, string caption, + public static DialogResult Show(string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions customButtonOptions, - bool? showCtrlCopy = null, Font messageboxTypeface = null, - bool showOptionalCheckBox = false, string optionalCheckBoxText = null, + bool? showCtrlCopy = null, Font? messageboxTypeface = null, + bool showOptionalCheckBox = false, string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, Point? optionalCheckBoxLocation = null, bool showCopyButton = false, - string copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, - string buttonOneCustomText = null, string buttonTwoCustomText = null, - string buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, + string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, + string? buttonOneCustomText = null, string? buttonTwoCustomText = null, + string? buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, - DialogResult? buttonThreeCustomDialogResult = null) - { - return InternalShow(null, text, caption, buttons, customButtonOptions, ExtendedMessageBoxIcon.None, MessageBoxDefaultButton.Button1, - 0, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, - isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, + DialogResult? buttonThreeCustomDialogResult = null) => + InternalShow(null, text, caption, buttons, customButtonOptions, ExtendedMessageBoxIcon.None, MessageBoxDefaultButton.Button1, + 0, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, + isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, null, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, - buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); - } + buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); /// /// Displays a message box in front of the specified object and with the specified text, caption, and buttons. @@ -736,22 +732,20 @@ public static DialogResult Show(string text, string caption, /// The action for the second button to take. /// The action for the third button to take. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(IWin32Window owner, - string text, string caption, + public static DialogResult Show(IWin32Window? owner, + string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions customButtonOptions, - bool? showCtrlCopy = null, Font messageboxTypeface = null, - bool showOptionalCheckBox = false, string optionalCheckBoxText = null, + bool? showCtrlCopy = null, Font? messageboxTypeface = null, + bool showOptionalCheckBox = false, string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, Point? optionalCheckBoxLocation = null, bool showCopyButton = false, - string copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, - string buttonOneCustomText = null, string buttonTwoCustomText = null, - string buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, + string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, + string? buttonOneCustomText = null, string? buttonTwoCustomText = null, + string? buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, - DialogResult? buttonThreeCustomDialogResult = null) - { - return InternalShow(owner, text, caption, buttons, customButtonOptions, ExtendedMessageBoxIcon.None, MessageBoxDefaultButton.Button1, 0, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, null, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); - } + DialogResult? buttonThreeCustomDialogResult = null) => + InternalShow(owner, text, caption, buttons, customButtonOptions, ExtendedMessageBoxIcon.None, MessageBoxDefaultButton.Button1, 0, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, null, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); /// /// Displays a message box with specified text, caption, buttons, and icon. @@ -781,23 +775,21 @@ public static DialogResult Show(IWin32Window owner, /// The action for the second button to take. /// The action for the third button to take. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(string text, string caption, + public static DialogResult Show(string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions customButtonOptions, ExtendedMessageBoxIcon icon, - bool? showCtrlCopy = null, Font messageboxTypeface = null, - bool showOptionalCheckBox = false, string optionalCheckBoxText = null, + bool? showCtrlCopy = null, Font? messageboxTypeface = null, + bool showOptionalCheckBox = false, string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, - Point? optionalCheckBoxLocation = null, Image customMessageBoxIcon = null, - bool showCopyButton = false, string copyButtonText = null, + Point? optionalCheckBoxLocation = null, Image? customMessageBoxIcon = null, + bool showCopyButton = false, string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, - string buttonOneCustomText = null, string buttonTwoCustomText = null, - string buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, + string? buttonOneCustomText = null, string? buttonTwoCustomText = null, + string? buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, - DialogResult? buttonThreeCustomDialogResult = null) - { - return InternalShow(null, text, caption, buttons, customButtonOptions, icon, MessageBoxDefaultButton.Button1, 0, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); - } + DialogResult? buttonThreeCustomDialogResult = null) => + InternalShow(null, text, caption, buttons, customButtonOptions, icon, MessageBoxDefaultButton.Button1, 0, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); /// /// Displays a message box in front of the specified object and with the specified text, caption, buttons, and icon. @@ -828,23 +820,21 @@ public static DialogResult Show(string text, string caption, /// The action for the second button to take. /// The action for the third button to take. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(IWin32Window owner, - string text, string caption, + public static DialogResult Show(IWin32Window? owner, + string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions customButtonOptions, - ExtendedMessageBoxIcon icon, bool? showCtrlCopy = null, Font messageboxTypeface = null, - bool showOptionalCheckBox = false, string optionalCheckBoxText = null, + ExtendedMessageBoxIcon icon, bool? showCtrlCopy = null, Font? messageboxTypeface = null, + bool showOptionalCheckBox = false, string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, - Point? optionalCheckBoxLocation = null, Image customMessageBoxIcon = null, - bool showCopyButton = false, string copyButtonText = null, + Point? optionalCheckBoxLocation = null, Image? customMessageBoxIcon = null, + bool showCopyButton = false, string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, - string buttonOneCustomText = null, string buttonTwoCustomText = null, - string buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, + string? buttonOneCustomText = null, string? buttonTwoCustomText = null, + string? buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, - DialogResult? buttonThreeCustomDialogResult = null) - { - return InternalShow(owner, text, caption, buttons, customButtonOptions, icon, MessageBoxDefaultButton.Button1, 0, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); - } + DialogResult? buttonThreeCustomDialogResult = null) => + InternalShow(owner, text, caption, buttons, customButtonOptions, icon, MessageBoxDefaultButton.Button1, 0, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); /// /// Displays a message box with the specified text, caption, buttons, icon, and default button. @@ -875,22 +865,20 @@ public static DialogResult Show(IWin32Window owner, /// The action for the second button to take. /// The action for the third button to take. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(string text, string caption, + public static DialogResult Show(string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions customButtonOptions, ExtendedMessageBoxIcon icon, MessageBoxDefaultButton defaultButton, bool? showCtrlCopy = null, - Font messageboxTypeface = null, bool showOptionalCheckBox = false, - string optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, + Font? messageboxTypeface = null, bool showOptionalCheckBox = false, + string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, Point? optionalCheckBoxLocation = null, - Image customMessageBoxIcon = null, bool showCopyButton = false, - string copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, - string buttonOneCustomText = null, string buttonTwoCustomText = null, - string buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, + Image? customMessageBoxIcon = null, bool showCopyButton = false, + string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, + string? buttonOneCustomText = null, string? buttonTwoCustomText = null, + string? buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, - DialogResult? buttonThreeCustomDialogResult = null) - { - return InternalShow(null, text, caption, buttons, customButtonOptions, icon, defaultButton, 0, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); - } + DialogResult? buttonThreeCustomDialogResult = null) => + InternalShow(null, text, caption, buttons, customButtonOptions, icon, defaultButton, 0, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); /// /// Displays a message box in front of the specified object and with the specified text, caption, buttons, icon, and default button. @@ -922,24 +910,22 @@ public static DialogResult Show(string text, string caption, /// The action for the second button to take. /// The action for the third button to take. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(IWin32Window owner, - string text, string caption, + public static DialogResult Show(IWin32Window? owner, + string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions customButtonOptions, ExtendedMessageBoxIcon icon, MessageBoxDefaultButton defaultButton, bool? showCtrlCopy = null, - Font messageboxTypeface = null, bool showOptionalCheckBox = false, - string optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, + Font? messageboxTypeface = null, bool showOptionalCheckBox = false, + string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, Point? optionalCheckBoxLocation = null, - Image customMessageBoxIcon = null, bool showCopyButton = false, - string copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, - string buttonOneCustomText = null, string buttonTwoCustomText = null, - string buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, + Image? customMessageBoxIcon = null, bool showCopyButton = false, + string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, + string? buttonOneCustomText = null, string? buttonTwoCustomText = null, + string? buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, - DialogResult? buttonThreeCustomDialogResult = null) - { - return InternalShow(owner, text, caption, buttons, customButtonOptions, icon, defaultButton, 0, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); - } + DialogResult? buttonThreeCustomDialogResult = null) => + InternalShow(owner, text, caption, buttons, customButtonOptions, icon, defaultButton, 0, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); /// /// Displays a message box with the specified text, caption, buttons, icon, default button, and options. @@ -971,24 +957,22 @@ public static DialogResult Show(IWin32Window owner, /// The action for the second button to take. /// The action for the third button to take. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(string text, string caption, + public static DialogResult Show(string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions customButtonOptions, ExtendedMessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, - bool? showCtrlCopy = null, Font messageboxTypeface = null, - bool showOptionalCheckBox = false, string optionalCheckBoxText = null, + bool? showCtrlCopy = null, Font? messageboxTypeface = null, + bool showOptionalCheckBox = false, string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, - Point? optionalCheckBoxLocation = null, Image customMessageBoxIcon = null, - bool showCopyButton = false, string copyButtonText = null, + Point? optionalCheckBoxLocation = null, Image? customMessageBoxIcon = null, + bool showCopyButton = false, string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, - string buttonOneCustomText = null, string buttonTwoCustomText = null, - string buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, + string? buttonOneCustomText = null, string? buttonTwoCustomText = null, + string? buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, - DialogResult? buttonThreeCustomDialogResult = null) - { - return InternalShow(null, text, caption, buttons, customButtonOptions, icon, defaultButton, options, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); - } + DialogResult? buttonThreeCustomDialogResult = null) => + InternalShow(null, text, caption, buttons, customButtonOptions, icon, defaultButton, options, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); /// /// Displays a message box in front of the specified object and with the specified text, caption, buttons, icon, default button, and options. @@ -1021,25 +1005,23 @@ public static DialogResult Show(string text, string caption, /// The action for the second button to take. /// The action for the third button to take. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(IWin32Window owner, - string text, string caption, + public static DialogResult Show(IWin32Window? owner, + string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions customButtonOptions, ExtendedMessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, - bool? showCtrlCopy = null, Font messageboxTypeface = null, - bool showOptionalCheckBox = false, string optionalCheckBoxText = null, + bool? showCtrlCopy = null, Font? messageboxTypeface = null, + bool showOptionalCheckBox = false, string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, - Point? optionalCheckBoxLocation = null, Image customMessageBoxIcon = null, - bool showCopyButton = false, string copyButtonText = null, + Point? optionalCheckBoxLocation = null, Image? customMessageBoxIcon = null, + bool showCopyButton = false, string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, - string buttonOneCustomText = null, string buttonTwoCustomText = null, - string buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, + string? buttonOneCustomText = null, string? buttonTwoCustomText = null, + string? buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, - DialogResult? buttonThreeCustomDialogResult = null) - { - return InternalShow(owner, text, caption, buttons, customButtonOptions, icon, defaultButton, options, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); - } + DialogResult? buttonThreeCustomDialogResult = null) => + InternalShow(owner, text, caption, buttons, customButtonOptions, icon, defaultButton, options, null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); /// /// Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button. @@ -1072,24 +1054,22 @@ public static DialogResult Show(IWin32Window owner, /// The action for the second button to take. /// The action for the third button to take. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(string text, string caption, + public static DialogResult Show(string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions customButtonOptions, ExtendedMessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, - bool displayHelpButton, bool? showCtrlCopy = null, Font messageboxTypeface = null, - bool showOptionalCheckBox = false, string optionalCheckBoxText = null, + bool displayHelpButton, bool? showCtrlCopy = null, Font? messageboxTypeface = null, + bool showOptionalCheckBox = false, string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, - Point? optionalCheckBoxLocation = null, Image customMessageBoxIcon = null, - bool showCopyButton = false, string copyButtonText = null, + Point? optionalCheckBoxLocation = null, Image? customMessageBoxIcon = null, + bool showCopyButton = false, string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, - string buttonOneCustomText = null, string buttonTwoCustomText = null, - string buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, + string? buttonOneCustomText = null, string? buttonTwoCustomText = null, + string? buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, - DialogResult? buttonThreeCustomDialogResult = null) - { - return InternalShow(null, text, caption, buttons, customButtonOptions, icon, defaultButton, options, displayHelpButton ? new HelpInformation() : null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); - } + DialogResult? buttonThreeCustomDialogResult = null) => + InternalShow(null, text, caption, buttons, customButtonOptions, icon, defaultButton, options, displayHelpButton ? new HelpInformation() : null, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); /// /// Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file. @@ -1122,24 +1102,22 @@ public static DialogResult Show(string text, string caption, /// The action for the second button to take. /// The action for the third button to take. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(string text, string caption, + public static DialogResult Show(string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions customButtonOptions, ExtendedMessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, - string helpFilePath, bool? showCtrlCopy = null, Font messageboxTypeface = null, - bool showOptionalCheckBox = false, string optionalCheckBoxText = null, + string helpFilePath, bool? showCtrlCopy = null, Font? messageboxTypeface = null, + bool showOptionalCheckBox = false, string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, - Point? optionalCheckBoxLocation = null, Image customMessageBoxIcon = null, - bool showCopyButton = false, string copyButtonText = null, + Point? optionalCheckBoxLocation = null, Image? customMessageBoxIcon = null, + bool showCopyButton = false, string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, - string buttonOneCustomText = null, string buttonTwoCustomText = null, - string buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, + string? buttonOneCustomText = null, string? buttonTwoCustomText = null, + string? buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, - DialogResult? buttonThreeCustomDialogResult = null) - { - return InternalShow(null, text, caption, buttons, customButtonOptions, icon, defaultButton, options, new(helpFilePath), showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); - } + DialogResult? buttonThreeCustomDialogResult = null) => + InternalShow(null, text, caption, buttons, customButtonOptions, icon, defaultButton, options, new(helpFilePath), showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); /// /// Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file. @@ -1173,25 +1151,23 @@ public static DialogResult Show(string text, string caption, /// The action for the second button to take. /// The action for the third button to take. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(IWin32Window owner, - string text, string caption, + public static DialogResult Show(IWin32Window? owner, + string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions customButtonOptions, ExtendedMessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, - string helpFilePath, bool? showCtrlCopy = null, Font messageboxTypeface = null, - bool showOptionalCheckBox = false, string optionalCheckBoxText = null, + string helpFilePath, bool? showCtrlCopy = null, Font? messageboxTypeface = null, + bool showOptionalCheckBox = false, string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, - Point? optionalCheckBoxLocation = null, Image customMessageBoxIcon = null, - bool showCopyButton = false, string copyButtonText = null, + Point? optionalCheckBoxLocation = null, Image? customMessageBoxIcon = null, + bool showCopyButton = false, string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, - string buttonOneCustomText = null, string buttonTwoCustomText = null, - string buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, + string? buttonOneCustomText = null, string? buttonTwoCustomText = null, + string? buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, - DialogResult? buttonThreeCustomDialogResult = null) - { - return InternalShow(owner, text, caption, buttons, customButtonOptions, icon, defaultButton, options, new(helpFilePath), showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); - } + DialogResult? buttonThreeCustomDialogResult = null) => + InternalShow(owner, text, caption, buttons, customButtonOptions, icon, defaultButton, options, new(helpFilePath), showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); /// /// Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file and HelpNavigator. @@ -1225,24 +1201,22 @@ public static DialogResult Show(IWin32Window owner, /// The action for the second button to take. /// The action for the third button to take. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(string text, string caption, + public static DialogResult Show(string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions customButtonOptions, ExtendedMessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, bool? showCtrlCopy = null, - Font messageboxTypeface = null, bool showOptionalCheckBox = false, - string optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, + Font? messageboxTypeface = null, bool showOptionalCheckBox = false, + string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, Point? optionalCheckBoxLocation = null, - Image customMessageBoxIcon = null, bool showCopyButton = false, - string copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, - string buttonOneCustomText = null, string buttonTwoCustomText = null, - string buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, + Image? customMessageBoxIcon = null, bool showCopyButton = false, + string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, + string? buttonOneCustomText = null, string? buttonTwoCustomText = null, + string? buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, - DialogResult? buttonThreeCustomDialogResult = null) - { - return InternalShow(null, text, caption, buttons, customButtonOptions, icon, defaultButton, options, new(helpFilePath, navigator), showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); - } + DialogResult? buttonThreeCustomDialogResult = null) => + InternalShow(null, text, caption, buttons, customButtonOptions, icon, defaultButton, options, new(helpFilePath, navigator), showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); /// /// Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file and Help keyword. @@ -1276,24 +1250,22 @@ public static DialogResult Show(string text, string caption, /// The action for the second button to take. /// The action for the third button to take. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(string text, string caption, + public static DialogResult Show(string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions customButtonOptions, ExtendedMessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, - string helpFilePath, string keyword, bool? showCtrlCopy = null, Font messageboxTypeface = null, - bool showOptionalCheckBox = false, string optionalCheckBoxText = null, + string helpFilePath, string keyword, bool? showCtrlCopy = null, Font? messageboxTypeface = null, + bool showOptionalCheckBox = false, string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, - Point? optionalCheckBoxLocation = null, Image customMessageBoxIcon = null, - bool showCopyButton = false, string copyButtonText = null, + Point? optionalCheckBoxLocation = null, Image? customMessageBoxIcon = null, + bool showCopyButton = false, string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, - string buttonOneCustomText = null, string buttonTwoCustomText = null, - string buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, + string? buttonOneCustomText = null, string? buttonTwoCustomText = null, + string? buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, - DialogResult? buttonThreeCustomDialogResult = null) - { - return InternalShow(null, text, caption, buttons, customButtonOptions, icon, defaultButton, options, new(helpFilePath, keyword), showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); - } + DialogResult? buttonThreeCustomDialogResult = null) => + InternalShow(null, text, caption, buttons, customButtonOptions, icon, defaultButton, options, new(helpFilePath, keyword), showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); /// /// Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file and HelpNavigator. @@ -1328,25 +1300,23 @@ public static DialogResult Show(string text, string caption, /// The action for the second button to take. /// The action for the third button to take. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(IWin32Window owner, - string text, string caption, + public static DialogResult Show(IWin32Window? owner, + string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions customButtonOptions, ExtendedMessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, bool? showCtrlCopy = null, - Font messageboxTypeface = null, bool showOptionalCheckBox = false, - string optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, + Font? messageboxTypeface = null, bool showOptionalCheckBox = false, + string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, Point? optionalCheckBoxLocation = null, - Image customMessageBoxIcon = null, bool showCopyButton = false, - string copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, - string buttonOneCustomText = null, string buttonTwoCustomText = null, - string buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, + Image? customMessageBoxIcon = null, bool showCopyButton = false, + string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, + string? buttonOneCustomText = null, string? buttonTwoCustomText = null, + string? buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, - DialogResult? buttonThreeCustomDialogResult = null) - { - return InternalShow(owner, text, caption, buttons, customButtonOptions, icon, defaultButton, options, new(helpFilePath, navigator), showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); - } + DialogResult? buttonThreeCustomDialogResult = null) => + InternalShow(owner, text, caption, buttons, customButtonOptions, icon, defaultButton, options, new(helpFilePath, navigator), showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); /// /// Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file and Help keyword. @@ -1381,25 +1351,23 @@ public static DialogResult Show(IWin32Window owner, /// The action for the second button to take. /// The action for the third button to take. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(IWin32Window owner, - string text, string caption, + public static DialogResult Show(IWin32Window? owner, + string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions customButtonOptions, ExtendedMessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, - string helpFilePath, string keyword, bool? showCtrlCopy = null, Font messageboxTypeface = null, - bool showOptionalCheckBox = false, string optionalCheckBoxText = null, + string helpFilePath, string keyword, bool? showCtrlCopy = null, Font? messageboxTypeface = null, + bool showOptionalCheckBox = false, string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, - Point? optionalCheckBoxLocation = null, Image customMessageBoxIcon = null, - bool showCopyButton = false, string copyButtonText = null, + Point? optionalCheckBoxLocation = null, Image? customMessageBoxIcon = null, + bool showCopyButton = false, string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, - string buttonOneCustomText = null, string buttonTwoCustomText = null, - string buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, + string? buttonOneCustomText = null, string? buttonTwoCustomText = null, + string? buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, - DialogResult? buttonThreeCustomDialogResult = null) - { - return InternalShow(owner, text, caption, buttons, customButtonOptions, icon, defaultButton, options, new(helpFilePath, keyword), showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); - } + DialogResult? buttonThreeCustomDialogResult = null) => + InternalShow(owner, text, caption, buttons, customButtonOptions, icon, defaultButton, options, new(helpFilePath, keyword), showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); /// /// 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. @@ -1434,25 +1402,23 @@ public static DialogResult Show(IWin32Window owner, /// The action for the second button to take. /// The action for the third button to take. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(string text, string caption, + public static DialogResult Show(string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions customButtonOptions, ExtendedMessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, object param, - bool? showCtrlCopy = null, Font messageboxTypeface = null, - bool showOptionalCheckBox = false, string optionalCheckBoxText = null, + bool? showCtrlCopy = null, Font? messageboxTypeface = null, + bool showOptionalCheckBox = false, string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, - Point? optionalCheckBoxLocation = null, Image customMessageBoxIcon = null, - bool showCopyButton = false, string copyButtonText = null, + Point? optionalCheckBoxLocation = null, Image? customMessageBoxIcon = null, + bool showCopyButton = false, string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, - string buttonOneCustomText = null, string buttonTwoCustomText = null, - string buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, + string? buttonOneCustomText = null, string? buttonTwoCustomText = null, + string? buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, - DialogResult? buttonThreeCustomDialogResult = null) - { - return InternalShow(null, text, caption, buttons, customButtonOptions, icon, defaultButton, options, new(helpFilePath, navigator, param), showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); - } + DialogResult? buttonThreeCustomDialogResult = null) => + InternalShow(null, text, caption, buttons, customButtonOptions, icon, defaultButton, options, new(helpFilePath, navigator, param), showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); /// /// 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. @@ -1488,25 +1454,23 @@ public static DialogResult Show(string text, string caption, /// The action for the second button to take. /// The action for the third button to take. /// One of the System.Windows.Forms.DialogResult values. - public static DialogResult Show(IWin32Window owner, - string text, string caption, + public static DialogResult Show(IWin32Window? owner, + string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions customButtonOptions, ExtendedMessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, object param, - bool? showCtrlCopy = null, Font messageboxTypeface = null, - bool showOptionalCheckBox = false, string optionalCheckBoxText = null, + bool? showCtrlCopy = null, Font? messageboxTypeface = null, + bool showOptionalCheckBox = false, string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, - Point? optionalCheckBoxLocation = null, Image customMessageBoxIcon = null, - bool showCopyButton = false, string copyButtonText = null, + Point? optionalCheckBoxLocation = null, Image? customMessageBoxIcon = null, + bool showCopyButton = false, string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, - string buttonOneCustomText = null, string buttonTwoCustomText = null, - string buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, + string? buttonOneCustomText = null, string? buttonTwoCustomText = null, + string? buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, - DialogResult? buttonThreeCustomDialogResult = null) - { - return InternalShow(owner, text, caption, buttons, customButtonOptions, icon, defaultButton, options, new(helpFilePath, navigator, param), showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); - } + DialogResult? buttonThreeCustomDialogResult = null) => + InternalShow(owner, text, caption, buttons, customButtonOptions, icon, defaultButton, options, new(helpFilePath, navigator, param), showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); /// /// 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. @@ -1540,75 +1504,74 @@ public static DialogResult Show(IWin32Window owner, /// The action for the second button to take. /// The action for the third button to take. /// One of the System.Windows.Forms.DialogResult values. - internal static DialogResult Show(IWin32Window owner, - string text, string caption, + internal static DialogResult Show(IWin32Window? owner, + string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions customButtonOptions, ExtendedMessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, - HelpInformation helpInformation, bool showCtrlCopy, Font messageBoxTypeface, - bool showOptionalCheckBox, string optionalCheckBoxText, bool isOptionalCheckBoxChecked, + HelpInformation? helpInformation, bool showCtrlCopy, Font? messageBoxTypeface, + bool showOptionalCheckBox, string? optionalCheckBoxText, bool isOptionalCheckBoxChecked, CheckState? optionalCheckBoxCheckState, AnchorStyles optionalCheckBoxAnchor, Point optionalCheckBoxLocation, - Image customMessageBoxIcon, bool showCopyButton = false, - string copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, - string buttonOneCustomText = null, string buttonTwoCustomText = null, - string buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, + Image? customMessageBoxIcon, bool showCopyButton = false, + string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, + string? buttonOneCustomText = null, string? buttonTwoCustomText = null, + string? buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, - DialogResult? buttonThreeCustomDialogResult = null) - { - return InternalShow(owner, text, caption, buttons, customButtonOptions, icon, defaultButton, options, helpInformation, showCtrlCopy, messageBoxTypeface, showOptionalCheckBox, - optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, - customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, - buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); - } + DialogResult? buttonThreeCustomDialogResult = null) => + InternalShow(owner, text, caption, buttons, customButtonOptions, icon, defaultButton, options, helpInformation, showCtrlCopy, messageBoxTypeface, showOptionalCheckBox, + optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, optionalCheckBoxLocation, + customMessageBoxIcon, showCopyButton, copyButtonText, fade, fadeSleepTimer, buttonOneCustomText, buttonTwoCustomText, + buttonThreeCustomText, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult); + #endregion #region Implementation - private static DialogResult InternalShow(IWin32Window owner, - string text, string caption, + private static DialogResult InternalShow(IWin32Window? owner, + string? text, string caption, ExtendedMessageBoxButtons buttons, ExtendedMessageBoxCustomButtonOptions? customButtonOptions, ExtendedMessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, - HelpInformation helpInformation, bool? showCtrlCopy, Font messageboxTypeface = null, - bool showOptionalCheckBox = false, string optionalCheckBoxText = null, + HelpInformation? helpInformation, bool? showCtrlCopy, Font? messageboxTypeface = null, + bool showOptionalCheckBox = false, string? optionalCheckBoxText = null, bool isOptionalCheckBoxChecked = false, CheckState? optionalCheckBoxCheckState = null, AnchorStyles? optionalCheckBoxAnchor = null, Point? optionalCheckBoxLocation = null, - Image customMessageBoxIcon = null, bool showCopyButton = false, - string copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, - string buttonOneCustomText = null, string buttonTwoCustomText = null, - string buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, + Image? customMessageBoxIcon = null, bool showCopyButton = false, + string? copyButtonText = null, bool? fade = false, int? fadeSleepTimer = 50, + string? buttonOneCustomText = null, string? buttonTwoCustomText = null, + string? buttonThreeCustomText = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, DialogResult? buttonThreeCustomDialogResult = null, bool? showToolTips = null) { // 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)) + 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)) + 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 ((helpInformation != null) && ((options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) != 0)) + if (helpInformation != null && (options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) != 0) { throw new ArgumentException(@"Cannot show message box from a service with help specified", nameof(options)); } // If help information provided or we are not a service/default desktop application then grab an owner for showing the message box - IWin32Window showOwner = null; - if ((helpInformation != null) || ((options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) == 0)) + IWin32Window? showOwner = null; + if (helpInformation != 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 ?? FromHandle(PlatformInvoke.GetActiveWindow()); } // Show message box window as a modal dialog and then dispose of it afterwards - using (KryptonMessageBoxExtended ekmb = new(showOwner, text, caption, buttons, customButtonOptions, icon, defaultButton, + using (KryptonMessageBoxExtended ekmb = new KryptonMessageBoxExtended(showOwner, text, caption, buttons, customButtonOptions, icon, defaultButton, options, helpInformation, showCtrlCopy, messageboxTypeface, showOptionalCheckBox, optionalCheckBoxText, isOptionalCheckBoxChecked, optionalCheckBoxCheckState, optionalCheckBoxAnchor, @@ -1626,7 +1589,7 @@ private static DialogResult InternalShow(IWin32Window owner, private void UpdateText() { - Text = (string.IsNullOrWhiteSpace(_caption) ? string.Empty : _caption.Split(Environment.NewLine.ToCharArray())[0]); + Text = string.IsNullOrWhiteSpace(_caption) ? string.Empty : _caption.Split(Environment.NewLine.ToCharArray())[0]; _messageText.StateCommon.Font = _messageboxTypeface; _messageText.Text = _text; } @@ -1703,14 +1666,14 @@ private void UpdateButtons() SetCustomButtonText(_customButtonOptions, _buttonOneText, _buttonOneResult, _buttonTwoText, _buttonTwoResult, _buttonThreeText, _buttonThreeResult); break; */ case ExtendedMessageBoxButtons.OK: - _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + _button1.Text = KryptonManager.Strings.GeneralStrings.OK; _button1.DialogResult = DialogResult.OK; _button1.StateCommon.Content.ShortText.Font = _messageboxTypeface; _button2.Visible = _button3.Visible = false; break; case ExtendedMessageBoxButtons.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.StateCommon.Content.ShortText.Font = _messageboxTypeface; @@ -1718,8 +1681,8 @@ private void UpdateButtons() _button3.Visible = false; break; case ExtendedMessageBoxButtons.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.StateCommon.Content.ShortText.Font = _messageboxTypeface; @@ -1728,9 +1691,9 @@ private void UpdateButtons() ControlBox = false; break; case ExtendedMessageBoxButtons.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; @@ -1739,8 +1702,8 @@ private void UpdateButtons() _button3.StateCommon.Content.ShortText.Font = _messageboxTypeface; break; case ExtendedMessageBoxButtons.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.StateCommon.Content.ShortText.Font = _messageboxTypeface; @@ -1748,9 +1711,9 @@ private void UpdateButtons() _button3.Visible = false; break; case ExtendedMessageBoxButtons.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; @@ -1787,7 +1750,7 @@ private void UpdateHelp() { } - private void UpdateSizing(IWin32Window showOwner) + private void UpdateSizing(IWin32Window? showOwner) { Size messageSizing = UpdateMessageSizing(showOwner); Size buttonsSizing = UpdateButtonsSizing(); @@ -1797,7 +1760,7 @@ private void UpdateSizing(IWin32Window showOwner) messageSizing.Height + buttonsSizing.Height); } - private Size UpdateMessageSizing(IWin32Window showOwner) + private Size UpdateMessageSizing(IWin32Window? showOwner) { // Update size of the message label but with a maximum width using (Graphics g = CreateGraphics()) @@ -1805,7 +1768,7 @@ private Size UpdateMessageSizing(IWin32Window showOwner) // 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.Width *= 2 / 3.0f; scaledMonitorSize.Height *= 0.95f; _messageText.UpdateFont(); SizeF messageSize = g.MeasureString(_text, _messageText.Font, scaledMonitorSize); @@ -1814,8 +1777,8 @@ private Size UpdateMessageSizing(IWin32Window showOwner) float messageXSize = Math.Max(messageSize.Width, captionSize.Width); // Work out DPI adjustment factor - float factorX = g.DpiX > 96 ? ((1.0f * g.DpiX) / 96) : 1.0f; - float factorY = g.DpiY > 96 ? ((1.0f * g.DpiY) / 96) : 1.0f; + float factorX = g.DpiX > 96 ? 1.0f * g.DpiX / 96 : 1.0f; + float factorY = g.DpiY > 96 ? 1.0f * g.DpiY / 96 : 1.0f; messageSize.Width = messageXSize * factorX; messageSize.Height = messageSize.Height * factorY; @@ -1930,23 +1893,23 @@ private Size UpdateButtonsSizing() _button1.Size = maxButtonSize; // Size the panel for the buttons - _panelButtons.Size = new((maxButtonSize.Width * numButtons) + (GAP * (numButtons + 1)), maxButtonSize.Height + (GAP * 2)); + _panelButtons.Size = new(maxButtonSize.Width * numButtons + GAP * (numButtons + 1), maxButtonSize.Height + GAP * 2); // Button area is the number of buttons with gaps between them and 10 pixels around all edges - return new((maxButtonSize.Width * numButtons) + (GAP * (numButtons + 1)), maxButtonSize.Height + (GAP * 2)); + return new(maxButtonSize.Width * numButtons + GAP * (numButtons + 1), maxButtonSize.Height + GAP * 2); } private void button_keyDown(object sender, KeyEventArgs e) { // Escape key kills the dialog if we allow it to be closed - if ((e.KeyCode == Keys.Escape) && ControlBox) + if (e.KeyCode == Keys.Escape && ControlBox) { Close(); } else { // Pressing Ctrl+C should copy message text into the clipboard - if ((e.Modifiers == Keys.Control) && (e.KeyCode == Keys.C)) + if (e.Modifiers == Keys.Control && e.KeyCode == Keys.C) { StringBuilder sb = new(); @@ -1989,7 +1952,7 @@ private void button_keyDown(object sender, KeyEventArgs e) /// State of the optional CheckBox check. /// The optional CheckBox anchor. /// The optional CheckBox location. - private void ShowOptionalCheckBoxUI(bool showOptionalCheckBox, string optionalCheckBoxText, + private void ShowOptionalCheckBoxUI(bool showOptionalCheckBox, string? optionalCheckBoxText, bool isOptionalCheckBoxChecked, CheckState? optionalCheckBoxCheckState, AnchorStyles? optionalCheckBoxAnchor, Point? optionalCheckBoxLocation) { @@ -2042,7 +2005,7 @@ public static bool GetOptionalCheckBoxState() /// Shows the copy button. /// if set to true [show copy button]. /// The copy button text. - private void ShowCopyButton(bool showCopyButton, string copyButtonText) + private void ShowCopyButton(bool showCopyButton, string? copyButtonText) { _copyButton.Visible = showCopyButton; @@ -2074,7 +2037,7 @@ private void SetCustomButtonText(ExtendedMessageBoxCustomButtonOptions customBut switch (customButtonOptions) { case ExtendedMessageBoxCustomButtonOptions.None: - _button3.Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + _button3.Text = KryptonManager.Strings.GeneralStrings.OK; _button3.DialogResult = DialogResult.OK; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxButtons.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxButtons.cs index cdcc4f68a..576ac23cf 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxButtons.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxButtons.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxCustomButtonOptions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxCustomButtonOptions.cs index 814b454e8..fdc54a6bc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxCustomButtonOptions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxCustomButtonOptions.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxIcon.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxIcon.cs index e36cf51d2..590c0f943 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxIcon.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxIcon.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxTimeoutAction.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxTimeoutAction.cs index b17c47d81..2d0b02fec 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxTimeoutAction.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxTimeoutAction.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxTimeoutButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxTimeoutButton.cs index 3fdee42cf..140e0a86d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxTimeoutButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Enumerations/ExtendedMessageBoxTimeoutButton.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Globals/GlobalDeclarations.cs index ecef31309..2cc8dcd59 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Globals/GlobalDeclarations.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Krypton.Toolkit.Suite.Extended.Developer.Utilities 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Krypton.Toolkit.Suite.Extended.Developer.Utilities 2022.csproj index df10a9a1f..f21a61b61 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Krypton.Toolkit.Suite.Extended.Developer.Utilities 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Krypton.Toolkit.Suite.Extended.Developer.Utilities 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -70,9 +58,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements utilities for developer usage. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements utilities for developer usage. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -80,74 +68,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + @@ -160,7 +110,7 @@ enable - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Krypton.Toolkit.Suite.Extended.Developer.Utilities.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Krypton.Toolkit.Suite.Extended.Developer.Utilities.licenseheader index c890e86c0..a0e5e0a62 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Krypton.Toolkit.Suite.Extended.Developer.Utilities.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Krypton.Toolkit.Suite.Extended.Developer.Utilities.licenseheader @@ -4,7 +4,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Classes/IOExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Classes/IOExtensions.cs index ffc7c651b..d5a328d26 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Classes/IOExtensions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Classes/IOExtensions.cs @@ -16,19 +16,19 @@ public IOExtensions() #region Implementation - internal static Image ExtractIconFromFilePath(string filePath) + internal static Image? ExtractIconFromFilePath(string filePath) { - Image icon = null; + Image? icon = null; try { - //Icon i = new Icon(). + Icon? i = Icon.ExtractAssociatedIcon(filePath); - //icon = i. + icon = i?.ToBitmap(); } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } return icon; @@ -42,13 +42,13 @@ internal static void GetFavIcon(PictureBox targetControl, string url, PictureBox { try { - targetControl.ImageLocation = $"{url}/favicon.ico"; + targetControl.ImageLocation = $@"{url}/favicon.ico"; targetControl.SizeMode = sizeMode; } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Components/KryptonAboutBoxManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Components/KryptonAboutBoxManager.cs deleted file mode 100644 index 7cf87d6cc..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Components/KryptonAboutBoxManager.cs +++ /dev/null @@ -1,114 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Dialogs -{ - public class KryptonAboutBoxManager : Component - { - #region Variables - private Assembly _assembly; - - private Application _application; - - private bool _showDescription, _showFrameworkVersion, _showSystemInformation; - - private Image _applicationIcon; - - private string _aboutText, _applicationText, _applicationDescription, _versionText, _copyrightText, _frameworkVersionText, _showSystemInformationText; - #endregion - - #region Properties - public Assembly Assembly { get => _assembly; set => _assembly = value; } - - public Application Application { get => _application; set => _application = value; } - - public bool ShowDescription { get => _showDescription; set => _showDescription = value; } - - public bool ShowFrameworkVersion { get => _showFrameworkVersion; set => _showFrameworkVersion = value; } - - public bool ShowSystemInformation { get => _showSystemInformation; set => _showSystemInformation = value; } - - public Image ApplicationIcon { get => _applicationIcon; set => _applicationIcon = value; } - - public string AboutText { get => _aboutText; set => _aboutText = value; } - - public string ApplicationText { get => _applicationText; set => _applicationText = value; } - - public string ApplicationDescription { get => _applicationDescription; set => _applicationDescription = value; } - - public string CopyrightText { get => _copyrightText; set => _copyrightText = value; } - - public string FrameworkVersionText { get => _frameworkVersionText; set => _frameworkVersionText = value; } - - public string ShowSystemInformationText { get => _showSystemInformationText; set => _showSystemInformationText = value; } - - public string VersionText { get => _versionText; set => _versionText = value; } - #endregion - - #region Constructor - public KryptonAboutBoxManager() - { - _assembly = Assembly.GetExecutingAssembly(); - - FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(_assembly.Location); - - _showDescription = true; - - _showFrameworkVersion = true; - - _showSystemInformation = false; - - _applicationIcon = Icon.ExtractAssociatedIcon(Application.ExecutablePath).ToBitmap(); - - _applicationText = "Application"; - - _applicationDescription = fvi.FileDescription; - - _aboutText = "About"; - - _copyrightText = "Copyright (c)"; - - _frameworkVersionText = "Framework Version"; - - _showSystemInformationText = "&Show System Information"; - - _versionText = "Version"; - } - #endregion - - #region Methods - public void DisplayAboutBox() - { - KryptonAboutDialog aboutDialog = new(_applicationIcon, _assembly, _showDescription, _showFrameworkVersion, - _showSystemInformation, _applicationText, _aboutText, _copyrightText, - _frameworkVersionText, _showSystemInformationText, _versionText); - - aboutDialog.ShowDialog(); - } - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Controls Toolkit/KryptonAboutExtendedToolkit.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Controls Toolkit/KryptonAboutExtendedToolkit.cs new file mode 100644 index 000000000..157b91bb1 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Controls Toolkit/KryptonAboutExtendedToolkit.cs @@ -0,0 +1,57 @@ +#region MIT License +/* + * + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Dialogs +{ + /// The public interface to the class. + [ToolboxItem(false)] + [DesignerCategory(@"code")] + public class KryptonAboutExtendedToolkit + { + #region Public + + /// Shows the specified about extended toolkit data. + /// The about extended toolkit data. + /// + public static DialogResult Show(KryptonAboutExtendedToolkitData aboutExtendedToolkitData) => + ShowCore(aboutExtendedToolkitData); + + #endregion + + #region Implementation + + private static DialogResult ShowCore(KryptonAboutExtendedToolkitData aboutExtendedToolkitData) + { + using var kaet = new KryptonAboutExtendedToolkitForm(aboutExtendedToolkitData); + + return kaet.ShowDialog(); + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Controls Toolkit/KryptonBrowseComboBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Controls Toolkit/KryptonBrowseComboBox.cs index ba1670433..9e827eb62 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Controls Toolkit/KryptonBrowseComboBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Controls Toolkit/KryptonBrowseComboBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Controls Toolkit/KryptonSplitButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Controls Toolkit/KryptonSplitButton.cs index 4d20e7f16..dd98150d2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Controls Toolkit/KryptonSplitButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Controls Toolkit/KryptonSplitButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -213,7 +213,7 @@ protected override void OnPaint(PaintEventArgs e) int internalBorder = BORDER_SIZE; - Rectangle focusRectangle = new(internalBorder, internalBorder, bounds.Width - _dropDownRectangle.Width - internalBorder, bounds.Height - (internalBorder * 2)); + Rectangle focusRectangle = new(internalBorder, internalBorder, bounds.Width - _dropDownRectangle.Width - internalBorder, bounds.Height - internalBorder * 2); PaletteBase palette = KryptonManager.CurrentGlobalPalette; @@ -266,7 +266,7 @@ private static void PaintArrow(Graphics graphics, Rectangle rectangle) { Point midPoint = new(Convert.ToInt32(rectangle.Left + rectangle.Width / 2), Convert.ToInt32(rectangle.Top + rectangle.Height / 2)); - midPoint.X += (rectangle.Width % 2); + midPoint.X += rectangle.Width % 2; Point[] arrow = new Point[] { new(midPoint.X - 2, midPoint.Y - 1), new(midPoint.X + 3, midPoint.Y - 1), new(midPoint.X, midPoint.Y + 2) }; @@ -310,7 +310,7 @@ private void KryptonContextMenu_Closed(object sender, ToolStripDropDownClosedEve //if (e.CloseReason == ToolStripDropDownCloseReason.AppClicked) //{ - _skipNextOpen = (_dropDownRectangle.Contains(PointToClient(Cursor.Position))); + _skipNextOpen = _dropDownRectangle.Contains(PointToClient(Cursor.Position)); //} } @@ -324,7 +324,7 @@ private void ContextMenuStrip_Closing(object sender, ToolStripDropDownClosingEve if (e.CloseReason == ToolStripDropDownCloseReason.AppClicked) { - _skipNextOpen = (_dropDownRectangle.Contains(PointToClient(Cursor.Position))); + _skipNextOpen = _dropDownRectangle.Contains(PointToClient(Cursor.Position)); } } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Readme.md b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Controls Visuals/Text to Speech/KryptonTextToSpeechDialog.cs similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Readme.md rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Controls Visuals/Text to Speech/KryptonTextToSpeechDialog.cs diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Enumerations/AboutToolkitPage.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Enumerations/AboutToolkitPage.cs new file mode 100644 index 000000000..7f321279c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Enumerations/AboutToolkitPage.cs @@ -0,0 +1,38 @@ +#region MIT License +/* + * + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Dialogs +{ + internal enum AboutToolkitPage + { + GeneralInformation = 0, + Discord = 1, + DeveloperInformation = 2, + Versions = 3 + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Enumerations/RunDialogStartPosition.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Enumerations/RunDialogStartPosition.cs index 21ea73e5d..e21e858f0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Enumerations/RunDialogStartPosition.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Enumerations/RunDialogStartPosition.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Enumerations/ShowResetOnRunDialog.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Enumerations/ShowResetOnRunDialog.cs index 1ebee5ed7..2b9471e68 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Enumerations/ShowResetOnRunDialog.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Enumerations/ShowResetOnRunDialog.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Events/UAC Elevation/ExecuteProcessAsAdministratorEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Events/UAC Elevation/ExecuteProcessAsAdministratorEventArgs.cs index ceda519bd..9a1bc6211 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Events/UAC Elevation/ExecuteProcessAsAdministratorEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Events/UAC Elevation/ExecuteProcessAsAdministratorEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -107,7 +107,7 @@ private void ElevateProcessWithAdministrativeRights(object objectToElevate, stri } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } @@ -141,7 +141,7 @@ public void ElevateProcessWithAdministrativeRights(string? processName, string? } catch (Win32Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } return; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/General/KryptonAboutExtendedToolkitData.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/General/KryptonAboutExtendedToolkitData.cs new file mode 100644 index 000000000..fad5de81b --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/General/KryptonAboutExtendedToolkitData.cs @@ -0,0 +1,225 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Dialogs +{ + /// Contains the information used for creating a new . + public struct KryptonAboutExtendedToolkitData + { + #region Static Fields + + private const string DEFAULT_BUILT_ON_TEXT = @"Built On"; + + private const string DEFAULT_CURRENT_THEME_TEXT = @"Current Theme"; + + private const string DEFAULT_HEADER_TEXT = @"About"; + + private const string DEFAULT_GENERAL_INFORMATION_WELCOME_TEXT = @"Some of the components used in this application are part of the Krypton Extended Toolkit."; + + private const string DEFAULT_GENERAL_INFORMATION_LICENSE_TEXT = @"License"; + + private const string DEFAULT_GENERAL_INFORMATION_LEARN_MORE_TEXT = @"To learn more, click here."; + + private const string DEFAULT_JOIN_DISCORD_SERVER = @"Join our Discord server."; + + private const string DEFAULT_VIEW_REPOSITORIES = @"View our repositories."; + + private const string DEFAULT_DOWNLOAD_DOCUMENTATION = @"Download the latest documentation."; + + private const string DEFAULT_DOWNLOAD_DEMOS = @"Download the demos."; + + private const string DEFAULT_FILE_NAME_COLUMN_HEADER_TEXT = @"File Name"; + + private const string DEFAULT_VERSION_COLUMN_HEADER_TEXT = @"Version"; + + private const string DEFAULT_TOOL_BAR_GENERAL_INFORMATION_TEXT = @"General Information"; + + private const string DEFAULT_TOOL_BAR_DISCORD_TEXT = @"Discord"; + + private const string DEFAULT_TOOL_BAR_DEVELOPER_INFORMATION_TEXT = @"Developer Information"; + + private const string DEFAULT_TOOL_BAR_VERSION_INFORMATION_TEXT = @"Version Information"; + + #endregion + + #region Instance Fields + + /// Shows the discord button. + public bool ShowDiscordButton { get; set; } = true; + + /// Shows the developer information button. + public bool ShowDeveloperInformationButton { get; set; } = true; + + /// Shows the version information button. + public bool ShowVersionInformationButton { get; set; } = true; + + /// Shows the theme options. + public bool ShowThemeOptions { get; set; } = true; + + /// The show system information button. + public bool ShowSystemInformationButton { get; set; } = true; + + /// Gets or sets a value indicating whether to show the build date label. + public bool ShowBuildDate { get; set; } = true; + + //public Font CommonFont; + //public Font CurrentThemeFont; + //public Font HeaderFont; + + /// The toolkit type. + public ToolkitType ToolkitType { get; set; } = ToolkitType.Stable; + + /// The header text. + public string HeaderText { get; set; } = DEFAULT_HEADER_TEXT; + + /// The current theme text. + public string CurrentThemeText { get; set; } = DEFAULT_CURRENT_THEME_TEXT; + + /// The general information welcome text. + public string GeneralInformationWelcomeText { get; set; } = DEFAULT_GENERAL_INFORMATION_WELCOME_TEXT; + + /// The general information license text. + public string GeneralInformationLicenseText { get; set; } = DEFAULT_GENERAL_INFORMATION_LICENSE_TEXT; + + /// The general information learn more text. + public string GeneralInformationLearnMoreText { get; set; } = DEFAULT_GENERAL_INFORMATION_LEARN_MORE_TEXT; + + /// The discord text. + public string DiscordText { get; set; } = DEFAULT_JOIN_DISCORD_SERVER; + + /// The repository information text. + public string RepositoryInformationText { get; set; } = DEFAULT_VIEW_REPOSITORIES; + + /// The download documentation text. + public string DownloadDocumentationText { get; set; } = DEFAULT_DOWNLOAD_DOCUMENTATION; + + /// The download demos text. + public string DownloadDemosText { get; set; } = DEFAULT_DOWNLOAD_DEMOS; + + /// The file name column header text. + public string FileNameColumnHeaderText { get; set; } = DEFAULT_FILE_NAME_COLUMN_HEADER_TEXT; + + /// The version column header text. + public string VersionColumnHeaderText { get; set; } = DEFAULT_VERSION_COLUMN_HEADER_TEXT; + + /// The tool bar general information text. + public string ToolBarGeneralInformationText { get; set; } = DEFAULT_TOOL_BAR_GENERAL_INFORMATION_TEXT; + + /// The tool bar discord text. + public string ToolBarDiscordText { get; set; } = DEFAULT_TOOL_BAR_DISCORD_TEXT; + + /// The tool bar developer information text. + public string ToolBarDeveloperInformationText { get; set; } = DEFAULT_TOOL_BAR_DEVELOPER_INFORMATION_TEXT; + + /// The tool bar version information text. + public string ToolBarVersionInformationText { get; set; } = DEFAULT_TOOL_BAR_VERSION_INFORMATION_TEXT; + + /// Gets or sets the build on text. + public string BuildOnText { get; set; } = DEFAULT_BUILT_ON_TEXT; + + /// The learn more link area. + public LinkArea LearnMoreLinkArea { get; set; } = new LinkArea(130, 135); + + /// The discord link area. + public LinkArea DiscordLinkArea { get; set; } = new LinkArea(0, 4); + + /// The repository information link area. + public LinkArea RepositoryInformationLinkArea { get; set; } = new LinkArea(0, 4); + + /// The download demos link area. + public LinkArea DownloadDemosLinkArea { get; set; } = new LinkArea(0, 9); + + /// The documentation link area. + public LinkArea DocumentationLinkArea { get; set; } = new LinkArea(0, 9); + + #endregion + + #region Identity + + /// Initializes a new instance of the struct. + public KryptonAboutExtendedToolkitData() + { + ShowDiscordButton = true; + + ShowDeveloperInformationButton = true; + + ShowVersionInformationButton = true; + + ShowThemeOptions = true; + + ShowSystemInformationButton = true; + + ShowBuildDate = true; + + ToolkitType = ToolkitType.Stable; + + BuildOnText = DEFAULT_BUILT_ON_TEXT; + + HeaderText = DEFAULT_HEADER_TEXT; + + CurrentThemeText = DEFAULT_CURRENT_THEME_TEXT; + + GeneralInformationLearnMoreText = DEFAULT_GENERAL_INFORMATION_LEARN_MORE_TEXT; + + GeneralInformationLicenseText = DEFAULT_GENERAL_INFORMATION_LICENSE_TEXT; + + GeneralInformationWelcomeText = DEFAULT_GENERAL_INFORMATION_WELCOME_TEXT; + + DiscordText = DEFAULT_JOIN_DISCORD_SERVER; + + RepositoryInformationText = DEFAULT_VIEW_REPOSITORIES; + + DownloadDocumentationText = DEFAULT_DOWNLOAD_DOCUMENTATION; + + DownloadDemosText = DEFAULT_DOWNLOAD_DEMOS; + + FileNameColumnHeaderText = DEFAULT_FILE_NAME_COLUMN_HEADER_TEXT; + + VersionColumnHeaderText = DEFAULT_VERSION_COLUMN_HEADER_TEXT; + + ToolBarGeneralInformationText = DEFAULT_TOOL_BAR_GENERAL_INFORMATION_TEXT; + + ToolBarDiscordText = DEFAULT_TOOL_BAR_DISCORD_TEXT; + + ToolBarDeveloperInformationText = DEFAULT_TOOL_BAR_DEVELOPER_INFORMATION_TEXT; + + ToolBarVersionInformationText = DEFAULT_TOOL_BAR_VERSION_INFORMATION_TEXT; + + LearnMoreLinkArea = new LinkArea(133, 143); + + DiscordLinkArea = new LinkArea(0, 4); + + RepositoryInformationLinkArea = new LinkArea(0, 4); + + DownloadDemosLinkArea = new LinkArea(0, 9); + + DocumentationLinkArea = new LinkArea(0, 9); + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Globals/GlobalDeclarations.cs index dead36abd..0087eac23 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -38,11 +38,12 @@ global using System.Windows.Forms; global using Krypton.Toolkit.Suite.Extended.Common; +global using Krypton.Toolkit.Suite.Extended.Debug.Tools; global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; +global using Krypton.Toolkit.Suite.Extended.Dialogs.Properties; global using Krypton.Toolkit.Suite.Extended.Forms; global using Krypton.Toolkit.Suite.Extended.Global.Utilities; global using Krypton.Toolkit.Suite.Extended.Settings; global using Krypton.Toolkit.Suite.Extended.Shared; -global using Krypton.Toolkit.Suite.Extended.Utilities.System.Synthesis; global using Microsoft.WindowsAPICodePack.Dialogs; \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Interfaces/IAbout.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Interfaces/IAbout.cs index c6744374e..cf2a89eea 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Interfaces/IAbout.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Interfaces/IAbout.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Krypton.Toolkit.Suite.Extended.Dialogs 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Krypton.Toolkit.Suite.Extended.Dialogs 2022.csproj index c9d24af61..9c51df9e2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Krypton.Toolkit.Suite.Extended.Dialogs 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Krypton.Toolkit.Suite.Extended.Dialogs 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements additional extensions to standard dialogs. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements additional extensions to standard dialogs. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,74 +69,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + @@ -161,7 +111,8 @@ - + + @@ -214,6 +165,7 @@ + true diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Krypton.Toolkit.Suite.Extended.Dialogs.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Krypton.Toolkit.Suite.Extended.Dialogs.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Krypton.Toolkit.Suite.Extended.Dialogs.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Krypton.Toolkit.Suite.Extended.Dialogs.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Properties/Resources.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Properties/Resources.Designer.cs index 8e8586ff1..cfc155be5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Properties/Resources.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Properties/Resources.Designer.cs @@ -60,6 +60,16 @@ internal Resources() { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Canary { + get { + object obj = ResourceManager.GetObject("Canary", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized string similar to Type the name of a program, folder, document or Internet resource, and Windows will open it for you.. /// @@ -148,6 +158,46 @@ internal static string InputBoxCueText { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Krypton_Canary { + get { + object obj = ResourceManager.GetObject("Krypton Canary", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Krypton_Nightly { + get { + object obj = ResourceManager.GetObject("Krypton Nightly", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Krypton_Stable { + get { + object obj = ResourceManager.GetObject("Krypton Stable", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Nightly { + get { + object obj = ResourceManager.GetObject("Nightly", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized string similar to Open as &administrator. /// @@ -224,5 +274,15 @@ internal static System.Drawing.Bitmap Settings_16_x_16 { return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Stable { + get { + object obj = ResourceManager.GetObject("Stable", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Properties/Resources.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Properties/Resources.resx index b716cf91c..60ec51094 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Properties/Resources.resx +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Properties/Resources.resx @@ -117,13 +117,16 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\Canary.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Type the name of a program, folder, document or Internet resource, and Windows will open it for you. Type a file path or URL here... - ..\Resources\Input_Box_Critical_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -145,6 +148,18 @@ ..\Resources\Input_Box_Warning_128_x_115.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Krypton Canary.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\..\..\..\Assets\PNG\NuGet Package Icons\Krypton Nightly.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Krypton Stable.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Nightly.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Open as &administrator @@ -169,4 +184,7 @@ ..\Resources\Settings_16_x_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Stable.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Resources/Canary.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Resources/Canary.png new file mode 100644 index 000000000..9a5405282 Binary files /dev/null and b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Resources/Canary.png differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Resources/Krypton Canary.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Resources/Krypton Canary.png new file mode 100644 index 000000000..c92fd9c2e Binary files /dev/null and b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Resources/Krypton Canary.png differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Resources/Krypton Stable.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Resources/Krypton Stable.png new file mode 100644 index 000000000..0a0721512 Binary files /dev/null and b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Resources/Krypton Stable.png differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Resources/Nightly.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Resources/Nightly.png new file mode 100644 index 000000000..ba558f6d2 Binary files /dev/null and b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Resources/Nightly.png differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Resources/Stable.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Resources/Stable.png new file mode 100644 index 000000000..c09268b13 Binary files /dev/null and b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Resources/Stable.png differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/About/KryptonAboutDialog.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/About/KryptonAboutDialog.cs deleted file mode 100644 index d75f23691..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/About/KryptonAboutDialog.cs +++ /dev/null @@ -1,307 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - - -namespace Krypton.Toolkit.Suite.Extended.Dialogs -{ - public class KryptonAboutDialog : CommonExtendedKryptonForm - { - #region Design Code - private KryptonPanel kryptonPanel1; - private KryptonLabel klblApplicationVersion; - private KryptonLabel klblApplicationName; - private System.Windows.Forms.PictureBox pbxApplicationIcon; - private KryptonButton kbtnOk; - private KryptonRichTextBox krtbMoreDetails; - private KryptonLabel klblCopyright; - private KryptonButton kbtnSystemInformation; - private KryptonLabel klblFrameworkVersion; - private KryptonBorderEdge kryptonBorderEdge1; - private KryptonPanel kryptonPanel2; - - private void InitializeComponent() - { - this.kryptonPanel1 = new(); - this.kbtnSystemInformation = new(); - this.kbtnOk = new(); - this.kryptonPanel2 = new(); - this.klblFrameworkVersion = new(); - this.krtbMoreDetails = new(); - this.klblCopyright = new(); - this.klblApplicationVersion = new(); - this.klblApplicationName = new(); - this.pbxApplicationIcon = new(); - this.kryptonBorderEdge1 = new(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); - this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); - this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbxApplicationIcon)).BeginInit(); - this.SuspendLayout(); - // - // kryptonPanel1 - // - this.kryptonPanel1.Controls.Add(this.kryptonBorderEdge1); - this.kryptonPanel1.Controls.Add(this.kbtnSystemInformation); - this.kryptonPanel1.Controls.Add(this.kbtnOk); - this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.kryptonPanel1.Location = new(0, 339); - this.kryptonPanel1.Name = "kryptonPanel1"; - this.kryptonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel1.Size = new(622, 46); - this.kryptonPanel1.TabIndex = 0; - // - // kbtnSystemInformation - // - this.kbtnSystemInformation.Location = new(12, 9); - this.kbtnSystemInformation.Name = "kbtnSystemInformation"; - this.kbtnSystemInformation.Size = new(128, 25); - this.kbtnSystemInformation.TabIndex = 1; - this.kbtnSystemInformation.Values.Text = "System &Information"; - this.kbtnSystemInformation.Visible = false; - this.kbtnSystemInformation.Click += new(this.kbtnSystemInformation_Click); - // - // kbtnOk - // - this.kbtnOk.DialogResult = System.Windows.Forms.DialogResult.OK; - this.kbtnOk.Location = new(520, 9); - this.kbtnOk.Name = "kbtnOk"; - this.kbtnOk.Size = new(90, 25); - this.kbtnOk.TabIndex = 0; - this.kbtnOk.Values.Text = "&Ok"; - // - // kryptonPanel2 - // - this.kryptonPanel2.Controls.Add(this.klblFrameworkVersion); - this.kryptonPanel2.Controls.Add(this.krtbMoreDetails); - this.kryptonPanel2.Controls.Add(this.klblCopyright); - this.kryptonPanel2.Controls.Add(this.klblApplicationVersion); - this.kryptonPanel2.Controls.Add(this.klblApplicationName); - this.kryptonPanel2.Controls.Add(this.pbxApplicationIcon); - this.kryptonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonPanel2.Location = new(0, 0); - this.kryptonPanel2.Name = "kryptonPanel2"; - this.kryptonPanel2.Size = new(622, 339); - this.kryptonPanel2.TabIndex = 2; - // - // klblFrameworkVersion - // - this.klblFrameworkVersion.Location = new(146, 98); - this.klblFrameworkVersion.Name = "klblFrameworkVersion"; - this.klblFrameworkVersion.Size = new(156, 19); - this.klblFrameworkVersion.StateCommon.ShortText.Font = new("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.klblFrameworkVersion.TabIndex = 5; - this.klblFrameworkVersion.Values.Text = "Framework Version: {0}"; - // - // krtbMoreDetails - // - this.krtbMoreDetails.Location = new(146, 141); - this.krtbMoreDetails.Name = "krtbMoreDetails"; - this.krtbMoreDetails.ReadOnly = true; - this.krtbMoreDetails.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedHorizontal; - this.krtbMoreDetails.Size = new(464, 183); - this.krtbMoreDetails.TabIndex = 4; - this.krtbMoreDetails.Text = ""; - // - // klblCopyright - // - this.klblCopyright.Location = new(146, 70); - this.klblCopyright.Name = "klblCopyright"; - this.klblCopyright.Size = new(95, 19); - this.klblCopyright.StateCommon.ShortText.Font = new("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.klblCopyright.TabIndex = 3; - this.klblCopyright.Values.Text = "Copyright: {0}"; - // - // klblApplicationVersion - // - this.klblApplicationVersion.Location = new(146, 42); - this.klblApplicationVersion.Name = "klblApplicationVersion"; - this.klblApplicationVersion.Size = new(83, 19); - this.klblApplicationVersion.StateCommon.ShortText.Font = new("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.klblApplicationVersion.TabIndex = 2; - this.klblApplicationVersion.Values.Text = "Version: {0}"; - // - // klblApplicationName - // - this.klblApplicationName.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl; - this.klblApplicationName.Location = new(146, 12); - this.klblApplicationName.Name = "klblApplicationName"; - this.klblApplicationName.Size = new(119, 21); - this.klblApplicationName.StateCommon.ShortText.Font = new("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.klblApplicationName.TabIndex = 1; - this.klblApplicationName.Values.Text = "Application: {0}"; - // - // pbxApplicationIcon - // - this.pbxApplicationIcon.BackColor = System.Drawing.Color.Transparent; - this.pbxApplicationIcon.Location = new(12, 12); - this.pbxApplicationIcon.Name = "pbxApplicationIcon"; - this.pbxApplicationIcon.Size = new(128, 128); - this.pbxApplicationIcon.TabIndex = 0; - this.pbxApplicationIcon.TabStop = false; - // - // kryptonBorderEdge1 - // - this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderSecondary; - this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Top; - this.kryptonBorderEdge1.Location = new(0, 0); - this.kryptonBorderEdge1.Name = "kryptonBorderEdge1"; - this.kryptonBorderEdge1.Size = new(622, 1); - this.kryptonBorderEdge1.Text = "kryptonBorderEdge1"; - // - // KryptonAboutDialog - // - this.AcceptButton = this.kbtnOk; - this.ClientSize = new(622, 385); - this.Controls.Add(this.kryptonPanel2); - this.Controls.Add(this.kryptonPanel1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "KryptonAboutDialog"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; - this.Load += new(this.KryptonAboutDialog_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(); - ((System.ComponentModel.ISupportInitialize)(this.pbxApplicationIcon)).EndInit(); - this.ResumeLayout(false); - - } - #endregion - - #region Constructors - public KryptonAboutDialog(Image applicationIcon, Assembly assembly, Effects.FadeSpeedChoice speedChoice = Effects.FadeSpeedChoice.Normal, float fadeDelay = 50, int fadeSpeed = 50) - { - InitializeComponent(); - - FadeSpeed = fadeDelay; - - FadeSpeedChoice = speedChoice; - - SleepInterval = fadeSpeed; - - try - { - FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location); - - Text = $"About {assembly.FullName}"; - - pbxApplicationIcon.Image = applicationIcon; - - klblApplicationName.Text = $"Application: {fvi.ProductName}"; - - klblApplicationVersion.Text = $"Version: {fvi.FileVersion}"; - - klblCopyright.Text = $"Copyright: {fvi.LegalCopyright}"; - - klblFrameworkVersion.Text = $"Framework Version: {FileUtilityMethodsExtended.GetFrameworkVersion(assembly)}"; - - krtbMoreDetails.Text = fvi.FileDescription; - } - catch (Exception e) - { - ExceptionCapture.CaptureException(e); - } - } - - public KryptonAboutDialog(Image applicationIcon, Assembly assembly, bool showDescription, bool showFrameworkVersion, bool showSystemInformation, string applicationText, - string aboutText, string copyrightText, string frameworkVersionText, string showSystemInformationText, string versionText) - { - InitializeComponent(); - - try - { - Text = $"{aboutText}: {assembly.FullName}"; - - pbxApplicationIcon.Image = applicationIcon; - - FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location); - - klblApplicationName.Text = $"{applicationText}: {fvi.ProductName}"; - - klblApplicationVersion.Text = $"{versionText}: {fvi.FileVersion}"; - - klblCopyright.Text = $"{copyrightText}: {fvi.LegalCopyright}"; - - klblFrameworkVersion.Text = $"{frameworkVersionText}: {FileUtilityMethodsExtended.GetFrameworkVersion(assembly)}"; - - klblFrameworkVersion.Visible = showFrameworkVersion; - - krtbMoreDetails.Text = fvi.FileDescription; - - krtbMoreDetails.Visible = showDescription; - - ModifyLayout(showDescription); - - kbtnSystemInformation.Text = showSystemInformationText; - - kbtnSystemInformation.Visible = showSystemInformation; - } - catch (Exception e) - { - ExceptionCapture.CaptureException(e); - } - } - #endregion - - private void KryptonAboutDialog_Load(object sender, EventArgs e) - { - - } - - private void kbtnSystemInformation_Click(object sender, EventArgs e) - { - // TODO: Eventually, replace this with a custom solution - try - { - Process.Start("msinfo32.exe"); - } - catch (Exception exc) - { - ExceptionCapture.CaptureException(exc); - } - } - - private void ModifyLayout(bool showDescription) - { - if (showDescription) - { - Size = new(642, 428); - } - else - { - Size = new(642, 243); - } - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/About/KryptonAboutExtendedToolkitForm.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/About/KryptonAboutExtendedToolkitForm.Designer.cs new file mode 100644 index 000000000..5c95a095e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/About/KryptonAboutExtendedToolkitForm.Designer.cs @@ -0,0 +1,567 @@ +namespace Krypton.Toolkit.Suite.Extended.Dialogs +{ + partial class KryptonAboutExtendedToolkitForm + { + /// + /// 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.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.toolStripContainer1 = 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(); + ((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.toolStripContainer1.ContentPanel.SuspendLayout(); + this.toolStripContainer1.TopToolStripPanel.SuspendLayout(); + this.toolStripContainer1.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.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, 400); + this.kpnlButtons.Name = "kpnlButtons"; + this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; + this.kpnlButtons.Size = new System.Drawing.Size(800, 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.Size = new System.Drawing.Size(800, 49); + this.tableLayoutPanel1.TabIndex = 1; + // + // kbtnOk + // + this.kbtnOk.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.kbtnOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.kbtnOk.Location = new System.Drawing.Point(700, 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(498, 12); + this.kbtnSystemInformation.Margin = new System.Windows.Forms.Padding(10); + this.kbtnSystemInformation.Name = "kbtnSystemInformation"; + this.kbtnSystemInformation.Size = new System.Drawing.Size(182, 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(800, 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(800, 400); + this.kryptonPanel1.TabIndex = 1; + // + // khgMain + // + this.khgMain.GroupBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; + this.khgMain.HeaderVisibleSecondary = false; + this.khgMain.Location = new System.Drawing.Point(13, 13); + this.khgMain.Name = "khgMain"; + // + // khgMain.Panel + // + this.khgMain.Panel.Controls.Add(this.toolStripContainer1); + this.khgMain.Size = new System.Drawing.Size(775, 381); + this.khgMain.TabIndex = 0; + this.khgMain.ValuesPrimary.Image = null; + // + // toolStripContainer1 + // + // + // toolStripContainer1.ContentPanel + // + this.toolStripContainer1.ContentPanel.Controls.Add(this.kpnlToolkitGeneralInformation); + this.toolStripContainer1.ContentPanel.Controls.Add(this.kpnlDiscord); + this.toolStripContainer1.ContentPanel.Controls.Add(this.kpnlDeveloperInformation); + this.toolStripContainer1.ContentPanel.Controls.Add(this.kpnlVersions); + this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(773, 322); + this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.toolStripContainer1.Location = new System.Drawing.Point(0, 0); + this.toolStripContainer1.Name = "toolStripContainer1"; + this.toolStripContainer1.Size = new System.Drawing.Size(773, 347); + this.toolStripContainer1.TabIndex = 0; + this.toolStripContainer1.Text = "toolStripContainer1"; + // + // toolStripContainer1.TopToolStripPanel + // + this.toolStripContainer1.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(773, 322); + this.kpnlToolkitGeneralInformation.TabIndex = 4; + // + // 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(773, 322); + 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, 221); + 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(130, 135); + 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(689, 221); + this.klwlblGeneralInformation.Text = "Some of the components used in this application are part of the Krypton Extended " + + "Toolkit.\r\n\r\nLicense: MIT\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, 266); + this.klblCurrentTheme.Margin = new System.Windows.Forms.Padding(5); + this.klblCurrentTheme.Name = "klblCurrentTheme"; + this.klblCurrentTheme.Size = new System.Drawing.Size(689, 20); + this.klblCurrentTheme.TabIndex = 2; + this.klblCurrentTheme.Values.Text = "Current Theme:"; + // + // ktcmbCurrentTheme + // + this.ktcmbCurrentTheme.Dock = System.Windows.Forms.DockStyle.Fill; + this.ktcmbCurrentTheme.DropDownWidth = 689; + this.ktcmbCurrentTheme.IntegralHeight = false; + this.ktcmbCurrentTheme.Location = new System.Drawing.Point(79, 296); + this.ktcmbCurrentTheme.Margin = new System.Windows.Forms.Padding(5); + this.ktcmbCurrentTheme.Name = "ktcmbCurrentTheme"; + this.ktcmbCurrentTheme.Size = new System.Drawing.Size(689, 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, 236); + this.klblBuiltOn.Margin = new System.Windows.Forms.Padding(5); + this.klblBuiltOn.Name = "klblBuiltOn"; + this.klblBuiltOn.Size = new System.Drawing.Size(689, 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(773, 322); + this.kpnlDiscord.TabIndex = 3; + // + // 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(773, 322); + 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(773, 322); + this.kpnlDeveloperInformation.TabIndex = 2; + // + // 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(773, 322); + 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(763, 97); + 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, 112); + this.klwlblDocumentation.Margin = new System.Windows.Forms.Padding(5); + this.klwlblDocumentation.Name = "klwlblDocumentation"; + this.klwlblDocumentation.Size = new System.Drawing.Size(763, 97); + 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, 219); + this.klwlblDemos.Margin = new System.Windows.Forms.Padding(5); + this.klwlblDemos.Name = "klwlblDemos"; + this.klwlblDemos.Size = new System.Drawing.Size(763, 98); + 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(773, 322); + this.kpnlVersions.TabIndex = 1; + // + // 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(773, 322); + 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(3, 0); + this.tsToolkitInformation.Name = "tsToolkitInformation"; + this.tsToolkitInformation.Size = new System.Drawing.Size(434, 25); + this.tsToolkitInformation.TabIndex = 1; + // + // 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); + // + // KryptonAboutExtendedToolkitForm + // + this.AcceptButton = this.kbtnOk; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.kryptonPanel1); + 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 = "KryptonAboutExtendedToolkitForm"; + 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.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.toolStripContainer1.ContentPanel.ResumeLayout(false); + this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false); + this.toolStripContainer1.TopToolStripPanel.PerformLayout(); + this.toolStripContainer1.ResumeLayout(false); + this.toolStripContainer1.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.ResumeLayout(false); + + } + + #endregion + + private KryptonPanel kpnlButtons; + private KryptonBorderEdge kryptonBorderEdge1; + private KryptonPanel kryptonPanel1; + private KryptonHeaderGroup khgMain; + private ToolStripContainer toolStripContainer1; + 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 TableLayoutPanel tableLayoutPanel1; + private KryptonButton kbtnOk; + private KryptonButton kbtnSystemInformation; + private KryptonPanel kpnlVersions; + private KryptonDataGridView kdgvVersions; + private KryptonPanel kpnlDeveloperInformation; + private TableLayoutPanel tlpDeveloperInformation; + private KryptonLinkWrapLabel klwlblRepositories; + private KryptonLinkWrapLabel klwlblDocumentation; + private KryptonLinkWrapLabel klwlblDemos; + private KryptonPanel kpnlDiscord; + private KryptonLinkWrapLabel klwlblDiscord; + private KryptonPanel kpnlToolkitGeneralInformation; + private TableLayoutPanel tlpGeneralInformation; + private PictureBox pbxLogo; + private KryptonLinkWrapLabel klwlblGeneralInformation; + private KryptonLabel klblCurrentTheme; + private KryptonThemeComboBox ktcmbCurrentTheme; + private KryptonLabel klblBuiltOn; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/About/KryptonAboutExtendedToolkitForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/About/KryptonAboutExtendedToolkitForm.cs new file mode 100644 index 000000000..0f4205e09 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/About/KryptonAboutExtendedToolkitForm.cs @@ -0,0 +1,353 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Dialogs +{ + internal partial class KryptonAboutExtendedToolkitForm : KryptonForm + { + #region Instance Fields + + private readonly KryptonAboutExtendedToolkitData _aboutExtendedToolkitData; + + #endregion + + public KryptonAboutExtendedToolkitForm(KryptonAboutExtendedToolkitData aboutExtendedToolkitData) + { + _aboutExtendedToolkitData = aboutExtendedToolkitData; + + Startup(); + + InitializeComponent(); + } + + #region Implementation + + private void klwlblDemos_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) => GlobalToolkitUtilities.LaunchProcess(@"https://github.com/Krypton-Suite/Extended-Toolkit-Demos/releases"); + + private void klwlblDocumentation_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) => GlobalToolkitUtilities.LaunchProcess(@"https://github.com/Krypton-Suite/Help-Files/releases"); + + private void klwlblRepositories_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) => GlobalToolkitUtilities.LaunchProcess(@"https://github.com/orgs/Krypton-Suite/repositories"); + + private void klwlblDiscord_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) => GlobalToolkitUtilities.LaunchProcess(@"https://discord.gg/CRjF6fY"); + + private void klwlblGeneralInformation_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) => GlobalToolkitUtilities.LaunchProcess(@"https://github.com/Krypton-Suite/Extended-Toolkit"); + + 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 kbtnSystemInformation_Click(object sender, EventArgs e) => LaunchSystemInformation(); + + private void kbtnOk_Click(object sender, EventArgs e) => Hide(); + + private void Startup() + { + // Adjust UI elements + ShowDeveloperControls(_aboutExtendedToolkitData.ShowDeveloperInformationButton); + + ShowDiscordControls(_aboutExtendedToolkitData.ShowDiscordButton); + + ShowVersionControls(_aboutExtendedToolkitData.ShowVersionInformationButton); + + ShowThemeControls(_aboutExtendedToolkitData.ShowThemeOptions); + + ShowBuildDateLabel(_aboutExtendedToolkitData.ShowBuildDate); + + UpdateBuiltOnText(string.Empty); + + // ToDo: Figure out why this does not work + // UpdateBuiltOnText($@"{_aboutExtendedToolkitData.BuildOnText}: {KryptonAboutBoxUtilities.AssemblyBuildDate(Assembly.LoadFile($@"{Application.ExecutablePath}\Krypton.Toolkit.dll"), false)}"); + + UpdateCurrentThemeText($@"{_aboutExtendedToolkitData.CurrentThemeText}:"); + + ShowSystemInformationButton(_aboutExtendedToolkitData.ShowSystemInformationButton); + + SwitchIcon(_aboutExtendedToolkitData.ToolkitType); + + ConcatanateGeneralInformationText(_aboutExtendedToolkitData.GeneralInformationWelcomeText, _aboutExtendedToolkitData.GeneralInformationLicenseText, _aboutExtendedToolkitData.GeneralInformationLearnMoreText); + + UpdateDiscordText(_aboutExtendedToolkitData.DiscordText); + + UpdateRepositoriesText(_aboutExtendedToolkitData.RepositoryInformationText); + + UpdateDemosText(_aboutExtendedToolkitData.DownloadDemosText); + + UpdateDocumentationText(_aboutExtendedToolkitData.DownloadDocumentationText); + + UpdateColumnHeadings(_aboutExtendedToolkitData.FileNameColumnHeaderText, _aboutExtendedToolkitData.VersionColumnHeaderText); + + UpdateToolBarText(_aboutExtendedToolkitData.ToolBarGeneralInformationText, _aboutExtendedToolkitData.ToolBarDiscordText, _aboutExtendedToolkitData.ToolBarDeveloperInformationText, _aboutExtendedToolkitData.ToolBarVersionInformationText); + + UpdateGeneralInformationLinkArea(_aboutExtendedToolkitData.LearnMoreLinkArea); + + UpdateDocumentationLinkArea(_aboutExtendedToolkitData.DocumentationLinkArea); + + UpdateDiscordLinkArea(_aboutExtendedToolkitData.DiscordLinkArea); + + UpdateDemosLinkArea(_aboutExtendedToolkitData.DownloadDemosLinkArea); + + UpdateRepositoriesLinkArea(_aboutExtendedToolkitData.RepositoryInformationLinkArea); + + GetReferenceAssemblyInformation(); + + klblCurrentTheme.Text = $@"{KryptonManager.Strings.CustomStrings.CurrentTheme}:"; + } + + private void UpdateCurrentThemeText(string value) => klblCurrentTheme.Text = value; + + private void LaunchSystemInformation() => GlobalToolkitUtilities.LaunchProcess(@"MSInfo32.exe"); + + private void UpdateToolBarText(string toolBarGeneralInformationText, string toolBarDiscordText, string toolBarDeveloperInformationText, string toolBarVersionInformationText) + { + tsbtnToolkitGeneralInformation.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: + khgMain.ValuesPrimary.Image = Resources.Canary; + + pbxLogo.Image = Resources.Krypton_Canary; + break; + case ToolkitType.Nightly: + khgMain.ValuesPrimary.Image = Resources.Nightly; + + pbxLogo.Image = Resources.Krypton_Nightly; + break; + case ToolkitType.Stable: + khgMain.ValuesPrimary.Image = Resources.Stable; + + pbxLogo.Image = Resources.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}: MIT\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; + + #endregion + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/About/KryptonAboutExtendedToolkitForm.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/About/KryptonAboutExtendedToolkitForm.resx new file mode 100644 index 000000000..dc46c23b1 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/About/KryptonAboutExtendedToolkitForm.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 Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Authentication/KryptonAuthenticationForm.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Authentication/KryptonAuthenticationForm.Designer.cs index f7cda83d5..b8adc0b30 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Authentication/KryptonAuthenticationForm.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Authentication/KryptonAuthenticationForm.Designer.cs @@ -162,7 +162,6 @@ private void InitializeComponent() // // kryptonButton1 // - this.kryptonButton1.CornerRoundingRadius = -1F; this.kryptonButton1.Location = new System.Drawing.Point(394, 13); this.kryptonButton1.Name = "kryptonButton1"; this.kryptonButton1.Size = new System.Drawing.Size(90, 25); @@ -171,7 +170,6 @@ private void InitializeComponent() // // kryptonButton2 // - this.kryptonButton2.CornerRoundingRadius = -1F; this.kryptonButton2.Location = new System.Drawing.Point(298, 13); this.kryptonButton2.Name = "kryptonButton2"; this.kryptonButton2.Size = new System.Drawing.Size(90, 25); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Exception/KryptonExceptionCaptureDialog.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Exception/KryptonExceptionCaptureDialog.cs index 7ac8eea75..00669b44c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Exception/KryptonExceptionCaptureDialog.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Exception/KryptonExceptionCaptureDialog.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -50,9 +50,9 @@ private void InitializeComponent() this.kryptonPanel2 = new(); this.kchkDarkMode = new(); this.ktxtException = new(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); this.SuspendLayout(); // @@ -71,7 +71,7 @@ private void InitializeComponent() // // kbtnCancel // - this.kbtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.kbtnCancel.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kbtnCancel.Location = new(447, 13); this.kbtnCancel.Name = "kbtnCancel"; @@ -82,7 +82,7 @@ private void InitializeComponent() // // kbtnExportException // - this.kbtnExportException.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.kbtnExportException.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); this.kbtnExportException.Location = new(13, 13); this.kbtnExportException.Name = "kbtnExportException"; this.kbtnExportException.Size = new(119, 25); @@ -119,9 +119,9 @@ private void InitializeComponent() // // ktxtException // - this.ktxtException.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.ktxtException.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom + | System.Windows.Forms.AnchorStyles.Left + | System.Windows.Forms.AnchorStyles.Right); this.ktxtException.Location = new(12, 12); this.ktxtException.Multiline = true; this.ktxtException.Name = "ktxtException"; @@ -141,10 +141,10 @@ private void InitializeComponent() this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); this.kryptonPanel2.PerformLayout(); this.ResumeLayout(false); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/NuGet/KryptonNuGetBrowser.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/NuGet/KryptonNuGetBrowser.Designer.cs index ae558df94..b2a7b999d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/NuGet/KryptonNuGetBrowser.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/NuGet/KryptonNuGetBrowser.Designer.cs @@ -65,7 +65,6 @@ private void InitializeComponent() // // kbtnCancel // - this.kbtnCancel.CornerRoundingRadius = -1F; this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kbtnCancel.Location = new System.Drawing.Point(698, 13); this.kbtnCancel.Name = "kbtnCancel"; @@ -98,7 +97,6 @@ private void InitializeComponent() // // kryptonButton1 // - this.kryptonButton1.CornerRoundingRadius = -1F; this.kryptonButton1.Location = new System.Drawing.Point(710, 13); this.kryptonButton1.Name = "kryptonButton1"; this.kryptonButton1.Size = new System.Drawing.Size(78, 25); @@ -108,14 +106,9 @@ private void InitializeComponent() // klvPackages // this.klvPackages.HideSelection = false; - this.klvPackages.ItemStyle = Krypton.Toolkit.ButtonStyle.ListItem; this.klvPackages.Location = new System.Drawing.Point(13, 42); this.klvPackages.Name = "klvPackages"; - this.klvPackages.OwnerDraw = true; this.klvPackages.Size = new System.Drawing.Size(775, 571); - this.klvPackages.StateCommon.Item.Content.ShortText.MultiLine = Krypton.Toolkit.InheritBool.True; - this.klvPackages.StateCommon.Item.Content.ShortText.MultiLineH = Krypton.Toolkit.PaletteRelativeAlign.Center; - this.klvPackages.StateCommon.Item.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.klvPackages.TabIndex = 4; // // kryptonTextBox2 diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/NuGet/KryptonNuGetBrowser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/NuGet/KryptonNuGetBrowser.cs index 816ae1090..647709c4c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/NuGet/KryptonNuGetBrowser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/NuGet/KryptonNuGetBrowser.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Properties/KryptonPropertiesForm.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Properties/KryptonPropertiesForm.Designer.cs index 4300aa5d5..980115917 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Properties/KryptonPropertiesForm.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Properties/KryptonPropertiesForm.Designer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -84,7 +84,6 @@ private void InitializeComponent() // // kryptonButton1 // - this.kryptonButton1.CornerRoundingRadius = -1F; this.kryptonButton1.Location = new System.Drawing.Point(245, 13); this.kryptonButton1.Name = "kryptonButton1"; this.kryptonButton1.Size = new System.Drawing.Size(90, 25); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Properties/KryptonPropertiesForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Properties/KryptonPropertiesForm.cs index 12db76074..fb1fc1353 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Properties/KryptonPropertiesForm.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Properties/KryptonPropertiesForm.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Run/KryptonRunDialog.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Run/KryptonRunDialog.Designer.cs index 91455f289..2dbb315fc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Run/KryptonRunDialog.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Run/KryptonRunDialog.Designer.cs @@ -77,7 +77,6 @@ private void InitializeComponent() // this.ksbRun.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.ksbRun.AutoSize = true; - this.ksbRun.CornerRoundingRadius = -1F; this.ksbRun.DialogResult = System.Windows.Forms.DialogResult.OK; this.ksbRun.Enabled = false; this.ksbRun.KryptonContextMenu = this.kcmRunOptions; @@ -120,7 +119,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(292, 13); this.kbtnCancel.Name = "kbtnCancel"; @@ -131,7 +129,6 @@ private void InitializeComponent() // kbtnSettings // this.kbtnSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.kbtnSettings.CornerRoundingRadius = -1F; this.kbtnSettings.Location = new System.Drawing.Point(12, 13); this.kbtnSettings.Name = "kbtnSettings"; this.kbtnSettings.Size = new System.Drawing.Size(90, 25); @@ -168,7 +165,6 @@ private void InitializeComponent() this.kcmbFilePath.ButtonSpecs.AddRange(new Krypton.Toolkit.ButtonSpecAny[] { this.bsBrowse, this.bsReset}); - this.kcmbFilePath.CornerRoundingRadius = -1F; this.kcmbFilePath.DropDownWidth = 258; this.kcmbFilePath.IntegralHeight = false; this.kcmbFilePath.Location = new System.Drawing.Point(68, 79); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Run/KryptonRunDialog.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Run/KryptonRunDialog.cs index 356ba5d27..3a0fc1a10 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Run/KryptonRunDialog.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Run/KryptonRunDialog.cs @@ -127,11 +127,12 @@ private string Browse(bool isFolderPicker = false) try { - CommonOpenFileDialog cofd = new(); - - cofd.IsFolderPicker = isFolderPicker; + CommonOpenFileDialog cofd = new CommonOpenFileDialog() + { + IsFolderPicker = isFolderPicker, - cofd.Title = @"Browse for a resource:"; + Title = @"Browse for a resource:" + }; if (cofd.ShowDialog() == CommonFileDialogResult.Ok) { @@ -140,7 +141,7 @@ private string Browse(bool isFolderPicker = false) } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); return result; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Run/KryptonRunDialogOptions.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Run/KryptonRunDialogOptions.Designer.cs index ab7e7dc0f..4b138f11b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Run/KryptonRunDialogOptions.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Run/KryptonRunDialogOptions.Designer.cs @@ -55,7 +55,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(350, 13); this.kbtnCancel.Name = "kbtnCancel"; @@ -75,7 +74,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(254, 13); this.kbtnOk.Name = "kbtnOk"; @@ -86,7 +84,6 @@ private void InitializeComponent() // kbtnReset // this.kbtnReset.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnReset.CornerRoundingRadius = -1F; this.kbtnReset.Location = new System.Drawing.Point(12, 13); this.kbtnReset.Name = "kbtnReset"; this.kbtnReset.Size = new System.Drawing.Size(90, 25); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Splash/KryptonSplashDialog.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Splash/KryptonSplashDialog.cs index 97ed0aa01..773d416fd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Splash/KryptonSplashDialog.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Splash/KryptonSplashDialog.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -43,9 +43,9 @@ private void InitializeComponent() this.klblClose = new(); this.pbAppIcon = new(); this.kwlApplicationName = new(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbAppIcon)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.pbAppIcon).BeginInit(); this.SuspendLayout(); // // pbLoading @@ -72,7 +72,7 @@ private void InitializeComponent() this.klblClose.Location = new(769, 12); this.klblClose.Name = "klblClose"; this.klblClose.Size = new(20, 19); - this.klblClose.StateCommon.ShortText.Font = new("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblClose.StateCommon.ShortText.Font = new("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblClose.TabIndex = 6; this.klblClose.Values.Text = "X"; this.klblClose.Click += new(this.klblClose_Click); @@ -92,12 +92,12 @@ private void InitializeComponent() // this.kwlApplicationName.AutoSize = false; this.kwlApplicationName.Dock = System.Windows.Forms.DockStyle.Bottom; - this.kwlApplicationName.Font = new("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlApplicationName.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kwlApplicationName.Font = new("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); + this.kwlApplicationName.ForeColor = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kwlApplicationName.Location = new(0, 302); this.kwlApplicationName.Name = "kwlApplicationName"; this.kwlApplicationName.Size = new(797, 115); - this.kwlApplicationName.StateCommon.Font = new("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kwlApplicationName.StateCommon.Font = new("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kwlApplicationName.Text = "<##APPLICATION-NAME##>"; this.kwlApplicationName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // @@ -112,10 +112,10 @@ private void InitializeComponent() this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbAppIcon)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.pbAppIcon).EndInit(); this.ResumeLayout(false); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Text to Speech/KryptonTextToSpeechDialog.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Text to Speech/KryptonTextToSpeechDialog.cs index b1c023de8..4a876f466 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Text to Speech/KryptonTextToSpeechDialog.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/Text to Speech/KryptonTextToSpeechDialog.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,6 +25,9 @@ */ #endregion +// Only used here +using SpeechSynthesizer = System.Speech.Synthesis.SpeechSynthesizer; + namespace Krypton.Toolkit.Suite.Extended.Dialogs { public class KryptonTextToSpeechDialog : CommonExtendedKryptonForm @@ -67,23 +70,23 @@ private void InitializeComponent() this.kryptonLabel1 = new(); this.kryptonGroupBox1 = new(); this.kcmbInstalledVoices = new(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kgbInput)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kgbInput.Panel)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kgbInput).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kgbInput.Panel).BeginInit(); this.kgbInput.Panel.SuspendLayout(); this.kgbInput.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kgbAdjustments)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kgbAdjustments.Panel)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kgbAdjustments).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kgbAdjustments.Panel).BeginInit(); this.kgbAdjustments.Panel.SuspendLayout(); this.kgbAdjustments.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1.Panel).BeginInit(); this.kryptonGroupBox1.Panel.SuspendLayout(); this.kryptonGroupBox1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbInstalledVoices)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbInstalledVoices).BeginInit(); this.SuspendLayout(); // // kryptonPanel1 @@ -110,7 +113,7 @@ private void InitializeComponent() // // kbtnSpeak // - this.kbtnSpeak.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.kbtnSpeak.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnSpeak.Enabled = false; this.kbtnSpeak.Location = new(260, 13); this.kbtnSpeak.Name = "kbtnSpeak"; @@ -121,7 +124,7 @@ private void InitializeComponent() // // kbtnCancel // - this.kbtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.kbtnCancel.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kbtnCancel.Location = new(356, 13); this.kbtnCancel.Name = "kbtnCancel"; @@ -195,7 +198,7 @@ private void InitializeComponent() // this.kwlVolume.AutoSize = false; this.kwlVolume.Font = new("Segoe UI", 9F); - this.kwlVolume.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kwlVolume.ForeColor = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kwlVolume.Location = new(12, 184); this.kwlVolume.Name = "kwlVolume"; this.kwlVolume.Size = new(405, 23); @@ -226,7 +229,7 @@ private void InitializeComponent() // this.kwlRate.AutoSize = false; this.kwlRate.Font = new("Segoe UI", 9F); - this.kwlRate.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kwlRate.ForeColor = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kwlRate.Location = new(12, 86); this.kwlRate.Name = "kwlRate"; this.kwlRate.Size = new(405, 23); @@ -255,8 +258,8 @@ private void InitializeComponent() // // kryptonGroupBox1 // - this.kryptonGroupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.kryptonGroupBox1.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left + | System.Windows.Forms.AnchorStyles.Right); this.kryptonGroupBox1.Location = new(13, 13); this.kryptonGroupBox1.Name = "kryptonGroupBox1"; // @@ -294,25 +297,25 @@ private void InitializeComponent() this.ShowInTaskbar = false; this.Text = "Text to Speech"; this.Load += new(this.KryptonTextToSpeechDialog_Load); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kgbInput.Panel)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kgbInput.Panel).EndInit(); this.kgbInput.Panel.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kgbInput)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kgbInput).EndInit(); this.kgbInput.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kgbAdjustments.Panel)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kgbAdjustments.Panel).EndInit(); this.kgbAdjustments.Panel.ResumeLayout(false); this.kgbAdjustments.Panel.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kgbAdjustments)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kgbAdjustments).EndInit(); this.kgbAdjustments.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1.Panel).EndInit(); this.kryptonGroupBox1.Panel.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1).EndInit(); this.kryptonGroupBox1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kcmbInstalledVoices)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbInstalledVoices).EndInit(); this.ResumeLayout(false); } @@ -340,7 +343,7 @@ public KryptonTextToSpeechDialog() #region Methods private void PropagateInstalledVoicesList() { - using (SpeechSynthesizer synth = new()) + using (SpeechSynthesizer synth = new SpeechSynthesizer()) { foreach (var voice in synth.GetInstalledVoices()) { @@ -353,10 +356,7 @@ private void PropagateInstalledVoicesList() private void Speak(string textToSpeak, string voice, int rate, int volume) { -#if NETCOREAPP3_0_OR_GREATER - SpeakNETCore(textToSpeak); -#else - using (SpeechSynthesizer synth = new() { Volume = volume, Rate = rate }) + using (SpeechSynthesizer synth = new SpeechSynthesizer() { Volume = volume, Rate = rate }) { synth.SelectVoice(voice); @@ -366,53 +366,6 @@ private void Speak(string textToSpeak, string voice, int rate, int volume) kgbAdjustments.Enabled = true; } -#endif - } - - /// - /// https://www.c-sharpcorner.com/blogs/using-systemspeech-with-net-core-30 - /// - /// - /// - private static void SpeakNETCore(string textToSpeech, bool wait = false) - { - // Command to execute PS - Execute($@"Add-Type -AssemblyName System.speech; - $speak = New-Object System.Speech.Synthesis.SpeechSynthesizer; - $speak.Speak(""{textToSpeech}"");"); // Embedd text - - void Execute(string command) - { - // create a temp file with .ps1 extension - var cFile = $"{Path.GetTempPath()}{Guid.NewGuid()}.ps1"; - - //Write the .ps1 - using var tw = new StreamWriter(cFile, false, Encoding.UTF8); - tw.Write(command); - - // Setup the PS - var start = - new ProcessStartInfo() - { - FileName = "C:\\windows\\system32\\windowspowershell\\v1.0\\powershell.exe", // CHUPA MICROSOFT 02-10-2019 23:45 - LoadUserProfile = false, - UseShellExecute = false, - CreateNoWindow = true, - Arguments = $"-executionpolicy bypass -File {cFile}", - WindowStyle = ProcessWindowStyle.Hidden - }; - - //Init the Process - var p = Process.Start(start); - // The wait may not work! :( - if (wait) - { - if (p != null) - { - p.WaitForExit(); - } - } - } } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dock.Extender/Controls Toolkit/KryptonFloatableForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dock.Extender/Controls Toolkit/KryptonFloatableForm.cs index 303685074..8ccbc7ed3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dock.Extender/Controls Toolkit/KryptonFloatableForm.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dock.Extender/Controls Toolkit/KryptonFloatableForm.cs @@ -105,7 +105,7 @@ protected override void OnMove(EventArgs e) Point pt = Cursor.Position; Point pc = PointToClient(pt); - if (pc.Y < -21 || pc.Y > 0) + if (pc.Y is < -21 or > 0) { return; } @@ -193,7 +193,7 @@ private Rectangle GetDockingArea(Control? c) int borderwidth = (r.Width - rc.Width) / 2; r.X += borderwidth; - r.Y += (r.Height - rc.Height) - borderwidth; + r.Y += r.Height - rc.Height - borderwidth; if (!_dockOnInside) { @@ -254,8 +254,8 @@ private void SetOverlay(Control? c, Point pc) Rectangle rc = r; //determine relative coordinates - float rx = (pc.X - r.Left) / (float)(r.Width); - float ry = (pc.Y - r.Top) / (float)(r.Height); + float rx = (pc.X - r.Left) / (float)r.Width; + float ry = (pc.Y - r.Top) / (float)r.Height; //Console.WriteLine("Moving over " + c.Name + " " + rx.ToString() + "," + ry.ToString()); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dock.Extender/Krypton.Toolkit.Suite.Extended.Dock.Extender 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dock.Extender/Krypton.Toolkit.Suite.Extended.Dock.Extender 2022.csproj index 9992a61d0..254a08242 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dock.Extender/Krypton.Toolkit.Suite.Extended.Dock.Extender 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dock.Extender/Krypton.Toolkit.Suite.Extended.Dock.Extender 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements additional docking operations. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements additional docking operations. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,74 +69,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dock.Extender/Krypton.Toolkit.Suite.Extended.Dock.Extender.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dock.Extender/Krypton.Toolkit.Suite.Extended.Dock.Extender.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dock.Extender/Krypton.Toolkit.Suite.Extended.Dock.Extender.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dock.Extender/Krypton.Toolkit.Suite.Extended.Dock.Extender.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourCollection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourCollection.cs index 3ed67a2c2..cc7326423 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourCollection.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourCollection.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourComparer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourComparer.cs index 7e23ef22d..f9c202439 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourComparer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourComparer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourExtensions.cs index d85d8d8cb..2516a84d2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourExtensions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourExtensions.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -246,7 +246,7 @@ private static double Min(double r, double g, double b) /// public static Color FromAHSB(int alpha, float hue, float saturation, float brightness) { - if (0 > alpha || 255 < alpha) + if (alpha is < 0 or > 255) { throw new ArgumentOutOfRangeException( "alpha", @@ -254,7 +254,7 @@ public static Color FromAHSB(int alpha, float hue, float saturation, float brigh "Value must be within a range of 0 - 255."); } - if (0f > hue || 360f < hue) + if (hue is < 0f or > 360f) { throw new ArgumentOutOfRangeException( "hue", @@ -262,7 +262,7 @@ public static Color FromAHSB(int alpha, float hue, float saturation, float brigh "Value must be within a range of 0 - 360."); } - if (0f > saturation || 1f < saturation) + if (saturation is < 0f or > 1f) { throw new ArgumentOutOfRangeException( "saturation", @@ -270,7 +270,7 @@ public static Color FromAHSB(int alpha, float hue, float saturation, float brigh "Value must be within a range of 0 - 1."); } - if (0f > brightness || 1f < brightness) + if (brightness is < 0f or > 1f) { throw new ArgumentOutOfRangeException( "brightness", @@ -292,13 +292,13 @@ public static Color FromAHSB(int alpha, float hue, float saturation, float brigh if (0.5 < brightness) { - fMax = brightness - (brightness * saturation) + saturation; - fMin = brightness + (brightness * saturation) - saturation; + fMax = brightness - brightness * saturation + saturation; + fMin = brightness + brightness * saturation - saturation; } else { - fMax = brightness + (brightness * saturation); - fMin = brightness - (brightness * saturation); + fMax = brightness + brightness * saturation; + fMin = brightness - brightness * saturation; } iSextant = (int)Math.Floor(hue / 60f); @@ -308,14 +308,14 @@ public static Color FromAHSB(int alpha, float hue, float saturation, float brigh } hue /= 60f; - hue -= 2f * (float)Math.Floor(((iSextant + 1f) % 6f) / 2f); + hue -= 2f * (float)Math.Floor((iSextant + 1f) % 6f / 2f); if (0 == iSextant % 2) { - fMid = (hue * (fMax - fMin)) + fMin; + fMid = hue * (fMax - fMin) + fMin; } else { - fMid = fMin - (hue * (fMax - fMin)); + fMid = fMin - hue * (fMax - fMin); } iMax = Convert.ToInt32(fMax * 255); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourHitTestInfo.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourHitTestInfo.cs index 376407451..a1eb42fdd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourHitTestInfo.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourHitTestInfo.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourPalettes.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourPalettes.cs index d56d491d3..34f7558f9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourPalettes.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ColourPalettes.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/DrawingNativeMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/DrawingNativeMethods.cs index 2bb87a722..42a2e8ef9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/DrawingNativeMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/DrawingNativeMethods.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/Helpers.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/Helpers.cs index 2e18b6aaf..6596e95b0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/Helpers.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/Helpers.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ImageComboItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ImageComboItem.cs index d039d27c7..49a972638 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ImageComboItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/ImageComboItem.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/PaletteSerializer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/PaletteSerializer.cs index 89d23ff74..e8dc5831f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/PaletteSerializer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Common/PaletteSerializer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Custom Events/CustomEventHandlers.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Custom Events/CustomEventHandlers.cs index 5ad81133a..8633bf0ea 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Custom Events/CustomEventHandlers.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Custom Events/CustomEventHandlers.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Image Box/ImageBoxExtendedMouseWheelMessageFilter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Image Box/ImageBoxExtendedMouseWheelMessageFilter.cs index da883cbd8..5a183508b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Image Box/ImageBoxExtendedMouseWheelMessageFilter.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Image Box/ImageBoxExtendedMouseWheelMessageFilter.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Image Box/ImageBoxExtendedNativeMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Image Box/ImageBoxExtendedNativeMethods.cs index 93417a19c..f987e8547 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Image Box/ImageBoxExtendedNativeMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Image Box/ImageBoxExtendedNativeMethods.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -53,7 +53,7 @@ public enum SIF #region Constants - public const int GWL_STYLE = (-16); + public const int GWL_STYLE = -16; public const int SB_BOTH = 3; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Image Box/ZoomLevelCollection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Image Box/ZoomLevelCollection.cs index eb54c5e75..067351b7a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Image Box/ZoomLevelCollection.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Classes/Image Box/ZoomLevelCollection.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourEditorManagerControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourEditorManagerControl.cs index 539c05ee0..472586db9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourEditorManagerControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourEditorManagerControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourGridControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourGridControl.cs index 212d8552f..8c0db78fa 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourGridControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourGridControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -1153,7 +1153,7 @@ protected override bool IsInputKey(Keys keyData) { bool result; - if (keyData == Keys.Left || keyData == Keys.Up || keyData == Keys.Down || keyData == Keys.Right || keyData == Keys.Enter || keyData == Keys.Home || keyData == Keys.End) + if (keyData is Keys.Left or Keys.Up or Keys.Down or Keys.Right or Keys.Enter or Keys.Home or Keys.End) { result = true; } @@ -1307,7 +1307,7 @@ private void SetScaledCellSize() _scaledCellSize = _cellSize; } - Debug.WriteLine(_scaledCellSize); + DebugUtilities.WriteLine(_scaledCellSize); } /// @@ -1615,7 +1615,7 @@ protected override void OnPaint(PaintEventArgs e) colorCount = this.Colours.Count; - Debug.Print(e.ClipRectangle.Size == this.ClientSize ? "Performing full paint!" : "Performing partial paint!"); + System.Diagnostics.Debug.Print(e.ClipRectangle.Size == this.ClientSize ? "Performing full paint!" : "Performing partial paint!"); this.OnPaintBackground(e); // HACK: Easiest way of supporting things like BackgroundImage, BackgroundImageLayout etc as the PaintBackground event is no longer being called @@ -1932,7 +1932,7 @@ protected virtual void RefreshColours() { if (this.AllowPainting) { - Debug.Print("Calculating Colours..."); + System.Diagnostics.Debug.Print("Calculating Colours..."); this.CalculateGridSize(); if (this.AutoFit) @@ -2017,7 +2017,7 @@ private void ColoursCollectionItemReplacedHandler(object sender, ColourCollectio if (index >= 0 && index < collection.Count && collection[index] != this.Colour) { - Debug.Print("Replacing index {0} with {1}", index, collection[index]); + System.Diagnostics.Debug.Print("Replacing index {0} with {1}", index, collection[index]); _previousColourIndex = index; _colourIndex = -1; @@ -2068,10 +2068,8 @@ private void RemoveEventHandlers(ColourCollection value) private void SetToolTip() { - if (this.ShowToolTips) + if (this.ShowToolTips is true and true) { - if (this.ShowToolTips) - { #if USENAMEHACK string name; @@ -2091,9 +2089,8 @@ private void SetToolTip() _toolTip.SetToolTip(this, name); #else - _toolTip.SetToolTip(this, this.HotIndex != InvalidIndex ? this.GetColour(this.HotIndex).Name : null); + _toolTip.SetToolTip(this, this.HotIndex != InvalidIndex ? this.GetColour(this.HotIndex).Name : null); #endif - } } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourHexadecimalComboBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourHexadecimalComboBox.cs index fb60abfb7..db658a2f0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourHexadecimalComboBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourHexadecimalComboBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourHexadecimalTextBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourHexadecimalTextBox.cs index 0b97b735f..4acf95da4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourHexadecimalTextBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourHexadecimalTextBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourSliderControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourSliderControl.cs index ad7585c31..5fd97dba9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourSliderControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourSliderControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourWheelControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourWheelControl.cs index 81ac9f6f2..c4eebe365 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourWheelControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ColourWheelControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -153,7 +153,7 @@ public virtual int ColourStep get => _colourStep; set { - if (value < 1 || value > 359) + if (value is < 1 or > 359) { throw new ArgumentOutOfRangeException(nameof(value), value, "Value must be between 1 and 359"); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/HueColourSliderControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/HueColourSliderControl.cs index 635a3945e..41f632ab6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/HueColourSliderControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/HueColourSliderControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ImageBoxExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ImageBoxExtended.cs index 20251b733..333b56d2f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ImageBoxExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ImageBoxExtended.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/KryptonColourButtonExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/KryptonColourButtonExtended.cs index 112f22fdb..e605b309b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/KryptonColourButtonExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/KryptonColourButtonExtended.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -49,6 +49,7 @@ public partial class KryptonColourButtonExtended : VisualSimpleBase, IButtonCont private bool _wasEnabled; private bool _isDefault; private bool _useMnemonic; + private KryptonCustomPaletteBase _palette; //private ViewDrawButtonExtended vdbe = new ViewDrawButtonExtended(null, null, null, null, null, null, VisualOrientation.Top, true); @@ -266,6 +267,13 @@ public override KryptonContextMenu KryptonContextMenu set { } } + public KryptonCustomPaletteBase Palette + { + get => _palette; + + set => _palette = value; + } + /// /// Gets and sets the maximum number of recent colors to store and display. /// @@ -537,7 +545,7 @@ public ButtonStyle ButtonStyle private bool ShouldSerializeButtonStyle() { - return (ButtonStyle != ButtonStyle.Standalone); + return ButtonStyle != ButtonStyle.Standalone; } private void ResetButtonStyle() @@ -724,7 +732,7 @@ public virtual KryptonCommand KryptonCommand /// true if the control should behave as a default color button; otherwise false. public void NotifyDefault(bool value) { - if (!ViewDrawButtonExtended.IsFixed && (_isDefault != value)) + if (!ViewDrawButtonExtended.IsFixed && _isDefault != value) { // Remember new default status _isDefault = value; @@ -830,7 +838,7 @@ public virtual void SetFixedState(PaletteState state) /// /// The state for which the image is needed. /// Image value. - public Image GetImage(PaletteState state) => Values.GetImage(state); + public Image? GetImage(PaletteState state) => Values.GetImage(state); /// /// Gets the image color that should be transparent. @@ -1079,7 +1087,7 @@ private bool ShowDropDown() } else { - _kryptonContextMenu.Palette = Palette; + _kryptonContextMenu.LocalCustomPalette = Palette; } } @@ -1228,13 +1236,13 @@ private void UpdateRecentColours(Color color) foreach (KryptonContextMenuItemBase item in _kryptonContextMenu.Items) { // Only interested in the non-recent colors color columns - if ((item != _coloursRecent) && (item is KryptonContextMenuColorColumns colors)) + if (item != _coloursRecent && item is KryptonContextMenuColorColumns colors) { // Cast to correct type // We do not change the theme or standard entries if they are not to be used - if (((item == _coloursTheme) && !VisibleThemes) || - ((item == _coloursStandard) && !VisibleStandard)) + if ((item == _coloursTheme && !VisibleThemes) || + (item == _coloursStandard && !VisibleStandard)) { continue; } @@ -1248,7 +1256,7 @@ private void UpdateRecentColours(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(Color.Empty)) { bool found = false; foreach (Color recentColor in _recentColours) @@ -1281,7 +1289,7 @@ private void UpdateContextMenu() // Update visible state based of properties _separatorTheme.Visible = _headingTheme.Visible = _coloursTheme.Visible = VisibleThemes; _separatorStandard.Visible = _headingStandard.Visible = _coloursStandard.Visible = VisibleStandard; - _separatorRecent.Visible = _headingRecent.Visible = _coloursRecent.Visible = (VisibleRecent && (_recentColours.Count > 0)); + _separatorRecent.Visible = _headingRecent.Visible = _coloursRecent.Visible = VisibleRecent && _recentColours.Count > 0; _itemsNoColour.Visible = VisibleNoColour; _itemsMoreColours.Visible = VisibleMoreColours; @@ -1336,8 +1344,7 @@ private void DecideOnVisible(KryptonContextMenuItemBase visible, KryptonContextM } // We do not consider existing separators - if (!((item is KryptonContextMenuSeparator) || - (item is KryptonContextMenuHeading))) + if (!(item is KryptonContextMenuSeparator or KryptonContextMenuHeading)) { // If the previous item is visible, then make the parameter visible if (item.Visible) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/KryptonImageComboBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/KryptonImageComboBox.cs index b19c4abbc..ddb99cf0f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/KryptonImageComboBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/KryptonImageComboBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -70,7 +70,7 @@ protected override void OnDrawItem(DrawItemEventArgs e) ImageComboItem item = (ImageComboItem)this.Items[e.Index]; // get forecolor & font - Color foreColour = (item.ForeColour != Color.FromKnownColor(KnownColor.Transparent)) ? item.ForeColour : e.ForeColor; + Color foreColour = item.ForeColour != Color.FromKnownColor(KnownColor.Transparent) ? item.ForeColour : e.ForeColor; Font font = item.Mark ? new Font(e.Font, FontStyle.Bold) : e.Font; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/LightnessColourSliderControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/LightnessColourSliderControl.cs index 26e2971fe..a04ee6fc6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/LightnessColourSliderControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/LightnessColourSliderControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/RGBAColourSliderControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/RGBAColourSliderControl.cs index ae1c16da2..e31567a74 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/RGBAColourSliderControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/RGBAColourSliderControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/SaturationColourSliderControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/SaturationColourSliderControl.cs index 01e95a577..5265d3eb6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/SaturationColourSliderControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/SaturationColourSliderControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ScreenColourPickerControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ScreenColourPickerControl.cs index f3898460b..89d42e721 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ScreenColourPickerControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ScreenColourPickerControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ScrollControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ScrollControl.cs index 31f6912e0..0035c6c46 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ScrollControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ScrollControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -207,7 +207,7 @@ protected override void OnMouseWheel(MouseEventArgs e) delta = SystemInformation.MouseWheelScrollLines * this.VerticalScroll.SmallChange; } - y += (e.Delta > 0) ? -delta : delta; + y += e.Delta > 0 ? -delta : delta; } else if (this.HorizontalScroll.Visible && this.HorizontalScroll.Enabled) { @@ -220,7 +220,7 @@ protected override void OnMouseWheel(MouseEventArgs e) delta = SystemInformation.MouseWheelScrollLines * this.HorizontalScroll.SmallChange; } - x += (e.Delta > 0) ? -delta : delta; + x += e.Delta > 0 ? -delta : delta; } this.ScrollTo(x, y); @@ -589,7 +589,7 @@ protected ScrollEventType GetEventType(IntPtr wParam) case DrawingNativeMethods.SB_TOP: return ScrollEventType.First; default: - throw new ArgumentException(string.Format("{0} isn't a valid scroll event type.", wParam), "wparam"); + throw new ArgumentException($"{wParam} isn't a valid scroll event type.", "wparam"); } } @@ -703,9 +703,9 @@ protected virtual void ScrollTo(ScrollOrientation scrollbar, int value) oldInfo = this.GetScrollInfo(scrollbar); - if (value > ((oldInfo.nMax - oldInfo.nMin) + 1) - oldInfo.nPage) + if (value > oldInfo.nMax - oldInfo.nMin + 1 - oldInfo.nPage) { - value = ((oldInfo.nMax - oldInfo.nMin) + 1) - oldInfo.nPage; + value = oldInfo.nMax - oldInfo.nMin + 1 - oldInfo.nPage; } if (value < oldInfo.nMin) { @@ -890,13 +890,13 @@ protected virtual void WmScroll(ref Message msg) scrollInfo.nPos = scrollInfo.nMax; break; default: - Debug.Assert(false, string.Format("Unknown scroll event type {0}", eventType)); + System.Diagnostics.Debug.Assert(false, $"Unknown scroll event type {eventType}"); break; } - if (scrollInfo.nPos > ((scrollInfo.nMax - scrollInfo.nMin) + 1) - scrollInfo.nPage) + if (scrollInfo.nPos > scrollInfo.nMax - scrollInfo.nMin + 1 - scrollInfo.nPage) { - scrollInfo.nPos = ((scrollInfo.nMax - scrollInfo.nMin) + 1) - scrollInfo.nPage; + scrollInfo.nPos = scrollInfo.nMax - scrollInfo.nMin + 1 - scrollInfo.nPage; } if (scrollInfo.nPos < scrollInfo.nMin) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ScrollProperties.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ScrollProperties.cs index 70313c800..a86cc7c20 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ScrollProperties.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/ScrollProperties.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/VirtualScrollableControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/VirtualScrollableControl.cs index d74c4d9ed..324acb38e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/VirtualScrollableControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/VirtualScrollableControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Labels/KryptonAlphaValueLabel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Labels/KryptonAlphaValueLabel.cs index 45b5bae41..13684c58d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Labels/KryptonAlphaValueLabel.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Labels/KryptonAlphaValueLabel.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Labels/KryptonBlueValueLabel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Labels/KryptonBlueValueLabel.cs index f75d4ac60..7a870f1bb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Labels/KryptonBlueValueLabel.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Labels/KryptonBlueValueLabel.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Labels/KryptonGreenValueLabel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Labels/KryptonGreenValueLabel.cs index fdfa0ad4e..44c049c8f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Labels/KryptonGreenValueLabel.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Labels/KryptonGreenValueLabel.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Labels/KryptonRedValueLabel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Labels/KryptonRedValueLabel.cs index 5bbac9a69..08f895b7e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Labels/KryptonRedValueLabel.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Labels/KryptonRedValueLabel.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Numeric Boxes/KryptonAlphaValueNumericBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Numeric Boxes/KryptonAlphaValueNumericBox.cs index 9983d5ffd..66b4c3e87 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Numeric Boxes/KryptonAlphaValueNumericBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Numeric Boxes/KryptonAlphaValueNumericBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Numeric Boxes/KryptonBlueValueNumericBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Numeric Boxes/KryptonBlueValueNumericBox.cs index 20a2f6caa..4435e2dc4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Numeric Boxes/KryptonBlueValueNumericBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Numeric Boxes/KryptonBlueValueNumericBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Numeric Boxes/KryptonGreenValueNumericBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Numeric Boxes/KryptonGreenValueNumericBox.cs index e9da43fa0..b6d4d3a7f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Numeric Boxes/KryptonGreenValueNumericBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Numeric Boxes/KryptonGreenValueNumericBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Numeric Boxes/KryptonRedValueNumericBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Numeric Boxes/KryptonRedValueNumericBox.cs index 85229c53e..0cd6a256e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Numeric Boxes/KryptonRedValueNumericBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Numeric Boxes/KryptonRedValueNumericBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Trackbars/KryptonAlphaTrackBar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Trackbars/KryptonAlphaTrackBar.cs index 4f406b85e..79a193ea8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Trackbars/KryptonAlphaTrackBar.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Trackbars/KryptonAlphaTrackBar.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Trackbars/KryptonBlueTrackBar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Trackbars/KryptonBlueTrackBar.cs index db0815dc5..487370f91 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Trackbars/KryptonBlueTrackBar.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Trackbars/KryptonBlueTrackBar.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Trackbars/KryptonGreenTrackBar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Trackbars/KryptonGreenTrackBar.cs index 9f3ad6372..f0b512e2b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Trackbars/KryptonGreenTrackBar.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Trackbars/KryptonGreenTrackBar.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Trackbars/KryptonRedTrackBar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Trackbars/KryptonRedTrackBar.cs index 17eab71df..ccd49cf69 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Trackbars/KryptonRedTrackBar.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Trackbars/KryptonRedTrackBar.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ARGBUserControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ARGBUserControl.cs index cab369314..0eb6728c9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ARGBUserControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ARGBUserControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -56,8 +56,8 @@ private void InitializeComponent() this._kryptonLabel1.Location = new System.Drawing.Point(8, 5); this._kryptonLabel1.Name = "_kryptonLabel1"; this._kryptonLabel1.Size = new System.Drawing.Size(58, 24); - this._kryptonLabel1.StateCommon.LongText.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this._kryptonLabel1.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this._kryptonLabel1.StateCommon.LongText.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); + this._kryptonLabel1.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this._kryptonLabel1.TabIndex = 4; this._kryptonLabel1.Values.Text = "Alpha:"; // @@ -66,8 +66,8 @@ private void InitializeComponent() this._kryptonLabel2.Location = new System.Drawing.Point(8, 71); this._kryptonLabel2.Name = "_kryptonLabel2"; this._kryptonLabel2.Size = new System.Drawing.Size(59, 24); - this._kryptonLabel2.StateCommon.LongText.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this._kryptonLabel2.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this._kryptonLabel2.StateCommon.LongText.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); + this._kryptonLabel2.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this._kryptonLabel2.TabIndex = 5; this._kryptonLabel2.Values.Text = "Green:"; // @@ -76,8 +76,8 @@ private void InitializeComponent() this._kryptonLabel3.Location = new System.Drawing.Point(8, 100); this._kryptonLabel3.Name = "_kryptonLabel3"; this._kryptonLabel3.Size = new System.Drawing.Size(48, 24); - this._kryptonLabel3.StateCommon.LongText.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this._kryptonLabel3.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this._kryptonLabel3.StateCommon.LongText.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); + this._kryptonLabel3.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this._kryptonLabel3.TabIndex = 6; this._kryptonLabel3.Values.Text = "Blue:"; // @@ -86,8 +86,8 @@ private void InitializeComponent() this._kryptonLabel4.Location = new System.Drawing.Point(8, 38); this._kryptonLabel4.Name = "_kryptonLabel4"; this._kryptonLabel4.Size = new System.Drawing.Size(44, 24); - this._kryptonLabel4.StateCommon.LongText.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this._kryptonLabel4.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this._kryptonLabel4.StateCommon.LongText.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); + this._kryptonLabel4.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this._kryptonLabel4.TabIndex = 7; this._kryptonLabel4.Values.Text = "Red:"; // diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ColourEditor.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ColourEditor.cs index bb638432f..28c20a4c9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ColourEditor.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ColourEditor.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -188,7 +188,7 @@ private void InitializeComponent() this.panel8.SuspendLayout(); this.pnlHexadecimal.SuspendLayout(); this.panel16.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbHexadecimalValue)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbHexadecimalValue).BeginInit(); this.panel15.SuspendLayout(); this.SuspendLayout(); // @@ -385,7 +385,7 @@ private void InitializeComponent() this.klblGreen.Location = new System.Drawing.Point(0, 0); this.klblGreen.Name = "klblGreen"; this.klblGreen.Size = new System.Drawing.Size(35, 23); - this.klblGreen.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblGreen.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblGreen.StateCommon.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.klblGreen.StateCommon.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; this.klblGreen.TabIndex = 1; @@ -407,7 +407,7 @@ private void InitializeComponent() this.klblBlue.Location = new System.Drawing.Point(0, 0); this.klblBlue.Name = "klblBlue"; this.klblBlue.Size = new System.Drawing.Size(35, 22); - this.klblBlue.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblBlue.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblBlue.StateCommon.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.klblBlue.StateCommon.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; this.klblBlue.TabIndex = 1; @@ -429,7 +429,7 @@ private void InitializeComponent() this.klblRed.Location = new System.Drawing.Point(0, 0); this.klblRed.Name = "klblRed"; this.klblRed.Size = new System.Drawing.Size(35, 22); - this.klblRed.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblRed.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblRed.StateCommon.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.klblRed.StateCommon.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; this.klblRed.TabIndex = 1; @@ -451,7 +451,7 @@ private void InitializeComponent() this.kryptonLabel1.Location = new System.Drawing.Point(0, 0); this.kryptonLabel1.Name = "kryptonLabel1"; this.kryptonLabel1.Size = new System.Drawing.Size(246, 26); - this.kryptonLabel1.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel1.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel1.StateCommon.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.kryptonLabel1.StateCommon.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; this.kryptonLabel1.TabIndex = 0; @@ -649,7 +649,7 @@ private void InitializeComponent() this.kryptonLabel8.Location = new System.Drawing.Point(0, 0); this.kryptonLabel8.Name = "kryptonLabel8"; this.kryptonLabel8.Size = new System.Drawing.Size(35, 22); - this.kryptonLabel8.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel8.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel8.StateCommon.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.kryptonLabel8.StateCommon.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; this.kryptonLabel8.TabIndex = 1; @@ -671,7 +671,7 @@ private void InitializeComponent() this.kryptonLabel9.Location = new System.Drawing.Point(0, 0); this.kryptonLabel9.Name = "kryptonLabel9"; this.kryptonLabel9.Size = new System.Drawing.Size(35, 26); - this.kryptonLabel9.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel9.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel9.StateCommon.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.kryptonLabel9.StateCommon.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; this.kryptonLabel9.TabIndex = 1; @@ -693,7 +693,7 @@ private void InitializeComponent() this.klblHue.Location = new System.Drawing.Point(0, 0); this.klblHue.Name = "klblHue"; this.klblHue.Size = new System.Drawing.Size(35, 26); - this.klblHue.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblHue.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblHue.StateCommon.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.klblHue.StateCommon.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; this.klblHue.TabIndex = 1; @@ -770,7 +770,7 @@ private void InitializeComponent() this.klblAlpha.Location = new System.Drawing.Point(0, 0); this.klblAlpha.Name = "klblAlpha"; this.klblAlpha.Size = new System.Drawing.Size(51, 26); - this.klblAlpha.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblAlpha.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblAlpha.StateCommon.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.klblAlpha.StateCommon.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; this.klblAlpha.TabIndex = 2; @@ -792,7 +792,7 @@ private void InitializeComponent() this.kryptonLabel2.Location = new System.Drawing.Point(0, 0); this.kryptonLabel2.Name = "kryptonLabel2"; this.kryptonLabel2.Size = new System.Drawing.Size(246, 26); - this.kryptonLabel2.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel2.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel2.StateCommon.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.kryptonLabel2.StateCommon.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; this.kryptonLabel2.TabIndex = 1; @@ -847,7 +847,7 @@ private void InitializeComponent() this.klblHex.Location = new System.Drawing.Point(0, 0); this.klblHex.Name = "klblHex"; this.klblHex.Size = new System.Drawing.Size(35, 24); - this.klblHex.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblHex.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblHex.StateCommon.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.klblHex.StateCommon.ShortText.TextV = Krypton.Toolkit.PaletteRelativeAlign.Center; this.klblHex.TabIndex = 1; @@ -904,7 +904,7 @@ private void InitializeComponent() this.panel8.PerformLayout(); this.pnlHexadecimal.ResumeLayout(false); this.panel16.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kcmbHexadecimalValue)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbHexadecimalValue).EndInit(); this.panel15.ResumeLayout(false); this.panel15.PerformLayout(); this.ResumeLayout(false); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ColourEditorUserControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ColourEditorUserControl.cs index 32c74edd2..1af257b56 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ColourEditorUserControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ColourEditorUserControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -107,7 +107,7 @@ private void InitializeComponent() this.hColourBar = new Krypton.Toolkit.Suite.Extended.Drawing.Utilities.HueColourSliderControl(); this.panel1 = new System.Windows.Forms.Panel(); this.pnlHSLUI = new System.Windows.Forms.Panel(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbHex)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbHex).BeginInit(); this.pnlRGB.SuspendLayout(); this.pnlRed.SuspendLayout(); this.pnlGreen.SuspendLayout(); @@ -124,18 +124,18 @@ private void InitializeComponent() // // kcmbHex // - this.kcmbHex.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.kcmbHex.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left + | System.Windows.Forms.AnchorStyles.Right); this.kcmbHex.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable; this.kcmbHex.DropDownWidth = 58; this.kcmbHex.IntegralHeight = false; this.kcmbHex.Location = new System.Drawing.Point(54, 0); this.kcmbHex.Name = "kcmbHex"; this.kcmbHex.Size = new System.Drawing.Size(204, 27); - this.kcmbHex.StateCommon.ComboBox.Content.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kcmbHex.StateCommon.ComboBox.Content.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kcmbHex.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; - this.kcmbHex.StateCommon.Item.Content.LongText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kcmbHex.StateCommon.Item.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kcmbHex.StateCommon.Item.Content.LongText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); + this.kcmbHex.StateCommon.Item.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kcmbHex.TabIndex = 29; this.kcmbHex.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.kcmbHex_DrawItem); this.kcmbHex.DropDown += new System.EventHandler(this.kcmbHex_DropDown); @@ -144,8 +144,8 @@ private void InitializeComponent() // // knudHue // - this.knudHue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Right))); + this.knudHue.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom + | System.Windows.Forms.AnchorStyles.Right); this.knudHue.Location = new System.Drawing.Point(200, 3); this.knudHue.Maximum = new decimal(new int[] { 255, @@ -154,14 +154,14 @@ private void InitializeComponent() 0}); this.knudHue.Name = "knudHue"; this.knudHue.Size = new System.Drawing.Size(58, 23); - this.knudHue.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.knudHue.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.knudHue.StateCommon.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Inherit; this.knudHue.TabIndex = 30; // // knudSaturation // - this.knudSaturation.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Right))); + this.knudSaturation.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom + | System.Windows.Forms.AnchorStyles.Right); this.knudSaturation.Location = new System.Drawing.Point(200, 3); this.knudSaturation.Maximum = new decimal(new int[] { 255, @@ -170,14 +170,14 @@ private void InitializeComponent() 0}); this.knudSaturation.Name = "knudSaturation"; this.knudSaturation.Size = new System.Drawing.Size(58, 23); - this.knudSaturation.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.knudSaturation.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.knudSaturation.StateCommon.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Inherit; this.knudSaturation.TabIndex = 31; // // knudLuminosity // - this.knudLuminosity.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Right))); + this.knudLuminosity.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom + | System.Windows.Forms.AnchorStyles.Right); this.knudLuminosity.Location = new System.Drawing.Point(200, 6); this.knudLuminosity.Maximum = new decimal(new int[] { 255, @@ -186,14 +186,14 @@ private void InitializeComponent() 0}); this.knudLuminosity.Name = "knudLuminosity"; this.knudLuminosity.Size = new System.Drawing.Size(58, 23); - this.knudLuminosity.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.knudLuminosity.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.knudLuminosity.StateCommon.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Inherit; this.knudLuminosity.TabIndex = 32; // // knudAlpha // - this.knudAlpha.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Right))); + this.knudAlpha.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom + | System.Windows.Forms.AnchorStyles.Right); this.knudAlpha.Location = new System.Drawing.Point(200, 3); this.knudAlpha.Maximum = new decimal(new int[] { 255, @@ -202,7 +202,7 @@ private void InitializeComponent() 0}); this.knudAlpha.Name = "knudAlpha"; this.knudAlpha.Size = new System.Drawing.Size(58, 23); - this.knudAlpha.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.knudAlpha.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.knudAlpha.StateCommon.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Inherit; this.knudAlpha.TabIndex = 33; // @@ -212,40 +212,40 @@ private void InitializeComponent() this.klblRGB.Location = new System.Drawing.Point(0, 0); this.klblRGB.Name = "klblRGB"; this.klblRGB.Size = new System.Drawing.Size(51, 27); - this.klblRGB.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblRGB.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblRGB.TabIndex = 34; this.klblRGB.Values.Text = "RGB:"; // // klblBlue // - this.klblBlue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); + this.klblBlue.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom + | System.Windows.Forms.AnchorStyles.Left); this.klblBlue.Location = new System.Drawing.Point(13, 6); this.klblBlue.Name = "klblBlue"; this.klblBlue.Size = new System.Drawing.Size(27, 21); - this.klblBlue.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblBlue.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblBlue.TabIndex = 35; this.klblBlue.Values.Text = "B:"; // // klblGreen // - this.klblGreen.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); + this.klblGreen.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom + | System.Windows.Forms.AnchorStyles.Left); this.klblGreen.Location = new System.Drawing.Point(14, 5); this.klblGreen.Name = "klblGreen"; this.klblGreen.Size = new System.Drawing.Size(28, 21); - this.klblGreen.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblGreen.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblGreen.TabIndex = 36; this.klblGreen.Values.Text = "G:"; // // klblRed // - this.klblRed.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); + this.klblRed.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom + | System.Windows.Forms.AnchorStyles.Left); this.klblRed.Location = new System.Drawing.Point(14, 6); this.klblRed.Name = "klblRed"; this.klblRed.Size = new System.Drawing.Size(28, 21); - this.klblRed.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblRed.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblRed.TabIndex = 37; this.klblRed.Values.Text = "R:"; // @@ -255,51 +255,51 @@ private void InitializeComponent() this.klblHex.Location = new System.Drawing.Point(0, 0); this.klblHex.Name = "klblHex"; this.klblHex.Size = new System.Drawing.Size(45, 27); - this.klblHex.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblHex.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblHex.TabIndex = 38; this.klblHex.Values.Text = "Hex:"; // // klblHSL // - this.klblHSL.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); + this.klblHSL.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom + | System.Windows.Forms.AnchorStyles.Left); this.klblHSL.Location = new System.Drawing.Point(4, 6); this.klblHSL.Name = "klblHSL"; this.klblHSL.Size = new System.Drawing.Size(47, 21); - this.klblHSL.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblHSL.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblHSL.TabIndex = 39; this.klblHSL.Values.Text = "HSL:"; // // klblHue // - this.klblHue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); + this.klblHue.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom + | System.Windows.Forms.AnchorStyles.Left); this.klblHue.Location = new System.Drawing.Point(13, 5); this.klblHue.Name = "klblHue"; this.klblHue.Size = new System.Drawing.Size(28, 21); - this.klblHue.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblHue.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblHue.TabIndex = 40; this.klblHue.Values.Text = "H:"; // // klblSaturation // - this.klblSaturation.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); + this.klblSaturation.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom + | System.Windows.Forms.AnchorStyles.Left); this.klblSaturation.Location = new System.Drawing.Point(13, 5); this.klblSaturation.Name = "klblSaturation"; this.klblSaturation.Size = new System.Drawing.Size(27, 21); - this.klblSaturation.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblSaturation.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblSaturation.TabIndex = 41; this.klblSaturation.Values.Text = "S:"; // // klblLuminosity // - this.klblLuminosity.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); + this.klblLuminosity.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom + | System.Windows.Forms.AnchorStyles.Left); this.klblLuminosity.Location = new System.Drawing.Point(14, 6); this.klblLuminosity.Name = "klblLuminosity"; this.klblLuminosity.Size = new System.Drawing.Size(25, 21); - this.klblLuminosity.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblLuminosity.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblLuminosity.TabIndex = 42; this.klblLuminosity.Values.Text = "L:"; // @@ -309,7 +309,7 @@ private void InitializeComponent() this.klblAlpha.Location = new System.Drawing.Point(0, 0); this.klblAlpha.Name = "klblAlpha"; this.klblAlpha.Size = new System.Drawing.Size(57, 27); - this.klblAlpha.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblAlpha.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblAlpha.TabIndex = 43; this.klblAlpha.Values.Text = "Alpha:"; // @@ -337,7 +337,7 @@ private void InitializeComponent() // // rColourBar // - this.rColourBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.rColourBar.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right); this.rColourBar.BackColor = System.Drawing.Color.Transparent; this.rColourBar.Location = new System.Drawing.Point(47, 6); this.rColourBar.Name = "rColourBar"; @@ -346,8 +346,8 @@ private void InitializeComponent() // // knudRed // - this.knudRed.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Right))); + this.knudRed.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom + | System.Windows.Forms.AnchorStyles.Right); this.knudRed.Location = new System.Drawing.Point(200, 3); this.knudRed.Maximum = new decimal(new int[] { 255, @@ -376,7 +376,7 @@ private void InitializeComponent() // // gColourBar // - this.gColourBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.gColourBar.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right); this.gColourBar.BackColor = System.Drawing.Color.Transparent; this.gColourBar.Channel = Krypton.Toolkit.Suite.Extended.Drawing.Utilities.RGBAChannel.Green; this.gColourBar.Location = new System.Drawing.Point(47, 3); @@ -386,8 +386,8 @@ private void InitializeComponent() // // knudGreen // - this.knudGreen.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Right))); + this.knudGreen.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom + | System.Windows.Forms.AnchorStyles.Right); this.knudGreen.Location = new System.Drawing.Point(200, 6); this.knudGreen.Maximum = new decimal(new int[] { 255, @@ -416,7 +416,7 @@ private void InitializeComponent() // // bColourBar // - this.bColourBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.bColourBar.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right); this.bColourBar.BackColor = System.Drawing.Color.Transparent; this.bColourBar.Channel = Krypton.Toolkit.Suite.Extended.Drawing.Utilities.RGBAChannel.Blue; this.bColourBar.Location = new System.Drawing.Point(47, 3); @@ -426,8 +426,8 @@ private void InitializeComponent() // // knudBlue // - this.knudBlue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Right))); + this.knudBlue.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom + | System.Windows.Forms.AnchorStyles.Right); this.knudBlue.Location = new System.Drawing.Point(200, 6); this.knudBlue.Maximum = new decimal(new int[] { 255, @@ -477,8 +477,8 @@ private void InitializeComponent() // // aColourBar // - this.aColourBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.aColourBar.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left + | System.Windows.Forms.AnchorStyles.Right); this.aColourBar.BackColor = System.Drawing.Color.Transparent; this.aColourBar.Channel = Krypton.Toolkit.Suite.Extended.Drawing.Utilities.RGBAChannel.Alpha; this.aColourBar.Location = new System.Drawing.Point(65, 6); @@ -499,7 +499,7 @@ private void InitializeComponent() // // lColourBar // - this.lColourBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.lColourBar.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right); this.lColourBar.BackColor = System.Drawing.Color.Transparent; this.lColourBar.Location = new System.Drawing.Point(45, 9); this.lColourBar.Name = "lColourBar"; @@ -519,7 +519,7 @@ private void InitializeComponent() // // sColourBar // - this.sColourBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.sColourBar.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right); this.sColourBar.BackColor = System.Drawing.Color.Transparent; this.sColourBar.Location = new System.Drawing.Point(47, 5); this.sColourBar.Name = "sColourBar"; @@ -539,7 +539,7 @@ private void InitializeComponent() // // hColourBar // - this.hColourBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.hColourBar.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right); this.hColourBar.BackColor = System.Drawing.Color.Transparent; this.hColourBar.Location = new System.Drawing.Point(47, 5); this.hColourBar.Name = "hColourBar"; @@ -580,7 +580,7 @@ private void InitializeComponent() this.Name = "ColourEditorUserControl"; this.Size = new System.Drawing.Size(261, 303); this.Load += new System.EventHandler(this.ColourEditorUserControl_Load); - ((System.ComponentModel.ISupportInitialize)(this.kcmbHex)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbHex).EndInit(); this.pnlRGB.ResumeLayout(false); this.pnlRGB.PerformLayout(); this.pnlRed.ResumeLayout(false); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ColourGrid.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ColourGrid.cs index d81bc950f..8a952bf06 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ColourGrid.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ColourGrid.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ColourGridUserControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ColourGridUserControl.cs index 61834ebbb..c1019403d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ColourGridUserControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/User Controls/General/ColourGridUserControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Designers/ImageBoxExtendedDesigner.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Designers/ImageBoxExtendedDesigner.cs index 314492487..d8b092fb3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Designers/ImageBoxExtendedDesigner.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Designers/ImageBoxExtendedDesigner.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Designers/KryptonColourButtonExtendedActionList.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Designers/KryptonColourButtonExtendedActionList.cs index 5411dae79..75c624a8c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Designers/KryptonColourButtonExtendedActionList.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Designers/KryptonColourButtonExtendedActionList.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Designers/KryptonColourButtonExtendedDesigner.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Designers/KryptonColourButtonExtendedDesigner.cs index 2db8166f9..5db8d7185 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Designers/KryptonColourButtonExtendedDesigner.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Designers/KryptonColourButtonExtendedDesigner.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Enumerations/ColourCellBorderStyle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Enumerations/ColourCellBorderStyle.cs index 12b1af4ce..3c4c1a15e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Enumerations/ColourCellBorderStyle.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Enumerations/ColourCellBorderStyle.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ColourChangedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ColourChangedEventArgs.cs index a684c6683..5888f8143 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ColourChangedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ColourChangedEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ColourCollectionEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ColourCollectionEventArgs.cs index 768c55af7..58b11251b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ColourCollectionEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ColourCollectionEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ColourGenerationEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ColourGenerationEventArgs.cs index 50cca22ee..0a8a03b6c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ColourGenerationEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ColourGenerationEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ColourHexadecimalValuesEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ColourHexadecimalValuesEventArgs.cs index 68033432b..6adc38f12 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ColourHexadecimalValuesEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ColourHexadecimalValuesEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/EditColourCancelEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/EditColourCancelEventArgs.cs index 58ab2c2a3..b3b643a07 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/EditColourCancelEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/EditColourCancelEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ImageBoxExtendedCancelEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ImageBoxExtendedCancelEventArgs.cs index 70325900c..c7e432a6c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ImageBoxExtendedCancelEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ImageBoxExtendedCancelEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ImageBoxExtendedZoomEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ImageBoxExtendedZoomEventArgs.cs index 75c6ef604..571ae6be0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ImageBoxExtendedZoomEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/ImageBoxExtendedZoomEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/SelectedColourEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/SelectedColourEventArgs.cs index 2fc4446ca..c6bdcc03e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/SelectedColourEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Events/SelectedColourEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Globals/GlobalDeclarations.cs index 00efbbd52..5a3ad50d5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -49,6 +49,7 @@ global using Krypton.Toolkit.Suite.Extended.Buttons; global using Krypton.Toolkit.Suite.Extended.Core; global using Krypton.Toolkit.Suite.Extended.Common; +global using Krypton.Toolkit.Suite.Extended.Debug.Tools; global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; global using Krypton.Toolkit.Suite.Extended.Messagebox; global using Krypton.Toolkit.Suite.Extended.Shared; \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Interfaces/IColourConfigurator.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Interfaces/IColourConfigurator.cs index 9720062a8..dee9243b0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Interfaces/IColourConfigurator.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Interfaces/IColourConfigurator.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Interfaces/IColourEditor.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Interfaces/IColourEditor.cs index 23dbddade..98d1b4dd8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Interfaces/IColourEditor.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Interfaces/IColourEditor.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Interfaces/IPaletteSerializer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Interfaces/IPaletteSerializer.cs index 71844577c..9d9b1c003 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Interfaces/IPaletteSerializer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Interfaces/IPaletteSerializer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Krypton.Toolkit.Suite.Extended.Drawing.Utilities 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Krypton.Toolkit.Suite.Extended.Drawing.Utilities 2022.csproj index 82a3a4fee..9c59e259e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Krypton.Toolkit.Suite.Extended.Drawing.Utilities 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Krypton.Toolkit.Suite.Extended.Drawing.Utilities 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements additional drawing utilities. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements additional drawing utilities. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,74 +69,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Krypton.Toolkit.Suite.Extended.Drawing.Utilities.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Krypton.Toolkit.Suite.Extended.Drawing.Utilities.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Krypton.Toolkit.Suite.Extended.Drawing.Utilities.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Krypton.Toolkit.Suite.Extended.Drawing.Utilities.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Structures/HSLColour.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Structures/HSLColour.cs index 762bccad0..c5486062a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Structures/HSLColour.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Structures/HSLColour.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/ColourGridDialog.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/ColourGridDialog.cs index 44c63a088..169ff7b2c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/ColourGridDialog.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/ColourGridDialog.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -46,7 +46,7 @@ private void InitializeComponent() this.ftsColourGridActions = new Krypton.Toolkit.Suite.Extended.Floating.Toolbars.FloatableToolStrip(); this.tsbSavePalette = new System.Windows.Forms.ToolStripButton(); this.tsbLoadPalette = new System.Windows.Forms.ToolStripButton(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); this.tspeColourGridActions.SuspendLayout(); this.ftsColourGridActions.SuspendLayout(); @@ -125,7 +125,7 @@ private void InitializeComponent() this.Name = "ColourGridDialog"; this.Text = "Colour Grid"; this.Load += new System.EventHandler(this.ColourGridDialog_Load); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); this.tspeColourGridActions.ResumeLayout(false); @@ -263,7 +263,7 @@ private void tsbLoadPalette_Click(object sender, EventArgs e) if (serializer != null) { - ColorCollection colours; + ColorCollection? colours; if (!serializer.CanRead) { @@ -297,7 +297,7 @@ private void tsbLoadPalette_Click(object sender, EventArgs e) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/ColourKnobDialog.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/ColourKnobDialog.cs index 508aa7bf3..8f63868d8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/ColourKnobDialog.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/ColourKnobDialog.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -63,11 +63,11 @@ private void InitializeComponent() this.kKnobGreen = new Krypton.Toolkit.Suite.Extended.Common.CommonKryptonKnobControlEnhanced(); this.kKnobRed = new Krypton.Toolkit.Suite.Extended.Common.CommonKryptonKnobControlEnhanced(); this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.cpbxColourPreview)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cpbxColourPreview).BeginInit(); this.SuspendLayout(); // // kryptonPanel1 @@ -124,7 +124,7 @@ private void InitializeComponent() this.kryptonLabel6.Location = new System.Drawing.Point(205, 164); this.kryptonLabel6.Name = "kryptonLabel6"; this.kryptonLabel6.Size = new System.Drawing.Size(38, 21); - this.kryptonLabel6.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel6.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel6.TabIndex = 9; this.kryptonLabel6.Values.Text = "255"; // @@ -133,7 +133,7 @@ private void InitializeComponent() this.kryptonLabel5.Location = new System.Drawing.Point(363, 164); this.kryptonLabel5.Name = "kryptonLabel5"; this.kryptonLabel5.Size = new System.Drawing.Size(38, 21); - this.kryptonLabel5.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel5.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel5.TabIndex = 8; this.kryptonLabel5.Values.Text = "255"; // @@ -142,7 +142,7 @@ private void InitializeComponent() this.kryptonLabel4.Location = new System.Drawing.Point(43, 164); this.kryptonLabel4.Name = "kryptonLabel4"; this.kryptonLabel4.Size = new System.Drawing.Size(38, 21); - this.kryptonLabel4.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel4.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel4.TabIndex = 7; this.kryptonLabel4.Values.Text = "255"; // @@ -151,7 +151,7 @@ private void InitializeComponent() this.kryptonLabel3.Location = new System.Drawing.Point(199, 12); this.kryptonLabel3.Name = "kryptonLabel3"; this.kryptonLabel3.Size = new System.Drawing.Size(56, 21); - this.kryptonLabel3.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel3.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel3.TabIndex = 6; this.kryptonLabel3.Values.Text = "Green"; // @@ -160,7 +160,7 @@ private void InitializeComponent() this.kryptonLabel2.Location = new System.Drawing.Point(361, 12); this.kryptonLabel2.Name = "kryptonLabel2"; this.kryptonLabel2.Size = new System.Drawing.Size(44, 21); - this.kryptonLabel2.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel2.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel2.TabIndex = 5; this.kryptonLabel2.Values.Text = "Blue"; // @@ -169,7 +169,7 @@ private void InitializeComponent() this.kryptonLabel1.Location = new System.Drawing.Point(43, 12); this.kryptonLabel1.Name = "kryptonLabel1"; this.kryptonLabel1.Size = new System.Drawing.Size(41, 21); - this.kryptonLabel1.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel1.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel1.TabIndex = 4; this.kryptonLabel1.Values.Text = "Red"; // @@ -184,10 +184,10 @@ private void InitializeComponent() // // kKnobBlue // - this.kKnobBlue.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(206)))), ((int)(((byte)(230))))); + this.kKnobBlue.BackColor = System.Drawing.Color.FromArgb((int)(byte)187, (int)(byte)206, (int)(byte)230); this.kKnobBlue.EndAngle = 405F; this.kKnobBlue.ImeMode = System.Windows.Forms.ImeMode.On; - this.kKnobBlue.KnobBackColour = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(206)))), ((int)(((byte)(230))))); + this.kKnobBlue.KnobBackColour = System.Drawing.Color.FromArgb((int)(byte)187, (int)(byte)206, (int)(byte)230); this.kKnobBlue.LargeChange = 5; this.kKnobBlue.Location = new System.Drawing.Point(328, 44); this.kKnobBlue.Maximum = 255; @@ -195,7 +195,7 @@ private void InitializeComponent() this.kKnobBlue.Name = "kKnobBlue"; this.kKnobBlue.PointerColour = System.Drawing.Color.Blue; this.kKnobBlue.PointerStyle = Krypton.Toolkit.Suite.Extended.Common.CommonKryptonKnobControlEnhanced.KnobPointerStyles.CIRCLE; - this.kKnobBlue.ScaleColour = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kKnobBlue.ScaleColour = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kKnobBlue.ScaleDivisions = 11; this.kKnobBlue.ScaleSubDivisions = 4; this.kKnobBlue.ScaleTypeface = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); @@ -210,10 +210,10 @@ private void InitializeComponent() // // kKnobGreen // - this.kKnobGreen.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(206)))), ((int)(((byte)(230))))); + this.kKnobGreen.BackColor = System.Drawing.Color.FromArgb((int)(byte)187, (int)(byte)206, (int)(byte)230); this.kKnobGreen.EndAngle = 405F; this.kKnobGreen.ImeMode = System.Windows.Forms.ImeMode.On; - this.kKnobGreen.KnobBackColour = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(206)))), ((int)(((byte)(230))))); + this.kKnobGreen.KnobBackColour = System.Drawing.Color.FromArgb((int)(byte)187, (int)(byte)206, (int)(byte)230); this.kKnobGreen.LargeChange = 5; this.kKnobGreen.Location = new System.Drawing.Point(169, 44); this.kKnobGreen.Maximum = 255; @@ -221,7 +221,7 @@ private void InitializeComponent() this.kKnobGreen.Name = "kKnobGreen"; this.kKnobGreen.PointerColour = System.Drawing.Color.Green; this.kKnobGreen.PointerStyle = Krypton.Toolkit.Suite.Extended.Common.CommonKryptonKnobControlEnhanced.KnobPointerStyles.CIRCLE; - this.kKnobGreen.ScaleColour = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kKnobGreen.ScaleColour = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kKnobGreen.ScaleDivisions = 11; this.kKnobGreen.ScaleSubDivisions = 4; this.kKnobGreen.ScaleTypeface = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); @@ -236,10 +236,10 @@ private void InitializeComponent() // // kKnobRed // - this.kKnobRed.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(206)))), ((int)(((byte)(230))))); + this.kKnobRed.BackColor = System.Drawing.Color.FromArgb((int)(byte)187, (int)(byte)206, (int)(byte)230); this.kKnobRed.EndAngle = 405F; this.kKnobRed.ImeMode = System.Windows.Forms.ImeMode.On; - this.kKnobRed.KnobBackColour = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(206)))), ((int)(((byte)(230))))); + this.kKnobRed.KnobBackColour = System.Drawing.Color.FromArgb((int)(byte)187, (int)(byte)206, (int)(byte)230); this.kKnobRed.LargeChange = 5; this.kKnobRed.Location = new System.Drawing.Point(12, 44); this.kKnobRed.Maximum = 255; @@ -247,7 +247,7 @@ private void InitializeComponent() this.kKnobRed.Name = "kKnobRed"; this.kKnobRed.PointerColour = System.Drawing.Color.Red; this.kKnobRed.PointerStyle = Krypton.Toolkit.Suite.Extended.Common.CommonKryptonKnobControlEnhanced.KnobPointerStyles.CIRCLE; - this.kKnobRed.ScaleColour = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kKnobRed.ScaleColour = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kKnobRed.ScaleDivisions = 11; this.kKnobRed.ScaleSubDivisions = 4; this.kKnobRed.ScaleTypeface = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); @@ -283,13 +283,13 @@ private void InitializeComponent() this.ShowIcon = false; this.ShowInTaskbar = false; this.Load += new System.EventHandler(this.ColourKnobDialog_Load); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); this.kryptonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.cpbxColourPreview)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cpbxColourPreview).EndInit(); this.ResumeLayout(false); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/KryptonColourButtonCustomColourDialog.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/KryptonColourButtonCustomColourDialog.cs index 91f451cbf..46f271300 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/KryptonColourButtonCustomColourDialog.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/KryptonColourButtonCustomColourDialog.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -83,11 +83,11 @@ private void InitializeComponent() this.kryptonLabel2 = new Krypton.Toolkit.KryptonLabel(); this.kryptonLabel1 = new Krypton.Toolkit.KryptonLabel(); this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.circularPictureBox1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.circularPictureBox1).BeginInit(); this.SuspendLayout(); // // kryptonPanel1 @@ -104,7 +104,7 @@ private void InitializeComponent() // // kryptonOKDialogButton1 // - this.kryptonOKDialogButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.kryptonOKDialogButton1.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kryptonOKDialogButton1.DialogResult = System.Windows.Forms.DialogResult.OK; this.kryptonOKDialogButton1.Location = new System.Drawing.Point(273, 11); this.kryptonOKDialogButton1.Name = "kryptonOKDialogButton1"; @@ -114,7 +114,7 @@ private void InitializeComponent() // // kryptonCancelDialogButton1 // - this.kryptonCancelDialogButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.kryptonCancelDialogButton1.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kryptonCancelDialogButton1.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kryptonCancelDialogButton1.Location = new System.Drawing.Point(369, 11); this.kryptonCancelDialogButton1.Name = "kryptonCancelDialogButton1"; @@ -186,7 +186,7 @@ private void InitializeComponent() this.kryptonTextBox1.MaxLength = 7; this.kryptonTextBox1.Name = "kryptonTextBox1"; this.kryptonTextBox1.Size = new System.Drawing.Size(154, 24); - this.kryptonTextBox1.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonTextBox1.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonTextBox1.StateCommon.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Inherit; this.kryptonTextBox1.TabIndex = 18; this.kryptonTextBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -196,7 +196,7 @@ private void InitializeComponent() this.kryptonLabel7.Location = new System.Drawing.Point(12, 144); this.kryptonLabel7.Name = "kryptonLabel7"; this.kryptonLabel7.Size = new System.Drawing.Size(154, 21); - this.kryptonLabel7.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel7.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel7.TabIndex = 17; this.kryptonLabel7.Values.Text = "Hexadecimal Value:"; // @@ -229,7 +229,7 @@ private void InitializeComponent() this.kryptonNumericUpDown6.Size = new System.Drawing.Size(79, 23); this.kryptonNumericUpDown6.StateCommon.Back.Color1 = System.Drawing.Color.Blue; this.kryptonNumericUpDown6.StateCommon.Content.Color1 = System.Drawing.Color.White; - this.kryptonNumericUpDown6.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonNumericUpDown6.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonNumericUpDown6.StateCommon.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Inherit; this.kryptonNumericUpDown6.TabIndex = 14; // @@ -245,7 +245,7 @@ private void InitializeComponent() this.kryptonNumericUpDown5.Size = new System.Drawing.Size(79, 23); this.kryptonNumericUpDown5.StateCommon.Back.Color1 = System.Drawing.Color.Green; this.kryptonNumericUpDown5.StateCommon.Content.Color1 = System.Drawing.Color.White; - this.kryptonNumericUpDown5.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonNumericUpDown5.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonNumericUpDown5.StateCommon.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Inherit; this.kryptonNumericUpDown5.TabIndex = 13; // @@ -261,7 +261,7 @@ private void InitializeComponent() this.kryptonNumericUpDown4.Size = new System.Drawing.Size(79, 23); this.kryptonNumericUpDown4.StateCommon.Back.Color1 = System.Drawing.Color.Red; this.kryptonNumericUpDown4.StateCommon.Content.Color1 = System.Drawing.Color.White; - this.kryptonNumericUpDown4.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonNumericUpDown4.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonNumericUpDown4.StateCommon.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Inherit; this.kryptonNumericUpDown4.TabIndex = 12; // @@ -275,7 +275,7 @@ private void InitializeComponent() 0}); this.kryptonNumericUpDown3.Name = "kryptonNumericUpDown3"; this.kryptonNumericUpDown3.Size = new System.Drawing.Size(79, 23); - this.kryptonNumericUpDown3.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonNumericUpDown3.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonNumericUpDown3.StateCommon.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Inherit; this.kryptonNumericUpDown3.TabIndex = 11; // @@ -289,7 +289,7 @@ private void InitializeComponent() 0}); this.kryptonNumericUpDown2.Name = "kryptonNumericUpDown2"; this.kryptonNumericUpDown2.Size = new System.Drawing.Size(79, 23); - this.kryptonNumericUpDown2.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonNumericUpDown2.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonNumericUpDown2.StateCommon.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Inherit; this.kryptonNumericUpDown2.TabIndex = 10; // @@ -303,7 +303,7 @@ private void InitializeComponent() 0}); this.kryptonNumericUpDown1.Name = "kryptonNumericUpDown1"; this.kryptonNumericUpDown1.Size = new System.Drawing.Size(79, 23); - this.kryptonNumericUpDown1.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonNumericUpDown1.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonNumericUpDown1.StateCommon.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Inherit; this.kryptonNumericUpDown1.TabIndex = 9; // @@ -314,7 +314,7 @@ private void InitializeComponent() this.kryptonLabel6.Size = new System.Drawing.Size(48, 21); this.kryptonLabel6.StateCommon.ShortText.Color1 = System.Drawing.Color.Blue; this.kryptonLabel6.StateCommon.ShortText.Color2 = System.Drawing.Color.Blue; - this.kryptonLabel6.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel6.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel6.TabIndex = 8; this.kryptonLabel6.Values.Text = "Blue:"; // @@ -325,7 +325,7 @@ private void InitializeComponent() this.kryptonLabel5.Size = new System.Drawing.Size(61, 21); this.kryptonLabel5.StateCommon.ShortText.Color1 = System.Drawing.Color.Green; this.kryptonLabel5.StateCommon.ShortText.Color2 = System.Drawing.Color.Green; - this.kryptonLabel5.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel5.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel5.TabIndex = 7; this.kryptonLabel5.Values.Text = "Green:"; // @@ -336,7 +336,7 @@ private void InitializeComponent() this.kryptonLabel4.Size = new System.Drawing.Size(45, 21); this.kryptonLabel4.StateCommon.ShortText.Color1 = System.Drawing.Color.Red; this.kryptonLabel4.StateCommon.ShortText.Color2 = System.Drawing.Color.Red; - this.kryptonLabel4.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel4.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel4.TabIndex = 6; this.kryptonLabel4.Values.Text = "Red:"; // @@ -345,7 +345,7 @@ private void InitializeComponent() this.kryptonLabel3.Location = new System.Drawing.Point(12, 92); this.kryptonLabel3.Name = "kryptonLabel3"; this.kryptonLabel3.Size = new System.Drawing.Size(45, 21); - this.kryptonLabel3.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel3.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel3.TabIndex = 5; this.kryptonLabel3.Values.Text = "Hue:"; // @@ -354,7 +354,7 @@ private void InitializeComponent() this.kryptonLabel2.Location = new System.Drawing.Point(12, 52); this.kryptonLabel2.Name = "kryptonLabel2"; this.kryptonLabel2.Size = new System.Drawing.Size(92, 21); - this.kryptonLabel2.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel2.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel2.TabIndex = 4; this.kryptonLabel2.Values.Text = "Brightness:"; // @@ -363,7 +363,7 @@ private void InitializeComponent() this.kryptonLabel1.Location = new System.Drawing.Point(12, 12); this.kryptonLabel1.Name = "kryptonLabel1"; this.kryptonLabel1.Size = new System.Drawing.Size(57, 21); - this.kryptonLabel1.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel1.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel1.TabIndex = 3; this.kryptonLabel1.Values.Text = "Alpha:"; // @@ -387,13 +387,13 @@ private void InitializeComponent() this.ShowIcon = false; this.ShowInTaskbar = false; this.Text = "Select Colour"; - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); this.kryptonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.circularPictureBox1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.circularPictureBox1).EndInit(); this.ResumeLayout(false); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/KryptonColourContrastDialog.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/KryptonColourContrastDialog.cs index 39302d2bc..91e65025b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/KryptonColourContrastDialog.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/KryptonColourContrastDialog.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -145,15 +145,15 @@ private void InitializeComponent() this.kbvnumContrast = new Krypton.Toolkit.Suite.Extended.Drawing.Utilities.KryptonBlueValueNumericBox(); this.kryptonLabel2 = new Krypton.Toolkit.KryptonLabel(); this.chtxtContrast = new Krypton.Toolkit.Suite.Extended.Drawing.Utilities.ColourHexadecimalTextBox(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); this.cmsPaletteUtilities.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.cbContrastColour)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cbContrastColour).BeginInit(); this.cmsContrast.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.cbBaseColour)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cbBaseColour).BeginInit(); this.cmsBase.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); this.tableLayoutPanel3.SuspendLayout(); @@ -176,7 +176,6 @@ private void InitializeComponent() // this.ksbtnPalettes.AutoSize = true; this.ksbtnPalettes.ContextMenuStrip = this.cmsPaletteUtilities; - this.ksbtnPalettes.CornerRoundingRadius = -1F; this.ksbtnPalettes.Location = new System.Drawing.Point(12, 13); this.ksbtnPalettes.Name = "ksbtnPalettes"; this.ksbtnPalettes.ProcessPath = null; @@ -217,7 +216,6 @@ private void InitializeComponent() // // kbtnOk // - this.kbtnOk.CornerRoundingRadius = -1F; this.kbtnOk.DialogResult = System.Windows.Forms.DialogResult.OK; this.kbtnOk.Location = new System.Drawing.Point(678, 13); this.kbtnOk.Name = "kbtnOk"; @@ -228,7 +226,6 @@ private void InitializeComponent() // // kbtnCancel // - this.kbtnCancel.CornerRoundingRadius = -1F; this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kbtnCancel.Location = new System.Drawing.Point(774, 13); this.kbtnCancel.Name = "kbtnCancel"; @@ -434,25 +431,25 @@ private void InitializeComponent() // kwlContrastColourHeader // this.kwlContrastColourHeader.Dock = System.Windows.Forms.DockStyle.Fill; - this.kwlContrastColourHeader.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlContrastColourHeader.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kwlContrastColourHeader.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); + this.kwlContrastColourHeader.ForeColor = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kwlContrastColourHeader.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl; this.kwlContrastColourHeader.Location = new System.Drawing.Point(441, 0); this.kwlContrastColourHeader.Name = "kwlContrastColourHeader"; this.kwlContrastColourHeader.Size = new System.Drawing.Size(432, 58); - this.kwlContrastColourHeader.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kwlContrastColourHeader.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kwlContrastColourHeader.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // kwlBaseColourHeader // this.kwlBaseColourHeader.Dock = System.Windows.Forms.DockStyle.Fill; - this.kwlBaseColourHeader.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlBaseColourHeader.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kwlBaseColourHeader.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); + this.kwlBaseColourHeader.ForeColor = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kwlBaseColourHeader.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl; this.kwlBaseColourHeader.Location = new System.Drawing.Point(3, 0); this.kwlBaseColourHeader.Name = "kwlBaseColourHeader"; this.kwlBaseColourHeader.Size = new System.Drawing.Size(432, 58); - this.kwlBaseColourHeader.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kwlBaseColourHeader.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kwlBaseColourHeader.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // tableLayoutPanel2 @@ -563,8 +560,8 @@ private void InitializeComponent() // // kavnumBase // - this.kavnumBase.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.kavnumBase.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left + | System.Windows.Forms.AnchorStyles.Right); this.kavnumBase.Location = new System.Drawing.Point(219, 3); this.kavnumBase.Maximum = new decimal(new int[] { 255, @@ -579,8 +576,8 @@ private void InitializeComponent() // // krvnumBase // - this.krvnumBase.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.krvnumBase.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left + | System.Windows.Forms.AnchorStyles.Right); this.krvnumBase.Location = new System.Drawing.Point(219, 41); this.krvnumBase.Maximum = new decimal(new int[] { 255, @@ -601,8 +598,8 @@ private void InitializeComponent() // // kgvnumBase // - this.kgvnumBase.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.kgvnumBase.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left + | System.Windows.Forms.AnchorStyles.Right); this.kgvnumBase.Location = new System.Drawing.Point(219, 79); this.kgvnumBase.Maximum = new decimal(new int[] { 255, @@ -623,8 +620,8 @@ private void InitializeComponent() // // kbvnumBase // - this.kbvnumBase.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.kbvnumBase.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left + | System.Windows.Forms.AnchorStyles.Right); this.kbvnumBase.Location = new System.Drawing.Point(219, 117); this.kbvnumBase.Maximum = new decimal(new int[] { 255, @@ -650,7 +647,7 @@ private void InitializeComponent() this.kryptonLabel1.Location = new System.Drawing.Point(3, 155); this.kryptonLabel1.Name = "kryptonLabel1"; this.kryptonLabel1.Size = new System.Drawing.Size(210, 36); - this.kryptonLabel1.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel1.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel1.StateCommon.ShortText.ImageStyle = Krypton.Toolkit.PaletteImageStyle.Inherit; this.kryptonLabel1.StateCommon.ShortText.Trim = Krypton.Toolkit.PaletteTextTrim.Inherit; this.kryptonLabel1.TabIndex = 9; @@ -779,8 +776,8 @@ private void InitializeComponent() // // kavnumContrast // - this.kavnumContrast.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.kavnumContrast.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left + | System.Windows.Forms.AnchorStyles.Right); this.kavnumContrast.Location = new System.Drawing.Point(219, 3); this.kavnumContrast.Maximum = new decimal(new int[] { 255, @@ -795,8 +792,8 @@ private void InitializeComponent() // // krvnumContrast // - this.krvnumContrast.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.krvnumContrast.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left + | System.Windows.Forms.AnchorStyles.Right); this.krvnumContrast.Location = new System.Drawing.Point(219, 41); this.krvnumContrast.Maximum = new decimal(new int[] { 255, @@ -817,8 +814,8 @@ private void InitializeComponent() // // kgvnumContrast // - this.kgvnumContrast.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.kgvnumContrast.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left + | System.Windows.Forms.AnchorStyles.Right); this.kgvnumContrast.Location = new System.Drawing.Point(219, 79); this.kgvnumContrast.Maximum = new decimal(new int[] { 255, @@ -839,8 +836,8 @@ private void InitializeComponent() // // kbvnumContrast // - this.kbvnumContrast.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.kbvnumContrast.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left + | System.Windows.Forms.AnchorStyles.Right); this.kbvnumContrast.Location = new System.Drawing.Point(219, 117); this.kbvnumContrast.Maximum = new decimal(new int[] { 255, @@ -866,7 +863,7 @@ private void InitializeComponent() this.kryptonLabel2.Location = new System.Drawing.Point(3, 155); this.kryptonLabel2.Name = "kryptonLabel2"; this.kryptonLabel2.Size = new System.Drawing.Size(210, 36); - this.kryptonLabel2.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel2.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel2.StateCommon.ShortText.ImageStyle = Krypton.Toolkit.PaletteImageStyle.Inherit; this.kryptonLabel2.StateCommon.ShortText.Trim = Krypton.Toolkit.PaletteTextTrim.Inherit; this.kryptonLabel2.TabIndex = 8; @@ -902,17 +899,17 @@ private void InitializeComponent() this.ShowIcon = false; this.ShowInTaskbar = false; this.Text = "Contrast Colour Configurator"; - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); this.cmsPaletteUtilities.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.cbContrastColour)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cbContrastColour).EndInit(); this.cmsContrast.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.cbBaseColour)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cbBaseColour).EndInit(); this.cmsBase.ResumeLayout(false); this.tableLayoutPanel2.ResumeLayout(false); this.tableLayoutPanel2.PerformLayout(); @@ -1110,7 +1107,7 @@ private void UpdateUI_Tick(object sender, EventArgs e) private void chtxtBase_TextChanged(object sender, EventArgs e) { - if (chtxtBase.Text.Length == 3 || chtxtBase.Text.Length == 6) + if (chtxtBase.Text.Length is 3 or 6) { cbBaseColour.BackColor = ColorTranslator.FromHtml($"#{chtxtBase.Text}"); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/KryptonColourFindAndReplaceDialog.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/KryptonColourFindAndReplaceDialog.cs index 3aca8c892..d2ab2c931 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/KryptonColourFindAndReplaceDialog.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/KryptonColourFindAndReplaceDialog.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -59,15 +59,15 @@ private void InitializeComponent() this.kryptonLabel1 = new Krypton.Toolkit.KryptonLabel(); this.ktxtSearchTerm = new Krypton.Toolkit.KryptonTextBox(); this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonNavigator1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonNavigator1).BeginInit(); this.kryptonNavigator1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage1).BeginInit(); this.kryptonPage1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage2).BeginInit(); this.kryptonPage2.SuspendLayout(); this.SuspendLayout(); // @@ -210,17 +210,17 @@ private void InitializeComponent() this.Name = "KryptonColourFindAndReplaceDialog"; this.ShowIcon = false; this.ShowInTaskbar = false; - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonNavigator1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonNavigator1).EndInit(); this.kryptonNavigator1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage1).EndInit(); this.kryptonPage1.ResumeLayout(false); this.kryptonPage1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage2).EndInit(); this.kryptonPage2.ResumeLayout(false); this.kryptonPage2.PerformLayout(); this.ResumeLayout(false); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/KryptonColourPickerDialog.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/KryptonColourPickerDialog.cs index e5d6bfec0..3322a9595 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/KryptonColourPickerDialog.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/KryptonColourPickerDialog.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -62,11 +62,11 @@ private void InitializeComponent() this.cpbColour = new Krypton.Toolkit.Suite.Extended.Controls.CircularPictureBox(); this.scpColour = new Krypton.Toolkit.Suite.Extended.Drawing.Utilities.ScreenColourPickerControl(); this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.cpbColour)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cpbColour).BeginInit(); this.SuspendLayout(); // // kryptonPanel1 @@ -227,13 +227,13 @@ private void InitializeComponent() this.ShowIcon = false; this.ShowInTaskbar = false; this.Text = "Select a Colour"; - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); this.kryptonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.cpbColour)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cpbColour).EndInit(); this.ResumeLayout(false); } @@ -324,7 +324,7 @@ private void kbtnLoadPalette_Click(object sender, EventArgs e) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } } @@ -357,7 +357,7 @@ private void kbtnSavePalette_Click(object sender, EventArgs e) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } else diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/ScreenColourPickerDialog.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/ScreenColourPickerDialog.cs index 32fe08892..307356a64 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/ScreenColourPickerDialog.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/UX/ScreenColourPickerDialog.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -74,11 +74,11 @@ private void InitializeComponent() this.cpbSelectedColour = new Krypton.Toolkit.Suite.Extended.Controls.CircularPictureBox(); this.scp = new Krypton.Toolkit.Suite.Extended.Drawing.Utilities.ScreenColourPickerControl(); this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.cpbSelectedColour)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.cpbSelectedColour).BeginInit(); this.SuspendLayout(); // // kryptonPanel1 @@ -142,7 +142,7 @@ private void InitializeComponent() this.ktxtHexValue.MaxLength = 7; this.ktxtHexValue.Name = "ktxtHexValue"; this.ktxtHexValue.Size = new System.Drawing.Size(100, 24); - this.ktxtHexValue.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ktxtHexValue.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.ktxtHexValue.StateCommon.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Inherit; this.ktxtHexValue.TabIndex = 9; this.ktxtHexValue.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -153,25 +153,25 @@ private void InitializeComponent() this.kryptonLabel4.Location = new System.Drawing.Point(210, 206); this.kryptonLabel4.Name = "kryptonLabel4"; this.kryptonLabel4.Size = new System.Drawing.Size(154, 21); - this.kryptonLabel4.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kryptonLabel4.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kryptonLabel4.TabIndex = 8; this.kryptonLabel4.Values.Text = "Hexadecimal Value:"; // // kkcBlue // - this.kkcBlue.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(206)))), ((int)(((byte)(230))))); + this.kkcBlue.BackColor = System.Drawing.Color.FromArgb((int)(byte)187, (int)(byte)206, (int)(byte)230); this.kkcBlue.EndAngle = 405F; - this.kkcBlue.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kkcBlue.ForeColor = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kkcBlue.ImeMode = System.Windows.Forms.ImeMode.On; - this.kkcBlue.KnobBackColour = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(206)))), ((int)(((byte)(230))))); + this.kkcBlue.KnobBackColour = System.Drawing.Color.FromArgb((int)(byte)187, (int)(byte)206, (int)(byte)230); this.kkcBlue.LargeChange = 20; this.kkcBlue.Location = new System.Drawing.Point(325, 39); this.kkcBlue.Maximum = 255; this.kkcBlue.Minimum = 0; this.kkcBlue.Name = "kkcBlue"; - this.kkcBlue.PointerColour = System.Drawing.Color.FromArgb(((int)(((byte)(132)))), ((int)(((byte)(157)))), ((int)(((byte)(189))))); + this.kkcBlue.PointerColour = System.Drawing.Color.FromArgb((int)(byte)132, (int)(byte)157, (int)(byte)189); this.kkcBlue.PointerStyle = Krypton.Toolkit.Suite.Extended.Common.CommonKryptonKnobControlEnhanced.KnobPointerStyles.CIRCLE; - this.kkcBlue.ScaleColour = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kkcBlue.ScaleColour = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kkcBlue.ScaleDivisions = 11; this.kkcBlue.ScaleSubDivisions = 4; this.kkcBlue.ScaleTypeface = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); @@ -186,19 +186,19 @@ private void InitializeComponent() // // kkcGreen // - this.kkcGreen.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(206)))), ((int)(((byte)(230))))); + this.kkcGreen.BackColor = System.Drawing.Color.FromArgb((int)(byte)187, (int)(byte)206, (int)(byte)230); this.kkcGreen.EndAngle = 405F; - this.kkcGreen.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kkcGreen.ForeColor = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kkcGreen.ImeMode = System.Windows.Forms.ImeMode.On; - this.kkcGreen.KnobBackColour = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(206)))), ((int)(((byte)(230))))); + this.kkcGreen.KnobBackColour = System.Drawing.Color.FromArgb((int)(byte)187, (int)(byte)206, (int)(byte)230); this.kkcGreen.LargeChange = 20; this.kkcGreen.Location = new System.Drawing.Point(165, 39); this.kkcGreen.Maximum = 255; this.kkcGreen.Minimum = 0; this.kkcGreen.Name = "kkcGreen"; - this.kkcGreen.PointerColour = System.Drawing.Color.FromArgb(((int)(((byte)(132)))), ((int)(((byte)(157)))), ((int)(((byte)(189))))); + this.kkcGreen.PointerColour = System.Drawing.Color.FromArgb((int)(byte)132, (int)(byte)157, (int)(byte)189); this.kkcGreen.PointerStyle = Krypton.Toolkit.Suite.Extended.Common.CommonKryptonKnobControlEnhanced.KnobPointerStyles.CIRCLE; - this.kkcGreen.ScaleColour = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kkcGreen.ScaleColour = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kkcGreen.ScaleDivisions = 11; this.kkcGreen.ScaleSubDivisions = 4; this.kkcGreen.ScaleTypeface = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); @@ -213,19 +213,19 @@ private void InitializeComponent() // // kkcRed // - this.kkcRed.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(206)))), ((int)(((byte)(230))))); + this.kkcRed.BackColor = System.Drawing.Color.FromArgb((int)(byte)187, (int)(byte)206, (int)(byte)230); this.kkcRed.EndAngle = 405F; - this.kkcRed.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kkcRed.ForeColor = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kkcRed.ImeMode = System.Windows.Forms.ImeMode.On; - this.kkcRed.KnobBackColour = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(206)))), ((int)(((byte)(230))))); + this.kkcRed.KnobBackColour = System.Drawing.Color.FromArgb((int)(byte)187, (int)(byte)206, (int)(byte)230); this.kkcRed.LargeChange = 20; this.kkcRed.Location = new System.Drawing.Point(12, 39); this.kkcRed.Maximum = 255; this.kkcRed.Minimum = 0; this.kkcRed.Name = "kkcRed"; - this.kkcRed.PointerColour = System.Drawing.Color.FromArgb(((int)(((byte)(132)))), ((int)(((byte)(157)))), ((int)(((byte)(189))))); + this.kkcRed.PointerColour = System.Drawing.Color.FromArgb((int)(byte)132, (int)(byte)157, (int)(byte)189); this.kkcRed.PointerStyle = Krypton.Toolkit.Suite.Extended.Common.CommonKryptonKnobControlEnhanced.KnobPointerStyles.CIRCLE; - this.kkcRed.ScaleColour = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kkcRed.ScaleColour = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kkcRed.ScaleDivisions = 11; this.kkcRed.ScaleSubDivisions = 4; this.kkcRed.ScaleTypeface = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); @@ -250,7 +250,7 @@ private void InitializeComponent() this.knudGreen.Size = new System.Drawing.Size(88, 23); this.knudGreen.StateCommon.Back.Color1 = System.Drawing.Color.Green; this.knudGreen.StateCommon.Content.Color1 = System.Drawing.Color.White; - this.knudGreen.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.knudGreen.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.knudGreen.StateCommon.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Inherit; this.knudGreen.TabIndex = 5; this.knudGreen.ValueChanged += new System.EventHandler(this.knudGreen_ValueChanged); @@ -267,7 +267,7 @@ private void InitializeComponent() this.knudBlue.Size = new System.Drawing.Size(88, 23); this.knudBlue.StateCommon.Back.Color1 = System.Drawing.Color.Blue; this.knudBlue.StateCommon.Content.Color1 = System.Drawing.Color.White; - this.knudBlue.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.knudBlue.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.knudBlue.StateCommon.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Inherit; this.knudBlue.TabIndex = 4; this.knudBlue.ValueChanged += new System.EventHandler(this.knudBlue_ValueChanged); @@ -284,7 +284,7 @@ private void InitializeComponent() this.knudRed.Size = new System.Drawing.Size(91, 23); this.knudRed.StateCommon.Back.Color1 = System.Drawing.Color.Red; this.knudRed.StateCommon.Content.Color1 = System.Drawing.Color.White; - this.knudRed.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.knudRed.StateCommon.Content.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0); this.knudRed.StateCommon.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Inherit; this.knudRed.TabIndex = 3; this.knudRed.ValueChanged += new System.EventHandler(this.knudRed_ValueChanged); @@ -304,7 +304,7 @@ private void InitializeComponent() this.klblGreen.Size = new System.Drawing.Size(91, 21); this.klblGreen.StateCommon.ShortText.Color1 = System.Drawing.Color.Green; this.klblGreen.StateCommon.ShortText.Color2 = System.Drawing.Color.Green; - this.klblGreen.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblGreen.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblGreen.TabIndex = 2; this.klblGreen.Values.Text = "Green: 255"; // @@ -315,7 +315,7 @@ private void InitializeComponent() this.klblBlue.Size = new System.Drawing.Size(79, 21); this.klblBlue.StateCommon.ShortText.Color1 = System.Drawing.Color.Blue; this.klblBlue.StateCommon.ShortText.Color2 = System.Drawing.Color.Blue; - this.klblBlue.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblBlue.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblBlue.TabIndex = 1; this.klblBlue.Values.Text = "Blue: 255"; // @@ -326,7 +326,7 @@ private void InitializeComponent() this.klblRed.Size = new System.Drawing.Size(76, 21); this.klblRed.StateCommon.ShortText.Color1 = System.Drawing.Color.Red; this.klblRed.StateCommon.ShortText.Color2 = System.Drawing.Color.Red; - this.klblRed.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.klblRed.StateCommon.ShortText.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.klblRed.TabIndex = 0; this.klblRed.Values.Text = "Red: 255"; // @@ -375,13 +375,13 @@ private void InitializeComponent() this.ShowIcon = false; this.ShowInTaskbar = false; this.Text = "Select a Colour"; - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); this.kryptonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.cpbSelectedColour)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.cpbSelectedColour).EndInit(); this.ResumeLayout(false); } @@ -473,7 +473,7 @@ private void knudBlue_ValueChanged(object sender, EventArgs e) private void ktxtHexValue_TextChanged(object sender, EventArgs e) { - if (ktxtHexValue.Text.Length == 3 || ktxtHexValue.Text.Length <= 6) + if (ktxtHexValue.Text.Length is 3 or <= 6) { UpdateColourValues(ColorTranslator.FromHtml(ktxtHexValue.Text)); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Values/ColourButtonValues.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Values/ColourButtonValues.cs index bae551cfd..0ae8b8163 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Values/ColourButtonValues.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Values/ColourButtonValues.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -32,7 +32,9 @@ public class ColourButtonValues : Storage, IContentValues #region Fields private Color _transparent, _selectedColour, _emptyBorderColour; - private Image _image, _sourceImage, _compositeImage; + private Image _image; + private Image? _sourceImage; + private Image? _compositeImage; private Rectangle _selectedRect; @@ -85,11 +87,11 @@ public ColourButtonValues(NeedPaintHandler needPaint) #region IsDefault [Browsable(false)] - public override bool IsDefault => (ImageStates.IsDefault && - (Image == _defaultImage) && - (ImageTransparentColour == Color.Empty) && - (Text == DEFAULT_TEXT) && - (ExtraText == _defaultExtraText)); + public override bool IsDefault => ImageStates.IsDefault && + Image == _defaultImage && + ImageTransparentColour == Color.Empty && + Text == DEFAULT_TEXT && + ExtraText == _defaultExtraText; #endregion #region Image @@ -99,7 +101,7 @@ public ColourButtonValues(NeedPaintHandler needPaint) [Localizable(true)] [Category("Visuals")] [Description("Button image.")] - [RefreshPropertiesAttribute(RefreshProperties.All)] + [RefreshProperties(RefreshProperties.All)] public Image Image { get => _image; @@ -135,8 +137,8 @@ public void ResetImage() [Localizable(true)] [Category("Visuals")] [Description("Label image transparent color.")] - [RefreshPropertiesAttribute(RefreshProperties.All)] - [KryptonDefaultColorAttribute()] + [RefreshProperties(RefreshProperties.All)] + [KryptonDefaultColor()] public Color ImageTransparentColour { get => _transparent; @@ -197,7 +199,7 @@ private bool ShouldSerializeImageStates() [Localizable(true)] [Category("Visuals")] [Description("Button text.")] - [RefreshPropertiesAttribute(RefreshProperties.All)] + [RefreshProperties(RefreshProperties.All)] [Editor("System.ComponentModel.Design.MultilineStringEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))] public string Text { @@ -209,7 +211,7 @@ public string Text { _text = value; PerformNeedPaint(true); - TextChanged?.Invoke(this, EventArgs.Empty); + TextChanged.Invoke(this, EventArgs.Empty); } } } @@ -235,7 +237,7 @@ public void ResetText() [Localizable(true)] [Category("Visuals")] [Description("Button extra text.")] - [RefreshPropertiesAttribute(RefreshProperties.All)] + [RefreshProperties(RefreshProperties.All)] [Editor("System.ComponentModel.Design.MultilineStringEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))] [DefaultValue("")] public string ExtraText @@ -332,10 +334,10 @@ internal Rectangle SelectedRect /// /// The state for which the image is needed. /// Image value. - public virtual Image GetImage(PaletteState state) + public virtual Image? GetImage(PaletteState state) { #pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type. - Image image = null; + Image? image = null; #pragma warning restore CS8600 // Converting null literal or possible null value to non-nullable type. // Try and find a state specific image @@ -362,7 +364,7 @@ public virtual Image GetImage(PaletteState state) } // Do we need to create another composite image? - if ((_sourceImage != image) || (_compositeImage == null)) + if (_sourceImage != image || _compositeImage == null) { // Remember image used to create the composite image _sourceImage = image; @@ -376,7 +378,7 @@ public virtual Image GetImage(PaletteState state) else { // Create a copy of the source image - Bitmap copyBitmap = new Bitmap(image); + Bitmap? copyBitmap = new Bitmap(image); // Paint over the image with a color indicator using (Graphics g = Graphics.FromImage(copyBitmap)) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Values/ViewDrawButtonExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Values/ViewDrawButtonExtended.cs index b86ead4f8..0c258a5ea 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Values/ViewDrawButtonExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Values/ViewDrawButtonExtended.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -128,12 +128,12 @@ public ViewDrawButtonExtended(IPaletteTriple paletteDisabled, _drawOuterSeparator = new ViewLayoutSeparator(1); // Create the view used to draw the split edge - _edgeRedirect = new PaletteBorderEdgeRedirect(_paletteNormal.PaletteBorder, null); + _edgeRedirect = new PaletteBorderEdgeRedirect(_paletteNormal.PaletteBorder!, null); _drawSplitBorder = new ViewDrawBorderEdge(new PaletteBorderEdge(_edgeRedirect, null), CommonHelper.VisualToOrientation(orientation)); // Our view contains background and border with content inside _drawContent = new ViewDrawContent(_paletteNormal.PaletteContent, buttonValues, orientation); - _drawCanvas = new ViewDrawSplitCanvas(_paletteNormal.PaletteBack, _paletteNormal.PaletteBorder, paletteMetric, PaletteMetricPadding.None, orientation); + _drawCanvas = new ViewDrawSplitCanvas(_paletteNormal.PaletteBack, _paletteNormal.PaletteBorder!, paletteMetric, PaletteMetricPadding.None, orientation); // Use a docker layout to organize the contents of the canvas LayoutDocker = new ViewLayoutDocker @@ -287,7 +287,7 @@ public bool Splitter /// /// Gets and sets the source for button values. /// - public IContentValues ButtonValues + public IContentValues? ButtonValues { get => _drawContent.Values; set => _drawContent.Values = value; @@ -325,7 +325,7 @@ public override bool Enabled { base.Enabled = value; - if (Enabled && (ElementState == PaletteState.Disabled)) + if (Enabled && ElementState == PaletteState.Disabled) { ElementState = Checked ? PaletteState.CheckedNormal : PaletteState.Normal; } @@ -392,17 +392,6 @@ public bool UseMnemonic #endregion - #region DrawButtonComposition - /// - /// Gets and sets the composition usage of the button. - /// - public bool DrawButtonComposition - { - get => _drawCanvas.DrawCanvasOnComposition; - set => _drawCanvas.DrawCanvasOnComposition = value; - } - #endregion - #region TestForFocusCues /// /// Gets and sets the use of focus cues for deciding if focus rects are allowed. @@ -427,18 +416,16 @@ public void SetPalettes(IPaletteTriple paletteDisabled, IPaletteTriple paletteTracking, IPaletteTriple palettePressed) { - Debug.Assert(paletteDisabled != null); - Debug.Assert(paletteNormal != null); - Debug.Assert(paletteTracking != null); - Debug.Assert(palettePressed != null); + System.Diagnostics.Debug.Assert(paletteDisabled != null); + System.Diagnostics.Debug.Assert(paletteNormal != null); + System.Diagnostics.Debug.Assert(paletteTracking != null); + System.Diagnostics.Debug.Assert(palettePressed != null); // Remember the new palette settings -#pragma warning disable CS8601 // Possible null reference assignment. - _paletteDisabled = paletteDisabled; - _paletteNormal = paletteNormal; - _paletteTracking = paletteTracking; - _palettePressed = palettePressed; -#pragma warning restore CS8601 // Possible null reference assignment. + _paletteDisabled = paletteDisabled!; + _paletteNormal = paletteNormal!; + _paletteTracking = paletteTracking!; + _palettePressed = palettePressed!; // Must force update of palettes to use latest ones provided _forcePaletteUpdate = true; @@ -454,9 +441,9 @@ public void SetCheckedPalettes(IPaletteTriple paletteCheckedNormal, IPaletteTriple paletteCheckedTracking, IPaletteTriple paletteCheckedPressed) { - Debug.Assert(paletteCheckedNormal != null); - Debug.Assert(paletteCheckedTracking != null); - Debug.Assert(paletteCheckedPressed != null); + System.Diagnostics.Debug.Assert(paletteCheckedNormal != null); + System.Diagnostics.Debug.Assert(paletteCheckedTracking != null); + System.Diagnostics.Debug.Assert(paletteCheckedPressed != null); // Remember the new palette settings #pragma warning disable CS8601 // Possible null reference assignment. @@ -473,7 +460,7 @@ public void SetCheckedPalettes(IPaletteTriple paletteCheckedNormal, #region Evaluation public override bool EvalTransparentPaint(ViewContext context) { - Debug.Assert(context != null); + System.Diagnostics.Debug.Assert(context != null); // Ensure that child elements have correct palette state #pragma warning disable CS8604 // Possible null reference argument. @@ -488,8 +475,8 @@ public override bool EvalTransparentPaint(ViewContext context) #region Layout public override Size GetPreferredSize(ViewLayoutContext context) { - Debug.Assert(context != null); - Debug.Assert(_drawCanvas != null); + System.Diagnostics.Debug.Assert(context != null); + System.Diagnostics.Debug.Assert(_drawCanvas != null); // Ensure that child elements have correct palette state #pragma warning disable CS8604 // Possible null reference argument. @@ -504,7 +491,7 @@ public override Size GetPreferredSize(ViewLayoutContext context) public override void Layout(ViewLayoutContext context) { - Debug.Assert(context != null); + System.Diagnostics.Debug.Assert(context != null); // Validate incoming reference if (context == null) @@ -576,13 +563,13 @@ public override void Layout(ViewLayoutContext context) #region Paint public override void Render(RenderContext context) { - Debug.Assert(context != null); + System.Diagnostics.Debug.Assert(context != null); // Ensure that child elements have correct palette state - CheckPaletteState(context); + CheckPaletteState(context!); // Let base class perform standard rendering - base.Render(context); + base.Render(context!); } #endregion @@ -593,7 +580,7 @@ protected virtual void CheckPaletteState(ViewContext context) PaletteState buttonState = State; // If the actual control is not enabled, force to disabled state - if (!IsFixed && !context.Control.Enabled) + if (context.Control != null && !IsFixed && !context.Control.Enabled) { buttonState = PaletteState.Disabled; } @@ -604,7 +591,7 @@ protected virtual void CheckPaletteState(ViewContext context) // Is the checked button allowed to become unchecked if (AllowUncheck) { - // Show feedback on tracking and presssed + // Show feedback on tracking and pressed switch (buttonState) { case PaletteState.Normal: @@ -626,7 +613,7 @@ protected virtual void CheckPaletteState(ViewContext context) } // If the child elements are not in correct state - if (_forcePaletteUpdate || (_drawCanvas.ElementState != buttonState)) + if (_forcePaletteUpdate || _drawCanvas.ElementState != buttonState) { // No longer need to force the palettes to be updated _forcePaletteUpdate = false; @@ -663,14 +650,14 @@ protected virtual void CheckPaletteState(ViewContext context) break; default: // Should never happen! - Debug.Assert(false); + System.Diagnostics.Debug.Assert(false); break; } // Update with the correct palettes - _drawCanvas.SetPalettes(CurrentPalette.PaletteBack, CurrentPalette.PaletteBorder); - _drawContent.SetPalette(CurrentPalette.PaletteContent); - _edgeRedirect.SetPalette(CurrentPalette.PaletteBorder); + _drawCanvas.SetPalettes(CurrentPalette.PaletteBack, CurrentPalette.PaletteBorder!); + _drawContent.SetPalette(CurrentPalette.PaletteContent!); + _edgeRedirect.SetPalette(CurrentPalette.PaletteBorder!); } } #endregion @@ -684,7 +671,7 @@ private void UpdateDropDown() _drawCanvas.Splitter = _splitter & _dropDown; ViewDockStyle dockStyle = ViewDockStyle.Right; - System.Windows.Forms.Orientation splitOrientation = System.Windows.Forms.Orientation.Vertical; + Orientation splitOrientation = System.Windows.Forms.Orientation.Vertical; switch (_dropDownPosition) { case VisualOrientation.Top: diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Classes/ColourHandler.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Classes/ColourHandler.cs index 20b566c11..fc7965e00 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Classes/ColourHandler.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Classes/ColourHandler.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -130,7 +130,7 @@ public static RGB HSVtoRGB(HSV HSV) // Scale Hue to be between 0 and 360. Saturation // and value scale to be between 0 and 1. - h = ((double)HSV.Hue / 255 * 360) % 360; + h = (double)HSV.Hue / 255 * 360 % 360; s = (double)HSV.Saturation / 255; v = (double)HSV.value / 255; @@ -155,7 +155,7 @@ public static RGB HSVtoRGB(HSV HSV) // The color wheel consists of 6 sectors. // Figure out which sector you//re in. sectorPos = h / 60; - sectorNumber = (int)(Math.Floor(sectorPos)); + sectorNumber = (int)Math.Floor(sectorPos); // get the fractional part of the sector. // That is, how many degrees into the sector @@ -165,8 +165,8 @@ public static RGB HSVtoRGB(HSV HSV) // Calculate values for the three axes // of the color. p = v * (1 - s); - q = v * (1 - (s * fractionalSector)); - t = v * (1 - (s * (1 - fractionalSector))); + q = v * (1 - s * fractionalSector); + t = v * (1 - s * (1 - fractionalSector)); // Assign the fractional colors to r, g, and b // based on the sector the angle is in. diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Classes/DrawingMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Classes/DrawingMethods.cs index ee16fdfed..51e264737 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Classes/DrawingMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Classes/DrawingMethods.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -37,7 +37,7 @@ public static void DrawLinearGradientTwoParts(Graphics g, Rectangle rect, Color upbounds = rect; downbounds = rect; - upbounds.Height = (rect.Height / 2); + upbounds.Height = rect.Height / 2; upbounds.Width = rect.Width - 0; upbounds.X = rect.X + 0; upbounds.Y = rect.Y + 0; @@ -89,7 +89,7 @@ public static void DrawStatusBlend(Graphics g, Rectangle rect, Color LightColor, RectangleF backRect = new RectangleF(0, 1.5f, rect.Width, rect.Height - 2); // Cannot paint a zero sized area - if ((backRect.Width > 0) && (backRect.Height > 0)) + if (backRect.Width > 0 && backRect.Height > 0) { using (LinearGradientBrush backBrush = new LinearGradientBrush(backRect, LightColor, @@ -494,7 +494,7 @@ public static void DrawTabHeader(Graphics g, PointF[] pt, Rectangle rect, Color //check on all whites - if ((MiddleColour == Color.White) && (DarkColour == Color.White)) + if (MiddleColour == Color.White && DarkColour == Color.White) { MiddleColour = Color.WhiteSmoke; DarkColour = Color.Snow; @@ -533,7 +533,7 @@ public static GraphicsPath GetTabRoundedPath(Rectangle bounds, int radius, TabAl { bounds.Offset(1, 1); bounds.Width -= 2; - if ((Status != TabHeaderStatus.HotSelected) && (Status != TabHeaderStatus.Selected)) + if (Status != TabHeaderStatus.HotSelected && Status != TabHeaderStatus.Selected) { bounds.Height -= 2; } @@ -544,7 +544,7 @@ public static GraphicsPath GetTabRoundedPath(Rectangle bounds, int radius, TabAl case TabAlignment.Bottom: if (IsForBorder) { - if ((Status != TabHeaderStatus.HotSelected) && (Status != TabHeaderStatus.Selected)) + if (Status != TabHeaderStatus.HotSelected && Status != TabHeaderStatus.Selected) { bounds.Offset(1, +1); bounds.Height -= 2; @@ -563,7 +563,7 @@ public static GraphicsPath GetTabRoundedPath(Rectangle bounds, int radius, TabAl { bounds.Offset(1, 1); bounds.Height -= 2; - if ((Status != TabHeaderStatus.HotSelected) && (Status != TabHeaderStatus.Selected)) + if (Status != TabHeaderStatus.HotSelected && Status != TabHeaderStatus.Selected) { bounds.Width -= 2; } @@ -574,7 +574,7 @@ public static GraphicsPath GetTabRoundedPath(Rectangle bounds, int radius, TabAl case TabAlignment.Right: if (IsForBorder) { - if ((Status != TabHeaderStatus.HotSelected) && (Status != TabHeaderStatus.Selected)) + if (Status != TabHeaderStatus.HotSelected && Status != TabHeaderStatus.Selected) { bounds.Offset(1, 1); bounds.Width -= 2; @@ -603,7 +603,7 @@ public static Point[] GetTabSquaredPoints(Rectangle bounds, int cornerWidth, Tab { bounds.Offset(1, 1); bounds.Width -= 2; - if ((Status != TabHeaderStatus.HotSelected) && (Status != TabHeaderStatus.Selected)) + if (Status != TabHeaderStatus.HotSelected && Status != TabHeaderStatus.Selected) { bounds.Height -= 2; } @@ -614,7 +614,7 @@ public static Point[] GetTabSquaredPoints(Rectangle bounds, int cornerWidth, Tab case TabAlignment.Bottom: if (IsForBorder) { - if ((Status != TabHeaderStatus.HotSelected) && (Status != TabHeaderStatus.Selected)) + if (Status != TabHeaderStatus.HotSelected && Status != TabHeaderStatus.Selected) { bounds.Offset(1, +1); bounds.Height -= 2; @@ -633,7 +633,7 @@ public static Point[] GetTabSquaredPoints(Rectangle bounds, int cornerWidth, Tab { bounds.Offset(1, 1); bounds.Height -= 2; - if ((Status != TabHeaderStatus.HotSelected) && (Status != TabHeaderStatus.Selected)) + if (Status != TabHeaderStatus.HotSelected && Status != TabHeaderStatus.Selected) { bounds.Width -= 2; } @@ -644,7 +644,7 @@ public static Point[] GetTabSquaredPoints(Rectangle bounds, int cornerWidth, Tab case TabAlignment.Right: if (IsForBorder) { - if ((Status != TabHeaderStatus.HotSelected) && (Status != TabHeaderStatus.Selected)) + if (Status != TabHeaderStatus.HotSelected && Status != TabHeaderStatus.Selected) { bounds.Offset(1, 1); bounds.Width -= 2; @@ -671,7 +671,7 @@ public static Point[] GetSquaredTopPoints(Rectangle recBounds, int cornerWidth, pt[2] = new Point(recBounds.Left + cornerLeftWidth, recBounds.Top + allowSelectedTabHighSize); //little lower pt[3] = new Point(recBounds.Right - cornerRightWidth, recBounds.Top + allowSelectedTabHighSize); //little lower pt[4] = new Point(recBounds.Right, recBounds.Top + cornerRightWidth + allowSelectedTabHighSize); //little lower - if ((Appearance == TabAppearance.Normal) && ((Status == DrawingMethods.TabHeaderStatus.Selected) || (Status == DrawingMethods.TabHeaderStatus.HotSelected))) + if (Appearance == TabAppearance.Normal && Status is DrawingMethods.TabHeaderStatus.Selected or DrawingMethods.TabHeaderStatus.HotSelected) { //a litte Higher if selected pt[1] = new Point(pt[1].X, pt[1].Y - allowSelectedTabHighSize); pt[2] = new Point(pt[2].X, pt[2].Y - allowSelectedTabHighSize); @@ -696,7 +696,7 @@ public static Point[] GetSquaredBottomPoints(Rectangle recBounds, int cornerWidt pt[3] = new Point(recBounds.Right - cornerRightWidth, recBounds.Bottom - allowSelectedTabHighSize);//little lower pt[4] = new Point(recBounds.Left + cornerLeftWidth, recBounds.Bottom - allowSelectedTabHighSize);//little lower pt[5] = new Point(recBounds.Left, recBounds.Bottom - cornerLeftWidth - allowSelectedTabHighSize);//little lower - if ((Appearance == TabAppearance.Normal) && ((Status == DrawingMethods.TabHeaderStatus.Selected) || (Status == DrawingMethods.TabHeaderStatus.HotSelected))) + if (Appearance == TabAppearance.Normal && Status is DrawingMethods.TabHeaderStatus.Selected or DrawingMethods.TabHeaderStatus.HotSelected) { //a litte Higher if selected pt[2] = new Point(pt[2].X, pt[2].Y + allowSelectedTabHighSize); pt[3] = new Point(pt[3].X, pt[3].Y + allowSelectedTabHighSize); @@ -780,7 +780,7 @@ public static void DrawListViewHeader2(Graphics g, Rectangle rect, Color LightCo Rectangle Newrect = new Rectangle(rect.X, rect.Y + HalfSize, rect.Width, rect.Height - HalfSize); //check on all whites - if ((MiddleColour == Color.White) && (DarkColour == Color.White)) + if (MiddleColour == Color.White && DarkColour == Color.White) { MiddleColour = Color.WhiteSmoke; DarkColour = Color.Snow; @@ -1234,19 +1234,19 @@ public enum PaletteColourStyle public static Color ColourFromAHSB(int Alpha, float Hue, float Saturation, float Brightness) { - if (0 > Alpha || 255 < Alpha) + if (Alpha is < 0 or > 255) { throw new ArgumentOutOfRangeException("a", Alpha, "InvalidAlpha"); } - if (0f > Hue || 360f < Hue) + if (Hue is < 0f or > 360f) { throw new ArgumentOutOfRangeException("h", Hue, "InvalidHue"); } - if (0f > Saturation || 1f < Saturation) + if (Saturation is < 0f or > 1f) { throw new ArgumentOutOfRangeException("s", Saturation, "InvalidSaturation"); } - if (0f > Brightness || 1f < Brightness) + if (Brightness is < 0f or > 1f) { throw new ArgumentOutOfRangeException("b", Brightness, "InvalidBrightness"); } @@ -1262,13 +1262,13 @@ public static Color ColourFromAHSB(int Alpha, float Hue, float Saturation, float if (0.5 < Brightness) { - fMax = Brightness - (Brightness * Saturation) + Saturation; - fMin = Brightness + (Brightness * Saturation) - Saturation; + fMax = Brightness - Brightness * Saturation + Saturation; + fMin = Brightness + Brightness * Saturation - Saturation; } else { - fMax = Brightness + (Brightness * Saturation); - fMin = Brightness - (Brightness * Saturation); + fMax = Brightness + Brightness * Saturation; + fMin = Brightness - Brightness * Saturation; } iSextant = (int)Math.Floor(Hue / 60f); @@ -1277,7 +1277,7 @@ public static Color ColourFromAHSB(int Alpha, float Hue, float Saturation, float Hue -= 360f; } Hue /= 60f; - Hue -= 2f * (float)Math.Floor(((iSextant + 1f) % 6f) / 2f); + Hue -= 2f * (float)Math.Floor((iSextant + 1f) % 6f / 2f); if (0 == iSextant % 2) { fMid = Hue * (fMax - fMin) + fMin; @@ -1326,7 +1326,7 @@ public static GraphicsPath GetRoundedTopPath(Rectangle bounds, int radius, TabAp int width = bounds.Width; int height = bounds.Height; GraphicsPath graphicsPath = new GraphicsPath(); - if ((Appearance == TabAppearance.Normal) && ((Status == DrawingMethods.TabHeaderStatus.Selected) || (Status == DrawingMethods.TabHeaderStatus.HotSelected))) + if (Appearance == TabAppearance.Normal && Status is DrawingMethods.TabHeaderStatus.Selected or DrawingMethods.TabHeaderStatus.HotSelected) { //graphicsPath.AddLine(x, y + height, x, y - radius); //Left Line graphicsPath.AddArc(x, y, radius, radius, 180, 90); //Upper left corner @@ -1359,7 +1359,7 @@ public static GraphicsPath GetRoundedBottomPath(Rectangle bounds, int radius, Ta int height = bounds.Height; GraphicsPath graphicsPath = new GraphicsPath(); - if ((Appearance == TabAppearance.Normal) && ((Status == DrawingMethods.TabHeaderStatus.Selected) || (Status == DrawingMethods.TabHeaderStatus.HotSelected))) + if (Appearance == TabAppearance.Normal && Status is DrawingMethods.TabHeaderStatus.Selected or DrawingMethods.TabHeaderStatus.HotSelected) { //girare sempre in senso orario graphicsPath.AddLine(x, y, x + width, y); //top diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Classes/Knob/KryptonKnobUtilities.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Classes/Knob/KryptonKnobUtilities.cs index 402e8092f..0a5603fbc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Classes/Knob/KryptonKnobUtilities.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Classes/Knob/KryptonKnobUtilities.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Globals/GlobalDeclarations.cs index 0e1a07f05..5eefbe3d6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Krypton.Toolkit.Suite.Extended.Drawing 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Krypton.Toolkit.Suite.Extended.Drawing 2022.csproj index 99e3bef82..cd9b3d9d7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Krypton.Toolkit.Suite.Extended.Drawing 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Krypton.Toolkit.Suite.Extended.Drawing 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -70,9 +58,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements base drawing utilities. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements base drawing utilities. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -80,74 +68,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Krypton.Toolkit.Suite.Extended.Drawing.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Krypton.Toolkit.Suite.Extended.Drawing.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Krypton.Toolkit.Suite.Extended.Drawing.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Krypton.Toolkit.Suite.Extended.Drawing.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Classes/Fading/FadeController.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Classes/Fading/FadeController.cs index 557322b21..5fec9574c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Classes/Fading/FadeController.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Classes/Fading/FadeController.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -84,7 +84,7 @@ private void UpdateOpacity() case FadeDirection.In: if (form.Opacity < 1.0) { - form.Opacity += (fadeSpeed / 1000.0); + form.Opacity += fadeSpeed / 1000.0; } else { @@ -97,7 +97,7 @@ private void UpdateOpacity() case FadeDirection.Out: if (form.Opacity > 0.1) { - form.Opacity -= (fadeSpeed / 1000.0); + form.Opacity -= fadeSpeed / 1000.0; } else { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Classes/Fading/FadeSpeed.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Classes/Fading/FadeSpeed.cs index c2ac72bef..d9f2540c5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Classes/Fading/FadeSpeed.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Classes/Fading/FadeSpeed.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Components/Fading/FadeManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Components/Fading/FadeManager.cs index f9528cdd3..07eee49c1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Components/Fading/FadeManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Components/Fading/FadeManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Enumerations/FadeDirection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Enumerations/FadeDirection.cs index 3dcdf6366..ad8bcd646 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Enumerations/FadeDirection.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Enumerations/FadeDirection.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Enumerations/FadeSpeedChoice.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Enumerations/FadeSpeedChoice.cs index 2c07f04f4..c5024e2da 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Enumerations/FadeSpeedChoice.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Enumerations/FadeSpeedChoice.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Globals/GlobalDeclarations.cs index 037a8b423..ac74e7a75 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Globals/GlobalDeclarations.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Krypton.Toolkit.Suite.Extended.Effects 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Krypton.Toolkit.Suite.Extended.Effects 2022.csproj index adbebd54a..dd29a2a02 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Krypton.Toolkit.Suite.Extended.Effects 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Krypton.Toolkit.Suite.Extended.Effects 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -70,9 +58,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements additional effects, to be used in conjunction with the standard toolkit. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements additional effects, to be used in conjunction with the standard toolkit. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -80,74 +68,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Krypton.Toolkit.Suite.Extended.Effects.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Krypton.Toolkit.Suite.Extended.Effects.licenseheader index c890e86c0..a0e5e0a62 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Krypton.Toolkit.Suite.Extended.Effects.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Krypton.Toolkit.Suite.Extended.Effects.licenseheader @@ -4,7 +4,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Core/ConfigException.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Core/ConfigException.cs index c9b2720d8..a1424ad72 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Core/ConfigException.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Core/ConfigException.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Core/ExceptionReporterExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Core/ExceptionReporterExtensions.cs index 68fa85b1f..302a223d4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Core/ExceptionReporterExtensions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Core/ExceptionReporterExtensions.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Core/FileSaveResult.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Core/FileSaveResult.cs index 802ca4f89..67a87ba46 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Core/FileSaveResult.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Core/FileSaveResult.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Core/FileService.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Core/FileService.cs index 23e73a33d..e4d99aba9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Core/FileService.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Core/FileService.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/General/ExceptionReportInfo.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/General/ExceptionReportInfo.cs index 5ea27ba7f..fb40119a5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/General/ExceptionReportInfo.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/General/ExceptionReportInfo.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/General/ExceptionReporterBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/General/ExceptionReporterBase.cs index ee50b9b76..c61a5d889 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/General/ExceptionReporterBase.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/General/ExceptionReporterBase.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/General/ReportGenerator.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/General/ReportGenerator.cs index 0e82a95a6..617088f87 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/General/ReportGenerator.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/General/ReportGenerator.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/General/WinFormsExceptionReporter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/General/WinFormsExceptionReporter.cs index 312658226..9aaf8fcc1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/General/WinFormsExceptionReporter.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/General/WinFormsExceptionReporter.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/MVP/Presenters/ExceptionReportPresenter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/MVP/Presenters/ExceptionReportPresenter.cs index 666944d6b..e56dedae6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/MVP/Presenters/ExceptionReportPresenter.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/MVP/Presenters/ExceptionReportPresenter.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Mail/AttachAdapter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Mail/AttachAdapter.cs index 6d622cc24..d51986887 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Mail/AttachAdapter.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Mail/AttachAdapter.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Mail/Attacher.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Mail/Attacher.cs index dd181c40e..fcd479798 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Mail/Attacher.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Mail/Attacher.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Mail/EmailReporter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Mail/EmailReporter.cs index ce8db367b..dc97e8675 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Mail/EmailReporter.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Mail/EmailReporter.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Events/ConsoleSendEvent.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Events/ConsoleSendEvent.cs index e66e220bf..d21d0d9f5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Events/ConsoleSendEvent.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Events/ConsoleSendEvent.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Events/SilentSendEvent.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Events/SilentSendEvent.cs index 9c86ae601..02c4d98fc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Events/SilentSendEvent.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Events/SilentSendEvent.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/ReportPacket.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/ReportPacket.cs index 6382de0db..ab0361902 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/ReportPacket.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/ReportPacket.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/SenderFactory.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/SenderFactory.cs index 870581515..f686893ca 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/SenderFactory.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/SenderFactory.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/GhostSender.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/GhostSender.cs index 48921c8ae..625433926 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/GhostSender.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/GhostSender.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/MailSender.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/MailSender.cs index c53b293e1..d5015973e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/MailSender.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/MailSender.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/MapiMailSender.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/MapiMailSender.cs index b65175abd..437a327bc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/MapiMailSender.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/MapiMailSender.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/SmtpMailSender.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/SmtpMailSender.cs index 0c507e2ef..aefbad952 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/SmtpMailSender.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/SmtpMailSender.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/WebServiceSender.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/WebServiceSender.cs index 7166c4ad2..76e54f129 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/WebServiceSender.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Network/Senders/WebServiceSender.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Report/AssemblyDigger.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Report/AssemblyDigger.cs index 1520e62a3..ddb233d17 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Report/AssemblyDigger.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Report/AssemblyDigger.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Report/NoScreenShot.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Report/NoScreenShot.cs index 0e8d9fef4..a12ff94e8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Report/NoScreenShot.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Report/NoScreenShot.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Report/ReportBuilder.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Report/ReportBuilder.cs index 8a19299bf..db4beb517 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Report/ReportBuilder.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Report/ReportBuilder.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Report/StackTraceMaker.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Report/StackTraceMaker.cs index 9fb44f957..b2138d5e0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Report/StackTraceMaker.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Report/StackTraceMaker.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -66,7 +66,7 @@ private string StackTrace(Exception exception) } else { - stringBuilder.AppendLine($"Inner Exception {(count - 1)}"); + stringBuilder.AppendLine($"Inner Exception {count - 1}"); } stringBuilder diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoQueries.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoQueries.cs index 1c6048c52..b202735eb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoQueries.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoQueries.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoQuery.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoQuery.cs index 4f9daef57..6aa389771 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoQuery.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoQuery.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoResult.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoResult.cs index 8d3ad8d11..dd0c2ebf9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoResult.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoResult.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoResultMapper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoResultMapper.cs index 30542718a..4d4022b34 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoResultMapper.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoResultMapper.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoRetriever.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoRetriever.cs index d92980ee8..7be92956c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoRetriever.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/System Information/SysInfoRetriever.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/App.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/App.cs index f39108ee9..c8cdb3c6b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/App.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/App.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/AssemblyRef.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/AssemblyRef.cs index 30f24c2cf..ff5ace710 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/AssemblyRef.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/AssemblyRef.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/EmailIntroModel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/EmailIntroModel.cs index a4ace0d94..f90234088 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/EmailIntroModel.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/EmailIntroModel.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/Error.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/Error.cs index 893e4fe21..2c2e0721a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/Error.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/Error.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/ReportModel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/ReportModel.cs index b1448518a..165ea6350 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/ReportModel.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/ReportModel.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/TemplateRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/TemplateRenderer.cs index 85ded86a8..fc3660414 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/TemplateRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Templates/TemplateRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Windows Forms/DefaultWinFormsViewmaker.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Windows Forms/DefaultWinFormsViewmaker.cs index 674097067..3ec739543 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Windows Forms/DefaultWinFormsViewmaker.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Windows Forms/DefaultWinFormsViewmaker.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Windows Forms/SysInfoResultMapperWinForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Windows Forms/SysInfoResultMapperWinForm.cs index 7cc91f584..b869c06a3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Windows Forms/SysInfoResultMapperWinForm.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Windows Forms/SysInfoResultMapperWinForm.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Windows Forms/WinFormsScreenShooter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Windows Forms/WinFormsScreenShooter.cs index c93d762af..c37c0b034 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Windows Forms/WinFormsScreenShooter.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Windows Forms/WinFormsScreenShooter.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Windows Forms/WinformsClipboard.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Windows Forms/WinformsClipboard.cs index fbc1ef400..ae67f3ecc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Windows Forms/WinformsClipboard.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Windows Forms/WinformsClipboard.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Zip/ReportFileZipper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Zip/ReportFileZipper.cs index 363b4f040..ebadf8f12 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Zip/ReportFileZipper.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Zip/ReportFileZipper.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Zip/ZipAttachmentService.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Zip/ZipAttachmentService.cs index ff4366a45..e42394b2b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Zip/ZipAttachmentService.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Zip/ZipAttachmentService.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Zip/Zipper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Zip/Zipper.cs index c42eb5c10..f81d8a811 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Zip/Zipper.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Classes/Zip/Zipper.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Components/MVP/Views/ExceptionDetailControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Components/MVP/Views/ExceptionDetailControl.cs index c3b73331e..6a26792e1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Components/MVP/Views/ExceptionDetailControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Components/MVP/Views/ExceptionDetailControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -45,7 +45,7 @@ private void InitializeComponent() this.ktxtExceptionTabMessage = new Krypton.Toolkit.KryptonTextBox(); this.kryptonLabel2 = new Krypton.Toolkit.KryptonLabel(); this.ktxtStackTrace = new Krypton.Toolkit.KryptonTextBox(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); this.SuspendLayout(); // @@ -64,17 +64,12 @@ private void InitializeComponent() // // klvExceptions // - this.klvExceptions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.klvExceptions.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left + | System.Windows.Forms.AnchorStyles.Right); this.klvExceptions.HideSelection = false; - this.klvExceptions.ItemStyle = Krypton.Toolkit.ButtonStyle.ListItem; this.klvExceptions.Location = new System.Drawing.Point(4, 4); this.klvExceptions.Name = "klvExceptions"; - this.klvExceptions.OwnerDraw = true; this.klvExceptions.Size = new System.Drawing.Size(607, 120); - this.klvExceptions.StateCommon.Item.Content.ShortText.MultiLine = Krypton.Toolkit.InheritBool.True; - this.klvExceptions.StateCommon.Item.Content.ShortText.MultiLineH = Krypton.Toolkit.PaletteRelativeAlign.Center; - this.klvExceptions.StateCommon.Item.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.klvExceptions.TabIndex = 0; // // kryptonLabel1 @@ -88,9 +83,9 @@ private void InitializeComponent() // // ktxtExceptionTabMessage // - this.ktxtExceptionTabMessage.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.ktxtExceptionTabMessage.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom + | System.Windows.Forms.AnchorStyles.Left + | System.Windows.Forms.AnchorStyles.Right); this.ktxtExceptionTabMessage.Location = new System.Drawing.Point(20, 158); this.ktxtExceptionTabMessage.Multiline = true; this.ktxtExceptionTabMessage.Name = "ktxtExceptionTabMessage"; @@ -110,9 +105,9 @@ private void InitializeComponent() // // ktxtStackTrace // - this.ktxtStackTrace.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.ktxtStackTrace.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom + | System.Windows.Forms.AnchorStyles.Left + | System.Windows.Forms.AnchorStyles.Right); this.ktxtStackTrace.Location = new System.Drawing.Point(20, 243); this.ktxtStackTrace.Multiline = true; this.ktxtStackTrace.Name = "ktxtStackTrace"; @@ -125,7 +120,7 @@ private void InitializeComponent() this.Controls.Add(this.kryptonPanel1); this.Name = "ExceptionDetailControl"; this.Size = new System.Drawing.Size(614, 535); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); this.ResumeLayout(false); @@ -215,7 +210,7 @@ private static void AddTargetSite(ListViewItem lvi, Exception exception) private void WireUpEvents() { - klvExceptions.SelectedIndexChanged += ExceptionsSelectedIndexChanged; + //? klvExceptions.SelectedIndexChanged += ExceptionsSelectedIndexChanged; } private void ExceptionsSelectedIndexChanged(object sender, EventArgs e) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Components/Network/Senders/ExceptionReporterWebClient.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Components/Network/Senders/ExceptionReporterWebClient.cs index c62e9fbc9..11f26c4d8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Components/Network/Senders/ExceptionReporterWebClient.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Components/Network/Senders/ExceptionReporterWebClient.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Enumerations/ReportSendMethod.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Enumerations/ReportSendMethod.cs index fcb09fe10..cba3c7d95 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Enumerations/ReportSendMethod.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Enumerations/ReportSendMethod.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Enumerations/TemplateFormat.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Enumerations/TemplateFormat.cs index f03313100..79b0488e3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Enumerations/TemplateFormat.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Enumerations/TemplateFormat.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Globals/GlobalDeclarations.cs index 7fcd00884..463c31c9f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Core/IExceptionReportView.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Core/IExceptionReportView.cs index a5e467f21..9f6fa999f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Core/IExceptionReportView.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Core/IExceptionReportView.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Core/IFileService.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Core/IFileService.cs index 6197f7913..cf6bf5ca6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Core/IFileService.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Core/IFileService.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Core/IScreenShooter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Core/IScreenShooter.cs index 396cdefeb..4a4e72dab 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Core/IScreenShooter.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Core/IScreenShooter.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Core/IViewMaker.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Core/IViewMaker.cs index c96aa3c93..93542f881 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Core/IViewMaker.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Core/IViewMaker.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Mail/IAttach.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Mail/IAttach.cs index be17ba5f4..e59349187 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Mail/IAttach.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Mail/IAttach.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Network/IReportSendEvent.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Network/IReportSendEvent.cs index e6ad1eaf1..7eea4f19a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Network/IReportSendEvent.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Network/IReportSendEvent.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Network/IReportSender.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Network/IReportSender.cs index 915fa60e3..5d346255c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Network/IReportSender.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Network/IReportSender.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Report/IAssemblyDigger.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Report/IAssemblyDigger.cs index ca6335328..007a50f30 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Report/IAssemblyDigger.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Report/IAssemblyDigger.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Report/IStackTraceMaker.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Report/IStackTraceMaker.cs index bb86cdb06..ca53ab193 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Report/IStackTraceMaker.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Report/IStackTraceMaker.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/System Information/ISysInfoResultMapper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/System Information/ISysInfoResultMapper.cs index 0e9d171ed..39d2cbee9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/System Information/ISysInfoResultMapper.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/System Information/ISysInfoResultMapper.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Zip/IZipAttachmentService.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Zip/IZipAttachmentService.cs index fb2db82bc..2e1307033 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Zip/IZipAttachmentService.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Zip/IZipAttachmentService.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Zip/IZipper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Zip/IZipper.cs index 1022c3ec2..4702d0bbc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Zip/IZipper.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Interfaces/Zip/IZipper.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Krypton.Toolkit.Suite.Extended.Error.Reporting 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Krypton.Toolkit.Suite.Extended.Error.Reporting 2022.csproj index d3ac337e0..356f4dfe2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Krypton.Toolkit.Suite.Extended.Error.Reporting 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Krypton.Toolkit.Suite.Extended.Error.Reporting 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - + - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements error reporting features. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements error reporting features. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -87,9 +75,9 @@ - + - + @@ -99,9 +87,9 @@ - + - + @@ -111,9 +99,9 @@ - + - + @@ -123,9 +111,9 @@ - + - + @@ -160,18 +148,18 @@ - + - + - - + + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Krypton.Toolkit.Suite.Extended.Error.Reporting.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Krypton.Toolkit.Suite.Extended.Error.Reporting.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Krypton.Toolkit.Suite.Extended.Error.Reporting.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Krypton.Toolkit.Suite.Extended.Error.Reporting.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/UX/MVP/Views/ExceptionReportView.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/UX/MVP/Views/ExceptionReportView.Designer.cs index 07c662432..5346928e1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/UX/MVP/Views/ExceptionReportView.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/UX/MVP/Views/ExceptionReportView.Designer.cs @@ -495,14 +495,9 @@ private void InitializeComponent() this.klvAssemblies.HideSelection = false; this.klvAssemblies.HotTracking = true; this.klvAssemblies.HoverSelection = true; - this.klvAssemblies.ItemStyle = Krypton.Toolkit.ButtonStyle.ListItem; this.klvAssemblies.Location = new System.Drawing.Point(0, 0); this.klvAssemblies.Name = "klvAssemblies"; - this.klvAssemblies.OwnerDraw = true; this.klvAssemblies.Size = new System.Drawing.Size(567, 364); - this.klvAssemblies.StateCommon.Item.Content.ShortText.MultiLine = Krypton.Toolkit.InheritBool.True; - this.klvAssemblies.StateCommon.Item.Content.ShortText.MultiLineH = Krypton.Toolkit.PaletteRelativeAlign.Center; - this.klvAssemblies.StateCommon.Item.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.klvAssemblies.TabIndex = 0; // // kpSystemInformation diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/UX/MVP/Views/ExceptionReportView.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/UX/MVP/Views/ExceptionReportView.cs index c19ca31de..1d5c58e24 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/UX/MVP/Views/ExceptionReportView.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/UX/MVP/Views/ExceptionReportView.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Classes/General/CopyFiles.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Classes/General/CopyFiles.cs index 650759e28..c2e7008d5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Classes/General/CopyFiles.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Classes/General/CopyFiles.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -422,7 +422,7 @@ private void CheckFilenames() fileNames[innerIndex] += newFilename.Replace("[*REMOVEME*]", ""); //only add a . if its not the injected portion e.g (2) - if ((filenameIndex < tempFileNameArr.Count - 3 && newFilename.StartsWith("[*REMOVEME*]") == false)) + if (filenameIndex < tempFileNameArr.Count - 3 && newFilename.StartsWith("[*REMOVEME*]") == false) { fileNames[innerIndex] += "."; } filenameIndex += 1; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Classes/General/HelperUtilites.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Classes/General/HelperUtilites.cs deleted file mode 100644 index cc1a65633..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Classes/General/HelperUtilites.cs +++ /dev/null @@ -1,76 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.File.Copier -{ - internal static class HelperUtilites - { - #region Variables - - #endregion - - #region Properties - - #endregion - - #region Methods - public static List PopulateDirectoryListing(string inputPath) - { - List tempList = new(); - - foreach (string directory in Directory.GetDirectories(inputPath)) - { - foreach (string file in Directory.GetFiles(directory)) - { - tempList.Add(file); - } - } - - return tempList; - } - - public static string[] ReturnDirectoryListing(List inputList) - { - try - { - if (inputList.Count > 0) - { - return inputList.ToArray(); - } - } - catch (Exception exc) - { - ExceptionCapture.CaptureException(exc); - - return null; - } - - return inputList.ToArray(); - } - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Classes/General/HelperUtilities.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Classes/General/HelperUtilities.cs new file mode 100644 index 000000000..69d53ee13 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Classes/General/HelperUtilities.cs @@ -0,0 +1,76 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.File.Copier +{ + internal static class HelperUtilities + { + #region Variables + + #endregion + + #region Properties + + #endregion + + #region Methods + public static List PopulateDirectoryListing(string inputPath) + { + List tempList = new(); + + foreach (string directory in Directory.GetDirectories(inputPath)) + { + foreach (string file in Directory.GetFiles(directory)) + { + tempList.Add(file); + } + } + + return tempList; + } + + public static string[]? ReturnDirectoryListing(List inputList) + { + try + { + if (inputList.Count > 0) + { + return inputList.ToArray(); + } + } + catch (Exception exc) + { + DebugUtilities.NotImplemented(exc.ToString()); + + return null; + } + + return inputList.ToArray(); + } + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Controls/User Control/KryptonFileListing.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Controls/User Control/KryptonFileListing.cs index 68a7e7680..60bc67698 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Controls/User Control/KryptonFileListing.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Controls/User Control/KryptonFileListing.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -93,7 +93,7 @@ private void InitializeComponent() // ktxtDirectory // this.ktxtDirectory.Dock = System.Windows.Forms.DockStyle.Fill; - this.ktxtDirectory.Hint = "Please enter or browse to a directory..."; + this.ktxtDirectory.CueHint.CueHintText = "Please enter or browse to a directory..."; this.ktxtDirectory.Location = new(0, 0); this.ktxtDirectory.Name = "ktxtDirectory"; this.ktxtDirectory.Size = new(224, 23); @@ -310,11 +310,11 @@ private void OpenInExplorer(string item) } catch (Exception ex) { - ExceptionCapture.CaptureException(ex); + DebugUtilities.NotImplemented(ex.ToString()); } } - private void PropagateFileList(List directoryContents, string directory, string fileType = null) + private void PropagateFileList(List directoryContents, string directory, string? fileType = null) { DirectoryInfo directoryInfo = new(directory); @@ -390,12 +390,13 @@ private void kbtnBrowse_Click(object sender, EventArgs e) } break; default: + DebugUtilities.NotImplemented(_fileDialogType.ToString()); throw new ArgumentOutOfRangeException(); } } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Events/DirectoryPathChangedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Events/DirectoryPathChangedEventArgs.cs index 2bb228e3f..26b53ee32 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Events/DirectoryPathChangedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Events/DirectoryPathChangedEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Events/FileGathererEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Events/FileGathererEventArgs.cs index b5cf8eb22..7ee152f06 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Events/FileGathererEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Events/FileGathererEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Globals/GlobalDeclarations.cs index deaca1567..c103ea888 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -34,6 +34,7 @@ global using System.Runtime.InteropServices; global using System.Windows.Forms; +global using Krypton.Toolkit.Suite.Extended.Debug.Tools; global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; global using Krypton.Toolkit.Suite.Extended.Shared; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Interfaces/ICopyFileDetails.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Interfaces/ICopyFileDetails.cs index 05362b80f..682627a93 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Interfaces/ICopyFileDetails.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Interfaces/ICopyFileDetails.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Krypton.Toolkit.Suite.Extended.File.Copier 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Krypton.Toolkit.Suite.Extended.File.Copier 2022.csproj index 2e0ef0802..56e570ebf 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Krypton.Toolkit.Suite.Extended.File.Copier 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Krypton.Toolkit.Suite.Extended.File.Copier 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package provides tools to move and copy files. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package provides tools to move and copy files. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,74 +69,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + @@ -185,10 +135,11 @@ - + + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/UX/KryptonFileCopier.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/UX/KryptonFileCopier.cs index 49ae9d381..a9901e591 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/UX/KryptonFileCopier.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/UX/KryptonFileCopier.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -123,7 +123,7 @@ private void kbtnCopyFiles_Click(object sender, EventArgs e) files.Add(item); } - KryptonDeveloperDebugConsole debugConsole = new(HelperUtilites.ReturnDirectoryListing(files)); + KryptonDeveloperDebugConsole debugConsole = new(HelperUtilities.ReturnDirectoryListing(files)); debugConsole.Show(); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/UX/KryptonFileMonitor.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/UX/KryptonFileMonitor.cs index e2efa3e71..7e22d05d5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/UX/KryptonFileMonitor.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/UX/KryptonFileMonitor.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -44,7 +44,7 @@ public void Update(int totalFiles, int copiedFiles, long totalBytes, long copied if (totalFiles != 0) { - pbCurrentFile.Value = Convert.ToInt32((100f / (totalFiles / 1024f)) * (copiedBytes / 1024f)); + pbCurrentFile.Value = Convert.ToInt32(100f / (totalFiles / 1024f) * (copiedBytes / 1024f)); } klblTotalFiles.Text = $"Total Files: ({copiedFiles} / {totalFiles})"; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Explorer/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Explorer/Globals/GlobalDeclarations.cs index 6753070ea..3a43dea43 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Explorer/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Explorer/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Explorer/Krypton.Toolkit.Suite.Extended.File.Explorer 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Explorer/Krypton.Toolkit.Suite.Extended.File.Explorer 2022.csproj index aaa9d39fc..949feebf1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Explorer/Krypton.Toolkit.Suite.Extended.File.Explorer 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Explorer/Krypton.Toolkit.Suite.Extended.File.Explorer 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -38,6 +26,7 @@ en Debug;Release;Nightly;Canary true + preview @@ -68,9 +57,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements a file explorer. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements a file explorer. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -78,74 +67,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Explorer/Krypton.Toolkit.Suite.Extended.File.Explorer.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Explorer/Krypton.Toolkit.Suite.Extended.File.Explorer.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Explorer/Krypton.Toolkit.Suite.Extended.File.Explorer.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Explorer/Krypton.Toolkit.Suite.Extended.File.Explorer.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Classes/Advanced/MenuStripPanelCollectionEditor.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Classes/Advanced/MenuStripPanelCollectionEditor.cs index 2d9bc0597..c1d911c7c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Classes/Advanced/MenuStripPanelCollectionEditor.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Classes/Advanced/MenuStripPanelCollectionEditor.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Classes/Advanced/ToolStripPanelCollectionEditor.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Classes/Advanced/ToolStripPanelCollectionEditor.cs index a9ec6213e..1a615da82 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Classes/Advanced/ToolStripPanelCollectionEditor.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Classes/Advanced/ToolStripPanelCollectionEditor.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatableMenuStrip.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatableMenuStrip.cs index a24832ab4..58c637b9d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatableMenuStrip.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatableMenuStrip.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatablePanelHost.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatablePanelHost.cs index 4db21ffe3..9a077685e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatablePanelHost.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatablePanelHost.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatableToolStrip.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatableToolStrip.cs index 3829a83f5..f72e8c9e5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatableToolStrip.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatableToolStrip.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/MenuStripPanelExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/MenuStripPanelExtended.cs index 1beaa9999..d7f324dd2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/MenuStripPanelExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/MenuStripPanelExtended.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/ToolStripPanelExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/ToolStripPanelExtended.cs index 3a4f21854..4ef176abc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/ToolStripPanelExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/ToolStripPanelExtended.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Globals/GlobalDeclarations.cs index 8c487c4f0..73730b4ba 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Krypton.Toolkit.Suite.Extended.Floating.Toolbars 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Krypton.Toolkit.Suite.Extended.Floating.Toolbars 2022.csproj index 709816dd4..0dad489f7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Krypton.Toolkit.Suite.Extended.Floating.Toolbars 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Krypton.Toolkit.Suite.Extended.Floating.Toolbars 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package allows the usage of floating toolbars. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package allows the usage of floating toolbars. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,74 +69,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Krypton.Toolkit.Suite.Extended.Floating.Toolbars.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Krypton.Toolkit.Suite.Extended.Floating.Toolbars.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Krypton.Toolkit.Suite.Extended.Floating.Toolbars.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Krypton.Toolkit.Suite.Extended.Floating.Toolbars.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/FloatingContainerForm.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/FloatingContainerForm.Designer.cs index 3ef091618..b53bc6777 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/FloatingContainerForm.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/FloatingContainerForm.Designer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/FloatingContainerForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/FloatingContainerForm.cs index 3544aa11d..7c49ffabd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/FloatingContainerForm.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/FloatingContainerForm.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -136,7 +136,7 @@ private void CalculateMinimumWidth() } } - _minWidth += (_dFrameWidth + 3); + _minWidth += _dFrameWidth + 3; if (_minWidth < 46) { @@ -153,7 +153,7 @@ private void CalculateMinimumWidth() } } - _minWidth += (_dFrameWidth + 3); + _minWidth += _dFrameWidth + 3; if (_minWidth < 46) { @@ -184,7 +184,7 @@ protected override void OnResize(EventArgs e) { Width = _maxWidth; } - else if (Width < (_minWidth + 23)) + else if (Width < _minWidth + 23) { Width = _minWidth; } @@ -197,7 +197,7 @@ protected override void OnResize(EventArgs e) { Width = _maxWidth; } - else if (Width < (_minWidth + 23)) + else if (Width < _minWidth + 23) { Width = _minWidth; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/MenuStripContainerWindow.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/MenuStripContainerWindow.cs index 49ed2ad8c..debe23fcb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/MenuStripContainerWindow.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/MenuStripContainerWindow.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -130,7 +130,7 @@ public MenuStripContainerWindow() { InitializeComponent(); - _dFrameWidth = (Width - ClientSize.Width); + _dFrameWidth = Width - ClientSize.Width; _captionWidth = Height - ClientSize.Height - _dFrameWidth; @@ -165,7 +165,7 @@ private void CalculateMinimumWidth() } } - _minWidth += (_dFrameWidth + 3); + _minWidth += _dFrameWidth + 3; if (_minWidth < 46) { @@ -187,7 +187,7 @@ protected override void OnResize(EventArgs e) { Width = _maxWidth; } - else if (Width < (_minWidth + 23)) + else if (Width < _minWidth + 23) { Width = _minWidth; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/MenuStripExistingComponentChooser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/MenuStripExistingComponentChooser.cs index 4b0d1c769..b02bd43b6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/MenuStripExistingComponentChooser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/MenuStripExistingComponentChooser.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -42,7 +42,7 @@ public Control? SourceComponentContainer { foreach (Control item in value.Controls) { - if ((item is MenuStripPanelExtended)) + if (item is MenuStripPanelExtended) { _srcComponentList.Add(item as MenuStripPanelExtended); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/ToolStripContainerWindow.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/ToolStripContainerWindow.cs index 480da3014..d8de04a13 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/ToolStripContainerWindow.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/ToolStripContainerWindow.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -113,7 +113,7 @@ public ToolStripContainerWindow() { InitializeComponent(); - _dFrameWidth = (Width - ClientSize.Width); + _dFrameWidth = Width - ClientSize.Width; _captionWidth = Height - ClientSize.Height - _dFrameWidth; @@ -138,7 +138,7 @@ private void CalculateMinimumWidth() } } - _minWidth += (_dFrameWidth + 3); + _minWidth += _dFrameWidth + 3; if (_minWidth < 46) { @@ -160,7 +160,7 @@ protected override void OnResize(EventArgs e) { Width = _maxWidth; } - else if (Width < (_minWidth + 23)) + else if (Width < _minWidth + 23) { Width = _minWidth; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/ToolStripExistingComponentChooser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/ToolStripExistingComponentChooser.cs index 1d6e42209..4e250c16b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/ToolStripExistingComponentChooser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/UX/Advanced/ToolStripExistingComponentChooser.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -42,7 +42,7 @@ public Control? SourceComponentContainer { foreach (Control item in value.Controls) { - if ((item is ToolStripPanelExtended)) + if (item is ToolStripPanelExtended) { _srcComponentList.Add(item as ToolStripPanelExtended); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/ButtonSpec/ButtonSpecFormFixed.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/ButtonSpec/ButtonSpecFormFixed.cs index 1183f2c8d..340fe8e6b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/ButtonSpec/ButtonSpecFormFixed.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/ButtonSpec/ButtonSpecFormFixed.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -43,7 +43,7 @@ public abstract class ButtonSpecFormFixed : ButtonSpec /// /// Reference to owning krypton form. /// Fixed style to use. - protected ButtonSpecFormFixed(VirtualKryptonFormExtended form, + protected ButtonSpecFormFixed(VisualKryptonFormExtended form, PaletteButtonSpecStyle fixedStyle) { Debug.Assert(form != null); @@ -68,7 +68,7 @@ protected ButtonSpecFormFixed(VirtualKryptonFormExtended form, /// /// Gets access to the owning krypton form. /// - protected VirtualKryptonFormExtended KryptonForm { get; } + protected VisualKryptonFormExtended KryptonForm { get; } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/ButtonSpec/ButtonSpecFormWindowClose.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/ButtonSpec/ButtonSpecFormWindowClose.cs index f0d291ba8..f6313d845 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/ButtonSpec/ButtonSpecFormWindowClose.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/ButtonSpec/ButtonSpecFormWindowClose.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -66,7 +66,7 @@ public bool Enabled /// Initialize a new instance of the ButtonSpecFormWindowClose class. /// /// Reference to owning krypton form instance. - public ButtonSpecFormWindowClose(VirtualKryptonFormExtended form) + public ButtonSpecFormWindowClose(VisualKryptonFormExtended form) : base(form, PaletteButtonSpecStyle.FormClose) { } @@ -80,15 +80,8 @@ public ButtonSpecFormWindowClose(VirtualKryptonFormExtended form) /// Button visibility. 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.ApplyComposition && KryptonForm.ApplyCustomChrome) - { - return false; - } - // Have all buttons been turned off? - return KryptonForm.ControlBox && KryptonForm.CloseBox; + return KryptonForm is { ControlBox: true, CloseBox: true }; } /// @@ -103,7 +96,7 @@ public override bool GetVisible(PaletteBase palette) /// /// Palette to use for inheriting values. /// Button checked state. - public override ButtonCheckState GetChecked(PaletteBase palette) => + public override ButtonCheckState GetChecked(PaletteBase? palette) => // Close button is never shown as checked ButtonCheckState.NotCheckButton; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/ButtonSpec/ButtonSpecFormWindowMax.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/ButtonSpec/ButtonSpecFormWindowMax.cs index 05ac3bafe..83fa312d9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/ButtonSpec/ButtonSpecFormWindowMax.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/ButtonSpec/ButtonSpecFormWindowMax.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -37,7 +37,7 @@ public class ButtonSpecFormWindowMax : ButtonSpecFormFixed /// Initialize a new instance of the ButtonSpecFormWindowMax class. /// /// Reference to owning krypton form instance. - public ButtonSpecFormWindowMax(VirtualKryptonFormExtended form) + public ButtonSpecFormWindowMax(VisualKryptonFormExtended form) : base(form, PaletteButtonSpecStyle.FormMax) { } @@ -51,13 +51,6 @@ public ButtonSpecFormWindowMax(VirtualKryptonFormExtended form) /// Button visibility. 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.ApplyComposition && KryptonForm.ApplyCustomChrome) - { - return false; - } - // The maximize button is never present on tool windows switch (KryptonForm.FormBorderStyle) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/ButtonSpec/ButtonSpecFormWindowMin.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/ButtonSpec/ButtonSpecFormWindowMin.cs index 0b7fa86a4..b158fd55c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/ButtonSpec/ButtonSpecFormWindowMin.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/ButtonSpec/ButtonSpecFormWindowMin.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -37,7 +37,7 @@ public class ButtonSpecFormWindowMin : ButtonSpecFormFixed /// Initialize a new instance of the ButtonSpecFormWindowMin class. /// /// Reference to owning krypton form instance. - public ButtonSpecFormWindowMin(VirtualKryptonFormExtended form) + public ButtonSpecFormWindowMin(VisualKryptonFormExtended form) : base(form, PaletteButtonSpecStyle.FormMin) { } @@ -51,13 +51,6 @@ public ButtonSpecFormWindowMin(VirtualKryptonFormExtended form) /// Button visibility. 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.ApplyComposition && KryptonForm.ApplyCustomChrome) - { - return false; - } - // The minimize button is never present on tool windows switch (KryptonForm.FormBorderStyle) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Toolkit/KryptonFormExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Toolkit/KryptonFormExtended.cs index 8e302efd8..8112899a6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Toolkit/KryptonFormExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Toolkit/KryptonFormExtended.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -27,7 +27,7 @@ namespace Krypton.Toolkit.Suite.Extended.Forms { - public class KryptonFormExtended : VirtualKryptonFormExtended + public class KryptonFormExtended : VisualKryptonFormExtended { #region Instance Fields diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Toolkit/KryptonSlideForm.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Toolkit/KryptonSlideForm.Designer.cs new file mode 100644 index 000000000..538283599 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Toolkit/KryptonSlideForm.Designer.cs @@ -0,0 +1,39 @@ +namespace Krypton.Toolkit.Suite.Extended.Forms +{ + partial class KryptonSlideForm + { + /// + /// 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.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Text = "KryptonSlideForm"; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Toolkit/KryptonSlideForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Toolkit/KryptonSlideForm.cs new file mode 100644 index 000000000..13d30ca9f --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Toolkit/KryptonSlideForm.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Krypton.Toolkit.Suite.Extended.Forms +{ + public partial class KryptonSlideForm : VisualSlideForm + { + public KryptonSlideForm(KryptonFormExtended owner, float step) : base(owner, step) + { + InitializeComponent(); + } + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Toolkit/TransparentPanel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Toolkit/TransparentPanel.cs new file mode 100644 index 000000000..ce9655c5c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Toolkit/TransparentPanel.cs @@ -0,0 +1,59 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Forms +{ + [ToolboxItem(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public class TransparentPanel : KryptonPanel + { + #region Identity + + public TransparentPanel() + { + SetStyle(ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); + } + + #endregion + + #region Protected + + protected override CreateParams CreateParams + { + get + { + CreateParams cp = base.CreateParams; + + cp.ExStyle |= 0x00000020; // WS_EX_TRANSPARENT + + return cp; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VirtualForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VirtualForm.cs deleted file mode 100644 index e5157fd4d..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VirtualForm.cs +++ /dev/null @@ -1,2008 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Forms -{ - /// - /// Base class that allows a form to have custom chrome applied. You should derive - /// a class from this that performs the specific chrome drawing that is required. - /// Taken from - /// - [ToolboxItem(false)] - public abstract class VirtualForm : Form, IKryptonDebug - { - #region Static Fields - - private const int DEFAULT_COMPOSITION_HEIGHT = 30; - private static readonly bool _themedApp; - #endregion - - #region Instance Fields - private bool _activated; - private bool _windowActive; - private bool _trackingMouse; - private bool _applyCustomChrome; - private bool _closeBoxVisible; - private bool _allowComposition; - private bool _insideUpdateComposition; - private bool _captured; - private bool _disposing; - private int _compositionHeight; - private int _ignoreCount; - private ViewBase _capturedElement; - private PaletteBase? _localPalette; - private PaletteBase? _palette; - private PaletteMode _paletteMode; - private readonly IntPtr _screenDC; - private ShadowValues _shadowValues; - private ShadowManager _shadowManager; - private BlurValues _blurValues; - private BlurManager _blurManager; - private FadeValues _fadeValues; - private FadeManager _fadeManager; - - private readonly FadeController _fadeController; - #endregion - - #region Events - /// - /// Occurs when the palette changes. - /// - [Category(@"Property Changed")] - [Description(@"Occurs when the value of the Palette property is changed.")] - public event EventHandler PaletteChanged; - - /// - /// Occurs when the use of custom chrome changes. - /// - [Browsable(false)] // SKC: Probably a special case for not exposing this event in the designer.... - [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler ApplyCustomChromeChanged; - - /// - /// Occurs when the active window setting changes. - /// - [Browsable(false)] // SKC: Probably a special case for not exposing this event in the designer.... - [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler WindowActiveChanged; - - /// - /// Occurs when the Global palette changes. - /// - [Category(@"Property Changed")] - [Description(@"Occurs when the value of the GlobalPalette property is changed.")] - public event EventHandler GlobalPaletteChanged; - #endregion - - #region Identity - static VirtualForm() - { - try - { - // Is this application in an OS that is capable of themes and is currently themed - _themedApp = VisualStyleInformation.IsEnabledByUser && !string.IsNullOrEmpty(VisualStyleInformation.ColorScheme); - } - catch - { - // - } - } - - /// - /// Initialize a new instance of the KryptonVirtualForm class. - /// - public VirtualForm() - { - // Automatically redraw whenever the size of the window changes - SetStyle(ControlStyles.ResizeRedraw, true); - - // We need to create and cache a device context compatible with the display - _screenDC = PlatformInvoke.CreateCompatibleDC(IntPtr.Zero); - - // Setup the need paint delegate - NeedPaintDelegate = OnNeedPaint; - - // Set the palette and renderer to the defaults as specified by the manager - _localPalette = null; - SetPalette(KryptonManager.CurrentGlobalPalette); - _paletteMode = PaletteMode.Global; - - // We need to layout the view - NeedLayout = true; - - // Default the composition height - _compositionHeight = DEFAULT_COMPOSITION_HEIGHT; - - _closeBoxVisible = true; - - // Create constant target for resolving palette delegates - Redirector = CreateRedirector(); - - // Hook into global static events - KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged; - SystemEvents.UserPreferenceChanged += OnUserPreferenceChanged; - - ShadowValues = new ShadowValues(); - BlurValues = new BlurValues(); - - FadeValues = new FadeValues(); - -#if !NET462 - DpiChanged += OnDpiChanged; -#endif - // Note: Will not handle movement between monitors - UpdateDpiFactors(); - } - - - /// - /// 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) - { - _disposing = true; - - if (disposing) - { - // Must unhook from the palette paint events - if (_palette != null) - { - _palette.PalettePaint -= OnNeedPaint; - _palette.ButtonSpecChanged -= OnButtonSpecChanged; - _palette.AllowFormChromeChanged -= OnAllowFormChromeChanged; - _palette.BasePaletteChanged -= OnBaseChanged; - _palette.BaseRendererChanged -= OnBaseChanged; - } - - // Unhook from global static events - KryptonManager.GlobalPaletteChanged -= OnGlobalPaletteChanged; - SystemEvents.UserPreferenceChanged -= OnUserPreferenceChanged; - } - - base.Dispose(disposing); - - ViewManager?.Dispose(); - - if (_screenDC != IntPtr.Zero) - { - PlatformInvoke.DeleteDC(_screenDC); - } - } - #endregion - - #region Public - - /// - /// Gets the DpiX of the view. - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public float FactorDpiX - { - [DebuggerStepThrough] - get; - set; - } = 1; - - /// - /// Gets the DpiY of the view. - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public float FactorDpiY - { - [DebuggerStepThrough] - get; - set; - } = 1; - - /// - /// Gets and sets a value indicating if palette chrome should be applied. - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public bool ApplyCustomChrome - { - [DebuggerStepThrough] - get => _applyCustomChrome; - - internal set - { - // Only interested in changed values - if (_applyCustomChrome != value) - { - // Cache old setting - var oldApplyCustomChrome = _applyCustomChrome; - - // Store the new setting - _applyCustomChrome = value; - - // If we need custom chrome drawing... - if (_applyCustomChrome) - { - try - { - // Set back to false in case we decide that the operating system - // is not capable of supporting our custom chrome implementation - _applyCustomChrome = false; - - // Only need to remove the window theme, if there is one - if (PlatformInvoke.IsAppThemed() && PlatformInvoke.IsThemeActive()) - { - // Assume that we can apply custom chrome - _applyCustomChrome = 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 - PlatformInvoke.SetWindowTheme(Handle, string.Empty, string.Empty); - } - else - { - // Force a WM_NCCALCSIZE to update for composition - PlatformInvoke.SetWindowTheme(Handle, null, null); - } - - // Call virtual method for initializing own chrome - WindowChromeStart(); - } - } - catch - { - // Failed and so cannot provide custom chrome - _applyCustomChrome = false; - } - } - else - { - try - { - // Retest if composition should be applied - UpdateComposition(); - - // Restore the application to previous theme setting - PlatformInvoke.SetWindowTheme(Handle, null, null); - - // Call virtual method to reverse own chrome setup - WindowChromeEnd(); - } - catch - { - // - } - } - - // Raise event to notify a change in setting - if (_applyCustomChrome != oldApplyCustomChrome) - { - // Generate change event - OnApplyCustomChromeChanged(EventArgs.Empty); - } - } - } - } - - /// Gets or sets a value indicating whether the Close button is displayed in the caption bar of the form. - /// - /// 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 => _closeBoxVisible; - set - { - _closeBoxVisible = value; - Invalidate(); - } - } - - /// - /// 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; } - - /// - /// Gets or sets the palette to be applied. - /// - [Category(@"Visuals")] - [Description(@"Palette applied to drawing.")] - public PaletteMode PaletteMode - { - [DebuggerStepThrough] - get => _paletteMode; - - set - { - 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 - _localPalette = null; - SetPalette(KryptonManager.GetPaletteForMode(_paletteMode)); - - // Must raise event to change palette in redirector - OnPaletteChanged(EventArgs.Empty); - - // Need to layout again use new palette - PerformLayout(); - break; - } - } - } - } - - private bool ShouldSerializePaletteMode() => PaletteMode != PaletteMode.Global; - - /// - /// Resets the PaletteMode property to its default value. - /// - public void ResetPaletteMode() => PaletteMode = PaletteMode.Global; - - /// - /// Gets access to the button content. - /// - [Category(@"Visuals")] - [Description(@"Form Shadowing")] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] - public ShadowValues ShadowValues - { - [DebuggerStepThrough] - get => _shadowValues; - set - { - _shadowValues = value; - _shadowManager = new ShadowManager(this, _shadowValues); - } - } - - private bool ShouldSerializeShadowValues() => !_shadowValues.IsDefault; - - /// - /// Resets the shadow values. - /// - public void ResetShadowValues() => _shadowValues.Reset(); - - /// - /// Gets access to the button content. - /// - [Category(@"Visuals")] - [Description(@"Form Blurring")] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] - public BlurValues BlurValues - { - [DebuggerStepThrough] - get => _blurValues; - set - { - _blurValues = value; - _blurManager = new BlurManager(this, _blurValues); - } - } - - private bool ShouldSerializeBlurValues() => !_blurValues.IsDefault; - - /// - /// Resets the blur values. - /// - public void ResetBlurValues() => _blurValues.Reset(); - - public FadeValues FadeValues - { - [DebuggerStepThrough] - get => _fadeValues; - - set - { - _fadeValues = value; - - _fadeManager = new FadeManager(this, null, _fadeValues.UseFade, _fadeValues.FadeInterval, _fadeValues, _fadeController); - } - } - - private bool ShouldSerializeFadeValues() => !_fadeValues.IsDefault; - - public void ResetFadeValues() => _fadeValues.Reset(); - - - /// - /// Gets and sets the custom palette implementation. - /// - [Category(@"Visuals")] - [Description(@"Custom palette applied to drawing.")] - [DefaultValue(null)] - public PaletteBase? Palette - { - [DebuggerStepThrough] - get => _localPalette; - - set - { - // Only interested in changes of value - if (_localPalette != value) - { - // Remember the starting palette - PaletteBase? old = _localPalette; - - // Use the provided palette value - SetPalette(value); - - // If no custom palette is required - if (value == null) - { - // No custom palette, so revert back to the global setting - _paletteMode = PaletteMode.Global; - - // Get the appropriate palette for the global mode - _localPalette = null; - SetPalette(KryptonManager.GetPaletteForMode(_paletteMode)); - } - else - { - // No longer using a standard palette - _localPalette = value; - _paletteMode = PaletteMode.Custom; - } - - // If real change has occurred - if (old != _localPalette) - { - // Raise the change event - OnPaletteChanged(EventArgs.Empty); - - // Need to layout again use new palette - PerformLayout(); - } - } - } - } - - /// - /// Resets the Palette property to its default value. - /// - public void ResetPalette() => _localPalette = null; - - /// - /// Gets access to the current renderer. - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Advanced)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public IRenderer Renderer - { - [DebuggerStepThrough] - get; - private set; - } - - /// - /// Fires the NeedPaint event. - /// - /// Does the palette change require a layout. - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Advanced)] - public void PerformNeedPaint(bool needLayout) => OnNeedPaint(this, new NeedLayoutEventArgs(needLayout)); - - /// - /// Gets the resolved palette to actually use when drawing. - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - public PaletteBase? GetResolvedPalette() => _palette; - - /// - /// Create a tool strip renderer appropriate for the current renderer/palette pair. - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Advanced)] - public ToolStripRenderer CreateToolStripRenderer() => Renderer.RenderToolStrip(GetResolvedPalette()); - - /// - /// Send the provided system command to the window for processing. - /// - /// System command. - [EditorBrowsable(EditorBrowsableState.Never)] - internal void SendSysCommand(PlatformInvoke.SC_ sysCommand) => SendSysCommand(sysCommand, IntPtr.Zero); - - /// - /// Send the provided system command to the window for processing. - /// - /// System command. - /// LPARAM value. - [EditorBrowsable(EditorBrowsableState.Never)] - internal void SendSysCommand(PlatformInvoke.SC_ sysCommand, IntPtr lParam) => - // Send window message to ourself - PlatformInvoke.SendMessage(Handle, PlatformInvoke.WM_.SYSCOMMAND, (IntPtr)sysCommand, lParam); - - /// - /// Gets the size of the borders requested by the real window. - /// - /// Border sizing. - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public Padding RealWindowBorders => CommonHelper.GetWindowBorders(CreateParams); - - /// - /// Gets a count of the number of paints that have occurred. - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public int PaintCount { get; private set; } - - /// - /// Gets and sets the active state of the window. - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public bool WindowActive - { - get => _windowActive; - - set - { - if (_windowActive != value) - { - _windowActive = value; - _blurManager.SetBlurState(_windowActive); - OnWindowActiveChanged(); - } - } - } - - /// - /// Please use a ButtonSpec, as this gives greater flexibility! - /// - [Browsable(false)] - [Category(@"Window Style")] - [DefaultValue(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - [Description(@"Please use a ButtonSpec, as this gives greater flexibility!")] - public new bool HelpButton - { - get => base.HelpButton; - // ReSharper disable once ValueParameterNotUsed - set - { - base.HelpButton = false; - throw new NotSupportedException(@"Please use a ButtonSpec, as this gives greater flexibility!"); - } - } - - - /// - /// Request the non-client area be repainted. - /// - public void RedrawNonClient() => InvalidateNonClient(Rectangle.Empty, true); - - /// - /// Request the non-client area be recalculated. - /// - public void RecalcNonClient() - { - if (!IsDisposed && !Disposing && IsHandleCreated) - { - PlatformInvoke.SetWindowPos(Handle, IntPtr.Zero, 0, 0, 0, 0, - PlatformInvoke.SWP_.NOACTIVATE | PlatformInvoke.SWP_.NOMOVE | - PlatformInvoke.SWP_.NOZORDER | PlatformInvoke.SWP_.NOSIZE | - PlatformInvoke.SWP_.NOOWNERZORDER | PlatformInvoke.SWP_.FRAMECHANGED); - } - } - -#if NET6_0_OR_GREATER - /// Gets or sets the anchoring for minimized MDI children. - /// true to anchor minimized MDI children to the bottom left of the parent form; false to anchor to the top left of the parent form. - [Category(@"Window Style")] - [Description(@"Gets or sets the anchoring for minimized MDI children.")] - [DefaultValue(true)] - public new bool MdiChildrenMinimizedAnchorBottom - { - get => base.MdiChildrenMinimizedAnchorBottom; - - set - { - base.MdiChildrenMinimizedAnchorBottom = value; - throw new NotSupportedException(@"Please use .NET 6 or newer to use this feature."); - } - } -#endif - #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. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void KryptonResetCounters() => ViewManager.ResetCounters(); - - /// - /// Gets the number of layout cycles performed since last reset. - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public int KryptonLayoutCounter => ViewManager.LayoutCounter; - - /// - /// Gets the number of paint cycles performed since last reset. - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public int KryptonPaintCounter => ViewManager.PaintCounter; - - #endregion - - #region Protected - /// - /// Gets and sets the ViewManager instance. - /// - protected ViewManager ViewManager - { - [DebuggerStepThrough] - get; - set; - } - - /// - /// Gets access to the palette redirector. - /// - protected PaletteRedirect Redirector - { - [DebuggerStepThrough] - get; - } - - /// - /// Gets access to the need paint delegate. - /// - protected NeedPaintHandler NeedPaintDelegate - { - [DebuggerStepThrough] - get; - } - - /// - /// Convert a screen location to a window location. - /// - /// Screen point. - /// Point in window coordinates. - protected Point ScreenToWindow(Point screenPt) - { - // First of all convert to client coordinates - Point clientPt = PointToClient(screenPt); - - // Now adjust to take into account the top and left borders - Padding borders = RealWindowBorders; - clientPt.Offset(borders.Left, ApplyComposition ? 0 : borders.Top); - - return clientPt; - } - - /// - /// Request the non-client area be repainted. - /// - public void InvalidateNonClient() => InvalidateNonClient(Rectangle.Empty, true); - - /// - /// Request the non-client area be repainted. - /// - /// Area to invalidate. - protected void InvalidateNonClient(Rectangle invalidRect) => InvalidateNonClient(invalidRect, true); - - /// - /// Request the non-client area be repainted. - /// - /// Area to invalidate. - /// Should client area be excluded. - protected void InvalidateNonClient(Rectangle invalidRect, - bool excludeClientArea) - { - if (!IsDisposed && !Disposing && IsHandleCreated) - { - if (invalidRect.IsEmpty) - { - Padding realWindowBorders = RealWindowBorders; - Rectangle realWindowRectangle = RealWindowRectangle; - - invalidRect = new Rectangle(-realWindowBorders.Left, - -realWindowBorders.Top, - realWindowRectangle.Width, - realWindowRectangle.Height); - } - - using Region invalidRegion = new(invalidRect); - if (excludeClientArea) - { - invalidRegion.Exclude(ClientRectangle); - } - - using Graphics g = Graphics.FromHwnd(Handle); - IntPtr hRgn = invalidRegion.GetHrgn(g); - - PlatformInvoke.RedrawWindow(Handle, IntPtr.Zero, hRgn, - PlatformInvoke.RDW_FRAME | PlatformInvoke.RDW_UPDATENOW | PlatformInvoke.RDW_INVALIDATE); - - PlatformInvoke.DeleteObject(hRgn); - } - } - - /// - /// Gets rectangle that is the real window rectangle based on Win32 API call. - /// - protected Rectangle RealWindowRectangle - { - get - { - // Grab the actual current size of the window, this is more accurate than using - // the 'this.Size' which is out of date when performing a resize of the window. - PlatformInvoke.RECT windowRect = new(); - PlatformInvoke.GetWindowRect(Handle, ref windowRect); - - // Create rectangle that encloses the entire window - return new Rectangle(0, 0, - windowRect.right - windowRect.left, - windowRect.bottom - windowRect.top); - } - } - #endregion - - #region Protected Override - /// - /// Raises the HandleCreated event. - /// - /// An EventArgs containing the event data. - protected override void OnHandleCreated(EventArgs e) - { - // Can fail on versions before XP SP1 - try - { - // Prevent the OS from drawing the non-client area in classic look - // if the application stops responding to windows messages - PlatformInvoke.DisableProcessWindowsGhosting(); - } - catch - { - // - } - - base.OnHandleCreated(e); - } - - /// - /// Start capturing mouse input for a particular element that is inside the chrome. - /// - /// 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 = true; - _captured = true; - - // Remember the view element that wants the mouse input during capture - _capturedElement = element; - } - - /// - /// Raises the Resize event. - /// - /// An EventArgs containing the event data. - protected override void OnResize(EventArgs e) - { - // Allow an extra region change to occur during resize - ResumePaint(); - - base.OnResize(e); - - if (ApplyCustomChrome - && !((MdiParent != null) - && CommonHelper.IsFormMaximized(this)) - ) - { - PerformNeedPaint(true); - } - - // Reverse the resume from earlier - 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. - /// - /// An EventArgs containing the event data. - protected override void OnActivated(EventArgs e) - { - WindowActive = true; - base.OnActivated(e); - } - - /// - /// Raises the Deactivate event. - /// - /// An EventArgs containing the event data. - protected override void OnDeactivate(EventArgs e) - { - WindowActive = false; - 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) - { - Rectangle compositionRect = new(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. - /// - /// An EventArgs containing event data. - protected override void OnShown(EventArgs e) - { - // With Windows 7 and above, a modal window with custom chrome under the DWM - // will sometimes not be drawn when first shown. - if (Environment.OSVersion.Version.Major >= 6) - { - PerformNeedPaint(true); - } - - base.OnShown(e); - } - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - } - - protected override void OnFormClosing(FormClosingEventArgs e) - { - base.OnFormClosing(e); - } - - #endregion - - #region Protected Virtual - // ReSharper disable VirtualMemberNeverOverridden.Global - /// - /// Suspend processing of non-client painting. - /// - protected virtual void SuspendPaint() - { - _ignoreCount++; - } - - /// - /// Resume processing of non-client painting. - /// - protected virtual void ResumePaint() - { - _ignoreCount--; - } - - /// - /// Create the redirector instance. - /// - /// PaletteRedirect derived class. - protected virtual PaletteRedirect CreateRedirector() => new(_palette); - - /// - /// Processes a notification from palette storage of a button spec change. - /// - /// Source of notification. - /// An EventArgs containing event data. - protected virtual void OnButtonSpecChanged(object sender, EventArgs e) - { - } - - /// - /// Raises the PaletteChanged event. - /// - /// An EventArgs containing the event data. - protected virtual void OnPaletteChanged(EventArgs e) - { - // Update the redirector with latest palette - Redirector.Target = _palette; - - // A new palette source means we need to layout and redraw - OnNeedPaint(Palette, new NeedLayoutEventArgs(true)); - - PaletteChanged?.Invoke(this, e); - } - - /// - /// Raises the ApplyCustomChrome event. - /// - /// An EventArgs containing the event data. - protected virtual void OnApplyCustomChromeChanged(EventArgs e) => ApplyCustomChromeChanged?.Invoke(this, e); - - /// - /// Occurs when the AllowFormChromeChanged 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) - { - } - - /// - /// Processes a notification from palette storage of a paint and optional layout required. - /// - /// Source of notification. - /// An NeedLayoutEventArgs containing event data. - /// - protected virtual void OnNeedPaint(object? sender, NeedLayoutEventArgs e) - { - Debug.Assert(e != null); - - // Validate incoming reference - if (e == null) - { - throw new ArgumentNullException(nameof(e)); - } - - // Do nothing unless we are applying custom chrome - if (ApplyCustomChrome) - { - // 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(); - } - } - } - - /// - /// Process Windows-based messages. - /// - /// A Windows-based message. - 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)PlatformInvoke.WM_NCCALCSIZE) && _themedApp && - // ((MdiParent == null) || ApplyCustomChrome)) - if (_themedApp - && ((MdiParent == null) || ApplyCustomChrome) - ) - { - switch (m.Msg) - { - case PlatformInvoke.WM_.NCCALCSIZE: - processed = OnWM_NCCALCSIZE(ref m); - break; - case PlatformInvoke.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/ */ - // 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" !! - base.WndProc(ref m); - return; - } - } - - // Do we need to override message processing? - if (ApplyCustomChrome && !IsDisposed && !Disposing) - { - switch (m.Msg) - { - case PlatformInvoke.WM_.NCPAINT: - if (!ApplyComposition) - { - processed = _ignoreCount > 0 || OnWM_NCPAINT(ref m); - } - break; - case PlatformInvoke.WM_.NCHITTEST: - processed = ApplyComposition ? OnCompWM_NCHITTEST(ref m) : OnWM_NCHITTEST(ref m); - - break; - case PlatformInvoke.WM_.NCACTIVATE: - processed = OnWM_NCACTIVATE(ref m); - break; - case PlatformInvoke.WM_.NCMOUSEMOVE: - processed = OnWM_NCMOUSEMOVE(ref m); - break; - case PlatformInvoke.WM_.NCLBUTTONDOWN: - processed = OnWM_NCLBUTTONDOWN(ref m); - break; - case PlatformInvoke.WM_.NCLBUTTONUP: - processed = OnWM_NCLBUTTONUP(ref m); - break; - case PlatformInvoke.WM_.MOUSEMOVE: - if (_captured) - { - processed = OnWM_MOUSEMOVE(ref m); - } - - break; - case PlatformInvoke.WM_.LBUTTONUP: - if (_captured) - { - processed = OnWM_LBUTTONUP(ref m); - } - - break; - case PlatformInvoke.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 PlatformInvoke.WM_.NCLBUTTONDBLCLK: - processed = OnWM_NCLBUTTONDBLCLK(ref m); - break; - case PlatformInvoke.WM_.SYSCOMMAND: - { - var sc = (PlatformInvoke.SC_)m.WParam.ToInt64(); - // Is this the command for closing the form? - if (sc == PlatformInvoke.SC_.CLOSE) - { - PropertyInfo PlatformInvoke = typeof(Form).GetProperty(@"CloseReason", - BindingFlags.Instance | - BindingFlags.SetProperty | - BindingFlags.NonPublic); - - // Update form with the reason for the close - PlatformInvoke.SetValue(this, CloseReason.UserClosing, null); - } - - if (sc != PlatformInvoke.SC_.KEYMENU) - { - processed = OnPaintNonClient(ref m); - } - } - break; - case PlatformInvoke.WM_.INITMENU: - case PlatformInvoke.WM_.SETTEXT: - case PlatformInvoke.WM_.HELP: - processed = OnPaintNonClient(ref m); - break; - case 0x00AE: - // Mystery message causes OS title bar buttons to draw, we want to - // prevent that and ignoring the messages seems to do no harm. - processed = true; - break; - case 0xC1BC: - // Under Windows7 a modal window with custom chrome under the DWM - // will sometimes not be drawn when first shown. So we spot the window - // message used to indicate a window is shown and manually request layout - // and paint of the non-client area to get it shown. - PerformNeedPaint(true); - break; - } - } - - // If the message has not been handled, let base class process it - if (!processed && m.Msg != PlatformInvoke.WM_.GETMINMAXINFO) - { - base.WndProc(ref m); - _shadowManager.WndProc(ref m); - } - - if (m.Msg == PlatformInvoke.WM_.SIZE) - { - // Make sure sizing is completed (due to above base) before taking a clean snapshot for focus lost - _blurManager.TakeSnapshot(); - } - } - - /// - /// Creates and populates the MINMAXINFO structure for a maximized window. - /// Puts the structure into memory address given by lParam. - /// Only used to process a WM_GETMINMAXINFO message. - /// - /// A Windows-based message. - protected virtual void OnWM_GETMINMAXINFO(ref Message m) - { - PlatformInvoke.MINMAXINFO mmi = (PlatformInvoke.MINMAXINFO)Marshal.PtrToStructure(m.LParam, typeof(PlatformInvoke.MINMAXINFO)); - - // Adjust the maximized size and position to fit the work area of the correct monitor - const int MONITOR_DEFAULT_TO_NEAREST = 0x00000002; - IntPtr monitor = PlatformInvoke.MonitorFromWindow(m.HWnd, MONITOR_DEFAULT_TO_NEAREST); - - if (monitor != IntPtr.Zero) - { - PlatformInvoke.MONITORINFO monitorInfo = PlatformInvoke.GetMonitorInfo(monitor); - PlatformInvoke.RECT rcWorkArea = monitorInfo.rcWork; - PlatformInvoke.RECT rcMonitorArea = monitorInfo.rcMonitor; - mmi.ptMaxPosition.X = Math.Abs(rcWorkArea.left - rcMonitorArea.left); - mmi.ptMaxPosition.Y = Math.Abs(rcWorkArea.top - rcMonitorArea.top); - mmi.ptMaxSize.X = Math.Abs(rcWorkArea.right - rcWorkArea.left); - mmi.ptMaxSize.Y = Math.Abs(rcWorkArea.bottom - rcWorkArea.top); - // https://github.com/Krypton-Suite/Standard-Toolkit/issues/415 so changed to "* 3 / 2" - mmi.ptMinTrackSize.X = Math.Max(mmi.ptMinTrackSize.X * 3 / 2, MinimumSize.Width); - mmi.ptMinTrackSize.Y = Math.Max(mmi.ptMinTrackSize.Y * 2, MinimumSize.Height); - - // https://github.com/Krypton-Suite/Standard-Toolkit/issues/459 - if (MaximumSize.Width > mmi.ptMinTrackSize.X - && MaximumSize.Width < mmi.ptMaxSize.X) - { - mmi.ptMaxSize.X = MaximumSize.Width; - } - if (MaximumSize.Height > mmi.ptMinTrackSize.Y - && MaximumSize.Height < mmi.ptMaxSize.Y) - { - mmi.ptMaxSize.Y = MaximumSize.Height; - } - } - - Marshal.StructureToPtr(mmi, m.LParam, true); - } - - /// - /// Process the WM_NCCALCSIZE message when overriding window chrome. - /// - /// A Windows-based message. - /// True if the message was processed; otherwise false. - protected virtual bool OnWM_NCCALCSIZE(ref Message m) - { - // Does the LParam contain a RECT or an NCCALCSIZE_PARAMS - if (m.WParam != IntPtr.Zero) - { - // Get the border sizing needed around the client area - Padding borders = FormBorderStyle == FormBorderStyle.None ? Padding.Empty : RealWindowBorders; - - // Extract the Win32 NCCALCSIZE_PARAMS structure from LPARAM - PlatformInvoke.NCCALCSIZE_PARAMS calcsize = (PlatformInvoke.NCCALCSIZE_PARAMS)m.GetLParam(typeof(PlatformInvoke.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; - } - - // Reduce provided RECT by the borders - calcsize.rectProposed.left += borders.Left; - calcsize.rectProposed.top += borders.Top; - calcsize.rectProposed.right -= borders.Right; - calcsize.rectProposed.bottom -= borders.Bottom; - - // Put back the modified structure - Marshal.StructureToPtr(calcsize, m.LParam, false); - } - - // Message processed, do not pass onto base class for processing - return true; - } - - /// - /// Process the WM_NCPAINT message when overriding window chrome. - /// - /// A Windows-based message. - /// True if the message was processed; otherwise false. - protected virtual bool OnWM_NCPAINT(ref Message m) - { - // Perform actual paint operation - if (!_disposing) - { - OnNonClientPaint(m.HWnd); - } - - // We have handled the message - m.Result = (IntPtr)1; - - // 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 OnWM_NCHITTEST(ref Message m) - { - // Extract the point in screen coordinates - Point screenPoint = new((int)m.LParam.ToInt64()); - - // Convert to window coordinates - Point windowPoint = ScreenToWindow(screenPoint); - - // Perform hit testing - m.Result = WindowChromeHitTest(windowPoint, false); - - // 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 - PlatformInvoke.Dwm.DwmDefWindowProc(m.HWnd, m.Msg, m.WParam, m.LParam, out IntPtr result); - m.Result = result; - - // If no result returned then let the base window routine process it - if (m.Result == (IntPtr)PlatformInvoke.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)PlatformInvoke.HT.CAPTION) || - (m.Result == (IntPtr)PlatformInvoke.HT.CLIENT)) - { - // Extract the point in screen coordinates - Point screenPoint = new((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. - /// - /// A Windows-based message. - /// True if the message was processed; otherwise false. - 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) - { - _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; - } - } - - return false; - } - - /// - /// Process a windows message that requires the non client area be repainted. - /// - /// A Windows-based message. - /// True if the message was processed; otherwise false. - protected virtual bool OnPaintNonClient(ref Message m) - { - // Let window be updated with new text - DefWndProc(ref m); - - // Need a repaint to show change - InvalidateNonClient(); - - // Message processed, do not pass onto base class for processing - return true; - } - - /// - /// Process the WM_NCMOUSEMOVE message when overriding window chrome. - /// - /// A Windows-based message. - /// True if the message was processed; otherwise false. - protected virtual bool OnWM_NCMOUSEMOVE(ref Message m) - { - // Extract the point in screen coordinates - Point screenPoint = new((int)m.LParam.ToInt64()); - - // 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); - - // If we are not tracking when the mouse leaves the non-client window - if (!_trackingMouse) - { - PlatformInvoke.TRACKMOUSEEVENTS tme = new() - { - // This structure needs to know its own size in bytes - cbSize = (uint)Marshal.SizeOf(typeof(PlatformInvoke.TRACKMOUSEEVENTS)), - dwHoverTime = 100, - - // We need to know then the mouse leaves the non client window area - dwFlags = PlatformInvoke.TME_LEAVE | PlatformInvoke.TME_NONCLIENT, - - // We want to track our own window - hWnd = Handle - }; - - // Call Win32 API to start tracking - PlatformInvoke.TrackMouseEvent(ref tme); - - // Do not need to track again until mouse reenters the window - _trackingMouse = true; - } - - // Indicate that we processed the message - m.Result = IntPtr.Zero; - - // Message processed, do not pass onto base class for processing - return true; - } - - /// - /// Process the WM_NCLBUTTONDOWN message when overriding window chrome. - /// - /// A Windows-based message.4 - /// True if the message was processed; otherwise false. - protected virtual bool OnWM_NCLBUTTONDOWN(ref Message m) - { - // Extract the point in screen coordinates - Point screenPoint = new((int)m.LParam.ToInt64()); - - // 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); - } - - /// - /// Process the WM_LBUTTONUP message when overriding window chrome. - /// - /// A Windows-based message. - /// True if the message was processed; otherwise false. - protected virtual bool OnWM_NCLBUTTONUP(ref Message m) - { - // Extract the point in screen coordinates - Point screenPoint = new((int)m.LParam.ToInt64()); - - // 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); - } - - /// - /// Process the WM_NCMOUSELEAVE message when overriding window chrome. - /// - /// A Windows-based message. - /// True if the message was processed; otherwise false. - protected virtual bool OnWM_NCMOUSELEAVE(ref Message m) - { - _blurManager.TakeSnapshot(); - // Next time the mouse enters the window we need to track it leaving - _trackingMouse = false; - - // Perform actual mouse leave actions - WindowChromeMouseLeave(); - - // Indicate that we processed the message - m.Result = IntPtr.Zero; - - // Need a repaint to show change - InvalidateNonClient(); - - // Message processed, do not pass onto base class for processing - return true; - } - - /// - /// Process the OnWM_MOUSEMOVE message when overriding window chrome. - /// - /// A Windows-based message. - /// True if the message was processed; otherwise false. - protected virtual bool OnWM_MOUSEMOVE(ref Message m) - { - // Extract the point in client coordinates - Point clientPoint = new((int)m.LParam); - - // Convert to screen coordinates - Point screenPoint = PointToScreen(clientPoint); - - // Convert to window coordinates - Point windowPoint = ScreenToWindow(screenPoint); - - // Perform actual mouse movement actions - WindowChromeNonClientMouseMove(windowPoint); - - return true; - } - - /// - /// Process the WM_LBUTTONUP message when overriding window chrome. - /// - /// A Windows-based message. - /// True if the message was processed; otherwise false. - protected virtual bool OnWM_LBUTTONUP(ref Message m) - { - // Capture has now expired - _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; - - // Extract the point in client coordinates - Point clientPoint = new((int)m.LParam); - - // Convert to screen coordinates - Point screenPoint = PointToScreen(clientPoint); - - // Convert to window coordinates - Point windowPoint = ScreenToWindow(screenPoint); - - // Pass message onto the view elements - ViewManager.MouseUp(new MouseEventArgs(MouseButtons.Left, 0, windowPoint.X, windowPoint.Y, 0), windowPoint); - - // Pass message onto the view elements - ViewManager.MouseLeave(EventArgs.Empty); - - // Need a repaint to show change - InvalidateNonClient(); - - return true; - } - - /// - /// Process the WM_NCLBUTTONDBLCLK message when overriding window chrome. - /// - /// A Windows-based message. - /// True if the message was processed; otherwise false. - protected virtual bool OnWM_NCLBUTTONDBLCLK(ref Message m) - { - // Extract the point in screen coordinates - Point screenPoint = new((int)m.LParam.ToInt64()); - - // Convert to window coordinates - Point windowPoint = ScreenToWindow(screenPoint); - - // Find the view element under the mouse - ViewBase? pointView = ViewManager.Root!.ViewFromPoint(windowPoint); - - // Try and find a mouse controller for the active view - IMouseController? controller = pointView?.FindMouseController(); - - // Eat the message - return controller != null; - } - - /// - /// Perform chrome window painting in the non-client areas. - /// - /// Window handle of window being painted. - protected virtual void OnNonClientPaint(IntPtr hWnd) - { - // Create rectangle that encloses the entire window - Rectangle windowBounds = RealWindowRectangle; - - // We can only draw a window that has some size - if ((windowBounds.Width > 0) && (windowBounds.Height > 0)) - { - // Get the device context for this window - IntPtr hDC = PlatformInvoke.GetWindowDC(Handle); - - // If we managed to get a device context - if (hDC != IntPtr.Zero) - { - try - { - // Find the rectangle that covers the client area of the form - Padding borders = RealWindowBorders; - Rectangle clipClientRect = new(borders.Left, borders.Top, - windowBounds.Width - borders.Horizontal, - windowBounds.Height - borders.Vertical); - - var minimized = CommonHelper.IsFormMinimized(this); - - // After excluding the client area, is there anything left to draw? - if (minimized || ((clipClientRect.Width > 0) && (clipClientRect.Height > 0))) - { - // If not minimized we need to clip the client area - if (!minimized) - { - // Exclude client area from being drawn into and bit blitted - PlatformInvoke.ExcludeClipRect(hDC, clipClientRect.Left, clipClientRect.Top, - clipClientRect.Right, clipClientRect.Bottom); - } - - // Create one the correct size and cache for future drawing - IntPtr hBitmap = PlatformInvoke.CreateCompatibleBitmap(hDC, windowBounds.Width, windowBounds.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. - PlatformInvoke.SelectObject(_screenDC, hBitmap); - - // Drawing is easier when using a Graphics instance - using (Graphics g = Graphics.FromHdc(_screenDC)) - { - WindowChromePaint(g, windowBounds); - } - - // Now blit from the bitmap to the screen - PlatformInvoke.BitBlt(hDC, 0, 0, windowBounds.Width, windowBounds.Height, _screenDC, 0, 0, PlatformInvoke.SRCCOPY); - } - finally - { - // Delete the temporary bitmap - PlatformInvoke.DeleteObject(hBitmap); - } - } - else - { - // Drawing is easier when using a Graphics instance - using Graphics g = Graphics.FromHdc(hDC); - WindowChromePaint(g, windowBounds); - } - } - } - finally - { - // Must always release the device context - PlatformInvoke.ReleaseDC(Handle, hDC); - } - } - } - - // Bump the number of paints that have occurred - PaintCount++; - } - - /// - /// Called when the active state of the window changes. - /// - protected virtual void OnWindowActiveChanged() => WindowActiveChanged?.Invoke(this, EventArgs.Empty); - - /// - /// Gets and sets the need to layout the view. - /// - protected bool NeedLayout { get; set; } - // ReSharper restore VirtualMemberNeverOverridden.Global - #endregion - - #region Protected Chrome - /// - /// Perform setup for custom chrome. - /// - protected virtual void WindowChromeStart() - { - } - - /// - /// Perform cleanup when custom chrome ending. - /// - protected virtual void WindowChromeEnd() - { - } - - /// - /// Perform hit testing. - /// - /// Point in window coordinates. - /// Are we performing composition. - /// - protected virtual IntPtr WindowChromeHitTest(Point pt, bool composition) => (IntPtr)PlatformInvoke.HT.CLIENT; - - /// - /// Perform painting of the window chrome. - /// - /// Graphics instance to use for drawing. - /// Bounds enclosing the window chrome. - protected virtual void WindowChromePaint(Graphics g, Rectangle bounds) - { - } - - /// - /// Perform non-client mouse movement processing. - /// - /// Point in window coordinates. - protected virtual void WindowChromeNonClientMouseMove(Point pt) => ViewManager.MouseMove(new MouseEventArgs(MouseButtons.None, 0, pt.X, pt.Y, 0), pt); - - /// - /// Process the left mouse down event. - /// - /// Window coordinate of the mouse down. - /// True if event is processed; otherwise false. - 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 - // Ask the controller if the mouse down should be ignored by wnd proc processing - IMouseController controller = ViewManager.ActiveView?.FindMouseController(); - return controller is { IgnoreVisualFormLeftButtonDown: true }; - } - - /// - /// Process the left mouse up event. - /// - /// Window coordinate of the mouse up. - /// True if event is processed; otherwise false. - protected virtual bool WindowChromeLeftMouseUp(Point pt) - { - ViewManager.MouseUp(new MouseEventArgs(MouseButtons.Left, 0, pt.X, pt.Y, 0), pt); - - // By default, we have not handled the mouse up event - return false; - } - - /// - /// Perform mouse leave processing. - /// - protected virtual void WindowChromeMouseLeave() => - // Pass message onto the view elements - ViewManager.MouseLeave(EventArgs.Empty); - - #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) - { - // We only care if we are using the global palette - if (PaletteMode == PaletteMode.Global) - { - // Update ourself with the new global palette - _localPalette = null; - SetPalette(KryptonManager.CurrentGlobalPalette); - Redirector.Target = _palette; - - // A new palette source means we need to layout and redraw - OnNeedPaint(Palette, new NeedLayoutEventArgs(true)); - - GlobalPaletteChanged?.Invoke(sender, e); - } - } - - private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e) - { - // If a change has occurred that could effect the color table then it needs regenerating - switch (e.Category) - { - case UserPreferenceCategory.Icon: - case UserPreferenceCategory.Menu: - case UserPreferenceCategory.Color: - case UserPreferenceCategory.VisualStyle: - case UserPreferenceCategory.General: - case UserPreferenceCategory.Window: - case UserPreferenceCategory.Desktop: - UpdateComposition(); - PerformNeedPaint(true); - break; - } - } - - private void SetPalette(PaletteBase? palette) - { - if (palette != _palette) - { - // Unhook from current palette events - if (_palette != null) - { - _palette.PalettePaint -= OnNeedPaint; - _palette.ButtonSpecChanged -= OnButtonSpecChanged; - _palette.AllowFormChromeChanged -= OnAllowFormChromeChanged; - _palette.BasePaletteChanged -= OnBaseChanged; - _palette.BaseRendererChanged -= OnBaseChanged; - } - - // Remember the new palette - _palette = palette; - - // Get the renderer associated with the palette - 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); - } - } - } - - 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); - } - -#if !NET462 - private void OnDpiChanged(object sender, DpiChangedEventArgs e) - { - UpdateDpiFactors(); - } -#endif - #endregion - - private void UpdateDpiFactors() - { - // Do not use the control dpi, as these values are being used to target the screen - IntPtr screenDc = PlatformInvoke.GetDC(IntPtr.Zero); - if (screenDc != IntPtr.Zero) - { - FactorDpiX = PlatformInvoke.GetDeviceCaps(screenDc, PlatformInvoke.DeviceCap.LOGPIXELSX) / 96f; - FactorDpiY = PlatformInvoke.GetDeviceCaps(screenDc, PlatformInvoke.DeviceCap.LOGPIXELSY) / 96f; - PlatformInvoke.ReleaseDC(IntPtr.Zero, screenDc); - } - else - { - // Do it the slow "init everything long way" - using Graphics graphics = Graphics.FromHwnd(IntPtr.Zero); - FactorDpiX = graphics.DpiX / 96f; - FactorDpiY = graphics.DpiY / 96f; - } - // _palette.HasAlreadyBeenScaled = false; - // PaletteImageScaler.ScalePalette(FactorDpiX, FactorDpiY, _palette); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VirtualKryptonFormExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VirtualKryptonFormExtended.cs deleted file mode 100644 index eb9a28d47..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VirtualKryptonFormExtended.cs +++ /dev/null @@ -1,1798 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -// ReSharper disable ConditionIsAlwaysTrueOrFalse -namespace Krypton.Toolkit.Suite.Extended.Forms -{ - /// - /// Draws the window chrome using a Krypton palette. - /// - [ToolboxItem(false)] - //[ToolboxBitmap(typeof(KryptonFormExtended), "ToolboxBitmaps.KryptonForm.bmp")] - //[Description(@"Draws the window chrome using a Krypton palette.")] - //[Designer("Krypton.Toolkit.Suite.Extended.Forms.KryptonFormExtendedDesigner, Krypton.Toolkit")] - public abstract class VirtualKryptonFormExtended : VirtualForm, IContentValues - { - #region Type Definitions - /// - /// Collection for managing ButtonSpecAny instances. - /// - public class FormButtonSpecCollection : ButtonSpecCollection - { - #region Identity - /// - /// Initialize a new instance of the FormButtonSpecCollection class. - /// - /// Reference to owning object. - public FormButtonSpecCollection(VirtualKryptonFormExtended owner) - : base(owner) - { - } - #endregion - } - - /// - /// Collection for managing NavigatorButtonSpec instances. - /// - public class FormFixedButtonSpecCollection : ButtonSpecCollection - { - #region Identity - /// - /// Initialize a new instance of the FormFixedButtonSpecCollection class. - /// - /// Reference to owning object. - public FormFixedButtonSpecCollection(VirtualKryptonFormExtended owner) - : base(owner) - { - } - #endregion - } - #endregion - - #region Static Fields - private static readonly Size CAPTION_ICON_SIZE = new(16, 16); - private const int HT_CORNER = 8; - // Drop shadow - private const int CS_DROPSHADOW = 0x00020000; - - private const int CP_NOCLOSE_BUTTON = 0x200; - #endregion - - #region Instance Fields - - private readonly FormFixedButtonSpecCollection _buttonSpecsFixed; - private readonly ButtonSpecManagerDraw _buttonManager; - private VisualPopupToolTip? _visualPopupToolTip; - private readonly ViewDrawForm _drawDocker; - private readonly ViewDrawDocker _drawHeading; - private readonly ViewDrawContent _drawContent; - private readonly ViewDecoratorFixedSize _headingFixedSize; - private readonly ViewLayoutNull _layoutNull; - private HeaderStyle _headerStyle; - private PaletteRelativeAlign _formTitleAlign; - private HeaderStyle _headerStylePrev; - private FormWindowState _regionWindowState; - private FormWindowState _lastWindowState; - private string _textExtra; - private string _oldText; - private static bool _isInAdministratorMode; - private bool _allowFormChrome; - private bool _allowStatusStripMerge; - private bool _recreateButtons; - private bool _firstCheckView; - private bool _lastNotNormal; - private bool _useDropShadow; - private bool _useWindows11StyleCornerRounding; - private StatusStrip? _statusStrip; - private Bitmap? _cacheBitmap; - private Icon? _cacheIcon; - private float _cornerRoundingRadius; - private Control _activeControl; - - #endregion - - #region Identity - /// - /// Initialize a new instance of the KryptonFormExtended class. - /// - public VirtualKryptonFormExtended() - { - // Default properties - _headerStyle = HeaderStyle.Form; - _formTitleAlign = PaletteRelativeAlign.Near; - _headerStylePrev = _headerStyle; - AllowButtonSpecToolTips = false; - _allowFormChrome = true; - _allowStatusStripMerge = true; - AllowIconDisplay = true; - _regionWindowState = FormWindowState.Normal; - _recreateButtons = true; - _firstCheckView = true; - _lastNotNormal = false; - - // Create storage objects - ButtonSpecs = new FormButtonSpecCollection(this); - _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 }); - - // Create the palette storage - StateCommon = new PaletteFormRedirect(Redirector, NeedPaintDelegate); - StateInactive = new PaletteForm(StateCommon, StateCommon.Header, NeedPaintDelegate); - StateActive = new PaletteForm(StateCommon, StateCommon.Header, NeedPaintDelegate); - - // Create a header to act as the form title bar - _drawHeading = new ViewDrawDocker(StateActive.Header.Back, - StateActive.Header.Border, - StateActive.Header, - PaletteMetricBool.None, - 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 - }; - - // Content draws the text and icon inside the title bar - _drawContent = new ViewDrawContent(StateActive.Header.Content, this, VisualOrientation.Top); - _drawHeading.Add(_drawContent, ViewDockStyle.Fill); - - // Create a decorator so that the heading has a fixed sized and not based on content - _headingFixedSize = new ViewDecoratorFixedSize(_drawHeading, Size.Empty); - - // Create a null element that takes up all remaining space - _layoutNull = new ViewLayoutNull(); - - // Create the root element that contains the title bar and null filler - _drawDocker = new ViewDrawForm(StateActive.Back, StateActive.Border) - { - { _headingFixedSize, ViewDockStyle.Top }, - { _layoutNull, ViewDockStyle.Fill } - }; - - // Create button specification collection manager - _buttonManager = new ButtonSpecManagerDraw(this, Redirector, ButtonSpecs, _buttonSpecsFixed, - new[] { _drawHeading }, - new IPaletteMetric[] { StateCommon.Header }, - new[] { PaletteMetricInt.HeaderButtonEdgeInsetForm }, - new[] { PaletteMetricPadding.HeaderButtonPaddingForm }, - CreateToolStripRenderer, - OnButtonManagerNeedPaint); - - // Create the manager for handling tooltips - ToolTipManager = new ToolTipManager(new(null)); - ToolTipManager.ShowToolTip += OnShowToolTip; - ToolTipManager.CancelToolTip += OnCancelToolTip; - _buttonManager.ToolTipManager = ToolTipManager; - - // Hook into global static events - KryptonManager.GlobalAllowFormChromeChanged += OnGlobalAllowFormChromeChanged; - KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged; - - // Create the view manager instance - ViewManager = new ViewManager(this, _drawDocker); - - // If Windows 11 or higher - if (Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build >= 22000) - { - _useWindows11StyleCornerRounding = true; - - CornerRoundingRadius = 5; - } - else - { - _useWindows11StyleCornerRounding = false; - - // Set the CornerRoundingRadius to 'GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE', default value - CornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE; - } - - // Disable 'UseDropShadow' on creation -#pragma warning disable CS0618 - UseDropShadow = false; -#pragma warning restore CS0618 - } - - /// - /// 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) - { - // Remove ant showing tooltip - OnCancelToolTip(this, EventArgs.Empty); - - // Remember to pull down the manager instance - _buttonManager.Destruct(); - - // Unhook from the global static events - KryptonManager.GlobalPaletteChanged -= OnGlobalPaletteChanged; - KryptonManager.GlobalAllowFormChromeChanged -= OnGlobalAllowFormChromeChanged; - - // Clear down the cached bitmap - if (_cacheBitmap != null) - { - _cacheBitmap.Dispose(); - _cacheBitmap = null; - } - - ButtonSpecMin.Dispose(); - ButtonSpecMax.Dispose(); - ButtonSpecClose.Dispose(); - } - - base.Dispose(disposing); - } - #endregion - - #region Public - /// - /// Gets or sets the extra text associated with the control. - /// - [Category(@"Appearance")] - [Description(@"The extra text associated with the control.")] - [DefaultValue("")] - public string TextExtra - { - get => _textExtra; - - set - { - _textExtra = value; - PerformNeedPaint(true); - } - } - - /// - /// 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 or sets a value indicating if custom chrome is allowed. - /// - [Category(@"Visuals")] - [Description(@"Should custom chrome be allowed for this KryptonFormExtended instance.")] - [DefaultValue(true)] - public bool AllowFormChrome - { - get => _allowFormChrome; - set - { - if (_allowFormChrome != value) - { - _allowFormChrome = value; - - // Do we want to switch on/off the custom chrome? - UpdateCustomChromeDecision(); - } - } - } - - /// - /// Gets or sets a value indicating if the form status strip be considered for merging into chrome. - /// - [Category(@"Visuals")] - [Description(@"Should the form status strip be considered for merging into chrome.")] - [DefaultValue(true)] - public bool AllowStatusStripMerge - { - get => _allowStatusStripMerge; - set - { - if (_allowStatusStripMerge != value) - { - _allowStatusStripMerge = value; - - _statusStrip?.Invalidate(); - - PerformNeedPaint(false); - } - } - } - - /// - /// Gets and sets the header style for a main form. - /// - [Category(@"Visuals")] - [Description(@"Header style for a main form.")] - [DefaultValue(typeof(HeaderStyle), "Form")] - public HeaderStyle HeaderStyle - { - get => _headerStyle; - - set - { - if (_headerStyle != value) - { - _headerStyle = value; - PerformNeedPaint(false); - } - } - } - - /// - /// Gets and sets the header edge to display the button against. - /// - [Category(@"Visuals")] - [Description(@"The Form Title position, relative to available space")] - [RefreshProperties(RefreshProperties.All)] - [DefaultValue(typeof(PaletteRelativeAlign), "Near")] - public PaletteRelativeAlign FormTitleAlign - { - get => _formTitleAlign; - - set - { - if (_formTitleAlign != value) - { - _formTitleAlign = value; - PerformNeedPaint(true); - } - } - } - - private bool ShouldSerializeFormTitleAlign() => _formTitleAlign != PaletteRelativeAlign.Near; - - private void ResetFormTitleAlign() => _formTitleAlign = PaletteRelativeAlign.Near; - - /// - /// Gets and sets the chrome group border style. - /// - [Category(@"Visuals")] - [Description(@"Chrome group border style.")] - [DefaultValue(typeof(PaletteBorderStyle), "FormMain")] - public PaletteBorderStyle GroupBorderStyle - { - get => StateCommon.BorderStyle; - - set - { - if (StateCommon.BorderStyle != value) - { - StateCommon.BorderStyle = value; - PerformNeedPaint(false); - } - } - } - - /// - /// Gets and sets the chrome group background style. - /// - [Category(@"Visuals")] - [Description(@"Chrome group background style.")] - [DefaultValue(typeof(PaletteBackStyle), "FormMain")] - public PaletteBackStyle GroupBackStyle - { - get => StateCommon.BackStyle; - - set - { - if (StateCommon.BackStyle != value) - { - StateCommon.BackStyle = value; - PerformNeedPaint(false); - } - } - } - - /// - /// Allows the use of drop shadow around the form. - /// - [Category(@"Visuals")] - [Description(@"Allows the use of drop shadow around the form.")] - [DefaultValue(false)] - [Obsolete("Deprecated - Only use if you are using Windows 7, 8 or 8.1.")] - public bool UseDropShadow - { - get => _useDropShadow; - - set - { - _useDropShadow = value; - - UpdateDropShadowDraw(_useDropShadow); - } - } - - /// - /// Gets or sets a value indicating whether this instance is in administrator mode. - /// - /// - /// true if this instance is in administrator mode; otherwise, false. - /// - [Category(@"Appearance"), Description(@"Is the user currently an administrator.")] - public bool IsInAdministratorMode { get => _isInAdministratorMode; private set => _isInAdministratorMode = value; } - - /// - /// Gets access to the common form appearance entries that other states can override. - /// - [Category(@"Visuals")] - [Description(@"Overrides for defining common form appearance that other states can override.")] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] - public PaletteFormRedirect StateCommon { get; } - - private bool ShouldSerializeStateCommon() => !StateCommon.IsDefault; - - /// - /// Gets access to the inactive form appearance entries. - /// - [Category(@"Visuals")] - [Description(@"Overrides for defining inactive form appearance.")] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] - public PaletteForm StateInactive { get; } - - private bool ShouldSerializeStateInactive() => !StateInactive.IsDefault; - - /// - /// Gets access to the active form appearance entries. - /// - [Category(@"Visuals")] - [Description(@"Overrides for defining active form appearance.")] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] - public PaletteForm StateActive { get; } - - private bool ShouldSerializeStateActive() => !StateActive.IsDefault; - - /// - /// Gets the collection of button specifications. - /// - [Category(@"Visuals")] - [Description(@"Collection of button specifications.")] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] - public FormButtonSpecCollection ButtonSpecs { get; } - - /// - /// Gets access to the minimize button spec. - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public ButtonSpecFormWindowMin ButtonSpecMin { get; } - - /// - /// Gets access to the minimize button spec. - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public ButtonSpecFormWindowMax ButtonSpecMax { get; } - - /// - /// Gets access to the minimize button spec. - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public ButtonSpecFormWindowClose ButtonSpecClose { get; } - - /// - /// Gets and sets a value indicating if the border should be inert to changes. - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public bool InertForm { get; set; } - - /// - /// Allow an extra view element to be injected into the caption area. - /// - /// Reference to view element. - /// Docking style of the element. - [EditorBrowsable(EditorBrowsableState.Never)] - public void InjectViewElement(ViewBase? element, ViewDockStyle style) - { - Debug.Assert(element != null); - Debug.Assert(_drawHeading != null); - - if (!IsDisposed) - { - // If injecting a new fill item for the caption content area - if (style == ViewDockStyle.Fill) - { - // Incoming element must be a ViewLayoutDocker - if (element is ViewLayoutDocker docker) - { - // Remove the existing content - if (_drawHeading != null) - { - _drawHeading.Remove(_drawContent); - - // Add new element and put content inside it - _drawHeading.Add(docker, ViewDockStyle.Fill); - } - - docker.Add(_drawContent, ViewDockStyle.Fill); - } - } - else - { - // Just add to the docking edge requested - if (_drawHeading != null) - { - _drawHeading.Add(element!, style); - } - } - } - } - - /// - /// Remove a previously injected view element from the caption area. - /// - /// Reference to view element. - /// Docking style of the element. - [EditorBrowsable(EditorBrowsableState.Never)] - public void RevokeViewElement(ViewBase? element, ViewDockStyle style) - { - Debug.Assert(element != null); - - if (!IsDisposed) - { - // If revoking the fill item for the caption content area - if (style == ViewDockStyle.Fill) - { - // Incoming element must be a ViewLayoutDocker - if (element is ViewLayoutDocker docker) - { - // Remove the existing content - docker.Remove(_drawContent); - _drawHeading.Remove(docker); - - // Add back the original content - _drawHeading.Add(_drawContent, ViewDockStyle.Fill); - } - } - else - { - // Just remove the specified elements - _drawHeading.Remove(element!); - } - } - } - - /// - /// Gets and sets a value indicating if the icon is allowed to be shown. - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public bool AllowIconDisplay { get; set; } - - /// - /// Next time a layout occurs the min/max/close buttons need recreating. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void RecreateMinMaxCloseButtons() - { - _recreateButtons = true; - } - - /// - /// Gets access to the ToolTipManager used for displaying tool tips. - /// - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public ToolTipManager ToolTipManager { get; } - - /// - /// Gets the current state of the window. - /// - /// FormWindowState enumeration value. - [EditorBrowsable(EditorBrowsableState.Never)] - public FormWindowState GetWindowState() - { - // Get the current window style (cannot use the - // WindowState property as it can be slightly out of date) - var style = PlatformInvoke.GetWindowLong(Handle, PlatformInvoke.GWL_.STYLE); - - if ((style & PlatformInvoke.WS_.MINIMIZE) != 0) - { - return FormWindowState.Minimized; - } - else - { - return (style & PlatformInvoke.WS_.MAXIMIZE) != 0 ? FormWindowState.Maximized : FormWindowState.Normal; - } - } - - /// Gets or sets the corner rounding radius. - /// The corner rounding radius. - [DefaultValue(-1), Description(@"Defines the corner roundness on the current window (-1 is the default look).")] - public float CornerRoundingRadius - { - get => _cornerRoundingRadius; - set - { - _cornerRoundingRadius = value; - Invalidate(); - } - } - - /// Gets or sets the active control on the container control. - [DefaultValue(null), Description(@"Defines an active control for this window.")] - public new Control ActiveControl - { - get => _activeControl; - - set - { - if (_activeControl != value) - { - _activeControl = value; - - _activeControl.Focus(); - } - else - { - _activeControl.Focus(); - } - } - } - - #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. - /// - /// Window relative point to test. - /// True if inside the button; otherwise false. - public bool HitTestMinButton(Point pt) => _buttonManager.GetButtonRectangle(ButtonSpecMin).Contains(pt); - - /// - /// Gets a value indicating if the provided point is inside the maximize button. - /// - /// Window relative point to test. - /// True if inside the button; otherwise false. - public bool HitTestMaxButton(Point pt) => _buttonManager.GetButtonRectangle(ButtonSpecMax).Contains(pt); - - /// - /// Gets a value indicating if the provided point is inside the close button. - /// - /// Window relative point to test. - /// True if inside the button; otherwise false. - public bool HitTestCloseButton(Point pt) => _buttonManager.GetButtonRectangle(ButtonSpecClose).Contains(pt); - - /// - /// Gets and sets a rectangle to treat as a custom caption area. - /// - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - public Rectangle CustomCaptionArea { get; set; } - - #endregion - - #region Public IContentValues - /// - /// Gets the image used for showing on the title bar. - /// - /// Form state. - /// Image. - public Image? GetImage(PaletteState state) - { - Icon? displayIcon = GetDefinedIcon(); - - // Has the icon to be Displayed changed since the last time around? - if (displayIcon != _cacheIcon) - { - // Clear down the cached bitmap - if (_cacheBitmap != null) - { - _cacheBitmap.Dispose(); - _cacheBitmap = null; - } - - // Clear down the cached icon - _cacheIcon = null; - } - - // Do we need to create a cached bitmap for the display icon? - if ((displayIcon != null) && (_cacheBitmap == null)) - { - // Remember the icon used to generate the cached bitmap - _cacheIcon = displayIcon; - - // Currently the `FactorDpi#`'s do _NOT_ change whilst the app is running - //if ((ViewButton.FactorDpiX != _lastFactorDpiX) - // || (ViewButton.FactorDpiY != _lastFactorDpiY) - // ) - //{ - // Image needs to be regenerated - var currentWidth = (int)(CAPTION_ICON_SIZE.Width * FactorDpiX); - var currentHeight = (int)(CAPTION_ICON_SIZE.Height * FactorDpiY); - //} - - Bitmap? resizedBitmap = null; - try - { - using var temp = new Icon(_cacheIcon, currentWidth, currentHeight); - resizedBitmap = temp.ToBitmap(); - } - catch - { - try - { - // Failed so we convert the Icon directly instead of trying to get a sized version first - resizedBitmap = _cacheIcon.ToBitmap(); - } - catch - { - // Do nothing - } - } - - // Cache for future access - if (resizedBitmap != null) - { - _cacheBitmap = CommonHelper.ScaleImageForSizedDisplay(resizedBitmap, currentWidth, currentHeight); - } - } - - return _cacheBitmap; - } - - /// - /// Gets the image color that should be interpreted as transparent. - /// - /// Form state. - /// Transparent Color. - public Color GetImageTransparentColor(PaletteState state) => - // We never mark any color as transparent - Color.Empty; - - /// - /// Gets the short text used as the main caption title. - /// - /// Title string. - public string GetShortText() => - // Return the existing form text property. - Text; - - /// - /// Gets the long text used as the secondary caption title. - /// - /// Title string. - public string GetLongText() => _textExtra; - - #endregion - - #region Protected Override - /// - /// Create the redirector instance. - /// - /// PaletteRedirect derived class. - protected override PaletteRedirect CreateRedirector() => new FormPaletteRedirect(GetResolvedPalette(), this); - - internal class FormPaletteRedirect : PaletteRedirect - { - private readonly VirtualKryptonFormExtended _kryptonForm; - - public FormPaletteRedirect(PaletteBase? palette, VirtualKryptonFormExtended kryptonForm) - : base(palette) => - _kryptonForm = kryptonForm; - - public override PaletteRelativeAlign GetContentShortTextH(PaletteContentStyle style, PaletteState state) - { - return style switch - { - PaletteContentStyle.HeaderForm - or PaletteContentStyle.HeaderPrimary - or PaletteContentStyle.HeaderDockInactive - or PaletteContentStyle.HeaderDockActive - or PaletteContentStyle.HeaderSecondary - or PaletteContentStyle.HeaderCustom1 - or PaletteContentStyle.HeaderCustom2 - or PaletteContentStyle.HeaderCustom3 => _kryptonForm._formTitleAlign != PaletteRelativeAlign.Inherit - ? _kryptonForm._formTitleAlign - : base.GetContentShortTextH(style, state), - _ => base.GetContentShortTextH(style, state) - }; - } - } - - /// - /// Raises the ControlAdded event. - /// - /// An EventArgs containing event data. - protected override void OnControlAdded(ControlEventArgs e) - { - // Is this the type of control we need to watch? - if (e.Control is StatusStrip strip) - { - // Start monitoring the status strip change in state - MonitorStatusStrip(strip); - - // Recalc to test if status strip should be integrated - RecalcNonClient(); - } - - base.OnControlAdded(e); - } - - /// - /// Raises the ControlRemoved event. - /// - /// An EventArgs containing event data. - protected override void OnControlRemoved(ControlEventArgs e) - { - // Is the cached reference being removed? - if (_statusStrip == e.Control) - { - // Unhook from status strip events - UnmonitorStatusStrip(); - - // Recalc to test if status strip should be unintegrated - RecalcNonClient(); - } - } - - /// - /// Raises the Load event. - /// - /// An EventArgs containing event data. - protected override void OnLoad(EventArgs e) - { - // Let base class perform standard actions such as calculating the - // correct initial size and position of the window when first shown - base.OnLoad(e); - - // We only apply custom chrome when control is already created and positioned - UpdateCustomChromeDecision(); - } - - /// - /// Raises the TextChanged event. - /// - /// An EventArgs containing event data. - protected override void OnTextChanged(EventArgs e) - { - base.OnTextChanged(e); - PerformNeedPaint(true); - } - - /// - /// Processes a notification from palette storage of a button spec change. - /// - /// Source of notification. - /// An EventArgs containing event data. - /// - protected override void OnButtonSpecChanged(object sender, EventArgs e) - { - Debug.Assert(e != null); - - // Validate incoming reference - if (e == null) - { - throw new ArgumentNullException(nameof(e)); - } - - // Recreate all the button specs with new values - _buttonManager.RecreateButtons(); - } - - /// - /// Called when the active state of the window changes. - /// - protected override void OnWindowActiveChanged() - { - // Update to use the correct state override values - if (WindowActive) - { - _drawDocker.SetPalettes(StateActive.Back, StateActive.Border); - _drawHeading.SetPalettes(StateActive.Header.Back, StateActive.Header.Border); - _drawContent.SetPalette(StateActive.Header.Content); - } - else - { - _drawDocker.SetPalettes(StateInactive.Back, StateInactive.Border); - _drawHeading.SetPalettes(StateInactive.Header.Back, StateInactive.Header.Border); - _drawContent.SetPalette(StateInactive.Header.Content); - } - - _drawDocker.Enabled = WindowActive; - _drawHeading.Enabled = WindowActive; - _drawContent.Enabled = WindowActive; - - // Only need to redraw if showing custom chrome - if (ApplyCustomChrome) - { - PerformNeedPaint(false); - } - - base.OnWindowActiveChanged(); - } - - /// - /// Raises the PaletteChanged event. - /// - /// An EventArgs containing the event data. - protected override void OnPaletteChanged(EventArgs e) - { - // Let base class switch the palette over - base.OnPaletteChanged(e); - - // Test if we need to change the custom chrome usage - UpdateCustomChromeDecision(); - } - - /// - /// Occurs when the AllowFormChromeChanged 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) => - // Test if we need to change the custom chrome usage - UpdateCustomChromeDecision(); - - protected override void OnFormClosing(FormClosingEventArgs e) - { - base.OnFormClosing(e); - } - - #endregion - - #region Protected Chrome - /// - /// Perform setup for custom chrome. - /// - protected override void WindowChromeStart() - { - // Make sure the views for the buttons are created - if (_recreateButtons) - { - _buttonManager.RecreateButtons(); - _recreateButtons = false; - } - - // Need to perform a layout - PerformNeedPaint(true); - - base.WindowChromeStart(); - } - - /// - /// Perform cleanup when custom chrome ending. - /// - protected override void WindowChromeEnd() - { - // Remove any region begin used to shape the form - UpdateBorderRegion(null); - - base.WindowChromeEnd(); - } - - /// - /// Perform hit testing. - /// - /// Point in window coordinates. - /// Are we performing composition. - /// - protected override IntPtr WindowChromeHitTest(Point pt, bool composition) - { - Point originalPt = pt; - if ((CustomCaptionArea != null) && CustomCaptionArea.Contains(pt)) - { - return (IntPtr)PlatformInvoke.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)) - { - // 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; - } - } - } - - // Do not allow the caption to be moved or the border resized - if (InertForm) - { - return (IntPtr)PlatformInvoke.HT.CLIENT; - } - - using (ViewLayoutContext context = new(this, Renderer)) - { - // Discover if the form icon is being Displayed - if (_drawContent.IsImageDisplayed(context)) - { - // Is the mouse over the image area - if (_drawContent.ImageRectangle(context).Contains(pt)) - { - return (IntPtr)PlatformInvoke.HT.MENU; - } - } - } - - 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 - }; - - // 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. - if (borders.Top > borders.Left) - { - borders.Top = borders.Left; - } - - // Get the elements that contains the mouse point - ViewBase? mouseView = ViewManager.Root!.ViewFromPoint(pt); - - // Scan up the view hierarchy until a recognized element is found - while (mouseView != null) - { - // Is mouse over the caption bar? - if (mouseView == _drawHeading) - { - // We give priority to the areas that are used to resize the window - if ((pt.X > borders.Left) && - (pt.X < (Width - borders.Right)) && - (pt.Y > borders.Top) && - (pt.Y < (Height - borders.Bottom))) - { - return (IntPtr)PlatformInvoke.HT.CAPTION; - } - } - - // Is mouse over one of the borders? - if (mouseView == _drawDocker) - { - // Is point over the left border? - if ((borders.Left > 0) && (pt.X <= borders.Left)) - { - if (pt.Y <= HT_CORNER) - { - return (IntPtr)PlatformInvoke.HT.TOPLEFT; - } - - return pt.Y >= (Height - HT_CORNER) ? (IntPtr)PlatformInvoke.HT.BOTTOMLEFT : (IntPtr)PlatformInvoke.HT.LEFT; - } - - // Is point over the right border? - if ((borders.Right > 0) && (pt.X >= (Width - borders.Right))) - { - if (pt.Y <= HT_CORNER) - { - return (IntPtr)PlatformInvoke.HT.TOPRIGHT; - } - - return pt.Y >= (Height - HT_CORNER) ? (IntPtr)PlatformInvoke.HT.BOTTOMRIGHT : (IntPtr)PlatformInvoke.HT.RIGHT; - } - - // Is point over the bottom border? - if ((borders.Bottom > 0) && (pt.Y >= (Height - borders.Bottom))) - { - if (pt.X <= HT_CORNER) - { - return (IntPtr)PlatformInvoke.HT.BOTTOMLEFT; - } - - return pt.X >= (Width - HT_CORNER) ? (IntPtr)PlatformInvoke.HT.BOTTOMRIGHT : (IntPtr)PlatformInvoke.HT.BOTTOM; - } - - // Is point over the top border? - if ((borders.Top > 0) && (pt.Y <= borders.Top)) - { - if (pt.X <= HT_CORNER) - { - return (IntPtr)PlatformInvoke.HT.TOPLEFT; - } - - return pt.X >= (Width - HT_CORNER) ? (IntPtr)PlatformInvoke.HT.TOPRIGHT : (IntPtr)PlatformInvoke.HT.TOP; - } - } - - // Mouse up another level - mouseView = mouseView.Parent; - } - - return base.WindowChromeHitTest(originalPt, composition); - } - - /// - /// Perform painting of the window chrome. - /// - /// Graphics instance to use for drawing. - /// Bounds enclosing the window chrome. - protected override void WindowChromePaint(Graphics g, Rectangle bounds) - { - CheckViewLayout(); - PerformViewPaint(g, bounds); - } - - /// - /// Process the WM_NCLBUTTONDOWN message when overriding window chrome. - /// - /// A Windows-based message.4 - /// True if the message was processed; otherwise false. - protected override bool OnWM_NCLBUTTONDOWN(ref Message m) - { - using ViewLayoutContext context = new(this, Renderer); - // Discover if the form icon is being Displayed - if (_drawContent.IsImageDisplayed(context)) - { - // Extract the point in screen coordinates - Point screenPoint = new((int)m.LParam.ToInt64()); - - // 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)) - { - // TODO: Use `GetSystemMenu` to obtain the system menu and convert into a KryptonContextMenu with the correct theming ! - - // Make this work for the offset Application Icon when ButtonSpecs are left aligned - PlatformInvoke.PostMessage(this.Handle, PlatformInvoke.WM_.CONTEXTMENU, this.Handle, m.LParam); - return true; - } - } - - return base.OnWM_NCLBUTTONDOWN(ref m); - } - - /// - /// Process the left mouse down event. - /// - /// Window coordinate of the mouse down. - /// True if event is processed; otherwise false. - protected override bool WindowChromeLeftMouseDown(Point windowPoint) - { - // Let base class perform standard processing of the event - var ret = base.WindowChromeLeftMouseDown(windowPoint); - - // Has pressing down made a view active and indicated it also wants to capture mouse? - if ((ViewManager.ActiveView != null) && ViewManager.MouseCaptured) - { - StartCapture(ViewManager.ActiveView); - ret = true; - } - - return ret; - } - #endregion - - #region Implementation - private Icon? GetDefinedIcon() - { - // Are we allowed to try and show an icon? - if (AllowIconDisplay) - { - // Only some of the border styles show an icon - switch (FormBorderStyle) - { - case FormBorderStyle.Sizable: - case FormBorderStyle.Fixed3D: - case FormBorderStyle.FixedSingle: - // Only show icon if Form properties allow it - if (ShowIcon && ControlBox) - { - return Icon; - } - - break; - } - } - - return null; - } - - private void SetHeaderStyle(ViewDrawDocker drawDocker, - PaletteTripleMetricRedirect palette, - HeaderStyle style) - { - palette.SetStyles(style); - - switch (style) - { - case HeaderStyle.Primary: - _buttonManager.SetDockerMetrics(drawDocker, palette, - PaletteMetricInt.HeaderButtonEdgeInsetPrimary, - PaletteMetricPadding.HeaderButtonPaddingPrimary); - break; - case HeaderStyle.Secondary: - _buttonManager.SetDockerMetrics(drawDocker, palette, - PaletteMetricInt.HeaderButtonEdgeInsetSecondary, - PaletteMetricPadding.HeaderButtonPaddingSecondary); - break; - case HeaderStyle.DockActive: - _buttonManager.SetDockerMetrics(drawDocker, palette, - PaletteMetricInt.HeaderButtonEdgeInsetDockActive, - PaletteMetricPadding.HeaderButtonPaddingDockActive); - break; - case HeaderStyle.DockInactive: - _buttonManager.SetDockerMetrics(drawDocker, palette, - 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); - break; - } - } - - private bool CheckViewLayout() - { - // Cannot process a message for a disposed control - if (!IsDisposed && !Disposing) - { - // Do we have a manager to use for laying out? - if (ViewManager != null) - { - // Make sure the max/restore setting is correct - ButtonSpecMax.ButtonSpecType = WindowState == FormWindowState.Maximized - ? PaletteButtonSpecStyle.FormRestore - : PaletteButtonSpecStyle.FormMax; - - // Make sure the min/restore setting is correct - if (WindowState == FormWindowState.Minimized) - { - ButtonSpecMin.ButtonSpecType = PaletteButtonSpecStyle.FormRestore; - _drawDocker.StatusStrip = null; - } - else - { - ButtonSpecMin.ButtonSpecType = PaletteButtonSpecStyle.FormMin; - - // Make sure the top level form docker has the status strip being merged - _drawDocker.StatusStrip = StatusStripMerging ? _statusStrip : null; - } - - // Recreate buttons to get latest state - _buttonManager.RefreshButtons(); - - // Never set the header style unless it has changed, as it causes a relayout - if (_headerStyle != _headerStylePrev) - { - // Ensure the header style matches the form border style - SetHeaderStyle(_drawHeading, StateCommon.Header, _headerStyle); - - // Remember last header style set - _headerStylePrev = _headerStyle; - } - - // Update the heading to have a height matching the window requirements - 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()) - { - _lastWindowState = GetWindowState(); - NeedLayout = true; - } - - // Text can change because of a minimized/maximized MDI child so need - // to watch out for the change and ensure a layout occurs - if (_oldText != GetShortText()) - { - _oldText = GetShortText(); - NeedLayout = true; - } - - // If any of the buttons are tracking or pressed then need to layout - if (!NeedLayout) - { - var notNormal = false; - foreach (ButtonSpecView bsv in _buttonManager.ButtonSpecViews) - { - switch (bsv.ViewButton!.State) - { - case PaletteState.Tracking: - case PaletteState.Pressed: - notNormal = true; - break; - } - } - - if (_lastNotNormal != notNormal) - { - _lastNotNormal = notNormal; - NeedLayout = true; - } - } - - // Is a layout required? - if (NeedLayout - || (GetDefinedIcon() != _cacheIcon) - ) - { - // Ask the view to perform a layout - using (var context = new ViewLayoutContext(ViewManager, this, RealWindowRectangle, Renderer)) - { - ViewManager.Layout(context); - } - - // Layout not needed until next indicated - NeedLayout = false; - - // If in the maximized state we manually create the region - if (GetWindowState() == FormWindowState.Maximized) - { - UpdateRegionForMaximized(); - } - else - { - // 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 - using RenderContext context = new(this, null, Bounds, Renderer); - using GraphicsPath? path = _drawDocker.GetOuterBorderPath(context); - if (!_firstCheckView) - { - SuspendPaint(); - } - - UpdateBorderRegion(path != null ? new Region(path) : null); - - if (!_firstCheckView) - { - ResumePaint(); - } - } - - // Next time around we suspend/resume the drawing - _firstCheckView = false; - return true; - } - } - } - - return false; - } - - private void PerformViewPaint(Graphics g, Rectangle rect) - { - // Cannot process a message for a disposed control - if (!IsDisposed && !Disposing && (ViewManager != null)) - { - // 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)) - { - UpdateRegionForMaximized(); - } - - // We draw the main form and header background - _drawDocker.DrawCanvas = true; - _drawHeading.DrawCanvas = true; - - // Perform actual painting of the view - ViewManager.Paint(Renderer, new PaintEventArgs(g, rect)); - } - } - - private void UpdateRegionForMaximized() - { - if (MdiParent == null) - { - // Get the size of each window border - Padding padding = RealWindowBorders; - - // Reduce the Bounds by the padding on all but the top - Rectangle maximizedRect = new(padding.Left, padding.Left, - Width - padding.Horizontal, - Height - padding.Left - padding.Bottom); - - // Use this as the new region - SuspendPaint(); - _regionWindowState = FormWindowState.Maximized; - UpdateBorderRegion(new Region(maximizedRect)); - ResumePaint(); - } - else - { - // As a maximized Mdi Child we do not need any border region - UpdateBorderRegion(null); - } - } - - private void UpdateBorderRegion(Region? newRegion) - { - if ((newRegion != null) - && (newRegion.IsEmpty(this.CreateGraphics())) - ) - { - return; - } - - // Cache the current region setting - Region oldRegion = Region; - - // Use the new region - Region = newRegion; - - // Cleanup old region gracefully - oldRegion?.Dispose(); - } - - private void UpdateCustomChromeDecision() - { - if (IsHandleCreated) - { - // Decide if we should have custom chrome applied - var needChrome = AllowFormChrome && - KryptonManager.AllowFormChrome && - (GetResolvedPalette().GetAllowFormChrome() == InheritBool.True); - - // Is there a change in custom chrome requirement? - if (ApplyCustomChrome != needChrome) - { - _recreateButtons = true; - _firstCheckView = true; - ApplyCustomChrome = needChrome; - PerformNeedPaint(needChrome); - } - } - } - - internal bool StatusStripMerging => _allowStatusStripMerge - && _statusStrip is { Visible: true, Dock: DockStyle.Bottom } - && (_statusStrip.Bottom == ClientRectangle.Bottom) - && (_statusStrip.RenderMode == ToolStripRenderMode.ManagerRenderMode) - && (ToolStripManager.Renderer is KryptonOffice2007Renderer or KryptonSparkleRenderer); - - private void MonitorStatusStrip(StatusStrip? statusStrip) - { - if (_statusStrip != null) - { - UnmonitorStatusStrip(); - } - - // Hook into event handlers - _statusStrip = statusStrip; - _statusStrip!.VisibleChanged += OnStatusVisibleChanged; - _statusStrip.DockChanged += OnStatusDockChanged; - } - - private void UnmonitorStatusStrip() - { - if (_statusStrip != null) - { - // Unhook from event handlers - _statusStrip.VisibleChanged -= OnStatusVisibleChanged; - _statusStrip.DockChanged -= OnStatusDockChanged; - _statusStrip = null; - } - } - - 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()!; - if (topForm is { ContainsFocus: false }) - { - return; - } - - // Never show tooltips are design time - if (!DesignMode) - { - IContentValues? sourceContent = null; - LabelStyle toolTipStyle = LabelStyle.ToolTip; - bool shadow = true; - - // Find the button spec associated with the tooltip request - ButtonSpec? buttonSpec = _buttonManager.ButtonSpecFromView(e.Target); - - // If the tooltip is for a button spec - if (buttonSpec != null) - { - // Are we allowed to show page related tooltips - if (AllowButtonSpecToolTips) - { - // Create a helper object to provide tooltip values - ButtonSpecToContent? buttonSpecMapping = new(Redirector, buttonSpec); - - // Is there actually anything to show for the tooltip - if (buttonSpecMapping.HasContent) - { - sourceContent = buttonSpecMapping; - toolTipStyle = buttonSpec.ToolTipStyle; - shadow = buttonSpec.ToolTipShadow; - } - } - } - - if (sourceContent != null) - { - // Remove any currently showing tooltip - _visualPopupToolTip?.Dispose(); - - // Create the actual tooltip popup object - _visualPopupToolTip = new VisualPopupToolTip(Redirector, - sourceContent, - Renderer, - PaletteBackStyle.ControlToolTip, - PaletteBorderStyle.ControlToolTip, - CommonHelper.ContentStyleFromLabelStyle(toolTipStyle), - shadow); - - _visualPopupToolTip.Disposed += OnVisualPopupToolTipDisposed; - - // Show relative to the provided screen point - _visualPopupToolTip.ShowCalculatingSize(e.ControlMousePosition); - } - } - } - } - - private void OnCancelToolTip(object sender, EventArgs e) => - // Remove any currently showing tooltip - _visualPopupToolTip?.Dispose(); - - private void OnVisualPopupToolTipDisposed(object sender, EventArgs e) - { - // Unhook events from the specific instance that generated event - VisualPopupToolTip popupToolTip = (VisualPopupToolTip)sender; - popupToolTip.Disposed -= OnVisualPopupToolTipDisposed; - - // Not showing a popup page any more - _visualPopupToolTip = null; - } - - private void OnButtonManagerNeedPaint(object? sender, NeedLayoutEventArgs e) - { - // Only interested in optimizing specific button spec changes - if (sender is ButtonSpecView bsView) - { - ButtonSpec bs = bsView.ButtonSpec; - - // Only interest in the three form level buttons, as we know - // these never change in size because of a paint request - if ((bs == ButtonSpecMin) || - (bs == ButtonSpecMax) || - (bs == ButtonSpecClose)) - { - // Translate the button rectangle into the non client area - Rectangle buttonRect = bsView.ViewButton!.ClientRectangle; - Padding borders = RealWindowBorders; - buttonRect.X -= borders.Left; - buttonRect.Y -= borders.Top; - - // Only invalidate the actual button area itself - OnNeedPaint(sender, new NeedLayoutEventArgs(false, buttonRect)); - return; - } - } - - OnNeedPaint(sender, e); - } - - private void OnStatusDockChanged(object sender, EventArgs e) - { - if (StatusStripMerging) - { - PerformNeedPaint(false); - } - } - - private void OnStatusVisibleChanged(object sender, EventArgs e) - { - if (StatusStripMerging) - { - PerformNeedPaint(false); - } - } - - private void OnGlobalAllowFormChromeChanged(object sender, EventArgs e) => UpdateCustomChromeDecision(); - - private void OnGlobalPaletteChanged(object sender, EventArgs e) - { - // We only care if we are using the global palette - if (PaletteMode == PaletteMode.Global) - { - UpdateCustomChromeDecision(); - } - } - #endregion - - #region Drop Shadow Methods - /// - /// Calls the method that draws the drop shadow around the form. - /// - /// Use dropshadow user input value. - public void UpdateDropShadowDraw(bool useDropShadow) - { - if (useDropShadow) - { - DrawDropShadow(); - } - - Invalidate(); - } - - /// - /// A wrapper that draws the drop shadow around the form. - /// - /// The shadow around the form. - private void DrawDropShadow() - { - GetCreateParams(); - - // Redraw - Invalidate(); - } - - /// - /// Test code - /// - /// The overrides - private CreateParams GetCreateParams() - { - CreateParams cp = base.CreateParams; - - return cp; - } - - /// - /// Example by juverpp - /// - protected override CreateParams CreateParams - { - get - { - // add the drop shadow flag for automatically drawing - // a drop shadow around the form - CreateParams cp = base.CreateParams; - -#pragma warning disable CS0618 // Type or member is obsolete - if (UseDropShadow) - { - cp.ClassStyle |= CS_DROPSHADOW; - } - - if (!CloseBox) - { - cp.ClassStyle |= CP_NOCLOSE_BUTTON; - } -#pragma warning restore CS0618 // Type or member is obsolete - - return cp; - } - } - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VisualForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VisualForm.cs new file mode 100644 index 000000000..1f9e48248 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VisualForm.cs @@ -0,0 +1,1803 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Forms +{ + /// + /// Base class that allows a form to have custom chrome applied. You should derive + /// a class from this that performs the specific chrome drawing that is required. + /// Taken from + /// + [ToolboxItem(false)] + public abstract class VisualForm : Form, IKryptonDebug + { + #region Static Fields + + private const int DEFAULT_COMPOSITION_HEIGHT = 30; + private static readonly bool _themedApp; + #endregion + + #region Instance Fields + private bool _activated; + private bool _windowActive; + private bool _trackingMouse; + private bool _applyCustomChrome; + private bool _closeBoxVisible; + 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 PaletteMode _paletteMode; + private readonly IntPtr _screenDC; + private ShadowValues _shadowValues; + private ShadowManager _shadowManager; + private BlurValues _blurValues; + private BlurManager _blurManager; + private FadeValues _fadeValues; + private FadeManager _fadeManager; + + private readonly FadeController _fadeController; + #endregion + + #region Events + /// + /// Occurs when the palette changes. + /// + [Category(@"Property Changed")] + [Description(@"Occurs when the value of the Palette property is changed.")] + public event EventHandler PaletteChanged; + + /// + /// Occurs when the use of custom chrome changes. + /// + [Browsable(false)] // SKC: Probably a special case for not exposing this event in the designer.... + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler? ApplyUseThemeFormChromeBorderWidthChanged; + + /// + /// Occurs when the use of custom chrome changes. + /// + [Browsable(false)] // SKC: Probably a special case for not exposing this event in the designer.... + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler ApplyCustomChromeChanged; + + /// + /// Occurs when the active window setting changes. + /// + [Browsable(false)] // SKC: Probably a special case for not exposing this event in the designer.... + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler WindowActiveChanged; + + /// + /// Occurs when the Global palette changes. + /// + [Category(@"Property Changed")] + [Description(@"Occurs when the value of the GlobalPalette property is changed.")] + public event EventHandler GlobalPaletteChanged; + #endregion + + #region Identity + static VisualForm() + { + try + { + // Is this application in an OS that is capable of themes and is currently themed + _themedApp = VisualStyleInformation.IsEnabledByUser && !string.IsNullOrEmpty(VisualStyleInformation.ColorScheme); + } + catch + { + // + } + } + + /// + /// Initialize a new instance of the KryptonVirtualForm class. + /// + public VisualForm() + { + // Automatically redraw whenever the size of the window changes + SetStyle(ControlStyles.ResizeRedraw, true); + + // We need to create and cache a device context compatible with the display + _screenDC = PlatformInvoke.CreateCompatibleDC(IntPtr.Zero); + + // Setup the need paint delegate + NeedPaintDelegate = OnNeedPaint; + + // Set the palette and renderer to the defaults as specified by the manager + _localPalette = null; + SetPalette(KryptonManager.CurrentGlobalPalette); + _paletteMode = PaletteMode.Global; + + // We need to layout the view + NeedLayout = true; + + // Default the composition height + _compositionHeight = DEFAULT_COMPOSITION_HEIGHT; + + _closeBoxVisible = true; + + // Create constant target for resolving palette delegates + Redirector = CreateRedirector(); + + // Hook into global static events + KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged; + SystemEvents.UserPreferenceChanged += OnUserPreferenceChanged; + + ShadowValues = new ShadowValues(); + BlurValues = new BlurValues(); + + FadeValues = new FadeValues(); + +#if !NET462 + DpiChanged += OnDpiChanged; +#endif + // Note: Will not handle movement between monitors + UpdateDpiFactors(); + } + + + /// + /// 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) + { + _disposing = true; + + if (disposing) + { + // Must unhook from the palette paint events + if (_palette != null) + { + _palette.PalettePaint -= OnNeedPaint; + _palette.ButtonSpecChanged -= OnButtonSpecChanged; + _palette.UseThemeFormChromeBorderWidthChanged -= OnUseThemeFormChromeBorderWidthChanged; + _palette.BasePaletteChanged -= OnBaseChanged; + _palette.BaseRendererChanged -= OnBaseChanged; + } + + // Unhook from global static events + KryptonManager.GlobalPaletteChanged -= OnGlobalPaletteChanged; + SystemEvents.UserPreferenceChanged -= OnUserPreferenceChanged; + } + + base.Dispose(disposing); + + ViewManager?.Dispose(); + + if (_screenDC != IntPtr.Zero) + { + PlatformInvoke.DeleteDC(_screenDC); + } + } + #endregion + + #region Public + + /// + /// Gets the DpiX of the view. + /// + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public float FactorDpiX + { + [DebuggerStepThrough] + get; + set; + } = 1; + + /// + /// Gets the DpiY of the view. + /// + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public float FactorDpiY + { + [DebuggerStepThrough] + get; + set; + } = 1; + /// + /// Gets and sets a value indicating if palette chrome should be applied. + /// + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + internal bool UseThemeFormChromeBorderWidth + { + [DebuggerStepThrough] + get => _useThemeFormChromeBorderWidth; + + set + { + // Only interested in changed values + if (_useThemeFormChromeBorderWidth != value) + { + // Cache old setting + var oldUseThemeFormChromeBorderWidth = _useThemeFormChromeBorderWidth; + + // Store the new setting + _useThemeFormChromeBorderWidth = value; + + // If we need custom chrome drawing... + if (_useThemeFormChromeBorderWidth) + { + try + { + // Set back to false in case we decide that the operating system + // is not capable of supporting our custom chrome implementation + _useThemeFormChromeBorderWidth = false; + + // Only need to remove the window theme, if there is one + if (PlatformInvoke.IsAppThemed() && PlatformInvoke.IsThemeActive()) + { + // Assume that we can apply custom chrome + _useThemeFormChromeBorderWidth = true; + + // Remove any theme that is currently drawing chrome + PlatformInvoke.SetWindowTheme(Handle, string.Empty, string.Empty); + + // Call virtual method for initializing own chrome + WindowChromeStart(); + } + } + catch + { + // Failed and so cannot provide custom chrome + _useThemeFormChromeBorderWidth = false; + } + } + else + { + try + { + // Restore the application to previous theme setting + PlatformInvoke.SetWindowTheme(Handle, null, null); + + // Call virtual method to reverse own chrome setup + WindowChromeEnd(); + } + catch + { + // + } + } + + // Raise event to notify a change in setting + if (_useThemeFormChromeBorderWidth != oldUseThemeFormChromeBorderWidth) + { + // Generate change event + OnApplyUseThemeFormChromeBorderWidthChanged(EventArgs.Empty); + } + } + } + } + + /// Gets or sets a value indicating whether the Close button is displayed in the caption bar of the form. + /// + /// 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 or sets the palette to be applied. + /// + [Category(@"Visuals")] + [Description(@"Palette applied to drawing.")] + public PaletteMode PaletteMode + { + [DebuggerStepThrough] + get => _paletteMode; + + set + { + 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 + _localPalette = null; + SetPalette(KryptonManager.GetPaletteForMode(_paletteMode)); + + // Must raise event to change palette in redirector + OnPaletteChanged(EventArgs.Empty); + + // Need to layout again use new palette + PerformLayout(); + break; + } + } + } + } + + private bool ShouldSerializePaletteMode() => PaletteMode != PaletteMode.Global; + + /// + /// Resets the PaletteMode property to its default value. + /// + public void ResetPaletteMode() => PaletteMode = PaletteMode.Global; + + /// + /// Gets access to the button content. + /// + [Category(@"Visuals")] + [Description(@"Form Shadowing")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + public ShadowValues ShadowValues + { + [DebuggerStepThrough] + get => _shadowValues; + set + { + _shadowValues = value; + _shadowManager = new ShadowManager(this, _shadowValues); + } + } + + private bool ShouldSerializeShadowValues() => !_shadowValues.IsDefault; + + /// + /// Resets the shadow values. + /// + public void ResetShadowValues() => _shadowValues.Reset(); + + /// + /// Gets access to the button content. + /// + [Category(@"Visuals")] + [Description(@"Form Blurring")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + public BlurValues BlurValues + { + [DebuggerStepThrough] + get => _blurValues; + set + { + _blurValues = value; + _blurManager = new BlurManager(this, _blurValues); + } + } + + private bool ShouldSerializeBlurValues() => !_blurValues.IsDefault; + + /// + /// Resets the blur values. + /// + public void ResetBlurValues() => _blurValues.Reset(); + + public FadeValues FadeValues + { + [DebuggerStepThrough] + get => _fadeValues; + + set + { + _fadeValues = value; + + _fadeManager = new FadeManager(this, null, _fadeValues.UseFade, _fadeValues.FadeInterval, _fadeValues, _fadeController); + } + } + + private bool ShouldSerializeFadeValues() => !_fadeValues.IsDefault; + + public void ResetFadeValues() => _fadeValues.Reset(); + + + /// + /// Gets and sets the custom palette implementation. + /// + [Category(@"Visuals")] + [Description(@"Custom palette applied to drawing.")] + [DefaultValue(null)] + public PaletteBase? Palette + { + [DebuggerStepThrough] + get => _localPalette; + + set + { + // Only interested in changes of value + if (_localPalette != value) + { + // Remember the starting palette + PaletteBase? old = _localPalette; + + // Use the provided palette value + SetPalette(value); + + // If no custom palette is required + if (value == null) + { + // No custom palette, so revert back to the global setting + _paletteMode = PaletteMode.Global; + + // Get the appropriate palette for the global mode + _localPalette = null; + SetPalette(KryptonManager.GetPaletteForMode(_paletteMode)); + } + else + { + // No longer using a standard palette + _localPalette = value; + _paletteMode = PaletteMode.Custom; + } + + // If real change has occurred + if (old != _localPalette) + { + // Raise the change event + OnPaletteChanged(EventArgs.Empty); + + // Need to layout again use new palette + PerformLayout(); + } + } + } + } + + /// + /// Resets the Palette property to its default value. + /// + public void ResetPalette() => _localPalette = null; + + /// + /// Gets access to the current renderer. + /// + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Advanced)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public IRenderer Renderer + { + [DebuggerStepThrough] + get; + private set; + } + + /// + /// Fires the NeedPaint event. + /// + /// Does the palette change require a layout. + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Advanced)] + public void PerformNeedPaint(bool needLayout) => OnNeedPaint(this, new NeedLayoutEventArgs(needLayout)); + + /// + /// Gets the resolved palette to actually use when drawing. + /// + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public PaletteBase? GetResolvedPalette() => _palette; + + /// + /// Create a tool strip renderer appropriate for the current renderer/palette pair. + /// + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Advanced)] + public ToolStripRenderer CreateToolStripRenderer() => Renderer.RenderToolStrip(GetResolvedPalette()); + + /// + /// Send the provided system command to the window for processing. + /// + /// System command. + [EditorBrowsable(EditorBrowsableState.Never)] + internal void SendSysCommand(PlatformInvoke.SC_ sysCommand) => SendSysCommand(sysCommand, IntPtr.Zero); + + /// + /// Send the provided system command to the window for processing. + /// + /// System command. + /// LPARAM value. + [EditorBrowsable(EditorBrowsableState.Never)] + internal void SendSysCommand(PlatformInvoke.SC_ sysCommand, IntPtr lParam) => + // Send window message to ourself + PlatformInvoke.SendMessage(Handle, PlatformInvoke.WM_.SYSCOMMAND, (IntPtr)sysCommand, lParam); + + /// + /// Gets the size of the borders requested by the real window. + /// + /// Border sizing. + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public Padding RealWindowBorders => CommonHelperExtended.GetWindowBorders(CreateParams, this as KryptonFormExtended); + + /// + /// Gets a count of the number of paints that have occurred. + /// + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public int PaintCount { get; private set; } + + /// + /// Gets and sets the active state of the window. + /// + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public bool WindowActive + { + get => _windowActive; + + set + { + if (_windowActive != value) + { + _windowActive = value; + _blurManager.SetBlurState(_windowActive); + OnWindowActiveChanged(); + } + } + } + + /// + /// Please use a ButtonSpec, as this gives greater flexibility! + /// + [Browsable(false)] + [Category(@"Window Style")] + [DefaultValue(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Description(@"Please use a ButtonSpec, as this gives greater flexibility!")] + public new bool HelpButton + { + get => base.HelpButton; + // ReSharper disable once ValueParameterNotUsed + set + { + base.HelpButton = false; + throw new NotSupportedException(@"Please use a ButtonSpec, as this gives greater flexibility!"); + } + } + + + /// + /// Request the non-client area be repainted. + /// + public void RedrawNonClient() => InvalidateNonClient(Rectangle.Empty, true); + + /// + /// Request the non-client area be recalculated. + /// + public void RecalcNonClient() + { + if (!IsDisposed && !Disposing && IsHandleCreated) + { + PlatformInvoke.SetWindowPos(Handle, IntPtr.Zero, 0, 0, 0, 0, + PlatformInvoke.SWP_.NOACTIVATE | PlatformInvoke.SWP_.NOMOVE | + PlatformInvoke.SWP_.NOZORDER | PlatformInvoke.SWP_.NOSIZE | + PlatformInvoke.SWP_.NOOWNERZORDER | PlatformInvoke.SWP_.FRAMECHANGED); + } + } + +#if NET6_0_OR_GREATER + /// Gets or sets the anchoring for minimized MDI children. + /// true to anchor minimized MDI children to the bottom left of the parent form; false to anchor to the top left of the parent form. + [Category(@"Window Style")] + [Description(@"Gets or sets the anchoring for minimized MDI children.")] + [DefaultValue(true)] + public new bool MdiChildrenMinimizedAnchorBottom + { + get => base.MdiChildrenMinimizedAnchorBottom; + + set + { + base.MdiChildrenMinimizedAnchorBottom = value; + throw new NotSupportedException(@"Please use .NET 6 or newer to use this feature."); + } + } +#endif + #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. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void KryptonResetCounters() => ViewManager.ResetCounters(); + + /// + /// Gets the number of layout cycles performed since last reset. + /// + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public int KryptonLayoutCounter => ViewManager.LayoutCounter; + + /// + /// Gets the number of paint cycles performed since last reset. + /// + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public int KryptonPaintCounter => ViewManager.PaintCounter; + + #endregion + + #region Protected + /// + /// Gets and sets the ViewManager instance. + /// + protected ViewManager ViewManager + { + [DebuggerStepThrough] + get; + set; + } + + /// + /// Gets access to the palette redirector. + /// + protected PaletteRedirect Redirector + { + [DebuggerStepThrough] + get; + } + + /// + /// Gets access to the need paint delegate. + /// + protected NeedPaintHandler NeedPaintDelegate + { + [DebuggerStepThrough] + get; + } + + /// + /// Convert a screen location to a window location. + /// + /// Screen point. + /// Point in window coordinates. + protected Point ScreenToWindow(Point screenPt) + { + // First of all convert to client coordinates + Point clientPt = PointToClient(screenPt); + + // Now adjust to take into account the top and left borders + Padding borders = RealWindowBorders; + clientPt.Offset(borders.Left, borders.Top); + + return clientPt; + } + + /// + /// Request the non-client area be repainted. + /// + public void InvalidateNonClient() => InvalidateNonClient(Rectangle.Empty, true); + + /// + /// Request the non-client area be repainted. + /// + /// Area to invalidate. + protected void InvalidateNonClient(Rectangle invalidRect) => InvalidateNonClient(invalidRect, true); + + /// + /// Request the non-client area be repainted. + /// + /// Area to invalidate. + /// Should client area be excluded. + protected void InvalidateNonClient(Rectangle invalidRect, + bool excludeClientArea) + { + if (!IsDisposed && !Disposing && IsHandleCreated) + { + if (invalidRect.IsEmpty) + { + Padding realWindowBorders = RealWindowBorders; + Rectangle realWindowRectangle = RealWindowRectangle; + + invalidRect = new Rectangle(-realWindowBorders.Left, + -realWindowBorders.Top, + realWindowRectangle.Width, + realWindowRectangle.Height); + } + + using Region invalidRegion = new(invalidRect); + if (excludeClientArea) + { + invalidRegion.Exclude(ClientRectangle); + } + + using Graphics g = Graphics.FromHwnd(Handle); + IntPtr hRgn = invalidRegion.GetHrgn(g); + + PlatformInvoke.RedrawWindow(Handle, IntPtr.Zero, hRgn, + PlatformInvoke.RDW_FRAME | PlatformInvoke.RDW_UPDATENOW | PlatformInvoke.RDW_INVALIDATE); + + PlatformInvoke.DeleteObject(hRgn); + } + } + + /// + /// Gets rectangle that is the real window rectangle based on Win32 API call. + /// + protected Rectangle RealWindowRectangle + { + get + { + // Grab the actual current size of the window, this is more accurate than using + // the 'this.Size' which is out of date when performing a resize of the window. + PlatformInvoke.RECT windowRect = new(); + PlatformInvoke.GetWindowRect(Handle, ref windowRect); + + // Create rectangle that encloses the entire window + return new Rectangle(0, 0, + windowRect.right - windowRect.left, + windowRect.bottom - windowRect.top); + } + } + #endregion + + #region Protected Override + /// + /// Raises the HandleCreated event. + /// + /// An EventArgs containing the event data. + protected override void OnHandleCreated(EventArgs e) + { + // Can fail on versions before XP SP1 + try + { + // Prevent the OS from drawing the non-client area in classic look + // if the application stops responding to windows messages + PlatformInvoke.DisableProcessWindowsGhosting(); + } + catch + { + // + } + + base.OnHandleCreated(e); + } + + /// + /// Start capturing mouse input for a particular element that is inside the chrome. + /// + /// 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 = true; + _captured = true; + + // Remember the view element that wants the mouse input during capture + _capturedElement = element; + } + + /// + /// Raises the Resize event. + /// + /// An EventArgs containing the event data. + protected override void OnResize(EventArgs e) + { + // Allow an extra region change to occur during resize + ResumePaint(); + + base.OnResize(e); + + if (/*ApplyCustomChrome + &&*/ !(MdiParent != null + && CommonHelper.IsFormMaximized(this)) + ) + { + PerformNeedPaint(true); + } + + // Reverse the resume from earlier + SuspendPaint(); + } + + /// + /// Raises the Activated event. + /// + /// An EventArgs containing the event data. + protected override void OnActivated(EventArgs e) + { + WindowActive = true; + base.OnActivated(e); + } + + /// + /// Raises the Deactivate event. + /// + /// An EventArgs containing the event data. + protected override void OnDeactivate(EventArgs e) + { + WindowActive = false; + base.OnDeactivate(e); + } + + /// + /// Raises the Shown event. + /// + /// An EventArgs containing event data. + protected override void OnShown(EventArgs e) + { + // With Windows 7 and above, a modal window with custom chrome under the DWM + // will sometimes not be drawn when first shown. + if (Environment.OSVersion.Version.Major >= 6) + { + PerformNeedPaint(true); + } + + base.OnShown(e); + } + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + } + + protected override void OnFormClosing(FormClosingEventArgs e) + { + base.OnFormClosing(e); + } + + #endregion + + #region Protected Virtual + // ReSharper disable VirtualMemberNeverOverridden.Global + /// + /// Suspend processing of non-client painting. + /// + protected virtual void SuspendPaint() + { + _ignoreCount++; + } + + /// + /// Resume processing of non-client painting. + /// + protected virtual void ResumePaint() + { + _ignoreCount--; + } + + /// + /// Create the redirector instance. + /// + /// PaletteRedirect derived class. + protected virtual PaletteRedirect CreateRedirector() => new(_palette); + + /// + /// Processes a notification from palette storage of a button spec change. + /// + /// Source of notification. + /// An EventArgs containing event data. + protected virtual void OnButtonSpecChanged(object sender, EventArgs e) + { + } + + /// + /// Raises the PaletteChanged event. + /// + /// An EventArgs containing the event data. + protected virtual void OnPaletteChanged(EventArgs e) + { + // Update the redirector with latest palette + Redirector.Target = _palette; + + // A new palette source means we need to layout and redraw + OnNeedPaint(Palette, new NeedLayoutEventArgs(true)); + + PaletteChanged?.Invoke(this, e); + } + + /// + /// Raises the ApplyUseThemeFormChromeBorderWidth event. + /// + /// An EventArgs containing the event data. + protected virtual void OnApplyUseThemeFormChromeBorderWidthChanged(EventArgs e) => ApplyUseThemeFormChromeBorderWidthChanged?.Invoke(this, e); + + /// + /// Raises the ApplyCustomChrome event. + /// + /// An EventArgs containing the event data. + protected virtual void OnApplyCustomChromeChanged(EventArgs e) => ApplyCustomChromeChanged?.Invoke(this, e); + + /// + /// Occurs when the AllowFormChromeChanged 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) + { + } + + /// + /// Processes a notification from palette storage of a paint and optional layout required. + /// + /// Source of notification. + /// An NeedLayoutEventArgs containing event data. + /// + protected virtual void OnNeedPaint(object? sender, NeedLayoutEventArgs e) + { + Debug.Assert(e != null); + + // Validate incoming reference + if (e == null) + { + throw new ArgumentNullException(nameof(e)); + } + + + // Do we need to recalc the border size as well as invalidate? + if (e.NeedLayout) + { + NeedLayout = true; + } + + InvalidateNonClient(); + + } + + /// + /// Process Windows-based messages. + /// + /// A Windows-based message. + 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) + { + case PlatformInvoke.WM_.NCCALCSIZE: + processed = OnWM_NCCALCSIZE(ref m); + break; + case PlatformInvoke.WM_.GETMINMAXINFO: + OnWM_GETMINMAXINFO(ref m); + /* 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 its own Min/Max requirements" !! + base.WndProc(ref m); + return; + } + } + + // Do we need to override message processing? + if (/*ApplyCustomChrome &&*/ !IsDisposed && !Disposing) + { + switch (m.Msg) + { + case PlatformInvoke.WM_.NCPAINT: + processed = _ignoreCount > 0 || OnWM_NCPAINT(ref m); + break; + + case PlatformInvoke.WM_.NCHITTEST: + processed = OnWM_NCHITTEST(ref m); + break; + + case PlatformInvoke.WM_.NCACTIVATE: + processed = OnWM_NCACTIVATE(ref m); + break; + + case PlatformInvoke.WM_.NCMOUSEMOVE: + processed = OnWM_NCMOUSEMOVE(ref m); + break; + + case PlatformInvoke.WM_.NCLBUTTONDOWN: + processed = OnWM_NCLBUTTONDOWN(ref m); + break; + + case PlatformInvoke.WM_.NCLBUTTONUP: + processed = OnWM_NCLBUTTONUP(ref m); + break; + + case PlatformInvoke.WM_.MOUSEMOVE: + if (_captured) + { + processed = OnWM_MOUSEMOVE(ref m); + } + + break; + case PlatformInvoke.WM_.LBUTTONUP: + if (_captured) + { + processed = OnWM_LBUTTONUP(ref m); + } + break; + + case PlatformInvoke.WM_.NCMOUSELEAVE: + if (!_captured) + { + processed = OnWM_NCMOUSELEAVE(ref m); + } + break; + + case PlatformInvoke.WM_.NCLBUTTONDBLCLK: + processed = OnWM_NCLBUTTONDBLCLK(ref m); + break; + case PlatformInvoke.WM_.SYSCOMMAND: + { + var sc = (PlatformInvoke.SC_)m.WParam.ToInt64(); + // Is this the command for closing the form? + if (sc == PlatformInvoke.SC_.CLOSE) + { + PropertyInfo? pi = typeof(Form).GetProperty(nameof(CloseReason), + BindingFlags.Instance | + BindingFlags.SetProperty | + BindingFlags.NonPublic); + + // Update form with the reason for the close + pi?.SetValue(this, CloseReason.UserClosing, null); + } + + if (sc != PlatformInvoke.SC_.KEYMENU) + { + processed = OnPaintNonClient(ref m); + } + } + break; + case PlatformInvoke.WM_.INITMENU: + case PlatformInvoke.WM_.SETTEXT: + case PlatformInvoke.WM_.HELP: + processed = OnPaintNonClient(ref m); + break; + case 0x00AE: + // Mystery message causes OS title bar buttons to draw, we want to + // prevent that and ignoring the messages seems to do no harm. + processed = true; + break; + case 0xC1BC: + // Under Windows7 a modal window with custom chrome under the DWM + // will sometimes not be drawn when first shown. So we spot the window + // message used to indicate a window is shown and manually request layout + // and paint of the non-client area to get it shown. + PerformNeedPaint(true); + break; + } + } + + // If the message has not been handled, let base class process it + if (!processed && m.Msg != PlatformInvoke.WM_.GETMINMAXINFO) + { + base.WndProc(ref m); + _shadowManager.WndProc(ref m); + } + + if (m.Msg == PlatformInvoke.WM_.SIZE) + { + // Make sure sizing is completed (due to above base) before taking a clean snapshot for focus lost + _blurManager.TakeSnapshot(); + } + } + + /// + /// Creates and populates the MINMAXINFO structure for a maximized window. + /// Puts the structure into memory address given by lParam. + /// Only used to process a WM_GETMINMAXINFO message. + /// + /// A Windows-based message. + protected virtual void OnWM_GETMINMAXINFO(ref Message m) + { + PlatformInvoke.MINMAXINFO mmi = (PlatformInvoke.MINMAXINFO)Marshal.PtrToStructure(m.LParam, typeof(PlatformInvoke.MINMAXINFO)); + + // Adjust the maximized size and position to fit the work area of the correct monitor + const int MONITOR_DEFAULT_TO_NEAREST = 0x00000002; + IntPtr monitor = PlatformInvoke.MonitorFromWindow(m.HWnd, MONITOR_DEFAULT_TO_NEAREST); + + if (monitor != IntPtr.Zero) + { + PlatformInvoke.MONITORINFO monitorInfo = PlatformInvoke.GetMonitorInfo(monitor); + PlatformInvoke.RECT rcWorkArea = monitorInfo.rcWork; + PlatformInvoke.RECT rcMonitorArea = monitorInfo.rcMonitor; + mmi.ptMaxPosition.X = Math.Abs(rcWorkArea.left - rcMonitorArea.left); + mmi.ptMaxPosition.Y = Math.Abs(rcWorkArea.top - rcMonitorArea.top); + mmi.ptMaxSize.X = Math.Abs(rcWorkArea.right - rcWorkArea.left); + mmi.ptMaxSize.Y = Math.Abs(rcWorkArea.bottom - rcWorkArea.top); + // https://github.com/Krypton-Suite/Standard-Toolkit/issues/415 so changed to "* 3 / 2" + mmi.ptMinTrackSize.X = Math.Max(mmi.ptMinTrackSize.X * 3 / 2, MinimumSize.Width); + mmi.ptMinTrackSize.Y = Math.Max(mmi.ptMinTrackSize.Y * 2, MinimumSize.Height); + + // https://github.com/Krypton-Suite/Standard-Toolkit/issues/459 + if (MaximumSize.Width > mmi.ptMinTrackSize.X + && MaximumSize.Width < mmi.ptMaxSize.X) + { + mmi.ptMaxSize.X = MaximumSize.Width; + } + if (MaximumSize.Height > mmi.ptMinTrackSize.Y + && MaximumSize.Height < mmi.ptMaxSize.Y) + { + mmi.ptMaxSize.Y = MaximumSize.Height; + } + } + + Marshal.StructureToPtr(mmi, m.LParam, true); + } + + /// + /// Process the WM_NCCALCSIZE message when overriding window chrome. + /// + /// A Windows-based message. + /// True if the message was processed; otherwise false. + protected virtual bool OnWM_NCCALCSIZE(ref Message m) + { + // Does the LParam contain a RECT or an NCCALCSIZE_PARAMS + if (m.WParam != IntPtr.Zero) + { + // Get the border sizing needed around the client area + Padding borders = FormBorderStyle == FormBorderStyle.None ? Padding.Empty : RealWindowBorders; + + // Extract the Win32 NCCALCSIZE_PARAMS structure from LPARAM + PlatformInvoke.NCCALCSIZE_PARAMS calcsize = (PlatformInvoke.NCCALCSIZE_PARAMS)m.GetLParam(typeof(PlatformInvoke.NCCALCSIZE_PARAMS)); + + // Reduce provided RECT by the borders + calcsize.rectProposed.left += borders.Left; + calcsize.rectProposed.top += borders.Top; + calcsize.rectProposed.right -= borders.Right; + calcsize.rectProposed.bottom -= borders.Bottom; + + // Put back the modified structure + Marshal.StructureToPtr(calcsize, m.LParam, false); + } + + // Message processed, do not pass onto base class for processing + return true; + } + + /// + /// Process the WM_NCPAINT message when overriding window chrome. + /// + /// A Windows-based message. + /// True if the message was processed; otherwise false. + protected virtual bool OnWM_NCPAINT(ref Message m) + { + // Perform actual paint operation + if (!_disposing) + { + OnNonClientPaint(m.HWnd); + } + + // We have handled the message + m.Result = (IntPtr)1; + + // 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 OnWM_NCHITTEST(ref Message m) + { + // Extract the point in screen coordinates + Point screenPoint = new((int)m.LParam.ToInt64()); + + // Convert to window coordinates + Point windowPoint = ScreenToWindow(screenPoint); + + // Perform hit testing + m.Result = WindowChromeHitTest(windowPoint, false); + + // 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 + PlatformInvoke.Dwm.DwmDefWindowProc(m.HWnd, m.Msg, m.WParam, m.LParam, out IntPtr result); + m.Result = result; + + // If no result returned then let the base window routine process it + if (m.Result == (IntPtr)PlatformInvoke.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)PlatformInvoke.HT.CAPTION || + m.Result == (IntPtr)PlatformInvoke.HT.CLIENT) + { + // Extract the point in screen coordinates + Point screenPoint = new((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. + /// + /// A Windows-based message. + /// True if the message was processed; otherwise false. + protected virtual bool OnWM_NCACTIVATE(ref Message m) + { + // Cache the new active state + WindowActive = m.WParam == (IntPtr)1; + + if (MdiParent != null && !_activated) + { + _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; + } + + return false; + } + + /// + /// Process a windows message that requires the non client area be repainted. + /// + /// A Windows-based message. + /// True if the message was processed; otherwise false. + protected virtual bool OnPaintNonClient(ref Message m) + { + // Let window be updated with new text + DefWndProc(ref m); + + // Need a repaint to show change + InvalidateNonClient(); + + // Message processed, do not pass onto base class for processing + return true; + } + + /// + /// Process the WM_NCMOUSEMOVE message when overriding window chrome. + /// + /// A Windows-based message. + /// True if the message was processed; otherwise false. + protected virtual bool OnWM_NCMOUSEMOVE(ref Message m) + { + // Extract the point in screen coordinates + Point screenPoint = new((int)m.LParam.ToInt64()); + + // Convert to window coordinates + Point windowPoint = ScreenToWindow(screenPoint); + + // Perform actual mouse movement actions + WindowChromeNonClientMouseMove(windowPoint); + + // If we are not tracking when the mouse leaves the non-client window + if (!_trackingMouse) + { + PlatformInvoke.TRACKMOUSEEVENTS tme = new() + { + // This structure needs to know its own size in bytes + cbSize = (uint)Marshal.SizeOf(typeof(PlatformInvoke.TRACKMOUSEEVENTS)), + dwHoverTime = 100, + + // We need to know then the mouse leaves the non client window area + dwFlags = PlatformInvoke.TME_LEAVE | PlatformInvoke.TME_NONCLIENT, + + // We want to track our own window + hWnd = Handle + }; + + // Call Win32 API to start tracking + PlatformInvoke.TrackMouseEvent(ref tme); + + // Do not need to track again until mouse reenters the window + _trackingMouse = true; + } + + // Indicate that we processed the message + m.Result = IntPtr.Zero; + + // Message processed, do not pass onto base class for processing + return true; + } + + /// + /// Process the WM_NCLBUTTONDOWN message when overriding window chrome. + /// + /// A Windows-based message.4 + /// True if the message was processed; otherwise false. + protected virtual bool OnWM_NCLBUTTONDOWN(ref Message m) + { + // Extract the point in screen coordinates + Point screenPoint = new((int)m.LParam.ToInt64()); + + // Convert to window coordinates + Point windowPoint = ScreenToWindow(screenPoint); + + // Perform actual mouse down processing + return WindowChromeLeftMouseDown(windowPoint); + } + + /// + /// Process the WM_LBUTTONUP message when overriding window chrome. + /// + /// A Windows-based message. + /// True if the message was processed; otherwise false. + protected virtual bool OnWM_NCLBUTTONUP(ref Message m) + { + // Extract the point in screen coordinates + Point screenPoint = new((int)m.LParam.ToInt64()); + + // Convert to window coordinates + Point windowPoint = ScreenToWindow(screenPoint); + + // Perform actual mouse up processing + return WindowChromeLeftMouseUp(windowPoint); + } + + /// + /// Process the WM_NCMOUSELEAVE message when overriding window chrome. + /// + /// A Windows-based message. + /// True if the message was processed; otherwise false. + protected virtual bool OnWM_NCMOUSELEAVE(ref Message m) + { + _blurManager.TakeSnapshot(); + // Next time the mouse enters the window we need to track it leaving + _trackingMouse = false; + + // Perform actual mouse leave actions + WindowChromeMouseLeave(); + + // Indicate that we processed the message + m.Result = IntPtr.Zero; + + // Need a repaint to show change + InvalidateNonClient(); + + // Message processed, do not pass onto base class for processing + return true; + } + + /// + /// Process the OnWM_MOUSEMOVE message when overriding window chrome. + /// + /// A Windows-based message. + /// True if the message was processed; otherwise false. + protected virtual bool OnWM_MOUSEMOVE(ref Message m) + { + // Extract the point in client coordinates + Point clientPoint = new((int)m.LParam); + + // Convert to screen coordinates + Point screenPoint = PointToScreen(clientPoint); + + // Convert to window coordinates + Point windowPoint = ScreenToWindow(screenPoint); + + // Perform actual mouse movement actions + WindowChromeNonClientMouseMove(windowPoint); + + return true; + } + + /// + /// Process the WM_LBUTTONUP message when overriding window chrome. + /// + /// A Windows-based message. + /// True if the message was processed; otherwise false. + protected virtual bool OnWM_LBUTTONUP(ref Message m) + { + // Capture has now expired + _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; + + // Extract the point in client coordinates + Point clientPoint = new((int)m.LParam); + + // Convert to screen coordinates + Point screenPoint = PointToScreen(clientPoint); + + // Convert to window coordinates + Point windowPoint = ScreenToWindow(screenPoint); + + // Pass message onto the view elements + ViewManager.MouseUp(new MouseEventArgs(MouseButtons.Left, 0, windowPoint.X, windowPoint.Y, 0), windowPoint); + + // Pass message onto the view elements + ViewManager.MouseLeave(EventArgs.Empty); + + // Need a repaint to show change + InvalidateNonClient(); + + return true; + } + + /// + /// Process the WM_NCLBUTTONDBLCLK message when overriding window chrome. + /// + /// A Windows-based message. + /// True if the message was processed; otherwise false. + protected virtual bool OnWM_NCLBUTTONDBLCLK(ref Message m) + { + // Extract the point in screen coordinates + Point screenPoint = new((int)m.LParam.ToInt64()); + + // Convert to window coordinates + Point windowPoint = ScreenToWindow(screenPoint); + + // Find the view element under the mouse + ViewBase? pointView = ViewManager.Root!.ViewFromPoint(windowPoint); + + // Try and find a mouse controller for the active view + IMouseController? controller = pointView?.FindMouseController(); + + // Eat the message + return controller != null; + } + + /// + /// Perform chrome window painting in the non-client areas. + /// + /// Window handle of window being painted. + protected virtual void OnNonClientPaint(IntPtr hWnd) + { + // Create rectangle that encloses the entire window + Rectangle windowBounds = RealWindowRectangle; + + // We can only draw a window that has some size + if (windowBounds.Width > 0 && windowBounds.Height > 0) + { + // Get the device context for this window + IntPtr hDC = PlatformInvoke.GetWindowDC(Handle); + + // If we managed to get a device context + if (hDC != IntPtr.Zero) + { + try + { + // Find the rectangle that covers the client area of the form + Padding borders = RealWindowBorders; + Rectangle clipClientRect = new(borders.Left, borders.Top, + windowBounds.Width - borders.Horizontal, + windowBounds.Height - borders.Vertical); + + var minimized = CommonHelper.IsFormMinimized(this); + + // After excluding the client area, is there anything left to draw? + if (minimized || (clipClientRect.Width > 0 && clipClientRect.Height > 0)) + { + // If not minimized we need to clip the client area + if (!minimized) + { + // Exclude client area from being drawn into and bit blitted + PlatformInvoke.ExcludeClipRect(hDC, clipClientRect.Left, clipClientRect.Top, + clipClientRect.Right, clipClientRect.Bottom); + } + + // Create one the correct size and cache for future drawing + IntPtr hBitmap = PlatformInvoke.CreateCompatibleBitmap(hDC, windowBounds.Width, windowBounds.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. + PlatformInvoke.SelectObject(_screenDC, hBitmap); + + // Drawing is easier when using a Graphics instance + using (Graphics g = Graphics.FromHdc(_screenDC)) + { + WindowChromePaint(g, windowBounds); + } + + // Now blit from the bitmap to the screen + PlatformInvoke.BitBlt(hDC, 0, 0, windowBounds.Width, windowBounds.Height, _screenDC, 0, 0, PlatformInvoke.SRCCOPY); + } + finally + { + // Delete the temporary bitmap + PlatformInvoke.DeleteObject(hBitmap); + } + } + else + { + // Drawing is easier when using a Graphics instance + using Graphics g = Graphics.FromHdc(hDC); + WindowChromePaint(g, windowBounds); + } + } + } + finally + { + // Must always release the device context + PlatformInvoke.ReleaseDC(Handle, hDC); + } + } + } + + // Bump the number of paints that have occurred + PaintCount++; + } + + /// + /// Called when the active state of the window changes. + /// + protected virtual void OnWindowActiveChanged() => WindowActiveChanged?.Invoke(this, EventArgs.Empty); + + /// + /// Gets and sets the need to layout the view. + /// + protected bool NeedLayout { get; set; } + // ReSharper restore VirtualMemberNeverOverridden.Global + #endregion + + #region Protected Chrome + /// + /// Perform setup for custom chrome. + /// + protected virtual void WindowChromeStart() + { + } + + /// + /// Perform cleanup when custom chrome ending. + /// + protected virtual void WindowChromeEnd() + { + } + + /// + /// Perform hit testing. + /// + /// Point in window coordinates. + /// Are we performing composition. + /// + protected virtual IntPtr WindowChromeHitTest(Point pt, bool composition) => (IntPtr)PlatformInvoke.HT.CLIENT; + + /// + /// Perform painting of the window chrome. + /// + /// Graphics instance to use for drawing. + /// Bounds enclosing the window chrome. + protected virtual void WindowChromePaint(Graphics g, Rectangle bounds) + { + } + + /// + /// Perform non-client mouse movement processing. + /// + /// Point in window coordinates. + protected virtual void WindowChromeNonClientMouseMove(Point pt) => ViewManager.MouseMove(new MouseEventArgs(MouseButtons.None, 0, pt.X, pt.Y, 0), pt); + + /// + /// Process the left mouse down event. + /// + /// Window coordinate of the mouse down. + /// True if event is processed; otherwise false. + 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 + // Ask the controller if the mouse down should be ignored by wnd proc processing + IMouseController controller = ViewManager.ActiveView?.FindMouseController(); + return controller is { IgnoreVisualFormLeftButtonDown: true }; + } + + /// + /// Process the left mouse up event. + /// + /// Window coordinate of the mouse up. + /// True if event is processed; otherwise false. + protected virtual bool WindowChromeLeftMouseUp(Point pt) + { + ViewManager.MouseUp(new MouseEventArgs(MouseButtons.Left, 0, pt.X, pt.Y, 0), pt); + + // By default, we have not handled the mouse up event + return false; + } + + /// + /// Perform mouse leave processing. + /// + protected virtual void WindowChromeMouseLeave() => + // Pass message onto the view elements + ViewManager.MouseLeave(EventArgs.Empty); + + #endregion + + #region Implementation + + 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; + SetPalette(KryptonManager.CurrentGlobalPalette); + Redirector.Target = _palette; + + // A new palette source means we need to layout and redraw + OnNeedPaint(Palette, new NeedLayoutEventArgs(true)); + + GlobalPaletteChanged?.Invoke(sender, e); + } + } + + private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e) + { + // If a change has occurred that could effect the color table then it needs regenerating + switch (e.Category) + { + case UserPreferenceCategory.Icon: + case UserPreferenceCategory.Menu: + case UserPreferenceCategory.Color: + case UserPreferenceCategory.VisualStyle: + case UserPreferenceCategory.General: + case UserPreferenceCategory.Window: + case UserPreferenceCategory.Desktop: + PerformNeedPaint(true); + break; + } + } + + private void SetPalette(PaletteBase? palette) + { + if (palette != _palette) + { + // Unhook from current palette events + if (_palette != null) + { + _palette.PalettePaint -= OnNeedPaint; + _palette.ButtonSpecChanged -= OnButtonSpecChanged; + _palette.UseThemeFormChromeBorderWidthChanged -= OnUseThemeFormChromeBorderWidthChanged; + _palette.BasePaletteChanged -= OnBaseChanged; + _palette.BaseRendererChanged -= OnBaseChanged; + } + + // Remember the new palette + _palette = palette; + + // Get the renderer associated with the palette + Renderer = _palette.GetRenderer(); + + // Hook to new palette events + if (_palette != null) + { + _palette.PalettePaint += OnNeedPaint; + _palette.ButtonSpecChanged += OnButtonSpecChanged; + _palette.UseThemeFormChromeBorderWidthChanged += OnUseThemeFormChromeBorderWidthChanged; + _palette.BasePaletteChanged += OnBaseChanged; + _palette.BaseRendererChanged += OnBaseChanged; + // PaletteImageScaler.ScalePalette(FactorDpiX, FactorDpiY, _palette); + } + } + } + + protected virtual void OnUseThemeFormChromeBorderWidthChanged(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); + } + +#if !NET462 + private void OnDpiChanged(object sender, DpiChangedEventArgs e) + { + UpdateDpiFactors(); + } +#endif + #endregion + + private void UpdateDpiFactors() + { + // Do not use the control dpi, as these values are being used to target the screen + IntPtr screenDc = PlatformInvoke.GetDC(IntPtr.Zero); + if (screenDc != IntPtr.Zero) + { + FactorDpiX = PlatformInvoke.GetDeviceCaps(screenDc, PlatformInvoke.DeviceCap.LOGPIXELSX) / 96f; + FactorDpiY = PlatformInvoke.GetDeviceCaps(screenDc, PlatformInvoke.DeviceCap.LOGPIXELSY) / 96f; + PlatformInvoke.ReleaseDC(IntPtr.Zero, screenDc); + } + else + { + // Do it the slow "init everything long way" + using Graphics graphics = Graphics.FromHwnd(IntPtr.Zero); + FactorDpiX = graphics.DpiX / 96f; + FactorDpiY = graphics.DpiY / 96f; + } + // _palette.HasAlreadyBeenScaled = false; + // PaletteImageScaler.ScalePalette(FactorDpiX, FactorDpiY, _palette); + } + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VisualKryptonFormExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VisualKryptonFormExtended.cs new file mode 100644 index 000000000..cd76e97ce --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VisualKryptonFormExtended.cs @@ -0,0 +1,1736 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +// ReSharper disable ConditionIsAlwaysTrueOrFalse +namespace Krypton.Toolkit.Suite.Extended.Forms +{ + /// + /// Draws the window chrome using a Krypton palette. + /// + [ToolboxItem(false)] + //[ToolboxBitmap(typeof(KryptonFormExtended), "ToolboxBitmaps.KryptonForm.bmp")] + //[Description(@"Draws the window chrome using a Krypton palette.")] + //[Designer("Krypton.Toolkit.Suite.Extended.Forms.KryptonFormExtendedDesigner, Krypton.Toolkit")] + public abstract class VisualKryptonFormExtended : VisualForm, IContentValues + { + #region Type Definitions + /// + /// Collection for managing ButtonSpecAny instances. + /// + public class FormButtonSpecCollection : ButtonSpecCollection + { + #region Identity + /// + /// Initialize a new instance of the FormButtonSpecCollection class. + /// + /// Reference to owning object. + public FormButtonSpecCollection(VisualKryptonFormExtended owner) + : base(owner) + { + } + #endregion + } + + /// + /// Collection for managing NavigatorButtonSpec instances. + /// + public class FormFixedButtonSpecCollection : ButtonSpecCollection + { + #region Identity + /// + /// Initialize a new instance of the FormFixedButtonSpecCollection class. + /// + /// Reference to owning object. + public FormFixedButtonSpecCollection(VisualKryptonFormExtended owner) + : base(owner) + { + } + #endregion + } + #endregion + + #region Static Fields + private static readonly Size CAPTION_ICON_SIZE = new(16, 16); + private const int HT_CORNER = 8; + // Drop shadow + private const int CS_DROPSHADOW = 0x00020000; + + private const int CP_NOCLOSE_BUTTON = 0x200; + #endregion + + #region Instance Fields + + private readonly FormFixedButtonSpecCollection _buttonSpecsFixed; + private readonly ButtonSpecManagerDraw _buttonManager; + private VisualPopupToolTip? _visualPopupToolTip; + private readonly ViewDrawForm _drawDocker; + private readonly ViewDrawDocker _drawHeading; + private readonly ViewDrawContent _drawContent; + private readonly ViewDecoratorFixedSize _headingFixedSize; + private readonly ViewLayoutNull _layoutNull; + private HeaderStyle _headerStyle; + private PaletteRelativeAlign _formTitleAlign; + private HeaderStyle _headerStylePrev; + private FormWindowState _regionWindowState; + private FormWindowState _lastWindowState; + private string _textExtra; + private string _oldText; + private static bool _isInAdministratorMode; + + private bool _hasUseThemeFormChromeBorderWidthFirstRun; + private bool _allowFormChrome; + private bool _allowStatusStripMerge; + private bool _recreateButtons; + private bool _firstCheckView; + private bool _lastNotNormal; + private bool _useDropShadow; + private bool _useWindows11StyleCornerRounding; + private StatusStrip? _statusStrip; + private Bitmap? _cacheBitmap; + private Icon? _cacheIcon; + private float _cornerRoundingRadius; + private Control _activeControl; + + #endregion + + #region Identity + /// + /// Initialize a new instance of the KryptonFormExtended class. + /// + public VisualKryptonFormExtended() + { + // Default properties + _headerStyle = HeaderStyle.Form; + _formTitleAlign = PaletteRelativeAlign.Near; + _headerStylePrev = _headerStyle; + AllowButtonSpecToolTips = false; + _allowFormChrome = true; + _allowStatusStripMerge = true; + AllowIconDisplay = true; + _regionWindowState = FormWindowState.Normal; + _recreateButtons = true; + _firstCheckView = true; + _lastNotNormal = false; + + // Create storage objects + ButtonSpecs = new FormButtonSpecCollection(this); + _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 }); + + // Create the palette storage + StateCommon = new PaletteFormRedirect(Redirector, NeedPaintDelegate); + StateInactive = new PaletteForm(StateCommon, StateCommon.Header, NeedPaintDelegate); + StateActive = new PaletteForm(StateCommon, StateCommon.Header, NeedPaintDelegate); + + // Create a header to act as the form title bar + _drawHeading = new ViewDrawDocker(StateActive.Header.Back, + StateActive.Header.Border, + StateActive.Header, + PaletteMetricBool.None, + 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 + }; + + // Content draws the text and icon inside the title bar + _drawContent = new ViewDrawContent(StateActive.Header.Content, this, VisualOrientation.Top); + _drawHeading.Add(_drawContent, ViewDockStyle.Fill); + + // Create a decorator so that the heading has a fixed sized and not based on content + _headingFixedSize = new ViewDecoratorFixedSize(_drawHeading, Size.Empty); + + // Create a null element that takes up all remaining space + _layoutNull = new ViewLayoutNull(); + + // Create the root element that contains the title bar and null filler + _drawDocker = new ViewDrawForm(StateActive.Back, StateActive.Border) + { + { _headingFixedSize, ViewDockStyle.Top }, + { _layoutNull, ViewDockStyle.Fill } + }; + + // Create button specification collection manager + _buttonManager = new ButtonSpecManagerDraw(this, Redirector, ButtonSpecs, _buttonSpecsFixed, + new[] { _drawHeading }, + new IPaletteMetric[] { StateCommon.Header }, + new[] { PaletteMetricInt.HeaderButtonEdgeInsetForm }, + new[] { PaletteMetricPadding.HeaderButtonPaddingForm }, + CreateToolStripRenderer, + OnButtonManagerNeedPaint); + + // Create the manager for handling tooltips + ToolTipManager = new ToolTipManager(new(null)); + ToolTipManager.ShowToolTip += OnShowToolTip; + ToolTipManager.CancelToolTip += OnCancelToolTip; + _buttonManager.ToolTipManager = ToolTipManager; + + // Hook into global static events + KryptonManager.GlobalUseThemeFormChromeBorderWidthChanged += OnGlobalUseThemeFormChromeBorderWidthChanged; + KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged; + + // Create the view manager instance + ViewManager = new ViewManager(this, _drawDocker); + + // Disable 'UseDropShadow' on creation +#pragma warning disable CS0618 + UseDropShadow = false; +#pragma warning restore CS0618 + } + + /// + /// 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) + { + // Remove ant showing tooltip + OnCancelToolTip(this, EventArgs.Empty); + + // Remember to pull down the manager instance + _buttonManager.Destruct(); + + // Unhook from the global static events + KryptonManager.GlobalPaletteChanged -= OnGlobalPaletteChanged; + KryptonManager.GlobalUseThemeFormChromeBorderWidthChanged -= OnGlobalUseThemeFormChromeBorderWidthChanged; + + // Clear down the cached bitmap + if (_cacheBitmap != null) + { + _cacheBitmap.Dispose(); + _cacheBitmap = null; + } + + ButtonSpecMin.Dispose(); + ButtonSpecMax.Dispose(); + ButtonSpecClose.Dispose(); + } + + base.Dispose(disposing); + } + #endregion + + #region Public + /// + /// Gets or sets the extra text associated with the control. + /// + [Category(@"Appearance")] + [Description(@"The extra text associated with the control.")] + [DefaultValue("")] + public string TextExtra + { + get => _textExtra; + + set + { + _textExtra = value; + PerformNeedPaint(true); + } + } + + /// + /// 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 or sets a value indicating if custom chrome is allowed. + /// + [Category(@"Visuals")] + [Description(@"Should custom chrome be allowed for this KryptonForm instance.")] + [DefaultValue(true)] + public new bool UseThemeFormChromeBorderWidth + { + get => _allowFormChrome; + set + { + if (_allowFormChrome != value) + { + _allowFormChrome = value; + if (StateCommon!.Border is PaletteFormBorderExtended formBorder) + { + formBorder.UseThemeFormChromeBorderWidth = value; + } + + // Do we want to switch on/off the custom chrome? + UpdateUseThemeFormChromeBorderWidthDecision(); + RecalcNonClient(); + } + } + } + + /// + /// Gets or sets a value indicating if the form status strip be considered for merging into chrome. + /// + [Category(@"Visuals")] + [Description(@"Should the form status strip be considered for merging into chrome.")] + [DefaultValue(true)] + public bool AllowStatusStripMerge + { + get => _allowStatusStripMerge; + set + { + if (_allowStatusStripMerge != value) + { + _allowStatusStripMerge = value; + + _statusStrip?.Invalidate(); + + PerformNeedPaint(false); + } + } + } + + /// + /// Gets and sets the header style for a main form. + /// + [Category(@"Visuals")] + [Description(@"Header style for a main form.")] + [DefaultValue(typeof(HeaderStyle), "Form")] + public HeaderStyle HeaderStyle + { + get => _headerStyle; + + set + { + if (_headerStyle != value) + { + _headerStyle = value; + PerformNeedPaint(false); + } + } + } + + /// + /// Gets and sets the header edge to display the button against. + /// + [Category(@"Visuals")] + [Description(@"The Form Title position, relative to available space")] + [RefreshProperties(RefreshProperties.All)] + [DefaultValue(typeof(PaletteRelativeAlign), "Near")] + public PaletteRelativeAlign FormTitleAlign + { + get => _formTitleAlign; + + set + { + if (_formTitleAlign != value) + { + _formTitleAlign = value; + PerformNeedPaint(true); + } + } + } + + private bool ShouldSerializeFormTitleAlign() => _formTitleAlign != PaletteRelativeAlign.Near; + + private void ResetFormTitleAlign() => _formTitleAlign = PaletteRelativeAlign.Near; + + /// + /// Gets and sets the chrome group border style. + /// + [Category(@"Visuals")] + [Description(@"Chrome group border style.")] + [DefaultValue(typeof(PaletteBorderStyle), "FormMain")] + public PaletteBorderStyle GroupBorderStyle + { + get => StateCommon.BorderStyle; + + set + { + if (StateCommon.BorderStyle != value) + { + StateCommon.BorderStyle = value; + PerformNeedPaint(false); + } + } + } + + /// + /// Gets and sets the chrome group background style. + /// + [Category(@"Visuals")] + [Description(@"Chrome group background style.")] + [DefaultValue(typeof(PaletteBackStyle), "FormMain")] + public PaletteBackStyle GroupBackStyle + { + get => StateCommon.BackStyle; + + set + { + if (StateCommon.BackStyle != value) + { + StateCommon.BackStyle = value; + PerformNeedPaint(false); + } + } + } + + /// + /// Allows the use of drop shadow around the form. + /// + [Category(@"Visuals")] + [Description(@"Allows the use of drop shadow around the form.")] + [DefaultValue(false)] + [Obsolete("Deprecated - Only use if you are using Windows 7, 8 or 8.1.")] + public bool UseDropShadow + { + get => _useDropShadow; + + set + { + _useDropShadow = value; + + UpdateDropShadowDraw(_useDropShadow); + } + } + + /// + /// Gets or sets a value indicating whether this instance is in administrator mode. + /// + /// + /// true if this instance is in administrator mode; otherwise, false. + /// + [Category(@"Appearance"), Description(@"Is the user currently an administrator.")] + public bool IsInAdministratorMode { get => _isInAdministratorMode; private set => _isInAdministratorMode = value; } + + /// + /// Gets access to the common form appearance entries that other states can override. + /// + [Category(@"Visuals")] + [Description(@"Overrides for defining common form appearance that other states can override.")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + public PaletteFormRedirect StateCommon { get; } + + private bool ShouldSerializeStateCommon() => !StateCommon.IsDefault; + + /// + /// Gets access to the inactive form appearance entries. + /// + [Category(@"Visuals")] + [Description(@"Overrides for defining inactive form appearance.")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + public PaletteForm StateInactive { get; } + + private bool ShouldSerializeStateInactive() => !StateInactive.IsDefault; + + /// + /// Gets access to the active form appearance entries. + /// + [Category(@"Visuals")] + [Description(@"Overrides for defining active form appearance.")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + public PaletteForm StateActive { get; } + + private bool ShouldSerializeStateActive() => !StateActive.IsDefault; + + /// + /// Gets the collection of button specifications. + /// + [Category(@"Visuals")] + [Description(@"Collection of button specifications.")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + public FormButtonSpecCollection ButtonSpecs { get; } + + /// + /// Gets access to the minimize button spec. + /// + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public ButtonSpecFormWindowMin ButtonSpecMin { get; } + + /// + /// Gets access to the minimize button spec. + /// + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public ButtonSpecFormWindowMax ButtonSpecMax { get; } + + /// + /// Gets access to the minimize button spec. + /// + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public ButtonSpecFormWindowClose ButtonSpecClose { get; } + + /// + /// Gets and sets a value indicating if the border should be inert to changes. + /// + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public bool InertForm { get; set; } + + /// + /// Allow an extra view element to be injected into the caption area. + /// + /// Reference to view element. + /// Docking style of the element. + [EditorBrowsable(EditorBrowsableState.Never)] + public void InjectViewElement(ViewBase? element, ViewDockStyle style) + { + Debug.Assert(element != null); + Debug.Assert(_drawHeading != null); + + if (!IsDisposed) + { + // If injecting a new fill item for the caption content area + if (style == ViewDockStyle.Fill) + { + // Incoming element must be a ViewLayoutDocker + if (element is ViewLayoutDocker docker) + { + // Remove the existing content + if (_drawHeading != null) + { + _drawHeading.Remove(_drawContent); + + // Add new element and put content inside it + _drawHeading.Add(docker, ViewDockStyle.Fill); + } + + docker.Add(_drawContent, ViewDockStyle.Fill); + } + } + else + { + // Just add to the docking edge requested + if (_drawHeading != null) + { + _drawHeading.Add(element!, style); + } + } + } + } + + /// + /// Remove a previously injected view element from the caption area. + /// + /// Reference to view element. + /// Docking style of the element. + [EditorBrowsable(EditorBrowsableState.Never)] + public void RevokeViewElement(ViewBase? element, ViewDockStyle style) + { + Debug.Assert(element != null); + + if (!IsDisposed) + { + // If revoking the fill item for the caption content area + if (style == ViewDockStyle.Fill) + { + // Incoming element must be a ViewLayoutDocker + if (element is ViewLayoutDocker docker) + { + // Remove the existing content + docker.Remove(_drawContent); + _drawHeading.Remove(docker); + + // Add back the original content + _drawHeading.Add(_drawContent, ViewDockStyle.Fill); + } + } + else + { + // Just remove the specified elements + _drawHeading.Remove(element!); + } + } + } + + /// + /// Gets and sets a value indicating if the icon is allowed to be shown. + /// + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public bool AllowIconDisplay { get; set; } + + /// + /// Next time a layout occurs the min/max/close buttons need recreating. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void RecreateMinMaxCloseButtons() + { + _recreateButtons = true; + } + + /// + /// Gets access to the ToolTipManager used for displaying tool tips. + /// + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public ToolTipManager ToolTipManager { get; } + + /// + /// Gets the current state of the window. + /// + /// FormWindowState enumeration value. + [EditorBrowsable(EditorBrowsableState.Never)] + public FormWindowState GetWindowState() + { + // Get the current window style (cannot use the + // WindowState property as it can be slightly out of date) + var style = PlatformInvoke.GetWindowLong(Handle, PlatformInvoke.GWL_.STYLE); + + if ((style & PlatformInvoke.WS_.MINIMIZE) != 0) + { + return FormWindowState.Minimized; + } + else + { + return (style & PlatformInvoke.WS_.MAXIMIZE) != 0 ? FormWindowState.Maximized : FormWindowState.Normal; + } + } + + /// Gets or sets the corner rounding radius. + /// The corner rounding radius. + [DefaultValue(-1), Description(@"Defines the corner roundness on the current window (-1 is the default look).")] + public float CornerRoundingRadius + { + get => _cornerRoundingRadius; + set + { + _cornerRoundingRadius = value; + Invalidate(); + } + } + + /// Gets or sets the active control on the container control. + [DefaultValue(null), Description(@"Defines an active control for this window.")] + public new Control ActiveControl + { + get => _activeControl; + + set + { + if (_activeControl != value) + { + _activeControl = value; + + _activeControl.Focus(); + } + else + { + _activeControl.Focus(); + } + } + } + + #endregion + + #region Public Chrome + + /// + /// Gets a value indicating if the provided point is inside the minimize button. + /// + /// Window relative point to test. + /// True if inside the button; otherwise false. + public bool HitTestMinButton(Point pt) => _buttonManager.GetButtonRectangle(ButtonSpecMin).Contains(pt); + + /// + /// Gets a value indicating if the provided point is inside the maximize button. + /// + /// Window relative point to test. + /// True if inside the button; otherwise false. + public bool HitTestMaxButton(Point pt) => _buttonManager.GetButtonRectangle(ButtonSpecMax).Contains(pt); + + /// + /// Gets a value indicating if the provided point is inside the close button. + /// + /// Window relative point to test. + /// True if inside the button; otherwise false. + public bool HitTestCloseButton(Point pt) => _buttonManager.GetButtonRectangle(ButtonSpecClose).Contains(pt); + + /// + /// Gets and sets a rectangle to treat as a custom caption area. + /// + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public Rectangle CustomCaptionArea { get; set; } + + #endregion + + #region Public IContentValues + /// + /// Gets the image used for showing on the title bar. + /// + /// Form state. + /// Image. + public Image? GetImage(PaletteState state) + { + Icon? displayIcon = GetDefinedIcon(); + + // Has the icon to be Displayed changed since the last time around? + if (displayIcon != _cacheIcon) + { + // Clear down the cached bitmap + if (_cacheBitmap != null) + { + _cacheBitmap.Dispose(); + _cacheBitmap = null; + } + + // Clear down the cached icon + _cacheIcon = null; + } + + // Do we need to create a cached bitmap for the display icon? + if (displayIcon != null && _cacheBitmap == null) + { + // Remember the icon used to generate the cached bitmap + _cacheIcon = displayIcon; + + // Currently the `FactorDpi#`'s do _NOT_ change whilst the app is running + //if ((ViewButton.FactorDpiX != _lastFactorDpiX) + // || (ViewButton.FactorDpiY != _lastFactorDpiY) + // ) + //{ + // Image needs to be regenerated + var currentWidth = (int)(CAPTION_ICON_SIZE.Width * FactorDpiX); + var currentHeight = (int)(CAPTION_ICON_SIZE.Height * FactorDpiY); + //} + + Bitmap? resizedBitmap = null; + try + { + using var temp = new Icon(_cacheIcon, currentWidth, currentHeight); + resizedBitmap = temp.ToBitmap(); + } + catch + { + try + { + // Failed so we convert the Icon directly instead of trying to get a sized version first + resizedBitmap = _cacheIcon.ToBitmap(); + } + catch + { + // Do nothing + } + } + + // Cache for future access + if (resizedBitmap != null) + { + _cacheBitmap = CommonHelper.ScaleImageForSizedDisplay(resizedBitmap, currentWidth, currentHeight); + } + } + + return _cacheBitmap; + } + + /// + /// Gets the image color that should be interpreted as transparent. + /// + /// Form state. + /// Transparent Color. + public Color GetImageTransparentColor(PaletteState state) => + // We never mark any color as transparent + Color.Empty; + + /// + /// Gets the short text used as the main caption title. + /// + /// Title string. + public string GetShortText() => + // Return the existing form text property. + Text; + + /// + /// Gets the long text used as the secondary caption title. + /// + /// Title string. + public string GetLongText() => _textExtra; + + #endregion + + #region Protected Override + /// + /// Create the redirector instance. + /// + /// PaletteRedirect derived class. + protected override PaletteRedirect CreateRedirector() => new FormPaletteRedirect(GetResolvedPalette(), this); + + internal class FormPaletteRedirect : PaletteRedirect + { + private readonly VisualKryptonFormExtended _kryptonForm; + + public FormPaletteRedirect(PaletteBase? palette, VisualKryptonFormExtended kryptonForm) + : base(palette) => + _kryptonForm = kryptonForm; + + public override PaletteRelativeAlign GetContentShortTextH(PaletteContentStyle style, PaletteState state) + { + return style switch + { + PaletteContentStyle.HeaderForm + or PaletteContentStyle.HeaderPrimary + or PaletteContentStyle.HeaderDockInactive + or PaletteContentStyle.HeaderDockActive + or PaletteContentStyle.HeaderSecondary + or PaletteContentStyle.HeaderCustom1 + or PaletteContentStyle.HeaderCustom2 + or PaletteContentStyle.HeaderCustom3 => _kryptonForm._formTitleAlign != PaletteRelativeAlign.Inherit + ? _kryptonForm._formTitleAlign + : base.GetContentShortTextH(style, state), + _ => base.GetContentShortTextH(style, state) + }; + } + } + + /// + /// Raises the ControlAdded event. + /// + /// An EventArgs containing event data. + protected override void OnControlAdded(ControlEventArgs e) + { + // Is this the type of control we need to watch? + if (e.Control is StatusStrip strip) + { + // Start monitoring the status strip change in state + MonitorStatusStrip(strip); + + // Recalc to test if status strip should be integrated + RecalcNonClient(); + } + + base.OnControlAdded(e); + } + + /// + /// Raises the ControlRemoved event. + /// + /// An EventArgs containing event data. + protected override void OnControlRemoved(ControlEventArgs e) + { + // Is the cached reference being removed? + if (_statusStrip == e.Control) + { + // Unhook from status strip events + UnmonitorStatusStrip(); + + // Recalc to test if status strip should be unintegrated + RecalcNonClient(); + } + } + + /// + /// Raises the Load event. + /// + /// An EventArgs containing event data. + protected override void OnLoad(EventArgs e) + { + // Let base class perform standard actions such as calculating the + // correct initial size and position of the window when first shown + base.OnLoad(e); + + // We only apply custom chrome when control is already created and positioned + UpdateUseThemeFormChromeBorderWidthDecision(); + } + + /// + /// Raises the TextChanged event. + /// + /// An EventArgs containing event data. + protected override void OnTextChanged(EventArgs e) + { + base.OnTextChanged(e); + PerformNeedPaint(true); + } + + /// + /// Processes a notification from palette storage of a button spec change. + /// + /// Source of notification. + /// An EventArgs containing event data. + /// + protected override void OnButtonSpecChanged(object sender, EventArgs e) + { + Debug.Assert(e != null); + + // Validate incoming reference + if (e == null) + { + throw new ArgumentNullException(nameof(e)); + } + + // Recreate all the button specs with new values + _buttonManager.RecreateButtons(); + } + + /// + /// Called when the active state of the window changes. + /// + protected override void OnWindowActiveChanged() + { + // Update to use the correct state override values + if (WindowActive) + { + _drawDocker.SetPalettes(StateActive.Back, StateActive.Border); + _drawHeading.SetPalettes(StateActive.Header.Back, StateActive.Header.Border); + _drawContent.SetPalette(StateActive.Header.Content); + } + else + { + _drawDocker.SetPalettes(StateInactive.Back, StateInactive.Border); + _drawHeading.SetPalettes(StateInactive.Header.Back, StateInactive.Header.Border); + _drawContent.SetPalette(StateInactive.Header.Content); + } + + _drawDocker.Enabled = WindowActive; + _drawHeading.Enabled = WindowActive; + _drawContent.Enabled = WindowActive; + + // Only need to redraw if showing custom chrome + //if (ApplyCustomChrome) + //{ + PerformNeedPaint(false); + //} + + base.OnWindowActiveChanged(); + } + + /// + /// Raises the PaletteChanged event. + /// + /// An EventArgs containing the event data. + protected override void OnPaletteChanged(EventArgs e) + { + // Let base class switch the palette over + base.OnPaletteChanged(e); + + // Test if we need to change the custom chrome usage + UpdateUseThemeFormChromeBorderWidthDecision(); + } + + /// + /// Occurs when the AllowFormChromeChanged 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) => + // Test if we need to change the custom chrome usage + UpdateUseThemeFormChromeBorderWidthDecision(); + + protected override void OnFormClosing(FormClosingEventArgs e) + { + base.OnFormClosing(e); + } + + #endregion + + #region Protected Chrome + /// + /// Perform setup for custom chrome. + /// + protected override void WindowChromeStart() + { + // Make sure the views for the buttons are created + if (_recreateButtons) + { + _buttonManager.RecreateButtons(); + _recreateButtons = false; + } + + // Need to perform a layout + PerformNeedPaint(true); + + base.WindowChromeStart(); + } + + /// + /// Perform cleanup when custom chrome ending. + /// + protected override void WindowChromeEnd() + { + // Remove any region begin used to shape the form + UpdateBorderRegion(null); + + base.WindowChromeEnd(); + } + + /// + /// Perform hit testing. + /// + /// Point in window coordinates. + /// Are we performing composition. + /// + protected override IntPtr WindowChromeHitTest(Point pt, bool composition) + { + Point originalPt = pt; + if (CustomCaptionArea != null && CustomCaptionArea.Contains(pt)) + { + return (IntPtr)PlatformInvoke.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)) + { + // 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; + } + } + } + + // Do not allow the caption to be moved or the border resized + if (InertForm) + { + return (IntPtr)PlatformInvoke.HT.CLIENT; + } + + using (ViewLayoutContext context = new(this, Renderer)) + { + // Discover if the form icon is being Displayed + if (_drawContent.IsImageDisplayed(context)) + { + // Is the mouse over the image area + if (_drawContent.ImageRectangle(context).Contains(pt)) + { + return (IntPtr)PlatformInvoke.HT.MENU; + } + } + } + + 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 + }; + + // 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. + if (borders.Top > borders.Left) + { + borders.Top = borders.Left; + } + + // Get the elements that contains the mouse point + ViewBase? mouseView = ViewManager.Root!.ViewFromPoint(pt); + + // Scan up the view hierarchy until a recognized element is found + while (mouseView != null) + { + // Is mouse over the caption bar? + if (mouseView == _drawHeading) + { + // We give priority to the areas that are used to resize the window + if (pt.X > borders.Left && + pt.X < Width - borders.Right && + pt.Y > borders.Top && + pt.Y < Height - borders.Bottom) + { + return (IntPtr)PlatformInvoke.HT.CAPTION; + } + } + + // Is mouse over one of the borders? + if (mouseView == _drawDocker) + { + // Is point over the left border? + if (borders.Left > 0 && pt.X <= borders.Left) + { + if (pt.Y <= HT_CORNER) + { + return (IntPtr)PlatformInvoke.HT.TOPLEFT; + } + + return pt.Y >= Height - HT_CORNER ? (IntPtr)PlatformInvoke.HT.BOTTOMLEFT : (IntPtr)PlatformInvoke.HT.LEFT; + } + + // Is point over the right border? + if (borders.Right > 0 && pt.X >= Width - borders.Right) + { + if (pt.Y <= HT_CORNER) + { + return (IntPtr)PlatformInvoke.HT.TOPRIGHT; + } + + return pt.Y >= Height - HT_CORNER ? (IntPtr)PlatformInvoke.HT.BOTTOMRIGHT : (IntPtr)PlatformInvoke.HT.RIGHT; + } + + // Is point over the bottom border? + if (borders.Bottom > 0 && pt.Y >= Height - borders.Bottom) + { + if (pt.X <= HT_CORNER) + { + return (IntPtr)PlatformInvoke.HT.BOTTOMLEFT; + } + + return pt.X >= Width - HT_CORNER ? (IntPtr)PlatformInvoke.HT.BOTTOMRIGHT : (IntPtr)PlatformInvoke.HT.BOTTOM; + } + + // Is point over the top border? + if (borders.Top > 0 && pt.Y <= borders.Top) + { + if (pt.X <= HT_CORNER) + { + return (IntPtr)PlatformInvoke.HT.TOPLEFT; + } + + return pt.X >= Width - HT_CORNER ? (IntPtr)PlatformInvoke.HT.TOPRIGHT : (IntPtr)PlatformInvoke.HT.TOP; + } + } + + // Mouse up another level + mouseView = mouseView.Parent; + } + + return base.WindowChromeHitTest(originalPt, composition); + } + + /// + /// Perform painting of the window chrome. + /// + /// Graphics instance to use for drawing. + /// Bounds enclosing the window chrome. + protected override void WindowChromePaint(Graphics g, Rectangle bounds) + { + CheckViewLayout(); + PerformViewPaint(g, bounds); + } + + /// + /// Process the WM_NCLBUTTONDOWN message when overriding window chrome. + /// + /// A Windows-based message.4 + /// True if the message was processed; otherwise false. + protected override bool OnWM_NCLBUTTONDOWN(ref Message m) + { + using ViewLayoutContext context = new(this, Renderer); + // Discover if the form icon is being Displayed + if (_drawContent.IsImageDisplayed(context)) + { + // Extract the point in screen coordinates + Point screenPoint = new((int)m.LParam.ToInt64()); + + // Convert to window coordinates + Point windowPoint = ScreenToWindow(screenPoint); + + // Is the mouse over the Application icon image area + if (_drawContent.ImageRectangle(context).Contains(windowPoint)) + { + // TODO: Use `GetSystemMenu` to obtain the system menu and convert into a KryptonContextMenu with the correct theming ! + + // Make this work for the offset Application Icon when ButtonSpecs are left aligned + PlatformInvoke.PostMessage(this.Handle, PlatformInvoke.WM_.CONTEXTMENU, this.Handle, m.LParam); + return true; + } + } + + return base.OnWM_NCLBUTTONDOWN(ref m); + } + + /// + /// Process the left mouse down event. + /// + /// Window coordinate of the mouse down. + /// True if event is processed; otherwise false. + protected override bool WindowChromeLeftMouseDown(Point windowPoint) + { + // Let base class perform standard processing of the event + var ret = base.WindowChromeLeftMouseDown(windowPoint); + + // Has pressing down made a view active and indicated it also wants to capture mouse? + if (ViewManager.ActiveView != null && ViewManager.MouseCaptured) + { + StartCapture(ViewManager.ActiveView); + ret = true; + } + + return ret; + } + #endregion + + #region Implementation + private Icon? GetDefinedIcon() + { + // Are we allowed to try and show an icon? + if (AllowIconDisplay) + { + // Only some of the border styles show an icon + switch (FormBorderStyle) + { + case FormBorderStyle.Sizable: + case FormBorderStyle.Fixed3D: + case FormBorderStyle.FixedSingle: + // Only show icon if Form properties allow it + if (ShowIcon && ControlBox) + { + return Icon; + } + + break; + } + } + + return null; + } + + private void SetHeaderStyle(ViewDrawDocker drawDocker, + PaletteTripleMetricRedirect palette, + HeaderStyle style) + { + palette.SetStyles(style); + + switch (style) + { + case HeaderStyle.Primary: + _buttonManager.SetDockerMetrics(drawDocker, palette, + PaletteMetricInt.HeaderButtonEdgeInsetPrimary, + PaletteMetricPadding.HeaderButtonPaddingPrimary); + break; + case HeaderStyle.Secondary: + _buttonManager.SetDockerMetrics(drawDocker, palette, + PaletteMetricInt.HeaderButtonEdgeInsetSecondary, + PaletteMetricPadding.HeaderButtonPaddingSecondary); + break; + case HeaderStyle.DockActive: + _buttonManager.SetDockerMetrics(drawDocker, palette, + PaletteMetricInt.HeaderButtonEdgeInsetDockActive, + PaletteMetricPadding.HeaderButtonPaddingDockActive); + break; + case HeaderStyle.DockInactive: + _buttonManager.SetDockerMetrics(drawDocker, palette, + 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); + break; + } + } + + private bool CheckViewLayout() + { + // Cannot process a message for a disposed control + if (!IsDisposed && !Disposing) + { + // Do we have a manager to use for laying out? + if (ViewManager != null) + { + // Make sure the max/restore setting is correct + ButtonSpecMax.ButtonSpecType = WindowState == FormWindowState.Maximized + ? PaletteButtonSpecStyle.FormRestore + : PaletteButtonSpecStyle.FormMax; + + // Make sure the min/restore setting is correct + if (WindowState == FormWindowState.Minimized) + { + ButtonSpecMin.ButtonSpecType = PaletteButtonSpecStyle.FormRestore; + _drawDocker.StatusStrip = null; + } + else + { + ButtonSpecMin.ButtonSpecType = PaletteButtonSpecStyle.FormMin; + + // Make sure the top level form docker has the status strip being merged + _drawDocker.StatusStrip = StatusStripMerging ? _statusStrip : null; + } + + // Recreate buttons to get latest state + _buttonManager.RefreshButtons(); + + // Never set the header style unless it has changed, as it causes a relayout + if (_headerStyle != _headerStylePrev) + { + // Ensure the header style matches the form border style + SetHeaderStyle(_drawHeading, StateCommon.Header, _headerStyle); + + // Remember last header style set + _headerStylePrev = _headerStyle; + } + + // Update the heading to have a height matching the window requirements + Padding windowBorders = RealWindowBorders; + _headingFixedSize.FixedSize = new Size(windowBorders.Top, windowBorders.Top); + + // A change in window state since last time requires a layout + if (_lastWindowState != GetWindowState()) + { + _lastWindowState = GetWindowState(); + NeedLayout = true; + } + + // Text can change because of a minimized/maximized MDI child so need + // to watch out for the change and ensure a layout occurs + if (_oldText != GetShortText()) + { + _oldText = GetShortText(); + NeedLayout = true; + } + + // If any of the buttons are tracking or pressed then need to layout + if (!NeedLayout) + { + var notNormal = false; + foreach (ButtonSpecView bsv in _buttonManager.ButtonSpecViews) + { + switch (bsv.ViewButton!.State) + { + case PaletteState.Tracking: + case PaletteState.Pressed: + notNormal = true; + break; + } + } + + if (_lastNotNormal != notNormal) + { + _lastNotNormal = notNormal; + NeedLayout = true; + } + } + + // Is a layout required? + if (NeedLayout + || GetDefinedIcon() != _cacheIcon + ) + { + // Ask the view to perform a layout + using (var context = new ViewLayoutContext(ViewManager, this, RealWindowRectangle, Renderer)) + { + ViewManager.Layout(context); + } + + // Layout not needed until next indicated + NeedLayout = false; + + // If in the maximized state we manually create the region + if (GetWindowState() == FormWindowState.Maximized) + { + UpdateRegionForMaximized(); + } + else + { + // 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 + using RenderContext context = new(this, null, Bounds, Renderer); + using GraphicsPath? path = _drawDocker.GetOuterBorderPath(context); + if (!_firstCheckView) + { + SuspendPaint(); + } + + UpdateBorderRegion(path != null ? new Region(path) : null); + + if (!_firstCheckView) + { + ResumePaint(); + } + } + + // Next time around we suspend/resume the drawing + _firstCheckView = false; + return true; + } + } + } + + return false; + } + + private void PerformViewPaint(Graphics g, Rectangle rect) + { + // Cannot process a message for a disposed control + if (!IsDisposed && !Disposing && ViewManager != null) + { + // 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) + { + UpdateRegionForMaximized(); + } + + // We draw the main form and header background + _drawDocker.DrawCanvas = true; + _drawHeading.DrawCanvas = true; + + // Perform actual painting of the view + ViewManager.Paint(Renderer, new PaintEventArgs(g, rect)); + } + } + + private void UpdateRegionForMaximized() + { + if (MdiParent == null) + { + // Get the size of each window border + Padding padding = RealWindowBorders; + + // Reduce the Bounds by the padding on all but the top + Rectangle maximizedRect = new(padding.Left, padding.Left, + Width - padding.Horizontal, + Height - padding.Left - padding.Bottom); + + // Use this as the new region + SuspendPaint(); + _regionWindowState = FormWindowState.Maximized; + UpdateBorderRegion(new Region(maximizedRect)); + ResumePaint(); + } + else + { + // As a maximized Mdi Child we do not need any border region + UpdateBorderRegion(null); + } + } + + private void UpdateBorderRegion(Region? newRegion) + { + if (newRegion != null + && newRegion.IsEmpty(this.CreateGraphics()) + ) + { + return; + } + + // Cache the current region setting + Region oldRegion = Region; + + // Use the new region + Region = newRegion; + + // Cleanup old region gracefully + oldRegion?.Dispose(); + } + + private void UpdateUseThemeFormChromeBorderWidthDecision() + { + if (IsHandleCreated) + { + // Decide if we should have custom chrome applied + var needChrome = UseThemeFormChromeBorderWidth && + KryptonManager.UseThemeFormChromeBorderWidth && + GetResolvedPalette().UseThemeFormChromeBorderWidth == InheritBool.True; + + // Is there a change in custom chrome requirement? + if (UseThemeFormChromeBorderWidth != needChrome + || !_hasUseThemeFormChromeBorderWidthFirstRun) + { + _hasUseThemeFormChromeBorderWidthFirstRun = true; + _recreateButtons = true; + _firstCheckView = true; + UseThemeFormChromeBorderWidth = needChrome; + base.UseThemeFormChromeBorderWidth = true; // make sure "Form" buttons are drawn correctly + PerformNeedPaint(true); // Force Layout size change + } + } + } + + internal bool StatusStripMerging => _allowStatusStripMerge + && _statusStrip is { Visible: true, Dock: DockStyle.Bottom } + && _statusStrip.Bottom == ClientRectangle.Bottom + && _statusStrip.RenderMode == ToolStripRenderMode.ManagerRenderMode + && ToolStripManager.Renderer is KryptonOffice2007Renderer or KryptonSparkleRenderer; + + private void MonitorStatusStrip(StatusStrip? statusStrip) + { + if (_statusStrip != null) + { + UnmonitorStatusStrip(); + } + + // Hook into event handlers + _statusStrip = statusStrip; + _statusStrip!.VisibleChanged += OnStatusVisibleChanged; + _statusStrip.DockChanged += OnStatusDockChanged; + } + + private void UnmonitorStatusStrip() + { + if (_statusStrip != null) + { + // Unhook from event handlers + _statusStrip.VisibleChanged -= OnStatusVisibleChanged; + _statusStrip.DockChanged -= OnStatusDockChanged; + _statusStrip = null; + } + } + + 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()!; + if (topForm is { ContainsFocus: false }) + { + return; + } + + // Never show tooltips are design time + if (!DesignMode) + { + IContentValues? sourceContent = null; + LabelStyle toolTipStyle = LabelStyle.ToolTip; + bool shadow = true; + + // Find the button spec associated with the tooltip request + ButtonSpec? buttonSpec = _buttonManager.ButtonSpecFromView(e.Target); + + // If the tooltip is for a button spec + if (buttonSpec != null) + { + // Are we allowed to show page related tooltips + if (AllowButtonSpecToolTips) + { + // Create a helper object to provide tooltip values + ButtonSpecToContent? buttonSpecMapping = new(Redirector, buttonSpec); + + // Is there actually anything to show for the tooltip + if (buttonSpecMapping.HasContent) + { + sourceContent = buttonSpecMapping; + toolTipStyle = buttonSpec.ToolTipStyle; + shadow = buttonSpec.ToolTipShadow; + } + } + } + + if (sourceContent != null) + { + // Remove any currently showing tooltip + _visualPopupToolTip?.Dispose(); + + // Create the actual tooltip popup object + _visualPopupToolTip = new VisualPopupToolTip(Redirector, + sourceContent, + Renderer, + PaletteBackStyle.ControlToolTip, + PaletteBorderStyle.ControlToolTip, + CommonHelper.ContentStyleFromLabelStyle(toolTipStyle), + shadow); + + _visualPopupToolTip.Disposed += OnVisualPopupToolTipDisposed; + + // Show relative to the provided screen point + _visualPopupToolTip.ShowCalculatingSize(e.ControlMousePosition); + } + } + } + } + + private void OnCancelToolTip(object sender, EventArgs e) => + // Remove any currently showing tooltip + _visualPopupToolTip?.Dispose(); + + private void OnVisualPopupToolTipDisposed(object sender, EventArgs e) + { + // Unhook events from the specific instance that generated event + VisualPopupToolTip popupToolTip = (VisualPopupToolTip)sender; + popupToolTip.Disposed -= OnVisualPopupToolTipDisposed; + + // Not showing a popup page any more + _visualPopupToolTip = null; + } + + private void OnButtonManagerNeedPaint(object? sender, NeedLayoutEventArgs e) + { + // Only interested in optimizing specific button spec changes + if (sender is ButtonSpecView bsView) + { + ButtonSpec bs = bsView.ButtonSpec; + + // Only interest in the three form level buttons, as we know + // these never change in size because of a paint request + if (bs == ButtonSpecMin || + bs == ButtonSpecMax || + bs == ButtonSpecClose) + { + // Translate the button rectangle into the non client area + Rectangle buttonRect = bsView.ViewButton!.ClientRectangle; + Padding borders = RealWindowBorders; + buttonRect.X -= borders.Left; + buttonRect.Y -= borders.Top; + + // Only invalidate the actual button area itself + OnNeedPaint(sender, new NeedLayoutEventArgs(false, buttonRect)); + return; + } + } + + OnNeedPaint(sender, e); + } + + private void OnStatusDockChanged(object sender, EventArgs e) + { + if (StatusStripMerging) + { + PerformNeedPaint(false); + } + } + + private void OnStatusVisibleChanged(object sender, EventArgs e) + { + if (StatusStripMerging) + { + PerformNeedPaint(false); + } + } + + private void OnGlobalUseThemeFormChromeBorderWidthChanged(object sender, EventArgs e) => UpdateUseThemeFormChromeBorderWidthDecision(); + + private void OnGlobalPaletteChanged(object sender, EventArgs e) + { + // We only care if we are using the global palette + if (PaletteMode == PaletteMode.Global) + { + UpdateUseThemeFormChromeBorderWidthDecision(); + } + } + #endregion + + #region Drop Shadow Methods + /// + /// Calls the method that draws the drop shadow around the form. + /// + /// Use dropshadow user input value. + public void UpdateDropShadowDraw(bool useDropShadow) + { + if (useDropShadow) + { + DrawDropShadow(); + } + + Invalidate(); + } + + /// + /// A wrapper that draws the drop shadow around the form. + /// + /// The shadow around the form. + private void DrawDropShadow() + { + GetCreateParams(); + + // Redraw + Invalidate(); + } + + /// + /// Test code + /// + /// The overrides + private CreateParams GetCreateParams() + { + CreateParams cp = base.CreateParams; + + return cp; + } + + /// + /// Example by juverpp + /// + protected override CreateParams CreateParams + { + get + { + // add the drop shadow flag for automatically drawing + // a drop shadow around the form + CreateParams cp = base.CreateParams; + +#pragma warning disable CS0618 // Type or member is obsolete + if (UseDropShadow) + { + cp.ClassStyle |= CS_DROPSHADOW; + } + + if (!CloseBox) + { + cp.ClassStyle |= CP_NOCLOSE_BUTTON; + } +#pragma warning restore CS0618 // Type or member is obsolete + + return cp; + } + } + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VisualSlideForm.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VisualSlideForm.Designer.cs new file mode 100644 index 000000000..dfba5d79b --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VisualSlideForm.Designer.cs @@ -0,0 +1,56 @@ +namespace Krypton.Toolkit.Suite.Extended.Forms +{ + public partial class VisualSlideForm + { + /// + /// 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.tmrSlide = new System.Windows.Forms.Timer(this.components); + this.SuspendLayout(); + // + // tmrSlide + // + this.tmrSlide.Interval = 10; + this.tmrSlide.Tick += new System.EventHandler(this.tmrSlide_Tick); + // + // VisualSlideForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(284, 284); + this.ControlBox = false; + this.Name = "VisualSlideForm"; + this.ShowInTaskbar = false; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Timer tmrSlide; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VisualSlideForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VisualSlideForm.cs new file mode 100644 index 000000000..c2058ebbc --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VisualSlideForm.cs @@ -0,0 +1,201 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Krypton.Toolkit.Suite.Extended.Forms +{ + public partial class VisualSlideForm : KryptonForm + { + #region Instance Fields + + private bool _expand; + + private float _ratio; + + private float _step; + + private readonly KryptonFormExtended? _owner; + + private SlideDirection _slideDirection; + + private SizeF _offset; + + private SizeF _sizeStep; + + private Point _origin; + + #endregion + + #region Public + + public bool IsExpanded => _expand; + + public SlideDirection SlideDirection + { + set => _slideDirection = value; + } + + public float SlideStep + { + set => _step = value; + } + + #endregion + + #region Identity + + public VisualSlideForm(KryptonFormExtended? owner, float step) + { + InitializeComponent(); + + _owner = owner; + + _ratio = 0.0f; + + _step = step; + } + + public VisualSlideForm() : this(null, 0) + { + + } + + #endregion + + #region Implementation + + public void Slide() + { + if (!_expand) + { + Show(); + } + + _owner?.BringToFront(); + + _expand = !_expand; + + tmrSlide.Start(); + } + + private void tmrSlide_Tick(object sender, EventArgs e) + { + if (_expand) + { + _ratio += _step; + + _offset += _sizeStep; + + if (_ratio > 1) + { + tmrSlide.Stop(); + } + } + else + { + _ratio -= _step; + + _offset -= _sizeStep; + + if (_ratio <= 0) + { + tmrSlide.Stop(); + } + } + + UpdateLocation(); + } + + private void UpdateLocation() => Location = _origin + _offset.ToSize(); + + private void UpdateSlideLocation() + { + if (_owner != null) + { + _origin = new Point(); + + switch (_slideDirection) + { + case SlideDirection.Top: + _origin = _owner.Location; + + Width = _owner.Width; + + _sizeStep = new SizeF(0, -Height * _step); + break; + case SlideDirection.Bottom: + _origin.X = _owner.Location.X; + + _origin.Y = _owner.Location.Y + _owner.Height - Height; + + Width = _owner.Width; + + _sizeStep = new SizeF(0, Height * _step); + break; + case SlideDirection.Left: + _origin = _owner.Location; + + _sizeStep = new SizeF(-Width * _step, 0); + + Height = _owner.Height; + break; + case SlideDirection.Right: + _origin.X = _owner.Location.X + _owner.Width - Width; + + _origin.Y = _owner.Location.Y; + + _sizeStep = new SizeF(Width * _step, 0); + + Height = _owner.Height; + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + } + + private void VisualSlideForm_Move(object sender, EventArgs e) + { + UpdateSlideLocation(); + + UpdateLocation(); + } + + private void VisualSlideForm_Resize(object sender, EventArgs e) + { + UpdateSlideLocation(); + + UpdateLocation(); + } + + private void VisualSlideForm_Closed(object sender, EventArgs e) => Close(); + + #endregion + + #region Protected + + protected override void OnLoad(EventArgs e) + { + UpdateSlideLocation(); + + UpdateLocation(); + + if (_owner != null) + { + _owner.LocationChanged += VisualSlideForm_Move; + + _owner.Resize += VisualSlideForm_Resize; + + _owner.Closed += VisualSlideForm_Closed; + } + } + + #endregion + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VisualSlideForm.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VisualSlideForm.resx new file mode 100644 index 000000000..4786659dd --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VisualSlideForm.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 Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Enumerations/FadeDirection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Enumerations/FadeDirection.cs index cc8d39052..34d52043b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Enumerations/FadeDirection.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Enumerations/FadeDirection.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Enumerations/FadeSpeedChoice.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Enumerations/FadeSpeedChoice.cs index a7b9bfc32..05c26ed81 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Enumerations/FadeSpeedChoice.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Enumerations/FadeSpeedChoice.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Enumerations/SlideDirection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Enumerations/SlideDirection.cs new file mode 100644 index 000000000..237ba71ec --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Enumerations/SlideDirection.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Krypton.Toolkit.Suite.Extended.Forms +{ + public enum SlideDirection + { + Top = 0, + Bottom = 1, + Left = 2, + Right = 3 + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/BlurManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/BlurManager.cs index ef17c6997..cc330b730 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/BlurManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/BlurManager.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -35,17 +35,17 @@ namespace Krypton.Toolkit.Suite.Extended.Forms internal class BlurManager { #region Instance Fields - private readonly VirtualForm _parentForm; + private readonly VisualForm _parentForm; private readonly BlurValues _blurValues; - private VisualBlur _visualBlur; + private VisualBlur? _visualBlur; private readonly Timer _detectIsActiveTimer; - private Bitmap _currentFormDisplay; + private Bitmap? _currentFormDisplay; private double? _parentBeforeOpacity; #endregion #region Identity - public BlurManager(VirtualForm kryptonForm, BlurValues blurValues) + public BlurManager(VisualForm kryptonForm, BlurValues blurValues) { _parentForm = kryptonForm; _blurValues = blurValues; @@ -117,13 +117,13 @@ public bool IsOverlapped() var visited = new HashSet { hWnd }; try { - Form activeForm = Form.ActiveForm; + Form? activeForm = Form.ActiveForm; if (activeForm != null) { visited.Add(activeForm.Handle); } - visited.Add(_visualBlur.Handle); + visited.Add(_visualBlur!.Handle); PlatformInvoke.RECT thisRect = new(); @@ -172,7 +172,7 @@ private void BlurValues_EnableBlurChanged(object sender, EventArgs e) private void DetectIsTopMost(object sender, EventArgs e) { - if ((_visualBlur != null) + if (_visualBlur != null && IsOverlapped() ) { @@ -195,9 +195,9 @@ private void DoTheBlur() _visualBlur.SetTargetRect(_parentForm.DesktopLocation, clientRectangle); Rectangle targetRect = _visualBlur.TargetRect; - _visualBlur.UpdateBlur(_currentFormDisplay); + _visualBlur.UpdateBlur(_currentFormDisplay!); // As UpdateBlur can take a few moments, then it is possible for the app to be closed before getting to the next line - if ((_visualBlur == null) + if (_visualBlur == null || _parentForm.IsDisposed || _parentForm.Disposing ) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/CommonHelperExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/CommonHelperExtended.cs new file mode 100644 index 000000000..e5cbbe2a3 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/CommonHelperExtended.cs @@ -0,0 +1,1679 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Forms +{ + #region Delegates + /// + /// Signature of a bare method. + /// + public delegate void SimpleCall(); + + /// + /// Signature of a method that performs an operation. + /// + /// Operation parameter. + /// Operation result. + public delegate object Operation(object? parameter); + + /// + /// Signature of a method that returns a ToolStripRenderer instance. + /// + public delegate ToolStripRenderer GetToolStripRenderer(); + #endregion + + /// + /// Set of common helper routines for the Toolkit + /// + public static class CommonHelperExtended + { + #region Static Fields + private const int VK_SHIFT = 0x10; + private const int VK_CONTROL = 0x11; + private const int VK_MENU = 0x12; + + private static readonly char[] _singleDateFormat = ['d', + 'f', + 'F', + 'g', + 'h', + 'H', + 'K', + 'm', + 'M', + 's', + 't', + 'y', + 'z' + ]; + //private static readonly int[] _daysInMonth = new int[12] { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; + + private static int _nextId = 1000; + //private static readonly DateTime _baseDate = new(2000, 1, 1); + private static PropertyInfo? _cachedShortcutPI; + private static PropertyInfo? _cachedDesignModePI; + private static MethodInfo? _cachedShortcutMI; + private static NullContentValues? _nullContentValues; + private static readonly DoubleConverter _dc = new DoubleConverter(); + private static readonly SizeConverter _sc = new SizeConverter(); + private static readonly PointConverter _pc = new PointConverter(); + private static readonly BooleanConverter _bc = new BooleanConverter(); + private static readonly ColorConverter _cc = new ColorConverter(); + + #endregion + + /// + /// Gets access to the global null point value. + /// + public static Point NullPoint + { + [DebuggerStepThrough] + get; + } = new Point(int.MaxValue, int.MaxValue); + + /// + /// Gets access to the global null rectangle value. + /// + public static Rectangle NullRectangle + { + [DebuggerStepThrough] + get; + } = new Rectangle(int.MaxValue, int.MaxValue, 0, 0); + + /// + /// Color matrix used to adjust colors to look disabled. + /// + public static ColorMatrix MatrixDisabled + { + [DebuggerStepThrough] + get; + } = new ColorMatrix([ + [0.3f, 0.3f, 0.3f, 0, 0], + [0.59f, 0.59f, 0.59f, 0, 0], + [0.11f, 0.11f, 0.11f, 0, 0], + [0, 0, 0, 0.5f, 0], + [0, 0, 0, 0, 1] + ]); + + /// + /// Gets the next global identifier in sequence. + /// + public static int NextId + { + [DebuggerStepThrough] + get => _nextId++; + } + + /// + /// Gets a string that is guaranteed to be unique. + /// + public static string UniqueString + { + get + { + // Generate a GUID that is guaranteed to be unique + var guid = Guid.NewGuid(); + // Return as a hex formatted string. + return guid.ToString(@"N"); + } + } + + /// + /// Gets the padding value used when inheritance is needed. + /// + public static Padding InheritPadding + { + [DebuggerStepThrough] + get; + } = new Padding(-1); + + /// + /// Check a short-cut menu for a matching short and invoke that item if found. + /// + /// ContextMenuStrip instance to check. + /// Windows message that generated check. + /// Keyboard shortcut to check. + /// True if shortcut processed; otherwise false. + public static bool CheckContextMenuForShortcut(ContextMenuStrip? cms, + ref Message msg, + Keys keyData) + { + if (cms != null) + { + // Cache the info needed to sneak access to the context menu strip + if (_cachedShortcutPI == null) + { + _cachedShortcutPI = typeof(ToolStrip).GetProperty(@"Shortcuts", + BindingFlags.Instance | + BindingFlags.GetProperty | + BindingFlags.NonPublic); + + _cachedShortcutMI = typeof(ToolStripMenuItem).GetMethod("ProcessCmdKey", + BindingFlags.Instance | + BindingFlags.NonPublic); + } + + // Get any menu item from context strip that matches the shortcut key combination + var shortcuts = _cachedShortcutPI!.GetValue(cms, null) as Hashtable; + + // If we found a match... + if (shortcuts![keyData] is ToolStripMenuItem menuItem) + { + // Get the menu item to process the shortcut + var ret = _cachedShortcutMI!.Invoke(menuItem, [msg, keyData]); + + // Return the 'ProcessCmdKey' result + if (ret != null) + { + return (bool)ret; + } + } + } + + return false; + } + + /// + /// Gets reference to a null implementation of the IContentValues interface. + /// + public static IContentValues NullContentValues => _nullContentValues ??= new NullContentValues(); + + /// + /// Return the provided size with orientation specific padding applied. + /// + /// Orientation to apply padding with. + /// Starting size. + /// Padding to be applied. + /// Updated size. + public static Size ApplyPadding(Orientation orientation, Size size, Padding padding) + { + // Ignore an empty padding value + if (!padding.Equals(InheritPadding)) + { + // The orientation determines how the border padding is + // applied to the preferred size of the children + switch (orientation) + { + case Orientation.Vertical: + size.Width += padding.Vertical; + size.Height += padding.Horizontal; + break; + case Orientation.Horizontal: + size.Width += padding.Horizontal; + size.Height += padding.Vertical; + break; + default: + // Should never happen! + Debug.Assert(false); + DebugTools.NotImplemented(orientation.ToString()); + break; + } + } + + return size; + } + + /// + /// Return the provided size with visual orientation specific padding applied. + /// + /// Orientation to apply padding with. + /// Starting size. + /// Padding to be applied. + /// Updated size. + public static Size ApplyPadding(VisualOrientation orientation, + Size size, + Padding padding) + { + // Ignore an empty padding value + if (!padding.Equals(InheritPadding)) + { + // The orientation determines how the border padding is + // applied to the preferred size of the children + switch (orientation) + { + case VisualOrientation.Top: + case VisualOrientation.Bottom: + size.Width += padding.Horizontal; + size.Height += padding.Vertical; + break; + case VisualOrientation.Left: + case VisualOrientation.Right: + size.Width += padding.Vertical; + size.Height += padding.Horizontal; + break; + default: + // Should never happen! + Debug.Assert(false); + DebugTools.NotImplemented(orientation.ToString()); + break; + } + } + + return size; + } + + /// + /// Return the provided rectangle with orientation specific padding applied. + /// + /// Orientation to apply padding with. + /// Starting rectangle. + /// Padding to be applied. + /// Updated rectangle. + public static Rectangle ApplyPadding(Orientation orientation, + Rectangle rect, + Padding padding) + { + // Ignore an empty padding value + if (!padding.Equals(InheritPadding)) + { + // The orientation determines how the border padding is + // applied to the preferred size of the children + switch (orientation) + { + case Orientation.Horizontal: + rect.X += padding.Left; + rect.Width -= padding.Horizontal; + rect.Y += padding.Top; + rect.Height -= padding.Vertical; + break; + case Orientation.Vertical: + rect.X += padding.Top; + rect.Width -= padding.Vertical; + rect.Y += padding.Right; + rect.Height -= padding.Horizontal; + break; + default: + // Should never happen! + Debug.Assert(false); + DebugTools.NotImplemented(orientation.ToString()); + break; + } + } + + return rect; + } + + /// + /// Return the provided rectangle with visual orientation specific padding applied. + /// + /// Orientation to apply padding with. + /// Starting rectangle. + /// Padding to be applied. + /// Updated rectangle. + public static Rectangle ApplyPadding(VisualOrientation orientation, + Rectangle rect, + Padding padding) + { + // Ignore an empty padding value + if (!padding.Equals(InheritPadding)) + { + // The orientation determines how the border padding is + // used to reduce the space available for children + switch (orientation) + { + case VisualOrientation.Top: + rect = new Rectangle(rect.X + padding.Left, rect.Y + padding.Top, + rect.Width - padding.Horizontal, rect.Height - padding.Vertical); + break; + case VisualOrientation.Bottom: + rect = new Rectangle(rect.X + padding.Right, rect.Y + padding.Bottom, + rect.Width - padding.Horizontal, rect.Height - padding.Vertical); + break; + case VisualOrientation.Left: + rect = new Rectangle(rect.X + padding.Top, rect.Y + padding.Right, + rect.Width - padding.Vertical, rect.Height - padding.Horizontal); + break; + case VisualOrientation.Right: + rect = new Rectangle(rect.X + padding.Bottom, rect.Y + padding.Left, + rect.Width - padding.Vertical, rect.Height - padding.Horizontal); + break; + default: + // Should never happen! + Debug.Assert(false); + DebugTools.NotImplemented(orientation.ToString()); + break; + } + } + + return rect; + } + + /// + /// Modify the incoming padding to reflect the visual orientation. + /// + /// Orientation to apply to padding. + /// Padding to be modified. + /// Updated padding. + public static Padding OrientatePadding(VisualOrientation orientation, + Padding padding) + { + switch (orientation) + { + case VisualOrientation.Top: + return padding; + case VisualOrientation.Bottom: + return new Padding(padding.Right, padding.Bottom, padding.Left, padding.Top); + case VisualOrientation.Left: + return new Padding(padding.Top, padding.Right, padding.Bottom, padding.Left); + case VisualOrientation.Right: + return new Padding(padding.Bottom, padding.Left, padding.Top, padding.Right); + default: + // Should never happen! + Debug.Assert(false); + DebugTools.NotImplemented(orientation.ToString()); + return padding; + } + } + + /// + /// Swap the width and height values for the rectangle. + /// + /// Rectangle to modify. + [DebuggerStepThrough] + public static void SwapRectangleSizes(ref Rectangle rect) => (rect.Width, rect.Height) = (rect.Height, rect.Width); + + /// + /// Gets the form level right to left setting. + /// + /// Control for which the setting is needed. + /// RightToLeft setting. + public static bool GetRightToLeftLayout(Control control) + { + // Default to left-to-right layout + var rtl = false; + + // We need a valid control to find a top level form + // Search for a top level form associated with the control + Form? topForm = control.FindForm(); + + // If can find an owning form + if (topForm != null) + { + // Use the form setting instead + rtl = topForm.RightToLeftLayout; + } + + return rtl; + } + + /// + /// Decide if the context menu strip should be Displayed. + /// + /// Reference to context menu strip. + /// True to display; otherwise false. + public static bool ValidContextMenuStrip(ContextMenuStrip? cms) => + // Must be a valid reference to examine + cms is { Items.Count: > 0 }; + + /// + /// Decide if the KryptonContextMenu should be Displayed. + /// + /// Reference to context menu strip. + /// True to display; otherwise false. + public static bool ValidKryptonContextMenu(KryptonContextMenu? kcm) => + // Must be a valid reference to examine + kcm is { Items.Count: > 0 }; + + /// + /// Perform operation in a worker thread with wait dialog in main thread. + /// + /// Delegate of operation to be performed. + /// Parameter to be passed into the operation. + /// Result of performing the operation. + public static object PerformOperation(Operation op, object? parameter) + { + // Create a modal window for showing feedback + using var wait = new ModalWaitDialog(); + // Create the object that runs the operation in a separate thread + var opThread = new OperationThreadExtended(op, parameter); + + // Create the actual thread and provide thread entry point + var thread = new Thread(opThread.Run); + + // Kick off the thread action + thread.Start(); + + // Keep looping until the thread is finished + while (opThread.State == 0) + { + // Sleep to allow thread to perform more work + Thread.Sleep(25); + + // Give the feedback dialog a chance to update + wait.UpdateDialog(); + } + + // Process operation result + switch (opThread.State) + { + case 1: + return opThread.Result; + case 2: + throw opThread.Exception; + default: + // Should never happen! + Debug.Assert(false); + throw DebugTools.NotImplemented(opThread.State.ToString()); + } + } + + /// + /// Gets a value indicating if the provided value is an override state. + /// + /// Specific state. + /// True if an override state; otherwise false. + [DebuggerStepThrough] + public static bool IsOverrideState(PaletteState state) => (state & PaletteState.Override) == PaletteState.Override; + + /// + /// Gets a value indicating if the provided value is an override state but excludes one value. + /// + /// Specific state. + /// State that should be excluded from test. + /// True if an override state; otherwise false. + [DebuggerStepThrough] + public static bool IsOverrideStateExclude(PaletteState state, PaletteState exclude) => state != exclude && IsOverrideState(state); + + /// + /// Gets a value indicating if the enumeration specifies no borders. + /// + /// Enumeration for borders. + /// True if no border specified; otherwise false. + [DebuggerStepThrough] + public static bool HasNoBorders(PaletteDrawBorders borders) => (borders & PaletteDrawBorders.All) == PaletteDrawBorders.None; + + /// + /// Gets a value indicating if the enumeration specifies at least one border. + /// + /// Enumeration for borders. + /// True if at least one border specified; otherwise false. + [DebuggerStepThrough] + public static bool HasABorder(PaletteDrawBorders borders) => (borders & PaletteDrawBorders.All) != PaletteDrawBorders.None; + + /// + /// Gets a value indicating if the enumeration specifies at least one border. + /// + /// Enumeration for borders. + /// True if at least one border specified; otherwise false. + [DebuggerStepThrough] + public static bool HasOneBorder(PaletteDrawBorders borders) + { + PaletteDrawBorders justBorders = borders & PaletteDrawBorders.All; + + // If borders value equals just one of the edges + return justBorders is PaletteDrawBorders.Top or PaletteDrawBorders.Bottom or PaletteDrawBorders.Left or PaletteDrawBorders.Right; + } + + /// + /// Gets a value indicating if the enumeration includes the top border. + /// + /// Enumeration for borders. + /// True if includes the top border; otherwise false. + [DebuggerStepThrough] + public static bool HasTopBorder(PaletteDrawBorders borders) => (borders & PaletteDrawBorders.Top) == PaletteDrawBorders.Top; + + /// + /// Gets a value indicating if the enumeration includes the bottom border. + /// + /// Enumeration for borders. + /// True if includes the bottom border; otherwise false. + [DebuggerStepThrough] + public static bool HasBottomBorder(PaletteDrawBorders borders) => (borders & PaletteDrawBorders.Bottom) == PaletteDrawBorders.Bottom; + + /// + /// Gets a value indicating if the enumeration includes the left border. + /// + /// Enumeration for borders. + /// True if includes the left border; otherwise false. + [DebuggerStepThrough] + public static bool HasLeftBorder(PaletteDrawBorders borders) => (borders & PaletteDrawBorders.Left) == PaletteDrawBorders.Left; + + /// + /// Gets a value indicating if the enumeration includes the right border. + /// + /// Enumeration for borders. + /// True if includes the right border; otherwise false. + [DebuggerStepThrough] + public static bool HasRightBorder(PaletteDrawBorders borders) => (borders & PaletteDrawBorders.Right) == PaletteDrawBorders.Right; + + /// + /// Gets a value indicating if the enumeration specifies all four borders. + /// + /// Enumeration for borders. + /// True if all four borders specified; otherwise false. + [DebuggerStepThrough] + public static bool HasAllBorders(PaletteDrawBorders borders) => (borders & PaletteDrawBorders.All) == PaletteDrawBorders.All; + + /// + /// Apply an orientation to the draw border edges to get a correct value. + /// + /// Border edges to be drawn. + /// How to adjust the border edges. + /// Border edges adjusted for orientation. + public static PaletteDrawBorders OrientateDrawBorders(PaletteDrawBorders borders, + VisualOrientation orientation) + { + // No need to perform a change for top orientation + if (orientation == VisualOrientation.Top) + { + return borders; + } + + // No need to change All or None values + if (borders is PaletteDrawBorders.All or PaletteDrawBorders.None) + { + return borders; + } + + var ret = PaletteDrawBorders.None; + + // Apply orientation change to each side in turn + switch (orientation) + { + case VisualOrientation.Bottom: + // Invert sides + if (HasTopBorder(borders)) + { + ret |= PaletteDrawBorders.Bottom; + } + + if (HasBottomBorder(borders)) + { + ret |= PaletteDrawBorders.Top; + } + + if (HasLeftBorder(borders)) + { + ret |= PaletteDrawBorders.Right; + } + + if (HasRightBorder(borders)) + { + ret |= PaletteDrawBorders.Left; + } + break; + + case VisualOrientation.Left: + // Rotate one anti-clockwise + if (HasTopBorder(borders)) + { + ret |= PaletteDrawBorders.Left; + } + + if (HasBottomBorder(borders)) + { + ret |= PaletteDrawBorders.Right; + } + + if (HasLeftBorder(borders)) + { + ret |= PaletteDrawBorders.Bottom; + } + + if (HasRightBorder(borders)) + { + ret |= PaletteDrawBorders.Top; + } + break; + + case VisualOrientation.Right: + // Rotate sides one clockwise + if (HasTopBorder(borders)) + { + ret |= PaletteDrawBorders.Right; + } + + if (HasBottomBorder(borders)) + { + ret |= PaletteDrawBorders.Left; + } + + if (HasLeftBorder(borders)) + { + ret |= PaletteDrawBorders.Top; + } + + if (HasRightBorder(borders)) + { + ret |= PaletteDrawBorders.Bottom; + } + break; + + default: + // Should never happen! + Debug.Assert(false); + DebugTools.NotImplemented(orientation.ToString()); + break; + } + + return ret; + } + + /// + /// Apply a reversed orientation so that when orientated again it comes out with the original value. + /// + /// Border edges to be drawn. + /// How to adjust the border edges. + /// Border edges adjusted for orientation. + public static PaletteDrawBorders ReverseOrientateDrawBorders(PaletteDrawBorders borders, + VisualOrientation orientation) + { + // No need to perform an change for top orientation + if (orientation == VisualOrientation.Top) + { + return borders; + } + + // No need to change the All or None values + if (borders is PaletteDrawBorders.All or PaletteDrawBorders.None) + { + return borders; + } + + var ret = PaletteDrawBorders.None; + + // Apply orientation change to each side in turn + switch (orientation) + { + case VisualOrientation.Bottom: + // Invert sides + if (HasTopBorder(borders)) + { + ret |= PaletteDrawBorders.Bottom; + } + + if (HasBottomBorder(borders)) + { + ret |= PaletteDrawBorders.Top; + } + + if (HasLeftBorder(borders)) + { + ret |= PaletteDrawBorders.Right; + } + + if (HasRightBorder(borders)) + { + ret |= PaletteDrawBorders.Left; + } + break; + + case VisualOrientation.Right: + // Rotate one anti-clockwise + if (HasTopBorder(borders)) + { + ret |= PaletteDrawBorders.Left; + } + + if (HasBottomBorder(borders)) + { + ret |= PaletteDrawBorders.Right; + } + + if (HasLeftBorder(borders)) + { + ret |= PaletteDrawBorders.Bottom; + } + + if (HasRightBorder(borders)) + { + ret |= PaletteDrawBorders.Top; + } + break; + + case VisualOrientation.Left: + // Rotate sides one clockwise + if (HasTopBorder(borders)) + { + ret |= PaletteDrawBorders.Right; + } + + if (HasBottomBorder(borders)) + { + ret |= PaletteDrawBorders.Left; + } + + if (HasLeftBorder(borders)) + { + ret |= PaletteDrawBorders.Top; + } + + if (HasRightBorder(borders)) + { + ret |= PaletteDrawBorders.Bottom; + } + break; + + default: + // Should never happen! + Debug.Assert(false); + DebugTools.NotImplemented(orientation.ToString()); + break; + } + + return ret; + } + + /// + /// Convert from VisualOrientation to Orientation. + /// + /// VisualOrientation value. + /// Orientation value. + public static Orientation VisualToOrientation(VisualOrientation orientation) + { + switch (orientation) + { + case VisualOrientation.Top: + case VisualOrientation.Bottom: + return Orientation.Vertical; + case VisualOrientation.Left: + case VisualOrientation.Right: + return Orientation.Horizontal; + default: + // Should never happen! + Debug.Assert(false); + DebugTools.NotImplemented(orientation.ToString()); + return Orientation.Vertical; + } + } + + /// + /// Convert from ButtonStyle to PaletteButtonStyle. + /// + /// ButtonStyle to convert. + /// PaletteButtonStyle enumeration value. + public static PaletteButtonStyle ButtonStyleToPalette(ButtonStyle style) + { + switch (style) + { + case ButtonStyle.Standalone: + return PaletteButtonStyle.Standalone; + case ButtonStyle.Alternate: + return PaletteButtonStyle.Alternate; + case ButtonStyle.LowProfile: + return PaletteButtonStyle.LowProfile; + case ButtonStyle.ButtonSpec: + return PaletteButtonStyle.ButtonSpec; + case ButtonStyle.BreadCrumb: + return PaletteButtonStyle.BreadCrumb; + case ButtonStyle.Cluster: + return PaletteButtonStyle.Cluster; + case ButtonStyle.NavigatorStack: + return PaletteButtonStyle.NavigatorStack; + case ButtonStyle.NavigatorOverflow: + return PaletteButtonStyle.NavigatorOverflow; + case ButtonStyle.NavigatorMini: + return PaletteButtonStyle.NavigatorMini; + case ButtonStyle.InputControl: + return PaletteButtonStyle.InputControl; + case ButtonStyle.ListItem: + return PaletteButtonStyle.ListItem; + case ButtonStyle.Form: + return PaletteButtonStyle.Form; + case ButtonStyle.FormClose: + return PaletteButtonStyle.FormClose; + case ButtonStyle.Command: + return PaletteButtonStyle.Command; + case ButtonStyle.Custom1: + return PaletteButtonStyle.Custom1; + case ButtonStyle.Custom2: + return PaletteButtonStyle.Custom2; + case ButtonStyle.Custom3: + return PaletteButtonStyle.Custom3; + default: + // Should never happen! + Debug.Assert(false); + DebugTools.NotImplemented(style.ToString()); + return PaletteButtonStyle.Standalone; + } + } + + /// + /// Create a graphics path that describes a rounded rectangle. + /// + /// Rectangle to become rounded. + /// The rounding factor to apply. + /// GraphicsPath instance. + public static GraphicsPath RoundedRectanglePath(Rectangle rect, int rounding) + { + var roundedPath = new GraphicsPath(); + + // Only use a rounding that will fit inside the rect + rounding = Math.Min(rounding, Math.Min(rect.Width / 2, rect.Height / 2) - rounding); + + // If there is no room for any rounding effect... + if (rounding <= 0) + { + // Just add a simple rectangle as a quick way of adding four lines + roundedPath.AddRectangle(rect); + } + else + { + // We create the path using a floating point rectangle + var rectF = new RectangleF(rect.X, rect.Y, rect.Width, rect.Height); + + // The border is made of up a quarter of a circle arc, in each corner + var arcLength = rounding * 2; + roundedPath.AddArc(rectF.Left, rectF.Top, arcLength, arcLength, 180f, 90f); + roundedPath.AddArc(rectF.Right - arcLength, rectF.Top, arcLength, arcLength, 270f, 90f); + roundedPath.AddArc(rectF.Right - arcLength, rectF.Bottom - arcLength, arcLength, arcLength, 0f, 90f); + roundedPath.AddArc(rectF.Left, rectF.Bottom - arcLength, arcLength, arcLength, 90f, 90f); + + // Make the last and first arc join up + roundedPath.CloseFigure(); + } + + return roundedPath; + } + + /// + /// Convert the color to a black and white color. + /// + /// Base color. + /// Black and White version of color. + public static Color ColorToBlackAndWhite(Color color) + { + // Use the standard percentages of RGB for the human eye bias + var gray = (int)(color.R * 0.3f + + color.G * 0.59f + + color.B * 0.11f); + + return Color.FromArgb(gray, gray, gray); + } + + /// + /// Whiten a provided color by applying per channel percentages. + /// + /// Color. + /// Percentage of red to keep. + /// Percentage of green to keep. + /// Percentage of blue to keep. + /// Modified color. + public static Color WhitenColor(Color color1, + float percentR, + float percentG, + float percentB) + { + // Find how much to use of each primary color + var red = (int)(color1.R / percentR); + var green = (int)(color1.G / percentG); + var blue = (int)(color1.B / percentB); + + // Limit check against individual component + if (red < 0) + { + red = 0; + } + + if (red > 255) + { + red = 255; + } + + if (green < 0) + { + green = 0; + } + + if (green > 255) + { + green = 255; + } + + if (blue < 0) + { + blue = 0; + } + + if (blue > 255) + { + blue = 255; + } + + // Return the whitened color + return Color.FromArgb(color1.A, red, green, blue); + } + + /// + /// Blacken a provided color by applying per channel percentages. + /// + /// Color. + /// Percentage of red to keep. + /// Percentage of green to keep. + /// Percentage of blue to keep. + /// Modified color. + public static Color BlackenColor(Color color1, + float percentR, + float percentG, + float percentB) + { + // Find how much to use of each primary color + var red = (int)(color1.R * percentR); + var green = (int)(color1.G * percentG); + var blue = (int)(color1.B * percentB); + + // Limit check against individual component + if (red < 0) + { + red = 0; + } + + if (red > 255) + { + red = 255; + } + + if (green < 0) + { + green = 0; + } + + if (green > 255) + { + green = 255; + } + + if (blue < 0) + { + blue = 0; + } + + if (blue > 255) + { + blue = 255; + } + + // Return the whitened color + return Color.FromArgb(color1.A, red, green, blue); + } + + /// + /// Merge two colors together using relative percentages. + /// + /// First color. + /// Percentage of first color to use. + /// Second color. + /// Percentage of second color to use. + /// Merged color. + public static Color MergeColors(Color color1, float percent1, + Color color2, float percent2) => + // Use existing three color merge + MergeColors(color1, percent1, color2, percent2, Color.Empty, 0f); + + /// + /// Merge three colors together using relative percentages. + /// + /// First color. + /// Percentage of first color to use. + /// Second color. + /// Percentage of second color to use. + /// Third color. + /// Percentage of third color to use. + /// Merged color. + public static Color MergeColors(Color color1, float percent1, + Color color2, float percent2, + Color color3, float percent3) + { + // Find how much to use of each primary color + var red = (int)(color1.R * percent1 + color2.R * percent2 + color3.R * percent3); + var green = (int)(color1.G * percent1 + color2.G * percent2 + color3.G * percent3); + var blue = (int)(color1.B * percent1 + color2.B * percent2 + color3.B * percent3); + + // Limit check against individual component + if (red < 0) + { + red = 0; + } + + if (red > 255) + { + red = 255; + } + + if (green < 0) + { + green = 0; + } + + if (green > 255) + { + green = 255; + } + + if (blue < 0) + { + blue = 0; + } + + if (blue > 255) + { + blue = 255; + } + + // Return the merged color + return Color.FromArgb(red, green, blue); + } + + /// + /// Get the number of bits used to define the color depth of the display. + /// + /// Number of bits in color depth. + public static int ColorDepth() + { + // Get access to the desktop DC + var desktopDC = PlatformInvoke.GetDC(IntPtr.Zero); + + // Find raw values that define the color depth + var planes = PlatformInvoke.GetDeviceCaps(desktopDC, PlatformInvoke.DeviceCap.PLANES); + var bitsPerPixel = PlatformInvoke.GetDeviceCaps(desktopDC, PlatformInvoke.DeviceCap.BITSPIXEL); + + // Must remember to release it! + PlatformInvoke.ReleaseDC(IntPtr.Zero, desktopDC); + + return planes * bitsPerPixel; + } + + /// + /// Gets a value indicating if the SHIFT key is pressed. + /// + public static bool IsShiftKeyPressed + { + [DebuggerStepThrough] + get => (PlatformInvoke.GetKeyState(VK_SHIFT) & 0x00008000) != 0; + } + + /// + /// Gets a value indicating if the CTRL key is pressed. + /// + public static bool IsCtrlKeyPressed + { + [DebuggerStepThrough] + get => (PlatformInvoke.GetKeyState(VK_CONTROL) & 0x00008000) != 0; + } + + /// + /// Gets a value indicating if the ALT key is pressed. + /// + public static bool IsAltKeyPressed + { + [DebuggerStepThrough] + get => (PlatformInvoke.GetKeyState(VK_MENU) & 0x00008000) != 0; + } + + /// + /// Search the hierarchy of the provided control looking for one that has the focus. + /// + /// Top of the hierarchy to search. + /// Control with focus; otherwise null. + public static Control? GetControlWithFocus(Control control) + { + // Does the provided control have the focus? + if (control.Focused + && control is not IContainedInputControl + ) + { + return control; + } + else + { + // Check each child hierarchy in turn + return (from Control child in control.Controls + where child.ContainsFocus + select GetControlWithFocus(child) + ).FirstOrDefault(); + } + } + + /// + /// Add the provided control to a parent collection. + /// + /// Parent control. + /// Control to be added. + public static void AddControlToParent([DisallowNull] Control parent, [DisallowNull] Control c) + { + Debug.Assert(parent != null); + Debug.Assert(c != null); + + // If the control is already inside a control collection, then remove it + if (c!.Parent != null) + { + RemoveControlFromParent(c); + } + // Then must use the internal method for adding a new instance + + // If the control collection is one of our internal collections... + if (parent!.Controls is KryptonControlCollection cc) + { + cc.AddInternal(c); + } + else + { + // Inside a standard collection, add it the usual way + parent.Controls.Add(c); + } + } + + /// + /// Remove the provided control from its parent collection. + /// + /// Control to be removed. + public static void RemoveControlFromParent([DisallowNull] Control c) + { + Debug.Assert(c != null); + + // If the control is inside a parent collection + if (c?.Parent != null) + { + // Then must use the internal method for adding a new instance + // If the control collection is one of our internal collections... + if (c.Parent.Controls is KryptonControlCollection cc) + { + cc.RemoveInternal(c); + } + else + { + // Inside a standard collection, remove it the usual way + c.Parent.Controls.Remove(c); + } + } + } + + /// + /// Gets the size of the borders requested by the real window. + /// + /// Window style parameters. + /// Optional VisualForm base to detect usage of Chrome drawing + /// Border sizing. + public static Padding GetWindowBorders(CreateParams cp, KryptonFormExtended? form) + { + int xOffset = 0; + int yOffset = 0; + + if (form is { StateCommon.Border: PaletteFormBorderExtended formBorder } kryptonForm) + { + var (xOffset1, yOffset1) = formBorder.BorderWidths(kryptonForm.FormBorderStyle); + xOffset = xOffset1; + yOffset = yOffset1; + } + + var rect = new PlatformInvoke.RECT + { + // Start with a zero sized rectangle + left = -xOffset, + right = xOffset, + top = -yOffset, + bottom = yOffset + }; + // Adjust rectangle to add on the borders required + PlatformInvoke.AdjustWindowRectEx(ref rect, cp.Style, false, cp.ExStyle); + // Return the per side border values + return new Padding(-rect.left, -rect.top, rect.right, rect.bottom); + } + + /// + /// Discover if the provided Form is currently minimized. + /// + /// Form reference. + /// True if minimized; otherwise false. + public static bool IsFormMinimized(Form f) + { + // Get the current window style (cannot use the + // WindowState property as it can be slightly out of date) + var style = PlatformInvoke.GetWindowLong(f.Handle, PlatformInvoke.GWL_.STYLE); + + return (style & PlatformInvoke.WS_.MINIMIZE) != 0; + } + + /// + /// Discover if the provided Form is currently maximized. + /// + /// Form reference. + /// True if maximized; otherwise false. + public static bool IsFormMaximized(Form f) + { + // Get the current window style (cannot use the + // WindowState property as it can be slightly out of date) + var style = PlatformInvoke.GetWindowLong(f.Handle, PlatformInvoke.GWL_.STYLE); + + return (style & PlatformInvoke.WS_.MAXIMIZE) != 0; + } + + + /// + /// Gets the real client rectangle of the list. + /// + /// Window handle of the control. + public static Rectangle RealClientRectangle(IntPtr handle) + { + // Grab the actual current size of the window, this is more accurate than using + // the 'this.Size' which is out of date when performing a resize of the window. + var windowRect = new PlatformInvoke.RECT(); + PlatformInvoke.GetWindowRect(handle, ref windowRect); + + // Create rectangle that encloses the entire window + return new Rectangle(0, 0, + windowRect.right - windowRect.left, + windowRect.bottom - windowRect.top); + } + + + /// + /// Find the appropriate content style to match the incoming label style. + /// + /// LabelStyle enumeration. + /// Matching PaletteContentStyle enumeration value. + public static PaletteContentStyle ContentStyleFromLabelStyle(LabelStyle style) + { + switch (style) + { + case LabelStyle.AlternateControl: + return PaletteContentStyle.LabelAlternateControl; + case LabelStyle.NormalControl: + return PaletteContentStyle.LabelNormalControl; + case LabelStyle.BoldControl: + return PaletteContentStyle.LabelBoldControl; + case LabelStyle.ItalicControl: + return PaletteContentStyle.LabelItalicControl; + case LabelStyle.TitleControl: + return PaletteContentStyle.LabelTitleControl; + case LabelStyle.AlternatePanel: + return PaletteContentStyle.LabelAlternatePanel; + case LabelStyle.NormalPanel: + return PaletteContentStyle.LabelNormalPanel; + case LabelStyle.BoldPanel: + return PaletteContentStyle.LabelBoldPanel; + case LabelStyle.ItalicPanel: + return PaletteContentStyle.LabelItalicPanel; + case LabelStyle.TitlePanel: + return PaletteContentStyle.LabelTitlePanel; + case LabelStyle.GroupBoxCaption: + return PaletteContentStyle.LabelGroupBoxCaption; + case LabelStyle.ToolTip: + return PaletteContentStyle.LabelToolTip; + case LabelStyle.SuperTip: + return PaletteContentStyle.LabelSuperTip; + case LabelStyle.KeyTip: + return PaletteContentStyle.LabelKeyTip; + case LabelStyle.Custom1: + return PaletteContentStyle.LabelCustom1; + case LabelStyle.Custom2: + return PaletteContentStyle.LabelCustom2; + case LabelStyle.Custom3: + return PaletteContentStyle.LabelCustom3; + default: + // Should never happen! + Debug.Assert(false); + DebugTools.NotImplemented(style.ToString()); + return PaletteContentStyle.LabelNormalPanel; + } + } + + /// + /// Convert from palette rendering hint to actual rendering hint. + /// + /// Palette rendering hint. + /// Converted value for use with a Graphics instance. + public static TextRenderingHint PaletteTextHintToRenderingHint(PaletteTextHint hint) + { + switch (hint) + { + case PaletteTextHint.AntiAlias: + return TextRenderingHint.AntiAlias; + case PaletteTextHint.AntiAliasGridFit: + return TextRenderingHint.AntiAliasGridFit; + case PaletteTextHint.ClearTypeGridFit: + return TextRenderingHint.ClearTypeGridFit; + case PaletteTextHint.SingleBitPerPixel: + return TextRenderingHint.SingleBitPerPixel; + case PaletteTextHint.SingleBitPerPixelGridFit: + return TextRenderingHint.SingleBitPerPixelGridFit; + default: + // Should never happen! + Debug.Assert(false); + DebugTools.NotImplemented(hint.ToString()); + return TextRenderingHint.SystemDefault; + } + } + + /// + /// Get the correct metric padding for the provided separator style. + /// + /// Separator style. + /// Matching metric padding. + public static PaletteMetricPadding SeparatorStyleToMetricPadding(SeparatorStyle separatorStyle) + { + switch (separatorStyle) + { + case SeparatorStyle.LowProfile: + return PaletteMetricPadding.SeparatorPaddingLowProfile; + case SeparatorStyle.HighProfile: + return PaletteMetricPadding.SeparatorPaddingHighProfile; + case SeparatorStyle.HighInternalProfile: + return PaletteMetricPadding.SeparatorPaddingHighInternalProfile; + case SeparatorStyle.Custom1: + return PaletteMetricPadding.SeparatorPaddingCustom1; + case SeparatorStyle.Custom2: + return PaletteMetricPadding.SeparatorPaddingCustom2; + case SeparatorStyle.Custom3: + return PaletteMetricPadding.SeparatorPaddingCustom3; + default: + // Should never happen! + Debug.Assert(false); + DebugTools.NotImplemented(separatorStyle.ToString()); + return PaletteMetricPadding.SeparatorPaddingLowProfile; + } + } + + /// + /// Ensure that a single character format string is treated as a custom format. + /// + /// Incoming format. + /// Corrected format. + public static string MakeCustomDateFormat(string format) + { + // Is this a single character format? + if (format.Length == 1) + { + // If the character is one of the predefined entries... + if (format.IndexOfAny(_singleDateFormat) == 0) + { + // Insert the percentage sign so it is a custom format and not a predefined one + format = $"%{format}"; + } + } + + return format; + } + + /// + /// Create new instance of specified type within the designer host, if provided. + /// + /// Type of the item to create. + /// Designer host used if provided. + /// Reference to new instance. + public static object CreateInstance(Type itemType, IDesignerHost? host) + { + object retObj; + + // Cannot use the designer host to create component unless the type implements IComponent + if (typeof(IComponent).IsAssignableFrom(itemType) && host != null) + { + // Ask host to create component for us + retObj = host.CreateComponent(itemType, null!); + + // If the new object has an associated designer then use that now to initialize the instance + if (host.GetDesigner((IComponent)retObj) is IComponentInitializer designer) + { + designer.InitializeNewComponent(null); + } + } + else + { + // Cannot use host for creation, so do it the standard way instead + retObj = TypeDescriptor.CreateInstance(host, itemType, null!, null!); + } + + return retObj ?? false; + } + + /// + /// Destroy instance of an object using the provided designer host. + /// + /// Reference to item for destroying. + /// Designer host used if provided. + public static void DestroyInstance(object instance, IDesignerHost? host) + { + switch (instance) + { + // Use designer to remove component if possible + case IComponent component when host != null: + host.DestroyComponent(component); + break; + case IComponent component: + component.Dispose(); + break; + // Fallback to calling any exposed dispose method + case IDisposable disposable: + disposable.Dispose(); + break; + } + } + + /// + /// Output some debug data to a log file that exists in same directory as the application. + /// + /// String to output. + public static void LogOutput(string str) + { + // TODO: Make this thread aware ! + // TODO: DO NOT WRITE to the application path, as that might / will be UAC protected !! + //var fi = new FileInfo(Application.ExecutablePath); + //using var writer = new StreamWriter($@"{fi.DirectoryName}LogOutput.txt", true, Encoding.ASCII); + //writer.Write($@"{DateTime.Now.ToLongTimeString()} : "); + //writer.WriteLine(str); + //writer.Flush(); + Debug.WriteLine(str); + } + + /// + /// Discover if the component is in design mode. + /// + /// Component to test. + /// True if in design mode; otherwise false. + public static bool DesignMode(Component? c) + { + // Cache the info needed to sneak access to the component protected property + if (_cachedDesignModePI == null) + { + _cachedDesignModePI = typeof(ToolStrip).GetProperty(nameof(DesignMode), + BindingFlags.Instance | + BindingFlags.GetProperty | + BindingFlags.NonPublic); + } + + return (bool)_cachedDesignModePI!.GetValue(c, null); + } + + /// + /// Convert a double to a culture invariant string value. + /// + /// Double to convert. + /// Culture invariant string representation. + public static string? DoubleToString(double d) => _dc.ConvertToInvariantString(d); + + /// + /// Convert a culture invariant string value to a double. + /// + /// String to convert. + /// Double value. + public static double StringToDouble(string s) => (double)_dc.ConvertFromInvariantString(s); + + /// + /// Convert a Size to a culture invariant string value. + /// + /// Size to convert. + /// Culture invariant string representation. + public static string? SizeToString(Size s) => _sc.ConvertToInvariantString(s); + + /// + /// Convert a culture invariant string value to a Size. + /// + /// String to convert. + /// Size value. + public static Size StringToSize(string s) => (Size)_sc.ConvertFromInvariantString(s); + + /// + /// Convert a Point to a culture invariant string value. + /// + /// Size to convert. + /// Culture invariant string representation. + public static string? PointToString(Point s) => _pc.ConvertToInvariantString(s); + + /// + /// Convert a culture invariant string value to a Point. + /// + /// String to convert. + /// Point value. + public static Point StringToPoint(string? s) => (Point)_pc.ConvertFromInvariantString(s); + + /// + /// Convert a Boolean to a culture invariant string value. + /// + /// Boolean to convert. + /// Culture invariant string representation. + public static string? BoolToString(bool b) => _bc.ConvertToInvariantString(b); + + /// + /// Convert a culture invariant string value to a Boolean. + /// + /// String to convert. + /// Boolean value. + public static bool StringToBool(string s) => (bool)_bc.ConvertFromInvariantString(s); + + /// + /// Convert a Color to a culture invariant string value. + /// + /// Color to convert. + /// Culture invariant string representation. + public static string? ColorToString(Color c) => _cc.ConvertToInvariantString(c); + + /// + /// Convert a culture invariant string value to a Color. + /// + /// String to convert. + /// Color value. + public static Color StringToColor(string s) => (Color)_cc.ConvertFromInvariantString(s); + + /// + /// Convert a client mouse position inside a windows message into a screen position. + /// + /// Window message. + /// Screen point. + public static Point ClientMouseMessageToScreenPt(Message m) + { + // Extract the x and y mouse position from message + var clientPt = new PlatformInvoke.POINTC + { + x = PlatformInvoke.LOWORD((int)m.LParam), + y = PlatformInvoke.HIWORD((int)m.LParam) + }; + + // Negative positions are in the range 32767 -> 65535, + // so convert to actual int values for the negative positions + if (clientPt.x >= 32767) + { + clientPt.x -= 65536; + } + + if (clientPt.y >= 32767) + { + clientPt.y -= 65536; + } + + // Convert a 0,0 point from client to screen to find offsetting + var zeroPIPt = new PlatformInvoke.POINTC + { + x = 0, + y = 0 + }; + PlatformInvoke.MapWindowPoints(m.HWnd, IntPtr.Zero, zeroPIPt, 1); + + // Adjust the client coordinate by the offset to get to screen + clientPt.x += zeroPIPt.x; + clientPt.y += zeroPIPt.y; + + // Return as a managed point type + return new Point(clientPt.x, clientPt.y); + } + + /// + /// Gets a reference to the currently active floating window. + /// + public static Form? ActiveFloatingWindow { get; set; } + + /// + /// Gets the current active cursor, and if that is null use the current default cursor + /// + /// Cursor Hotspot + public static Point CaptureCursor() + { + Cursor cur = Cursor.Current ?? Cursors.Default; + + return cur.HotSpot; + } + + /// + /// + /// + /// + /// + public static void Deflate(this Rectangle rect, Padding margins) + { + rect.X += margins.Left; + rect.Y += margins.Top; + rect.Width -= margins.Left + margins.Right; + rect.Height -= margins.Top + margins.Bottom; + } + + /// + /// Do not use the `DpiHandler.ScaleBitmapLogicalToDevice` as that will introduce the "purple artifact" lines + /// Also, Using the int version of the `DrawImage` produces better upscale for the 125% images + /// + /// + /// + /// + /// + /// thrown if targets are negative + public static Bitmap? ScaleImageForSizedDisplay(Image? src, float trgtWidth, float trgtHeight) + { + if (trgtWidth <= 1.0 || trgtHeight <= 1.0) + { + // For some reason, in the designer it can send a rect that has a negative size element, + // therefore the targets will also be negative + // Also When collapsing / expanding ribbons the `trgtHeight` will > 0 BUT < 1.0 + //return new Bitmap(0, 0); // This will throw an exception + return null; + } + + var newImage = new Bitmap((int)trgtWidth, (int)trgtHeight); + using Graphics gr = Graphics.FromImage(newImage); + gr.Clear(Color.Transparent); + gr.SmoothingMode = SmoothingMode.HighQuality; + // Got to be careful with this setting, otherwise "Purple" artifacts will be introduced ! + gr.InterpolationMode = InterpolationMode.NearestNeighbor; + gr.PixelOffsetMode = PixelOffsetMode.HighQuality; + //var srcRect = new RectangleF(0.0f, 0.0f, src.Width, src.Height); + //var destRect = new RectangleF(0.0f, 0.0f, trgtWidth, trgtHeight); + //// Handle rounding down of the target `newImage` dimensions + //srcRect.Offset(-trgtWidth%1, -trgtHeight%1); + //gr.DrawImage(src, destRect, srcRect, GraphicsUnit.Pixel); + gr.DrawImage(src!, 0, 0, (int)trgtWidth, (int)trgtHeight); + + return newImage; + } + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/ControlExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/ControlExtensions.cs new file mode 100644 index 000000000..47628b99b --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/ControlExtensions.cs @@ -0,0 +1,282 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +using Timer = System.Windows.Forms.Timer; + +namespace Krypton.Toolkit.Suite.Extended.Forms +{ + /// + /// Class with extensions for Control objects + /// + public static class ControlExtensions + { + #region Animation + + /// + /// Animates the current control with some values. + /// + /// The control to animate. + /// The anonymous object with name / value pairs. + public static void Animate(this Control c, object properties) + { + Animate(c, properties, 200, Easing.Linear, null); + } + + /// + /// Animates the current control with some values. + /// + /// The control to animate. + /// The anonymous object with name / value pairs. + /// The duration of the animation. + public static void Animate(this Control c, object properties, int duration) + { + Animate(c, properties, duration, Easing.Linear, null); + } + + /// + /// Animates the current control with some values. + /// + /// The control to animate. + /// The anonymous object with name / value pairs. + /// The duration of the animation. + /// The Easing object to use. + public static void Animate(this Control c, object properties, int duration, Easing easing) + { + Animate(c, properties, duration, easing, null); + } + + /// + /// Animates the current control with some values. + /// + /// The control to animate. + /// The anonymous object with name / value pairs. + /// The duration of the animation. + /// The Easing object to use. + /// The callback method to invoke when the animation is finished. + public static void Animate(this Control c, object properties, int duration, Easing easing, Action? complete) + { + var t = new Timer(); + t.Interval = 30; + var frame = 0; + var maxframes = (int)Math.Ceiling(duration / 30.0); + var reflection = properties.GetType(); + var target = c.GetType(); + var props = reflection.GetProperties(); + var values = new ReflectionCache[props.Length]; + + for (var i = 0; i < props.Length; i++) + { + values[i] = new ReflectionCache(target?.GetProperty(props[i].Name)); + values[i].SetStart(values[i].Info?.GetValue(c, null)); + values[i].SetEnd(props[i].GetValue(properties, null)); + } + + t.Tick += (s, e) => + { + frame++; + + for (var i = 0; i < values.Length; i++) + { + values[i].Execute(c, easing, frame, maxframes); + } + + if (frame == maxframes) + { + t.Stop(); + + if (complete != null) + { + complete(); + } + } + }; + + t.Start(); + } + + class ReflectionCache + { + public ReflectionCache(PropertyInfo? info) + { + Info = info; + + if (info == null) + { + throw new ArgumentException("Invalid property to animate. The given properties have to match a property of the control."); + } + + PropertyInfo?[] subprops = info.PropertyType.GetProperties().Where(m => m.CanRead && m.CanWrite).ToArray(); + + if (subprops.Length > 0) + { + SubList = new ReflectionCache[subprops.Length]; + + for (var i = 0; i < subprops.Length; i++) + { + SubList[i] = new ReflectionCache(subprops[i]); + } + } + } + + public double Start { get; private set; } + + public double End { get; private set; } + + public bool HasItems { get => SubList != null; } + + public Type? ListType { get; private set; } + + public ReflectionCache[]? SubList { get; private set; } + + public PropertyInfo? Info { get; private set; } + + public Action SetValue { get; private set; } + + public void Execute(object c, Easing easing, int frame, int frames) + { + if (HasItems) + { + var cp = Activator.CreateInstance(ListType!); + + foreach (var item in SubList!) + { + item.Execute(cp, easing, frame, frames); + } + + Info?.SetValue(c, cp, null); + } + else + { + var value = easing.CalculateStep(frame, frames, Start, End); + + SetValue(c, value); + } + } + + public ReflectionCache SetStart(object? value) + { + if (HasItems) + { + ListType = value?.GetType(); + + foreach (var item in SubList!) + { + item.SetStart(item.Info?.GetValue(value, null)); + } + } + else + { + Start = Convert.ToDouble(value); + + if (value is int) + { + SetValue = (c, v) => + { + Info?.SetValue(c, Convert.ToInt32(v), null); + }; + } + else if (value is long) + { + SetValue = (c, v) => + { + Info?.SetValue(c, Convert.ToInt64(v), null); + }; + } + else if (value is float) + { + SetValue = (c, v) => + { + Info?.SetValue(c, Convert.ToSingle(v), null); + }; + } + else if (value is decimal) + { + SetValue = (c, v) => + { + Info?.SetValue(c, Convert.ToDecimal(v), null); + }; + } + else + { + SetValue = (c, v) => + { + Info?.SetValue(c, v, null); + }; + } + } + + return this; + } + + public ReflectionCache SetEnd(object? value) + { + if (HasItems) + { + foreach (var item in SubList!) + { + item.SetEnd(item.Info?.GetValue(value, null)); + } + } + else + { + End = Convert.ToDouble(value); + } + + return this; + } + } + + #endregion + + #region Presentation + + /// + /// Gives a shadow to this control + /// + /// The current control + /// The shadow's color + /// The horizontal offset of the shadow + /// The vertical offset of the shadow + /// The blurness of the shadow + public static void Shadow(this Control control, Color color, float dx, float dy, float blur) + { + if (control.Parent != null) + { + control.Parent.Resize += (s, e) => + { + (s as Control)?.Refresh(); + }; + control.Parent.Paint += (s, e) => + { + e.Graphics.DrawShadow(new Rectangle(control.Location, control.Size), color, dx, dy, blur); + }; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/Easing.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/Easing.cs new file mode 100644 index 000000000..1cb16d105 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/Easing.cs @@ -0,0 +1,84 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Forms +{ + public abstract class Easing + { + #region Static Fields + + private static Easing _linear; + + private static Easing _sinus; + + #endregion + + #region Public + + /// + /// Gets an instance of the provided linear easing. + /// + public static Easing Linear + { + get + { + _linear ??= new LinearEasing(); + + return _linear; + } + } + + /// + /// Gets an instance of the provided sinus easing. + /// + public static Easing Sinus + { + get + { + _sinus ??= new SinusEasing(); + + return _sinus; + } + } + + #endregion + + #region Implementation + + /// + /// Calculate the current value for the given properties. + /// + /// The current frame number. + /// The total frame number. + /// The start value (at frame 0). + /// The final value (at frame total - 1). + /// The current value. + public abstract double CalculateStep(int frame, int frames, double start, double end); + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeController.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeController.cs index c606c6233..d0778b64d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeController.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeController.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -35,7 +35,7 @@ public class FadeController private readonly KryptonFormExtended parentForm; // The parent form if being displayed as a dialog. private FadeDirection fadeDirection; // The direction in which to fade. private float fadeSpeed; // The speed at which to fade. - private FadeCompleted fadeFinished; // The delegate to call when a fade has completed. + private FadeCompleted? fadeFinished; // The delegate to call when a fade has completed. private bool shouldClose; // If set to true, the form will close after fading out. private readonly System.Threading.Tasks.TaskCompletionSource showDialogResult // The Async Task Completion Source for displaying as a dialog. = new System.Threading.Tasks.TaskCompletionSource(); @@ -83,7 +83,7 @@ private void UpdateOpacity() case FadeDirection.In: if (form.Opacity < 1.0) { - form.Opacity += (fadeSpeed / 1000.0); + form.Opacity += fadeSpeed / 1000.0; } else { @@ -96,7 +96,7 @@ private void UpdateOpacity() case FadeDirection.Out: if (form.Opacity > 0.1) { - form.Opacity -= (fadeSpeed / 1000.0); + form.Opacity -= fadeSpeed / 1000.0; } else { @@ -123,7 +123,7 @@ private void UpdateOpacity() /// Fade the form in at the defined speed as a dialog /// based on parent form. /// - private async System.Threading.Tasks.Task ShowDialog(float fadeSpeed, FadeCompleted finished) + private async System.Threading.Tasks.Task ShowDialog(float fadeSpeed, FadeCompleted? finished) { parentForm.BeginInvoke(new Action(() => showDialogResult.SetResult(form.ShowDialog(parentForm)))); @@ -139,7 +139,7 @@ private async System.Threading.Tasks.Task ShowDialog(float fadeSpe /// /// Fade the form in at the defined speed. /// - private void FadeIn(float fadeSpeed, FadeCompleted finished) + private void FadeIn(float fadeSpeed, FadeCompleted? finished) { form.Opacity = 0; form.Show(); @@ -151,7 +151,7 @@ private void FadeIn(float fadeSpeed, FadeCompleted finished) BeginFade(); } - private void FadeIn(FadeSpeedChoice fadeSpeedChoice, FadeCompleted finished, float fadeSpeed = 0) + private void FadeIn(FadeSpeedChoice fadeSpeedChoice, FadeCompleted? finished, float fadeSpeed = 0) { form.Opacity = 0; @@ -195,7 +195,7 @@ private void FadeIn(FadeSpeedChoice fadeSpeedChoice, FadeCompleted finished, flo /// /// Fade the form out at the defined speed. /// - private void FadeOut(float fadeSpeed, FadeCompleted finished) + private void FadeOut(float fadeSpeed, FadeCompleted? finished) { if (form.Opacity < 0.1) { @@ -211,7 +211,7 @@ private void FadeOut(float fadeSpeed, FadeCompleted finished) BeginFade(); } - private void FadeOut(FadeSpeedChoice fadeSpeedChoice, FadeCompleted finished, float fadeSpeed = 0) + private void FadeOut(FadeSpeedChoice fadeSpeedChoice, FadeCompleted? finished, float fadeSpeed = 0) { if (form.Opacity < 0.1) { @@ -260,7 +260,7 @@ private void FadeOut(FadeSpeedChoice fadeSpeedChoice, FadeCompleted finished, fl /// /// Fades a dialog in using parent form and defined fade speed. /// - public static async System.Threading.Tasks.Task ShowDialog(KryptonFormExtended form, KryptonFormExtended parent, float fadeSpeed) + public static async Task ShowDialog(KryptonFormExtended form, KryptonFormExtended parent, float fadeSpeed) { FadeController fader = new FadeController(form, parent); return await fader.ShowDialog(fadeSpeed, null); @@ -270,7 +270,7 @@ public static async System.Threading.Tasks.Task ShowDialog(Krypton /// Fades a dialog in using parent form and defined fade speed /// and call the finished delegate.) /// - public static async System.Threading.Tasks.Task ShowDialog(KryptonFormExtended form, KryptonFormExtended parent, float fadeSpeed, FadeCompleted finished) + public static async Task ShowDialog(KryptonFormExtended form, KryptonFormExtended parent, float fadeSpeed, FadeCompleted finished) { FadeController fader = new FadeController(form, parent); return await fader.ShowDialog(fadeSpeed, finished); @@ -285,7 +285,7 @@ public static void FadeIn(KryptonFormExtended form, float fadeSpeed, FadeComplet fader.FadeIn(fadeSpeed, finished); } - public static void FadeIn(KryptonFormExtended form, FadeSpeedChoice fadeSpeedChoice, float fadeSpeed = 0, FadeCompleted finished = null) + public static void FadeIn(KryptonFormExtended form, FadeSpeedChoice fadeSpeedChoice, float fadeSpeed = 0, FadeCompleted? finished = null) { FadeController fader = new FadeController(form); @@ -301,7 +301,7 @@ public static void FadeOut(KryptonFormExtended form, float fadeSpeed, FadeComple fader.FadeOut(fadeSpeed, finished); } - public static void FadeOut(KryptonFormExtended form, FadeSpeedChoice fadeSpeedChoice, float fadeSpeed = 0, FadeCompleted finished = null) + public static void FadeOut(KryptonFormExtended form, FadeSpeedChoice fadeSpeedChoice, float fadeSpeed = 0, FadeCompleted? finished = null) { FadeController fader = new FadeController(form); @@ -353,7 +353,7 @@ public static void FadeOutAndClose(KryptonFormExtended form, float fadeSpeed, Fa fader.FadeOut(fadeSpeed, finished); } - public static void FadeOutAndClose(KryptonFormExtended form, FadeSpeedChoice fadeSpeedChoice, float fadeSpeed = 0, FadeCompleted finished = null) + public static void FadeOutAndClose(KryptonFormExtended form, FadeSpeedChoice fadeSpeedChoice, float fadeSpeed = 0, FadeCompleted? finished = null) { FadeController fader = new FadeController(form) { shouldClose = true }; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeControllerNETCoreSafe.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeControllerNETCoreSafe.cs index 84585e649..41ca4cbd0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeControllerNETCoreSafe.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeControllerNETCoreSafe.cs @@ -99,7 +99,7 @@ public static void FadeWindowOutExtended(KryptonFormExtended owner, int fadeSpee /// Fades the window out. Credit: https://stackoverflow.com/questions/12497826/better-algorithm-to-fade-a-winform. /// The owner. /// The next window. - public async void FadeWindowOut(KryptonFormExtended owner, KryptonFormExtended nextWindow = null) + public async void FadeWindowOut(KryptonFormExtended owner, KryptonFormExtended? nextWindow = null) { // The window is visible, so fade it out while (owner.Opacity > 0.0) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeManager.cs index c4b9f8e1b..f7a009a71 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeManager.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -43,9 +43,9 @@ internal class FadeManager private KryptonFormExtended _nextWindow; - private VirtualForm _currentVirtualWindow; + private VisualForm _currentVirtualWindow; - private VirtualForm _nextVirtualWindow; + private VisualForm _nextVirtualWindow; #endregion @@ -58,7 +58,7 @@ internal class FadeManager /// The fade interval. /// The fade values. /// The fade controller. - public FadeManager(VirtualForm currentWindow, VirtualForm nextWindow, bool useFade, int fadeInterval, FadeValues fadeValues, FadeController fadeController) + public FadeManager(VisualForm currentWindow, VisualForm nextWindow, bool useFade, int fadeInterval, FadeValues fadeValues, FadeController fadeController) { _fadeController = fadeController; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeSpeed.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeSpeed.cs index f444ca1e8..454cffeac 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeSpeed.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeSpeed.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeValues.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeValues.cs index dafad117d..4090bf570 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeValues.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FadeValues.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -34,7 +34,7 @@ public class FadeValues : Storage private bool _useFade; - private FadeController _fadeController; + private FadeController? _fadeController; private int _fadeInterval; @@ -42,9 +42,9 @@ public class FadeValues : Storage private KryptonFormExtended _nextWindow; - private VirtualForm _currentVirtualWindow; + private VisualForm _currentVirtualWindow; - private VirtualForm _nextVirtualWindow; + private VisualForm _nextVirtualWindow; #endregion @@ -53,22 +53,22 @@ public class FadeValues : Storage [DefaultValue(false)] public bool UseFade { get => _useFade; set => _useFade = value; } - internal FadeController FadeController => _fadeController; + internal FadeController? FadeController => _fadeController; [DefaultValue(50)] public int FadeInterval { get => _fadeInterval; set => _fadeInterval = value; } [DefaultValue(null)] - public KryptonFormExtended CurrentWindow { get => _currentWindow; set => _currentWindow = value; } + public KryptonFormExtended? CurrentWindow { get => _currentWindow; set => _currentWindow = value; } [DefaultValue(null)] - public KryptonFormExtended NextWindow { get => _nextWindow; set => _nextWindow = value; } + public KryptonFormExtended? NextWindow { get => _nextWindow; set => _nextWindow = value; } [DefaultValue(null)] - public VirtualForm CurrentVirtualWindow { get => _currentVirtualWindow; set => _currentVirtualWindow = value; } + public VisualForm? CurrentVirtualWindow { get => _currentVirtualWindow; set => _currentVirtualWindow = value; } [DefaultValue(null)] - public VirtualForm NextVirtualWindow { get => _nextVirtualWindow; set => _nextVirtualWindow = value; } + public VisualForm? NextVirtualWindow { get => _nextVirtualWindow; set => _nextVirtualWindow = value; } #endregion @@ -97,12 +97,13 @@ internal void Reset() #region Default Instance + [Browsable(false)] public override bool IsDefault => UseFade == false && FadeInterval.Equals(50) && - CurrentWindow.Equals(null) && - NextWindow.Equals(null) && - CurrentVirtualWindow.Equals(null) && - NextVirtualWindow.Equals(null); + CurrentWindow!.Equals(null) && + NextWindow!.Equals(null) && + CurrentVirtualWindow!.Equals(null) && + NextVirtualWindow!.Equals(null); #endregion } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FlashWindowExListener.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FlashWindowExListener.cs index f3bb69eca..52a9542c6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FlashWindowExListener.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/FlashWindowExListener.cs @@ -5,7 +5,7 @@ /// internal static class FlashWindowExListener { - private static readonly Dictionary _forms = new(); + private static readonly Dictionary _forms = new Dictionary(); private static readonly IntPtr _hHook; // Keep the HookProc delegate alive manually, such as using a class member as shown below, // otherwise the garbage collector will clean up the hook delegate eventually, diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/GraphicPathExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/GraphicPathExtensions.cs new file mode 100644 index 000000000..a738fd58a --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/GraphicPathExtensions.cs @@ -0,0 +1,115 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Forms +{ + /// + /// Class with extensions for GraphicsPath objects + /// + public static class GraphicPathExtensions + { + #region Round Rectangle + + /// + /// Adds a rectangle with round corners to the current GraphicsPath. + /// + /// The current GraphicsPath object. + /// The rectangle which defines the area to be added. + /// The radius of the different corners starting with the upper left corner. + /// The current GraphicsPath object. + public static GraphicsPath AddRoundRectangle(this GraphicsPath gp, Rectangle rectangle, params float[] radius) + { + return gp.AddRoundRectangle((RectangleF)rectangle, radius); + } + + /// + /// Adds a rectangle with round corners to the current GraphicsPath. + /// + /// The current GraphicsPath object. + /// The rectangle which defines the area to be added. + /// The radius of the different corners starting with the upper left corner. + /// The current GraphicsPath object. + public static GraphicsPath AddRoundRectangle(this GraphicsPath gp, RectangleF rectangle, params float[] radius) + { + return gp.AddRoundRectangle(rectangle.Location, rectangle.Size, radius); + } + + /// + /// Adds a rectangle with round corners to the current GraphicsPath. + /// + /// The current GraphicsPath object. + /// The coordinates of the upper left corner. + /// The dimension of the rectangle. + /// The radius of the different corners starting with the upper left corner. + /// The current GraphicsPath object. + public static GraphicsPath AddRoundRectangle(this GraphicsPath gp, PointF point, SizeF size, params float[] radius) + { + var r = new float[4]; + var d = new float[4]; + var bottom = point.Y + size.Height; + var right = point.X + size.Width; + + for (int i = 0; i < r.Length; i++) + { + r[i] = radius.Length > 0 ? radius[i % radius.Length] : 0f; + d[i] = 2f * r[i]; + } + + if (r[0] > 0f) + { + gp.AddArc(new RectangleF(point.X, point.Y, d[0], d[0]), 180, 90); + } + + gp.AddLine(new PointF(point.X + r[0], point.Y), new PointF(right - r[1], point.Y)); + + if (r[1] > 0f) + { + gp.AddArc(new RectangleF(right - d[1], point.Y, d[1], d[1]), 270, 90); + } + + gp.AddLine(new PointF(right, point.Y + r[1]), new PointF(right, bottom - r[2])); + + if (r[2] > 0f) + { + gp.AddArc(new RectangleF(right - d[2], bottom - d[2], d[2], d[2]), 0, 90); + } + + gp.AddLine(new PointF(right - r[2], bottom), new PointF(point.X + r[3], bottom)); + + if (r[3] > 0f) + { + gp.AddArc(new RectangleF(point.X, bottom - d[3], d[3], d[3]), 90, 90); + } + + gp.AddLine(new PointF(point.X, bottom - r[3]), new PointF(point.X, point.Y + r[0])); + gp.CloseFigure(); + return gp; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/GraphicsExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/GraphicsExtensions.cs new file mode 100644 index 000000000..353f4334b --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/GraphicsExtensions.cs @@ -0,0 +1,567 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Forms +{ + /// + /// Class with extensions for Graphics objects + /// + public static class GraphicsExtensions + { + #region Round Rectangle + + /// + /// Draws a rectangle with round corners. + /// + /// The current Graphics object. + /// The Pen object which draws the border with a certain color and width. + /// The rectangle which defines the area to be drawn. + /// The radius of the different corners starting with the upper left corner. + public static void DrawRoundRectangle(this Graphics g, Pen pen, RectangleF rectangle, params float[] radius) => g.DrawRoundRectangle(pen, rectangle.Location, rectangle.Size, radius); + + /// + /// Draws a rectangle with round corners. + /// + /// The current Graphics object. + /// The Pen object which draws the border with a certain color and width. + /// The rectangle which defines the area to be drawn. + /// The radius of the different corners starting with the upper left corner. + public static void DrawRoundRectangle(this Graphics g, Pen pen, Rectangle rectangle, params float[] radius) => g.DrawRoundRectangle(pen, (RectangleF)rectangle, radius); + + /// + /// Draws a rectangle with round corners. + /// + /// The current Graphics object. + /// The Pen object which draws the border with a certain color and width. + /// The coordinates of the upper left corner. + /// The dimension of the rectangle. + /// The radius of the different corners starting with the upper left corner. + public static void DrawRoundRectangle(this Graphics g, Pen pen, PointF point, SizeF size, params float[] radius) + { + var gp = new GraphicsPath().AddRoundRectangle(point, size, radius); + g.DrawPath(pen, gp); + } + + /// + /// Fills a rectangle with round corners. + /// + /// The current Graphics object. + /// The Brush object which fills the rectangle with colors. + /// The rectangle which defines the area to be filled. + /// The radius of the different corners starting with the upper left corner. + public static void FillRoundRectangle(this Graphics g, Brush brush, Rectangle rectangle, params float[] radius) + { + g.FillRoundRectangle(brush, (RectangleF)rectangle, radius); + } + + /// + /// Fills a rectangle with round corners. + /// + /// The current Graphics object. + /// The Brush object which fills the rectangle with colors. + /// The rectangle which defines the area to be filled. + /// The radius of the different corners starting with the upper left corner. + public static void FillRoundRectangle(this Graphics g, Brush brush, RectangleF rectangle, params float[] radius) + { + g.FillRoundRectangle(brush, rectangle.Location, rectangle.Size, radius); + } + + /// + /// Fills a rectangle with round corners. + /// + /// The current Graphics object. + /// The Brush object which fills the rectangle with colors. + /// The coordinates of the upper left corner. + /// The dimension of the rectangle. + /// The radius of the different corners starting with the upper left corner. + public static void FillRoundRectangle(this Graphics g, Brush brush, PointF point, SizeF size, params float[] radius) + { + var gp = new GraphicsPath().AddRoundRectangle(point, size, radius); + g.FillPath(brush, gp); + } + + #endregion + + #region Shadow + + /// + /// Draws a shadow around a defined path. + /// + /// The current Graphics handle. + /// The path which should have a shadow. + /// The color of the shadow. + /// The horizontal shift. + /// The vertical shift. + /// The blurness. + public static void DrawShadow(this Graphics g, GraphicsPath path, Color color, float dx, float dy, float blur) + { + var bounds = path.GetBounds(); + var bpw = blur / (float)bounds.Width / 2f; + var bph = blur / (float)bounds.Height / 2f; + var tdx = -(float)bounds.Left - (float)bounds.Width / 2f; + var tdy = -(float)bounds.Top - (float)bounds.Height / 2f; + path.Transform(new Matrix(1f, 0f, 0f, 1f, tdx, tdy)); + Region original = new Region(path); + path.Transform(new Matrix(1f + bpw, 0f, 0f, 1f + bph, dx, dy)); + Region transform = new Region(path); + transform.Exclude(original); + + var gs = g.Save(); + g.TranslateTransform(-tdx, -tdy); + + if (blur <= 0f) + { + g.FillRegion(new SolidBrush(color), transform); + } + else + { + var lgb = new PathGradientBrush(path); + lgb.CenterColor = color; + lgb.SurroundColors = new Color[] { Color.Transparent }; + var colors = new Color[3]; + var positions = new float[3]; + + for (var i = 0; i < 3; i++) + { + colors[i] = Color.FromArgb(255 * (2 - i) / 2, color); + positions[i] = (2f - i) / 2f; + } + + lgb.InterpolationColors.Colors = colors; + lgb.InterpolationColors.Positions = positions; + g.FillRegion(lgb, transform); + } + + g.Restore(gs); + } + + /// + /// Draws a shadow around a rectangle. + /// + /// The current Graphics handle. + /// The path which should have a shadow. + /// The color of the shadow. + /// The horizontal and vertical shift. + /// The blurness. + public static void DrawShadow(this Graphics g, GraphicsPath path, Color color, PointF shift, float blur) + { + g.DrawShadow(path, color, shift.X, shift.Y, blur); + } + + /// + /// Draws a shadow around a rectangle. + /// + /// The current Graphics handle. + /// The rectangle which should have a shadow. + /// The color of the shadow. + /// The horizontal shift. + /// The vertical shift. + /// The blurness. + public static void DrawShadow(this Graphics g, RectangleF origin, Color color, float dx, float dy, float blur) + { + var gp = new GraphicsPath(); + gp.AddRectangle(origin); + + if (gp.PointCount > 0) + { + g.DrawShadow(gp, color, dx, dy, blur); + } + } + + /// + /// Draws a shadow around a rectangle. + /// + /// The current Graphics handle. + /// The rectangle which should have a shadow. + /// The color of the shadow. + /// The horizontal and vertical shift. + /// The blurness. + public static void DrawShadow(this Graphics g, RectangleF origin, Color color, PointF shift, float blur) + { + g.DrawShadow(origin, color, shift.X, shift.Y, blur); + } + + #endregion + + #region Glow + + /// + /// Draws a glowing border around a given rectangle. + /// + /// The current Graphics object. + /// The rectangle that should contain the content. + /// The color of the glow effect (will become 50 percent transparent). + /// The size of the glow effect. + /// The optional radius for rounded corners. + public static void Glow(this Graphics g, Rectangle content, Color glowColor, int size = 10, float radius = 0) + { + var rect = new Rectangle(content.Left - size, content.Top - size, content.Width + 2 * size, 2 * size + content.Height); + var gp = new GraphicsPath(); + gp.AddRoundRectangle(rect, radius); + var pgb = new PathGradientBrush(gp); + pgb.CenterColor = glowColor; + pgb.SurroundColors = new Color[] { Color.FromArgb(0, 0, 0, 0) }; + g.FillRectangle(pgb, rect); + } + + #endregion + + #region Reflection + + /// + /// Draws a reflection effect on the current canvas. + /// + /// The current graphics object. + /// The underlying image with the pixels to reflect. + /// The rectangle where the pixels should be taken from. + /// The gap between the reflection part and the original in pixels. + /// The height of the reflection. + /// The opacity (0 to 1) at the beginning of the reflection. + /// The opacity (0 to 1) at the end of the reflection. + public static void DrawReflection(this Graphics g, Image data, RectangleF origin, int gap, int height, float startAlpha, float endAlpha) + { + var ia = new ImageAttributes(); + var cm = new ColorMatrix(); + + for (int i = 0; i < height; i++) + { + cm.Matrix33 = startAlpha - i * (startAlpha - endAlpha) / height; + ia.SetColorMatrix(cm); + g.DrawImage(data, + new Rectangle((int)origin.Left, (int)origin.Bottom + gap + i, (int)origin.Width, 1), + origin.Left, origin.Bottom - 1 - i, origin.Width, 1, GraphicsUnit.Pixel, ia); + } + } + + /// + /// Draws a reflection effect on the current canvas. + /// + /// The current graphics object. + /// The underlying image with the pixels to reflect. + /// The rectangle where the pixels should be taken from. + /// The gap between the reflection part and the original in pixels. + /// The height of the reflection. + /// The opacity (0 to 1) in the end of the reflection. + public static void DrawReflection(this Graphics g, Image data, RectangleF origin, int gap, int height, float endAlpha) + { + g.DrawReflection(data, origin, gap, height, 1f, endAlpha); + } + + /// + /// Draws a reflection effect on the current canvas. + /// + /// The current graphics object. + /// The underlying image with the pixels to reflect. + /// The rectangle where the pixels should be taken from. + /// The opacity (0 to 1) in the end of the reflection. + public static void DrawReflection(this Graphics g, Image data, RectangleF origin, float endAlpha) + { + g.DrawReflection(data, origin, 0, (int)origin.Height, 1f, endAlpha); + } + + /// + /// Draws a reflection effect on the current canvas. + /// + /// The current graphics object. + /// The underlying image with the pixels to reflect. + /// The rectangle where the pixels should be taken from. + public static void DrawReflection(this Graphics g, Image data, RectangleF origin) + { + g.DrawReflection(data, origin, 0f); + } + + #endregion + + #region Smoothness + + /// + /// Draws an image with 20% smoothed corners (gradient to transparency) + /// + /// The Graphics object + /// The image to smoothen + /// The destination rectangle of the image + public static void DrawImageSmooth(this Graphics g, Image image, RectangleF destination) + { + g.DrawImageSmooth(image, new RectangleF(Point.Empty, image.Size), destination, (AnchorStyles)15, 0.2f); + } + + /// + /// Draws an image with smoothed corners (gradient to transparency) + /// + /// The Graphics object + /// The image to smoothen + /// The destination rectangle of the image + /// The smoothness in percent (0 = none to 1.0 = complete gradient) + public static void DrawImageSmooth(this Graphics g, Image image, RectangleF destination, float smoothness) + { + g.DrawImageSmooth(image, new RectangleF(Point.Empty, image.Size), destination, (AnchorStyles)15, smoothness); + } + + /// + /// Draws an image with smoothed corners (gradient to transparency) + /// + /// The Graphics object + /// The image to smoothen + /// The destination rectangle of the image + /// The sides of the image to smoothen (bitflag enumeration) + /// The smoothness in percent (0 = none to 1.0 = complete gradient) + public static void DrawImageSmooth(this Graphics g, Image image, RectangleF destination, AnchorStyles sides, float smoothness) + { + g.DrawImageSmooth(image, new RectangleF(Point.Empty, image.Size), destination, sides, smoothness); + } + + /// + /// Draws an image with smoothed corners (gradient to transparency) + /// + /// The Graphics object + /// The image to smoothen + /// The top-left point where the image should be placed + /// The sides of the image to smoothen (bitflag enumeration) + /// The smoothness in percent (0 = none to 1.0 = complete gradient) + public static void DrawImageSmooth(this Graphics g, Image image, PointF destination, AnchorStyles sides, float smoothness) + { + g.DrawImageSmooth(image, new RectangleF(Point.Empty, image.Size), new RectangleF(destination, image.Size), sides, smoothness); + } + + /// + /// Draws an image with smoothed corners (gradient to transparency) + /// + /// The Graphics object + /// The image to smoothen + /// The source rectangle of the image (from where to take?) + /// The destination rectangle of the image (where to place?) + /// The sides of the image to smoothen (bitflag enumeration) + /// The smoothness in percent (0 = none to 1.0 = complete gradient) + public static void DrawImageSmooth(this Graphics g, Image image, RectangleF source, RectangleF destination, AnchorStyles sides, float smoothness) + { + var innerSource = source; + var s = (int)(Math.Min(source.Width, source.Height) * Math.Min(0.5f, smoothness / 2f)); + var tmp = new Bitmap((int)source.Width, (int)source.Height); + var gt = Graphics.FromImage(tmp); + + var left = false; + var right = false; + var top = false; + var bottom = false; + + if ((AnchorStyles.Top & sides) == AnchorStyles.Top) + { + top = true; + innerSource.Y += s; + innerSource.Height -= s; + } + + if ((AnchorStyles.Bottom & sides) == AnchorStyles.Bottom) + { + bottom = true; + innerSource.Height -= s; + } + + if ((AnchorStyles.Left & sides) == AnchorStyles.Left) + { + left = true; + innerSource.X += s; + innerSource.Width -= s; + } + + if ((AnchorStyles.Right & sides) == AnchorStyles.Right) + { + right = true; + innerSource.Width -= s; + } + + var innerRect = new Rectangle((int)(innerSource.X - source.X), (int)(innerSource.Y - source.Y), (int)innerSource.Width, (int)innerSource.Height); + var topRect = top ? new RectangleF(source.X, source.Y, source.Width, s) : RectangleF.Empty; + var leftRect = left ? new RectangleF(source.X, source.Y, s, source.Height) : RectangleF.Empty; + var bottomRect = bottom ? new RectangleF(source.X, source.Bottom - s, source.Width, s) : RectangleF.Empty; + var rightRect = right ? new RectangleF(source.Right - s, source.Y, s, source.Height) : RectangleF.Empty; + + //Draw Center + gt.DrawImage(image, innerRect, innerSource, GraphicsUnit.Pixel); + + //Draw Top Left Corner + if (topRect.IntersectsWith(leftRect)) + { + var corner = topRect; + corner.Intersect(leftRect); + topRect.X += corner.Width; + topRect.Width -= corner.Width; + leftRect.Y += corner.Height; + leftRect.Height -= corner.Height; + DrawCorner(gt, image, source, corner, s, AnchorStyles.Top | AnchorStyles.Left); + } + + //Draw Top Right Corner + if (topRect.IntersectsWith(rightRect)) + { + var corner = topRect; + corner.Intersect(rightRect); + topRect.Width -= corner.Width; + rightRect.Y += corner.Height; + rightRect.Height -= corner.Height; + DrawCorner(gt, image, source, corner, s, AnchorStyles.Top | AnchorStyles.Right); + } + + //Draw Bottom Left Corner + if (bottomRect.IntersectsWith(leftRect)) + { + var corner = bottomRect; + corner.Intersect(leftRect); + bottomRect.X += corner.Width; + bottomRect.Width -= corner.Width; + leftRect.Height -= corner.Height; + DrawCorner(gt, image, source, corner, s, AnchorStyles.Bottom | AnchorStyles.Left); + } + + //Draw Bottom Right Corner + if (bottomRect.IntersectsWith(rightRect)) + { + var corner = bottomRect; + corner.Intersect(rightRect); + bottomRect.Width -= corner.Width; + rightRect.Height -= corner.Height; + DrawCorner(gt, image, source, corner, s, AnchorStyles.Bottom | AnchorStyles.Right); + } + + //Draw Left Side + if (left) + { + DrawSide(gt, image, source, leftRect, s, AnchorStyles.Left); + } + + //Draw Right Side + if (right) + { + DrawSide(gt, image, source, rightRect, s, AnchorStyles.Right); + } + + //Draw Top Side + if (top) + { + DrawSide(gt, image, source, topRect, s, AnchorStyles.Top); + } + + //Draw Bottom Side + if (bottom) + { + DrawSide(gt, image, source, bottomRect, s, AnchorStyles.Bottom); + } + + g.DrawImage(tmp, destination); + } + + #region Helpers + + static void DrawCorner(Graphics g, Image image, RectangleF destSource, RectangleF src, float smoothness, AnchorStyles corner) + { + var dest = new RectangleF(src.X - destSource.X, src.Y - destSource.Y, src.Width, src.Height); + var ia = new ImageAttributes(); + var cm = new ColorMatrix(); + var left = (AnchorStyles.Left & corner) == AnchorStyles.Left; + var top = (AnchorStyles.Top & corner) == AnchorStyles.Top; + var s = Math.Ceiling(smoothness); + + /* NEW CODE --- not working yet*/ + /* + var b = new Bitmap((int)dest.Width, (int)dest.Height); + var r = new Rectangle(0, 0, (int)src.Width, (int)src.Height); + Graphics.FromImage(b).DrawImage(image, r, ); + var data = b.LockBits(r, ImageLockMode.ReadWrite, b.PixelFormat); + var ptr = data.Scan0; + var bytes = Math.Abs(data.Stride) * b.Height; + var values = new byte[bytes]; + System.Runtime.InteropServices.Marshal.Copy(ptr, values, 0, bytes); + var i = 3; + + for (var x = 0; x < b.Width; x++) + { + for (var y = 0; y < b.Height; y++) + { + var xr = Math.Min((x + 1) / s, 1.0); + var yr = Math.Min((y + 1) / s, 1.0); + var sq = (float)Math.Max(1.0 - Math.Sqrt(xr * xr + yr * yr), 0.0); + values[i] = (byte)(255f * sq); + i += 4; + } + } + + System.Runtime.InteropServices.Marshal.Copy(values, 0, ptr, bytes); + b.UnlockBits(data); + + g.DrawImage(b, dest, src, GraphicsUnit.Pixel); + */ + + for (var x = 0; x < dest.Width; x++) + { + for (var y = 0; y < dest.Height; y++) + { + var xr = Math.Min((x + 1) / s, 1.0); + var yr = Math.Min((y + 1) / s, 1.0); + var r = Math.Sqrt(xr * xr + yr * yr); + + if (r > 1.0) + { + continue; + } + + var d = new Rectangle((int)(left ? dest.Right - x - 1 : dest.Left + x), (int)(top ? dest.Bottom - y - 1 : dest.Top + y), 1, 1); + cm.Matrix33 = 1f - (float)r; + ia.SetColorMatrix(cm); + g.DrawImage(image, d, left ? src.Right - x - 1 : src.Left + x, top ? src.Bottom - y - 1 : src.Top + y, 1, 1, GraphicsUnit.Pixel, ia); + } + } + } + + static void DrawSide(Graphics g, Image image, RectangleF destSource, RectangleF src, float smoothness, AnchorStyles side) + { + var dest = new RectangleF(src.X - destSource.X, src.Y - destSource.Y, src.Width, src.Height); + var ia = new ImageAttributes(); + var cm = new ColorMatrix(); + var rest = (float)Math.Ceiling(smoothness); + var take = 1f; + var inv = (AnchorStyles.Bottom & side) == AnchorStyles.Bottom || (AnchorStyles.Right & side) == AnchorStyles.Right; + var top = (AnchorStyles.Bottom & side) == AnchorStyles.Bottom || (AnchorStyles.Top & side) == AnchorStyles.Top; + + while (rest > 0f) + { + take = Math.Min(1f, rest); + rest -= take; + var d = new Rectangle((int)Math.Floor(dest.X + (top ? 0f : rest)), (int)Math.Floor(dest.Y + (top ? rest : 0f)), + (int)Math.Ceiling(top ? dest.Width : take), (int)Math.Ceiling(top ? take : dest.Height)); + cm.Matrix33 = inv ? 1f - Math.Max(0f, rest / smoothness) : Math.Max(0f, rest / smoothness); + ia.SetColorMatrix(cm); + g.DrawImage(image, d, + src.X + (top ? 0f : rest), src.Y + (top ? rest : 0f), top ? src.Width : 1f, top ? 1f : src.Height, + GraphicsUnit.Pixel, ia); + } + } + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/KryptonFormExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/KryptonFormExtensions.cs new file mode 100644 index 000000000..e7d8e4a8e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/KryptonFormExtensions.cs @@ -0,0 +1,139 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +using Timer = System.Windows.Forms.Timer; + +namespace Krypton.Toolkit.Suite.Extended.Forms +{ + public static class KryptonFormExtensions + { + #region Implementation + + /// + /// Shows a notification on the form. + /// + /// The form to display the notification. + /// The message (notification) that should be displayed. + /// The duration of the notification (specify -1 for infinite). + /// The opacity of the background (0..1). + /// The glow color of the message rectangle. + /// The background color of the message rectangle. + /// The text color of the message. + public static Control Notify(this VisualKryptonFormExtended form, string message, int duration, double opacity, Color glowColor, Color backColor, Color foreColor) + { + var font = new Font(form.Font.FontFamily, form.Font.Size * 1.2f, form.Font.Unit); + var proposedSize = new Size(form.Width * 6 / 10, 0); + var size = TextRenderer.MeasureText(message, font, proposedSize, TextFormatFlags.WordBreak); + var panel = FormPanel(form, message, opacity, glowColor, backColor, foreColor, size, font); + form.Controls.Add(panel); + panel.BringToFront(); + + if (duration > 0) + { + var timer = new Timer(); + timer.Interval = duration; + timer.Tick += (sender, e) => + { + form.Controls.Remove(panel); + panel = null; + timer.Stop(); + }; + timer.Start(); + } + + form.Refresh(); + return panel; + } + + private static TransparentPanel FormPanel(VisualKryptonFormExtended form, string message, double opacity, + Color glowColor, Color backColor, Color foreColor, Size size, Font font) + { + var panel = new TransparentPanel(); + panel.Size = form.ClientRectangle.Size; + panel.Location = new Point(0, 0); + panel.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom; + panel.Paint += (sender, e) => + { + var g = e.Graphics; + e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb((int)Math.Ceiling(255.0 * opacity), Color.Black)), 0, 0, panel.Width, panel.Height); + g.SmoothingMode = SmoothingMode.AntiAlias; + var rectangle = new Rectangle(0, 0, size.Width + 20, size.Height + 10); + rectangle.Offset(form.Width / 2 - rectangle.Width / 2, form.Height / 2 - rectangle.Height / 2); + g.Glow(rectangle, glowColor, 30, 10); + g.FillRoundRectangle(new SolidBrush(backColor), rectangle, 5); + TextRenderer.DrawText(g, message, font, rectangle, foreColor, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.WordBreak); + }; + + return panel; + } + + /// + /// Shows a notification on the form with a black background, white text, red glowing and an opaque layer of 0.3 opacity for 5 seconds. + /// + /// The form to display the notification. + /// The message (notification) that should be displayed. + public static Control Notify(this VisualKryptonFormExtended form, string message) => form.Notify(message, 5000); + + /// + /// Shows a notification on the form with a black background, white text, red glowing and an opaque layer of 0.3. + /// + /// The form to display the notification. + /// The message (notification) that should be displayed. + /// The duration of the notification (specify -1 for infinite). + public static Control Notify(this VisualKryptonFormExtended form, string message, int duration) => form.Notify(message, duration, 0.3); + + /// + /// Shows a notification on the form with a black background, white text and red glowing. + /// + /// The form to display the notification. + /// The message (notification) that should be displayed. + /// The duration of the notification (specify -1 for infinite). + /// The opacity of the background (0..1). + public static Control Notify(this VisualKryptonFormExtended form, string message, int duration, double opacity) => form.Notify(message, duration, opacity, Color.Red); + + /// + /// Shows a notification on the form with a black background, white text and an opaque layer of 0.3 opacity. + /// + /// The form to display the notification. + /// The message (notification) that should be displayed. + /// The duration of the notification (specify -1 for infinite). + /// The glow color of the message rectangle. + public static Control Notify(this VisualKryptonFormExtended form, string message, int duration, Color glowColor) => form.Notify(message, duration, 0.3, glowColor); + + /// + /// Shows a notification on the form with a black background and white text. + /// + /// The form to display the notification. + /// The message (notification) that should be displayed. + /// The duration of the notification (specify -1 for infinite). + /// The opacity of the background (0..1). + /// The glow color of the message rectangle. + public static Control Notify(this VisualKryptonFormExtended form, string message, int duration, double opacity, Color glowColor) => form.Notify(message, duration, opacity, glowColor, Color.Black, Color.White); + + #endregion + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/LinearEasing.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/LinearEasing.cs new file mode 100644 index 000000000..f8d737b3f --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/LinearEasing.cs @@ -0,0 +1,39 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion +namespace Krypton.Toolkit.Suite.Extended.Forms +{ + public class LinearEasing : Easing + { + #region Implementation + + /// + public override double CalculateStep(int frame, int frames, double start, double end) + => start + frame * (end - start) / frames; + + #endregion + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/OperationThreadExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/OperationThreadExtended.cs new file mode 100644 index 000000000..0d24678ee --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/OperationThreadExtended.cs @@ -0,0 +1,119 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Forms +{ + internal class OperationThreadExtended : GlobalId + { + #region Instance Fields + private readonly Operation _op; + private readonly object? _parameter; + private int _state; + + #endregion + + #region Identity + /// + /// Initialize a new instance of the OperationThread class. + /// + /// Operation to perform on thread. + /// Parameter to pass into operation. + public OperationThreadExtended(Operation op, object? parameter) + { + // Remember the passed operation details + _op = op; + _parameter = parameter; + + // Operation still running + _state = 0; + } + #endregion + + #region Properties + /// + /// Gets the current operation state. + /// + public int State + { + get + { + int ret; + + // Read the state in a thread state way + lock (this) + { + ret = _state; + } + + return ret; + } + } + + /// + /// Gets the result from the operation. + /// + public object Result { get; private set; } + + /// + /// Gets the exception generated by operation. + /// + public Exception Exception { get; private set; } + + #endregion + + #region Run + /// + /// Entry point for performing operation. + /// + public void Run() + { + try + { + // Execute the operation + Result = _op(_parameter); + + // Success + lock (this) + { + _state = 1; + } + } + catch (Exception ex) + { + // Remember the exception details + Exception = ex; + + // Failed with exception + lock (this) + { + _state = 2; + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/ShadowManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/ShadowManager.cs index dc5d81aef..e8b1653cb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/ShadowManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/ShadowManager.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -35,14 +35,14 @@ namespace Krypton.Toolkit.Suite.Extended.Forms internal class ShadowManager { #region Instance Fields - private readonly VirtualForm _parentForm; + private readonly VisualForm _parentForm; private readonly ShadowValues _shadowValues; private bool _allowDrawing; private VisualShadowBase?[] _shadowForms; #endregion #region Identity - public ShadowManager(VirtualForm kryptonForm, ShadowValues shadowValues) + public ShadowManager(VisualForm kryptonForm, ShadowValues shadowValues) { _parentForm = kryptonForm; _shadowValues = shadowValues; @@ -82,9 +82,9 @@ private void InitialiseShadowForms() { if (_shadowForms != null) { - foreach (VisualShadowBase shadowForm in _shadowForms) + foreach (var shadowForm in _shadowForms) { - shadowForm.Visible = false; + shadowForm!.Visible = false; shadowForm.Dispose(); } } @@ -108,9 +108,9 @@ private void KryptonFormOnClosing(object sender, /*Cancel*/EventArgs e) if (_shadowForms != null) { - foreach (VisualShadowBase shadowForm in _shadowForms) + foreach (var shadowForm in _shadowForms) { - shadowForm.Visible = false; + shadowForm!.Visible = false; shadowForm.Dispose(); } } @@ -118,8 +118,8 @@ private void KryptonFormOnClosing(object sender, /*Cancel*/EventArgs e) private void FormLoaded(object sender, EventArgs e) { - _allowDrawing = (LicenseManager.UsageMode != LicenseUsageMode.Designtime) - && (Process.GetCurrentProcess().ProcessName != @"devenv"); + _allowDrawing = LicenseManager.UsageMode != LicenseUsageMode.Designtime + && Process.GetCurrentProcess().ProcessName != @"devenv"; if (_shadowForms == null) { InitialiseShadowForms(); @@ -158,9 +158,9 @@ private void ShadowValues_EnableShadowsChanged(object sender, EventArgs e) return; } - foreach (VisualShadowBase shadowForm in _shadowForms) + foreach (var shadowForm in _shadowForms) { - shadowForm.Visible = AllowDrawing; + shadowForm!.Visible = AllowDrawing; } } @@ -181,9 +181,9 @@ private void ReCalcBrushes() // calculate the "whole" shadow Rectangle clientRectangle = CommonHelper.RealClientRectangle(_parentForm.Handle); using Bitmap allShadow = DrawShadowBitmap(clientRectangle); - foreach (VisualShadowBase shadowForm in _shadowForms) + foreach (var shadowForm in _shadowForms) { - shadowForm.ReCalcShadow(allShadow, clientRectangle); + shadowForm?.ReCalcShadow(allShadow, clientRectangle); } } @@ -242,7 +242,7 @@ private Bitmap DrawShadowBitmap(Rectangle clientRectangle) using (Matrix matrix = new()) { gp.AddEllipse(0, 0, blurOffset * 2, blurOffset * 2); - using (PathGradientBrush pgb = new(gp) + using (PathGradientBrush pgb = new PathGradientBrush(gp) { CenterColor = _shadowValues.Colour, SurroundColors = new[] { Color.Transparent }, @@ -294,9 +294,9 @@ private void PositionShadowForms(bool move) void Mi() { var shadowFormVisible = AllowDrawing; - foreach (VisualShadowBase shadowForm in _shadowForms) + foreach (var shadowForm in _shadowForms) { - shadowForm.Visible = shadowFormVisible; + shadowForm!.Visible = shadowFormVisible; } if (!shadowFormVisible) { @@ -307,11 +307,11 @@ void Mi() IntPtr hWinPosInfo = PlatformInvoke.BeginDeferWindowPos(_shadowForms.Length); - foreach (VisualShadowBase shadowForm in _shadowForms) + foreach (var shadowForm in _shadowForms) { - shadowForm.CalcPositionShadowForm(desktopLocation, + shadowForm?.CalcPositionShadowForm(desktopLocation, CommonHelper.RealClientRectangle(_parentForm.Handle)); - Rectangle targetRect = shadowForm.TargetRect; + Rectangle targetRect = shadowForm!.TargetRect; hWinPosInfo = PlatformInvoke.DeferWindowPos(hWinPosInfo, shadowForm.Handle, /*PlatformInvoke.HWND_TOPMOST, //*/_parentForm.Handle, targetRect.X, targetRect.Y, targetRect.Width, targetRect.Height, (move ? PlatformInvoke.SWP_.NOSIZE : 0) | diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/SinusEasing.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/SinusEasing.cs new file mode 100644 index 000000000..ebc4e6813 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/SinusEasing.cs @@ -0,0 +1,70 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Forms +{ + public class SinusEasing : Easing + { + #region Public + + /// + /// Gets or sets the amplitude of the sinus wave. + /// + public double Amplitude { get; set; } + + /// + /// Gets or sets the frequency of the sinus wave. + /// + public double Frequency { get; set; } + + #endregion + + #region Identity + + /// + /// Creates an object of the sinus easing. + /// + /// The amplitude of the sinus wave. + /// The frequency of the sinus wave. + public SinusEasing(double amplitude = 0.2, double frequency = 2.0) + { + Amplitude = amplitude; + Frequency = frequency; + } + + #endregion + + #region Implementation + + /// + public override double CalculateStep(int frame, int frames, double start, double end) + => start + frame * (end - start) / frames + + Math.Sin(frame * Frequency * 2 * Math.PI / frames) * (end - start) * Amplitude; + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/VisualBlur.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/VisualBlur.cs index 668ac1909..24688c96c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/VisualBlur.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/VisualBlur.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -361,7 +361,7 @@ private static Bitmap ApplyConvolutionFilter(Bitmap sourceBitmap, double[,] filt var yOffset = filterY + filterOffset; for (var filterX = -filterOffset; filterX <= filterOffset; filterX++) { - var temporaryOffset = byteOffset + (filterX * 4) + (filterY * sourceBitmapData.Stride); + var temporaryOffset = byteOffset + filterX * 4 + filterY * sourceBitmapData.Stride; var xOffset = filterX + filterOffset; var filter = filterArray[yOffset, xOffset]; @@ -378,13 +378,13 @@ private static Bitmap ApplyConvolutionFilter(Bitmap sourceBitmap, double[,] filt green = factor * green + bias; red = factor * red + bias; - blue = (blue > 255 ? 255 : (blue < 0 ? 0 : blue)); - green = (green > 255 ? 255 : (green < 0 ? 0 : green)); - red = (red > 255 ? 255 : (red < 0 ? 0 : red)); + blue = blue > 255 ? 255 : blue < 0 ? 0 : blue; + green = green > 255 ? 255 : green < 0 ? 0 : green; + red = red > 255 ? 255 : red < 0 ? 0 : red; - targetByteArray[byteOffset] = (byte)(blue); - targetByteArray[byteOffset + 1] = (byte)(green); - targetByteArray[byteOffset + 2] = (byte)(red); + targetByteArray[byteOffset] = (byte)blue; + targetByteArray[byteOffset + 1] = (byte)green; + targetByteArray[byteOffset + 2] = (byte)red; targetByteArray[byteOffset + 3] = 255; } ); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/VisualShadowBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/VisualShadowBase.cs index 74ae111c9..38684f53f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/VisualShadowBase.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/General/VisualShadowBase.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Globals/GlobalDeclarations.cs index d76ed32fa..64583346e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,12 +26,16 @@ #endregion global using System; +global using System.Collections; global using System.Collections.Generic; global using System.ComponentModel; +global using System.ComponentModel.Design; global using System.Drawing; global using System.Drawing.Drawing2D; global using System.Drawing.Imaging; +global using System.Drawing.Text; global using System.Diagnostics; +global using System.Diagnostics.CodeAnalysis; global using System.Runtime.InteropServices; global using System.Reflection; global using System.Threading; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Interfaces/IKryptonComposition.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Interfaces/IKryptonComposition.cs index f38cdc227..8b81e152e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Interfaces/IKryptonComposition.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Interfaces/IKryptonComposition.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -45,7 +45,7 @@ public interface IKryptonComposition /// /// Gets and sets the form that owns the composition. /// - VirtualForm CompOwnerForm { get; set; } + VisualForm CompOwnerForm { get; set; } /// /// Request a repaint and optional layout. diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Krypton.Toolkit.Suite.Extended.Forms 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Krypton.Toolkit.Suite.Extended.Forms 2022.csproj index ee12a4f9d..4ea783345 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Krypton.Toolkit.Suite.Extended.Forms 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Krypton.Toolkit.Suite.Extended.Forms 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements additional KryptonForm effects, to be used in conjunction with the standard toolkit. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements additional KryptonForm effects, to be used in conjunction with the standard toolkit. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,74 +69,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/PaletteBase/PaletteBorder/PaletteFormBorderExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/PaletteBase/PaletteBorder/PaletteFormBorderExtended.cs new file mode 100644 index 000000000..063243b27 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/PaletteBase/PaletteBorder/PaletteFormBorderExtended.cs @@ -0,0 +1,108 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Forms +{ + public class PaletteFormBorderExtended : PaletteBorder + { + #region Identity + /// + /// Initialize a new instance of the PaletteBorder class. + /// + /// Source for inheriting defaulted values. + /// Delegate for notifying paint requests. + public PaletteFormBorderExtended([DisallowNull] IPaletteBorder inherit, + NeedPaintHandler? needPaint) + : base(inherit, needPaint) + { + } + #endregion + + + #region Width + internal bool UseThemeFormChromeBorderWidth { get; set; } = true; + private FormBorderStyle _lastFormFormBorderStyle = FormBorderStyle.Sizable; + + /// + /// Gets and sets the border width. + /// + [KryptonPersist(false)] + [Category(@"Visuals")] + [Description(@"Border width.")] + [DefaultValue(-1)] + [RefreshProperties(RefreshProperties.All)] + public override int Width + { + get => !UseThemeFormChromeBorderWidth + ? BorderWidths(_lastFormFormBorderStyle).xBorder + : base.Width; + + set => base.Width = value; + } + + /// https://github.com/Krypton-Suite/Standard-Toolkit/issues/139 + internal (int xBorder, int yBorder) BorderWidths(FormBorderStyle formFormBorderStyle) + { + var xBorder = base.Width; + var yBorder = base.Width; + if (!UseThemeFormChromeBorderWidth) + { + _lastFormFormBorderStyle = formFormBorderStyle; + switch (formFormBorderStyle) + { + case FormBorderStyle.None: + xBorder = 0; + yBorder = 0; + break; + case FormBorderStyle.FixedSingle: + case FormBorderStyle.FixedToolWindow: + xBorder = PlatformInvoke.GetSystemMetrics(PlatformInvoke.SM_.CXFIXEDFRAME); + yBorder = PlatformInvoke.GetSystemMetrics(PlatformInvoke.SM_.CYFIXEDFRAME); + break; + case FormBorderStyle.Fixed3D: + xBorder = PlatformInvoke.GetSystemMetrics(PlatformInvoke.SM_.CXEDGE); + yBorder = PlatformInvoke.GetSystemMetrics(PlatformInvoke.SM_.CYEDGE); + break; + case FormBorderStyle.FixedDialog: + xBorder = PlatformInvoke.GetSystemMetrics(PlatformInvoke.SM_.CXDLGFRAME); + yBorder = PlatformInvoke.GetSystemMetrics(PlatformInvoke.SM_.CYDLGFRAME); + break; + case FormBorderStyle.Sizable: + case FormBorderStyle.SizableToolWindow: + xBorder = PlatformInvoke.GetSystemMetrics(PlatformInvoke.SM_.CXSIZEFRAME); + yBorder = PlatformInvoke.GetSystemMetrics(PlatformInvoke.SM_.CYSIZEFRAME); + break; + default: + throw new ArgumentOutOfRangeException(nameof(formFormBorderStyle), formFormBorderStyle, null); + } + } + + return (xBorder, yBorder); + } + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Utilities/AllowNullAttribute.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Utilities/AllowNullAttribute.cs new file mode 100644 index 000000000..a160959af --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Utilities/AllowNullAttribute.cs @@ -0,0 +1,36 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Diagnostics.CodeAnalysis +{ +#if NETFRAMEWORK // https://github.com/dotnet/designs/blob/main/accepted/2020/net5/net5.md#preprocessor-symbols + /// Specifies that is allowed as an input even if the corresponding type disallows it. + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)] + internal sealed class AllowNullAttribute : Attribute + { + } + + /// Specifies that is disallowed as an input even if the corresponding type allows it. + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)] + internal sealed class DisallowNullAttribute : Attribute + { + } + + /// Specifies that an output may be even if the corresponding type disallows it. + [AttributeUsage( + AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, + Inherited = false)] + public sealed class MaybeNullAttribute : Attribute + { + } + + /// Specifies that an output is not even if the corresponding type allows it. Specifies that an input argument was not when the call returns. + [AttributeUsage( + AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, + Inherited = false)] + public sealed class NotNullAttribute : Attribute + { + } + +#endif +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Utilities/Portable.System.ValueTuple.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Utilities/Portable.System.ValueTuple.cs new file mode 100644 index 000000000..e23bc1af9 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Utilities/Portable.System.ValueTuple.cs @@ -0,0 +1,640 @@ +#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 - 2024. All rights reserved. + */ +#endregion + +// ReSharper disable UnusedMember.Global +// ReSharper disable SuspiciousTypeConversion.Global +// ReSharper disable JoinDeclarationAndInitializer + +// Above comment from https://github.com/igor-tkachev/Portable.System.ValueTuple +// Smurf-IV: Then +// - Reduced to only support Tuple'T2 and T4 +// - Remove other frameworks that Krypton does not support +// - Remove public API +// - Apply "Preview" coding style(s) + +#if NET462 + +namespace System +{ + using Collections; + using Collections.Generic; + + using Runtime.CompilerServices; + using Runtime.InteropServices; + + namespace Runtime.CompilerServices + { + /// + /// This interface is required for types that want to be indexed into by dynamic patterns. + /// + internal interface ITuple + { + /// + /// The number of positions in this data structure. + /// + int Length { get; } + + /// + /// Get the element at position . + /// + object this[int index] { get; } + } + + /// + /// Indicates that the use of on a member is meant to be treated as a tuple with element names. + /// + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Property | + AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | + AttributeTargets.ReturnValue)] + internal sealed class TupleElementNamesAttribute : Attribute + { + private readonly string[] _transformNames; + + /// + /// Specifies, in a pre-order depth-first traversal of a type's + /// construction, which elements are + /// meant to carry element names. + /// + public IList TransformNames => _transformNames; + + /// + /// Initializes a new instance of the class. + /// + /// + /// Specifies, in a pre-order depth-first traversal of a type's + /// construction, which occurrences are + /// meant to carry element names. + /// + /// + /// This constructor is meant to be used on types that contain an + /// instantiation of that contains + /// element names. For instance, if C is a generic type with + /// two type parameters, then a use of the constructed type C{, might be intended to + /// treat the first type argument as a tuple with element names and the + /// second as a tuple without element names. In which case, the + /// appropriate attribute specification should use a + /// transformNames value of { "name1", @"name2", null, null, + /// null }. + /// + public TupleElementNamesAttribute(string[] transformNames) => _transformNames = transformNames ?? throw new ArgumentNullException(nameof(transformNames)); + } + } + + /// + /// Helper so we can call some tuple methods recursively without knowing the underlying types. + /// + internal interface IValueTupleInternal : ITuple + { + int GetHashCode(IEqualityComparer comparer); + string ToStringEnd(); + } + + /// + /// The ValueTuple types (from arity 0 to 8) comprise the runtime implementation that underlies tuples in C# and struct tuples in F#. + /// Aside from created via language syntax, they are most easily created via the ValueTuple.Create factory methods. + /// The System.ValueTuple types differ from the System.Tuple types in that: + /// - they are structs rather than classes, + /// - they are mutable rather than readonly, and + /// - their members (such as Item1, Item2, etc) are fields rather than properties. + /// + [Serializable] + internal struct ValueTuple : IEquatable, + IStructuralEquatable, IStructuralComparable, + IComparable, IComparable, IValueTupleInternal + { + /// + /// Returns a value that indicates whether the current instance is equal to a specified object. + /// + /// The object to compare with this instance. + /// if is a . + public override bool Equals(object obj) => obj is ValueTuple; + + /// Returns a value indicating whether this instance is equal to a specified value. + /// An instance to compare to this instance. + /// true if has the same value as this instance; otherwise, false. + public bool Equals(ValueTuple other) => true; + + int IComparable.CompareTo(object other) + { + return other switch + { + null => 1, + ValueTuple => 0, + _ => throw new ArgumentException(@"Incorrect type", nameof(other)) + }; + } + + /// Compares this instance to a specified instance and returns an indication of their relative values. + /// An instance to compare. + /// + /// A signed number indicating the relative values of this instance and . + /// Returns less than zero if this instance is less than , zero if this + /// instance is equal to , and greater than zero if this instance is greater + /// than . + /// + public int CompareTo(ValueTuple other) => 0; + + /// Returns the hash code for this instance. + /// A 32-bit signed integer hash code. + public override int GetHashCode() => 0; + + bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer) => other is ValueTuple; + + int IStructuralEquatable.GetHashCode(IEqualityComparer comparer) => 0; + + int IStructuralComparable.CompareTo(object other, IComparer comparer) + { + return other switch + { + null => 1, + ValueTuple => 0, + _ => throw new ArgumentException(@"Incorrect type", nameof(other)) + }; + } + + int IValueTupleInternal.GetHashCode(IEqualityComparer comparer) => 0; + + /// + /// Returns a string that represents the value of this instance. + /// + /// The string representation of this instance. + /// + /// The string returned by this method takes the form (). + /// + public override string ToString() => @"()"; + + string IValueTupleInternal.ToStringEnd() => @")"; + + /// + /// The number of positions in this data structure. + /// + int ITuple.Length => 0; + + /// + /// Get the element at position . + /// + object ITuple.this[int index] => throw new IndexOutOfRangeException(); + + /// Creates a new struct 0-tuple. + /// A 0-tuple. + public static ValueTuple Create() => new(); + + /// Creates a new struct 2-tuple, or pair. + /// The type of the first component of the tuple. + /// The type of the second component of the tuple. + /// The value of the first component of the tuple. + /// The value of the second component of the tuple. + /// A 2-tuple (pair) whose value is (item1, item2). + public static ValueTuple Create(T1 item1, T2 item2) => new(item1, item2); + + /// Creates a new struct 4-tuple, or quadruple. + /// The type of the first component of the tuple. + /// The type of the second component of the tuple. + /// The type of the third component of the tuple. + /// The type of the fourth component of the tuple. + /// The value of the first component of the tuple. + /// The value of the second component of the tuple. + /// The value of the third component of the tuple. + /// The value of the fourth component of the tuple. + /// A 4-tuple (quadruple) whose value is (item1, item2, item3, item4). + public static ValueTuple Create(T1 item1, T2 item2, T3 item3, T4 item4) => + new ValueTuple(item1, item2, item3, item4); + + internal static int CombineHashCodes(int h1, int h2) => Combine(Combine(_randomSeed, h1), h2); + + internal static int CombineHashCodes(int h1, int h2, int h3) => Combine(CombineHashCodes(h1, h2), h3); + + internal static int CombineHashCodes(int h1, int h2, int h3, int h4) => Combine(CombineHashCodes(h1, h2, h3), h4); + + private static readonly int _randomSeed = new Random().Next(int.MinValue, int.MaxValue); + + private static int Combine(int h1, int h2) + { + // RyuJIT optimizes this to use the ROL instruction + // Related GitHub pull request: dotnet/coreclr#1830 + var rol5 = ((uint)h1 << 5) | ((uint)h1 >> 27); + return ((int)rol5 + h1) ^ h2; + } + } + + /// + /// Represents a 2-tuple, or pair, as a value type. + /// + /// The type of the tuple's first component. + /// The type of the tuple's second component. + [Serializable] + [StructLayout(LayoutKind.Auto)] + public struct ValueTuple : IEquatable>, + IStructuralEquatable, IStructuralComparable, + IComparable, IComparable>, IValueTupleInternal + { + /// + /// The current instance's first component. + /// + public readonly T1 Item1; + + /// + /// The current instance's first component. + /// + public readonly T2 Item2; + + /// + /// Initializes a new instance of the value type. + /// + /// The value of the tuple's first component. + /// The value of the tuple's second component. + public ValueTuple(T1 item1, T2 item2) + { + Item1 = item1; + Item2 = item2; + } + + /// + /// Returns a value that indicates whether the current instance is equal to a specified object. + /// + /// The object to compare with this instance. + /// if the current instance is equal to the specified object; otherwise, . + /// + /// + /// The parameter is considered to be equal to the current instance under the following conditions: + /// + /// It is a value type. + /// Its components are of the same types as those of the current instance. + /// Its components are equal to those of the current instance. Equality is determined by the default object equality comparer for each component. + /// + /// + public override bool Equals(object obj) => obj is ValueTuple tuple && Equals(tuple); + + /// + /// Returns a value that indicates whether the current instance is equal to a specified . + /// + /// The tuple to compare with this instance. + /// if the current instance is equal to the specified tuple; otherwise, . + /// + /// The parameter is considered to be equal to the current instance if each of its fields + /// are equal to that of the current instance, using the default comparer for that field's type. + /// + public bool Equals(ValueTuple other) => + EqualityComparer.Default.Equals(Item1, other.Item1) + && EqualityComparer.Default.Equals(Item2, other.Item2); + + int IComparable.CompareTo(object other) + { + return other switch + { + null => 1, + not ValueTuple => throw new ArgumentException(@"Incorrect type", nameof(other)), + _ => CompareTo((ValueTuple)other) + }; + } + + /// Compares this instance to a specified instance and returns an indication of their relative values. + /// An instance to compare. + /// + /// A signed number indicating the relative values of this instance and . + /// Returns less than zero if this instance is less than , zero if this + /// instance is equal to , and greater than zero if this instance is greater + /// than . + /// + public int CompareTo(ValueTuple other) + { + var c = Comparer.Default.Compare(Item1, other.Item1); + return c != 0 ? c : Comparer.Default.Compare(Item2, other.Item2); + } + + bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer) + { + return other switch + { + ValueTuple(var item1, var item2) => comparer.Equals(Item1, item1) && comparer.Equals(Item2, item2), + _ => false + }; + } + + int IStructuralComparable.CompareTo(object other, IComparer comparer) + { + switch (other) + { + case null: + return 1; + case ValueTuple(var item1, var item2): + { + var c = comparer.Compare(Item1, item1); + + return c != 0 ? c : comparer.Compare(Item2, item2); + } + default: + throw new ArgumentException(@"Incorrect type", nameof(other)); + } + } + + int IStructuralEquatable.GetHashCode(IEqualityComparer comparer) => GetHashCodeCore(comparer); + + /// + /// Returns the hash code for the current instance. + /// + /// A 32-bit signed integer hash code. + public override int GetHashCode() => + ValueTuple.CombineHashCodes(Item1?.GetHashCode() ?? 0, + Item2?.GetHashCode() ?? 0); + + private int GetHashCodeCore(IEqualityComparer comparer) => + ValueTuple.CombineHashCodes(comparer.GetHashCode(Item1), + comparer.GetHashCode(Item2)); + + int IValueTupleInternal.GetHashCode(IEqualityComparer comparer) => GetHashCodeCore(comparer); + + /// + /// Returns a string that represents the value of this instance. + /// + /// The string representation of this instance. + /// + /// The string returned by this method takes the form (Item1, Item2), + /// where Item1 and Item2 represent the values of the + /// and fields. If either field value is , + /// it is represented as . + /// + public override string ToString() => $@"({Item1}, {Item2})"; + + string IValueTupleInternal.ToStringEnd() => $@"{Item1}, {Item2})"; + + /// + /// The number of positions in this data structure. + /// + int ITuple.Length => 2; + + /// + /// Get the element at position . + /// + object ITuple.this[int index] + { + get + { + return index switch + { + 0 => Item1, + 1 => Item2, + _ => throw new IndexOutOfRangeException() + }; + } + } + } + + /// + /// Represents a 4-tuple, or quadruple, as a value type. + /// + /// The type of the tuple's first component. + /// The type of the tuple's second component. + /// The type of the tuple's third component. + /// The type of the tuple's fourth component. + [Serializable] + [StructLayout(LayoutKind.Auto)] + public struct ValueTuple : IEquatable>, + IStructuralEquatable, IStructuralComparable, + IComparable, IComparable>, IValueTupleInternal + { + /// + /// The current instance's first component. + /// + public readonly T1 Item1; + /// + /// The current instance's second component. + /// + public readonly T2 Item2; + /// + /// The current instance's third component. + /// + public readonly T3 Item3; + /// + /// The current instance's fourth component. + /// + public readonly T4 Item4; + + /// + /// Initializes a new instance of the value type. + /// + /// The value of the tuple's first component. + /// The value of the tuple's second component. + /// The value of the tuple's third component. + /// The value of the tuple's fourth component. + public ValueTuple(T1 item1, T2 item2, T3 item3, T4 item4) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + } + + /// + /// Returns a value that indicates whether the current instance is equal to a specified object. + /// + /// The object to compare with this instance. + /// if the current instance is equal to the specified object; otherwise, . + /// + /// The parameter is considered to be equal to the current instance under the following conditions: + /// + /// It is a value type. + /// Its components are of the same types as those of the current instance. + /// Its components are equal to those of the current instance. Equality is determined by the default object equality comparer for each component. + /// + /// + public override bool Equals(object obj) + { + return obj is ValueTuple && Equals((ValueTuple)obj); + } + + /// + /// Returns a value that indicates whether the current + /// instance is equal to a specified . + /// + /// The tuple to compare with this instance. + /// if the current instance is equal to the specified tuple; otherwise, . + /// + /// The parameter is considered to be equal to the current instance if each of its fields + /// are equal to that of the current instance, using the default comparer for that field's type. + /// + public bool Equals(ValueTuple other) + { + return + EqualityComparer.Default.Equals(Item1, other.Item1) && + EqualityComparer.Default.Equals(Item2, other.Item2) && + EqualityComparer.Default.Equals(Item3, other.Item3) && + EqualityComparer.Default.Equals(Item4, other.Item4); + } + + int IComparable.CompareTo(object other) + { + if (other == null) + { + return 1; + } + + if (!(other is ValueTuple)) + { + throw new ArgumentException(); + } + + return CompareTo((ValueTuple)other); + } + + /// Compares this instance to a specified instance and returns an indication of their relative values. + /// An instance to compare. + /// + /// A signed number indicating the relative values of this instance and . + /// Returns less than zero if this instance is less than , zero if this + /// instance is equal to , and greater than zero if this instance is greater + /// than . + /// + public int CompareTo(ValueTuple other) + { + int c; + + c = Comparer.Default.Compare(Item1, other.Item1); if (c != 0) + { + return c; + } + + c = Comparer.Default.Compare(Item2, other.Item2); if (c != 0) + { + return c; + } + + c = Comparer.Default.Compare(Item3, other.Item3); if (c != 0) + { + return c; + } + + return Comparer.Default.Compare(Item4, other.Item4); + } + + bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer) + { + if (!(other is ValueTuple)) + { + return false; + } + + var objTuple = (ValueTuple)other; + + return + comparer.Equals(Item1, objTuple.Item1) && + comparer.Equals(Item2, objTuple.Item2) && + comparer.Equals(Item3, objTuple.Item3) && + comparer.Equals(Item4, objTuple.Item4); + } + + int IStructuralComparable.CompareTo(object other, IComparer comparer) + { + if (other == null) + { + return 1; + } + + if (!(other is ValueTuple)) + { + throw new ArgumentException(); + } + + var objTuple = (ValueTuple)other; + + int c; + + c = comparer.Compare(Item1, objTuple.Item1); if (c != 0) + { + return c; + } + + c = comparer.Compare(Item2, objTuple.Item2); if (c != 0) + { + return c; + } + + c = comparer.Compare(Item3, objTuple.Item3); if (c != 0) + { + return c; + } + + return comparer.Compare(Item4, objTuple.Item4); + } + + int IStructuralEquatable.GetHashCode(IEqualityComparer comparer) + { + return GetHashCodeCore(comparer); + } + + /// + /// Returns the hash code for the current instance. + /// + /// A 32-bit signed integer hash code. + public override int GetHashCode() + { + return ValueTuple.CombineHashCodes( + Item1?.GetHashCode() ?? 0, + Item2?.GetHashCode() ?? 0, + Item3?.GetHashCode() ?? 0, + Item4?.GetHashCode() ?? 0); + } + + int GetHashCodeCore(IEqualityComparer comparer) + { + return ValueTuple.CombineHashCodes( + comparer.GetHashCode(Item1), + comparer.GetHashCode(Item2), + comparer.GetHashCode(Item3), + comparer.GetHashCode(Item4)); + } + + int IValueTupleInternal.GetHashCode(IEqualityComparer comparer) + { + return GetHashCodeCore(comparer); + } + + /// + /// Returns a string that represents the value of this instance. + /// + /// The string representation of this instance. + /// + /// The string returned by this method takes the form (Item1, Item2, Item3, Item4). + /// If any field value is , it is represented as . + /// + public override string ToString() + { + return $"({Item1}, {Item2}, {Item3}, {Item4})"; + } + + string IValueTupleInternal.ToStringEnd() + { + return $"{Item1}, {Item2}, {Item3}, {Item4})"; + } + + /// + /// The number of positions in this data structure. + /// + int ITuple.Length => 4; + + /// + /// Get the element at position . + /// + object ITuple.this[int index] + { + get + { + switch (index) + { + case 0 : return Item1; + case 1 : return Item2; + case 2 : return Item3; + case 3 : return Item4; + default: throw new IndexOutOfRangeException(); + } + } + } + } +} + + +#endif diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Values/FadeValues.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Values/FadeValues.cs new file mode 100644 index 000000000..01653189e --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Values/FadeValues.cs @@ -0,0 +1,138 @@ +#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 +{ + /// Controls the values for . + [ToolboxItem(false)] + [DesignerCategory(@"code")] + public class FadeValues : Storage + { + #region Static Values + + private const bool DEFAULT_FADING_ENABLED = false; + + private const bool DEFAULT_SHOULD_CLOSE_ON_FADE_OUT = true; + + private const float DEFAULT_FADE_SPEED = 0.5f; + + private const int DEFAULT_FADE_DURATION = 50; + + private const VisualForm? DEFAULT_OWNER_FORM = null; + + private static FadeSpeedChoice DEFAULT_FADE_SPEED_CHOICE = FadeSpeedChoice.Normal; + + #endregion + + #region Public + + /// Gets or sets a value indicating whether [fading enabled]. + /// true if [fading enabled]; otherwise, false. + [Category(@"Data")] + [Description(@"Enables the fading effects. Default is 'false'.")] + [DefaultValue(DEFAULT_FADING_ENABLED)] + public bool FadingEnabled { get; set; } + + private bool ShouldSerializeFadingEnabled() => !FadingEnabled.Equals(DEFAULT_FADING_ENABLED); + + public void ResetFadingEnabled() => FadingEnabled = DEFAULT_FADING_ENABLED; + + /// Gets or sets a value indicating whether [should close on fade out]. + /// true if [should close on fade out]; otherwise, false. + [Category(@"Data")] + [Description(@"Should the form fade out on close. Default is 'true'.")] + [DefaultValue(DEFAULT_SHOULD_CLOSE_ON_FADE_OUT)] + public bool ShouldCloseOnFadeOut { get; set; } + + private bool ShouldSerializeShouldCloseOnFadeOut() => !ShouldCloseOnFadeOut.Equals(DEFAULT_SHOULD_CLOSE_ON_FADE_OUT); + + public void ResetShouldCloseOnFadeOut() => ShouldCloseOnFadeOut = DEFAULT_SHOULD_CLOSE_ON_FADE_OUT; + + /// Gets or sets the fade speed. + /// The fade speed. + [Category(@"Data")] + [Description(@"Controls the fading speed. Default is '0.5'. (Use this if you are using .NET FrameWork 4.x)")] + [DefaultValue(DEFAULT_FADE_SPEED)] + public float FadeSpeed { get; set; } + + private bool ShouldSerializeFadeSpeed() => !FadeSpeed.Equals(DEFAULT_FADE_SPEED); + + private void ResetFadeSpeed() => FadeSpeed = DEFAULT_FADE_SPEED; + + /// Gets or sets the duration of the fade. + /// The duration of the fade. + [Category(@"Data")] + [Description(@"Controls the fading duration. Default is '50'. (Use this if you are using .NET)")] + [DefaultValue(DEFAULT_FADE_DURATION)] + public int FadeDuration { get; set; } + + private bool ShouldSerializeFadeDuration() => !FadeDuration.Equals(DEFAULT_FADE_DURATION); + + private void ResetFadeDuration() => FadeDuration = DEFAULT_FADE_DURATION; + + /// Gets or sets the fade speed choice. + /// The fade speed choice. + [Category(@"Data")] + [Description(@"Controls the fading speed. Default is 'Normal'.")] + [DefaultValue(typeof(FadeSpeedChoice), @"Normal")] + public FadeSpeedChoice FadeSpeedChoice { get; set; } + + private bool ShouldSerializeFadeSpeedChoice() => !FadeSpeedChoice.Equals(DEFAULT_FADE_SPEED_CHOICE); + + private void ResetFadeSpeedChoice() => FadeSpeedChoice = DEFAULT_FADE_SPEED_CHOICE; + + [Category(@"Data")] + [Browsable(false)] + public VisualForm? Owner { get; set; } + + #endregion + + #region Identity + + public FadeValues() + { + throw new Exception( "FadeValues is disabled until proven stable. Further development in V100" ); + Reset(); + } + + #endregion + + #region IsDefault + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public override bool IsDefault => FadingEnabled.Equals(DEFAULT_FADING_ENABLED) && + ShouldCloseOnFadeOut.Equals(DEFAULT_SHOULD_CLOSE_ON_FADE_OUT) && + FadeDuration.Equals(DEFAULT_FADE_DURATION) && + FadeSpeed.Equals(DEFAULT_FADE_SPEED) && + FadeSpeedChoice.Equals(DEFAULT_FADE_SPEED_CHOICE) /*&& + Owner.Equals(null)*/; + + #endregion + + #region Implementation + + internal void Reset() + { + FadingEnabled = DEFAULT_FADING_ENABLED; + + ShouldCloseOnFadeOut = DEFAULT_SHOULD_CLOSE_ON_FADE_OUT; + + FadeDuration = DEFAULT_FADE_DURATION; + + FadeSpeed = DEFAULT_FADE_SPEED; + + FadeSpeedChoice = DEFAULT_FADE_SPEED_CHOICE; + + Owner = DEFAULT_OWNER_FORM; + } + + #endregion + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Values/SlideFormValues.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Values/SlideFormValues.cs new file mode 100644 index 000000000..ba126bb99 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Values/SlideFormValues.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Krypton.Toolkit.Suite.Extended.Forms +{ + public class SlideFormValues : Storage + { + #region Static Fields + + private const float DEFAULT_SLIDE_STEP = 1.0f; + + private const SlideDirection DEFAULT_SLIDE_DIRECTION = SlideDirection.Right; + + #endregion + + #region Public + + public float SlideStep { internal get; set; } + + public SlideDirection SlideDirection { internal get; set; } + + #endregion + + #region Identity + + public SlideFormValues() + { + Reset(); + } + + #endregion + + public override bool IsDefault => SlideStep.Equals(DEFAULT_SLIDE_STEP) && + SlideDirection.Equals(DEFAULT_SLIDE_DIRECTION); + + #region Implementation + + public void Reset() + { + SlideStep = DEFAULT_SLIDE_STEP; + + SlideDirection = DEFAULT_SLIDE_DIRECTION; + } + + #endregion + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Gages/Krypton.Toolkit.Suite.Extended.Gages 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Gages/Krypton.Toolkit.Suite.Extended.Gages 2022.csproj index ffff47bfc..97b3793a7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Gages/Krypton.Toolkit.Suite.Extended.Gages 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Gages/Krypton.Toolkit.Suite.Extended.Gages 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -38,6 +26,7 @@ en Debug;Release;Nightly;Canary true + preview @@ -68,9 +57,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements additional gage controls. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements additional gage controls. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -78,74 +67,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Gages/Krypton.Toolkit.Suite.Extended.Guages.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Gages/Krypton.Toolkit.Suite.Extended.Guages.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Gages/Krypton.Toolkit.Suite.Extended.Guages.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Gages/Krypton.Toolkit.Suite.Extended.Guages.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/GlobalMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/GlobalMethods.cs index 7bc05972b..bcc8fe598 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/GlobalMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/GlobalMethods.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -127,7 +127,7 @@ public bool CheckIfTargetPlatformIsSupported(bool useLegacyVistaSupport = false) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc, "Exception Thrown", KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon.Error, "GlobalMethods", "CheckIfTargetPlatformIsSupported(bool useLegacyVistaSupport = false)"); + DebugUtilities.NotImplemented(exc.ToString()); SetIsTargetPlatformSupported(false); } @@ -154,7 +154,7 @@ public bool IsTargetPlatformRunningIn64BITMode() } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); SetIsTargetPlatform64BIT(false); } @@ -174,7 +174,7 @@ public bool AreAssemblies64BIT() } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); SetIsAssemblies64BIT(false); } @@ -474,7 +474,7 @@ public static bool IsTargetPlatformRunningIn64BITMode() } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); SetIsTargetPlatform64BIT(false); } @@ -494,7 +494,7 @@ public static bool AreAssemblies64BIT() } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); SetIsAssemblies64BIT(false); } @@ -527,7 +527,7 @@ public static void ElevateProcessWithAdministrativeRights(string processName) } catch (Win32Exception wexc) { - ExceptionCapture.CaptureException(wexc); + DebugUtilities.NotImplemented(wexc.ToString()); } return; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/GlobalNativeMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/GlobalNativeMethods.cs index dacc06fd0..6144033f6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/GlobalNativeMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/GlobalNativeMethods.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/TranslationMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/TranslationMethods.cs index 7c2881886..504325e82 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/TranslationMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/TranslationMethods.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/UtilityMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/UtilityMethods.cs index 81b5dfe27..ade8b63de 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/UtilityMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/UtilityMethods.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -67,7 +67,7 @@ public static void ElevateProcessWithAdministrativeRights(string processName) } catch (Win32Exception wexc) { - ExceptionCapture.CaptureException(wexc); + DebugUtilities.NotImplemented(wexc.ToString()); } return; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/IO/FileUtilityMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/IO/FileUtilityMethods.cs index 7cf9611b6..354c845bb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/IO/FileUtilityMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/IO/FileUtilityMethods.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -53,9 +53,9 @@ public FileUtilityMethods() /// public static string ParseReadableFileSize(long fileSize) { - string sign = (fileSize < 0 ? "-" : ""), suffix; + string sign = fileSize < 0 ? "-" : "", suffix; - double readable = (fileSize < 0 ? -fileSize : fileSize); + double readable = fileSize < 0 ? -fileSize : fileSize; if (fileSize >= 0x40000000) // Gigabyte { @@ -139,36 +139,36 @@ public string ParseReadableFileSize(int fileSize) public string GetBytesReadable(long size) { // Get absolute value - long absolute_i = (size < 0 ? -size : size); + long absoluteI = size < 0 ? -size : size; // Determine the suffix and readable value string suffix; double readable; - if (absolute_i >= 0x1000000000000000) // Exabyte + if (absoluteI >= 0x1000000000000000) // Exabyte { suffix = "EB"; - readable = (size >> 50); + readable = size >> 50; } - else if (absolute_i >= 0x4000000000000) // Petabyte + else if (absoluteI >= 0x4000000000000) // Petabyte { suffix = "PB"; - readable = (size >> 40); + readable = size >> 40; } - else if (absolute_i >= 0x10000000000) // Terabyte + else if (absoluteI >= 0x10000000000) // Terabyte { suffix = "TB"; - readable = (size >> 30); + readable = size >> 30; } - else if (absolute_i >= 0x40000000) // Gigabyte + else if (absoluteI >= 0x40000000) // Gigabyte { suffix = "GB"; - readable = (size >> 20); + readable = size >> 20; } - else if (absolute_i >= 0x100000) // Megabyte + else if (absoluteI >= 0x100000) // Megabyte { suffix = "MB"; - readable = (size >> 10); + readable = size >> 10; } - else if (absolute_i >= 0x400) // Kilobyte + else if (absoluteI >= 0x400) // Kilobyte { suffix = "KB"; readable = size; @@ -178,7 +178,7 @@ public string GetBytesReadable(long size) return size.ToString("0 B"); // Byte } // Divide by 1024 to get fractional value - readable = (readable / 1024); + readable = readable / 1024; // Return formatted number with suffix return readable.ToString("0.### ") + suffix; } @@ -186,13 +186,13 @@ public string GetBytesReadable(long size) /// /// Returns the size of the online file. /// - /// The online file URL. + /// The online file URL. /// Size of the file. - public void ReturnOnlineFileSize(string onlineFileURL, KryptonLabel fileSize) + public void ReturnOnlineFileSize(string onlineFileUrl, KryptonLabel fileSize) { - string URL = onlineFileURL, fileType = URL.Substring(URL.LastIndexOf(".") + 1, (URL.Length - URL.LastIndexOf(".") - 1)), fileName = URL.Substring(URL.LastIndexOf("/") + 1, (URL.Length - URL.LastIndexOf("/") - 1)); + string url = onlineFileUrl, fileType = url.Substring(url.LastIndexOf(".") + 1, url.Length - url.LastIndexOf(".") - 1), fileName = url.Substring(url.LastIndexOf("/") + 1, url.Length - url.LastIndexOf("/") - 1); - WebRequest request = (HttpWebRequest)WebRequest.Create(onlineFileURL); + WebRequest request = (HttpWebRequest)WebRequest.Create(onlineFileUrl); request.Method = "HEAD"; @@ -232,100 +232,100 @@ public void ReturnOnlineFileSize(string onlineFileURL, KryptonLabel fileSize) /// /// Formats the length of the file. /// - /// The file path. - /// The output. - public void FormatFileLength(string FilePath, KryptonLabel Output) + /// The file path. + /// The output. + public void FormatFileLength(string filePath, KryptonLabel output) { - long fileSize = (long)ReturnFileLength(FilePath), result; + long fileSize = (long)ReturnFileLength(filePath), result; if (fileSize >= 1073741824) { result = fileSize / 1073741824; - Output.Text = string.Format("File Size: {0:##:##} GB", result); + output.Text = string.Format("File Size: {0:##:##} GB", result); } else if (fileSize >= 1048576) { result = fileSize / 1048576; - Output.Text = string.Format("File Size: {0:##:##} MB", result); + output.Text = string.Format("File Size: {0:##:##} MB", result); } else if (fileSize >= 1024) { result = fileSize / 1024; - Output.Text = string.Format("File Size: {0:##:##} KB", result); + output.Text = string.Format("File Size: {0:##:##} KB", result); } } /// /// Retrieves the file length from the specified file. /// - /// The file path to the specified file. + /// The file path to the specified file. /// The file length from the specified file. - public int ReturnFileLength(string FilePath) + public int ReturnFileLength(string filePath) { - return Convert.ToInt32(ReturnFileInformation(FilePath).Length); + return Convert.ToInt32(ReturnFileInformation(filePath).Length); } /// /// Retrieves the file last accessed time from the specified file. /// - /// The file path to the specified file. + /// The file path to the specified file. /// The file last accessed time from the specified file. - public DateTime ReturnFileLastAccessedTime(string FilePath) + public DateTime ReturnFileLastAccessedTime(string filePath) { - return ReturnFileInformation(FilePath).LastAccessTime; + return ReturnFileInformation(filePath).LastAccessTime; } /// /// Retrieves the file creation time from the specified file. /// - /// The file path to the specified file. + /// The file path to the specified file. /// The file creation time from the specified file. - public DateTime ReturnFileCreationTime(string FilePath) + public DateTime ReturnFileCreationTime(string filePath) { - return ReturnFileInformation(FilePath).CreationTime; + return ReturnFileInformation(filePath).CreationTime; } /// /// Retrieves the file last write time from the specified file. /// - /// The file path to the specified file. + /// The file path to the specified file. /// The file last write time from the specified file. - public DateTime ReturnFileLastWriteTime(string FilePath) + public DateTime ReturnFileLastWriteTime(string filePath) { - return ReturnFileInformation(FilePath).LastWriteTime; + return ReturnFileInformation(filePath).LastWriteTime; } /// /// Retrieves the file name from the specified file. /// - /// The file path to the specified file. + /// The file path to the specified file. /// The file name from the specified file. - public string ReturnFileName(string FilePath) + public string ReturnFileName(string filePath) { - return ReturnFileInformation(FilePath).Name; + return ReturnFileInformation(filePath).Name; } /// /// Retrieves the file extension from the specified file. /// - /// The file path to the specified file. + /// The file path to the specified file. /// The file extension from the specified file. - public string ReturnFileExtension(string FilePath) + public string ReturnFileExtension(string filePath) { - return ReturnFileInformation(FilePath).Extension; + return ReturnFileInformation(filePath).Extension; } /// /// Retrieves the file information from the specified file. /// - /// The file path to the specified file. + /// The file path to the specified file. /// The file information from the specified file. - public FileInfo ReturnFileInformation(string FilePath) + public FileInfo ReturnFileInformation(string filePath) { - FileInfo fileInformation = new FileInfo(FilePath); + FileInfo fileInformation = new FileInfo(filePath); return fileInformation; } @@ -333,26 +333,26 @@ public FileInfo ReturnFileInformation(string FilePath) /// /// Loads from file. /// - /// The file path. + /// The file path. /// - public string LoadFromFile(string FilePath) + public string LoadFromFile(string filePath) { string fileContent = string.Empty; try { - if (new FileInfo(FilePath).Length == 0) + if (new FileInfo(filePath).Length == 0) { KryptonMessageBox.Show("The file specified is a zero-byte file. Please try again.", "Zero-Byte File Detected", KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon.Error); } else { - fileContent = File.OpenRead(FilePath).ToString(); + fileContent = File.OpenRead(filePath).ToString(); } } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } return fileContent; @@ -361,17 +361,17 @@ public string LoadFromFile(string FilePath) /// /// Determines whether [is file locked] [the specified file]. /// - /// The file. + /// The file. /// /// true if [is file locked] [the specified file]; otherwise, false. /// - protected virtual bool IsFileLocked(FileInfo File) + protected virtual bool IsFileLocked(FileInfo file) { - FileStream fs = null; + FileStream? fs = null; try { - fs = File.Open(FileMode.Open, FileAccess.Read, FileShare.None); + fs = file.Open(FileMode.Open, FileAccess.Read, FileShare.None); } catch (IOException) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/IO/IconExtractor.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/IO/IconExtractor.cs index f879fbef5..72356c6cb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/IO/IconExtractor.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/IO/IconExtractor.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/IO/NetworkUtilities.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/IO/NetworkUtilities.cs index d10a22bee..b6ca3c178 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/IO/NetworkUtilities.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/IO/NetworkUtilities.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -72,11 +72,11 @@ public bool CheckInternetConnectionState(string pingAddress = null) { if (globalMethods.GetIsTargetPlatformSupported()) { - ExceptionCapture.CaptureException(ex, "Exception Thrown", KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon.Error, "NetworkUtilities", "CheckInternetConnectionState(string pingAddress = null)"); + DebugUtilities.NotImplemented(ex.ToString()); } else { - ExceptionCapture.CaptureException(ex); + DebugUtilities.NotImplemented(ex.ToString()); } } @@ -118,11 +118,11 @@ public bool ExistsOnServer(Uri fileLocation) { if (globalMethods.GetIsTargetPlatformSupported()) { - ExceptionCapture.CaptureException(ex, "Exception Thrown", KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon.Error, "NetworkUtilities", "ExistsOnServer(Uri fileLocation)"); + DebugUtilities.NotImplemented(ex.ToString()); } else { - ExceptionCapture.CaptureException(ex, "Exception Thrown", KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon.Error, "NetworkUtilities", "ExistsOnServer(Uri fileLocation)"); + DebugUtilities.NotImplemented(ex.ToString()); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/Security/UACSecurity.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/Security/UACSecurity.cs index 6a59f5857..03a66c966 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/Security/UACSecurity.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/Security/UACSecurity.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -37,7 +37,7 @@ public static class UACSecurity #endregion #region Constants - internal const int BCM_FIRST = 0x1600, BCM_SETSHIELD = (BCM_FIRST + 0x000C); + internal const int BCM_FIRST = 0x1600, BCM_SETSHIELD = BCM_FIRST + 0x000C; #endregion #region Methods diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/Special Effects/FadeEffects.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/Special Effects/FadeEffects.cs index 509ac74db..d966199f4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/Special Effects/FadeEffects.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/Special Effects/FadeEffects.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Globals/GlobalDeclarations.cs index feaa11403..fc2abd6d7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Globals/GlobalDeclarations.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -46,6 +46,6 @@ global using System.Text.RegularExpressions; global using System.Windows.Forms; -global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; +global using Krypton.Toolkit.Suite.Extended.Debug.Tools; global using Microsoft.Win32; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Krypton.Toolkit.Suite.Extended.Global.Utilities 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Krypton.Toolkit.Suite.Extended.Global.Utilities 2022.csproj index c76a6c2f1..0b1b923bd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Krypton.Toolkit.Suite.Extended.Global.Utilities 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Krypton.Toolkit.Suite.Extended.Global.Utilities 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -70,9 +58,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements global utilities that are used by the extended toolkit. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements global utilities that are used by the extended toolkit. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -80,74 +68,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + @@ -161,6 +111,7 @@ + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Krypton.Toolkit.Suite.Extended.Global.Utilities.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Krypton.Toolkit.Suite.Extended.Global.Utilities.licenseheader index c890e86c0..a0e5e0a62 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Krypton.Toolkit.Suite.Extended.Global.Utilities.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Krypton.Toolkit.Suite.Extended.Global.Utilities.licenseheader @@ -4,7 +4,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Classes/MRU/MostRecentlyUsedFileManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Classes/MRU/MostRecentlyUsedFileManager.cs index 97ccc092f..373cdb8fa 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Classes/MRU/MostRecentlyUsedFileManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Classes/MRU/MostRecentlyUsedFileManager.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,7 +25,7 @@ */ #endregion -using Krypton.Toolkit.Suite.Extended.Developer.Utilities; +using DebugUtilities = Krypton.Toolkit.Suite.Extended.Debug.Tools.DebugUtilities; using Microsoft.Win32; @@ -118,7 +118,7 @@ private void OnClearRecentFiles_Click(object sender, EventArgs e) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } if (OnClearRecentFilesClick != null) @@ -131,7 +131,7 @@ private void RefreshRecentFilesMenu() { RegistryKey key; - string value; + string? value; ToolStripItem item; @@ -148,7 +148,7 @@ private void RefreshRecentFilesMenu() } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); return; } @@ -197,7 +197,7 @@ public static void StaticAddRecentFile(string fileNameWithFullPath) try { - RegistryKey key = Registry.CurrentUser.CreateSubKey(manager._subKeyName, RegistryKeyPermissionCheck.ReadWriteSubTree); + RegistryKey? key = Registry.CurrentUser.CreateSubKey(manager._subKeyName, RegistryKeyPermissionCheck.ReadWriteSubTree); for (int i = 0; true; i++) { @@ -221,7 +221,7 @@ public static void StaticAddRecentFile(string fileNameWithFullPath) } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } manager.RefreshRecentFilesMenu(); @@ -259,7 +259,7 @@ public void AddRecentFile(string fileNameWithFullPath) } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } RefreshRecentFilesMenu(); @@ -279,7 +279,7 @@ public static void StaticRemoveRecentFile(string fileNameWithFullPath) foreach (string valueName in valueNames) { - if ((key.GetValue(valueName, null) as string) == fileNameWithFullPath) + if (key.GetValue(valueName, null) as string == fileNameWithFullPath) { key.DeleteValue(valueName); @@ -291,7 +291,7 @@ public static void StaticRemoveRecentFile(string fileNameWithFullPath) } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } manager.RefreshRecentFilesMenu(); @@ -307,7 +307,7 @@ public void RemoveRecentFile(string fileNameWithFullPath) foreach (string keyValue in keyValues) { - if ((key.GetValue(keyValue, null) as string) == fileNameWithFullPath) + if (key.GetValue(keyValue, null) as string == fileNameWithFullPath) { key.DeleteValue(keyValue); @@ -319,7 +319,7 @@ public void RemoveRecentFile(string fileNameWithFullPath) } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } RefreshRecentFilesMenu(); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Controls Toolkit/Components/KryptonFileListBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Controls Toolkit/Components/KryptonFileListBox.cs index c62715a9a..1d1e10a91 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Controls Toolkit/Components/KryptonFileListBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Controls Toolkit/Components/KryptonFileListBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Controls Toolkit/Components/KryptonFileSystemTreeView.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Controls Toolkit/Components/KryptonFileSystemTreeView.cs index 2229d899a..b523eecbc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Controls Toolkit/Components/KryptonFileSystemTreeView.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Controls Toolkit/Components/KryptonFileSystemTreeView.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Enumerations/IconSize.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Enumerations/IconSize.cs index 853c34d27..fabf7cbc3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Enumerations/IconSize.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Enumerations/IconSize.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Events/FileSelectEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Events/FileSelectEventArgs.cs index 0dbeea8bc..15de6798f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Events/FileSelectEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Events/FileSelectEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Globals/GlobalDeclarations.cs index c8bf7f66d..377429840 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Krypton.Toolkit.Suite.Extended.IO 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Krypton.Toolkit.Suite.Extended.IO 2022.csproj index 0988c98f1..8add2ef04 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Krypton.Toolkit.Suite.Extended.IO 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Krypton.Toolkit.Suite.Extended.IO 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements IO controls and features. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements IO controls and features. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,79 +69,42 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Krypton.Toolkit.Suite.Extended.IO.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Krypton.Toolkit.Suite.Extended.IO.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Krypton.Toolkit.Suite.Extended.IO.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Krypton.Toolkit.Suite.Extended.IO.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/UX/KryptonSystemInformation.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/UX/KryptonSystemInformation.cs index fcc084d82..9b31eb327 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/UX/KryptonSystemInformation.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/UX/KryptonSystemInformation.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Components/KryptonInputBoxExtendedAlternateManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Components/KryptonInputBoxExtendedAlternateManager.cs index 1a636888a..840534bed 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Components/KryptonInputBoxExtendedAlternateManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Components/KryptonInputBoxExtendedAlternateManager.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Components/KryptonInputBoxExtendedManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Components/KryptonInputBoxExtendedManager.cs index 830dd7fe8..d58f6c823 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Components/KryptonInputBoxExtendedManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Components/KryptonInputBoxExtendedManager.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Toolkit/InternalKryptonBorderedLabel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Toolkit/InternalKryptonBorderedLabel.cs index f224faf24..df0d45655 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Toolkit/InternalKryptonBorderedLabel.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Toolkit/InternalKryptonBorderedLabel.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedAlternateForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedAlternateForm.cs index 6b47079c0..ba8deb8ee 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedAlternateForm.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedAlternateForm.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedForm.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedForm.Designer.cs index 039b7c937..b2c217c8a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedForm.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedForm.Designer.cs @@ -128,7 +128,6 @@ private void InitializeComponent() // // kcmbResponse // - this.kcmbResponse.CornerRoundingRadius = -1F; this.kcmbResponse.CueHint.Padding = new System.Windows.Forms.Padding(0); this.kcmbResponse.Dock = System.Windows.Forms.DockStyle.Fill; this.kcmbResponse.DropDownWidth = 344; @@ -141,7 +140,6 @@ private void InitializeComponent() // // kdtpResponse // - this.kdtpResponse.CornerRoundingRadius = -1F; this.kdtpResponse.Dock = System.Windows.Forms.DockStyle.Fill; this.kdtpResponse.Location = new System.Drawing.Point(0, 0); this.kdtpResponse.Name = "kdtpResponse"; @@ -150,7 +148,6 @@ private void InitializeComponent() // // kdudResponse // - this.kdudResponse.CornerRoundingRadius = -1F; this.kdudResponse.Dock = System.Windows.Forms.DockStyle.Fill; this.kdudResponse.Location = new System.Drawing.Point(0, 0); this.kdudResponse.Name = "kdudResponse"; @@ -221,7 +218,6 @@ private void InitializeComponent() // this.kbtnButtonThree.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.kbtnButtonThree.AutoSize = true; - this.kbtnButtonThree.CornerRoundingRadius = -1F; this.kbtnButtonThree.Location = new System.Drawing.Point(280, 1); this.kbtnButtonThree.MinimumSize = new System.Drawing.Size(50, 26); this.kbtnButtonThree.Name = "kbtnButtonThree"; @@ -233,7 +229,6 @@ private void InitializeComponent() // this.kbtnButtonTwo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.kbtnButtonTwo.AutoSize = true; - this.kbtnButtonTwo.CornerRoundingRadius = -1F; this.kbtnButtonTwo.Location = new System.Drawing.Point(219, 1); this.kbtnButtonTwo.MinimumSize = new System.Drawing.Size(50, 26); this.kbtnButtonTwo.Name = "kbtnButtonTwo"; @@ -245,7 +240,6 @@ private void InitializeComponent() // this.kbtnInputBoxActionButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.kbtnInputBoxActionButton.AutoSize = true; - this.kbtnInputBoxActionButton.CornerRoundingRadius = -1F; this.kbtnInputBoxActionButton.Location = new System.Drawing.Point(9, 1); this.kbtnInputBoxActionButton.Name = "kbtnInputBoxActionButton"; this.kbtnInputBoxActionButton.Size = new System.Drawing.Size(90, 25); @@ -257,7 +251,6 @@ private void InitializeComponent() // this.kbtnButtonOne.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.kbtnButtonOne.AutoSize = true; - this.kbtnButtonOne.CornerRoundingRadius = -1F; this.kbtnButtonOne.Location = new System.Drawing.Point(158, 1); this.kbtnButtonOne.MinimumSize = new System.Drawing.Size(50, 26); this.kbtnButtonOne.Name = "kbtnButtonOne"; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedForm.cs index decd088a1..ef216e260 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedForm.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedForm.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -407,7 +407,7 @@ private void UpdateIcon(InputBoxIconType iconType, Image customImage = null) pbxIcon.Image = Properties.Resources.Stop_Information_Box; break; case InputBoxIconType.Shield: - if (OSUtilities.IsWindowsEleven) + if (OSUtilities.IsAtLeastWindowsEleven) { pbxIcon.Image = Properties.Resources.UAC_Shield_Windows_11_Information_Box; } @@ -421,7 +421,7 @@ private void UpdateIcon(InputBoxIconType iconType, Image customImage = null) } break; case InputBoxIconType.WindowsLogo: - if (OSUtilities.IsWindowsEleven) + if (OSUtilities.IsAtLeastWindowsEleven) { pbxIcon.Image = Properties.Resources.Windows11_Information_Box; } @@ -457,7 +457,7 @@ private void UpdateButtons(InputBoxButtons buttons, InputBoxButtonFocus buttonFo kbtnButtonTwo.DialogResult = DialogResult.None; - kbtnButtonThree.Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + kbtnButtonThree.Text = KryptonManager.Strings.GeneralStrings.OK; kbtnButtonThree.DialogResult = DialogResult.OK; @@ -470,11 +470,11 @@ private void UpdateButtons(InputBoxButtons buttons, InputBoxButtonFocus buttonFo kbtnButtonOne.DialogResult = DialogResult.None; - kbtnButtonTwo.Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + kbtnButtonTwo.Text = KryptonManager.Strings.GeneralStrings.OK; kbtnButtonTwo.DialogResult = DialogResult.OK; - kbtnButtonThree.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel; + kbtnButtonThree.Text = KryptonManager.Strings.GeneralStrings.Cancel; kbtnButtonThree.DialogResult = DialogResult.Cancel; @@ -487,11 +487,11 @@ private void UpdateButtons(InputBoxButtons buttons, InputBoxButtonFocus buttonFo kbtnButtonOne.DialogResult = DialogResult.None; - kbtnButtonTwo.Text = KryptonLanguageManager.GeneralToolkitStrings.Yes; + kbtnButtonTwo.Text = KryptonManager.Strings.GeneralStrings.Yes; kbtnButtonTwo.DialogResult = DialogResult.Yes; - kbtnButtonThree.Text = KryptonLanguageManager.GeneralToolkitStrings.No; + kbtnButtonThree.Text = KryptonManager.Strings.GeneralStrings.No; kbtnButtonThree.DialogResult = DialogResult.No; @@ -500,15 +500,15 @@ private void UpdateButtons(InputBoxButtons buttons, InputBoxButtonFocus buttonFo CancelButton = kbtnButtonThree; break; case InputBoxButtons.YesNoCancel: - kbtnButtonOne.Text = KryptonLanguageManager.GeneralToolkitStrings.Yes; + kbtnButtonOne.Text = KryptonManager.Strings.GeneralStrings.Yes; kbtnButtonOne.DialogResult = DialogResult.Yes; - kbtnButtonTwo.Text = KryptonLanguageManager.GeneralToolkitStrings.No; + kbtnButtonTwo.Text = KryptonManager.Strings.GeneralStrings.No; kbtnButtonTwo.DialogResult = DialogResult.No; - kbtnButtonThree.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel; + kbtnButtonThree.Text = KryptonManager.Strings.GeneralStrings.Cancel; kbtnButtonThree.DialogResult = DialogResult.Cancel; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedFormTest.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedFormTest.Designer.cs index 9da4e3ca2..ff67019a8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedFormTest.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedFormTest.Designer.cs @@ -130,7 +130,6 @@ private void InitializeComponent() // // kcmbResponse // - this.kcmbResponse.CornerRoundingRadius = -1F; this.kcmbResponse.CueHint.Padding = new System.Windows.Forms.Padding(0); this.kcmbResponse.Dock = System.Windows.Forms.DockStyle.Fill; this.kcmbResponse.DropDownWidth = 344; @@ -177,7 +176,6 @@ private void InitializeComponent() // // kdtpResponse // - this.kdtpResponse.CornerRoundingRadius = -1F; this.kdtpResponse.Dock = System.Windows.Forms.DockStyle.Fill; this.kdtpResponse.Location = new System.Drawing.Point(0, 0); this.kdtpResponse.Name = "kdtpResponse"; @@ -215,7 +213,6 @@ private void InitializeComponent() // this.kbtnInputBoxButtonOne.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.kbtnInputBoxButtonOne.AutoSize = true; - this.kbtnInputBoxButtonOne.CornerRoundingRadius = -1F; this.kbtnInputBoxButtonOne.Enabled = false; this.kbtnInputBoxButtonOne.Location = new System.Drawing.Point(145, 0); this.kbtnInputBoxButtonOne.Margin = new System.Windows.Forms.Padding(0, 0, 0, 8); @@ -230,7 +227,6 @@ private void InitializeComponent() // this.kbtnInputBoxButtonTwo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.kbtnInputBoxButtonTwo.AutoSize = true; - this.kbtnInputBoxButtonTwo.CornerRoundingRadius = -1F; this.kbtnInputBoxButtonTwo.DialogResult = System.Windows.Forms.DialogResult.OK; this.kbtnInputBoxButtonTwo.Location = new System.Drawing.Point(213, 0); this.kbtnInputBoxButtonTwo.Margin = new System.Windows.Forms.Padding(0, 0, 0, 8); @@ -244,7 +240,6 @@ private void InitializeComponent() // this.kbtnInputBoxButtonThree.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.kbtnInputBoxButtonThree.AutoSize = true; - this.kbtnInputBoxButtonThree.CornerRoundingRadius = -1F; this.kbtnInputBoxButtonThree.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kbtnInputBoxButtonThree.Location = new System.Drawing.Point(285, 0); this.kbtnInputBoxButtonThree.Margin = new System.Windows.Forms.Padding(0); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedFormTest.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedFormTest.cs index 1fa8ccb92..e2bcf299e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedFormTest.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Controls Visuals/KryptonInputBoxExtendedFormTest.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -371,7 +371,7 @@ private void UpdateButtons(InputBoxButtons buttons, InputBoxButtonFocus buttonFo kbtnInputBoxButtonTwo.DialogResult = DialogResult.None; - kbtnInputBoxButtonThree.Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + kbtnInputBoxButtonThree.Text = KryptonManager.Strings.GeneralStrings.OK; kbtnInputBoxButtonThree.DialogResult = DialogResult.OK; @@ -384,11 +384,11 @@ private void UpdateButtons(InputBoxButtons buttons, InputBoxButtonFocus buttonFo kbtnInputBoxButtonOne.DialogResult = DialogResult.None; - kbtnInputBoxButtonTwo.Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + kbtnInputBoxButtonTwo.Text = KryptonManager.Strings.GeneralStrings.OK; kbtnInputBoxButtonTwo.DialogResult = DialogResult.OK; - kbtnInputBoxButtonThree.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel; + kbtnInputBoxButtonThree.Text = KryptonManager.Strings.GeneralStrings.Cancel; kbtnInputBoxButtonThree.DialogResult = DialogResult.Cancel; @@ -401,11 +401,11 @@ private void UpdateButtons(InputBoxButtons buttons, InputBoxButtonFocus buttonFo kbtnInputBoxButtonOne.DialogResult = DialogResult.None; - kbtnInputBoxButtonTwo.Text = KryptonLanguageManager.GeneralToolkitStrings.Yes; + kbtnInputBoxButtonTwo.Text = KryptonManager.Strings.GeneralStrings.Yes; kbtnInputBoxButtonTwo.DialogResult = DialogResult.Yes; - kbtnInputBoxButtonThree.Text = KryptonLanguageManager.GeneralToolkitStrings.No; + kbtnInputBoxButtonThree.Text = KryptonManager.Strings.GeneralStrings.No; kbtnInputBoxButtonThree.DialogResult = DialogResult.No; @@ -414,15 +414,15 @@ private void UpdateButtons(InputBoxButtons buttons, InputBoxButtonFocus buttonFo CancelButton = kbtnInputBoxButtonThree; break; case InputBoxButtons.YesNoCancel: - kbtnInputBoxButtonOne.Text = KryptonLanguageManager.GeneralToolkitStrings.Yes; + kbtnInputBoxButtonOne.Text = KryptonManager.Strings.GeneralStrings.Yes; kbtnInputBoxButtonOne.DialogResult = DialogResult.Yes; - kbtnInputBoxButtonTwo.Text = KryptonLanguageManager.GeneralToolkitStrings.No; + kbtnInputBoxButtonTwo.Text = KryptonManager.Strings.GeneralStrings.No; kbtnInputBoxButtonTwo.DialogResult = DialogResult.No; - kbtnInputBoxButtonThree.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel; + kbtnInputBoxButtonThree.Text = KryptonManager.Strings.GeneralStrings.Cancel; kbtnInputBoxButtonThree.DialogResult = DialogResult.Cancel; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Enumerations/InputBoxIconType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Enumerations/InputBoxIconType.cs index 38e457210..1f2fbf975 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Enumerations/InputBoxIconType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Enumerations/InputBoxIconType.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Enumerations/KryptonInputBoxResponseType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Enumerations/KryptonInputBoxResponseType.cs index 873b4d3e9..38350e6bc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Enumerations/KryptonInputBoxResponseType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Enumerations/KryptonInputBoxResponseType.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Globals/GlobalDeclarations.cs index 4c8bb9ef5..c50693530 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Krypton.Toolkit.Suite.Extended.InputBox 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Krypton.Toolkit.Suite.Extended.InputBox 2022.csproj index 0c822092c..f955516db 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Krypton.Toolkit.Suite.Extended.InputBox 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Krypton.Toolkit.Suite.Extended.InputBox 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements a input box dialog. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements a input box dialog. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,74 +69,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Classes/ButtonLanguageController.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Classes/ButtonLanguageController.cs index 1c4e61c08..e47d66f02 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Classes/ButtonLanguageController.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Classes/ButtonLanguageController.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,6 +26,8 @@ */ #endregion +using DebugUtilities = Krypton.Toolkit.Suite.Extended.Debug.Tools.DebugUtilities; + namespace Krypton.Toolkit.Suite.Extended.Language.Model { public class ButtonLanguageController @@ -352,7 +354,7 @@ public static void AdaptButtonText(SelectedLanguage language, DialogButtonType t } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Enumerations/DialogButtonType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Enumerations/DialogButtonType.cs index e2b2d9575..598e9c20e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Enumerations/DialogButtonType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Enumerations/DialogButtonType.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Enumerations/DialogButtonsType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Enumerations/DialogButtonsType.cs index 6088cf3b6..f9e7a15c8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Enumerations/DialogButtonsType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Enumerations/DialogButtonsType.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Enumerations/SelectedLanguage.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Enumerations/SelectedLanguage.cs index 26542c1ba..62ded7c3c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Enumerations/SelectedLanguage.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Enumerations/SelectedLanguage.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Globals/GlobalDeclarations.cs index 3df4d0f80..cfe607371 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Globals/GlobalDeclarations.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Krypton.Toolkit.Suite.Extended.Language.Model 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Krypton.Toolkit.Suite.Extended.Language.Model 2022.csproj index 29618db6c..616819ce1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Krypton.Toolkit.Suite.Extended.Language.Model 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Krypton.Toolkit.Suite.Extended.Language.Model 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -70,9 +58,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements language options for certain Krypton button controls. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements language options for certain Krypton button controls. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -80,74 +68,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + @@ -161,6 +111,7 @@ + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Krypton.Toolkit.Suite.Extended.Language.Model.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Krypton.Toolkit.Suite.Extended.Language.Model.licenseheader index c890e86c0..a0e5e0a62 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Krypton.Toolkit.Suite.Extended.Language.Model.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Krypton.Toolkit.Suite.Extended.Language.Model.licenseheader @@ -4,7 +4,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Enumerations/KryptonMemoryBoxDefaultButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Enumerations/KryptonMemoryBoxDefaultButton.cs index 0f4abeb6a..1b8a30bef 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Enumerations/KryptonMemoryBoxDefaultButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Enumerations/KryptonMemoryBoxDefaultButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Enumerations/KryptonMemoryBoxDialogResult.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Enumerations/KryptonMemoryBoxDialogResult.cs index 4b6a50b8f..570b1e4bf 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Enumerations/KryptonMemoryBoxDialogResult.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Enumerations/KryptonMemoryBoxDialogResult.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Enumerations/KryptonMemoryBoxIcon.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Enumerations/KryptonMemoryBoxIcon.cs index 276275b5a..d63a14fbf 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Enumerations/KryptonMemoryBoxIcon.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Enumerations/KryptonMemoryBoxIcon.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Globals/GlobalDeclarations.cs index 345c88043..d9e3d5641 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Krypton.Toolkit.Suite.Extended.Memory.Box 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Krypton.Toolkit.Suite.Extended.Memory.Box 2022.csproj index 0f50f7f03..0e79cd3cc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Krypton.Toolkit.Suite.Extended.Memory.Box 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Krypton.Toolkit.Suite.Extended.Memory.Box 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements a memory box dialog. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements a memory box dialog. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,74 +69,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Krypton.Toolkit.Suite.Extended.Memory.Box.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Krypton.Toolkit.Suite.Extended.Memory.Box.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Krypton.Toolkit.Suite.Extended.Memory.Box.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Krypton.Toolkit.Suite.Extended.Memory.Box.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/UX/KryptonMemoryBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/UX/KryptonMemoryBox.cs index f16b17522..d2b4bd562 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/UX/KryptonMemoryBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/UX/KryptonMemoryBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -60,15 +60,15 @@ public KryptonMemoryBox() private void SetupButtonText() { - kbtnButtonOne.Text = KryptonLanguageManager.GeneralToolkitStrings.Yes; + kbtnButtonOne.Text = KryptonManager.Strings.GeneralStrings.Yes; - kbtnButtonTwo.Text = KryptonLanguageManager.CustomToolkitStrings.YesToAll; + kbtnButtonTwo.Text = KryptonManager.Strings.CustomStrings.YesToAll; - kbtnButtonThree.Text = KryptonLanguageManager.GeneralToolkitStrings.No; + kbtnButtonThree.Text = KryptonManager.Strings.GeneralStrings.No; - kbtnButtonFour.Text = KryptonLanguageManager.CustomToolkitStrings.NoToAll; + kbtnButtonFour.Text = KryptonManager.Strings.CustomStrings.NoToAll; - kbtnButtonFive.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel; + kbtnButtonFive.Text = KryptonManager.Strings.GeneralStrings.Cancel; } /// Sets the default dialog result. @@ -398,10 +398,10 @@ private Size UpdateButtonsSizing() kbtnButtonOne.Size = maximumButtonSize; // Size the panel for the buttons - kpnlButtons.Size = new Size((maximumButtonSize.Width * numberOfButtons) + (GAP * (numberOfButtons + 1)), maximumButtonSize.Height + (GAP * 2)); + kpnlButtons.Size = new Size(maximumButtonSize.Width * numberOfButtons + GAP * (numberOfButtons + 1), maximumButtonSize.Height + GAP * 2); // Button area is the number of buttons with gaps between them and 10 pixels around all edges - return new Size((maximumButtonSize.Width * numberOfButtons) + (GAP * (numberOfButtons + 1)), maximumButtonSize.Height + (GAP * 2)); + return new Size(maximumButtonSize.Width * numberOfButtons + GAP * (numberOfButtons + 1), maximumButtonSize.Height + GAP * 2); } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Controls Visuals/VisualMessageDialogForm.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Controls Visuals/VisualMessageDialogForm.Designer.cs new file mode 100644 index 000000000..de50774b9 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Controls Visuals/VisualMessageDialogForm.Designer.cs @@ -0,0 +1,39 @@ +namespace Krypton.Toolkit.Suite.Extended.MessageDialog +{ + partial class VisualMessageDialogForm + { + /// + /// 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.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Text = "VisualMessageDialogForm"; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Controls Visuals/VisualMessageDialogForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Controls Visuals/VisualMessageDialogForm.cs new file mode 100644 index 000000000..28c2a6475 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Controls Visuals/VisualMessageDialogForm.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Krypton.Toolkit.Suite.Extended.MessageDialog +{ + public partial class VisualMessageDialogForm : Form + { + public VisualMessageDialogForm() + { + InitializeComponent(); + } + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Controls Visuals/VisualMessageDialogRtlAwareForm.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Controls Visuals/VisualMessageDialogRtlAwareForm.Designer.cs new file mode 100644 index 000000000..c12872d1c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Controls Visuals/VisualMessageDialogRtlAwareForm.Designer.cs @@ -0,0 +1,39 @@ +namespace Krypton.Toolkit.Suite.Extended.MessageDialog +{ + partial class VisualMessageDialogRtlAwareForm + { + /// + /// 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.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Text = "VisualMessageDialogRtlAwareForm"; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Controls Visuals/VisualMessageDialogRtlAwareForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Controls Visuals/VisualMessageDialogRtlAwareForm.cs new file mode 100644 index 000000000..01c413fae --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Controls Visuals/VisualMessageDialogRtlAwareForm.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Krypton.Toolkit.Suite.Extended.MessageDialog +{ + public partial class VisualMessageDialogRtlAwareForm : Form + { + public VisualMessageDialogRtlAwareForm() + { + InitializeComponent(); + } + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Krypton.Toolkit.Suite.Extended.MessageDialog.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Krypton.Toolkit.Suite.Extended.MessageDialog.csproj new file mode 100644 index 000000000..f2beae859 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Krypton.Toolkit.Suite.Extended.MessageDialog.csproj @@ -0,0 +1,146 @@ + + + + + + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows + + + + + + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows + + + + + + library + Krypton.Toolkit.Suite.Extended.MessageDialog + Krypton.Toolkit.Suite.Extended.MessageDialog + + false + True + StrongKrypton.snk + true + en + Debug;Release;Nightly;Canary + preview + enable + 6 + true + + + + + + + Krypton.Toolkit.Suite.Extended.MessageDialog.Canary + + + + + + Krypton.Toolkit.Suite.Extended.MessageDialog.Nightly + + + + + + Krypton.Toolkit.Suite.Extended.MessageDialog + + + + + Krypton.Toolkit.Suite.Extended.MessageDialog + + + + + + + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements the KryptonMessageDialog, which is similar to a KryptonMessageBox, but adds additional functionality. + + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. + Also, all libraries are included targeting each specific framework version for performance purposes. + + To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.MessageDialog\Krypton.Toolkit.Suite.Extended.MessageDialog.xml + ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.MessageDialog\ + enable + + + + + + true + + + + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Krypton.Toolkit.Suite.Extended.MessageDialog.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Krypton.Toolkit.Suite.Extended.MessageDialog.licenseheader new file mode 100644 index 000000000..0709f698a --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Krypton.Toolkit.Suite.Extended.MessageDialog.licenseheader @@ -0,0 +1,27 @@ +extensions: .cs +#region MIT License +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/StrongKrypton.snk b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/StrongKrypton.snk similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/StrongKrypton.snk rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/StrongKrypton.snk diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Classes/Developer Test/KryptonMessageBoxExtendedDeveloperTest.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Classes/Developer Test/KryptonMessageBoxExtendedDeveloperTest.cs index 74aa95938..1e2e8872c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Classes/Developer Test/KryptonMessageBoxExtendedDeveloperTest.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Classes/Developer Test/KryptonMessageBoxExtendedDeveloperTest.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -335,28 +335,28 @@ private static IWin32Window ValidateOptions(IWin32Window owner, MessageBoxOption { // 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)) + (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)) + 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)) + 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 (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(PlatformInvoke.GetActiveWindow()); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Classes/HelpInfo.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Classes/HelpInfo.cs index 9f380e10e..b834cf233 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Classes/HelpInfo.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Classes/HelpInfo.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -27,7 +27,7 @@ namespace Krypton.Toolkit.Suite.Extended.Messagebox { - internal class HelpInfo + public class HelpInfo { #region Instance Fields @@ -65,12 +65,12 @@ public HelpInfo(string helpFilePath, HelpNavigator navigator, object? param = nu /// Value for Navigator /// Value for Keyword /// - private HelpInfo(string helpFilePath, string keyword, HelpNavigator navigator, object param) + private HelpInfo(string? helpFilePath, string? keyword, HelpNavigator navigator, object? param) { - HelpFilePath = helpFilePath; - Keyword = keyword; + HelpFilePath = helpFilePath ?? string.Empty; + Keyword = keyword ?? string.Empty; Navigator = navigator; - Param = param; + Param = param ?? string.Empty; } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Classes/InternalKryptonMessageBoxExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Classes/InternalKryptonMessageBoxExtended.cs index cb87c1ff7..26f6e815c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Classes/InternalKryptonMessageBoxExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Classes/InternalKryptonMessageBoxExtended.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/InternalKryptonButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/InternalKryptonButton.cs index 864c54e4b..8fc21bf88 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/InternalKryptonButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/InternalKryptonButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -38,7 +38,7 @@ internal class InternalKryptonButton : VisualSimpleBase, IButtonControl, IConten private readonly PaletteTripleOverride _overrideNormal; private readonly PaletteTripleOverride _overrideTracking; private readonly PaletteTripleOverride _overridePressed; - private IKryptonCommand _command; + private IKryptonCommand? _command; private bool _useAsDialogButton, _isDefault, _useMnemonic, _wasEnabled, _useAsUACElevationButton; #endregion @@ -70,7 +70,7 @@ public InternalKryptonButton() // Create content storage Values = CreateButtonValues(NeedPaintDelegate); - Values.TextChanged += OnButtonTextChanged; + Values.TextChanged += OnButtonTextChanged!; // Create the palette storage StateCommon = new PaletteTripleRedirect(Redirector, PaletteBackStyle.ButtonStandalone, PaletteBorderStyle.ButtonStandalone, PaletteContentStyle.ButtonStandalone, NeedPaintDelegate); @@ -111,8 +111,8 @@ public InternalKryptonButton() _drawButton.SourceController = _buttonController; // Need to know when user clicks the button view or mouse selects it - _buttonController.Click += OnButtonClick; - _buttonController.MouseSelect += OnButtonSelect; + _buttonController.Click += OnButtonClick!; + _buttonController.MouseSelect += OnButtonSelect!; // Create the view manager instance ViewManager = new ViewManager(this, _drawButton); @@ -120,24 +120,10 @@ public InternalKryptonButton() _useAsDialogButton = false; _useAsUACElevationButton = false; - - // Set `CornerRoundingRadius' to 'GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE' (-1) - 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(-1)] - public float CornerRoundingRadius - { - get => StateCommon.Border.Rounding; - - set => StateCommon.Border.Rounding = value; - } /// /// Gets and sets the automatic resize of the control to fit contents. @@ -174,7 +160,7 @@ public override string Text { get => Values.Text; - set => Values.Text = value; + set => Values.Text = value!; } private bool ShouldSerializeText() => @@ -353,7 +339,7 @@ public bool UseAsUACElevationButton [Category(@"Behavior")] [Description(@"Command associated with the button.")] [DefaultValue(null)] - public virtual IKryptonCommand KryptonCommand + public virtual IKryptonCommand? KryptonCommand { get => _command; @@ -393,7 +379,7 @@ public virtual IKryptonCommand KryptonCommand /// true if the control should behave as a default button; otherwise false. public void NotifyDefault(bool value) { - if (!ViewDrawButton.IsFixed && (_isDefault != value)) + if (!ViewDrawButton.IsFixed && _isDefault != value) { // Remember new default status _isDefault = value; @@ -488,7 +474,7 @@ public virtual void SetFixedState(PaletteState state) /// /// The state for which the image is needed. /// Image value. - public Image GetImage(PaletteState state) => KryptonCommand?.ImageSmall ?? Values.GetImage(state); + public Image? GetImage(PaletteState state) => KryptonCommand?.ImageSmall ?? Values.GetImage(state); /// /// Gets the image colour that should be transparent. @@ -572,7 +558,7 @@ 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) @@ -585,11 +571,11 @@ protected override void OnClick(EventArgs e) catch (InvalidEnumArgumentException) { // Is it https://github.com/Krypton-Suite/Standard-Toolkit/issues/728 - if (owner is KryptonMessageBoxExtendedForm) + if (owner is VisualMessageBoxExtendedForm) { // need to gain access to `dialogResult` and set it forcefully - FieldInfo fi = typeof(Form).GetField("dialogResult", BindingFlags.NonPublic | BindingFlags.Instance); - fi.SetValue(owner, DialogResult); + FieldInfo? fi = typeof(Form).GetField("dialogResult", BindingFlags.NonPublic | BindingFlags.Instance); + fi?.SetValue(owner, DialogResult); } else { @@ -650,43 +636,43 @@ 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 (DialogResult == DialogResult.Abort) { - Text = KryptonLanguageManager.GeneralToolkitStrings.Abort; + Text = KryptonManager.Strings.GeneralStrings.Abort; } if (DialogResult == DialogResult.Cancel) { - Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel; + Text = KryptonManager.Strings.GeneralStrings.Cancel; } if (DialogResult == DialogResult.OK) { - Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + Text = KryptonManager.Strings.GeneralStrings.OK; } if (DialogResult == DialogResult.Yes) { - Text = KryptonLanguageManager.GeneralToolkitStrings.Yes; + Text = KryptonManager.Strings.GeneralStrings.Yes; } if (DialogResult == DialogResult.No) { - Text = KryptonLanguageManager.GeneralToolkitStrings.No; + Text = KryptonManager.Strings.GeneralStrings.No; } if (DialogResult == DialogResult.Retry) { - Text = KryptonLanguageManager.GeneralToolkitStrings.Retry; + Text = KryptonManager.Strings.GeneralStrings.Retry; } if (DialogResult == DialogResult.Ignore) { - Text = KryptonLanguageManager.GeneralToolkitStrings.Ignore; + Text = KryptonManager.Strings.GeneralStrings.Ignore; } } @@ -742,7 +728,7 @@ protected virtual void OnCommandPropertyChanged(object sender, PropertyChangedEv switch (e.PropertyName) { case @"Enabled": - Enabled = KryptonCommand.Enabled; + Enabled = KryptonCommand!.Enabled; break; case @"Text": case @"ExtraText": @@ -787,7 +773,7 @@ private void ShowUACShield(bool showUACShield) { if (showUACShield) { - Values.Image = GraphicsExtensions.LoadIcon(IconType.Shield, SystemInformation.SmallIconSize).ToBitmap(); + Values.Image = GraphicsExtensions.LoadIcon(IconType.Shield, SystemInformation.SmallIconSize)?.ToBitmap(); Invalidate(); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/KryptonMessageBoxExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/KryptonMessageBoxExtended.cs index 0665f47c8..b83558fa9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/KryptonMessageBoxExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/KryptonMessageBoxExtended.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -40,22 +40,16 @@ public static class KryptonMessageBoxExtended /// The caption. /// The buttons. /// The icon. - /// The show optional CheckBox. - /// The optional CheckBox checked. - /// The optional CheckBox text. /// The show control copy. /// public static DialogResult Show(string message, string caption, ExtendedMessageBoxButtons buttons, - ExtendedKryptonMessageBoxIcon icon, bool? showOptionalCheckBox = null, - bool? optionalCheckBoxChecked = null, string? optionalCheckBoxText = null, - bool? showCtrlCopy = null) + ExtendedKryptonMessageBoxIcon icon, bool? showCtrlCopy = null) => ShowCore(null, message, caption, buttons, icon, KryptonMessageBoxDefaultButton.Button1, 0, null, showCtrlCopy, null, null, null, null, null, null, null, null, null, null, null, null, null, null, ExtendedKryptonMessageBoxMessageContainerType.Normal, null, null, null, null, - ContentAlignment.MiddleLeft, null, showOptionalCheckBox, - optionalCheckBoxChecked, optionalCheckBoxText, - null, null, null, DialogResult.OK); + ContentAlignment.MiddleLeft, null, null, null, null, null, + DialogResult.OK); /// Shows a . /// The text. @@ -64,24 +58,21 @@ public static DialogResult Show(string message, string caption, ExtendedMessageB /// The icon. /// The show control copy. /// Specifies how the message text should be aligned. See for supported values. - /// The show optional CheckBox. - /// The optional CheckBox checked. - /// The optional CheckBox text. /// Use the 'time out' facility, default value is false. /// Specifies the 'time out' time, default is 60. + /// Sets the interval of the 'time out' timer. Default is 1000. /// Specifies the action to trigger, once the has timed out. public static DialogResult Show(string messageText, string caption, ExtendedMessageBoxButtons buttons, - ExtendedKryptonMessageBoxIcon icon, bool? showCtrlCopy = null, - ContentAlignment? messageTextAlignment = null, bool? showOptionalCheckBox = null, - bool? optionalCheckBoxChecked = null, string? optionalCheckBoxText = null, - bool? useTimeOut = false, int? timeOut = 60, DialogResult? timerResult = DialogResult.None) => + ExtendedKryptonMessageBoxIcon icon, bool? showCtrlCopy = null, + ContentAlignment? messageTextAlignment = null, + HorizontalAlignment? messageTextBoxAlignment = null, + bool? useTimeOut = false, int? timeOut = 60, int? timeOutInterval = 1000, + DialogResult? timerResult = DialogResult.None) => ShowCore(null, messageText, caption, buttons, icon, KryptonMessageBoxDefaultButton.Button1, - 0, null, showCtrlCopy, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, ExtendedKryptonMessageBoxMessageContainerType.Normal, - null, null, null, null, - messageTextAlignment, null, - showOptionalCheckBox, optionalCheckBoxChecked, optionalCheckBoxText, - null, useTimeOut, timeOut, timerResult); + 0, null, showCtrlCopy, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, ExtendedKryptonMessageBoxMessageContainerType.Normal, + null, null, null, null, + messageTextAlignment, null, messageTextBoxAlignment, useTimeOut, timeOut, timeOutInterval, timerResult); /// Shows a . /// The text. @@ -97,9 +88,6 @@ public static DialogResult Show(string messageText, string caption, ExtendedMess /// If set to true, then this will launch Windows Explorer and select the file. /// Specifies how the message text should be aligned. See for supported values. /// Specifies how the message text should be aligned, when a is being used. See for supported values. - /// The show optional CheckBox. - /// The optional CheckBox checked. - /// The optional CheckBox text. /// Use the 'time out' facility, default value is false. /// Specifies the 'time out' time, default is 60. /// Specifies the action to trigger, once the has timed out. @@ -113,18 +101,16 @@ public static DialogResult Show(string messageText, string caption, ExtendedMess ProcessStartInfo? linkLaunchArgument = null, bool? openInExplorer = null, ContentAlignment? messageTextAlignment = null, PaletteRelativeAlign? richTextBoxTextAlignment = null, - bool? showOptionalCheckBox = null, - bool? optionalCheckBoxChecked = null, string? optionalCheckBoxText = null, - bool? useTimeOut = false, int? timeOut = 60, + HorizontalAlignment? messageTextBoxAlignment = null, + bool? useTimeOut = false, int? timeOut = 60, int? timeOutInterval = 1000, DialogResult? timerResult = DialogResult.None) => ShowCore(null, messageText, caption, buttons, icon, KryptonMessageBoxDefaultButton.Button1, 0, null, showCtrlCopy, null, null, null, Color.Empty, new[] { Color.Empty, Color.Empty, Color.Empty, Color.Empty }, null, null, null, null, string.Empty, string.Empty, string.Empty, string.Empty, applicationPath, messageContainerType, linkLabelCommand, - contentLinkArea, linkLaunchArgument, openInExplorer, messageTextAlignment, richTextBoxTextAlignment, - showOptionalCheckBox, optionalCheckBoxChecked, optionalCheckBoxText, - null, useTimeOut, timeOut, timerResult); + contentLinkArea, linkLaunchArgument, openInExplorer, messageTextAlignment, richTextBoxTextAlignment, messageTextBoxAlignment, + useTimeOut, timeOut, timeOutInterval, timerResult); /// Shows a . /// The text. @@ -145,10 +131,6 @@ public static DialogResult Show(string messageText, string caption, ExtendedMess /// If set to true, then this will launch Windows Explorer and select the file. /// Specifies how the message text should be aligned. See for supported values. /// Specifies how the message text should be aligned, when a is being used. See for supported values. - /// The show optional CheckBox. - /// The optional CheckBox checked. - /// The optional CheckBox text. - /// Sets the 'ThreeState' ability on the optional CheckBox. /// Use the 'time out' facility, default value is false. /// Specifies the 'time out' time, default is 60. /// Specifies the action to trigger, once the has timed out. @@ -169,11 +151,10 @@ public static DialogResult Show(string messageText, string caption = @"", ContentAlignment? messageTextAlignment = ContentAlignment.MiddleLeft, PaletteRelativeAlign? richTextBoxTextAlignment = null, - bool? showOptionalCheckBox = null, - bool? optionalCheckBoxChecked = null, string? optionalCheckBoxText = null, - bool? useOptionalCheckBoxThreeState = null, + HorizontalAlignment? messageTextBoxAlignment = null, bool? useTimeOut = false, - int? timeOut = 60, DialogResult? timerResult = DialogResult.None) + int? timeOut = 60, int? timeOutInterval = 1000, + DialogResult? timerResult = DialogResult.None) => ShowCore(null, messageText, caption, buttons, icon, defaultButton, options, displayHelpButton ? new HelpInfo() : null, showCtrlCopy, @@ -182,10 +163,8 @@ public static DialogResult Show(string messageText, string caption = @"", null, null, null, null, string.Empty, string.Empty, string.Empty, string.Empty, applicationPath, messageContainerType, linkLabelCommand, contentLinkArea, - linkLaunchArgument, openInExplorer, messageTextAlignment, richTextBoxTextAlignment, - showOptionalCheckBox, optionalCheckBoxChecked, optionalCheckBoxText, - useOptionalCheckBoxThreeState, - useTimeOut, timeOut, timerResult); + linkLaunchArgument, openInExplorer, messageTextAlignment, richTextBoxTextAlignment, messageTextBoxAlignment, + useTimeOut, timeOut, timeOutInterval, timerResult); /// Shows a . /// The text. @@ -204,10 +183,6 @@ public static DialogResult Show(string messageText, string caption = @"", /// If set to true, then this will launch Windows Explorer and select the file. /// Specifies how the message text should be aligned. See for supported values. /// Specifies how the message text should be aligned, when a is being used. See for supported values. - /// The show optional CheckBox. - /// The optional CheckBox checked. - /// The optional CheckBox text. - /// Sets the 'ThreeState' ability on the optional CheckBox. /// Use the 'time out' facility, default value is false. /// Specifies the 'time out' time, default is 60. /// Specifies the action to trigger, once the has timed out. @@ -224,11 +199,9 @@ public static DialogResult Show(string messageText, string caption, ProcessStartInfo? linkLaunchArgument = null, bool? openInExplorer = null, ContentAlignment? messageTextAlignment = null, PaletteRelativeAlign? richTextBoxTextAlignment = null, - bool? showOptionalCheckBox = null, - bool? optionalCheckBoxChecked = null, - string? optionalCheckBoxText = null, - bool? useOptionalCheckBoxThreeState = null, + HorizontalAlignment? messageTextBoxAlignment = null, bool? useTimeOut = false, int? timeOut = 60, + int? timeOutInterval = 1000, DialogResult? timerResult = DialogResult.None) => ShowCore(null, messageText, caption, buttons, icon, defaultButton, options, @@ -238,10 +211,8 @@ public static DialogResult Show(string messageText, string caption, null, null, null, null, string.Empty, string.Empty, string.Empty, string.Empty, applicationPath, messageContainerType, linkLabelCommand, contentLinkArea, linkLaunchArgument, openInExplorer, - messageTextAlignment, richTextBoxTextAlignment, - showOptionalCheckBox, optionalCheckBoxChecked, optionalCheckBoxText, - useOptionalCheckBoxThreeState, - useTimeOut, timeOut, timerResult); + messageTextAlignment, richTextBoxTextAlignment, messageTextBoxAlignment, + useTimeOut, timeOut, timeOutInterval, timerResult); /// Shows a . /// The owner. @@ -263,10 +234,6 @@ public static DialogResult Show(string messageText, string caption, /// If set to true, then this will launch Windows Explorer and select the file. /// Specifies how the message text should be aligned. See for supported values. /// Specifies how the message text should be aligned, when a is being used. See for supported values. - /// The show optional CheckBox. - /// The optional CheckBox checked. - /// The optional CheckBox text. - /// Sets the 'ThreeState' ability on the optional CheckBox. /// Use the 'time out' facility, default value is false. /// Specifies the 'time out' time, default is 60. /// Specifies the action to trigger, once the has timed out. @@ -285,13 +252,10 @@ public static DialogResult Show(IWin32Window owner, string messageText, string c ProcessStartInfo? linkLaunchArgument = null, bool? openInExplorer = null, ContentAlignment? messageTextAlignment = null, PaletteRelativeAlign? richTextBoxTextAlignment = null, - bool? showOptionalCheckBox = null, - bool? optionalCheckBoxChecked = null, - string? optionalCheckBoxText = null, - bool? useOptionalCheckBoxThreeState = null, + HorizontalAlignment? messageTextBoxAlignment = null, bool? useTimeOut = false, - int? timeOut = 60, DialogResult? timerResult = DialogResult.None - ) + int? timeOut = 60, int? timeOutInterval = 1000, + DialogResult? timerResult = DialogResult.None) => ShowCore(owner, messageText, caption, buttons, icon, defaultButton, options, displayHelpButton ? new HelpInfo() : null, showCtrlCopy, @@ -302,10 +266,34 @@ public static DialogResult Show(IWin32Window owner, string messageText, string c string.Empty, string.Empty, string.Empty, applicationPath, messageContainerType, linkLabelCommand, contentLinkArea, linkLaunchArgument, openInExplorer, - messageTextAlignment, richTextBoxTextAlignment, - showOptionalCheckBox, optionalCheckBoxChecked, optionalCheckBoxText, - useOptionalCheckBoxThreeState, - useTimeOut, timeOut, timerResult); + messageTextAlignment, richTextBoxTextAlignment, messageTextBoxAlignment, + useTimeOut, timeOut, timeOutInterval, timerResult); + + public static DialogResult Show(IWin32Window owner, string message, string caption, + ExtendedMessageBoxButtons buttons, ExtendedKryptonMessageBoxIcon icon, + KryptonMessageBoxDefaultButton defaultButton, MessageBoxOptions options, bool? showCtrlCopy = false) => + ShowCore(owner, message, caption, buttons, icon, defaultButton, options, + null, showCtrlCopy, null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, null, + null); + + public static DialogResult Show(string message, string caption, ExtendedMessageBoxButtons buttons, ExtendedKryptonMessageBoxIcon icon, KryptonMessageBoxDefaultButton defaultButton, MessageBoxOptions options, bool? showCtrlCopy = false) => + ShowCore(null, message, caption, buttons, icon, defaultButton, options, + null, showCtrlCopy, null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, null, + null); /// Shows a . /// The owner. @@ -325,10 +313,6 @@ public static DialogResult Show(IWin32Window owner, string messageText, string c /// If set to true, then this will launch Windows Explorer and select the file. /// Specifies how the message text should be aligned. See for supported values. /// Specifies how the message text should be aligned, when a is being used. See for supported values. - /// The show optional CheckBox. - /// The optional CheckBox checked. - /// The optional CheckBox text. - /// Sets the 'ThreeState' ability on the optional CheckBox. /// Use the 'time out' facility, default value is false. /// Specifies the 'time out' time, default is 60. /// Specifies the action to trigger, once the has timed out. @@ -346,12 +330,10 @@ public static DialogResult Show(IWin32Window owner, string messageText, string c ProcessStartInfo? linkLaunchArgument = null, bool? openInExplorer = null, ContentAlignment? messageTextAlignment = null, PaletteRelativeAlign? richTextBoxTextAlignment = null, - bool? showOptionalCheckBox = null, - bool? optionalCheckBoxChecked = null, - string? optionalCheckBoxText = null, - bool? useOptionalCheckBoxThreeState = null, + HorizontalAlignment? messageTextBoxAlignment = null, bool? useTimeOut = false, - int? timeOut = 60, DialogResult? timerResult = DialogResult.None) + int? timeOut = 60, int? timeOutInterval = 1000, + DialogResult? timerResult = DialogResult.None) => ShowCore(owner, messageText, caption, buttons, icon, defaultButton, options, displayHelpButton ? new HelpInfo() : null, showCtrlCopy, @@ -364,10 +346,8 @@ public static DialogResult Show(IWin32Window owner, string messageText, string c messageContainerType, linkLabelCommand, contentLinkArea, linkLaunchArgument, openInExplorer, messageTextAlignment, - richTextBoxTextAlignment, - showOptionalCheckBox, optionalCheckBoxChecked, optionalCheckBoxText, - useOptionalCheckBoxThreeState, - useTimeOut, timeOut, timerResult); + richTextBoxTextAlignment, messageTextBoxAlignment, + useTimeOut, timeOut, timeOutInterval, timerResult); /// Shows a . /// The text. @@ -390,10 +370,6 @@ public static DialogResult Show(IWin32Window owner, string messageText, string c /// If set to true, then this will launch Windows Explorer and select the file. /// Specifies how the message text should be aligned. See for supported values. /// Specifies how the message text should be aligned, when a is being used. See for supported values. - /// The show optional CheckBox. - /// The optional CheckBox checked. - /// The optional CheckBox text. - /// Sets the 'ThreeState' ability on the optional CheckBox. /// Use the 'time out' facility, default value is false. /// Specifies the 'time out' time, default is 60. /// Specifies the action to trigger, once the has timed out. @@ -415,13 +391,10 @@ public static DialogResult Show(string messageText, string caption = @"", ProcessStartInfo? linkLaunchArgument = null, bool? openInExplorer = null, ContentAlignment? messageTextAlignment = null, PaletteRelativeAlign? richTextBoxTextAlignment = null, - bool? showOptionalCheckBox = null, - bool? optionalCheckBoxChecked = null, - string? optionalCheckBoxText = null, - bool? useOptionalCheckBoxThreeState = null, + HorizontalAlignment? messageTextBoxAlignment = null, bool? useTimeOut = false, - int? timeOut = 60, DialogResult? timerResult = DialogResult.None - ) + int? timeOut = 60, int? timeOutInterval = 1000, + DialogResult? timerResult = DialogResult.None) => ShowCore(null, messageText, caption, buttons, icon, defaultButton, options, new HelpInfo(helpFilePath, navigator, param), showCtrlCopy, @@ -432,10 +405,8 @@ public static DialogResult Show(string messageText, string caption = @"", string.Empty, string.Empty, string.Empty, applicationPath, messageContainerType, linkLabelCommand, contentLinkArea, - linkLaunchArgument, openInExplorer, messageTextAlignment, richTextBoxTextAlignment, - showOptionalCheckBox, optionalCheckBoxChecked, optionalCheckBoxText, - useOptionalCheckBoxThreeState, - useTimeOut, timeOut, timerResult); + linkLaunchArgument, openInExplorer, messageTextAlignment, richTextBoxTextAlignment, messageTextBoxAlignment, + useTimeOut, timeOut, timeOutInterval, timerResult); /// Shows a message box. /// The owner. @@ -453,8 +424,8 @@ public static DialogResult Show(string messageText, string caption = @"", /// The message box typeface. /// The custom image icon. /// The show help button. - /// The message text colour. - /// The button text colours. + /// The message text colour. + /// The button text colours. /// The button one custom dialog result. /// The button two custom dialog result. /// The button three custom dialog result. @@ -471,10 +442,6 @@ public static DialogResult Show(string messageText, string caption = @"", /// If set to true, then this will launch Windows Explorer and select the file. /// Specifies how the message text should be aligned. See for supported values. /// Specifies how the message text should be aligned, when a is being used. See for supported values. - /// The show optional CheckBox. - /// The optional CheckBox checked. - /// The optional CheckBox text. - /// Sets the 'ThreeState' ability on the optional CheckBox. /// Use the 'time out' facility, default value is false. /// Specifies the 'time out' time, default is 60. /// Specifies the action to trigger, once the has timed out. @@ -491,8 +458,8 @@ public static DialogResult Show(IWin32Window owner, string messageText, string c Font? messageBoxTypeface = null, Image? customImageIcon = null, bool? showHelpButton = null, - Color? messageTextColour = null, - Color[]? buttonTextColours = null, + Color? messageTextColor = null, + Color[]? buttonTextColors = null, DialogResult? buttonOneCustomDialogResult = null, DialogResult? buttonTwoCustomDialogResult = null, DialogResult? buttonThreeCustomDialogResult = null, @@ -509,36 +476,305 @@ public static DialogResult Show(IWin32Window owner, string messageText, string c bool? openInExplorer = null, ContentAlignment? messageTextAlignment = null, PaletteRelativeAlign? richTextBoxTextAlignment = null, - bool? showOptionalCheckBox = null, - bool? optionalCheckBoxChecked = null, - string? optionalCheckBoxText = null, - bool? useOptionalCheckBoxThreeState = null, + HorizontalAlignment? messageTextBoxAlignment = null, bool? useTimeOut = false, int? timeOut = 60, + int? timeOutInterval = 1000, DialogResult? timerResult = DialogResult.None) => ShowCore(owner, messageText, caption, buttons, icon, defaultButton, options, displayHelpButton ? new HelpInfo(helpFilePath, navigator, param) : null, showCtrlCopy, messageBoxTypeface, customImageIcon, - showHelpButton, messageTextColour, buttonTextColours, buttonOneCustomDialogResult, + showHelpButton, messageTextColor, buttonTextColors, buttonOneCustomDialogResult, buttonTwoCustomDialogResult, buttonThreeCustomDialogResult, buttonFourDialogResult, buttonOneCustomText, buttonTwoCustomText, buttonThreeCustomText, buttonFourCustomText, applicationPath, messageContainerType, linkLabelCommand, contentLinkArea, linkLaunchArgument, openInExplorer, messageTextAlignment, - richTextBoxTextAlignment, - showOptionalCheckBox, optionalCheckBoxChecked, optionalCheckBoxText, - useOptionalCheckBoxThreeState, - useTimeOut, timeOut, timerResult); - - public static bool ReturnCheckBoxCheckedValue() => KryptonMessageBoxExtendedForm.ReturnCheckBoxCheckedValue(); - - public static CheckState ReturnCheckBoxCheckState() => KryptonMessageBoxExtendedForm.ReturnCheckBoxCheckState(); + richTextBoxTextAlignment, messageTextBoxAlignment, + useTimeOut, timeOut, timeOutInterval, timerResult); #endregion #region Implementation + internal static bool ShowCoreWithBoolResult(IWin32Window? owner, string text, string caption, + ExtendedMessageBoxButtons buttons, + ExtendedKryptonMessageBoxIcon icon, + KryptonMessageBoxDefaultButton defaultButton, + MessageBoxOptions options, HelpInfo? helpInfo, + bool? showCtrlCopy, Font? messageBoxTypeface, + Image? customImageIcon, bool? showHelpButton, + Color? messageTextColour, Color[]? buttonTextColours, + DialogResult? buttonOneCustomDialogResult, + DialogResult? buttonTwoCustomDialogResult, + DialogResult? buttonThreeCustomDialogResult, + DialogResult? buttonFourDialogResult, + string? buttonOneCustomText, string? buttonTwoCustomText, + string? buttonThreeCustomText, string? buttonFourCustomText, + string? applicationPath, + ExtendedKryptonMessageBoxMessageContainerType? messageContainerType, + KryptonCommand? linkLabelCommand, + LinkArea? contentLinkArea, + ProcessStartInfo? linkLaunchArgument, + bool? openInExplorer, + ContentAlignment? messageTextAlignment, + PaletteRelativeAlign? richTextBoxTextAlignment, + HorizontalAlignment? messageTextBoxAlignment, + bool? showOptionalCheckBox, + bool? initialDoNotShowAgainCheckBoxChecked, + CheckState? initialDoNotShowAgainCheckBoxCheckState, + string? optionalCheckBoxText, + bool? useOptionalCheckBoxThreeState, + bool? useTimeOut, + int? timeOut, + int? timeOutInterval, + DialogResult? timerResult) + { + IWin32Window? showOwner = ValidateOptions(owner, options, helpInfo); + + if (options == MessageBoxOptions.RightAlign | options == MessageBoxOptions.RtlReading) + { + using var kmbertl = new VisualMessageBoxExtendedRtlAwareForm(showOwner, text, + caption, buttons, + icon, defaultButton, + helpInfo, showCtrlCopy, + messageBoxTypeface, + customImageIcon, showHelpButton, + messageTextColour, + buttonTextColours, + buttonOneCustomDialogResult, + buttonTwoCustomDialogResult, + buttonThreeCustomDialogResult, + buttonFourDialogResult, + buttonOneCustomText, + buttonTwoCustomText, + buttonThreeCustomText, + buttonFourCustomText, + applicationPath, + messageContainerType, + linkLabelCommand, + contentLinkArea, + linkLaunchArgument, + openInExplorer, + messageTextAlignment, + richTextBoxTextAlignment, + messageTextBoxAlignment, + showOptionalCheckBox, + initialDoNotShowAgainCheckBoxChecked, + optionalCheckBoxText, + useOptionalCheckBoxThreeState, + useTimeOut, + timeOut, + timerResult); + + return true; + } + else + { + using var kmbe = new VisualMessageBoxExtendedForm( + showOwner, + text, + caption, + buttons, + icon, defaultButton, helpInfo, + showCtrlCopy, messageBoxTypeface, + customImageIcon, showHelpButton, + messageTextColour, + buttonTextColours, + buttonOneCustomDialogResult, + buttonTwoCustomDialogResult, + buttonThreeCustomDialogResult, + buttonFourDialogResult, + buttonOneCustomText, + buttonTwoCustomText, + buttonThreeCustomText, + buttonFourCustomText, + applicationPath, + messageContainerType, + linkLabelCommand, + contentLinkArea, + linkLaunchArgument, + openInExplorer, + messageTextAlignment, + richTextBoxTextAlignment, + messageTextBoxAlignment, + showOptionalCheckBox, + initialDoNotShowAgainCheckBoxChecked, + initialDoNotShowAgainCheckBoxCheckState, + optionalCheckBoxText, + useOptionalCheckBoxThreeState, + useTimeOut, + timeOut, + timeOutInterval, + timerResult); + + kmbe.Show(); + + return kmbe.GetDoNotShowAgainChecked(); + } + } + + /// Shows the core with check state result. + /// The owner. + /// The text. + /// The caption. + /// The buttons. + /// The icon. + /// The default button. + /// The options. + /// The help information. + /// The show control copy. + /// The message box typeface. + /// The custom image icon. + /// The show help button. + /// The message text colour. + /// The button text colours. + /// The button one custom dialog result. + /// The button two custom dialog result. + /// The button three custom dialog result. + /// The button four dialog result. + /// The button one custom text. + /// The button two custom text. + /// The button three custom text. + /// The button four custom text. + /// The application path. + /// Type of the message container. + /// The link label command. + /// The content link area. + /// The link launch argument. + /// The open in explorer. + /// The message text alignment. + /// The rich text box text alignment. + /// The show optional CheckBox. + /// The initial do not show again CheckBox checked. + /// Initial state of the do not show again CheckBox check. + /// The optional CheckBox text. + /// State of the use optional CheckBox three. + /// The use time out. + /// The time out. + /// The time out interval. + /// The timer result. + /// + ///
+ ///
+ internal static CheckState ShowCoreWithCheckStateResult(IWin32Window? owner, string text, string caption, + ExtendedMessageBoxButtons buttons, + ExtendedKryptonMessageBoxIcon icon, + KryptonMessageBoxDefaultButton defaultButton, + MessageBoxOptions options, HelpInfo? helpInfo, + bool? showCtrlCopy, Font? messageBoxTypeface, + Image? customImageIcon, bool? showHelpButton, + Color? messageTextColour, Color[]? buttonTextColours, + DialogResult? buttonOneCustomDialogResult, + DialogResult? buttonTwoCustomDialogResult, + DialogResult? buttonThreeCustomDialogResult, + DialogResult? buttonFourDialogResult, + string? buttonOneCustomText, string? buttonTwoCustomText, + string? buttonThreeCustomText, string? buttonFourCustomText, + string? applicationPath, + ExtendedKryptonMessageBoxMessageContainerType? messageContainerType, + KryptonCommand? linkLabelCommand, + LinkArea? contentLinkArea, + ProcessStartInfo? linkLaunchArgument, + bool? openInExplorer, + ContentAlignment? messageTextAlignment, + PaletteRelativeAlign? richTextBoxTextAlignment, + HorizontalAlignment? messageTextBoxAlignment, + bool? showOptionalCheckBox, + bool? initialDoNotShowAgainCheckBoxChecked, + CheckState? initialDoNotShowAgainCheckBoxCheckState, + string? optionalCheckBoxText, + bool? useOptionalCheckBoxThreeState, + bool? useTimeOut, + int? timeOut, + int? timeOutInterval, + DialogResult? timerResult) + { + IWin32Window? showOwner = ValidateOptions(owner, options, helpInfo); + + if (options == MessageBoxOptions.RightAlign | options == MessageBoxOptions.RtlReading) + { + using var kmbertl = new VisualMessageBoxExtendedRtlAwareForm(showOwner, text, + caption, buttons, + icon, defaultButton, + helpInfo, showCtrlCopy, + messageBoxTypeface, + customImageIcon, showHelpButton, + messageTextColour, + buttonTextColours, + buttonOneCustomDialogResult, + buttonTwoCustomDialogResult, + buttonThreeCustomDialogResult, + buttonFourDialogResult, + buttonOneCustomText, + buttonTwoCustomText, + buttonThreeCustomText, + buttonFourCustomText, + applicationPath, + messageContainerType, + linkLabelCommand, + contentLinkArea, + linkLaunchArgument, + openInExplorer, + messageTextAlignment, + richTextBoxTextAlignment, + messageTextBoxAlignment, + showOptionalCheckBox, + initialDoNotShowAgainCheckBoxChecked, + optionalCheckBoxText, + useOptionalCheckBoxThreeState, + useTimeOut, + timeOut, + timerResult); + + return CheckState.Unchecked; + } + else + { + using var kmbe = new VisualMessageBoxExtendedForm( + showOwner, + text, + caption, + buttons, + icon, defaultButton, helpInfo, + showCtrlCopy, messageBoxTypeface, + customImageIcon, showHelpButton, + messageTextColour, + buttonTextColours, + buttonOneCustomDialogResult, + buttonTwoCustomDialogResult, + buttonThreeCustomDialogResult, + buttonFourDialogResult, + buttonOneCustomText, + buttonTwoCustomText, + buttonThreeCustomText, + buttonFourCustomText, + applicationPath, + messageContainerType, + linkLabelCommand, + contentLinkArea, + linkLaunchArgument, + openInExplorer, + messageTextAlignment, + richTextBoxTextAlignment, + messageTextBoxAlignment, + showOptionalCheckBox, + initialDoNotShowAgainCheckBoxChecked, + initialDoNotShowAgainCheckBoxCheckState, + optionalCheckBoxText, + useOptionalCheckBoxThreeState, + useTimeOut, + timeOut, + timeOutInterval, + timerResult); + + kmbe.Show(); + + return kmbe.GetDoNotShowAgainCheckState(); + } + } + /// Shows the message box. /// The owner. /// The text. @@ -570,12 +806,9 @@ public static DialogResult Show(IWin32Window owner, string messageText, string c /// If set to true, then this will launch Windows Explorer and select the file. /// Specifies how the message text should be aligned. See for supported values. /// Specifies how the message text should be aligned, when a is being used. See for supported values. - /// The show optional CheckBox. - /// The optional CheckBox checked. - /// The optional CheckBox text. - /// Sets the 'ThreeState' ability on the optional CheckBox. /// Use the 'time out' facility, default value is false. /// Specifies the 'time out' time, default is 60. + /// Sets the interval of the 'time out' timer. /// Specifies the action to trigger, once the has timed out. /// One of the values. internal static DialogResult ShowCore(IWin32Window? owner, string text, string caption, @@ -600,48 +833,92 @@ internal static DialogResult ShowCore(IWin32Window? owner, string text, string c bool? openInExplorer, ContentAlignment? messageTextAlignment, PaletteRelativeAlign? richTextBoxTextAlignment, - bool? showOptionalCheckBox, - bool? optionalCheckBoxChecked, - string? optionalCheckBoxText, - bool? useOptionalCheckBoxThreeState, + HorizontalAlignment? messageTextBoxAlignment, bool? useTimeOut, int? timeOut, + int? timeOutInterval, DialogResult? timerResult) { IWin32Window? showOwner = ValidateOptions(owner, options, helpInfo); - using KryptonMessageBoxExtendedForm kmbe = new(showOwner, text, caption, buttons, - icon, defaultButton, options, - helpInfo, showCtrlCopy, - messageBoxTypeface, - customImageIcon, showHelpButton, - messageTextColour, - buttonTextColours, - buttonOneCustomDialogResult, - buttonTwoCustomDialogResult, - buttonThreeCustomDialogResult, - buttonFourDialogResult, - buttonOneCustomText, - buttonTwoCustomText, - buttonThreeCustomText, - buttonFourCustomText, - applicationPath, - messageContainerType, - linkLabelCommand, - contentLinkArea, - linkLaunchArgument, - openInExplorer, - messageTextAlignment, - richTextBoxTextAlignment, - showOptionalCheckBox, - optionalCheckBoxChecked, - optionalCheckBoxText, - useOptionalCheckBoxThreeState, - useTimeOut, - timeOut, - timerResult); - - return kmbe.ShowDialog(showOwner); + if (options == MessageBoxOptions.RightAlign | options == MessageBoxOptions.RtlReading) + { + using var kmbertl = new VisualMessageBoxExtendedRtlAwareForm(showOwner, text, + caption, buttons, + icon, defaultButton, + helpInfo, showCtrlCopy, + messageBoxTypeface, + customImageIcon, showHelpButton, + messageTextColour, + buttonTextColours, + buttonOneCustomDialogResult, + buttonTwoCustomDialogResult, + buttonThreeCustomDialogResult, + buttonFourDialogResult, + buttonOneCustomText, + buttonTwoCustomText, + buttonThreeCustomText, + buttonFourCustomText, + applicationPath, + messageContainerType, + linkLabelCommand, + contentLinkArea, + linkLaunchArgument, + openInExplorer, + messageTextAlignment, + richTextBoxTextAlignment, + messageTextBoxAlignment, + null, + null, + null, + null, + useTimeOut, + timeOut, + timerResult); + + return kmbertl.ShowDialog(showOwner); + } + else + { + using var kmbe = new VisualMessageBoxExtendedForm( + showOwner, + text, + caption, + buttons, + icon, defaultButton, helpInfo, + showCtrlCopy, messageBoxTypeface, + customImageIcon, showHelpButton, + messageTextColour, + buttonTextColours, + buttonOneCustomDialogResult, + buttonTwoCustomDialogResult, + buttonThreeCustomDialogResult, + buttonFourDialogResult, + buttonOneCustomText, + buttonTwoCustomText, + buttonThreeCustomText, + buttonFourCustomText, + applicationPath, + messageContainerType, + linkLabelCommand, + contentLinkArea, + linkLaunchArgument, + openInExplorer, + messageTextAlignment, + richTextBoxTextAlignment, + messageTextBoxAlignment, + null, + null, + null, + null, + null, + useTimeOut, + timeOut, + timeOutInterval, + timerResult); + + return kmbe.ShowDialog(showOwner); + } } #endregion @@ -650,28 +927,28 @@ internal static DialogResult ShowCore(IWin32Window? owner, string text, string c { // 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)) + (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)) + 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)) + 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 (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(PlatformInvoke.GetActiveWindow()); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/KryptonMessageBoxExtendedManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/KryptonMessageBoxExtendedManager.cs index 98c525cff..860c2288f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/KryptonMessageBoxExtendedManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/KryptonMessageBoxExtendedManager.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -55,15 +55,15 @@ internal class KryptonMessageBoxManager : Component private Font _messageBoxTypeface; - private Image _customImageIcon; + private Image? _customImageIcon; private string _text, _captionText, _helpFilePath, _optionalCheckBoxText, _optionalLinkLabelText, _optionalLinkLabelDestination, _applicationPath, _linkDestination; - private object _parameters; + private object? _parameters; private HelpNavigator _helpNavigator; - private IWin32Window _owner; + private IWin32Window? _owner; private LinkArea _linkArea; @@ -142,7 +142,7 @@ internal class KryptonMessageBoxManager : Component /// Gets or sets the custom image icon. /// The custom image icon. [DefaultValue(null), Description(@"Specifies a custom message box icon. Note, you'll need to set the MessageBoxIcon to 'CUSTOM' for this to work.")] - public Image CustomImageIcon { get => _customImageIcon; set => _customImageIcon = value; } + public Image? CustomImageIcon { get => _customImageIcon; set => _customImageIcon = value; } /// Gets or sets the text. /// The text. @@ -175,7 +175,7 @@ internal class KryptonMessageBoxManager : Component /// Gets or sets the parameters. /// The parameters. [DefaultValue(null), Description(@"The numeric ID of the Help topic to display when the user clicks the Help button.")] - public object Parameters { get => _parameters; set => _parameters = value; } + public object? Parameters { get => _parameters; set => _parameters = value; } /// Gets or sets the help navigator. /// The help navigator. @@ -185,7 +185,7 @@ internal class KryptonMessageBoxManager : Component /// Gets or sets the owner of the modal dialog box. /// The owner of the modal dialog box. [DefaultValue(null), Description(@"Owner of the modal dialog box.")] - public IWin32Window Owner { get => _owner; set => _owner = value; } + public IWin32Window? Owner { get => _owner; set => _owner = value; } public LinkArea LinkArea { get => _linkArea; set => _linkArea = value; } @@ -246,7 +246,7 @@ public KryptonMessageBoxManager() _owner = null; - _linkArea = new(); + _linkArea = new LinkArea(); } /// Initializes a new instance of the class. @@ -271,10 +271,10 @@ public KryptonMessageBoxManager(IWin32Window owner, string text, string caption, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, - object param, bool? showCtrlCopy, + object? param, bool? showCtrlCopy, bool? displayHelpButton, Font messageBoxTypeface, - Image customImageIcon, + Image? customImageIcon, string applicationPath, string linkDestination, bool openInExplorer, diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/KryptonMessageBoxExtendedManagerTest.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/KryptonMessageBoxExtendedManagerTest.cs index c7cf6a751..84eb13657 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/KryptonMessageBoxExtendedManagerTest.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/KryptonMessageBoxExtendedManagerTest.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -52,15 +52,15 @@ public class KryptonMessageBoxManagerTest : Component private Font _messageBoxTypeface; - private Image _customImageIcon; + private Image? _customImageIcon; private string _text, _captionText, _helpFilePath, _optionalCheckBoxText, _optionalLinkLabelText, _optionalLinkLabelDestination; - private object _parameters; + private object? _parameters; private HelpNavigator _helpNavigator; - private IWin32Window _owner; + private IWin32Window? _owner; #endregion @@ -119,7 +119,7 @@ public class KryptonMessageBoxManagerTest : Component /// Gets or sets the custom image icon. /// The custom image icon. [DefaultValue(null), Description(@"Specifies a custom message box icon. Note, you'll need to set the MessageBoxIcon to 'CUSTOM' for this to work.")] - public Image CustomImageIcon { get => _customImageIcon; set => _customImageIcon = value; } + public Image? CustomImageIcon { get => _customImageIcon; set => _customImageIcon = value; } /// Gets or sets the text. /// The text. @@ -150,7 +150,7 @@ public class KryptonMessageBoxManagerTest : Component /// Gets or sets the parameters. /// The parameters. [DefaultValue(null), Description(@"The numeric ID of the Help topic to display when the user clicks the Help button.")] - public object Parameters { get => _parameters; set => _parameters = value; } + public object? Parameters { get => _parameters; set => _parameters = value; } /// Gets or sets the help navigator. /// The help navigator. @@ -160,7 +160,7 @@ public class KryptonMessageBoxManagerTest : Component /// Gets or sets the owner of the modal dialog box. /// The owner of the modal dialog box. [DefaultValue(null), Description(@"Owner of the modal dialog box.")] - public IWin32Window Owner { get => _owner; set => _owner = value; } + public IWin32Window? Owner { get => _owner; set => _owner = value; } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/MessageButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/MessageButton.cs index aeba5da15..cc5a88381 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/MessageButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/MessageButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Developer/KryptonMessageBoxExtendedFormDevelopment.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Developer/KryptonMessageBoxExtendedFormDevelopment.Designer.cs index a051ab704..31f9f6eb9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Developer/KryptonMessageBoxExtendedFormDevelopment.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Developer/KryptonMessageBoxExtendedFormDevelopment.Designer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -57,32 +57,33 @@ private void InitializeComponent() { this.kpnlBase = new Krypton.Toolkit.KryptonPanel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel(); - this._messageText = new Krypton.Toolkit.KryptonWrapLabel(); + this.kpnlButtons = new Krypton.Toolkit.KryptonPanel(); + this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); - this._panelButtons = new Krypton.Toolkit.KryptonPanel(); - this._borderEdge = new Krypton.Toolkit.KryptonBorderEdge(); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); this._button4 = new Krypton.Toolkit.Suite.Extended.Messagebox.MessageButton(); this._button3 = new Krypton.Toolkit.Suite.Extended.Messagebox.MessageButton(); - this._button1 = new Krypton.Toolkit.Suite.Extended.Messagebox.MessageButton(); this._button2 = new Krypton.Toolkit.Suite.Extended.Messagebox.MessageButton(); - this.kryptonPanel3 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonCheckBox1 = new Krypton.Toolkit.KryptonCheckBox(); + this._button1 = new Krypton.Toolkit.Suite.Extended.Messagebox.MessageButton(); + this._button5 = new Krypton.Toolkit.Suite.Extended.Messagebox.MessageButton(); + this._messageIcon = new System.Windows.Forms.PictureBox(); + this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); + this.kcbOptionalCheckBox = new Krypton.Toolkit.KryptonCheckBox(); + this.kpnlContent = new Krypton.Toolkit.KryptonPanel(); + this.kwlblMessageText = new Krypton.Toolkit.KryptonWrapLabel(); + this.klwlblMessageText = new Krypton.Toolkit.KryptonLinkWrapLabel(); + this.krtbMessageText = new Krypton.Toolkit.KryptonRichTextBox(); ((System.ComponentModel.ISupportInitialize)(this.kpnlBase)).BeginInit(); this.kpnlBase.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); - this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); - this.kryptonPanel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit(); + this.kpnlButtons.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this._panelButtons)).BeginInit(); - this._panelButtons.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel3)).BeginInit(); - this.kryptonPanel3.SuspendLayout(); + this.tableLayoutPanel3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this._messageIcon)).BeginInit(); + this.tableLayoutPanel4.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).BeginInit(); + this.kpnlContent.SuspendLayout(); this.SuspendLayout(); // // kpnlBase @@ -91,201 +92,242 @@ private void InitializeComponent() this.kpnlBase.Dock = System.Windows.Forms.DockStyle.Fill; this.kpnlBase.Location = new System.Drawing.Point(0, 0); this.kpnlBase.Name = "kpnlBase"; - this.kpnlBase.Size = new System.Drawing.Size(188, 115); + this.kpnlBase.Size = new System.Drawing.Size(421, 161); this.kpnlBase.TabIndex = 0; // // tableLayoutPanel1 // this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent; - this.tableLayoutPanel1.ColumnCount = 2; - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel1.ColumnCount = 1; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.Controls.Add(this.pictureBox1, 0, 0); - this.tableLayoutPanel1.Controls.Add(this.kryptonPanel1, 0, 1); - this.tableLayoutPanel1.Controls.Add(this.kryptonPanel2, 1, 0); + this.tableLayoutPanel1.Controls.Add(this.kpnlButtons, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel3, 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(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(188, 115); + 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(421, 161); this.tableLayoutPanel1.TabIndex = 0; // - // pictureBox1 - // - this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.pictureBox1.Location = new System.Drawing.Point(8, 4); - this.pictureBox1.Margin = new System.Windows.Forms.Padding(8, 4, 4, 4); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(32, 49); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; - this.pictureBox1.TabIndex = 0; - this.pictureBox1.TabStop = false; - // - // kryptonPanel1 - // - this.tableLayoutPanel1.SetColumnSpan(this.kryptonPanel1, 2); - this.kryptonPanel1.Controls.Add(this.tableLayoutPanel2); - this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonPanel1.Location = new System.Drawing.Point(3, 60); - this.kryptonPanel1.Name = "kryptonPanel1"; - this.kryptonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel1.Size = new System.Drawing.Size(182, 52); - this.kryptonPanel1.TabIndex = 1; - // - // kryptonPanel2 - // - this.kryptonPanel2.Controls.Add(this._messageText); - this.kryptonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonPanel2.Location = new System.Drawing.Point(47, 3); - this.kryptonPanel2.Name = "kryptonPanel2"; - this.kryptonPanel2.Size = new System.Drawing.Size(138, 51); - this.kryptonPanel2.TabIndex = 2; - // - // _messageText - // - 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(138, 51); - this._messageText.Text = "Message Text"; - this._messageText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // kpnlButtons + // + this.kpnlButtons.Controls.Add(this.tableLayoutPanel2); + this.kpnlButtons.Controls.Add(this.kryptonBorderEdge1); + this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Fill; + this.kpnlButtons.Location = new System.Drawing.Point(3, 108); + this.kpnlButtons.Name = "kpnlButtons"; + this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; + this.kpnlButtons.Size = new System.Drawing.Size(415, 50); + this.kpnlButtons.TabIndex = 0; + // + // 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(415, 1); + this.kryptonBorderEdge1.Text = "kryptonBorderEdge1"; // // tableLayoutPanel2 // - this.tableLayoutPanel2.ColumnCount = 1; + this.tableLayoutPanel2.ColumnCount = 5; this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel2.Controls.Add(this._panelButtons, 0, 0); - this.tableLayoutPanel2.Controls.Add(this.kryptonPanel3, 0, 1); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel2.Controls.Add(this._button4, 4, 0); + this.tableLayoutPanel2.Controls.Add(this._button3, 3, 0); + this.tableLayoutPanel2.Controls.Add(this._button2, 2, 0); + this.tableLayoutPanel2.Controls.Add(this._button1, 1, 0); + this.tableLayoutPanel2.Controls.Add(this._button5, 0, 0); this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 1); 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()); - this.tableLayoutPanel2.Size = new System.Drawing.Size(182, 52); - this.tableLayoutPanel2.TabIndex = 0; - // - // _panelButtons - // - this.tableLayoutPanel2.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, 0); - 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(182, 21); - this._panelButtons.TabIndex = 1; - // - // _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(182, 1); - this._borderEdge.Text = "kryptonBorderEdge1"; + 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(415, 49); + this.tableLayoutPanel2.TabIndex = 1; + // + // tableLayoutPanel3 + // + 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.tableLayoutPanel4, 0, 0); + this.tableLayoutPanel3.Controls.Add(this._messageIcon, 0, 0); + this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 3); + 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(415, 99); + this.tableLayoutPanel3.TabIndex = 1; // // _button4 // - this._button4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this._button4.Anchor = System.Windows.Forms.AnchorStyles.Right; this._button4.AutoSize = true; - this._button4.CornerRoundingRadius = -1F; this._button4.Enabled = false; this._button4.IgnoreAltF4 = false; - this._button4.Location = new System.Drawing.Point(182, 0); - this._button4.Margin = new System.Windows.Forms.Padding(0); + this._button4.Location = new System.Drawing.Point(367, 13); + this._button4.Margin = new System.Windows.Forms.Padding(10); 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.Size = new System.Drawing.Size(38, 22); + this._button4.TabIndex = 3; 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.Anchor = System.Windows.Forms.AnchorStyles.Right; this._button3.AutoSize = true; - this._button3.CornerRoundingRadius = -1F; this._button3.Enabled = false; this._button3.IgnoreAltF4 = false; - this._button3.Location = new System.Drawing.Point(145, 0); - this._button3.Margin = new System.Windows.Forms.Padding(0); + this._button3.Location = new System.Drawing.Point(309, 13); + this._button3.Margin = new System.Windows.Forms.Padding(10); 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.Size = new System.Drawing.Size(38, 22); + this._button3.TabIndex = 4; 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.CornerRoundingRadius = -1F; - this._button1.Enabled = false; - this._button1.IgnoreAltF4 = false; - this._button1.Location = new System.Drawing.Point(69, 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.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.Anchor = System.Windows.Forms.AnchorStyles.Right; this._button2.AutoSize = true; - this._button2.CornerRoundingRadius = -1F; this._button2.Enabled = false; this._button2.IgnoreAltF4 = false; - this._button2.Location = new System.Drawing.Point(107, 0); - this._button2.Margin = new System.Windows.Forms.Padding(0); + this._button2.Location = new System.Drawing.Point(251, 13); + this._button2.Margin = new System.Windows.Forms.Padding(10); 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.Size = new System.Drawing.Size(38, 22); + this._button2.TabIndex = 5; this._button2.Values.Text = "B2"; this._button2.Visible = false; // - // kryptonPanel3 - // - this.kryptonPanel3.Controls.Add(this.kryptonCheckBox1); - this.kryptonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonPanel3.Location = new System.Drawing.Point(3, 24); - this.kryptonPanel3.Name = "kryptonPanel3"; - this.kryptonPanel3.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel3.Size = new System.Drawing.Size(176, 25); - this.kryptonPanel3.TabIndex = 2; + // _button1 // - // kryptonCheckBox1 + this._button1.Anchor = System.Windows.Forms.AnchorStyles.Right; + this._button1.AutoSize = true; + this._button1.Enabled = false; + this._button1.IgnoreAltF4 = false; + this._button1.Location = new System.Drawing.Point(193, 13); + this._button1.Margin = new System.Windows.Forms.Padding(10); + this._button1.MinimumSize = new System.Drawing.Size(38, 21); + this._button1.Name = "_button1"; + this._button1.Size = new System.Drawing.Size(38, 22); + this._button1.TabIndex = 6; + this._button1.Values.Text = "B1"; + this._button1.Visible = false; // - this.kryptonCheckBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonCheckBox1.Location = new System.Drawing.Point(0, 0); - this.kryptonCheckBox1.Name = "kryptonCheckBox1"; - this.kryptonCheckBox1.Size = new System.Drawing.Size(176, 25); - this.kryptonCheckBox1.TabIndex = 0; - this.kryptonCheckBox1.Values.Text = "kryptonCheckBox1"; + // _button5 + // + this._button5.Anchor = System.Windows.Forms.AnchorStyles.Left; + this._button5.AutoSize = true; + this._button5.Enabled = false; + this._button5.IgnoreAltF4 = false; + this._button5.Location = new System.Drawing.Point(10, 13); + this._button5.Margin = new System.Windows.Forms.Padding(10); + this._button5.MinimumSize = new System.Drawing.Size(38, 21); + this._button5.Name = "_button5"; + this._button5.Size = new System.Drawing.Size(38, 22); + this._button5.TabIndex = 7; + this._button5.Values.Text = "B5"; + this._button5.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(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, 91); + this._messageIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; + this._messageIcon.TabIndex = 1; + this._messageIcon.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.kcbOptionalCheckBox, 0, 1); + this.tableLayoutPanel4.Controls.Add(this.kpnlContent, 0, 0); + this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel4.Location = new System.Drawing.Point(48, 3); + this.tableLayoutPanel4.Name = "tableLayoutPanel4"; + this.tableLayoutPanel4.RowCount = 2; + 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(364, 93); + this.tableLayoutPanel4.TabIndex = 2; + // + // kcbOptionalCheckBox + // + this.kcbOptionalCheckBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.kcbOptionalCheckBox.Location = new System.Drawing.Point(3, 70); + this.kcbOptionalCheckBox.Name = "kcbOptionalCheckBox"; + this.kcbOptionalCheckBox.Size = new System.Drawing.Size(358, 20); + this.kcbOptionalCheckBox.TabIndex = 0; + this.kcbOptionalCheckBox.Values.Text = "CB1"; + // + // kpnlContent + // + this.kpnlContent.Controls.Add(this.kwlblMessageText); + this.kpnlContent.Controls.Add(this.klwlblMessageText); + this.kpnlContent.Controls.Add(this.krtbMessageText); + this.kpnlContent.Dock = System.Windows.Forms.DockStyle.Fill; + this.kpnlContent.Location = new System.Drawing.Point(3, 3); + this.kpnlContent.Name = "kpnlContent"; + this.kpnlContent.Size = new System.Drawing.Size(358, 61); + this.kpnlContent.TabIndex = 1; + // + // 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(358, 61); + 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(358, 61); + this.klwlblMessageText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // krtbMessageText + // + this.krtbMessageText.Dock = System.Windows.Forms.DockStyle.Fill; + this.krtbMessageText.Location = new System.Drawing.Point(0, 0); + this.krtbMessageText.Name = "krtbMessageText"; + this.krtbMessageText.ReadOnly = true; + this.krtbMessageText.Size = new System.Drawing.Size(358, 61); + this.krtbMessageText.TabIndex = 0; + this.krtbMessageText.Text = ""; // // KryptonMessageBoxExtendedFormDevelopment // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(188, 115); + this.ClientSize = new System.Drawing.Size(421, 161); this.Controls.Add(this.kpnlBase); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; @@ -298,18 +340,17 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.kpnlBase)).EndInit(); this.kpnlBase.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); - this.kryptonPanel1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); - this.kryptonPanel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit(); + this.kpnlButtons.ResumeLayout(false); + this.kpnlButtons.PerformLayout(); this.tableLayoutPanel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this._panelButtons)).EndInit(); - this._panelButtons.ResumeLayout(false); - this._panelButtons.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel3)).EndInit(); - this.kryptonPanel3.ResumeLayout(false); - this.kryptonPanel3.PerformLayout(); + this.tableLayoutPanel2.PerformLayout(); + this.tableLayoutPanel3.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this._messageIcon)).EndInit(); + this.tableLayoutPanel4.ResumeLayout(false); + this.tableLayoutPanel4.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).EndInit(); + this.kpnlContent.ResumeLayout(false); this.ResumeLayout(false); } @@ -318,18 +359,21 @@ private void InitializeComponent() private KryptonPanel kpnlBase; private TableLayoutPanel tableLayoutPanel1; - private PictureBox pictureBox1; - private KryptonPanel kryptonPanel1; - private KryptonPanel kryptonPanel2; - private KryptonWrapLabel _messageText; + private KryptonPanel kpnlButtons; + private KryptonBorderEdge kryptonBorderEdge1; private TableLayoutPanel tableLayoutPanel2; - private KryptonPanel _panelButtons; - private KryptonBorderEdge _borderEdge; + private TableLayoutPanel tableLayoutPanel3; private MessageButton _button4; private MessageButton _button3; - private MessageButton _button1; private MessageButton _button2; - private KryptonPanel kryptonPanel3; - private KryptonCheckBox kryptonCheckBox1; + private MessageButton _button1; + private MessageButton _button5; + private PictureBox _messageIcon; + private TableLayoutPanel tableLayoutPanel4; + private KryptonCheckBox kcbOptionalCheckBox; + private KryptonPanel kpnlContent; + private KryptonWrapLabel kwlblMessageText; + private KryptonLinkWrapLabel klwlblMessageText; + private KryptonRichTextBox krtbMessageText; } } \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Developer/KryptonMessageBoxExtendedFormDevelopment.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Developer/KryptonMessageBoxExtendedFormDevelopment.cs index 6825183af..3b80f5b22 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Developer/KryptonMessageBoxExtendedFormDevelopment.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Developer/KryptonMessageBoxExtendedFormDevelopment.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,13 +25,1379 @@ */ #endregion +using Resources = Krypton.Toolkit.Suite.Extended.Messagebox.Properties.Resources; + +using Timer = System.Windows.Forms.Timer; + namespace Krypton.Toolkit.Suite.Extended.Messagebox { public partial class KryptonMessageBoxExtendedFormDevelopment : KryptonForm { + #region Static Fields + + private const int GAP = 10; + private static readonly int OS_MAJOR_VERSION; + public const int WH_CALLWNDPROCRET = 12; + + private const int WM_CLOSE = 0x0010; + + #endregion + + #region Instance Fields + + private readonly bool _showCloseButton; + + private readonly string _text; + private readonly string _caption; + + 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 static /*readonly*/ IWin32Window? _showOwner; + private readonly HelpInfo? _helpInfo; + private readonly ContentAlignment _messageTextAlignment; + + private readonly Image? _applicationImage; + + private readonly KryptonMessageBoxExtendedData _messageBoxExtendedData; + + #endregion + + #region Extended Fields + + private readonly bool _showHelpButton; + + private readonly bool _openInExplorer; + + private readonly bool _useTimeOut; + + private readonly bool _showOptionalCheckBox; + + private readonly bool _useOptionalCheckBoxThreeState; + + private bool _optionalCheckBoxChecked; + + private readonly Color _messageTextColour; + + private readonly Color[]? _buttonTextColours = new Color[4]; + + private readonly DialogResult _buttonOneCustomDialogResult; + + private readonly DialogResult _buttonTwoCustomDialogResult; + + private readonly DialogResult _buttonThreeCustomDialogResult; + + private readonly DialogResult _buttonFourDialogResult; + + private readonly Font _messageBoxTypeface; + + private readonly ExtendedMessageBoxButtons _buttons; + + private readonly ExtendedKryptonMessageBoxIcon _kryptonMessageBoxIcon; + + private readonly Image? _customKryptonMessageBoxIcon; + + private readonly string _buttonOneCustomText; + + private readonly string _buttonTwoCustomText; + + private readonly string _buttonThreeCustomText; + + private readonly string _buttonFourCustomText; + + private readonly string _applicationPath; + + private readonly string _checkBoxText; + + private readonly ExtendedKryptonMessageBoxMessageContainerType _messageContainerType; + + private readonly KryptonCommand? _linkLabelCommand; + + private readonly LinkArea _contentLinkArea; + + private readonly ProcessStartInfo? _linkLaunchArgument; + + private static PlatformInvoke.HookProc _hookProc; + + private static IntPtr _hHook; + + private Timer _timeOutTimer; + + private int _timeOut; + + private bool _timedOut; + + private DialogResult _result; + + private DialogResult _timerResult; + + private readonly PaletteRelativeAlign _richTextBoxTextAlignment; + + #endregion + + #region Identity + + static KryptonMessageBoxExtendedFormDevelopment() + { + OS_MAJOR_VERSION = Environment.OSVersion.Version.Major; + + _hookProc = new PlatformInvoke.HookProc(MessageBoxHookProc); + + _hHook = IntPtr.Zero; + } + public KryptonMessageBoxExtendedFormDevelopment() { InitializeComponent(); } + + public KryptonMessageBoxExtendedFormDevelopment(KryptonMessageBoxExtendedData messageBoxExtendedData) + { + _messageBoxExtendedData = messageBoxExtendedData; + + // Create the form contents + InitializeComponent(); + + RightToLeftLayout = _messageBoxExtendedData.Options.HasFlag(MessageBoxOptions.RtlReading); + + // Update contents to match requirements + UpdateText(_messageBoxExtendedData.Caption, messageBoxExtendedData.MessageText, _messageBoxExtendedData.Options, _messageBoxExtendedData.MessageContentAreaType); + UpdateIcon(_messageBoxExtendedData.Icon); + UpdateButtons(_messageBoxExtendedData.Buttons); + UpdateDefault(_messageBoxExtendedData.DefaultButton); + UpdateHelp(_messageBoxExtendedData.ShowHelpButton); + UpdateTextExtra(_messageBoxExtendedData.ShowCtrlCopy); + + UpdateContentAreaType(_messageBoxExtendedData.MessageContentAreaType, _messageBoxExtendedData.MessageTextAlignment, _messageBoxExtendedData.RichTextBoxTextAlignment); + + UpdateContentLinkArea(_messageBoxExtendedData.ContentLinkArea); + + SetupOptionalCheckBox(); + + // Finally calculate and set form sizing + UpdateSizing(_messageBoxExtendedData.Owner); + } + + #endregion + + #region Implementation + + private void UpdateText(string caption, string? text, MessageBoxOptions options, ExtendedKryptonMessageBoxMessageContainerType? contentAreaType) + { + // Set the text of the form + Text = string.IsNullOrEmpty(caption) ? string.Empty : caption.Split(Environment.NewLine.ToCharArray())[0]; + + switch (contentAreaType) + { + case ExtendedKryptonMessageBoxMessageContainerType.Normal: + kwlblMessageText.Text = text; + + kwlblMessageText.RightToLeft = options.HasFlag(MessageBoxOptions.RightAlign) ? RightToLeft.Yes : + options.HasFlag(MessageBoxOptions.RtlReading) ? RightToLeft.Inherit : RightToLeft.No; + break; + case ExtendedKryptonMessageBoxMessageContainerType.HyperLink: + klwlblMessageText.Text = text; + + klwlblMessageText.RightToLeft = options.HasFlag(MessageBoxOptions.RightAlign) + ? + RightToLeft.Yes + : options.HasFlag(MessageBoxOptions.RtlReading) + ? RightToLeft.Inherit + : RightToLeft.No; + break; + case ExtendedKryptonMessageBoxMessageContainerType.RichTextBox: + krtbMessageText.Text = text; + + krtbMessageText.RightToLeft = options.HasFlag(MessageBoxOptions.RightAlign) ? RightToLeft.Yes : + options.HasFlag(MessageBoxOptions.RtlReading) ? RightToLeft.Inherit : RightToLeft.No; + break; + case null: + kwlblMessageText.Text = text; + + kwlblMessageText.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 (_messageContainerType == ExtendedKryptonMessageBoxMessageContainerType.Normal) + { + kwlblMessageText.Visible = true; + kwlblMessageText.Text = _text; + kwlblMessageText.StateCommon.Font = _messageBoxTypeface; + + kwlblMessageText.StateCommon.TextColor = _messageTextColour; + kwlblMessageText.RightToLeft = _options.HasFlag(MessageBoxOptions.RightAlign) + ? RightToLeft.Yes + : _options.HasFlag(MessageBoxOptions.RtlReading) + ? RightToLeft.Inherit + : RightToLeft.No; + + krtbMessageText.Visible = false; + + klwlblMessageText.Visible = false; + } + else if (_messageContainerType == ExtendedKryptonMessageBoxMessageContainerType.RichTextBox) + { + krtbMessageText.Visible = true; + + krtbMessageText.Text = _text; + + krtbMessageText.StateCommon.Content.Color1 = _messageTextColour; + + krtbMessageText.StateCommon.Content.Font = _messageBoxTypeface; + + krtbMessageText.RightToLeft = _options.HasFlag(MessageBoxOptions.RightAlign) + ? RightToLeft.Yes + : _options.HasFlag(MessageBoxOptions.RtlReading) + ? RightToLeft.Inherit + : RightToLeft.No; + + kwlblMessageText.Visible = false; + + klwlblMessageText.Visible = false; + } + else if (_messageContainerType == ExtendedKryptonMessageBoxMessageContainerType.HyperLink) + { + klwlblMessageText.Visible = true; + + klwlblMessageText.Text = _text; + + klwlblMessageText.StateCommon.TextColor = _messageTextColour; + + klwlblMessageText.StateCommon.Font = _messageBoxTypeface; + + klwlblMessageText.RightToLeft = _options.HasFlag(MessageBoxOptions.RightAlign) + ? RightToLeft.Yes + : _options.HasFlag(MessageBoxOptions.RtlReading) + ? RightToLeft.Inherit + : RightToLeft.No; + + kwlblMessageText.Visible = false; + + krtbMessageText.Visible = false; + } + + kcbOptionalCheckBox.StateCommon.ShortText.Color1 = _messageTextColour; + + kcbOptionalCheckBox.StateCommon.ShortText.Color2 = _messageTextColour; + + kcbOptionalCheckBox.StateCommon.ShortText.Font = _messageBoxTypeface; + + kcbOptionalCheckBox.RightToLeft = _options.HasFlag(MessageBoxOptions.RightAlign) ? RightToLeft.Yes : + _options.HasFlag(MessageBoxOptions.RtlReading) ? RightToLeft.Inherit : RightToLeft.No; + } + + private void UpdateTextExtra(bool? showCtrlCopy) + { + if (!showCtrlCopy.HasValue) + { + switch (_kryptonMessageBoxIcon) + { + case ExtendedKryptonMessageBoxIcon.Error: + case ExtendedKryptonMessageBoxIcon.Exclamation: + showCtrlCopy = true; + break; + } + } + + if (showCtrlCopy == true) + { + TextExtra = @"Ctrl+c to copy"; + } + } + + private void UpdateIcon(ExtendedKryptonMessageBoxIcon icon) + { + if (OSUtilities.IsAtLeastWindowsEleven) + { + switch (icon) + { + case ExtendedKryptonMessageBoxIcon.None: + // Windows XP and before will Beep, Vista and above do not! + if (OS_MAJOR_VERSION < 6) + { + SystemSounds.Beep.Play(); + } + break; + case ExtendedKryptonMessageBoxIcon.Hand: + _messageIcon.Image = Resources.Hand; + SystemSounds.Hand.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Question: + _messageIcon.Image = Resources.Question_Windows_11; + SystemSounds.Question.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Exclamation: + _messageIcon.Image = Resources.Warning_Windows_11; + SystemSounds.Exclamation.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Asterisk: + _messageIcon.Image = Resources.Asterisk_Windows_11; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Stop: + _messageIcon.Image = Resources.Stop; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Error: + _messageIcon.Image = Resources.Critical_Windows_11; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Warning: + _messageIcon.Image = Resources.Warning_Windows_11; + SystemSounds.Exclamation.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Information: + _messageIcon.Image = Resources.Information_Windows_11; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Shield: + _messageIcon.Image = Resources.UAC_Shield_Windows_11; + break; + case ExtendedKryptonMessageBoxIcon.WindowsLogo: + _messageIcon.Image = Resources.Windows11; + break; + case ExtendedKryptonMessageBoxIcon.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 ExtendedKryptonMessageBoxIcon.SystemApplication: + _messageIcon.Image = SystemIcons.Application.ToBitmap(); + break; + } + } + else + { + switch (icon) + { + case ExtendedKryptonMessageBoxIcon.None: + // Windows XP and before will Beep, Vista and above do not! + if (OS_MAJOR_VERSION < 6) + { + SystemSounds.Beep.Play(); + } + + break; + case ExtendedKryptonMessageBoxIcon.Hand: + _messageIcon.Image = Resources.Hand; + SystemSounds.Hand.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemHand: + _messageIcon.Image = SystemIcons.Hand.ToBitmap(); + SystemSounds.Hand.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Question: + _messageIcon.Image = Resources.Question; + SystemSounds.Question.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemQuestion: + _messageIcon.Image = SystemIcons.Question.ToBitmap(); + SystemSounds.Question.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Exclamation: + _messageIcon.Image = Resources.Warning; + SystemSounds.Exclamation.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemExclamation: + _messageIcon.Image = SystemIcons.Warning.ToBitmap(); + SystemSounds.Exclamation.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Asterisk: + _messageIcon.Image = OSUtilities.IsAtLeastWindowsEleven + ? Resources.Asterisk_Windows_11 + : Resources.Asterisk; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemAsterisk: + _messageIcon.Image = SystemIcons.Asterisk.ToBitmap(); + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Stop: + _messageIcon.Image = Resources.Stop; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Error: + _messageIcon.Image = Resources.Critical; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Warning: + _messageIcon.Image = Resources.Warning; + SystemSounds.Exclamation.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Information: + _messageIcon.Image = Resources.Information; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Shield: + if (OSUtilities.IsAtLeastWindowsEleven) + { + _messageIcon.Image = Resources.UAC_Shield_Windows_11; + } + else if (OSUtilities.IsWindowsTen) + { + _messageIcon.Image = Resources.UAC_Shield_Windows_10; + } + else + { + _messageIcon.Image = Resources.UAC_Shield_Windows_7; + } + + break; + case ExtendedKryptonMessageBoxIcon.WindowsLogo: + // Because Windows 11 displays a application icon, + // we need to rely on a image instead + if (OSUtilities.IsAtLeastWindowsEleven) + { + _messageIcon.Image = Resources.Windows11; + } + // Windows 10 + else if (OSUtilities.IsWindowsTen) + { + _messageIcon.Image = Resources.Windows_8_and_10_Logo; + } + else + { + _messageIcon.Image = SystemIcons.WinLogo.ToBitmap(); + } + + break; + case ExtendedKryptonMessageBoxIcon.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 ExtendedKryptonMessageBoxIcon.SystemApplication: + _messageIcon.Image = SystemIcons.Application.ToBitmap(); + break; + } + } + + _messageIcon.Visible = _kryptonMessageBoxIcon != ExtendedKryptonMessageBoxIcon.None; + } + + private void UpdateIcon() + { + switch (_kryptonMessageBoxIcon) + { + case ExtendedKryptonMessageBoxIcon.Custom: + if (_customKryptonMessageBoxIcon != null) + { + _messageIcon.Image = _customKryptonMessageBoxIcon; + } + else + { + _messageIcon.Image = SystemIcons.Application.ToBitmap(); + } + break; + case ExtendedKryptonMessageBoxIcon.None: + // Windows XP and before will Beep, Vista and above do not! + if (OS_MAJOR_VERSION < 6) + { + SystemSounds.Beep.Play(); + } + break; + case ExtendedKryptonMessageBoxIcon.Hand: + _messageIcon.Image = Properties.Resources.Hand; + SystemSounds.Hand.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemHand: + _messageIcon.Image = SystemIcons.Hand.ToBitmap(); + SystemSounds.Hand.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Question: + _messageIcon.Image = Properties.Resources.Question; + SystemSounds.Question.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemQuestion: + _messageIcon.Image = SystemIcons.Question.ToBitmap(); + SystemSounds.Question.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Exclamation: + _messageIcon.Image = Properties.Resources.Warning; + SystemSounds.Exclamation.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemExclamation: + _messageIcon.Image = SystemIcons.Exclamation.ToBitmap(); + SystemSounds.Exclamation.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Asterisk: + _messageIcon.Image = Properties.Resources.Asterisk; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemAsterisk: + _messageIcon.Image = SystemIcons.Asterisk.ToBitmap(); + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Stop: + _messageIcon.Image = Properties.Resources.Stop; + SystemSounds.Hand.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Error: + _messageIcon.Image = Properties.Resources.Critical; + SystemSounds.Hand.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Warning: + _messageIcon.Image = Properties.Resources.Warning; + SystemSounds.Exclamation.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Information: + _messageIcon.Image = Properties.Resources.Information; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Shield: + if (OSUtilities.IsAtLeastWindowsEleven) + { + _messageIcon.Image = Properties.Resources.UAC_Shield_Windows_11; + } + // Windows 10 + else if (OSUtilities.IsWindowsTen) + { + _messageIcon.Image = Properties.Resources.UAC_Shield_Windows_10; + } + else + { + _messageIcon.Image = Properties.Resources.UAC_Shield_Windows_7; + } + break; + case ExtendedKryptonMessageBoxIcon.WindowsLogo: + // Because Windows 11 displays a generic application icon, + // we need to rely on a image instead + if (OSUtilities.IsAtLeastWindowsEleven) + { + _messageIcon.Image = Properties.Resources.Windows11; + } + // Windows 10, 8.1 & 8 + else if (OSUtilities.IsWindowsTen || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsEight) + { + _messageIcon.Image = Properties.Resources.Windows_8_and_10_Logo; + } + else + { + _messageIcon.Image = SystemIcons.WinLogo.ToBitmap(); + } + break; + case ExtendedKryptonMessageBoxIcon.Application: + if (!string.IsNullOrEmpty(_applicationPath)) + { + Image tempImage = GraphicsExtensions.ExtractIconFromFilePath(_applicationPath).ToBitmap(); + Bitmap scaledImage = GraphicsExtensions.ScaleImage(tempImage, new Size(32, 32)); + + _messageIcon.Image = scaledImage; + } + else + { + _messageIcon.Image = SystemIcons.Application.ToBitmap(); + } + break; + case ExtendedKryptonMessageBoxIcon.SystemApplication: + _messageIcon.Image = SystemIcons.Application.ToBitmap(); + break; + } + + _messageIcon.Visible = _kryptonMessageBoxIcon != ExtendedKryptonMessageBoxIcon.None; + + } + + private void UpdateButtons(ExtendedMessageBoxButtons buttons) + { + switch (buttons) + { + case ExtendedMessageBoxButtons.OK: + _button1.Text = KryptonManager.Strings.GeneralStrings.OK; + _button1.DialogResult = DialogResult.OK; + _button1.Visible = true; + _button1.Enabled = true; + break; + case ExtendedMessageBoxButtons.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 ExtendedMessageBoxButtons.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 ExtendedMessageBoxButtons.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 ExtendedMessageBoxButtons.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 ExtendedMessageBoxButtons.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 ExtendedMessageBoxButtons.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; + } + + if (_messageBoxExtendedData.ShowActionButton != null) + { + //_button5.Text = _actionButtonText; + //_button5.Visible = true; + //_button5.Enabled = true; + //_button5.KryptonCommand = _actionButtonCommand; + } + + // Do we ignore the Alt+F4 on the buttons? + if (!ControlBox) + { + _button1.IgnoreAltF4 = true; + _button2.IgnoreAltF4 = true; + _button3.IgnoreAltF4 = true; + _button4.IgnoreAltF4 = true; + //_button5.IgnoreAltF4 = true; + } + } + + private void UpdateButtons() + { + switch (_buttons) + { + case ExtendedMessageBoxButtons.OK: + _button1.Text = KryptonManager.Strings.GeneralStrings.OK; + _button1.DialogResult = DialogResult.OK; + _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button1.Visible = true; + _button1.Enabled = true; + break; + case ExtendedMessageBoxButtons.OKCancel: + _button1.Text = KryptonManager.Strings.GeneralStrings.OK; + _button2.Text = KryptonManager.Strings.GeneralStrings.Cancel; + _button1.DialogResult = DialogResult.OK; + _button2.DialogResult = DialogResult.Cancel; + _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button1.Visible = true; + _button1.Enabled = true; + _button2.Visible = true; + _button2.Enabled = true; + break; + case ExtendedMessageBoxButtons.YesNo: + _button1.Text = KryptonManager.Strings.GeneralStrings.Yes; + _button2.Text = KryptonManager.Strings.GeneralStrings.No; + _button1.DialogResult = DialogResult.Yes; + _button2.DialogResult = DialogResult.No; + _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button1.Visible = true; + _button1.Enabled = true; + _button2.Visible = true; + _button2.Enabled = true; + ControlBox = false; + break; + case ExtendedMessageBoxButtons.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.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button3.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button1.Visible = true; + _button1.Enabled = true; + _button2.Visible = true; + _button2.Enabled = true; + _button3.Visible = true; + _button3.Enabled = true; + break; + case ExtendedMessageBoxButtons.RetryCancel: + _button1.Text = KryptonManager.Strings.GeneralStrings.Retry; + _button2.Text = KryptonManager.Strings.GeneralStrings.Cancel; + _button1.DialogResult = DialogResult.Retry; + _button2.DialogResult = DialogResult.Cancel; + _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button1.Visible = true; + _button1.Enabled = true; + _button2.Visible = true; + _button2.Enabled = true; + break; + case ExtendedMessageBoxButtons.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.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button3.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button1.Visible = true; + _button1.Enabled = true; + _button2.Visible = true; + _button2.Enabled = true; + _button3.Visible = true; + _button3.Enabled = true; + ControlBox = false; + break; + case ExtendedMessageBoxButtons.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; + _button2.DialogResult = (DialogResult)11; +#endif + _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button3.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _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 KryptonMessageBoxDefaultButton.Button5: + // AcceptButton = _showActionButton ? _button5 : _button1; + // break; + case null: + AcceptButton = _button1; + break; + default: + AcceptButton = _showHelpButton ? _button4 : _button1; + break; + } + } + + private void UpdateDefault() + { + switch (_defaultButton) + { + case KryptonMessageBoxDefaultButton.Button1: + _button1.Focus(); + break; + case KryptonMessageBoxDefaultButton.Button2: + _button2.Focus(); + break; + case KryptonMessageBoxDefaultButton.Button3: + _button3.Focus(); + break; + case KryptonMessageBoxDefaultButton.Button4: + _button4.Focus(); + break; + } + } + + private void UpdateHelp(bool? showHelpButton) + { + if (showHelpButton != null) + { + return; + } + + MessageButton helpButton = _buttons switch + { + ExtendedMessageBoxButtons.OK => _button2, + ExtendedMessageBoxButtons.OKCancel or ExtendedMessageBoxButtons.YesNo or ExtendedMessageBoxButtons.RetryCancel => _button3, + ExtendedMessageBoxButtons.AbortRetryIgnore or ExtendedMessageBoxButtons.YesNoCancel => _button4, + _ => throw new ArgumentOutOfRangeException() + }; + if (helpButton != null) + { + helpButton.Visible = true; + helpButton.Enabled = true; + helpButton.Text = KryptonManager.Strings.GeneralStrings.Help; + + helpButton.KeyPress += (_, _) => LaunchHelp(_messageBoxExtendedData.Owner); + + helpButton.Click += (_, _) => LaunchHelp(_messageBoxExtendedData.Owner); + } + } + + /// + /// 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, new[] { typeof(HelpEventArgs) }, null)!; + mInfoMethod.Invoke(control, new object[] { 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 if failure to send to Parent + } + } + + private void UpdateHelp() + { + if (_helpInfo == null) + { + return; + } + + MessageButton helpButton = _buttons switch + { + ExtendedMessageBoxButtons.OK => _button2, + ExtendedMessageBoxButtons.OKCancel or ExtendedMessageBoxButtons.YesNo or ExtendedMessageBoxButtons.RetryCancel => _button3, + ExtendedMessageBoxButtons.AbortRetryIgnore or ExtendedMessageBoxButtons.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() + { + try + { + Control control = FromHandle(_showOwner.Handle); + + MethodInfo mInfoMethod = control.GetType().GetMethod(@"OnHelpRequested", BindingFlags.Instance | BindingFlags.NonPublic, + Type.DefaultBinder, new[] { typeof(HelpEventArgs) }, null); + if (mInfoMethod != null) + { + mInfoMethod.Invoke(control, new object[] { 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 if failure to send to Parent + } + + } + + 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 != null ? Screen.FromHandle(showOwner.Handle) : Screen.PrimaryScreen; + SizeF scaledMonitorSize = screen.Bounds.Size; + scaledMonitorSize.Width *= 2 / 3.0f; + scaledMonitorSize.Height *= 0.95f; + + kwlblMessageText.UpdateFont(); + SizeF messageSize = g.MeasureString(_text, kwlblMessageText.Font, scaledMonitorSize); + // SKC: Don't forget to add the TextExtra into the calculation + SizeF captionSize = g.MeasureString($@"{_caption} {TextExtra}", kwlblMessageText.Font, scaledMonitorSize); + + var messageXSize = Math.Max(messageSize.Width, captionSize.Width); + // Work out DPI adjustment factor + messageSize.Width = messageXSize * FactorDpiX; + messageSize.Height *= FactorDpiY; + + // 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); + } + + // Find size of icon area plus the text area added together + if (_messageIcon.Image != null) + { + return new Size(textSize.Width + _messageIcon.Width, Math.Max(_messageIcon.Height + 10, textSize.Height)); + } + + return textSize; + } + + private Size UpdateButtonsSizing() + { + var numButtons = 1; + + // Button1 is always visible + Size button1Size = _button1.GetPreferredSize(Size.Empty); + Size maxButtonSize = new(button1Size.Width + GAP, button1Size.Height); + + // If Button2 is visible + if (_button2.Enabled) + { + numButtons++; + Size button2Size = _button2.GetPreferredSize(Size.Empty); + maxButtonSize.Width = Math.Max(maxButtonSize.Width, button2Size.Width + GAP); + 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 + GAP); + 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 + GAP); + maxButtonSize.Height = Math.Max(maxButtonSize.Height, button4Size.Height); + } + + // Start positioning buttons 10 pixels from right edge + var right = 0;//_panelButtons.Right - GAP; + + // If Button4 is visible + if (_button4.Enabled) + { + _button4.Location = new Point(right - maxButtonSize.Width, GAP); + _button4.Size = maxButtonSize; + right -= maxButtonSize.Width + GAP; + } + + // If Button3 is visible + if (_button3.Enabled) + { + _button3.Location = new Point(right - maxButtonSize.Width, GAP); + _button3.Size = maxButtonSize; + right -= maxButtonSize.Width + GAP; + } + + // If Button2 is visible + if (_button2.Enabled) + { + _button2.Location = new Point(right - maxButtonSize.Width, GAP); + _button2.Size = maxButtonSize; + right -= maxButtonSize.Width + GAP; + } + + // Button1 is always visible + _button1.Location = new Point(right - maxButtonSize.Width, GAP); + _button1.Size = maxButtonSize; + + // Size the panel for the buttons + //_panelButtons.Size = new Size((maxButtonSize.Width * numButtons) + (GAP * (numButtons + 1)), maxButtonSize.Height + (GAP * 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); + } + + 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.Control + || e.KeyCode != Keys.C + ) + { + return; + } + + 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(kwlblMessageText.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 (_openInExplorer) + { + OpenInExplorer(e.Link.LinkData.ToString()); + } + else + { + if (_linkLabelCommand != null) + { + _linkLabelCommand.PerformExecute(); + } + else if (_linkLaunchArgument != null) + { + Process.Start(_linkLaunchArgument); + } + } + } + catch (Exception exc) + { + DebugUtilities.NotImplemented(exc.ToString()); + } + } + + private void OpenInExplorer(string path) + { + try + { + Process.Start(@"explorer.exe", path); + } + catch (Exception e) + { + DebugUtilities.NotImplemented(e.ToString()); + } + } + + private void UpdateContentLinkArea(LinkArea? contentLinkArea) + { + if (contentLinkArea != null) + { + klwlblMessageText.LinkArea = (LinkArea)contentLinkArea; + } + } + + private void UpdateContentAreaType(ExtendedKryptonMessageBoxMessageContainerType? messageContainerType, ContentAlignment? messageTextAlignment, PaletteRelativeAlign? richTextBoxTextAlignment) + { + switch (messageContainerType) + { + case ExtendedKryptonMessageBoxMessageContainerType.HyperLink: + klwlblMessageText.Visible = true; + + kwlblMessageText.Visible = false; + + klwlblMessageText.TextAlign = messageTextAlignment ?? ContentAlignment.MiddleLeft; + + krtbMessageText.Visible = false; + break; + case ExtendedKryptonMessageBoxMessageContainerType.Normal: + klwlblMessageText.Visible = false; + + kwlblMessageText.Visible = true; + + kwlblMessageText.TextAlign = messageTextAlignment ?? ContentAlignment.MiddleLeft; + + krtbMessageText.Visible = false; + break; + case ExtendedKryptonMessageBoxMessageContainerType.RichTextBox: + klwlblMessageText.Visible = false; + + kwlblMessageText.Visible = false; + + krtbMessageText.Visible = true; + + krtbMessageText.StateCommon.Content.TextH = richTextBoxTextAlignment ?? PaletteRelativeAlign.Inherit; + break; + } + } + + private static void Initialize() + { + if (_hHook != IntPtr.Zero) + { + throw new NotSupportedException("multiple calls are not supported"); + } + + if (_showOwner != null) + { + _hHook = PlatformEvents.SetWindowsHookEx(WH_CALLWNDPROCRET, _hookProc, IntPtr.Zero, AppDomain.GetCurrentThreadId()); + } + } + + private static IntPtr MessageBoxHookProc(int nCode, IntPtr wParam, IntPtr lParam) + { + if (nCode < 0) + { + return PlatformEvents.CallNextHookEx(_hHook, nCode, wParam, lParam); + } + + CWPRETSTRUCT msg = (CWPRETSTRUCT)Marshal.PtrToStructure(lParam, typeof(CWPRETSTRUCT)); + IntPtr hook = _hHook; + + if (msg.message == (int)CbtHookAction.HCBT_ACTIVATE) + { + try + { + CenterWindow(msg.hwnd); + } + finally + { + PlatformEvents.UnhookWindowsHookEx(_hHook); + _hHook = IntPtr.Zero; + } + } + + return PlatformEvents.CallNextHookEx(hook, nCode, wParam, lParam); + } + + private static void CenterWindow(IntPtr hChildWnd) + { + Rectangle recChild = new Rectangle(0, 0, 0, 0); + bool success = PlatformEvents.GetWindowRect(hChildWnd, ref recChild); + + int width = recChild.Width - recChild.X; + int height = recChild.Height - recChild.Y; + + Rectangle recParent = new Rectangle(0, 0, 0, 0); + success = PlatformEvents.GetWindowRect(_showOwner.Handle, ref recParent); + + Point ptCenter = new Point(0, 0); + ptCenter.X = recParent.X + (recParent.Width - recParent.X) / 2; + ptCenter.Y = recParent.Y + (recParent.Height - recParent.Y) / 2; + + + Point ptStart = new Point(0, 0); + ptStart.X = ptCenter.X - width / 2; + ptStart.Y = ptCenter.Y - height / 2; + + ptStart.X = ptStart.X < 0 ? 0 : ptStart.X; + ptStart.Y = ptStart.Y < 0 ? 0 : ptStart.Y; + + int result = PlatformEvents.MoveWindow(hChildWnd, ptStart.X, ptStart.Y, width, + height, false); + } + + private void OnTimerElapsed(object state) + { + IntPtr mbWnd = PlatformEvents.FindWindow("#32770", _caption); // lpClassName is #32770 for MessageBox + if (mbWnd != IntPtr.Zero) + { + PlatformEvents.SendMessage(mbWnd, WM_CLOSE, IntPtr.Zero, IntPtr.Zero); + } + + _timeOutTimer.Dispose(); + + _timedOut = true; + } + + private void SetupOptionalCheckBox() + { + kcbOptionalCheckBox.Visible = _showOptionalCheckBox; + + kcbOptionalCheckBox.Checked = _optionalCheckBoxChecked; + + kcbOptionalCheckBox.Text = _checkBoxText; + + kcbOptionalCheckBox.ThreeState = _useOptionalCheckBoxThreeState; + } + + internal static bool ReturnCheckBoxCheckedValue() + { + KryptonMessageBoxExtendedFormDevelopment messageBoxExtendedForm = new KryptonMessageBoxExtendedFormDevelopment(); + + return messageBoxExtendedForm._optionalCheckBoxChecked; + } + + internal static CheckState ReturnCheckBoxCheckState() + { + KryptonMessageBoxExtendedFormDevelopment messageBoxExtendedForm = new KryptonMessageBoxExtendedFormDevelopment(); + + return messageBoxExtendedForm.kcbOptionalCheckBox.CheckState; + } + + private void OptionalCheckBox_CheckedChanged(object sender, EventArgs e) => _optionalCheckBoxChecked = kcbOptionalCheckBox.Checked; + + private void UpdateCloseButtonVisibility(bool? visible) => CloseBox = visible ?? true; + + #endregion } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/KryptonMessageBoxExtendedForm.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/KryptonMessageBoxExtendedForm.Designer.cs deleted file mode 100644 index 063ea3d6f..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/KryptonMessageBoxExtendedForm.Designer.cs +++ /dev/null @@ -1,333 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Messagebox -{ - partial class KryptonMessageBoxExtendedForm - { - /// - /// 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.Suite.Extended.Messagebox.MessageButton(); - this._button3 = new Krypton.Toolkit.Suite.Extended.Messagebox.MessageButton(); - this._button1 = new Krypton.Toolkit.Suite.Extended.Messagebox.MessageButton(); - this._button2 = new Krypton.Toolkit.Suite.Extended.Messagebox.MessageButton(); - this._messageIcon = new System.Windows.Forms.PictureBox(); - this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); - this.kcbOptionalCheckBox = new Krypton.Toolkit.KryptonCheckBox(); - this.kpnlContent = new Krypton.Toolkit.KryptonPanel(); - this.kwlblMessageText = new Krypton.Toolkit.KryptonWrapLabel(); - this.klwlblMessageText = new Krypton.Toolkit.KryptonLinkWrapLabel(); - 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(); - this.tableLayoutPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).BeginInit(); - this.kpnlContent.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(188, 88); - 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.tableLayoutPanel2, 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(188, 88); - 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, 67); - 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(188, 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(188, 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.CornerRoundingRadius = -1F; - this._button4.Enabled = false; - this._button4.IgnoreAltF4 = false; - this._button4.Location = new System.Drawing.Point(188, 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, 24); - this._button4.TabIndex = 2; - 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.CornerRoundingRadius = -1F; - this._button3.Enabled = false; - this._button3.IgnoreAltF4 = false; - this._button3.Location = new System.Drawing.Point(151, 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, 24); - this._button3.TabIndex = 2; - 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.CornerRoundingRadius = -1F; - this._button1.Enabled = false; - this._button1.IgnoreAltF4 = false; - this._button1.Location = new System.Drawing.Point(75, 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, 24); - this._button1.TabIndex = 0; - 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.CornerRoundingRadius = -1F; - this._button2.Enabled = false; - this._button2.IgnoreAltF4 = false; - this._button2.Location = new System.Drawing.Point(113, 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, 24); - this._button2.TabIndex = 1; - 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(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, 59); - this._messageIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; - this._messageIcon.TabIndex = 0; - this._messageIcon.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.kcbOptionalCheckBox, 0, 1); - this.tableLayoutPanel2.Controls.Add(this.kpnlContent, 0, 0); - this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel2.Location = new System.Drawing.Point(48, 3); - 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(137, 61); - this.tableLayoutPanel2.TabIndex = 1; - // - // kcbOptionalCheckBox - // - this.kcbOptionalCheckBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.kcbOptionalCheckBox.Location = new System.Drawing.Point(3, 38); - this.kcbOptionalCheckBox.Name = "kcbOptionalCheckBox"; - this.kcbOptionalCheckBox.Size = new System.Drawing.Size(131, 20); - this.kcbOptionalCheckBox.TabIndex = 0; - this.kcbOptionalCheckBox.Values.Text = "CB1"; - this.kcbOptionalCheckBox.CheckedChanged += new System.EventHandler(this.OptionalCheckBox_CheckedChanged); - // - // kpnlContent - // - this.kpnlContent.Controls.Add(this.kwlblMessageText); - this.kpnlContent.Controls.Add(this.klwlblMessageText); - this.kpnlContent.Controls.Add(this.krtbMessageText); - this.kpnlContent.Dock = System.Windows.Forms.DockStyle.Fill; - this.kpnlContent.Location = new System.Drawing.Point(3, 3); - this.kpnlContent.Name = "kpnlContent"; - this.kpnlContent.Size = new System.Drawing.Size(131, 29); - this.kpnlContent.TabIndex = 1; - // - // 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(131, 29); - 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(131, 29); - this.klwlblMessageText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // krtbMessageText - // - this.krtbMessageText.Dock = System.Windows.Forms.DockStyle.Fill; - this.krtbMessageText.Location = new System.Drawing.Point(0, 0); - this.krtbMessageText.Name = "krtbMessageText"; - this.krtbMessageText.ReadOnly = true; - this.krtbMessageText.Size = new System.Drawing.Size(131, 29); - this.krtbMessageText.TabIndex = 0; - this.krtbMessageText.Text = ""; - // - // KryptonMessageBoxExtendedForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(188, 88); - this.Controls.Add(this.kryptonPanel1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "KryptonMessageBoxExtendedForm"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - ((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(); - this.tableLayoutPanel2.ResumeLayout(false); - this.tableLayoutPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).EndInit(); - this.kpnlContent.ResumeLayout(false); - 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 TableLayoutPanel tableLayoutPanel2; - private KryptonCheckBox kcbOptionalCheckBox; - private KryptonPanel kpnlContent; - private KryptonRichTextBox krtbMessageText; - private KryptonLinkWrapLabel klwlblMessageText; - private KryptonWrapLabel kwlblMessageText; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/KryptonMessageBoxExtendedForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/KryptonMessageBoxExtendedForm.cs deleted file mode 100644 index e67d6ece3..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/KryptonMessageBoxExtendedForm.cs +++ /dev/null @@ -1,1049 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -// ReSharper disable NotAccessedField.Local - -using ContentAlignment = System.Drawing.ContentAlignment; -using Timer = System.Threading.Timer; - -#pragma warning disable IDE0031 -namespace Krypton.Toolkit.Suite.Extended.Messagebox -{ - internal partial class KryptonMessageBoxExtendedForm : KryptonForm - { - #region Static Fields - - private const int GAP = 10; - private static readonly int OS_MAJOR_VERSION; - public const int WH_CALLWNDPROCRET = 12; - - private const int WM_CLOSE = 0x0010; - - #endregion - - #region Instance Fields - - private readonly string _text; - private readonly string _caption; - - 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 static /*readonly*/ IWin32Window? _showOwner; - private readonly HelpInfo? _helpInfo; - private readonly ContentAlignment _messageTextAlignment; - - #endregion - - #region Extended Fields - - private readonly bool _showHelpButton; - - private readonly bool _openInExplorer; - - private readonly bool _useTimeOut; - - private readonly bool _showOptionalCheckBox; - - private readonly bool _useOptionalCheckBoxThreeState; - - private bool _optionalCheckBoxChecked; - - private readonly Color _messageTextColour; - - private readonly Color[]? _buttonTextColours = new Color[4]; - - private readonly DialogResult _buttonOneCustomDialogResult; - - private readonly DialogResult _buttonTwoCustomDialogResult; - - private readonly DialogResult _buttonThreeCustomDialogResult; - - private readonly DialogResult _buttonFourDialogResult; - - private readonly Font _messageBoxTypeface; - - private readonly ExtendedMessageBoxButtons _buttons; - - private readonly ExtendedKryptonMessageBoxIcon _kryptonMessageBoxIcon; - - private readonly Image? _customKryptonMessageBoxIcon; - - private readonly string _buttonOneCustomText; - - private readonly string _buttonTwoCustomText; - - private readonly string _buttonThreeCustomText; - - private readonly string _buttonFourCustomText; - - private readonly string _applicationPath; - - private readonly string _checkBoxText; - - private readonly ExtendedKryptonMessageBoxMessageContainerType _messageContainerType; - - private readonly KryptonCommand? _linkLabelCommand; - - private readonly LinkArea _contentLinkArea; - - private readonly ProcessStartInfo? _linkLaunchArgument; - - private static PlatformInvoke.HookProc _hookProc; - - private static IntPtr _hHook; - - private Timer _timeOutTimer; - - private int _timeOut; - - private bool _timedOut; - - private DialogResult _result; - - private DialogResult _timerResult; - - private readonly PaletteRelativeAlign _richTextBoxTextAlignment; - - #endregion - - #region Identity - - static KryptonMessageBoxExtendedForm() - { - OS_MAJOR_VERSION = Environment.OSVersion.Version.Major; - - _hookProc = new PlatformInvoke.HookProc(MessageBoxHookProc); - - _hHook = IntPtr.Zero; - } - - public KryptonMessageBoxExtendedForm() - { - InitializeComponent(); - } - - - internal KryptonMessageBoxExtendedForm(IWin32Window? showOwner, string text, string caption, - ExtendedMessageBoxButtons buttons, - ExtendedKryptonMessageBoxIcon icon, - KryptonMessageBoxDefaultButton defaultButton, - MessageBoxOptions options, - HelpInfo? helpInfo, bool? showCtrlCopy, - Font? messageBoxTypeface, - Image? customKryptonMessageBoxIcon, bool? showHelpButton, - Color? messageTextColour, Color[]? buttonTextColours, - DialogResult? buttonOneCustomDialogResult, - DialogResult? buttonTwoCustomDialogResult, - DialogResult? buttonThreeCustomDialogResult, - DialogResult? buttonFourDialogResult, - string? buttonOneCustomText, string? buttonTwoCustomText, - string? buttonThreeCustomText, string? buttonFourCustomText, - string? applicationPath, - ExtendedKryptonMessageBoxMessageContainerType? messageContainerType, - KryptonCommand? linkLabelCommand, - LinkArea? contentLinkArea, - ProcessStartInfo? linkLaunchArgument, - bool? openInExplorer, - ContentAlignment? messageTextAlignment, - PaletteRelativeAlign? richTextBoxTextAlignment, - bool? showOptionalCheckBox, - bool? optionalCheckBoxChecked, - string? optionalCheckBoxText, - bool? useOptionalCheckBoxThreeState, - bool? useTimeOut, - int? timeOut, - DialogResult? timerResult) - { - // Store incoming values - _text = text; - - if (useTimeOut != null || useTimeOut == false) - { - _caption = $"{caption} [{timeOut}]"; - } - else - { - _caption = caption; - } - - _buttons = buttons; - _kryptonMessageBoxIcon = icon; - _defaultButton = defaultButton; - _options = options; - _helpInfo = helpInfo ?? new HelpInfo(string.Empty, HelpNavigator.AssociateIndex, null); - _showOwner = showOwner; - _messageTextAlignment = messageTextAlignment ?? ContentAlignment.MiddleLeft; - - // Extended values - _messageBoxTypeface = messageBoxTypeface ?? new Font("Segoe UI", 8.25F); - _customKryptonMessageBoxIcon = customKryptonMessageBoxIcon; - _showHelpButton = showHelpButton ?? false; - _messageTextColour = messageTextColour ?? Color.Empty; - _buttonTextColours = buttonTextColours; - _buttonOneCustomDialogResult = buttonOneCustomDialogResult ?? DialogResult.Yes; - _buttonTwoCustomDialogResult = buttonTwoCustomDialogResult ?? DialogResult.No; - _buttonThreeCustomDialogResult = buttonThreeCustomDialogResult ?? DialogResult.Cancel; - _buttonFourDialogResult = buttonFourDialogResult ?? DialogResult.Retry; - _buttonOneCustomText = buttonOneCustomText ?? KryptonLanguageManager.GeneralToolkitStrings.Yes; - _buttonTwoCustomText = buttonTwoCustomText ?? KryptonLanguageManager.GeneralToolkitStrings.No; - _buttonThreeCustomText = buttonThreeCustomText ?? KryptonLanguageManager.GeneralToolkitStrings.Cancel; - _buttonFourCustomText = buttonFourCustomText ?? KryptonLanguageManager.GeneralToolkitStrings.Retry; - _applicationPath = applicationPath ?? string.Empty; - _messageContainerType = messageContainerType ?? ExtendedKryptonMessageBoxMessageContainerType.Normal; - _linkLabelCommand = linkLabelCommand ?? new KryptonCommand(); - _contentLinkArea = contentLinkArea ?? new LinkArea(0, text.Length); - _linkLaunchArgument = linkLaunchArgument ?? new ProcessStartInfo(); - _openInExplorer = openInExplorer ?? false; - _richTextBoxTextAlignment = richTextBoxTextAlignment ?? PaletteRelativeAlign.Inherit; - _useTimeOut = useTimeOut ?? false; - _timeOut = timeOut ?? 60; - _timeOutTimer = new Timer(OnTimerElapsed, null, _timeOut, Timeout.Infinite); - _timerResult = timerResult ?? DialogResult.None; - //_openInExplorer = openInExplorer ?? false; - - // Optional checkbox - _showOptionalCheckBox = showOptionalCheckBox ?? false; - _optionalCheckBoxChecked = optionalCheckBoxChecked ?? false; - _checkBoxText = optionalCheckBoxText ?? string.Empty; - _useOptionalCheckBoxThreeState = useOptionalCheckBoxThreeState ?? false; - - // Create the form contents - InitializeComponent(); - - RightToLeftLayout = _options.HasFlag(MessageBoxOptions.RtlReading); - - // Update contents to match requirements - UpdateText(); - UpdateIcon(); - UpdateButtons(); - UpdateDefault(); - UpdateHelp(); - UpdateTextExtra(showCtrlCopy); - - UpdateContentAreaType(messageContainerType, messageTextAlignment, richTextBoxTextAlignment); - - UpdateContentLinkArea(contentLinkArea); - - SetupOptionalCheckBox(); - - // Finally calculate and set form sizing - UpdateSizing(showOwner); - - if (_useTimeOut) - { - using (_timeOutTimer) - { - _result = KryptonMessageBoxExtended.Show(text, caption, buttons, icon, showCtrlCopy, - messageTextAlignment, useTimeOut, null, - null); - } - - if (_timedOut) - { - _result = _timerResult; - } - } - } - - #endregion Identity - - #region Implementation - - private void UpdateText() - { - Text = string.IsNullOrEmpty(_caption) ? string.Empty : _caption.Split(Environment.NewLine.ToCharArray())[0]; - - if (_messageContainerType == ExtendedKryptonMessageBoxMessageContainerType.Normal) - { - kwlblMessageText.Visible = true; - kwlblMessageText.Text = _text; - kwlblMessageText.StateCommon.Font = _messageBoxTypeface; - - kwlblMessageText.StateCommon.TextColor = _messageTextColour; - kwlblMessageText.RightToLeft = _options.HasFlag(MessageBoxOptions.RightAlign) - ? RightToLeft.Yes - : _options.HasFlag(MessageBoxOptions.RtlReading) - ? RightToLeft.Inherit - : RightToLeft.No; - - krtbMessageText.Visible = false; - - klwlblMessageText.Visible = false; - } - else if (_messageContainerType == ExtendedKryptonMessageBoxMessageContainerType.RichTextBox) - { - krtbMessageText.Visible = true; - - krtbMessageText.Text = _text; - - krtbMessageText.StateCommon.Content.Color1 = _messageTextColour; - - krtbMessageText.StateCommon.Content.Font = _messageBoxTypeface; - - krtbMessageText.RightToLeft = _options.HasFlag(MessageBoxOptions.RightAlign) - ? RightToLeft.Yes - : _options.HasFlag(MessageBoxOptions.RtlReading) - ? RightToLeft.Inherit - : RightToLeft.No; - - kwlblMessageText.Visible = false; - - klwlblMessageText.Visible = false; - } - else if (_messageContainerType == ExtendedKryptonMessageBoxMessageContainerType.HyperLink) - { - klwlblMessageText.Visible = true; - - klwlblMessageText.Text = _text; - - klwlblMessageText.StateCommon.TextColor = _messageTextColour; - - klwlblMessageText.StateCommon.Font = _messageBoxTypeface; - - klwlblMessageText.RightToLeft = _options.HasFlag(MessageBoxOptions.RightAlign) - ? RightToLeft.Yes - : _options.HasFlag(MessageBoxOptions.RtlReading) - ? RightToLeft.Inherit - : RightToLeft.No; - - kwlblMessageText.Visible = false; - - krtbMessageText.Visible = false; - } - - kcbOptionalCheckBox.StateCommon.ShortText.Color1 = _messageTextColour; - - kcbOptionalCheckBox.StateCommon.ShortText.Color2 = _messageTextColour; - - kcbOptionalCheckBox.StateCommon.ShortText.Font = _messageBoxTypeface; - - kcbOptionalCheckBox.RightToLeft = _options.HasFlag(MessageBoxOptions.RightAlign) ? RightToLeft.Yes : - _options.HasFlag(MessageBoxOptions.RtlReading) ? RightToLeft.Inherit : RightToLeft.No; - } - - private void UpdateTextExtra(bool? showCtrlCopy) - { - if (!showCtrlCopy.HasValue) - { - switch (_kryptonMessageBoxIcon) - { - case ExtendedKryptonMessageBoxIcon.Error: - case ExtendedKryptonMessageBoxIcon.Exclamation: - showCtrlCopy = true; - break; - } - } - - if (showCtrlCopy == true) - { - TextExtra = @"Ctrl+c to copy"; - } - } - - private void UpdateIcon() - { - switch (_kryptonMessageBoxIcon) - { - case ExtendedKryptonMessageBoxIcon.Custom: - if (_customKryptonMessageBoxIcon != null) - { - _messageIcon.Image = _customKryptonMessageBoxIcon; - } - else - { - _messageIcon.Image = SystemIcons.Application.ToBitmap(); - } - break; - case ExtendedKryptonMessageBoxIcon.None: - // Windows XP and before will Beep, Vista and above do not! - if (OS_MAJOR_VERSION < 6) - { - SystemSounds.Beep.Play(); - } - break; - case ExtendedKryptonMessageBoxIcon.Hand: - _messageIcon.Image = Properties.Resources.Hand; - SystemSounds.Hand.Play(); - break; - case ExtendedKryptonMessageBoxIcon.SystemHand: - _messageIcon.Image = SystemIcons.Hand.ToBitmap(); - SystemSounds.Hand.Play(); - break; - case ExtendedKryptonMessageBoxIcon.Question: - _messageIcon.Image = Properties.Resources.Question; - SystemSounds.Question.Play(); - break; - case ExtendedKryptonMessageBoxIcon.SystemQuestion: - _messageIcon.Image = SystemIcons.Question.ToBitmap(); - SystemSounds.Question.Play(); - break; - case ExtendedKryptonMessageBoxIcon.Exclamation: - _messageIcon.Image = Properties.Resources.Warning; - SystemSounds.Exclamation.Play(); - break; - case ExtendedKryptonMessageBoxIcon.SystemExclamation: - _messageIcon.Image = SystemIcons.Exclamation.ToBitmap(); - SystemSounds.Exclamation.Play(); - break; - case ExtendedKryptonMessageBoxIcon.Asterisk: - _messageIcon.Image = Properties.Resources.Asterisk; - SystemSounds.Asterisk.Play(); - break; - case ExtendedKryptonMessageBoxIcon.SystemAsterisk: - _messageIcon.Image = SystemIcons.Asterisk.ToBitmap(); - SystemSounds.Asterisk.Play(); - break; - case ExtendedKryptonMessageBoxIcon.Stop: - _messageIcon.Image = Properties.Resources.Stop; - SystemSounds.Hand.Play(); - break; - case ExtendedKryptonMessageBoxIcon.Error: - _messageIcon.Image = Properties.Resources.Critical; - SystemSounds.Hand.Play(); - break; - case ExtendedKryptonMessageBoxIcon.Warning: - _messageIcon.Image = Properties.Resources.Warning; - SystemSounds.Exclamation.Play(); - break; - case ExtendedKryptonMessageBoxIcon.Information: - _messageIcon.Image = Properties.Resources.Information; - SystemSounds.Asterisk.Play(); - break; - case ExtendedKryptonMessageBoxIcon.Shield: - if (OSUtilities.IsWindowsEleven) - { - _messageIcon.Image = Properties.Resources.UAC_Shield_Windows_11; - } - // Windows 10 - else if (OSUtilities.IsWindowsTen) - { - _messageIcon.Image = Properties.Resources.UAC_Shield_Windows_10; - } - else - { - _messageIcon.Image = Properties.Resources.UAC_Shield_Windows_7; - } - break; - case ExtendedKryptonMessageBoxIcon.WindowsLogo: - // Because Windows 11 displays a generic application icon, - // we need to rely on a image instead - if (OSUtilities.IsWindowsEleven) - { - _messageIcon.Image = Properties.Resources.Windows11; - } - // Windows 10, 8.1 & 8 - else if (OSUtilities.IsWindowsTen || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsEight) - { - _messageIcon.Image = Properties.Resources.Windows_8_and_10_Logo; - } - else - { - _messageIcon.Image = SystemIcons.WinLogo.ToBitmap(); - } - break; - case ExtendedKryptonMessageBoxIcon.Application: - if (!string.IsNullOrEmpty(_applicationPath)) - { - Image tempImage = GraphicsExtensions.ExtractIconFromFilePath(_applicationPath).ToBitmap(); - Bitmap scaledImage = GraphicsExtensions.ScaleImage(tempImage, new Size(32, 32)); - - _messageIcon.Image = scaledImage; - } - else - { - _messageIcon.Image = SystemIcons.Application.ToBitmap(); - } - break; - case ExtendedKryptonMessageBoxIcon.SystemApplication: - _messageIcon.Image = SystemIcons.Application.ToBitmap(); - break; - } - - _messageIcon.Visible = (_kryptonMessageBoxIcon != ExtendedKryptonMessageBoxIcon.None); - - } - - private void UpdateButtons() - { - switch (_buttons) - { - case ExtendedMessageBoxButtons.OK: - _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.OK; - _button1.DialogResult = DialogResult.OK; - _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; - _button1.Visible = true; - _button1.Enabled = true; - break; - case ExtendedMessageBoxButtons.OKCancel: - _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.OK; - _button2.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel; - _button1.DialogResult = DialogResult.OK; - _button2.DialogResult = DialogResult.Cancel; - _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; - _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; - _button1.Visible = true; - _button1.Enabled = true; - _button2.Visible = true; - _button2.Enabled = true; - break; - case ExtendedMessageBoxButtons.YesNo: - _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.Yes; - _button2.Text = KryptonLanguageManager.GeneralToolkitStrings.No; - _button1.DialogResult = DialogResult.Yes; - _button2.DialogResult = DialogResult.No; - _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; - _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; - _button1.Visible = true; - _button1.Enabled = true; - _button2.Visible = true; - _button2.Enabled = true; - ControlBox = false; - break; - case ExtendedMessageBoxButtons.YesNoCancel: - _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.Yes; - _button2.Text = KryptonLanguageManager.GeneralToolkitStrings.No; - _button3.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel; - _button1.DialogResult = DialogResult.Yes; - _button2.DialogResult = DialogResult.No; - _button3.DialogResult = DialogResult.Cancel; - _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; - _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; - _button3.StateCommon.Content.ShortText.Font = _messageBoxTypeface; - _button1.Visible = true; - _button1.Enabled = true; - _button2.Visible = true; - _button2.Enabled = true; - _button3.Visible = true; - _button3.Enabled = true; - break; - case ExtendedMessageBoxButtons.RetryCancel: - _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.Retry; - _button2.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel; - _button1.DialogResult = DialogResult.Retry; - _button2.DialogResult = DialogResult.Cancel; - _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; - _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; - _button1.Visible = true; - _button1.Enabled = true; - _button2.Visible = true; - _button2.Enabled = true; - break; - case ExtendedMessageBoxButtons.AbortRetryIgnore: - _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.Abort; - _button2.Text = KryptonLanguageManager.GeneralToolkitStrings.Retry; - _button3.Text = KryptonLanguageManager.GeneralToolkitStrings.Ignore; - _button1.DialogResult = DialogResult.Abort; - _button2.DialogResult = DialogResult.Retry; - _button3.DialogResult = DialogResult.Ignore; - _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; - _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; - _button3.StateCommon.Content.ShortText.Font = _messageBoxTypeface; - _button1.Visible = true; - _button1.Enabled = true; - _button2.Visible = true; - _button2.Enabled = true; - _button3.Visible = true; - _button3.Enabled = true; - ControlBox = false; - break; - case ExtendedMessageBoxButtons.CancelTryContinue: - _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel; - _button2.Text = KryptonLanguageManager.GeneralToolkitStrings.TryAgain; - _button3.Text = KryptonLanguageManager.GeneralToolkitStrings.Continue; - _button1.DialogResult = DialogResult.Cancel; -#if NET6_0_OR_GREATER - _button2.DialogResult = DialogResult.TryAgain; - _button3.DialogResult = DialogResult.Continue; -#else - _button2.DialogResult = (DialogResult)10; - _button2.DialogResult = (DialogResult)11; -#endif - _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; - _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; - _button3.StateCommon.Content.ShortText.Font = _messageBoxTypeface; - _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() - { - switch (_defaultButton) - { - case KryptonMessageBoxDefaultButton.Button1: - _button1.Focus(); - break; - case KryptonMessageBoxDefaultButton.Button2: - _button2.Focus(); - break; - case KryptonMessageBoxDefaultButton.Button3: - _button3.Focus(); - break; - case KryptonMessageBoxDefaultButton.Button4: - _button4.Focus(); - break; - } - } - - private void UpdateHelp() - { - if (_helpInfo == null) - { - return; - } - - MessageButton helpButton = _buttons switch - { - ExtendedMessageBoxButtons.OK => _button2, - ExtendedMessageBoxButtons.OKCancel or ExtendedMessageBoxButtons.YesNo or ExtendedMessageBoxButtons.RetryCancel => _button3, - ExtendedMessageBoxButtons.AbortRetryIgnore or ExtendedMessageBoxButtons.YesNoCancel => _button4, - _ => throw new ArgumentOutOfRangeException() - }; - if (helpButton != null) - { - helpButton.Visible = true; - helpButton.Enabled = true; - helpButton.Text = KryptonLanguageManager.GeneralToolkitStrings.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 - { - Control control = FromHandle(_showOwner.Handle); - - MethodInfo mInfoMethod = control.GetType().GetMethod(@"OnHelpRequested", BindingFlags.Instance | BindingFlags.NonPublic, - Type.DefaultBinder, new[] { typeof(HelpEventArgs) }, null); - if (mInfoMethod != null) - { - mInfoMethod.Invoke(control, new object[] { 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 if failure to send to Parent - } - - } - - 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 != null ? Screen.FromHandle(showOwner.Handle) : Screen.PrimaryScreen; - SizeF scaledMonitorSize = screen.Bounds.Size; - scaledMonitorSize.Width *= 2 / 3.0f; - scaledMonitorSize.Height *= 0.95f; - - kwlblMessageText.UpdateFont(); - SizeF messageSize = g.MeasureString(_text, kwlblMessageText.Font, scaledMonitorSize); - // SKC: Don't forget to add the TextExtra into the calculation - SizeF captionSize = g.MeasureString($@"{_caption} {TextExtra}", kwlblMessageText.Font, scaledMonitorSize); - - var messageXSize = Math.Max(messageSize.Width, captionSize.Width); - // Work out DPI adjustment factor - messageSize.Width = messageXSize * FactorDpiX; - messageSize.Height *= FactorDpiY; - - // 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); - } - - // Find size of icon area plus the text area added together - if (_messageIcon.Image != null) - { - return new Size(textSize.Width + _messageIcon.Width, Math.Max(_messageIcon.Height + 10, textSize.Height)); - } - - return textSize; - } - - private Size UpdateButtonsSizing() - { - var numButtons = 1; - - // Button1 is always visible - Size button1Size = _button1.GetPreferredSize(Size.Empty); - Size maxButtonSize = new(button1Size.Width + GAP, button1Size.Height); - - // If Button2 is visible - if (_button2.Enabled) - { - numButtons++; - Size button2Size = _button2.GetPreferredSize(Size.Empty); - maxButtonSize.Width = Math.Max(maxButtonSize.Width, button2Size.Width + GAP); - 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 + GAP); - 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 + GAP); - maxButtonSize.Height = Math.Max(maxButtonSize.Height, button4Size.Height); - } - - // Start positioning buttons 10 pixels from right edge - var right = _panelButtons.Right - GAP; - - // If Button4 is visible - if (_button4.Enabled) - { - _button4.Location = new Point(right - maxButtonSize.Width, GAP); - _button4.Size = maxButtonSize; - right -= maxButtonSize.Width + GAP; - } - - // If Button3 is visible - if (_button3.Enabled) - { - _button3.Location = new Point(right - maxButtonSize.Width, GAP); - _button3.Size = maxButtonSize; - right -= maxButtonSize.Width + GAP; - } - - // If Button2 is visible - if (_button2.Enabled) - { - _button2.Location = new Point(right - maxButtonSize.Width, GAP); - _button2.Size = maxButtonSize; - right -= maxButtonSize.Width + GAP; - } - - // Button1 is always visible - _button1.Location = new Point(right - maxButtonSize.Width, GAP); - _button1.Size = maxButtonSize; - - // Size the panel for the buttons - _panelButtons.Size = new Size((maxButtonSize.Width * numButtons) + (GAP * (numButtons + 1)), maxButtonSize.Height + (GAP * 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)); - } - - 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.Control - || (e.KeyCode != Keys.C) - ) - { - return; - } - - 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(kwlblMessageText.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 (_openInExplorer) - { - OpenInExplorer(e.Link.LinkData.ToString()); - } - else - { - if (_linkLabelCommand != null) - { - _linkLabelCommand.PerformExecute(); - } - else if (_linkLaunchArgument != null) - { - Process.Start(_linkLaunchArgument); - } - } - } - catch (Exception exc) - { - ExceptionCapture.CaptureException(exc); - } - } - - private void OpenInExplorer(string path) - { - try - { - Process.Start(@"explorer.exe", path); - } - catch (Exception e) - { - ExceptionCapture.CaptureException(e); - } - } - - private void UpdateContentLinkArea(LinkArea? contentLinkArea) - { - if (contentLinkArea != null) - { - klwlblMessageText.LinkArea = (LinkArea)contentLinkArea; - } - } - - private void UpdateContentAreaType(ExtendedKryptonMessageBoxMessageContainerType? messageContainerType, ContentAlignment? messageTextAlignment, PaletteRelativeAlign? richTextBoxTextAlignment) - { - switch (messageContainerType) - { - case ExtendedKryptonMessageBoxMessageContainerType.HyperLink: - klwlblMessageText.Visible = true; - - kwlblMessageText.Visible = false; - - klwlblMessageText.TextAlign = messageTextAlignment ?? ContentAlignment.MiddleLeft; - - krtbMessageText.Visible = false; - break; - case ExtendedKryptonMessageBoxMessageContainerType.Normal: - klwlblMessageText.Visible = false; - - kwlblMessageText.Visible = true; - - kwlblMessageText.TextAlign = messageTextAlignment ?? ContentAlignment.MiddleLeft; - - krtbMessageText.Visible = false; - break; - case ExtendedKryptonMessageBoxMessageContainerType.RichTextBox: - klwlblMessageText.Visible = false; - - kwlblMessageText.Visible = false; - - krtbMessageText.Visible = true; - - krtbMessageText.StateCommon.Content.TextH = richTextBoxTextAlignment ?? PaletteRelativeAlign.Inherit; - break; - } - } - - private static void Initialize() - { - if (_hHook != IntPtr.Zero) - { - throw new NotSupportedException("multiple calls are not supported"); - } - - if (_showOwner != null) - { - _hHook = PlatformEvents.SetWindowsHookEx(WH_CALLWNDPROCRET, _hookProc, IntPtr.Zero, AppDomain.GetCurrentThreadId()); - } - } - - private static IntPtr MessageBoxHookProc(int nCode, IntPtr wParam, IntPtr lParam) - { - if (nCode < 0) - { - return PlatformEvents.CallNextHookEx(_hHook, nCode, wParam, lParam); - } - - CWPRETSTRUCT msg = (CWPRETSTRUCT)Marshal.PtrToStructure(lParam, typeof(CWPRETSTRUCT)); - IntPtr hook = _hHook; - - if (msg.message == (int)CbtHookAction.HCBT_ACTIVATE) - { - try - { - CenterWindow(msg.hwnd); - } - finally - { - PlatformEvents.UnhookWindowsHookEx(_hHook); - _hHook = IntPtr.Zero; - } - } - - return PlatformEvents.CallNextHookEx(hook, nCode, wParam, lParam); - } - - private static void CenterWindow(IntPtr hChildWnd) - { - Rectangle recChild = new Rectangle(0, 0, 0, 0); - bool success = PlatformEvents.GetWindowRect(hChildWnd, ref recChild); - - int width = recChild.Width - recChild.X; - int height = recChild.Height - recChild.Y; - - Rectangle recParent = new Rectangle(0, 0, 0, 0); - success = PlatformEvents.GetWindowRect(_showOwner.Handle, ref recParent); - - Point ptCenter = new Point(0, 0); - ptCenter.X = recParent.X + ((recParent.Width - recParent.X) / 2); - ptCenter.Y = recParent.Y + ((recParent.Height - recParent.Y) / 2); - - - Point ptStart = new Point(0, 0); - ptStart.X = (ptCenter.X - (width / 2)); - ptStart.Y = (ptCenter.Y - (height / 2)); - - ptStart.X = (ptStart.X < 0) ? 0 : ptStart.X; - ptStart.Y = (ptStart.Y < 0) ? 0 : ptStart.Y; - - int result = PlatformEvents.MoveWindow(hChildWnd, ptStart.X, ptStart.Y, width, - height, false); - } - - private void OnTimerElapsed(object state) - { - IntPtr mbWnd = PlatformEvents.FindWindow("#32770", _caption); // lpClassName is #32770 for MessageBox - if (mbWnd != IntPtr.Zero) - { - PlatformEvents.SendMessage(mbWnd, WM_CLOSE, IntPtr.Zero, IntPtr.Zero); - } - - _timeOutTimer.Dispose(); - - _timedOut = true; - } - - private void SetupOptionalCheckBox() - { - kcbOptionalCheckBox.Visible = _showOptionalCheckBox; - - kcbOptionalCheckBox.Checked = _optionalCheckBoxChecked; - - kcbOptionalCheckBox.Text = _checkBoxText; - - kcbOptionalCheckBox.ThreeState = _useOptionalCheckBoxThreeState; - } - - internal static bool ReturnCheckBoxCheckedValue() - { - KryptonMessageBoxExtendedForm messageBoxExtendedForm = new KryptonMessageBoxExtendedForm(); - - return messageBoxExtendedForm._optionalCheckBoxChecked; - } - - internal static CheckState ReturnCheckBoxCheckState() - { - KryptonMessageBoxExtendedForm messageBoxExtendedForm = new KryptonMessageBoxExtendedForm(); - - return messageBoxExtendedForm.kcbOptionalCheckBox.CheckState; - } - - private void OptionalCheckBox_CheckedChanged(object sender, EventArgs e) => _optionalCheckBoxChecked = kcbOptionalCheckBox.Checked; - - #endregion - - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Left to Right/VisualMessageBoxExtendedForm.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Left to Right/VisualMessageBoxExtendedForm.Designer.cs new file mode 100644 index 000000000..203e0111c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Left to Right/VisualMessageBoxExtendedForm.Designer.cs @@ -0,0 +1,333 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Messagebox +{ + partial class VisualMessageBoxExtendedForm + { + /// + /// 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.Suite.Extended.Messagebox.MessageButton(); + this._button3 = new Krypton.Toolkit.Suite.Extended.Messagebox.MessageButton(); + this._button1 = new Krypton.Toolkit.Suite.Extended.Messagebox.MessageButton(); + this._button2 = new Krypton.Toolkit.Suite.Extended.Messagebox.MessageButton(); + this._messageIcon = new System.Windows.Forms.PictureBox(); + this.kpnlContent = new Krypton.Toolkit.KryptonPanel(); + this.klwlblMessageText = new Krypton.Toolkit.KryptonLinkWrapLabel(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.krtbMessageText = new Krypton.Toolkit.KryptonRichTextBox(); + this.kcbOptionalCheckBox = new Krypton.Toolkit.KryptonCheckBox(); + this.kwlblMessageText = new Krypton.Toolkit.KryptonTextBox(); + ((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.kpnlContent)).BeginInit(); + this.kpnlContent.SuspendLayout(); + this.tableLayoutPanel2.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(196, 96); + 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.tableLayoutPanel2, 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(196, 96); + 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, 75); + 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(196, 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(196, 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(196, 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, 24); + this._button4.TabIndex = 2; + 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(159, 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, 24); + this._button3.TabIndex = 2; + 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(83, 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, 24); + this._button1.TabIndex = 0; + 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(121, 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, 24); + this._button2.TabIndex = 1; + 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(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, 67); + this._messageIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; + this._messageIcon.TabIndex = 0; + this._messageIcon.TabStop = false; + // + // kpnlContent + // + this.kpnlContent.Controls.Add(this.kwlblMessageText); + this.kpnlContent.Controls.Add(this.klwlblMessageText); + this.kpnlContent.Controls.Add(this.krtbMessageText); + this.kpnlContent.Dock = System.Windows.Forms.DockStyle.Fill; + this.kpnlContent.Location = new System.Drawing.Point(3, 3); + this.kpnlContent.Name = "kpnlContent"; + this.kpnlContent.Size = new System.Drawing.Size(139, 37); + this.kpnlContent.TabIndex = 1; + // + // 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(139, 37); + this.klwlblMessageText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // 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.kcbOptionalCheckBox, 0, 1); + this.tableLayoutPanel2.Controls.Add(this.kpnlContent, 0, 0); + this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel2.Location = new System.Drawing.Point(48, 3); + 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(145, 69); + this.tableLayoutPanel2.TabIndex = 1; + // + // krtbMessageText + // + this.krtbMessageText.Dock = System.Windows.Forms.DockStyle.Fill; + this.krtbMessageText.Location = new System.Drawing.Point(0, 0); + this.krtbMessageText.Name = "krtbMessageText"; + this.krtbMessageText.ReadOnly = true; + this.krtbMessageText.Size = new System.Drawing.Size(139, 37); + this.krtbMessageText.TabIndex = 0; + this.krtbMessageText.Text = ""; + // + // kcbOptionalCheckBox + // + this.kcbOptionalCheckBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.kcbOptionalCheckBox.Location = new System.Drawing.Point(3, 46); + this.kcbOptionalCheckBox.Name = "kcbOptionalCheckBox"; + this.kcbOptionalCheckBox.Size = new System.Drawing.Size(139, 20); + this.kcbOptionalCheckBox.TabIndex = 0; + this.kcbOptionalCheckBox.Values.Text = "CB1"; + this.kcbOptionalCheckBox.CheckedChanged += new System.EventHandler(this.OptionalCheckBox_CheckedChanged); + // + // kwlblMessageText + // + this.kwlblMessageText.Dock = System.Windows.Forms.DockStyle.Fill; + this.kwlblMessageText.InputControlStyle = Krypton.Toolkit.InputControlStyle.PanelClient; + this.kwlblMessageText.Location = new System.Drawing.Point(0, 0); + this.kwlblMessageText.Margin = new System.Windows.Forms.Padding(5, 0, 0, 0); + this.kwlblMessageText.Multiline = true; + this.kwlblMessageText.Name = "kwlblMessageText"; + this.kwlblMessageText.ReadOnly = true; + this.kwlblMessageText.Size = new System.Drawing.Size(139, 37); + this.kwlblMessageText.StateCommon.Border.DrawBorders = Krypton.Toolkit.PaletteDrawBorders.None; + this.kwlblMessageText.TabIndex = 2; + this.kwlblMessageText.TabStop = false; + this.kwlblMessageText.Text = "Message Text\r\n.\ttabbed"; + // + // VisualMessageBoxExtendedForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(196, 96); + this.Controls.Add(this.kryptonPanel1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "VisualMessageBoxExtendedForm"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + ((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.kpnlContent)).EndInit(); + this.kpnlContent.ResumeLayout(false); + this.kpnlContent.PerformLayout(); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.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 TableLayoutPanel tableLayoutPanel2; + private KryptonCheckBox kcbOptionalCheckBox; + private KryptonPanel kpnlContent; + private KryptonTextBox kwlblMessageText; + private KryptonLinkWrapLabel klwlblMessageText; + private KryptonRichTextBox krtbMessageText; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Left to Right/VisualMessageBoxExtendedForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Left to Right/VisualMessageBoxExtendedForm.cs new file mode 100644 index 000000000..2a0708ead --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Left to Right/VisualMessageBoxExtendedForm.cs @@ -0,0 +1,1530 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +// ReSharper disable NotAccessedField.Local + +using Resources = Krypton.Toolkit.Suite.Extended.Messagebox.Properties.Resources; + +using ContentAlignment = System.Drawing.ContentAlignment; +using Timer = System.Windows.Forms.Timer; + +namespace Krypton.Toolkit.Suite.Extended.Messagebox +{ + internal partial class VisualMessageBoxExtendedForm : KryptonForm + { + #region Static Fields + + public const int WH_CALLWNDPROCRET = 12; + + private const int WM_CLOSE = 0x0010; + + #endregion + + #region Instance Fields + + private readonly bool _showCloseButton; + + private readonly string _text; + private readonly string _caption; + + 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 static /*readonly*/ IWin32Window? _showOwner; + private readonly HelpInfo? _helpInfo; + private readonly ContentAlignment _messageTextAlignment; + + private readonly Image? _applicationImage; + + private readonly KryptonMessageBoxExtendedData _messageBoxExtendedData; + + #endregion + + #region Extended Fields + + private readonly bool _showHelpButton; + + private readonly bool _openInExplorer; + + private readonly bool _useTimeOut; + + private readonly bool _showOptionalCheckBox; + + private readonly bool _useOptionalCheckBoxThreeState; + + private readonly bool _initialDoNotShowAgainCheck; + + private bool _isDoNotShowAgainCheckedResult; + + private readonly Color _messageTextColour; + + private readonly Color[]? _buttonTextColours = new Color[4]; + + private readonly CheckState _initialDoNotShowAgainCheckState; + + private CheckState _doNotShowAgainCheckStateResult; + + private readonly DialogResult _buttonOneCustomDialogResult; + + private readonly DialogResult _buttonTwoCustomDialogResult; + + private readonly DialogResult _buttonThreeCustomDialogResult; + + private readonly DialogResult _buttonFourDialogResult; + + private readonly Font _messageBoxTypeface; + + private readonly ExtendedMessageBoxButtons _buttons; + + private readonly ExtendedKryptonMessageBoxIcon _kryptonMessageBoxIcon; + + private readonly Image? _customKryptonMessageBoxIcon; + + private readonly string _buttonOneCustomText; + + private readonly string _buttonTwoCustomText; + + private readonly string _buttonThreeCustomText; + + private readonly string _buttonFourCustomText; + + private readonly string _applicationPath; + + private readonly string _checkBoxText; + + private readonly ExtendedKryptonMessageBoxMessageContainerType _messageContainerType; + + private readonly KryptonCommand? _linkLabelCommand; + + private readonly LinkArea _contentLinkArea; + + private readonly ProcessStartInfo? _linkLaunchArgument; + + private static readonly PlatformInvoke.HookProc _hookProc; + + private static IntPtr _hHook; + + private readonly Timer _timeOutTimer; + + private int _timeOut; + + private int? _timeOutInterval; + + private bool _timedOut; + + private DialogResult _result; + + private DialogResult _timerResult; + + private readonly PaletteRelativeAlign _richTextBoxTextAlignment; + + #endregion + + #region Identity + + static VisualMessageBoxExtendedForm() + { + _hookProc = new PlatformInvoke.HookProc(MessageBoxHookProc); + + _hHook = IntPtr.Zero; + } + + public VisualMessageBoxExtendedForm() + { + InitializeComponent(); + } + + internal VisualMessageBoxExtendedForm(IWin32Window? showOwner, string text, string caption, + ExtendedMessageBoxButtons buttons, + ExtendedKryptonMessageBoxIcon icon, + KryptonMessageBoxDefaultButton defaultButton, + HelpInfo? helpInfo, bool? showCtrlCopy, + Font? messageBoxTypeface, + Image? customKryptonMessageBoxIcon, bool? showHelpButton, + Color? messageTextColour, Color[]? buttonTextColours, + DialogResult? buttonOneCustomDialogResult, + DialogResult? buttonTwoCustomDialogResult, + DialogResult? buttonThreeCustomDialogResult, + DialogResult? buttonFourDialogResult, + string? buttonOneCustomText, string? buttonTwoCustomText, + string? buttonThreeCustomText, string? buttonFourCustomText, + string? applicationPath, + ExtendedKryptonMessageBoxMessageContainerType? messageContainerType, + KryptonCommand? linkLabelCommand, + LinkArea? contentLinkArea, + ProcessStartInfo? linkLaunchArgument, + bool? openInExplorer, + ContentAlignment? messageTextAlignment, + PaletteRelativeAlign? richTextBoxTextAlignment, + HorizontalAlignment? messageTextBoxAlignment, + bool? showOptionalCheckBox, + bool? initialDoNotShowAgainCheckBoxChecked, + CheckState? initialDoNotShowAgainCheckBoxCheckState, + string? optionalCheckBoxText, + bool? useOptionalCheckBoxThreeState, + bool? useTimeOut, + int? timeOut, + int? timeOutInterval, + DialogResult? timerResult) + { + // Store incoming values + _text = text; + + _caption = useTimeOut is { } or false ? $"{caption} [{timeOut}]" : caption; + + _buttons = buttons; + _kryptonMessageBoxIcon = icon; + _defaultButton = defaultButton; + _helpInfo = helpInfo ?? new HelpInfo(string.Empty, HelpNavigator.AssociateIndex, null); + _showOwner = showOwner; + _messageTextAlignment = messageTextAlignment ?? ContentAlignment.MiddleLeft; + + // Extended values + _messageBoxTypeface = messageBoxTypeface ?? KryptonManager.CurrentGlobalPalette.BaseFont; + _customKryptonMessageBoxIcon = customKryptonMessageBoxIcon; + _showHelpButton = showHelpButton ?? false; + _messageTextColour = messageTextColour ?? Color.Empty; + _buttonTextColours = buttonTextColours; + _buttonOneCustomDialogResult = buttonOneCustomDialogResult ?? DialogResult.Yes; + _buttonTwoCustomDialogResult = buttonTwoCustomDialogResult ?? DialogResult.No; + _buttonThreeCustomDialogResult = buttonThreeCustomDialogResult ?? DialogResult.Cancel; + _buttonFourDialogResult = buttonFourDialogResult ?? DialogResult.Retry; + _buttonOneCustomText = buttonOneCustomText ?? KryptonManager.Strings.GeneralStrings.Yes; + _buttonTwoCustomText = buttonTwoCustomText ?? KryptonManager.Strings.GeneralStrings.No; + _buttonThreeCustomText = buttonThreeCustomText ?? KryptonManager.Strings.GeneralStrings.Cancel; + _buttonFourCustomText = buttonFourCustomText ?? KryptonManager.Strings.GeneralStrings.Retry; + _applicationPath = applicationPath ?? string.Empty; + _messageContainerType = messageContainerType ?? ExtendedKryptonMessageBoxMessageContainerType.Normal; + _linkLabelCommand = linkLabelCommand ?? new KryptonCommand(); + _contentLinkArea = contentLinkArea ?? new LinkArea(0, text.Length); + _linkLaunchArgument = linkLaunchArgument ?? new ProcessStartInfo(); + _openInExplorer = openInExplorer ?? false; + _richTextBoxTextAlignment = richTextBoxTextAlignment ?? PaletteRelativeAlign.Inherit; + _useTimeOut = useTimeOut ?? false; + _timeOut = timeOut ?? 60; + _timeOutInterval = timeOutInterval ?? 1000; + _timeOutTimer = new Timer(); + _timeOutTimer.Interval = _timeOutInterval ?? 1000; + _timerResult = timerResult ?? DialogResult.None; + //_openInExplorer = openInExplorer ?? false; + + // Optional checkbox + _showOptionalCheckBox = showOptionalCheckBox ?? false; + _isDoNotShowAgainCheckedResult = initialDoNotShowAgainCheckBoxChecked ?? false; + _initialDoNotShowAgainCheckState = initialDoNotShowAgainCheckBoxCheckState ?? CheckState.Unchecked; + _checkBoxText = optionalCheckBoxText ?? string.Empty; + _useOptionalCheckBoxThreeState = useOptionalCheckBoxThreeState ?? false; + + // Create the form contents + InitializeComponent(); + + // Update contents to match requirements + UpdateText(); + UpdateIcon(); + UpdateButtons(); + UpdateDefault(); + UpdateHelp(); + UpdateTextExtra(showCtrlCopy); + + UpdateContentAreaType(messageContainerType, messageTextAlignment, messageTextBoxAlignment, richTextBoxTextAlignment); + + UpdateContentLinkArea(contentLinkArea); + + SetupOptionalCheckBox(); + + // Finally calculate and set form sizing + UpdateSizing(showOwner); + + _timeOutTimer.Tick += TimeOutTimer_Tick; + + if (_useTimeOut) + { + _timeOutTimer.Start(); + } + } + + public VisualMessageBoxExtendedForm(KryptonMessageBoxExtendedData messageBoxExtendedData) + { + _messageBoxExtendedData = messageBoxExtendedData; + + // Create the form contents + InitializeComponent(); + + RightToLeftLayout = _messageBoxExtendedData.Options.HasFlag(MessageBoxOptions.RtlReading); + + // Update contents to match requirements + UpdateText(_messageBoxExtendedData.Caption, messageBoxExtendedData.MessageText, _messageBoxExtendedData.Options, _messageBoxExtendedData.MessageContentAreaType); + UpdateIcon(_messageBoxExtendedData.Icon); + UpdateButtons(_messageBoxExtendedData.Buttons); + UpdateDefault(_messageBoxExtendedData.DefaultButton); + UpdateHelp(_messageBoxExtendedData.ShowHelpButton); + UpdateTextExtra(_messageBoxExtendedData.ShowCtrlCopy); + + UpdateContentAreaType(_messageBoxExtendedData.MessageContentAreaType, _messageBoxExtendedData.MessageTextAlignment, _messageBoxExtendedData.MessageTextBoxAlignment, _messageBoxExtendedData.RichTextBoxTextAlignment); + + UpdateContentLinkArea(_messageBoxExtendedData.ContentLinkArea); + + SetupOptionalCheckBox(); + + // Finally calculate and set form sizing + UpdateSizing(_messageBoxExtendedData.Owner); + } + + #endregion Identity + + #region Implementation + + private void UpdateText(string caption, string? text, MessageBoxOptions options, ExtendedKryptonMessageBoxMessageContainerType? contentAreaType) + { + // Set the text of the form + Text = string.IsNullOrEmpty(caption) ? string.Empty : caption.Split(Environment.NewLine.ToCharArray())[0]; + + switch (contentAreaType) + { + case ExtendedKryptonMessageBoxMessageContainerType.Normal: + kwlblMessageText.Text = text; + + kwlblMessageText.RightToLeft = options.HasFlag(MessageBoxOptions.RightAlign) ? RightToLeft.Yes : + options.HasFlag(MessageBoxOptions.RtlReading) ? RightToLeft.Inherit : RightToLeft.No; + break; + case ExtendedKryptonMessageBoxMessageContainerType.HyperLink: + klwlblMessageText.Text = text; + + klwlblMessageText.RightToLeft = options.HasFlag(MessageBoxOptions.RightAlign) + ? + RightToLeft.Yes + : options.HasFlag(MessageBoxOptions.RtlReading) + ? RightToLeft.Inherit + : RightToLeft.No; + break; + case ExtendedKryptonMessageBoxMessageContainerType.RichTextBox: + krtbMessageText.Text = text; + + krtbMessageText.RightToLeft = options.HasFlag(MessageBoxOptions.RightAlign) ? RightToLeft.Yes : + options.HasFlag(MessageBoxOptions.RtlReading) ? RightToLeft.Inherit : RightToLeft.No; + break; + case null: + kwlblMessageText.Text = text; + + kwlblMessageText.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 (_messageContainerType == ExtendedKryptonMessageBoxMessageContainerType.Normal) + { + kwlblMessageText.Visible = true; + kwlblMessageText.Text = _text; + kwlblMessageText.StateCommon.Content.Font = _messageBoxTypeface; + + kwlblMessageText.StateCommon.Content.Color1 = _messageTextColour; + + krtbMessageText.Visible = false; + + klwlblMessageText.Visible = false; + } + else if (_messageContainerType == ExtendedKryptonMessageBoxMessageContainerType.RichTextBox) + { + krtbMessageText.Visible = true; + + krtbMessageText.Text = _text; + + krtbMessageText.StateCommon.Content.Color1 = _messageTextColour; + + krtbMessageText.StateCommon.Content.Font = _messageBoxTypeface; + + kwlblMessageText.Visible = false; + + klwlblMessageText.Visible = false; + } + else if (_messageContainerType == ExtendedKryptonMessageBoxMessageContainerType.HyperLink) + { + klwlblMessageText.Visible = true; + + klwlblMessageText.Text = _text; + + klwlblMessageText.StateCommon.TextColor = _messageTextColour; + + klwlblMessageText.StateCommon.Font = _messageBoxTypeface; + + kwlblMessageText.Visible = false; + + krtbMessageText.Visible = false; + } + + kcbOptionalCheckBox.StateCommon.ShortText.Color1 = _messageTextColour; + + kcbOptionalCheckBox.StateCommon.ShortText.Color2 = _messageTextColour; + + kcbOptionalCheckBox.StateCommon.ShortText.Font = _messageBoxTypeface; + } + + private void UpdateTextExtra(bool? showCtrlCopy) + { + if (!showCtrlCopy.HasValue) + { + switch (_kryptonMessageBoxIcon) + { + case ExtendedKryptonMessageBoxIcon.Error: + case ExtendedKryptonMessageBoxIcon.Exclamation: + showCtrlCopy = true; + break; + } + } + + if (showCtrlCopy == true) + { + TextExtra = @"Ctrl+c to copy"; + } + } + + private void UpdateIcon(ExtendedKryptonMessageBoxIcon icon) + { + if (OSUtilities.IsAtLeastWindowsEleven) + { + switch (icon) + { + case ExtendedKryptonMessageBoxIcon.None: + // Windows XP and before will Beep, Vista and above do not! + if (GlobalStaticValues.OS_MAJOR_VERSION < 6) + { + SystemSounds.Beep.Play(); + } + break; + case ExtendedKryptonMessageBoxIcon.Hand: + _messageIcon.Image = Resources.Hand; + SystemSounds.Hand.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Question: + _messageIcon.Image = Resources.Question_Windows_11; + SystemSounds.Question.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Exclamation: + _messageIcon.Image = Resources.Warning_Windows_11; + SystemSounds.Exclamation.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Asterisk: + _messageIcon.Image = Resources.Asterisk_Windows_11; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Stop: + _messageIcon.Image = Resources.Stop; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Error: + _messageIcon.Image = Resources.Critical_Windows_11; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Warning: + _messageIcon.Image = Resources.Warning_Windows_11; + SystemSounds.Exclamation.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Information: + _messageIcon.Image = Resources.Information_Windows_11; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Shield: + _messageIcon.Image = Resources.UAC_Shield_Windows_11; + break; + case ExtendedKryptonMessageBoxIcon.WindowsLogo: + _messageIcon.Image = Resources.Windows11; + break; + case ExtendedKryptonMessageBoxIcon.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 ExtendedKryptonMessageBoxIcon.SystemApplication: + _messageIcon.Image = SystemIcons.Application.ToBitmap(); + break; + } + } + else + { + switch (icon) + { + case ExtendedKryptonMessageBoxIcon.None: + // Windows XP and before will Beep, Vista and above do not! + if (GlobalStaticValues.OS_MAJOR_VERSION < 6) + { + SystemSounds.Beep.Play(); + } + + break; + case ExtendedKryptonMessageBoxIcon.Hand: + _messageIcon.Image = Resources.Hand; + SystemSounds.Hand.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemHand: + _messageIcon.Image = SystemIcons.Hand.ToBitmap(); + SystemSounds.Hand.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Question: + _messageIcon.Image = Resources.Question; + SystemSounds.Question.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemQuestion: + _messageIcon.Image = SystemIcons.Question.ToBitmap(); + SystemSounds.Question.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Exclamation: + _messageIcon.Image = Resources.Warning; + SystemSounds.Exclamation.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemExclamation: + _messageIcon.Image = SystemIcons.Warning.ToBitmap(); + SystemSounds.Exclamation.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Asterisk: + _messageIcon.Image = OSUtilities.IsAtLeastWindowsEleven + ? Resources.Asterisk_Windows_11 + : Resources.Asterisk; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemAsterisk: + _messageIcon.Image = SystemIcons.Asterisk.ToBitmap(); + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Stop: + _messageIcon.Image = Resources.Stop; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Error: + _messageIcon.Image = Resources.Critical; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Warning: + _messageIcon.Image = Resources.Warning; + SystemSounds.Exclamation.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Information: + _messageIcon.Image = Resources.Information; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Shield: + if (OSUtilities.IsAtLeastWindowsEleven) + { + _messageIcon.Image = Resources.UAC_Shield_Windows_11; + } + else if (OSUtilities.IsWindowsTen) + { + _messageIcon.Image = Resources.UAC_Shield_Windows_10; + } + else + { + _messageIcon.Image = Resources.UAC_Shield_Windows_7; + } + + break; + case ExtendedKryptonMessageBoxIcon.WindowsLogo: + // Because Windows 11 displays a application icon, + // we need to rely on a image instead + if (OSUtilities.IsAtLeastWindowsEleven) + { + _messageIcon.Image = Resources.Windows11; + } + // Windows 10 + else if (OSUtilities.IsWindowsTen) + { + _messageIcon.Image = Resources.Windows_8_and_10_Logo; + } + else + { + _messageIcon.Image = SystemIcons.WinLogo.ToBitmap(); + } + + break; + case ExtendedKryptonMessageBoxIcon.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 ExtendedKryptonMessageBoxIcon.SystemApplication: + _messageIcon.Image = SystemIcons.Application.ToBitmap(); + break; + } + } + + _messageIcon.Visible = _kryptonMessageBoxIcon != ExtendedKryptonMessageBoxIcon.None; + } + + private void UpdateIcon() + { + switch (_kryptonMessageBoxIcon) + { + case ExtendedKryptonMessageBoxIcon.Custom: + if (_customKryptonMessageBoxIcon != null) + { + _messageIcon.Image = _customKryptonMessageBoxIcon; + } + else + { + _messageIcon.Image = SystemIcons.Application.ToBitmap(); + } + break; + case ExtendedKryptonMessageBoxIcon.None: + // Windows XP and before will Beep, Vista and above do not! + if (GlobalStaticValues.OS_MAJOR_VERSION < 6) + { + SystemSounds.Beep.Play(); + } + break; + case ExtendedKryptonMessageBoxIcon.Hand: + _messageIcon.Image = Resources.Hand; + SystemSounds.Hand.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemHand: + _messageIcon.Image = SystemIcons.Hand.ToBitmap(); + SystemSounds.Hand.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Question: + _messageIcon.Image = Resources.Question; + SystemSounds.Question.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemQuestion: + _messageIcon.Image = SystemIcons.Question.ToBitmap(); + SystemSounds.Question.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Exclamation: + _messageIcon.Image = Resources.Warning; + SystemSounds.Exclamation.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemExclamation: + _messageIcon.Image = SystemIcons.Exclamation.ToBitmap(); + SystemSounds.Exclamation.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Asterisk: + _messageIcon.Image = Resources.Asterisk; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemAsterisk: + _messageIcon.Image = SystemIcons.Asterisk.ToBitmap(); + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Stop: + _messageIcon.Image = Resources.Stop; + SystemSounds.Hand.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Error: + _messageIcon.Image = Resources.Critical; + SystemSounds.Hand.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Warning: + _messageIcon.Image = Resources.Warning; + SystemSounds.Exclamation.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Information: + _messageIcon.Image = Resources.Information; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Shield: + if (OSUtilities.IsAtLeastWindowsEleven) + { + _messageIcon.Image = Resources.UAC_Shield_Windows_11; + } + // Windows 10 + else if (OSUtilities.IsWindowsTen) + { + _messageIcon.Image = Resources.UAC_Shield_Windows_10; + } + else + { + _messageIcon.Image = Resources.UAC_Shield_Windows_7; + } + break; + case ExtendedKryptonMessageBoxIcon.WindowsLogo: + // Because Windows 11 displays a generic application icon, + // we need to rely on a image instead + if (OSUtilities.IsAtLeastWindowsEleven) + { + _messageIcon.Image = Resources.Windows11; + } + // Windows 10, 8.1 & 8 + else if (OSUtilities.IsWindowsTen || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsEight) + { + _messageIcon.Image = Resources.Windows_8_and_10_Logo; + } + else + { + _messageIcon.Image = SystemIcons.WinLogo.ToBitmap(); + } + break; + case ExtendedKryptonMessageBoxIcon.Application: + if (!string.IsNullOrEmpty(_applicationPath)) + { + Image tempImage = GraphicsExtensions.ExtractIconFromFilePath(_applicationPath)?.ToBitmap()!; + Bitmap? scaledImage = GraphicsExtensions.ScaleImage(tempImage, new Size(32, 32)); + + _messageIcon.Image = scaledImage; + } + else + { + _messageIcon.Image = SystemIcons.Application.ToBitmap(); + } + break; + case ExtendedKryptonMessageBoxIcon.SystemApplication: + _messageIcon.Image = SystemIcons.Application.ToBitmap(); + break; + } + + _messageIcon.Visible = _kryptonMessageBoxIcon != ExtendedKryptonMessageBoxIcon.None; + + } + + private void UpdateButtons(ExtendedMessageBoxButtons buttons) + { + switch (buttons) + { + case ExtendedMessageBoxButtons.OK: + _button1.Text = KryptonManager.Strings.GeneralStrings.OK; + _button1.DialogResult = DialogResult.OK; + _button1.Visible = true; + _button1.Enabled = true; + break; + case ExtendedMessageBoxButtons.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 ExtendedMessageBoxButtons.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 ExtendedMessageBoxButtons.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 ExtendedMessageBoxButtons.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 ExtendedMessageBoxButtons.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 ExtendedMessageBoxButtons.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; + } + + if (_messageBoxExtendedData.ShowActionButton != null) + { + //_button5.Text = _actionButtonText; + //_button5.Visible = true; + //_button5.Enabled = true; + //_button5.KryptonCommand = _actionButtonCommand; + } + + // Do we ignore the Alt+F4 on the buttons? + if (!ControlBox) + { + _button1.IgnoreAltF4 = true; + _button2.IgnoreAltF4 = true; + _button3.IgnoreAltF4 = true; + _button4.IgnoreAltF4 = true; + //_button5.IgnoreAltF4 = true; + } + } + + private void UpdateButtons() + { + switch (_buttons) + { + case ExtendedMessageBoxButtons.OK: + _button1.Text = KryptonManager.Strings.GeneralStrings.OK; + _button1.DialogResult = DialogResult.OK; + _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button1.Visible = true; + _button1.Enabled = true; + break; + case ExtendedMessageBoxButtons.OKCancel: + _button1.Text = KryptonManager.Strings.GeneralStrings.OK; + _button2.Text = KryptonManager.Strings.GeneralStrings.Cancel; + _button1.DialogResult = DialogResult.OK; + _button2.DialogResult = DialogResult.Cancel; + _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button1.Visible = true; + _button1.Enabled = true; + _button2.Visible = true; + _button2.Enabled = true; + break; + case ExtendedMessageBoxButtons.YesNo: + _button1.Text = KryptonManager.Strings.GeneralStrings.Yes; + _button2.Text = KryptonManager.Strings.GeneralStrings.No; + _button1.DialogResult = DialogResult.Yes; + _button2.DialogResult = DialogResult.No; + _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button1.Visible = true; + _button1.Enabled = true; + _button2.Visible = true; + _button2.Enabled = true; + ControlBox = false; + break; + case ExtendedMessageBoxButtons.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.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button3.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button1.Visible = true; + _button1.Enabled = true; + _button2.Visible = true; + _button2.Enabled = true; + _button3.Visible = true; + _button3.Enabled = true; + break; + case ExtendedMessageBoxButtons.RetryCancel: + _button1.Text = KryptonManager.Strings.GeneralStrings.Retry; + _button2.Text = KryptonManager.Strings.GeneralStrings.Cancel; + _button1.DialogResult = DialogResult.Retry; + _button2.DialogResult = DialogResult.Cancel; + _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button1.Visible = true; + _button1.Enabled = true; + _button2.Visible = true; + _button2.Enabled = true; + break; + case ExtendedMessageBoxButtons.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.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button3.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button1.Visible = true; + _button1.Enabled = true; + _button2.Visible = true; + _button2.Enabled = true; + _button3.Visible = true; + _button3.Enabled = true; + ControlBox = false; + break; + case ExtendedMessageBoxButtons.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; + _button2.DialogResult = (DialogResult)11; +#endif + _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button3.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _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 KryptonMessageBoxDefaultButton.Button5: + // AcceptButton = _showActionButton ? _button5 : _button1; + // break; + case null: + AcceptButton = _button1; + break; + default: + AcceptButton = _showHelpButton ? _button4 : _button1; + break; + } + } + + private void UpdateDefault() + { + switch (_defaultButton) + { + case KryptonMessageBoxDefaultButton.Button1: + _button1.Focus(); + break; + case KryptonMessageBoxDefaultButton.Button2: + _button2.Focus(); + break; + case KryptonMessageBoxDefaultButton.Button3: + _button3.Focus(); + break; + case KryptonMessageBoxDefaultButton.Button4: + _button4.Focus(); + break; + } + } + + private void UpdateHelp(bool? showHelpButton) + { + if (showHelpButton != null) + { + return; + } + + MessageButton helpButton = _buttons switch + { + ExtendedMessageBoxButtons.OK => _button2, + ExtendedMessageBoxButtons.OKCancel or ExtendedMessageBoxButtons.YesNo or ExtendedMessageBoxButtons.RetryCancel => _button3, + ExtendedMessageBoxButtons.AbortRetryIgnore or ExtendedMessageBoxButtons.YesNoCancel => _button4, + _ => throw new ArgumentOutOfRangeException() + }; + if (helpButton != null) + { + helpButton.Visible = true; + helpButton.Enabled = true; + helpButton.Text = KryptonManager.Strings.GeneralStrings.Help; + + helpButton.KeyPress += (_, _) => LaunchHelp(_messageBoxExtendedData.Owner); + + helpButton.Click += (_, _) => LaunchHelp(_messageBoxExtendedData.Owner); + } + } + + /// + /// 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, new[] { typeof(HelpEventArgs) }, null)!; + mInfoMethod.Invoke(control, new object[] { 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 if failure to send to Parent + } + } + + private void UpdateHelp() + { + if (_helpInfo == null) + { + return; + } + + MessageButton helpButton = _buttons switch + { + ExtendedMessageBoxButtons.OK => _button2, + ExtendedMessageBoxButtons.OKCancel or ExtendedMessageBoxButtons.YesNo or ExtendedMessageBoxButtons.RetryCancel => _button3, + ExtendedMessageBoxButtons.AbortRetryIgnore or ExtendedMessageBoxButtons.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() + { + try + { + Control? control = FromHandle(_showOwner!.Handle); + + MethodInfo? mInfoMethod = control!.GetType().GetMethod(@"OnHelpRequested", BindingFlags.Instance | BindingFlags.NonPublic, + Type.DefaultBinder, new[] { typeof(HelpEventArgs) }, null)!; + if (mInfoMethod != null) + { + mInfoMethod.Invoke(control, new object[] { 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 if failure to send to Parent + } + + } + + 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 != null ? Screen.FromHandle(showOwner.Handle) : Screen.PrimaryScreen; + SizeF scaledMonitorSize = screen!.Bounds.Size; + scaledMonitorSize.Width *= 2 / 3.0f; + scaledMonitorSize.Height *= 0.95f; + + //kwlblMessageText.UpdateFont(); + SizeF messageSize = g.MeasureString(_text, kwlblMessageText.Font, scaledMonitorSize); + // SKC: Don't forget to add the TextExtra into the calculation + SizeF captionSize = g.MeasureString($@"{_caption} {TextExtra}", kwlblMessageText.Font, scaledMonitorSize); + + var messageXSize = Math.Max(messageSize.Width, captionSize.Width); + // Work out DPI adjustment factor + messageSize.Width = messageXSize * FactorDpiX; + messageSize.Height *= FactorDpiY; + + // 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); + } + + // Find size of icon area plus the text area added together + if (_messageIcon.Image != null) + { + return new Size(textSize.Width + _messageIcon.Width, Math.Max(_messageIcon.Height + 10, textSize.Height)); + } + + return textSize; + } + + private Size UpdateButtonsSizing() + { + var numButtons = 1; + + // Button1 is always visible + Size button1Size = _button1.GetPreferredSize(Size.Empty); + Size maxButtonSize = new(button1Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING, button1Size.Height); + + // 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; + + // 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 GLOBAL_BUTTON_PADDINGs 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.Control + || e.KeyCode != Keys.C + ) + { + return; + } + + 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(kwlblMessageText.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 (_openInExplorer) + { + OpenInExplorer(e!.Link.LinkData.ToString()); + } + else + { + if (_linkLabelCommand != null) + { + _linkLabelCommand.PerformExecute(); + } + else if (_linkLaunchArgument != null) + { + Process.Start(_linkLaunchArgument); + } + } + } + catch (Exception exc) + { + DebugUtilities.NotImplemented(exc.ToString()); + } + } + + private void OpenInExplorer(string path) + { + try + { + Process.Start(@"explorer.exe", path); + } + catch (Exception e) + { + DebugUtilities.NotImplemented(e.ToString()); + } + } + + private void UpdateContentLinkArea(LinkArea? contentLinkArea) + { + if (contentLinkArea != null) + { + klwlblMessageText.LinkArea = (LinkArea)contentLinkArea; + } + } + + private void UpdateContentAreaType(ExtendedKryptonMessageBoxMessageContainerType? messageContainerType, ContentAlignment? messageTextAlignment, HorizontalAlignment? messageAlignment, PaletteRelativeAlign? richTextBoxTextAlignment) + { + switch (messageContainerType) + { + case ExtendedKryptonMessageBoxMessageContainerType.HyperLink: + klwlblMessageText.Visible = true; + + kwlblMessageText.Visible = false; + + klwlblMessageText.TextAlign = messageTextAlignment ?? ContentAlignment.MiddleLeft; + + krtbMessageText.Visible = false; + break; + case ExtendedKryptonMessageBoxMessageContainerType.Normal: + klwlblMessageText.Visible = false; + + kwlblMessageText.Visible = true; + + kwlblMessageText.TextAlign = messageAlignment ?? HorizontalAlignment.Left; + + krtbMessageText.Visible = false; + break; + case ExtendedKryptonMessageBoxMessageContainerType.RichTextBox: + klwlblMessageText.Visible = false; + + kwlblMessageText.Visible = false; + + krtbMessageText.Visible = true; + + krtbMessageText.StateCommon.Content.TextH = richTextBoxTextAlignment ?? PaletteRelativeAlign.Inherit; + break; + } + } + + private static void Initialize() + { + if (_hHook != IntPtr.Zero) + { + throw new NotSupportedException("multiple calls are not supported"); + } + + if (_showOwner != null) + { + _hHook = PlatformEvents.SetWindowsHookEx(WH_CALLWNDPROCRET, _hookProc, IntPtr.Zero, AppDomain.GetCurrentThreadId()); + } + } + + private static IntPtr MessageBoxHookProc(int nCode, IntPtr wParam, IntPtr lParam) + { + if (nCode < 0) + { + return PlatformEvents.CallNextHookEx(_hHook, nCode, wParam, lParam); + } + + CWPRETSTRUCT msg = (CWPRETSTRUCT)Marshal.PtrToStructure(lParam, typeof(CWPRETSTRUCT)); + IntPtr hook = _hHook; + + if (msg.message == (int)CbtHookAction.HCBT_ACTIVATE) + { + try + { + CenterWindow(msg.hwnd); + } + finally + { + PlatformEvents.UnhookWindowsHookEx(_hHook); + _hHook = IntPtr.Zero; + } + } + + return PlatformEvents.CallNextHookEx(hook, nCode, wParam, lParam); + } + + private static void CenterWindow(IntPtr hChildWnd) + { + Rectangle recChild = new Rectangle(0, 0, 0, 0); + bool success = PlatformEvents.GetWindowRect(hChildWnd, ref recChild); + + int width = recChild.Width - recChild.X; + int height = recChild.Height - recChild.Y; + + Rectangle recParent = new Rectangle(0, 0, 0, 0); + success = PlatformEvents.GetWindowRect(_showOwner!.Handle, ref recParent); + + Point ptCenter = new Point(0, 0); + ptCenter.X = recParent.X + (recParent.Width - recParent.X) / 2; + ptCenter.Y = recParent.Y + (recParent.Height - recParent.Y) / 2; + + + Point ptStart = new Point(0, 0); + ptStart.X = ptCenter.X - width / 2; + ptStart.Y = ptCenter.Y - height / 2; + + ptStart.X = ptStart.X < 0 ? 0 : ptStart.X; + ptStart.Y = ptStart.Y < 0 ? 0 : ptStart.Y; + + int result = PlatformEvents.MoveWindow(hChildWnd, ptStart.X, ptStart.Y, width, + height, false); + } + + private void OnTimerElapsed(object state) + { + IntPtr mbWnd = PlatformEvents.FindWindow("#32770", _caption); // lpClassName is #32770 for MessageBox + if (mbWnd != IntPtr.Zero) + { + PlatformEvents.SendMessage(mbWnd, WM_CLOSE, IntPtr.Zero, IntPtr.Zero); + } + + _timeOutTimer.Dispose(); + + _timedOut = true; + } + + private void SetupOptionalCheckBox() + { + kcbOptionalCheckBox.Visible = _showOptionalCheckBox; + + kcbOptionalCheckBox.Checked = _initialDoNotShowAgainCheck; + + kcbOptionalCheckBox.Text = _checkBoxText; + + kcbOptionalCheckBox.ThreeState = _useOptionalCheckBoxThreeState; + } + + internal static bool ReturnCheckBoxCheckedValue() + { + VisualMessageBoxExtendedForm messageBoxExtendedForm = new VisualMessageBoxExtendedForm(); + + return messageBoxExtendedForm.GetDoNotShowAgainChecked(); + } + + internal static CheckState ReturnCheckBoxCheckState() + { + VisualMessageBoxExtendedForm messageBoxExtendedForm = new VisualMessageBoxExtendedForm(); + + return messageBoxExtendedForm.GetDoNotShowAgainCheckState(); + } + + private void OptionalCheckBox_CheckedChanged(object sender, EventArgs e) + { + if (_useOptionalCheckBoxThreeState) + { + SetDoNotShowAgainCheckState(kcbOptionalCheckBox.CheckState); + } + else + { + SetDoNotShowAgainChecked(kcbOptionalCheckBox.Checked); + } + } + + private void SetDoNotShowAgainChecked(bool value) => _isDoNotShowAgainCheckedResult = value; + + internal bool GetDoNotShowAgainChecked() => _isDoNotShowAgainCheckedResult; + + private void SetDoNotShowAgainCheckState(CheckState value) => _doNotShowAgainCheckStateResult = value; + + internal CheckState GetDoNotShowAgainCheckState() => _doNotShowAgainCheckStateResult; + + private void UpdateCloseButtonVisibility(bool? visible) => CloseBox = visible ?? true; + + private void TimeOutTimer_Tick(object sender, EventArgs e) + { + _timeOut--; + + Text = $@"{_caption} ({_timeOut})"; + + if (_timeOut == 0) + { + _timedOut = true; + + Close(); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/About/KryptonAboutDialog.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Left to Right/VisualMessageBoxExtendedForm.resx similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/UX/About/KryptonAboutDialog.resx rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Left to Right/VisualMessageBoxExtendedForm.resx diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Right to Left/VisualMessageBoxExtendedRtlAwareForm.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Right to Left/VisualMessageBoxExtendedRtlAwareForm.Designer.cs new file mode 100644 index 000000000..05f00d68c --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Right to Left/VisualMessageBoxExtendedRtlAwareForm.Designer.cs @@ -0,0 +1,306 @@ +namespace Krypton.Toolkit.Suite.Extended.Messagebox +{ + partial class VisualMessageBoxExtendedRtlAwareForm + { + /// + /// 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.Suite.Extended.Messagebox.MessageButton(); + this._button3 = new Krypton.Toolkit.Suite.Extended.Messagebox.MessageButton(); + this._button1 = new Krypton.Toolkit.Suite.Extended.Messagebox.MessageButton(); + this._button2 = new Krypton.Toolkit.Suite.Extended.Messagebox.MessageButton(); + this._messageIcon = new System.Windows.Forms.PictureBox(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.kcbOptionalCheckBox = new Krypton.Toolkit.KryptonCheckBox(); + this.kpnlContent = new Krypton.Toolkit.KryptonPanel(); + this.klwlblMessageText = new Krypton.Toolkit.KryptonLinkWrapLabel(); + this.krtbMessageText = new Krypton.Toolkit.KryptonRichTextBox(); + this.kwlblMessageText = new Krypton.Toolkit.KryptonTextBox(); + ((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(); + this.tableLayoutPanel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).BeginInit(); + this.kpnlContent.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(200, 100); + this.kryptonPanel1.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._panelButtons, 0, 1); + this.tableLayoutPanel1.Controls.Add(this._messageIcon, 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.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(200, 100); + 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, 79); + 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(200, 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(200, 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(200, 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, 24); + this._button4.TabIndex = 2; + 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(163, 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, 24); + this._button3.TabIndex = 2; + 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(87, 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, 24); + this._button1.TabIndex = 0; + 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(125, 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, 24); + this._button2.TabIndex = 1; + 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(159, 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, 71); + this._messageIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; + this._messageIcon.TabIndex = 0; + this._messageIcon.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.kcbOptionalCheckBox, 0, 1); + this.tableLayoutPanel2.Controls.Add(this.kpnlContent, 0, 0); + 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(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.Size = new System.Drawing.Size(149, 73); + this.tableLayoutPanel2.TabIndex = 1; + // + // kcbOptionalCheckBox + // + this.kcbOptionalCheckBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.kcbOptionalCheckBox.Location = new System.Drawing.Point(3, 50); + this.kcbOptionalCheckBox.Name = "kcbOptionalCheckBox"; + this.kcbOptionalCheckBox.Size = new System.Drawing.Size(143, 20); + this.kcbOptionalCheckBox.TabIndex = 0; + this.kcbOptionalCheckBox.Values.Text = "CB1"; + // + // kpnlContent + // + this.kpnlContent.Controls.Add(this.kwlblMessageText); + this.kpnlContent.Controls.Add(this.klwlblMessageText); + this.kpnlContent.Controls.Add(this.krtbMessageText); + this.kpnlContent.Dock = System.Windows.Forms.DockStyle.Fill; + this.kpnlContent.Location = new System.Drawing.Point(3, 3); + this.kpnlContent.Name = "kpnlContent"; + this.kpnlContent.Size = new System.Drawing.Size(143, 41); + this.kpnlContent.TabIndex = 1; + // + // 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(143, 41); + this.klwlblMessageText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // krtbMessageText + // + this.krtbMessageText.Dock = System.Windows.Forms.DockStyle.Fill; + this.krtbMessageText.Location = new System.Drawing.Point(0, 0); + this.krtbMessageText.Name = "krtbMessageText"; + this.krtbMessageText.ReadOnly = true; + this.krtbMessageText.Size = new System.Drawing.Size(143, 41); + this.krtbMessageText.TabIndex = 0; + this.krtbMessageText.Text = ""; + // + // kwlblMessageText + // + this.kwlblMessageText.Dock = System.Windows.Forms.DockStyle.Fill; + this.kwlblMessageText.InputControlStyle = Krypton.Toolkit.InputControlStyle.PanelClient; + this.kwlblMessageText.Location = new System.Drawing.Point(0, 0); + this.kwlblMessageText.Margin = new System.Windows.Forms.Padding(5, 0, 0, 0); + this.kwlblMessageText.Multiline = true; + this.kwlblMessageText.Name = "kwlblMessageText"; + this.kwlblMessageText.ReadOnly = true; + this.kwlblMessageText.Size = new System.Drawing.Size(143, 41); + this.kwlblMessageText.StateCommon.Border.DrawBorders = Krypton.Toolkit.PaletteDrawBorders.None; + this.kwlblMessageText.TabIndex = 2; + this.kwlblMessageText.TabStop = false; + this.kwlblMessageText.Text = "Message Text\r\n.\ttabbed"; + // + // VisualMessageBoxExtendedRtlAwareForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(200, 100); + this.Controls.Add(this.kryptonPanel1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "VisualMessageBoxExtendedRtlAwareForm"; + this.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + ((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(); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).EndInit(); + this.kpnlContent.ResumeLayout(false); + this.kpnlContent.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 TableLayoutPanel tableLayoutPanel2; + private KryptonCheckBox kcbOptionalCheckBox; + private KryptonPanel kpnlContent; + private KryptonLinkWrapLabel klwlblMessageText; + private KryptonRichTextBox krtbMessageText; + private KryptonTextBox kwlblMessageText; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Right to Left/VisualMessageBoxExtendedRtlAwareForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Right to Left/VisualMessageBoxExtendedRtlAwareForm.cs new file mode 100644 index 000000000..da50b1aff --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Right to Left/VisualMessageBoxExtendedRtlAwareForm.cs @@ -0,0 +1,1052 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +using Krypton.Toolkit.Suite.Extended.Messagebox.Properties; + +using Timer = System.Windows.Forms.Timer; + +namespace Krypton.Toolkit.Suite.Extended.Messagebox +{ + internal partial class VisualMessageBoxExtendedRtlAwareForm : KryptonForm + { + #region Static Fields + + public const int WH_CALLWNDPROCRET = 12; + + private const int WM_CLOSE = 0x0010; + + #endregion + + #region Instance Fields + + private readonly bool _showCloseButton; + + private readonly string _text; + private readonly string _caption; + + 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 static /*readonly*/ IWin32Window? _showOwner; + private readonly HelpInfo? _helpInfo; + private readonly ContentAlignment _messageTextAlignment; + + private readonly Image? _applicationImage; + + private readonly KryptonMessageBoxExtendedData _messageBoxExtendedData; + + #endregion + + #region Extended Fields + + private readonly bool _showHelpButton; + + private readonly bool _openInExplorer; + + private readonly bool _useTimeOut; + + private readonly bool _showOptionalCheckBox; + + private readonly bool _useOptionalCheckBoxThreeState; + + private bool _optionalCheckBoxChecked; + + private readonly Color _messageTextColour; + + private readonly Color[]? _buttonTextColours = new Color[4]; + + private readonly DialogResult _buttonOneCustomDialogResult; + + private readonly DialogResult _buttonTwoCustomDialogResult; + + private readonly DialogResult _buttonThreeCustomDialogResult; + + private readonly DialogResult _buttonFourDialogResult; + + private readonly Font _messageBoxTypeface; + + private readonly ExtendedMessageBoxButtons _buttons; + + private readonly ExtendedKryptonMessageBoxIcon _kryptonMessageBoxIcon; + + private readonly Image? _customKryptonMessageBoxIcon; + + private readonly string _buttonOneCustomText; + + private readonly string _buttonTwoCustomText; + + private readonly string _buttonThreeCustomText; + + private readonly string _buttonFourCustomText; + + private readonly string _applicationPath; + + private readonly string _checkBoxText; + + private readonly ExtendedKryptonMessageBoxMessageContainerType _messageContainerType; + + private readonly KryptonCommand? _linkLabelCommand; + + private readonly LinkArea _contentLinkArea; + + private readonly ProcessStartInfo? _linkLaunchArgument; + + private static PlatformInvoke.HookProc _hookProc; + + private static IntPtr _hHook; + + private Timer _timeOutTimer; + + private int _timeOut; + + private bool _timedOut; + + private DialogResult _result; + + private DialogResult _timerResult; + + private readonly PaletteRelativeAlign _richTextBoxTextAlignment; + + #endregion + + #region Identity + + static VisualMessageBoxExtendedRtlAwareForm() + { + _hookProc = new PlatformInvoke.HookProc(MessageBoxHookProc); + + _hHook = IntPtr.Zero; + } + + public VisualMessageBoxExtendedRtlAwareForm() + { + InitializeComponent(); + } + + internal VisualMessageBoxExtendedRtlAwareForm(IWin32Window? showOwner, string text, string caption, + ExtendedMessageBoxButtons buttons, + ExtendedKryptonMessageBoxIcon icon, + KryptonMessageBoxDefaultButton defaultButton, + HelpInfo? helpInfo, bool? showCtrlCopy, + Font? messageBoxTypeface, + Image? customKryptonMessageBoxIcon, bool? showHelpButton, + Color? messageTextColour, Color[]? buttonTextColours, + DialogResult? buttonOneCustomDialogResult, + DialogResult? buttonTwoCustomDialogResult, + DialogResult? buttonThreeCustomDialogResult, + DialogResult? buttonFourDialogResult, + string? buttonOneCustomText, string? buttonTwoCustomText, + string? buttonThreeCustomText, string? buttonFourCustomText, + string? applicationPath, + ExtendedKryptonMessageBoxMessageContainerType? messageContainerType, + KryptonCommand? linkLabelCommand, + LinkArea? contentLinkArea, + ProcessStartInfo? linkLaunchArgument, + bool? openInExplorer, + ContentAlignment? messageTextAlignment, + PaletteRelativeAlign? richTextBoxTextAlignment, + HorizontalAlignment? messageTextBoxAlignment, + bool? showOptionalCheckBox, + bool? optionalCheckBoxChecked, + string? optionalCheckBoxText, + bool? useOptionalCheckBoxThreeState, + bool? useTimeOut, + int? timeOut, + DialogResult? timerResult) + { + // Store incoming values + _text = text; + + _caption = useTimeOut is { } or false ? $"{caption} [{timeOut}]" : caption; + + _buttons = buttons; + _kryptonMessageBoxIcon = icon; + _defaultButton = defaultButton; + _helpInfo = helpInfo ?? new HelpInfo(string.Empty, HelpNavigator.AssociateIndex, null); + _showOwner = showOwner; + _messageTextAlignment = messageTextAlignment ?? ContentAlignment.MiddleLeft; + + // Extended values + _messageBoxTypeface = messageBoxTypeface ?? KryptonManager.CurrentGlobalPalette.BaseFont; + _customKryptonMessageBoxIcon = customKryptonMessageBoxIcon; + _showHelpButton = showHelpButton ?? false; + _messageTextColour = messageTextColour ?? Color.Empty; + _buttonTextColours = buttonTextColours; + _buttonOneCustomDialogResult = buttonOneCustomDialogResult ?? DialogResult.Yes; + _buttonTwoCustomDialogResult = buttonTwoCustomDialogResult ?? DialogResult.No; + _buttonThreeCustomDialogResult = buttonThreeCustomDialogResult ?? DialogResult.Cancel; + _buttonFourDialogResult = buttonFourDialogResult ?? DialogResult.Retry; + _buttonOneCustomText = buttonOneCustomText ?? KryptonManager.Strings.GeneralStrings.Yes; + _buttonTwoCustomText = buttonTwoCustomText ?? KryptonManager.Strings.GeneralStrings.No; + _buttonThreeCustomText = buttonThreeCustomText ?? KryptonManager.Strings.GeneralStrings.Cancel; + _buttonFourCustomText = buttonFourCustomText ?? KryptonManager.Strings.GeneralStrings.Retry; + _applicationPath = applicationPath ?? string.Empty; + _messageContainerType = messageContainerType ?? ExtendedKryptonMessageBoxMessageContainerType.Normal; + _linkLabelCommand = linkLabelCommand ?? new KryptonCommand(); + _contentLinkArea = contentLinkArea ?? new LinkArea(0, text.Length); + _linkLaunchArgument = linkLaunchArgument ?? new ProcessStartInfo(); + _openInExplorer = openInExplorer ?? false; + _richTextBoxTextAlignment = richTextBoxTextAlignment ?? PaletteRelativeAlign.Inherit; + _useTimeOut = useTimeOut ?? false; + _timeOut = timeOut ?? 60; + //_timeOutTimer = new Timer(OnTimerElapsed, null, _timeOut, Timeout.Infinite); + _timerResult = timerResult ?? DialogResult.None; + //_openInExplorer = openInExplorer ?? false; + + // Optional checkbox + _showOptionalCheckBox = showOptionalCheckBox ?? false; + _optionalCheckBoxChecked = optionalCheckBoxChecked ?? false; + _checkBoxText = optionalCheckBoxText ?? string.Empty; + _useOptionalCheckBoxThreeState = useOptionalCheckBoxThreeState ?? false; + + // Create the form contents + InitializeComponent(); + + // Update contents to match requirements + UpdateText(); + UpdateIcon(); + UpdateButtons(); + UpdateDefault(); + UpdateHelp(); + UpdateTextExtra(showCtrlCopy); + + UpdateContentAreaType(messageContainerType, messageTextAlignment, richTextBoxTextAlignment, messageTextBoxAlignment); + + UpdateContentLinkArea(contentLinkArea); + + SetupOptionalCheckBox(); + + // Finally calculate and set form sizing + UpdateSizing(showOwner); + + if (_useTimeOut) + { + using (_timeOutTimer) + { + _result = KryptonMessageBoxExtended.Show(text, caption, buttons, icon, showCtrlCopy, + messageTextAlignment, messageTextBoxAlignment, useTimeOut, null, + null); + } + + if (_timedOut) + { + _result = _timerResult; + } + } + } + + #endregion + + #region Implementation + + private void UpdateText() + { + Text = string.IsNullOrEmpty(_caption) ? string.Empty : _caption.Split(Environment.NewLine.ToCharArray())[0]; + + if (_messageContainerType == ExtendedKryptonMessageBoxMessageContainerType.Normal) + { + kwlblMessageText.Visible = true; + kwlblMessageText.Text = _text; + kwlblMessageText.StateCommon.Content.Font = _messageBoxTypeface; + + kwlblMessageText.StateCommon.Content.Color1 = _messageTextColour; + + krtbMessageText.Visible = false; + + klwlblMessageText.Visible = false; + } + else if (_messageContainerType == ExtendedKryptonMessageBoxMessageContainerType.RichTextBox) + { + krtbMessageText.Visible = true; + + krtbMessageText.Text = _text; + + krtbMessageText.StateCommon.Content.Color1 = _messageTextColour; + + krtbMessageText.StateCommon.Content.Font = _messageBoxTypeface; + + kwlblMessageText.Visible = false; + + klwlblMessageText.Visible = false; + } + else if (_messageContainerType == ExtendedKryptonMessageBoxMessageContainerType.HyperLink) + { + klwlblMessageText.Visible = true; + + klwlblMessageText.Text = _text; + + klwlblMessageText.StateCommon.TextColor = _messageTextColour; + + klwlblMessageText.StateCommon.Font = _messageBoxTypeface; + + kwlblMessageText.Visible = false; + + krtbMessageText.Visible = false; + } + + kcbOptionalCheckBox.StateCommon.ShortText.Color1 = _messageTextColour; + + kcbOptionalCheckBox.StateCommon.ShortText.Color2 = _messageTextColour; + + kcbOptionalCheckBox.StateCommon.ShortText.Font = _messageBoxTypeface; + } + + private void UpdateTextExtra(bool? showCtrlCopy) + { + if (!showCtrlCopy.HasValue) + { + switch (_kryptonMessageBoxIcon) + { + case ExtendedKryptonMessageBoxIcon.Error: + case ExtendedKryptonMessageBoxIcon.Exclamation: + showCtrlCopy = true; + break; + } + } + + if (showCtrlCopy == true) + { + TextExtra = @"Ctrl+c to copy"; + } + } + + private void UpdateIcon() + { + switch (_kryptonMessageBoxIcon) + { + case ExtendedKryptonMessageBoxIcon.Custom: + if (_customKryptonMessageBoxIcon != null) + { + _messageIcon.Image = _customKryptonMessageBoxIcon; + } + else + { + _messageIcon.Image = SystemIcons.Application.ToBitmap(); + } + break; + case ExtendedKryptonMessageBoxIcon.None: + // Windows XP and before will Beep, Vista and above do not! + if (GlobalStaticValues.OS_MAJOR_VERSION < 6) + { + SystemSounds.Beep.Play(); + } + break; + case ExtendedKryptonMessageBoxIcon.Hand: + _messageIcon.Image = Resources.Hand; + SystemSounds.Hand.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemHand: + _messageIcon.Image = SystemIcons.Hand.ToBitmap(); + SystemSounds.Hand.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Question: + _messageIcon.Image = Resources.Question; + SystemSounds.Question.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemQuestion: + _messageIcon.Image = SystemIcons.Question.ToBitmap(); + SystemSounds.Question.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Exclamation: + _messageIcon.Image = Resources.Warning; + SystemSounds.Exclamation.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemExclamation: + _messageIcon.Image = SystemIcons.Exclamation.ToBitmap(); + SystemSounds.Exclamation.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Asterisk: + _messageIcon.Image = Resources.Asterisk; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.SystemAsterisk: + _messageIcon.Image = SystemIcons.Asterisk.ToBitmap(); + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Stop: + _messageIcon.Image = Resources.Stop; + SystemSounds.Hand.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Error: + _messageIcon.Image = Resources.Critical; + SystemSounds.Hand.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Warning: + _messageIcon.Image = Resources.Warning; + SystemSounds.Exclamation.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Information: + _messageIcon.Image = Resources.Information; + SystemSounds.Asterisk.Play(); + break; + case ExtendedKryptonMessageBoxIcon.Shield: + if (OSUtilities.IsAtLeastWindowsEleven) + { + _messageIcon.Image = Resources.UAC_Shield_Windows_11; + } + // Windows 10 + else if (OSUtilities.IsWindowsTen) + { + _messageIcon.Image = Resources.UAC_Shield_Windows_10; + } + else + { + _messageIcon.Image = Resources.UAC_Shield_Windows_7; + } + break; + case ExtendedKryptonMessageBoxIcon.WindowsLogo: + // Because Windows 11 displays a generic application icon, + // we need to rely on a image instead + if (OSUtilities.IsAtLeastWindowsEleven) + { + _messageIcon.Image = Resources.Windows11; + } + // Windows 10, 8.1 & 8 + else if (OSUtilities.IsWindowsTen || OSUtilities.IsWindowsEightPointOne || OSUtilities.IsWindowsEight) + { + _messageIcon.Image = Resources.Windows_8_and_10_Logo; + } + else + { + _messageIcon.Image = SystemIcons.WinLogo.ToBitmap(); + } + break; + case ExtendedKryptonMessageBoxIcon.Application: + if (!string.IsNullOrEmpty(_applicationPath)) + { + Image tempImage = GraphicsExtensions.ExtractIconFromFilePath(_applicationPath)?.ToBitmap()!; + Bitmap? scaledImage = GraphicsExtensions.ScaleImage(tempImage, new Size(32, 32)); + + _messageIcon.Image = scaledImage; + } + else + { + _messageIcon.Image = SystemIcons.Application.ToBitmap(); + } + break; + case ExtendedKryptonMessageBoxIcon.SystemApplication: + _messageIcon.Image = SystemIcons.Application.ToBitmap(); + break; + } + + _messageIcon.Visible = _kryptonMessageBoxIcon != ExtendedKryptonMessageBoxIcon.None; + + } + + private void UpdateButtons() + { + switch (_buttons) + { + case ExtendedMessageBoxButtons.OK: + _button1.Text = KryptonManager.Strings.GeneralStrings.OK; + _button1.DialogResult = DialogResult.OK; + _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button1.Visible = true; + _button1.Enabled = true; + break; + case ExtendedMessageBoxButtons.OKCancel: + _button1.Text = KryptonManager.Strings.GeneralStrings.OK; + _button2.Text = KryptonManager.Strings.GeneralStrings.Cancel; + _button1.DialogResult = DialogResult.OK; + _button2.DialogResult = DialogResult.Cancel; + _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button1.Visible = true; + _button1.Enabled = true; + _button2.Visible = true; + _button2.Enabled = true; + break; + case ExtendedMessageBoxButtons.YesNo: + _button1.Text = KryptonManager.Strings.GeneralStrings.Yes; + _button2.Text = KryptonManager.Strings.GeneralStrings.No; + _button1.DialogResult = DialogResult.Yes; + _button2.DialogResult = DialogResult.No; + _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button1.Visible = true; + _button1.Enabled = true; + _button2.Visible = true; + _button2.Enabled = true; + ControlBox = false; + break; + case ExtendedMessageBoxButtons.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.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button3.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button1.Visible = true; + _button1.Enabled = true; + _button2.Visible = true; + _button2.Enabled = true; + _button3.Visible = true; + _button3.Enabled = true; + break; + case ExtendedMessageBoxButtons.RetryCancel: + _button1.Text = KryptonManager.Strings.GeneralStrings.Retry; + _button2.Text = KryptonManager.Strings.GeneralStrings.Cancel; + _button1.DialogResult = DialogResult.Retry; + _button2.DialogResult = DialogResult.Cancel; + _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button1.Visible = true; + _button1.Enabled = true; + _button2.Visible = true; + _button2.Enabled = true; + break; + case ExtendedMessageBoxButtons.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.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button3.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button1.Visible = true; + _button1.Enabled = true; + _button2.Visible = true; + _button2.Enabled = true; + _button3.Visible = true; + _button3.Enabled = true; + ControlBox = false; + break; + case ExtendedMessageBoxButtons.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; + _button2.DialogResult = (DialogResult)11; +#endif + _button1.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button2.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _button3.StateCommon.Content.ShortText.Font = _messageBoxTypeface; + _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 KryptonMessageBoxDefaultButton.Button5: + // AcceptButton = _showActionButton ? _button5 : _button1; + // break; + case null: + AcceptButton = _button1; + break; + default: + AcceptButton = _showHelpButton ? _button4 : _button1; + break; + } + } + + private void UpdateDefault() + { + switch (_defaultButton) + { + case KryptonMessageBoxDefaultButton.Button1: + _button1.Focus(); + break; + case KryptonMessageBoxDefaultButton.Button2: + _button2.Focus(); + break; + case KryptonMessageBoxDefaultButton.Button3: + _button3.Focus(); + break; + case KryptonMessageBoxDefaultButton.Button4: + _button4.Focus(); + break; + } + } + + private void UpdateHelp() + { + if (_helpInfo == null) + { + return; + } + + MessageButton helpButton = _buttons switch + { + ExtendedMessageBoxButtons.OK => _button2, + ExtendedMessageBoxButtons.OKCancel or ExtendedMessageBoxButtons.YesNo or ExtendedMessageBoxButtons.RetryCancel => _button3, + ExtendedMessageBoxButtons.AbortRetryIgnore or ExtendedMessageBoxButtons.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() + { + try + { + Control? control = FromHandle(_showOwner!.Handle); + + MethodInfo? mInfoMethod = control!.GetType().GetMethod(@"OnHelpRequested", BindingFlags.Instance | BindingFlags.NonPublic, + Type.DefaultBinder, new[] { typeof(HelpEventArgs) }, null)!; + if (mInfoMethod != null) + { + mInfoMethod.Invoke(control, new object[] { 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 if failure to send to Parent + } + + } + + 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 != null ? Screen.FromHandle(showOwner.Handle) : Screen.PrimaryScreen; + SizeF scaledMonitorSize = screen!.Bounds.Size; + scaledMonitorSize.Width *= 2 / 3.0f; + scaledMonitorSize.Height *= 0.95f; + + //kwlblMessageText.UpdateFont(); + SizeF messageSize = g.MeasureString(_text, kwlblMessageText.Font, scaledMonitorSize); + // SKC: Don't forget to add the TextExtra into the calculation + SizeF captionSize = g.MeasureString($@"{_caption} {TextExtra}", kwlblMessageText.Font, scaledMonitorSize); + + var messageXSize = Math.Max(messageSize.Width, captionSize.Width); + // Work out DPI adjustment factor + messageSize.Width = messageXSize * FactorDpiX; + messageSize.Height *= FactorDpiY; + + // 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); + } + + // Find size of icon area plus the text area added together + if (_messageIcon.Image != null) + { + return new Size(textSize.Width + _messageIcon.Width, Math.Max(_messageIcon.Height + 10, textSize.Height)); + } + + return textSize; + } + + private Size UpdateButtonsSizing() + { + var numButtons = 1; + + // Button1 is always visible + Size button1Size = _button1.GetPreferredSize(Size.Empty); + Size maxButtonSize = new(button1Size.Width + GlobalStaticValues.GLOBAL_BUTTON_PADDING, button1Size.Height); + + // 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; + + // 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 GLOBAL_BUTTON_PADDINGs 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.Control + || e.KeyCode != Keys.C + ) + { + return; + } + + 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(kwlblMessageText.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 (_openInExplorer) + { + OpenInExplorer(e!.Link.LinkData.ToString()); + } + else + { + if (_linkLabelCommand != null) + { + _linkLabelCommand.PerformExecute(); + } + else if (_linkLaunchArgument != null) + { + Process.Start(_linkLaunchArgument); + } + } + } + catch (Exception exc) + { + DebugUtilities.NotImplemented(exc.ToString()); + } + } + + private void OpenInExplorer(string path) + { + try + { + Process.Start(@"explorer.exe", path); + } + catch (Exception e) + { + DebugUtilities.NotImplemented(e.ToString()); + } + } + + private void UpdateContentLinkArea(LinkArea? contentLinkArea) + { + if (contentLinkArea != null) + { + klwlblMessageText.LinkArea = (LinkArea)contentLinkArea; + } + } + + private void UpdateContentAreaType(ExtendedKryptonMessageBoxMessageContainerType? messageContainerType, ContentAlignment? messageTextAlignment, PaletteRelativeAlign? richTextBoxTextAlignment, HorizontalAlignment? messageTextBoxAlignment) + { + switch (messageContainerType) + { + case ExtendedKryptonMessageBoxMessageContainerType.HyperLink: + klwlblMessageText.Visible = true; + + kwlblMessageText.Visible = false; + + klwlblMessageText.TextAlign = messageTextAlignment ?? ContentAlignment.MiddleLeft; + + krtbMessageText.Visible = false; + break; + case ExtendedKryptonMessageBoxMessageContainerType.Normal: + klwlblMessageText.Visible = false; + + kwlblMessageText.Visible = true; + + kwlblMessageText.TextAlign = messageTextBoxAlignment ?? HorizontalAlignment.Left; + + krtbMessageText.Visible = false; + break; + case ExtendedKryptonMessageBoxMessageContainerType.RichTextBox: + klwlblMessageText.Visible = false; + + kwlblMessageText.Visible = false; + + krtbMessageText.Visible = true; + + krtbMessageText.StateCommon.Content.TextH = richTextBoxTextAlignment ?? PaletteRelativeAlign.Inherit; + break; + } + } + + private static void Initialize() + { + if (_hHook != IntPtr.Zero) + { + throw new NotSupportedException("multiple calls are not supported"); + } + + if (_showOwner != null) + { + _hHook = PlatformEvents.SetWindowsHookEx(WH_CALLWNDPROCRET, _hookProc, IntPtr.Zero, AppDomain.GetCurrentThreadId()); + } + } + + private static IntPtr MessageBoxHookProc(int nCode, IntPtr wParam, IntPtr lParam) + { + if (nCode < 0) + { + return PlatformEvents.CallNextHookEx(_hHook, nCode, wParam, lParam); + } + + CWPRETSTRUCT msg = (CWPRETSTRUCT)Marshal.PtrToStructure(lParam, typeof(CWPRETSTRUCT)); + IntPtr hook = _hHook; + + if (msg.message == (int)CbtHookAction.HCBT_ACTIVATE) + { + try + { + CenterWindow(msg.hwnd); + } + finally + { + PlatformEvents.UnhookWindowsHookEx(_hHook); + _hHook = IntPtr.Zero; + } + } + + return PlatformEvents.CallNextHookEx(hook, nCode, wParam, lParam); + } + + private static void CenterWindow(IntPtr hChildWnd) + { + Rectangle recChild = new Rectangle(0, 0, 0, 0); + bool success = PlatformEvents.GetWindowRect(hChildWnd, ref recChild); + + int width = recChild.Width - recChild.X; + int height = recChild.Height - recChild.Y; + + Rectangle recParent = new Rectangle(0, 0, 0, 0); + success = PlatformEvents.GetWindowRect(_showOwner!.Handle, ref recParent); + + Point ptCenter = new Point(0, 0); + ptCenter.X = recParent.X + (recParent.Width - recParent.X) / 2; + ptCenter.Y = recParent.Y + (recParent.Height - recParent.Y) / 2; + + + Point ptStart = new Point(0, 0); + ptStart.X = ptCenter.X - width / 2; + ptStart.Y = ptCenter.Y - height / 2; + + ptStart.X = ptStart.X < 0 ? 0 : ptStart.X; + ptStart.Y = ptStart.Y < 0 ? 0 : ptStart.Y; + + int result = PlatformEvents.MoveWindow(hChildWnd, ptStart.X, ptStart.Y, width, + height, false); + } + + private void OnTimerElapsed(object state) + { + IntPtr mbWnd = PlatformEvents.FindWindow("#32770", _caption); // lpClassName is #32770 for MessageBox + if (mbWnd != IntPtr.Zero) + { + PlatformEvents.SendMessage(mbWnd, WM_CLOSE, IntPtr.Zero, IntPtr.Zero); + } + + _timeOutTimer.Dispose(); + + _timedOut = true; + } + + #region Checkbox + private void SetupOptionalCheckBox() + { + kcbOptionalCheckBox.Visible = _showOptionalCheckBox; + + kcbOptionalCheckBox.Checked = _optionalCheckBoxChecked; + + kcbOptionalCheckBox.Text = _checkBoxText; + + kcbOptionalCheckBox.ThreeState = _useOptionalCheckBoxThreeState; + } + + internal static bool ReturnCheckBoxCheckedValue() + { + VisualMessageBoxExtendedRtlAwareForm messageBoxExtendedForm = new VisualMessageBoxExtendedRtlAwareForm(); + + return messageBoxExtendedForm._optionalCheckBoxChecked; + } + + internal static CheckState ReturnCheckBoxCheckState() + { + VisualMessageBoxExtendedRtlAwareForm messageBoxExtendedForm = new VisualMessageBoxExtendedRtlAwareForm(); + + return messageBoxExtendedForm.kcbOptionalCheckBox.CheckState; + } + + private void OptionalCheckBox_CheckedChanged(object sender, EventArgs e) => _optionalCheckBoxChecked = kcbOptionalCheckBox.Checked; + + private void UpdateCloseButtonVisibility(bool? visible) => CloseBox = visible ?? true; + + #endregion + + #endregion + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/KryptonMessageBoxExtendedForm.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Right to Left/VisualMessageBoxExtendedRtlAwareForm.resx similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/KryptonMessageBoxExtendedForm.resx rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Right to Left/VisualMessageBoxExtendedRtlAwareForm.resx diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Designer/KryptonMessageBoxConfiguratorActionList.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Designer/KryptonMessageBoxConfiguratorActionList.cs index de4671032..d0f93a9f1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Designer/KryptonMessageBoxConfiguratorActionList.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Designer/KryptonMessageBoxConfiguratorActionList.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -34,7 +34,7 @@ internal class KryptonMessageBoxConfiguratorActionList : DesignerActionList #region Instance Fields //private readonly KryptonMessageBoxManagerOld _messageBoxConfigurator; - private readonly IComponentChangeService _service; + private readonly IComponentChangeService? _service; #endregion #region Identity @@ -42,7 +42,7 @@ public KryptonMessageBoxConfiguratorActionList(KryptonMessageBoxConfiguratorDesi { //_messageBoxConfigurator = owner.Component as KryptonMessageBoxManagerOld; - _service = (IComponentChangeService)GetService(typeof(IComponentChangeService)); + _service = GetService(typeof(IComponentChangeService)) as IComponentChangeService; } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Designer/KryptonMessageBoxConfiguratorDesigner.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Designer/KryptonMessageBoxConfiguratorDesigner.cs index 9ca183537..a9876e0f2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Designer/KryptonMessageBoxConfiguratorDesigner.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Designer/KryptonMessageBoxConfiguratorDesigner.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/CbtHookAction.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/CbtHookAction.cs deleted file mode 100644 index 342789249..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/CbtHookAction.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace Krypton.Toolkit.Suite.Extended.Messagebox -{ - public enum CbtHookAction - { - HCBT_MOVESIZE = 0, - HCBT_MINMAX = 1, - HCBT_QS = 2, - HCBT_CREATEWND = 3, - HCBT_DESTROYWND = 4, - HCBT_ACTIVATE = 5, - HCBT_CLICKSKIPPED = 6, - HCBT_KEYSKIPPED = 7, - HCBT_SYSCOMMAND = 8, - HCBT_SETFOCUS = 9 - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedKryptonMessageBoxIcon.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedKryptonMessageBoxIcon.cs deleted file mode 100644 index c31829d37..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedKryptonMessageBoxIcon.cs +++ /dev/null @@ -1,99 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Messagebox -{ - /// Specifies an icon for the . - public enum ExtendedKryptonMessageBoxIcon - { - /// Specify a custom icon. - Custom = 0, - - /// Specify no icon. - None = 1, - - /// Specify a hand icon. - Hand = 2, - - /// Specify the system hand icon. - SystemHand = MessageBoxIcon.Hand, - - /// Specify a question icon. - Question = 3, - - /// Specify the system question icon. - SystemQuestion = MessageBoxIcon.Question, - - /// Specify a exclamation icon. - Exclamation = 4, - - /// Specify the system exclamation icon. - SystemExclamation = MessageBoxIcon.Exclamation, - - /// Specify a asterisk icon. - Asterisk = 5, - - /// Specify the system asterisk icon. - SystemAsterisk = MessageBoxIcon.Asterisk, - - /// Specify a stop icon. - Stop = 6, - - /// Specify the system stop icon. - SystemStop = MessageBoxIcon.Stop, - - /// Specify a error icon. - Error = 7, - - /// Specify the system error icon. - SystemError = MessageBoxIcon.Error, - - /// Specify a warning icon. - Warning = 8, - - /// Specify the system warning icon. - SystemWarning = MessageBoxIcon.Warning, - - /// Specify a information icon. - Information = 9, - - /// Specify the system information icon. - SystemInformation = MessageBoxIcon.Information, - - /// Specify a UAC shield icon. - Shield = 10, - - /// Specify a Windows logo icon. - WindowsLogo = 11, - - /// Specify your application icon. - Application = 12, - - /// Specify the default system application icon. See . - SystemApplication = 13 - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedKryptonMessageBoxMessageContainerType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedKryptonMessageBoxMessageContainerType.cs deleted file mode 100644 index 1cccd93c0..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedKryptonMessageBoxMessageContainerType.cs +++ /dev/null @@ -1,36 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Messagebox -{ - public enum ExtendedKryptonMessageBoxMessageContainerType - { - Normal = 0, - RichTextBox = 1, - HyperLink = 2 - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedMessageBoxButtons.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedMessageBoxButtons.cs deleted file mode 100644 index 42c1e3465..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedMessageBoxButtons.cs +++ /dev/null @@ -1,75 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Messagebox -{ - /// Specifies the button layout in the . - public enum ExtendedMessageBoxButtons - { - /// Defines a custom button layout. Linked to values. - Custom = 13, - /// - /// Specifies that the message box contains an OK button. - /// - OK = MessageBoxButtons.OK, - - /// - /// Specifies that the message box contains OK and Cancel buttons. - /// - OKCancel = MessageBoxButtons.OKCancel, - - /// - /// Specifies that the message box contains Abort, Retry, and Ignore buttons. - /// - AbortRetryIgnore = MessageBoxButtons.AbortRetryIgnore, - - /// - /// Specifies that the message box contains Yes, No, and Cancel buttons. - /// - YesNoCancel = MessageBoxButtons.YesNoCancel, - - /// - /// Specifies that the message box contains Yes and No buttons. - /// - YesNo = MessageBoxButtons.YesNo, - - /// - /// Specifies that the message box contains Retry and Cancel buttons. - /// - RetryCancel = MessageBoxButtons.RetryCancel, - - /// - /// Specifies that the message box contains Cancel, Try Again, and Continue buttons. - /// -#if NET60_OR_GREATER - CancelTryContinue = MessageBoxButtons.CancelTryContinue, -#else - CancelTryContinue = 0x00000006, -#endif - YesNoAllCancel = 8 - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedMessageBoxCustomButtonOptions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedMessageBoxCustomButtonOptions.cs deleted file mode 100644 index 83a45fadf..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedMessageBoxCustomButtonOptions.cs +++ /dev/null @@ -1,44 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Messagebox -{ - /// Specifies a custom button layout. - public enum ExtendedMessageBoxCustomButtonOptions - { - /// Do not use custom buttons, instead default to an 'OK' only button. - None = 0, - /// Use a one button layout. - OneButton = 1, - /// Use a two button layout. - TwoButtons = 2, - /// Use a three button layout. - ThreeButtons = 3, - /// Use a four button layout. - FourButtons = 4 - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedMessageBoxDialogResult.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedMessageBoxDialogResult.cs deleted file mode 100644 index baaf9f32e..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedMessageBoxDialogResult.cs +++ /dev/null @@ -1,43 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Messagebox -{ - public enum ExtendedMessageBoxDialogResult - { - None = 0, - OK = 1, - Cancel = 2, - Abort = 3, - Retry = 4, - Ignore = 5, - Yes = 6, - No = 7, - TryAgain = 8, - Continue = 9 - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedMessageBoxTimeoutAction.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedMessageBoxTimeoutAction.cs deleted file mode 100644 index 0c1ee06e4..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedMessageBoxTimeoutAction.cs +++ /dev/null @@ -1,38 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Messagebox -{ - public enum ExtendedMessageBoxTimeoutAction - { - Close = 0, - ButtonOne = 1, - ButtonTwo = 2, - ButtonThree = 3, - ButtonFour = 4 - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedMessageBoxTimeoutButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedMessageBoxTimeoutButton.cs deleted file mode 100644 index 1bb73907a..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Enumerations/ExtendedMessageBoxTimeoutButton.cs +++ /dev/null @@ -1,36 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Messagebox -{ - public enum ExtendedMessageBoxTimeoutButton - { - FirstButton = 0, - SecondButton = 1, - ThirdButton = 2 - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Events/ShowMessageBoxEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Events/ShowMessageBoxEventArgs.cs index 2493314ab..15bc5f8ca 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Events/ShowMessageBoxEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Events/ShowMessageBoxEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -83,7 +83,7 @@ public class ShowMessageBoxEventArgs : EventArgs [DefaultValue(false), Description("Allows the user to use 'CTRL + C' to copy the message box content.")] public bool ShowCtrlCopy { get => _showCtrlCopy; set => _showCtrlCopy = value; } - /// Gets or sets a value indicating whether this is fade. + /// Gets or sets a value indicating whether this is fade. /// true if fade; otherwise, false. [DefaultValue(false), Description("Fades the message box in and out. (Under construction)")] public bool Fade { get => _fade; set => _fade = value; } @@ -372,7 +372,7 @@ public ShowMessageBoxEventArgs(IWin32Window owner, string text, string caption, int? blurRadius, Color? contentMessageColour, Color? buttonOneTextColour, Color? buttonTwoTextColour, Color? buttonThreeTextColour, Color? yesButtonColour, Color? noButtonColour, Color? textColour, - Color? yesNoButtonTextColour, KryptonForm parentWindow = null) + Color? yesNoButtonTextColour, KryptonForm? parentWindow) { Owner = owner; @@ -458,7 +458,7 @@ public ShowMessageBoxEventArgs(IWin32Window owner, string text, string caption, YesNoButtonTextColour = yesNoButtonTextColour ?? Color.Empty; - ParentWindow = parentWindow ?? null; + ParentWindow = parentWindow ?? new KryptonForm(); } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/General/Definitions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/General/Definitions.cs new file mode 100644 index 000000000..4bae5ea38 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/General/Definitions.cs @@ -0,0 +1,244 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Messagebox +{ + #region Enum CbtHookAction + + public enum CbtHookAction + { + HCBT_MOVESIZE = 0, + HCBT_MINMAX = 1, + HCBT_QS = 2, + HCBT_CREATEWND = 3, + HCBT_DESTROYWND = 4, + HCBT_ACTIVATE = 5, + HCBT_CLICKSKIPPED = 6, + HCBT_KEYSKIPPED = 7, + HCBT_SYSCOMMAND = 8, + HCBT_SETFOCUS = 9 + } + + #endregion + + #region Enum ExtendedKryptonMessageBoxIcon + + /// Specifies an icon for the . + public enum ExtendedKryptonMessageBoxIcon + { + /// Specify a custom icon. + Custom = 0, + + /// Specify no icon. + None = 1, + + /// Specify a hand icon. + Hand = 2, + + /// Specify the system hand icon. + SystemHand = MessageBoxIcon.Hand, + + /// Specify a question icon. + Question = 3, + + /// Specify the system question icon. + SystemQuestion = MessageBoxIcon.Question, + + /// Specify a exclamation icon. + Exclamation = 4, + + /// Specify the system exclamation icon. + SystemExclamation = MessageBoxIcon.Exclamation, + + /// Specify a asterisk icon. + Asterisk = 5, + + /// Specify the system asterisk icon. + SystemAsterisk = MessageBoxIcon.Asterisk, + + /// Specify a stop icon. + Stop = 6, + + /// Specify the system stop icon. + SystemStop = MessageBoxIcon.Stop, + + /// Specify a error icon. + Error = 7, + + /// Specify the system error icon. + SystemError = MessageBoxIcon.Error, + + /// Specify a warning icon. + Warning = 8, + + /// Specify the system warning icon. + SystemWarning = MessageBoxIcon.Warning, + + /// Specify a information icon. + Information = 9, + + /// Specify the system information icon. + SystemInformation = MessageBoxIcon.Information, + + /// Specify a UAC shield icon. + Shield = 10, + + /// Specify a Windows logo icon. + WindowsLogo = 11, + + /// Specify your application icon. + Application = 12, + + /// Specify the default system application icon. See . + SystemApplication = 13 + } + + #endregion + + #region Enum ExtendedKryptonMessageBoxMessageContainerType + + public enum ExtendedKryptonMessageBoxMessageContainerType + { + Normal = 0, + RichTextBox = 1, + HyperLink = 2 + } + + #endregion + + #region Enum ExtendedMessageBoxButtons + + /// Specifies the button layout in the . + public enum ExtendedMessageBoxButtons + { + /// Defines a custom button layout. Linked to values. + Custom = 13, + /// + /// Specifies that the message box contains an OK button. + /// + OK = MessageBoxButtons.OK, + + /// + /// Specifies that the message box contains OK and Cancel buttons. + /// + OKCancel = MessageBoxButtons.OKCancel, + + /// + /// Specifies that the message box contains Abort, Retry, and Ignore buttons. + /// + AbortRetryIgnore = MessageBoxButtons.AbortRetryIgnore, + + /// + /// Specifies that the message box contains Yes, No, and Cancel buttons. + /// + YesNoCancel = MessageBoxButtons.YesNoCancel, + + /// + /// Specifies that the message box contains Yes and No buttons. + /// + YesNo = MessageBoxButtons.YesNo, + + /// + /// Specifies that the message box contains Retry and Cancel buttons. + /// + RetryCancel = MessageBoxButtons.RetryCancel, + + /// + /// Specifies that the message box contains Cancel, Try Again, and Continue buttons. + /// +#if NET60_OR_GREATER + CancelTryContinue = MessageBoxButtons.CancelTryContinue, +#else + CancelTryContinue = 0x00000006, +#endif + YesNoAllCancel = 8 + } + + #endregion + + #region Enum ExtendedMessageBoxCustomButtonOptions + + /// Specifies a custom button layout. + public enum ExtendedMessageBoxCustomButtonOptions + { + /// Do not use custom buttons, instead default to an 'OK' only button. + None = 0, + /// Use a one button layout. + OneButton = 1, + /// Use a two button layout. + TwoButtons = 2, + /// Use a three button layout. + ThreeButtons = 3, + /// Use a four button layout. + FourButtons = 4 + } + + #endregion + + #region Enum ExtendedMessageBoxDialogResult + + public enum ExtendedMessageBoxDialogResult : int + { + None = DialogResult.None, + Ok = DialogResult.OK, + Cancel = DialogResult.Cancel, + Abort = DialogResult.Abort, + Retry = DialogResult.Retry, + Ignore = DialogResult.Ignore, + Yes = DialogResult.Yes, + No = DialogResult.No, + TryAgain = 8, + Continue = 9, + Timeout = 1000 + } + + #endregion + + #region Enum ExtendedMessageBoxTimeoutAction + + public enum ExtendedMessageBoxTimeoutAction + { + Close = 0, + ButtonOne = 1, + ButtonTwo = 2, + ButtonThree = 3, + ButtonFour = 4 + } + + #endregion + + #region Enum ExtendedMessageBoxTimeoutButton + + public enum ExtendedMessageBoxTimeoutButton + { + ButtonOne = 0, + ButtonTwo = 1, + ButtonThree = 2 + } + + #endregion +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/General/KryptonMessageBoxExtendedData.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/General/KryptonMessageBoxExtendedData.cs new file mode 100644 index 000000000..ff0b56e84 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/General/KryptonMessageBoxExtendedData.cs @@ -0,0 +1,181 @@ +#region MIT License +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ +#endregion + +namespace Krypton.Toolkit.Suite.Extended.Messagebox +{ + public struct KryptonMessageBoxExtendedData + { + #region Public + + #region Base + + /// Gets or sets the owner window. + /// The owner window. + public IWin32Window? Owner { get; set; } + + /// Gets or sets the message text. + /// The message text. + public string? MessageText { get; set; } + + /// Gets or sets the window caption. + /// The window caption. + public string Caption { get; set; } + + /// Gets or sets the buttons. + /// The buttons. + public ExtendedMessageBoxButtons Buttons { get; set; } + + /// Gets or sets the icon. + /// The icon. + public ExtendedKryptonMessageBoxIcon Icon { get; set; } + + /// Gets or sets the default button. + /// The default button. + public KryptonMessageBoxDefaultButton? DefaultButton { get; set; } + + /// Gets or sets the . + /// The . + public MessageBoxOptions Options { get; set; } + + /// Gets or sets the help information. + /// The help information. + public HelpInfo? HelpInfo { get; set; } + + /// Gets or sets the show control copy. + /// The show control copy. + public bool? ShowCtrlCopy { get; set; } + + /// Gets or sets the show help button. + /// The show help button. + public bool? ShowHelpButton { get; set; } + + /// Gets or sets the show action button. + /// The show action button. + public bool? ShowActionButton { get; set; } + + /// Gets or sets the action button text. + /// The action button text. + public string? ActionButtonText { get; set; } + + /// Gets or sets the action button command. + /// The action button command. + public KryptonCommand? ActionButtonCommand { get; set; } + + /// Gets or sets the application image. + /// The application image. + public Image? ApplicationImage { get; set; } + + /// Gets or sets the application path. + /// The application path. + public string? ApplicationPath { get; set; } + + /// Gets or sets the type of the message content area. + /// The type of the message content area. + public ExtendedKryptonMessageBoxMessageContainerType? MessageContentAreaType { get; set; } + + /// Gets or sets the link label command. + /// The link label command. + public KryptonCommand? LinkLabelCommand { get; set; } + + /// Gets or sets the link launch argument. + /// The link launch argument. + public ProcessStartInfo? LinkLaunchArgument { get; set; } + + /// Gets or sets the content link area. + /// The content link area. + public LinkArea? ContentLinkArea { get; set; } + + /// Gets or sets the message text alignment. + /// The message text alignment. + public ContentAlignment? MessageTextAlignment { get; set; } + + /// Gets or sets the message text box alignment. + /// The message text box alignment. + public HorizontalAlignment? MessageTextBoxAlignment { get; set; } + + /// Gets or sets the force use of operating system icons. + /// Forces the use of operating system icons. + public bool? ForceUseOfOperatingSystemIcons { get; set; } + + /// Gets or sets the help file path for . + /// The help file path. + public string? HelpFilePath { get; set; } + + /// Gets or sets the help navigator for . + /// The help navigator. + public HelpNavigator? HelpNavigator { get; set; } + + /// Gets or sets the help parameters for . + /// The help parameters. + public object? HelpParameters { get; set; } + + /// Gets or sets the CheckBox text. + /// The CheckBox text. + public string? CheckBoxText { get; set; } + + /// Gets or sets the CheckBox checked value. + /// The CheckBox checked value. + public bool? IsCheckBoxChecked { get; set; } + + /// Gets or sets the state of the CheckBox . + /// The state of the CheckBox . + public CheckState? CheckBoxCheckState { get; set; } + + /// Gets or sets the state of the use CheckBox three. + /// The state of the use CheckBox three. + public bool? UseCheckBoxThreeState { get; set; } + + /// Gets or sets the show close button. + /// The show close button. + public bool? ShowCloseButton { get; set; } + + #endregion + + #region Extended + + public bool ShowMoreDetailsOption { get; set; } + + public PaletteRelativeAlign? RichTextBoxTextAlignment { get; set; } + + public string? MoreDetailsButtonText { get; set; } + + public string? MoreDetailsMessageText { get; set; } + + #endregion + + #endregion + + #region Identity + + public KryptonMessageBoxExtendedData() + { + + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Globals/GlobalDeclarations.cs index 86ea73483..808b4c5ca 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -37,5 +37,5 @@ global using System.Threading; global using System.Windows.Forms; -global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; +global using Krypton.Toolkit.Suite.Extended.Debug.Tools; global using Krypton.Toolkit.Suite.Extended.Shared; \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Krypton.Toolkit.Suite.Extended.Messagebox 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Krypton.Toolkit.Suite.Extended.Messagebox 2022.csproj index 08ae1e738..54c2a9751 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Krypton.Toolkit.Suite.Extended.Messagebox 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Krypton.Toolkit.Suite.Extended.Messagebox 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements additional KryptonMessageBox features and functionality. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements additional KryptonMessageBox features and functionality. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,79 +69,42 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Krypton.Toolkit.Suite.Extended.Messagebox.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Krypton.Toolkit.Suite.Extended.Messagebox.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Krypton.Toolkit.Suite.Extended.Messagebox.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Krypton.Toolkit.Suite.Extended.Messagebox.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Properties/Resources.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Properties/Resources.Designer.cs index d19ff06ed..d7a7aece5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Properties/Resources.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Properties/Resources.Designer.cs @@ -70,6 +70,26 @@ internal static System.Drawing.Bitmap Asterisk { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Asterisk_Windows_11 { + get { + object obj = ResourceManager.GetObject("Asterisk_Windows_11", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Cancel_Windows_11 { + get { + object obj = ResourceManager.GetObject("Cancel_Windows_11", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -80,6 +100,16 @@ internal static System.Drawing.Bitmap Critical { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Critical_Windows_11 { + get { + object obj = ResourceManager.GetObject("Critical_Windows_11", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -100,6 +130,16 @@ internal static System.Drawing.Bitmap Information { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Information_Windows_11 { + get { + object obj = ResourceManager.GetObject("Information_Windows_11", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -120,6 +160,16 @@ internal static System.Drawing.Bitmap Question { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Question_Windows_11 { + get { + object obj = ResourceManager.GetObject("Question_Windows_11", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -130,6 +180,26 @@ internal static System.Drawing.Bitmap Stop { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap TaskDialog_Windows_11_Logo { + get { + object obj = ResourceManager.GetObject("TaskDialog_Windows_11_Logo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap TaskDialog_Windows_8_and_10_Logo { + get { + object obj = ResourceManager.GetObject("TaskDialog_Windows_8_and_10_Logo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -170,6 +240,16 @@ internal static System.Drawing.Bitmap Warning { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Warning_Windows_11 { + get { + object obj = ResourceManager.GetObject("Warning_Windows_11", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Properties/Resources.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Properties/Resources.resx index fb84991f4..b710075e6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Properties/Resources.resx +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Properties/Resources.resx @@ -121,24 +121,45 @@ ..\Resources\Asterisk.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Asterisk_Windows_11.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Cancel_Windows_11.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\Critical.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Critical_Windows_11.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\Hand.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Information.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Information_Windows_11.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\Ok.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Question.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Question_Windows_11.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\Stop.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\TaskDialog_Windows_11_Logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\TaskDialog_Windows_8_and_10_Logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\UAC_Shield_Windows_10.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -151,6 +172,9 @@ ..\Resources\Warning.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Warning_Windows_11.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\Windows11.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/Asterisk_Windows_11.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/Asterisk_Windows_11.png new file mode 100644 index 000000000..3b3eef8fe Binary files /dev/null and b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/Asterisk_Windows_11.png differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/Cancel_Windows_11.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/Cancel_Windows_11.png new file mode 100644 index 000000000..6ba07535b Binary files /dev/null and b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/Cancel_Windows_11.png differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/Critical_Windows_11.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/Critical_Windows_11.png new file mode 100644 index 000000000..8594c988f Binary files /dev/null and b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/Critical_Windows_11.png differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/Information_Windows_11.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/Information_Windows_11.png new file mode 100644 index 000000000..81074e49d Binary files /dev/null and b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/Information_Windows_11.png differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/Question_Windows_11.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/Question_Windows_11.png new file mode 100644 index 000000000..b843e3c52 Binary files /dev/null and b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/Question_Windows_11.png differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/TaskDialog_Windows_11_Logo.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/TaskDialog_Windows_11_Logo.png new file mode 100644 index 000000000..8d1da7e26 Binary files /dev/null and b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/TaskDialog_Windows_11_Logo.png differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/TaskDialog_Windows_8_and_10_Logo.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/TaskDialog_Windows_8_and_10_Logo.png new file mode 100644 index 000000000..774cee4e1 Binary files /dev/null and b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/TaskDialog_Windows_8_and_10_Logo.png differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/Warning_Windows_11.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/Warning_Windows_11.png new file mode 100644 index 000000000..290b45b55 Binary files /dev/null and b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Resources/Warning_Windows_11.png differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/AnimationCache.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/AnimationCache.cs index f4c0699ab..68aa83237 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/AnimationCache.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/AnimationCache.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -94,11 +94,11 @@ public int Direction private void Animate() { currentFrame = currentFrame + direction; - if ((currentFrame <= 0) && (direction < 0)) + if (currentFrame <= 0 && direction < 0) { Stop(); } - else if ((currentFrame >= (length - 1)) && (direction > 0)) + else if (currentFrame >= length - 1 && direction > 0) { Stop(); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTable.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTable.cs index 66558922d..b24d40b93 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTable.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTable.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff10Black.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff10Black.cs index 8aa5a336f..473b4f6b9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff10Black.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff10Black.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff10Blue.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff10Blue.cs index ba036594a..a0ec7a9a3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff10Blue.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff10Blue.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff10Silver.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff10Silver.cs index e46c9386f..c4ec2373e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff10Silver.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff10Silver.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff3Blue.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff3Blue.cs index 7a8114ce2..ab6197912 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff3Blue.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff3Blue.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff3Green.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff3Green.cs index 48baab807..695322d2e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff3Green.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff3Green.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff3Silver.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff3Silver.cs index e571a3b25..40a15bb9c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff3Silver.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff3Silver.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff7Black.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff7Black.cs index c4bf0d012..8f10df888 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff7Black.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff7Black.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff7Blue.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff7Blue.cs index 16644f8ca..7ec7ab7fd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff7Blue.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff7Blue.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff7Silver.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff7Silver.cs index 134d7c8c7..5802c6a88 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff7Silver.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviColourTableOff7Silver.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviToolstripColourTable.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviToolstripColourTable.cs index 52b5a188f..07b5b7631 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviToolstripColourTable.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Colours/NaviToolstripColourTable.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandCollection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandCollection.cs index 9fcfe58df..aa114b67d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandCollection.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandCollection.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -212,7 +212,7 @@ void IList.Remove(object value) void IList.RemoveAt(int index) { - if ((index < 0) || (index >= _innerList.Count)) + if (index < 0 || index >= _innerList.Count) { throw new IndexOutOfRangeException(); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandEnumerator.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandEnumerator.cs index 9b0eb8790..412772400 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandEnumerator.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandEnumerator.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandOrderComparer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandOrderComparer.cs index aa3a342cb..a8d011490 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandOrderComparer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandOrderComparer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandOrgOrderComparer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandOrgOrderComparer.cs index 993fafc1c..f2ff1a712 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandOrgOrderComparer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandOrgOrderComparer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandSetting.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandSetting.cs index 993b49e50..5e04b5b2d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandSetting.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBandSetting.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBarSettings.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBarSettings.cs index 3be26b3b1..d435ad094 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBarSettings.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Common/NaviBarSettings.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviOffice10Renderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviOffice10Renderer.cs index 371978417..5a150477e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviOffice10Renderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviOffice10Renderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -89,7 +89,7 @@ public override void DrawNaviBandCollapsedBg(Graphics g, Rectangle bounds, strin bounds.Width -= 1; bounds.Height -= 1; - if ((state == InputState.Hovered)) + if (state == InputState.Hovered) { bounds.Inflate(new Size(-1, -1)); using (Pen p = new Pen(ColourTable.Border)) @@ -297,8 +297,8 @@ public override void DrawButtonBg(Graphics g, Rectangle bounds, ControlState sta bounds.Width -= 1; bounds.Height -= 1; - if (((state == ControlState.Active) && (inputState == InputState.Normal)) || - (inputState == InputState.Hovered)) + if ((state == ControlState.Active && inputState == InputState.Normal) || + inputState == InputState.Hovered) { bounds.Inflate(new Size(-1, -1)); using (Pen p = new Pen(ColourTable.Border)) @@ -628,15 +628,15 @@ public override void DrawButtonCollapseBg(Graphics g, Rectangle bounds, InputSta if (bounds.Height != 0) { - y = (bounds.Height / 2) - 3; + y = bounds.Height / 2 - 3; } if (bounds.Width != 0) { - x = (bounds.Width / 2) - 1; + x = bounds.Width / 2 - 1; } - if (((rightToLeft) && (!collapsed)) || (!rightToLeft) && (collapsed)) + if ((rightToLeft && !collapsed) || !rightToLeft && collapsed) { PointF[] points = {new PointF(x -2, y), new PointF(x+1,y + 3), diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviOffice3Renderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviOffice3Renderer.cs index 2156c6e2a..c58611d7c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviOffice3Renderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviOffice3Renderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -224,20 +224,20 @@ public override void DrawButtonBg(Graphics g, Rectangle bounds, ControlState sta { Color[] endColors = new Color[1]; - if ((state == ControlState.Normal) && (inputState == InputState.Normal)) + if (state == ControlState.Normal && inputState == InputState.Normal) { endColors = new Color[] { ColourTable.ButtonNormalColor2, ColourTable.ButtonNormalColor1 }; } - else if ((state == ControlState.Normal) && (inputState == InputState.Hovered)) + else if (state == ControlState.Normal && inputState == InputState.Hovered) { endColors = new Color[] { ColourTable.ButtonHoveredColor2, ColourTable.ButtonHoveredColor1 }; } - else if ((state == ControlState.Active) && (inputState == InputState.Normal)) + else if (state == ControlState.Active && inputState == InputState.Normal) { endColors = new Color[] { ColourTable.ButtonActiveColor2, ColourTable.ButtonActiveColor1 }; } - else if ((inputState == InputState.Clicked) - || ((state == ControlState.Active) && (inputState == InputState.Hovered))) + else if (inputState == InputState.Clicked + || (state == ControlState.Active && inputState == InputState.Hovered)) { endColors = new Color[] { ColourTable.ButtonActiveColor1, ColourTable.ButtonActiveColor2 }; } @@ -313,7 +313,7 @@ public override void DrawButtonCollapseBg(Graphics g, Rectangle bounds, InputSta g.FillRectangle(brush, bounds); } - if ((inputState == InputState.Clicked) || (inputState == InputState.Hovered)) + if (inputState is InputState.Clicked or InputState.Hovered) { Rectangle smallBounds = bounds; smallBounds.Location = new Point(smallBounds.Left + 4, smallBounds.Top + 3); @@ -351,15 +351,15 @@ public override void DrawButtonCollapseBg(Graphics g, Rectangle bounds, InputSta if (bounds.Height != 0) { - y = (bounds.Height / 2) - 3; + y = bounds.Height / 2 - 3; } if (bounds.Width != 0) { - x = (bounds.Width / 2) - 1; + x = bounds.Width / 2 - 1; } - if (((rightToLeft) && (!collapsed)) || (!rightToLeft) && (collapsed)) + if ((rightToLeft && !collapsed) || !rightToLeft && collapsed) { PointF[] points = {new PointF(x -3, y), new PointF(x,y + 3), @@ -490,7 +490,7 @@ public override void DrawNaviGroupHeader(Graphics g, Rectangle bounds, InputStat if (bounds.Height != 0) { - y = (bounds.Height / 2) - 3; // + 1px border and - 4 size + y = bounds.Height / 2 - 3; // + 1px border and - 4 size } if (rightToLeft) @@ -584,8 +584,8 @@ public override void DrawSplitterBg(Graphics g, Rectangle bounds) g.FillRectangle(brush, bounds); } - int centerX = bounds.Right - (bounds.Width / 2); - int centerY = bounds.Bottom - (bounds.Height / 2); + int centerX = bounds.Right - bounds.Width / 2; + int centerY = bounds.Bottom - bounds.Height / 2; using (SolidBrush b = new SolidBrush(ColourTable.Border)) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviOffice7Renderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviOffice7Renderer.cs index 5880668ee..2b4e10a85 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviOffice7Renderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviOffice7Renderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -266,23 +266,23 @@ public override void DrawButtonBg(Graphics g, Rectangle bounds, ControlState sta { Color[] endColors = new Color[1]; - if ((state == ControlState.Normal) && (inputState == InputState.Normal)) + if (state == ControlState.Normal && inputState == InputState.Normal) { endColors = new Color[] { ColourTable.ButtonNormalColor1, ColourTable.ButtonNormalColor2, ColourTable.ButtonNormalColor3, ColourTable.ButtonNormalColor4 }; } - else if ((state == ControlState.Normal) && (inputState == InputState.Hovered)) + else if (state == ControlState.Normal && inputState == InputState.Hovered) { endColors = new Color[] { ColourTable.ButtonHoveredColor1, ColourTable.ButtonHoveredColor2, ColourTable.ButtonHoveredColor3, ColourTable.ButtonHoveredColor4 }; } - else if ((state == ControlState.Active) && (inputState == InputState.Normal)) + else if (state == ControlState.Active && inputState == InputState.Normal) { endColors = new Color[] { ColourTable.ButtonActiveColor1, ColourTable.ButtonActiveColor2, ColourTable.ButtonActiveColor3, ColourTable.ButtonActiveColor4 }; } - else if ((inputState == InputState.Clicked) - || ((state == ControlState.Active) && (inputState == InputState.Hovered))) + else if (inputState == InputState.Clicked + || (state == ControlState.Active && inputState == InputState.Hovered)) { endColors = new Color[] { ColourTable.ButtonClickedColor1, ColourTable.ButtonClickedColor2, ColourTable.ButtonClickedColor3, ColourTable.ButtonClickedColor4 }; @@ -358,7 +358,7 @@ public override void DrawButtonCollapseBg(Graphics g, Rectangle bounds, InputSta g.FillRectangle(brush, bounds); } - if ((inputState == InputState.Clicked) || (inputState == InputState.Hovered)) + if (inputState is InputState.Clicked or InputState.Hovered) { Rectangle smallBounds = bounds; smallBounds.Location = new Point(smallBounds.Left + 4, smallBounds.Top + 3); @@ -386,15 +386,15 @@ public override void DrawButtonCollapseBg(Graphics g, Rectangle bounds, InputSta if (bounds.Height != 0) { - y = (bounds.Height / 2) - 3; + y = bounds.Height / 2 - 3; } if (bounds.Width != 0) { - x = (bounds.Width / 2) - 1; + x = bounds.Width / 2 - 1; } - if (((rightToLeft) && (!collapsed)) || (!rightToLeft) && (collapsed)) + if ((rightToLeft && !collapsed) || !rightToLeft && collapsed) { PointF[] points = {new PointF(x -3, y), new PointF(x,y + 3), @@ -540,7 +540,7 @@ public override void DrawNaviGroupHeader(Graphics g, Rectangle bounds, InputStat if (bounds.Height != 0) { - y = (bounds.Height / 2) - 3; // + 1px border and - 4 size + y = bounds.Height / 2 - 3; // + 1px border and - 4 size } if (rightToLeft) @@ -635,8 +635,8 @@ public override void DrawSplitterBg(Graphics g, Rectangle bounds) g.FillRectangle(brush, bounds); } - int centerX = bounds.Right - (bounds.Width / 2); - int centerY = bounds.Bottom - (bounds.Height / 2); + int centerX = bounds.Right - bounds.Width / 2; + int centerY = bounds.Bottom - bounds.Height / 2; using (SolidBrush b = new SolidBrush(ColourTable.Border)) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviRenderer.cs index b7ee06b96..99e4ce25c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviToolstripRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviToolstripRenderer.cs index f8e31b9c3..923a66dc7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviToolstripRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Drawing/NaviToolstripRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/ExtCollection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/ExtCollection.cs index bed99b74f..14afc7dd3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/ExtCollection.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/ExtCollection.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -85,7 +85,7 @@ protected override void OnRemoveComplete(int index, object value) { base.OnRemoveComplete(index, value); CollectionEventHandler? handler = m_itemRemoved; - if ((handler != null) + if (handler != null && _notify) { handler(this, new ExtCollectionEventArgs(value)); @@ -99,7 +99,7 @@ protected override void OnInsertComplete(int index, object value) { base.OnInsertComplete(index, value); CollectionEventHandler? handler = m_itemAdded; - if ((handler != null) + if (handler != null && _notify) { handler(this, new ExtCollectionEventArgs(value)); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/ExtDrawing.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/ExtDrawing.cs index 45890208b..239e763e6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/ExtDrawing.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/ExtDrawing.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/LargeImageIndexConverter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/LargeImageIndexConverter.cs index e34d36ec1..8db5ac741 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/LargeImageIndexConverter.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/LargeImageIndexConverter.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -35,7 +35,7 @@ public class LargeImageIndexConverter : ImageIndexConverter { int result = -1; string text = value.ToString(); - if (!text.Equals("(none)") && !(string.IsNullOrEmpty(text))) + if (!text.Equals("(none)") && !string.IsNullOrEmpty(text)) { int.TryParse(text, out result); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/LargeImageIndexEditor.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/LargeImageIndexEditor.cs index 89bcfe39b..74050c70f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/LargeImageIndexEditor.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/LargeImageIndexEditor.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -59,7 +59,7 @@ PropertyDescriptorCollection PropertyCollection imageList = (ImageList)property.GetValue(instance); } - if ((imageList != null) && (imageList.Images.Count > imageIndex) && (imageIndex >= 0)) + if (imageList != null && imageList.Images.Count > imageIndex && imageIndex >= 0) { image = imageList.Images[imageIndex]; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Layout/NaviLayoutEngine.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Layout/NaviLayoutEngine.cs index dd12563dd..a7098294e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Layout/NaviLayoutEngine.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Layout/NaviLayoutEngine.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Layout/NaviLayoutEngineOffice.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Layout/NaviLayoutEngineOffice.cs index db76c1ef8..f1eeae31c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Layout/NaviLayoutEngineOffice.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Layout/NaviLayoutEngineOffice.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -47,7 +47,7 @@ public class NaviLayoutEngineOffice : NaviLayoutEngine private PopupWindowHelper popupHelper = null; private readonly object threadLock = new object(); private NaviBandEnumerator ienum; - private Font headerFont = new Font("Arial", 11F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(0))); + private Font headerFont = new Font("Arial", 11F, FontStyle.Bold, GraphicsUnit.Point, (byte)0); private NaviRenderer renderer; private int splitterHeight = 8; private int optionButtonWidth = 18; @@ -306,7 +306,7 @@ public override bool Layout(object container, System.Windows.Forms.LayoutEventAr CalculateButtonLayout(); LayoutSplitter(); LayoutBands(); // First, because of the options menu - LayoutButtons((layoutEventArgs != null) && (layoutEventArgs.AffectedProperty == "OptionsMenu")); + LayoutButtons(layoutEventArgs != null && layoutEventArgs.AffectedProperty == "OptionsMenu"); LayoutAdditionalControls(); return true; @@ -340,7 +340,7 @@ private void LayoutAdditionalControls() } // Initializes Collapse button - collapseButton.Visible = Bar.ShowCollapseButton && (!showNeverCollapse); + collapseButton.Visible = Bar.ShowCollapseButton && !showNeverCollapse; collapseButton.Size = new Size(Bar.HeaderHeight, Bar.HeaderHeight - 3); if (Bar.RightToLeft == RightToLeft.Yes) @@ -375,10 +375,10 @@ private void LayoutMenu() /// True when the x and y coordinate are inside the bounds; False otherwise private bool MouseInSplitter(int x, int y) { - return ((x > splitterRectangle.X) - && (x < splitterRectangle.Right) - && (y > splitterRectangle.Y) - && (y < splitterRectangle.Bottom)); + return x > splitterRectangle.X + && x < splitterRectangle.Right + && y > splitterRectangle.Y + && y < splitterRectangle.Bottom; } /// @@ -393,13 +393,13 @@ private void DragSplitter(int ylocation) { // Position of the mouse calculated from the buttom of the control up to the top to // make things easier. - int ylocinv = (Bar.Height - ylocation) - smallButtonRectangle.Height - splitterHeight; + int ylocinv = Bar.Height - ylocation - smallButtonRectangle.Height - splitterHeight; // Check whether splitter is inside bounds if (ylocinv > 0) { // Increment position using a step. - if (ylocinv > (Bar.ButtonHeight + (Bar.VisibleLargeButtons * Bar.ButtonHeight))) + if (ylocinv > Bar.ButtonHeight + Bar.VisibleLargeButtons * Bar.ButtonHeight) { if (Bar.VisibleLargeButtons < visibleButtonCount) { @@ -407,7 +407,7 @@ private void DragSplitter(int ylocation) } } // Bar.ButtonHeight / 2 because it looks more smooth - else if (ylocinv <= ((Bar.ButtonHeight * Bar.VisibleLargeButtons) - (Bar.ButtonHeight / 2))) + else if (ylocinv <= Bar.ButtonHeight * Bar.VisibleLargeButtons - Bar.ButtonHeight / 2) { if (Bar.VisibleLargeButtons > 0) { @@ -432,7 +432,7 @@ private void LayoutSplitter() { // splitterposition is calculated from the bottom of the control to the top. // Thats not the same as the regular coordinate system. - splitterPosition = (Bar.ButtonHeight * largeButtonCount) + splitterHeight; + splitterPosition = Bar.ButtonHeight * largeButtonCount + splitterHeight; // inverse calculation // Width - 2 extra space reserved for the borders on both sides @@ -508,7 +508,7 @@ private void CalculateButtonLayout() private void LayoutLargeButtons() { // Gently lays out the position of the large buttons - int flow = (splitterPosition + smallButtonRectangle.Height + 1) - splitterHeight; + int flow = splitterPosition + smallButtonRectangle.Height + 1 - splitterHeight; for (int i = 0; i < largeButtonCount; i++) { @@ -530,7 +530,7 @@ private void LayoutLargeButtons() /// private void LayoutOverflowButtons() { - int compactFlow = (overflowCount * Bar.MinimizedButtonWidth) + 1; + int compactFlow = overflowCount * Bar.MinimizedButtonWidth + 1; // This may seem odd but the buttons are positioned from the left to the right. // The first overflow button will appear as the first left button. @@ -601,8 +601,8 @@ private void LayoutMenuItems() { menuitem.Image = band.SmallImage; } - else if ((band != null) && (band.SmallImageIndex >= 0) && (band.SmallImages != null) - && (band.SmallImageIndex < band.SmallImages.Images.Count)) + else if (band != null && band.SmallImageIndex >= 0 && band.SmallImages != null + && band.SmallImageIndex < band.SmallImages.Images.Count) { menuitem.Image = band.SmallImages.Images[band.SmallImageIndex]; } @@ -695,8 +695,8 @@ private void LayoutBands() { band.Location = new Point(1, Bar.HeaderHeight); - if ((band == Bar.ActiveBand) - && (!Bar.Collapsed)) + if (band == Bar.ActiveBand + && !Bar.Collapsed) { // Fake the change z-order to front // BringToFront give design time issues in ordering of the bands @@ -707,8 +707,8 @@ private void LayoutBands() band.Size = new Size(0, 0); } } - if ((Bar.Collapsed) - && (collapsedBand != null)) + if (Bar.Collapsed + && collapsedBand != null) { collapsedBand.Visible = true; collapsedBand.BringToFront(); @@ -723,7 +723,7 @@ private void LayoutBands() } else { - if ((collapsedBand != null) && (collapsedBand.Visible)) + if (collapsedBand != null && collapsedBand.Visible) { collapsedBand.Visible = false; } @@ -744,9 +744,9 @@ private void HandleMouseDown(MouseEventArgs e) { if (e != null) { - if ((e.Button == MouseButtons.Left) - && (e.Clicks == 1) - && (MouseInSplitter(e.X, e.Y))) + if (e.Button == MouseButtons.Left + && e.Clicks == 1 + && MouseInSplitter(e.X, e.Y)) { splitterDragging = true; } @@ -770,8 +770,8 @@ private void HandleMouseMove(MouseEventArgs e) DragSplitter(e.Y); } - if ((MouseInSplitter(e.X, e.Y)) - || (splitterDragging)) + if (MouseInSplitter(e.X, e.Y) + || splitterDragging) { Bar.Cursor = Cursors.SizeNS; } @@ -933,8 +933,8 @@ private void InitializeSubMenu() { menuItem.Image = band.SmallImage; } - else if ((band != null) && (band.SmallImageIndex >= 0) && (band.SmallImages != null) - && (band.SmallImageIndex < band.SmallImages.Images.Count)) + else if (band != null && band.SmallImageIndex >= 0 && band.SmallImages != null + && band.SmallImageIndex < band.SmallImages.Images.Count) { menuItem.Image = band.SmallImages.Images[band.SmallImageIndex]; } @@ -1036,7 +1036,7 @@ public void ShowMoreOptionsDialog() ///
public virtual void ClosePopup() { - if ((Bar.Collapsed) && (popup.Visible)) + if (Bar.Collapsed && popup.Visible) { popupHelper.ClosePopup(); } @@ -1047,8 +1047,8 @@ public virtual void ClosePopup() ///
public virtual void SwitchCollapsion(bool collapse, bool oldCollapsed) { - if ((collapse) - && (!oldCollapsed)) + if (collapse + && !oldCollapsed) { orgWidth = Bar.Width; Bar.Width = 33; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Layout/NaviLayoutFactory.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Layout/NaviLayoutFactory.cs index 0132fe4de..58fe1d6a5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Layout/NaviLayoutFactory.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/Layout/NaviLayoutFactory.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/NativeMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/NativeMethods.cs index 03c7f1720..235727ae2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/NativeMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/NativeMethods.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/PopupWindowHelper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/PopupWindowHelper.cs index 5908ecf47..414789e95 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/PopupWindowHelper.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/PopupWindowHelper.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -168,7 +168,7 @@ protected override void WndProc(ref Message m) if (m.Msg == NativeMethods.WM_NCACTIVATE) { // Check if the title bar will made inactive: - if (((int)m.WParam) == 0) + if ((int)m.WParam == 0) { // If so reactivate it. NativeMethods.SendMessage(this.Handle, NativeMethods.WM_NCACTIVATE, 1, IntPtr.Zero); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/PopupWindowHelperMessageFilter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/PopupWindowHelperMessageFilter.cs index 967526c84..44b9f2943 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/PopupWindowHelperMessageFilter.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/PopupWindowHelperMessageFilter.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/SmallImageIndexConverter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/SmallImageIndexConverter.cs index 5f7e65405..303e5e892 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/SmallImageIndexConverter.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/SmallImageIndexConverter.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -35,7 +35,7 @@ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo c { int result = -1; string text = value.ToString(); - if (!text.Equals("(none)") && !(string.IsNullOrEmpty(text))) + if (!text.Equals("(none)") && !string.IsNullOrEmpty(text)) { int.TryParse(text, out result); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/SmallImageIndexEditor.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/SmallImageIndexEditor.cs index 9da6cae91..27d6af3ba 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/SmallImageIndexEditor.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Classes/SmallImageIndexEditor.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -58,7 +58,7 @@ PropertyDescriptorCollection PropertyCollection imageList = (ImageList)property.GetValue(instance); } - if ((imageList != null) && (imageList.Images.Count > imageIndex) && (imageIndex >= 0)) + if (imageList != null && imageList.Images.Count > imageIndex && imageIndex >= 0) { image = imageList.Images[imageIndex]; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviBand.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviBand.cs index 123aac747..25a7cb667 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviBand.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviBand.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviBandClientArea.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviBandClientArea.cs index 98f1a5e03..7b3337dfe 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviBandClientArea.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviBandClientArea.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviBandCollapsed.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviBandCollapsed.cs index 8674a1364..5a866a86c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviBandCollapsed.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviBandCollapsed.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -84,7 +84,7 @@ internal void Initialize() SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.ResizeRedraw, true); - headerFont = new Font("Arial", 11F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(0))); + headerFont = new Font("Arial", 11F, FontStyle.Bold, GraphicsUnit.Point, (byte)0); ResizeRedraw = true; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviBar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviBar.cs index 675a3cfad..8a36b1026 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviBar.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviBar.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -595,13 +595,13 @@ public void SetActiveBand(NaviBand newBand) { foreach (NaviBand band in bands) { - if ((band != newBand) && (band.Button != null)) + if (band != newBand && band.Button != null) { band.Button.Active = false; } } } - if ((newBand != null) && (newBand.Button != null)) + if (newBand != null && newBand.Button != null) { newBand.Button.Active = true; } @@ -767,7 +767,7 @@ protected override Control.ControlCollection CreateControlsInstance() protected override void OnLayout(LayoutEventArgs e) { base.OnLayout(e); - if ((layoutEngineDirty) && !(layoutFactory == null)) + if (layoutEngineDirty && !(layoutFactory == null)) { layoutFactory.ReinitializeLayout(); layoutEngineDirty = false; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviButton.cs index 1cd9559ca..3639de9ff 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -266,20 +266,20 @@ protected override void OnPaint(PaintEventArgs e) { imageSmall = smallImage; } - else if ((band != null) && (band.SmallImage != null)) + else if (band != null && band.SmallImage != null) { imageSmall = band.SmallImage; } - else if ((band != null) && (band.SmallImageIndex >= 0) && (band.SmallImages != null) - && (band.SmallImageIndex < band.SmallImages.Images.Count)) + else if (band != null && band.SmallImageIndex >= 0 && band.SmallImages != null + && band.SmallImageIndex < band.SmallImages.Images.Count) { imageSmall = band.SmallImages.Images[band.SmallImageIndex]; } - if ((imageSmall != null) && (showImage)) + if (imageSmall != null && showImage) { - Point location = new Point((int)((Width / 2) - (imageSmall.Width / 2)), - (int)((Height / 2) - (imageSmall.Height / 2))); + Point location = new Point((int)(Width / 2 - imageSmall.Width / 2), + (int)(Height / 2 - imageSmall.Height / 2)); Renderer.DrawImage(e.Graphics, location, imageSmall); } } @@ -292,17 +292,17 @@ protected override void OnPaint(PaintEventArgs e) { imageLarge = largeImage; } - else if ((band != null) && (band.LargeImage != null)) + else if (band != null && band.LargeImage != null) { imageLarge = band.LargeImage; } - else if ((band != null) && (band.LargeImageIndex >= 0) - && (band.LargeImageIndex < band.LargeImages.Images.Count)) + else if (band != null && band.LargeImageIndex >= 0 + && band.LargeImageIndex < band.LargeImages.Images.Count) { imageLarge = band.LargeImages.Images[band.LargeImageIndex]; } - if ((imageLarge != null) && showImage) + if (imageLarge != null && showImage) { Point location; @@ -314,11 +314,11 @@ protected override void OnPaint(PaintEventArgs e) if (RightToLeft == RightToLeft.Yes) { - location = new Point(Width - margin - imageLarge.Width, (int)((Height / 2) - (imageLarge.Height / 2))); + location = new Point(Width - margin - imageLarge.Width, (int)(Height / 2 - imageLarge.Height / 2)); } else { - location = new Point(margin, (int)((Height / 2) - (imageLarge.Height / 2))); + location = new Point(margin, (int)(Height / 2 - imageLarge.Height / 2)); } Renderer.DrawImage(e.Graphics, location, imageLarge); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviButtonCollapse.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviButtonCollapse.cs index 665121dd7..be421ba0d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviButtonCollapse.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviButtonCollapse.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviButtonOptions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviButtonOptions.cs index 4dcfd4d38..008b275b8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviButtonOptions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviButtonOptions.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviCheckedListBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviCheckedListBox.cs index 490d12de5..b4f3195c4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviCheckedListBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviCheckedListBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviContextMenu.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviContextMenu.cs index 04625d955..fceec1778 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviContextMenu.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviContextMenu.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviControl.cs index 6a351f18f..c5f8373a2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviGroup.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviGroup.cs index b85adfe05..200c2f5d0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviGroup.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviGroup.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -281,7 +281,7 @@ protected override void OnPaint(PaintEventArgs e) containerRect.X++; containerRect.Y += headerHeight + 1; containerRect.Width -= 3; - containerRect.Height -= (headerHeight + 3); + containerRect.Height -= headerHeight + 3; Renderer.DrawHatchedPanel(e.Graphics, containerRect); } @@ -311,7 +311,7 @@ protected override void OnMouseClick(MouseEventArgs e) else { base.OnMouseClick(e); - if ((m_contextMenuStrip != null) && (e.Button == MouseButtons.Right)) + if (m_contextMenuStrip != null && e.Button == MouseButtons.Right) { m_contextMenuStrip.Show(this, e.Location); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviSuiteLanguageManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviSuiteLanguageManager.cs index 2b610189f..455596200 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviSuiteLanguageManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/Components/NaviSuiteLanguageManager.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -66,7 +66,7 @@ public NaviSuiteLanguageManager() [EditorBrowsable(EditorBrowsableState.Never)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public bool IsDefault => !(ShouldSerializeNaviSuiteStrings()); + public bool IsDefault => !ShouldSerializeNaviSuiteStrings(); public void Reset() { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/User Controls/NaviSuiteControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/User Controls/NaviSuiteControl.cs index a8f6360ca..502b48d89 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/User Controls/NaviSuiteControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Controls/User Controls/NaviSuiteControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -45,7 +45,7 @@ public partial class NaviSuiteControl : ContainerControl /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { - if (disposing && (components != null)) + if (disposing && components != null) { components.Dispose(); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Design/Designers/NaviBandDesigner.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Design/Designers/NaviBandDesigner.cs index 6694f207c..4894a5a71 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Design/Designers/NaviBandDesigner.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Design/Designers/NaviBandDesigner.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Design/Designers/NaviBarDesigner.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Design/Designers/NaviBarDesigner.cs index c26dc19cc..9598b4958 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Design/Designers/NaviBarDesigner.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Design/Designers/NaviBarDesigner.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Design/Designers/NaviBarToolboxItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Design/Designers/NaviBarToolboxItem.cs index 9fe00196d..86fa9cb3a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Design/Designers/NaviBarToolboxItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Design/Designers/NaviBarToolboxItem.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Design/Designers/NaviGroupDesigner.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Design/Designers/NaviGroupDesigner.cs index 142d1d049..e7bb848c6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Design/Designers/NaviGroupDesigner.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Design/Designers/NaviGroupDesigner.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Enumerations/ControlState.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Enumerations/ControlState.cs index a51da1003..bc72796ac 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Enumerations/ControlState.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Enumerations/ControlState.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Enumerations/InputState.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Enumerations/InputState.cs index f9bf608f5..c5be57600 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Enumerations/InputState.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Enumerations/InputState.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Enumerations/NaviLayoutStyle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Enumerations/NaviLayoutStyle.cs index 65ed9de0d..b32115544 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Enumerations/NaviLayoutStyle.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Enumerations/NaviLayoutStyle.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/AnimationEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/AnimationEventArgs.cs index 83d931bb7..395cd2f84 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/AnimationEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/AnimationEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/ExtCollectionEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/ExtCollectionEventArgs.cs index a349850f2..d24667c63 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/ExtCollectionEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/ExtCollectionEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/NaviBandEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/NaviBandEventArgs.cs index 725542e7c..a32124c31 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/NaviBandEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/NaviBandEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/PopupCancelEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/PopupCancelEventArgs.cs index 0a576313b..7dd7ba5c5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/PopupCancelEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/PopupCancelEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/PopupClosedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/PopupClosedEventArgs.cs index 8d3418c03..6d4b46183 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/PopupClosedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Events/PopupClosedEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Globals/GlobalDeclarations.cs index cd01d0e3c..7a723a9b8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Interfaces/IObservable.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Interfaces/IObservable.cs index 7139c6ef2..95be256f4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Interfaces/IObservable.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Interfaces/IObservable.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Interfaces/IObserver.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Interfaces/IObserver.cs index cf5905585..84ee36456 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Interfaces/IObserver.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Interfaces/IObserver.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Krypton.Toolkit.Suite.Extended.Navi.Suite 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Krypton.Toolkit.Suite.Extended.Navi.Suite 2022.csproj index 611d4163b..ad2b3f833 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Krypton.Toolkit.Suite.Extended.Navi.Suite 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Krypton.Toolkit.Suite.Extended.Navi.Suite 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements the 'NaviSuite' control. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements the 'NaviSuite' control. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,74 +69,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Krypton.Toolkit.Suite.Extended.Navi.Suite.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Krypton.Toolkit.Suite.Extended.Navi.Suite.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Krypton.Toolkit.Suite.Extended.Navi.Suite.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Krypton.Toolkit.Suite.Extended.Navi.Suite.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Translations/NaviSuiteStrings.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Translations/NaviSuiteStrings.cs index c08bfb78c..7de424ab4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Translations/NaviSuiteStrings.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Translations/NaviSuiteStrings.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/UX/NaviBandPopup.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/UX/NaviBandPopup.cs index eac34bde5..6d6bb2fd3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/UX/NaviBandPopup.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/UX/NaviBandPopup.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -156,8 +156,8 @@ protected override void OnPaintBackground(PaintEventArgs e) protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); - if ((e.Button == MouseButtons.Left) - && (e.Clicks == 1)) + if (e.Button == MouseButtons.Left + && e.Clicks == 1) { if (resizeBounds.Contains(e.Location)) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/UX/NaviOptionsForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/UX/NaviOptionsForm.cs index e89815daf..913c1d20c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/UX/NaviOptionsForm.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/UX/NaviOptionsForm.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -54,8 +54,8 @@ public void Initialize(NaviBar bar) private void Translate() { - buttonCancel.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel; - buttonOk.Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + buttonCancel.Text = KryptonManager.Strings.GeneralStrings.Cancel; + buttonOk.Text = KryptonManager.Strings.GeneralStrings.OK; labelDesc.Text = NaviSuiteLanguageManager.SuiteStrings.Description; buttonMoveDown.Text = NaviSuiteLanguageManager.SuiteStrings.MoveDown; buttonMoveUp.Text = NaviSuiteLanguageManager.SuiteStrings.MoveUp; @@ -97,8 +97,8 @@ private void buttonMoveUp_Click(object sender, EventArgs e) private void buttonMoveDown_Click(object sender, EventArgs e) { - if ((kclbBands.SelectedIndex > 0) - && (kclbBands.SelectedIndex < kclbBands.Items.Count - 1)) + if (kclbBands.SelectedIndex > 0 + && kclbBands.SelectedIndex < kclbBands.Items.Count - 1) { bool oldChecked = kclbBands.CheckedIndices.Contains( kclbBands.SelectedIndex + 1); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/KryptonNavigatorButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/KryptonNavigatorButton.cs index 9ec1fddbc..544060507 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/KryptonNavigatorButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/KryptonNavigatorButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/OutlookBarButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/OutlookBarButton.cs index 052f1a09b..ead9d425b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/OutlookBarButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/OutlookBarButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/OutlookBarButtonCollection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/OutlookBarButtonCollection.cs index 2c65d1b79..c7b445508 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/OutlookBarButtonCollection.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/OutlookBarButtonCollection.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/SubClass.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/SubClass.cs index 2de8a43bb..ef78c87f3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/SubClass.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/SubClass.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -65,14 +65,14 @@ public void CallDefaultWndProc(ref Message m) #region HiWord Message Cracker public int HiWord(int Number) { - return ((Number >> 16) & 0xffff); + return (Number >> 16) & 0xffff; } #endregion #region LoWord Message Cracker public int LoWord(int Number) { - return (Number & 0xffff); + return Number & 0xffff; } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/Utility.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/Utility.cs index c70056473..52976e0b5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/Utility.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/Utility.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/WIN32.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/WIN32.cs index 02b03eb8d..9fc1f697e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/WIN32.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Classes/WIN32.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/CustomButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/CustomButton.cs index 2e3cfbd41..0704be1ea 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/CustomButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/CustomButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -262,7 +262,7 @@ private void SetControlSizes() _buttonRect = new Rectangle(ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width - 1, ClientRectangle.Height - 1); _rectCornerRadius = Math.Max(1, scalingDividend / 10); _rectOutlineWidth = Math.Max(1, scalingDividend / 50); - _highlightRect = new Rectangle(ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width - 1, (ClientRectangle.Height - 1)); + _highlightRect = new Rectangle(ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width - 1, ClientRectangle.Height - 1); _highlightRectOffset = Math.Max(1, scalingDividend / 35); _defaultHighlightOffset = Math.Max(1, scalingDividend / 35); } @@ -639,7 +639,7 @@ protected override void OnMouseDown(MouseEventArgs mevent) protected override void OnKeyDown(KeyEventArgs kevent) { - if (kevent.KeyCode == Keys.Space || kevent.KeyCode == Keys.Return) + if (kevent.KeyCode is Keys.Space or Keys.Return) { PressButton(); } @@ -679,7 +679,7 @@ protected override void OnMouseUp(MouseEventArgs mevent) protected override void OnKeyUp(KeyEventArgs kevent) { - if (kevent.KeyCode == Keys.Space || kevent.KeyCode == Keys.Return) + if (kevent.KeyCode is Keys.Space or Keys.Return) { ReleaseButton(); if (IsDefault) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/CustomNavigatorButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/CustomNavigatorButton.cs index 3b5f2ea84..cf357ebc7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/CustomNavigatorButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/CustomNavigatorButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/CustomTabControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/CustomTabControl.cs index 5864b457b..25acf7308 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/CustomTabControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/CustomTabControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -418,7 +418,7 @@ private void InitColors() TabColourPressedDark = Color.FromArgb(232, 142, 49);// _paletteBack.GetBackColor1(PaletteState.Pressed); // Color.FromArgb(252, 143, 61);// TabColourPressedLight = Color.FromArgb(252, 207, 100);//= _paletteBack.GetBackColor2(PaletteState.Pressed); // Color.FromArgb(255, 224, 192);// - if ((_preserveTabColour == false)) //to avoid black text on black tab + if (_preserveTabColour == false) //to avoid black text on black tab { TabForeColour = Color.FromArgb(21, 66, 139); } @@ -639,7 +639,7 @@ internal void DrawControl(Graphics g) //if top or bottom leave a blank space for Close button or navigator - if ((Alignment == TabAlignment.Top) || (Alignment == TabAlignment.Bottom)) + if (Alignment is TabAlignment.Top or TabAlignment.Bottom) { rreg = new Rectangle(tabArea.Left, tabControlArea.Top, nWidth - N_MARGIN, tabControlArea.Height); } @@ -707,7 +707,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) tabTextArea.Width = 22; } - bool bSelected = (SelectedIndex == nIndex); + bool bSelected = SelectedIndex == nIndex; bool bHot = false; if (tabPage.Tag != null) @@ -750,11 +750,11 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) //bool bHotselected = false; - if ((bSelected) && (!bHot)) + if (bSelected && !bHot) { status = DrawingMethods.TabHeaderStatus.Selected; } - else if ((bSelected) && (bHot)) + else if (bSelected && bHot) { status = DrawingMethods.TabHeaderStatus.HotSelected; //bHotselected = true; @@ -1006,7 +1006,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) //---------------------------- - if (((status == DrawingMethods.TabHeaderStatus.Selected) || (status == DrawingMethods.TabHeaderStatus.HotSelected)) && (Appearance == TabAppearance.Normal)) + if (status is DrawingMethods.TabHeaderStatus.Selected or DrawingMethods.TabHeaderStatus.HotSelected && Appearance == TabAppearance.Normal) { //---------------------------- // clear bottom lines @@ -1022,7 +1022,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) //---------------------------- // draw tab's icon - if (ImageList != null && (tabPage.ImageIndex >= 0) && (ImageList != null) && (ImageList.Images[tabPage.ImageIndex] != null)) + if (ImageList != null && tabPage.ImageIndex >= 0 && ImageList != null && ImageList.Images[tabPage.ImageIndex] != null) { int nLeftMargin = 8; int nRightMargin = 2; @@ -1032,12 +1032,12 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) Rectangle rimage = new Rectangle(recBounds.X + nLeftMargin, recBounds.Y + 1, img.Width, img.Height); // adjust rectangles - float nAdj = (nLeftMargin + img.Width + nRightMargin); + float nAdj = nLeftMargin + img.Width + nRightMargin; // adjust rectangles - if (Alignment == TabAlignment.Top || Alignment == TabAlignment.Bottom) + if (Alignment is TabAlignment.Top or TabAlignment.Bottom) { - nAdj = (nLeftMargin + img.Width + nRightMargin); + nAdj = nLeftMargin + img.Width + nRightMargin; rimage.Y += (recBounds.Height - img.Height) / 2; tabTextArea.X += nAdj; @@ -1092,7 +1092,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) } - if (Alignment == TabAlignment.Right || Alignment == TabAlignment.Left) + if (Alignment is TabAlignment.Right or TabAlignment.Left) { //not ExtendedLayout if (_useExtendedLayout == false) @@ -1133,7 +1133,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) internal void DrawIcons(Graphics g) { - if ((_leftRightImages == null) || (_leftRightImages.Images.Count != 4)) + if (_leftRightImages == null || _leftRightImages.Images.Count != 4) { return; } @@ -1163,7 +1163,7 @@ internal void DrawIcons(Graphics g) border.Dispose(); - int nMiddle = (r0.Width / 2); + int nMiddle = r0.Width / 2; int nTop = (r0.Height - 16) / 2; int nLeft = (nMiddle - 16) / 2; @@ -1200,7 +1200,7 @@ internal void DrawIcons(Graphics g) if (TabCount > 0) { Rectangle r3 = GetTabRect(TabCount - 1); - if (r3.Right > (tabControlArea.Width - r0.Width)) + if (r3.Right > tabControlArea.Width - r0.Width) { g.DrawImage(img, r2); } @@ -1350,7 +1350,7 @@ private bool IsFirstTabHidden() { firstPagePosition = GetTabRect(0).Left; //not visible? - if ((firstPagePosition < 0)) + if (firstPagePosition < 0) { display = true; } @@ -1370,7 +1370,7 @@ private bool IsLastTabHidden() if (TabCount > 0) { //visible? - if ((GetTabRect(TabCount - 1).Right > _scroller.Left)) + if (GetTabRect(TabCount - 1).Right > _scroller.Left) { display = true; } @@ -1408,7 +1408,7 @@ protected override void OnPaintBackground(PaintEventArgs pevent) } //test on tab pages - if ((!IsLastTabHidden()) && (!IsFirstTabHidden())) + if (!IsLastTabHidden() && !IsFirstTabHidden()) { _allowInternalNavigatorButtons = false; } @@ -1417,7 +1417,7 @@ protected override void OnPaintBackground(PaintEventArgs pevent) _allowInternalNavigatorButtons = true; } //show navigator buttons? - if ((_allowNavigatorButtons) && (_allowInternalNavigatorButtons)) + if (_allowNavigatorButtons && _allowInternalNavigatorButtons) { _scroller.LeftScroller.Visible = true; _scroller.RightScroller.Visible = true; @@ -1437,7 +1437,7 @@ protected override void OnPaintBackground(PaintEventArgs pevent) //which buttons to display if (_allowCloseButton) { - if ((_allowNavigatorButtons) && (_allowInternalNavigatorButtons)) + if (_allowNavigatorButtons && _allowInternalNavigatorButtons) { if (_allowContextButton) { @@ -1468,7 +1468,7 @@ protected override void OnPaintBackground(PaintEventArgs pevent) } else { - if ((_allowNavigatorButtons) && (_allowInternalNavigatorButtons)) + if (_allowNavigatorButtons && _allowInternalNavigatorButtons) { if (_allowContextButton) { @@ -1617,7 +1617,7 @@ private void Scroller_ContextMenuButton(Object sender, EventArgs e) { //TabPage tp = (TabPage)e.Control; ToolStripMenuItem item; - if ((ImageList != null) && (tp.ImageIndex >= 0)) + if (ImageList != null && tp.ImageIndex >= 0) { item = new ToolStripMenuItem(tp.Text, ImageList.Images[tp.ImageIndex], ToolstripItemEvent); } @@ -1846,14 +1846,14 @@ private struct Windowpos [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] protected override void WndProc(ref Message m) { - if (m.Msg == WM_DESTROY || m.Msg == WM_NCDESTROY) + if (m.Msg is WM_DESTROY or WM_NCDESTROY) { ReleaseHandle(); } else if (m.Msg == WM_WINDOWPOSCHANGING) { //Move the updown control off the edge so it's not visible - Windowpos wp = (Windowpos)(m.GetLParam(typeof(Windowpos))); + Windowpos wp = (Windowpos)m.GetLParam(typeof(Windowpos)); wp.x += wp.cx; Marshal.StructureToPtr(wp, m.LParam, true); _bounds = new Rectangle(wp.x, wp.y, wp.cx, wp.cy); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/EmptyTabControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/EmptyTabControl.cs index a25ef89ce..264a27e2d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/EmptyTabControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/EmptyTabControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -80,7 +80,7 @@ public Boolean DrawBorder public EmptyTabControl() { //Design Mode - _designMode = (System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv"); + _designMode = System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv"; Init(); } @@ -90,7 +90,7 @@ public EmptyTabControl(IContainer container) container.Add(this); //Design Mode - _designMode = (System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv"); + _designMode = System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv"; Init(); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/FlatTabControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/FlatTabControl.cs index 1a0d39bcb..a5e3c6eaf 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/FlatTabControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/FlatTabControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -326,7 +326,7 @@ public FlatTabControl() //leftRightImages.ImageSize = new Size(16, 16); // default System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FlatTabControl)); - Bitmap updownImage = ((Bitmap)(resources.GetObject("TabIcons.bmp"))); + Bitmap updownImage = (Bitmap)resources.GetObject("TabIcons.bmp"); if (updownImage != null) { @@ -541,7 +541,7 @@ protected override void OnPaint(PaintEventArgs e) if (_allowCloseButton == true) { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FlatTabControl)); - Bitmap closeImage = ((Bitmap)(resources.GetObject("CloseIcon.bmp"))); + Bitmap closeImage = (Bitmap)resources.GetObject("CloseIcon.bmp"); closeImage.MakeTransparent(Color.White); @@ -651,7 +651,7 @@ internal void DrawControl(Graphics g) } //if top or bottom leave a blank space for Close button or navigator - if ((Alignment == TabAlignment.Top) || (Alignment == TabAlignment.Bottom)) + if (Alignment is TabAlignment.Top or TabAlignment.Bottom) { rreg = new Rectangle(TabArea.Left, TabControlArea.Top, nWidth - nMargin, TabControlArea.Height); } @@ -719,7 +719,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) } - bool bSelected = (SelectedIndex == nIndex); + bool bSelected = SelectedIndex == nIndex; bool bHot = false; if (tabPage.Tag != null) @@ -750,9 +750,9 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) //bool bHotselected = false; - if ((bSelected) && (!bHot)) + if (bSelected && !bHot) { Status = DrawingMethods.TabHeaderStatus.Selected; } - else if ((bSelected) && (bHot)) + else if (bSelected && bHot) { Status = DrawingMethods.TabHeaderStatus.HotSelected; //bHotselected = true; @@ -812,7 +812,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) g.DrawPolygon(new Pen(_borderColour, _borderWidth), pt); //---------------------------- - if (((Status == DrawingMethods.TabHeaderStatus.Selected) || (Status == DrawingMethods.TabHeaderStatus.HotSelected)) && (Appearance == TabAppearance.Normal)) + if (Status is DrawingMethods.TabHeaderStatus.Selected or DrawingMethods.TabHeaderStatus.HotSelected && Appearance == TabAppearance.Normal) { //---------------------------- // clear bottom lines @@ -827,7 +827,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) //---------------------------- // draw tab's icon - if ((tabPage.ImageIndex >= 0) && (ImageList != null) && (ImageList.Images[tabPage.ImageIndex] != null)) + if (tabPage.ImageIndex >= 0 && ImageList != null && ImageList.Images[tabPage.ImageIndex] != null) { int nLeftMargin = 8; int nRightMargin = 2; @@ -840,7 +840,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) float nAdj = (float)(nLeftMargin + img.Width + nRightMargin); // adjust rectangles - if (Alignment == TabAlignment.Top || Alignment == TabAlignment.Bottom) + if (Alignment is TabAlignment.Top or TabAlignment.Bottom) { nAdj = (float)(nLeftMargin + img.Width + nRightMargin); @@ -896,7 +896,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) br = new SolidBrush(SystemColors.GrayText); } - if (Alignment == TabAlignment.Right || Alignment == TabAlignment.Left) + if (Alignment is TabAlignment.Right or TabAlignment.Left) { //not ExtendedLayout if (_useExtendedLayout == false) @@ -936,7 +936,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) internal void DrawIcons(Graphics g) { - if ((leftRightImages == null) || (leftRightImages.Images.Count != 4)) + if (leftRightImages == null || leftRightImages.Images.Count != 4) { return; } @@ -965,7 +965,7 @@ internal void DrawIcons(Graphics g) - int nMiddle = (r0.Width / 2); + int nMiddle = r0.Width / 2; int nTop = (r0.Height - 16) / 2; int nLeft = (nMiddle - 16) / 2; @@ -1002,7 +1002,7 @@ internal void DrawIcons(Graphics g) if (TabCount > 0) { Rectangle r3 = GetTabRect(TabCount - 1); - if (r3.Right > (TabControlArea.Width - r0.Width)) + if (r3.Right > TabControlArea.Width - r0.Width) { g.DrawImage(img, r2); } @@ -1084,7 +1084,7 @@ private void FindUpDown() { bFound = true; // not updown or Handle = 0 or handle = null, recreate one - if ((!bUpDown) || (scUpDown.Handle == IntPtr.Zero) || (scUpDown.Handle == null)) + if (!bUpDown || scUpDown.Handle == IntPtr.Zero || scUpDown.Handle == null) { try { @@ -1115,7 +1115,7 @@ private void FindUpDown() pWnd = WIN32.GetWindow(pWnd, WIN32.GW_HWNDNEXT); } - if ((!bFound) && (bUpDown)) + if (!bFound && bUpDown) { bUpDown = false; } @@ -1133,16 +1133,16 @@ private void UpdateUpDown() //move the rect is allow close in on (TOP) - if ((Alignment == TabAlignment.Top) && (_allowCloseButton)) + if (Alignment == TabAlignment.Top && _allowCloseButton) { WIN32.MoveWindow(scUpDown.Handle, Width - 60, rect.Y + 5, rect.Width, rect.Height, true); } - else if ((Alignment == TabAlignment.Top) && (_allowCloseButton == false)) + else if (Alignment == TabAlignment.Top && _allowCloseButton == false) //if ((this.Alignment == TabAlignment.Top)) { WIN32.MoveWindow(scUpDown.Handle, Width - 41, rect.Y + 5, rect.Width, rect.Height, true); } //move the rect is allow close in on (Bottom) - if ((Alignment == TabAlignment.Bottom) && (_allowCloseButton)) + if (Alignment == TabAlignment.Bottom && _allowCloseButton) { WIN32.MoveWindow(scUpDown.Handle, Width - 60, Height - 24, rect.Width, rect.Height, true); } - else if ((Alignment == TabAlignment.Bottom) && (_allowCloseButton == false)) + else if (Alignment == TabAlignment.Bottom && _allowCloseButton == false) //if ((this.Alignment == TabAlignment.Bottom)) { WIN32.MoveWindow(scUpDown.Handle, Width - 41, Height - 24, rect.Width, rect.Height, true); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonEmptyTabControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonEmptyTabControl.cs index bc049eea6..a2685a42d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonEmptyTabControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonEmptyTabControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -85,7 +85,7 @@ public bool DrawBorder public KryptonEmptyTabControl() { //Design Mode - _designMode = (System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv"); + _designMode = System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv"; Init(); } @@ -95,7 +95,7 @@ public KryptonEmptyTabControl(IContainer container) container.Add(this); //Design Mode - _designMode = (System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv"); + _designMode = System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv"; Init(); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonFlatTabControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonFlatTabControl.cs index 4aea40cb5..e7900cfa0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonFlatTabControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonFlatTabControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -42,7 +42,7 @@ public partial class KryptonFlatTabControl : FlatTabControl /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { - if (disposing && (components != null)) + if (disposing && components != null) { components.Dispose(); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonNavigatorEditor.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonNavigatorEditor.cs index f49d04423..7b0b84c11 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonNavigatorEditor.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonNavigatorEditor.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabControl.cs index 349144f4a..caaf80a37 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -504,7 +504,7 @@ private void InitColours() _paletteBack.GetBackColor2(PaletteState .CheckedTracking); //= _paletteBack.GetBackColor2(PaletteState.Pressed); // Color.FromArgb(255, 224, 192);// - if ((_preserveTabColour == false)) //to avoid black text on black tab + if (_preserveTabColour == false) //to avoid black text on black tab { TabForeColour = _palette.ColorTable.StatusStripText; TabHotForeColour = _palette.ColorTable.MenuItemText; @@ -559,7 +559,7 @@ protected override void OnMouseMove(MouseEventArgs e) Graphics g; for (int i = 0; i < TabCount; i++) { - if ((GetTabRect(i).Contains(e.X, e.Y)) && (TabPages[i].Tag != null)) + if (GetTabRect(i).Contains(e.X, e.Y) && TabPages[i].Tag != null) { if (HotTrack) { @@ -752,7 +752,7 @@ internal void DrawControl(Graphics g) //if top or bottom leave a blank space for Close button or navigator - if ((Alignment == TabAlignment.Top) || (Alignment == TabAlignment.Bottom)) + if (Alignment is TabAlignment.Top or TabAlignment.Bottom) { rreg = new Rectangle(tabArea.Left, tabControlArea.Top, nWidth - N_MARGIN, tabControlArea.Height); } @@ -820,7 +820,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) tabTextArea.Width = 22; } - bool bSelected = (SelectedIndex == nIndex); + bool bSelected = SelectedIndex == nIndex; bool bHot = false; @@ -868,11 +868,11 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) status = DrawingMethods.TabHeaderStatus.Hot; } - if ((bSelected) && (!bHot)) + if (bSelected && !bHot) { status = DrawingMethods.TabHeaderStatus.Selected; } - else if ((bSelected) && (bHot)) + else if (bSelected && bHot) { status = DrawingMethods.TabHeaderStatus.HotSelected; //bHotselected = true; @@ -1128,7 +1128,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) //---------------------------- - if (((status == DrawingMethods.TabHeaderStatus.Selected) || (status == DrawingMethods.TabHeaderStatus.HotSelected)) && (Appearance == TabAppearance.Normal)) + if (status is DrawingMethods.TabHeaderStatus.Selected or DrawingMethods.TabHeaderStatus.HotSelected && Appearance == TabAppearance.Normal) { //---------------------------- // clear bottom lines @@ -1144,7 +1144,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) //---------------------------- // draw tab's icon - if ((tabPage.ImageIndex >= 0) && (ImageList != null) && (ImageList.Images[tabPage.ImageIndex] != null)) + if (tabPage.ImageIndex >= 0 && ImageList != null && ImageList.Images[tabPage.ImageIndex] != null) { int nLeftMargin = 8; int nRightMargin = 2; @@ -1157,9 +1157,9 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) float nAdj; // adjust rectangles - if (Alignment == TabAlignment.Top || Alignment == TabAlignment.Bottom) + if (Alignment is TabAlignment.Top or TabAlignment.Bottom) { - nAdj = (nLeftMargin + img.Width + nRightMargin); + nAdj = nLeftMargin + img.Width + nRightMargin; rimage.Y += (recBounds.Height - img.Height) / 2; tabTextArea.X += nAdj; @@ -1176,7 +1176,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) rimage.Y += 3; - nAdj = (10 + img.Height); + nAdj = 10 + img.Height; tabTextArea.Y += img.Height; tabTextArea.Height -= img.Height; } @@ -1214,7 +1214,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) } - if (Alignment == TabAlignment.Right || Alignment == TabAlignment.Left) + if (Alignment is TabAlignment.Right or TabAlignment.Left) { //not ExtendedLayout if (_useExtendedLayout == false) @@ -1255,7 +1255,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) internal void DrawIcons(Graphics g) { - if ((_leftRightImages == null) || (_leftRightImages.Images.Count != 4)) + if (_leftRightImages == null || _leftRightImages.Images.Count != 4) { return; } @@ -1285,7 +1285,7 @@ internal void DrawIcons(Graphics g) border.Dispose(); - int nMiddle = (r0.Width / 2); + int nMiddle = r0.Width / 2; int nTop = (r0.Height - 16) / 2; int nLeft = (nMiddle - 16) / 2; @@ -1322,7 +1322,7 @@ internal void DrawIcons(Graphics g) if (TabCount > 0) { Rectangle r3 = GetTabRect(TabCount - 1); - if (r3.Right > (tabControlArea.Width - r0.Width)) + if (r3.Right > tabControlArea.Width - r0.Width) { g.DrawImage(img, r2); } @@ -1499,7 +1499,7 @@ private bool IsFirstTabHidden() { firstPagePosition = GetTabRect(0).Left; //not visible? - if ((firstPagePosition < 0)) + if (firstPagePosition < 0) { display = true; } @@ -1519,7 +1519,7 @@ private bool IsLastTabHidden() if (TabCount > 0) { //visible? - if ((GetTabRect(TabCount - 1).Right > _scroller.Left)) + if (GetTabRect(TabCount - 1).Right > _scroller.Left) { display = true; } @@ -1557,7 +1557,7 @@ protected override void OnPaintBackground(PaintEventArgs pevent) } //test on tab pages - if ((IsLastTabHidden() == false) && (IsFirstTabHidden() == false)) + if (IsLastTabHidden() == false && IsFirstTabHidden() == false) { _allowInternalNavigatorButtons = false; } @@ -1771,7 +1771,7 @@ private void Scroller_ContextMenuButton(Object sender, EventArgs e) { //TabPage tp = (TabPage)e.Control; ToolStripMenuItem item; - if ((ImageList != null) && (tp.ImageIndex >= 0)) + if (ImageList != null && tp.ImageIndex >= 0) { item = new ToolStripMenuItem(tp.Text, ImageList.Images[tp.ImageIndex], ToolstripItemEvent); } @@ -1997,17 +1997,17 @@ private struct Windowpos public int x, y, cx, cy, flags; } - [PermissionSetAttribute(SecurityAction.Demand, Name = "FullTrust")] + [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] protected override void WndProc(ref Message m) { - if (m.Msg == WM_DESTROY || m.Msg == WM_NCDESTROY) + if (m.Msg is WM_DESTROY or WM_NCDESTROY) { ReleaseHandle(); } else if (m.Msg == WM_WINDOWPOSCHANGING) { //Move the updown control off the edge so it's not visible - Windowpos wp = (Windowpos)(m.GetLParam(typeof(Windowpos))); + Windowpos wp = (Windowpos)m.GetLParam(typeof(Windowpos)); wp.x += wp.cx; Marshal.StructureToPtr(wp, m.LParam, true); _bounds = new Rectangle(wp.x, wp.y, wp.cx, wp.cy); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabControlAlternative.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabControlAlternative.cs index 32112076c..c18722d41 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabControlAlternative.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabControlAlternative.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -214,7 +214,7 @@ protected override void OnPaintBackground(PaintEventArgs pevent) private void PaintTab(int index, RenderContext renderContext) { - bool Selected = (SelectedIndex == index); + bool Selected = SelectedIndex == index; Rectangle tabRect = GetTabRect(index); @@ -278,7 +278,7 @@ private void PaintTab(int index, RenderContext renderContext) if (tabImage != null) { - int x = tabRect.X + (tabImage.Width / 2); + int x = tabRect.X + tabImage.Width / 2; int y = tabRect.Y + (tabRect.Height - tabImage.Height) / 2; renderContext.Graphics.DrawImage(tabImage, x, y); @@ -290,7 +290,7 @@ private void PaintTab(int index, RenderContext renderContext) } - if (m_TabFont == null || (!object.ReferenceEquals(m_TabFont, g_TabFontBold) & !object.ReferenceEquals(m_TabFont, g_TabFontRegular))) + if (m_TabFont == null || !object.ReferenceEquals(m_TabFont, g_TabFontBold) & !object.ReferenceEquals(m_TabFont, g_TabFontRegular)) { if (renderContext.Graphics.MeasureString(TabPages[index].Text, g_TabFontBold, tabRect.X, g_StringFormat).Width <= tabRect.Width) { @@ -379,7 +379,7 @@ private ISelectionService SelectionService { if (m_SelectionService == null) { - m_SelectionService = (ISelectionService)(this.GetService(typeof(ISelectionService))); + m_SelectionService = (ISelectionService)this.GetService(typeof(ISelectionService)); } return m_SelectionService; @@ -517,7 +517,7 @@ public void RemoveTab() public void ToggleDockStyle() { - Boolean docked = (this.KryptonTabControl.Dock == DockStyle.Fill); + Boolean docked = this.KryptonTabControl.Dock == DockStyle.Fill; SetProperty("Dock", docked ? DockStyle.None : DockStyle.Fill); } @@ -577,7 +577,7 @@ private ISelectionService SelectionService { if (m_SelectionService == null) { - m_SelectionService = (ISelectionService)(this.GetService(typeof(ISelectionService))); + m_SelectionService = (ISelectionService)this.GetService(typeof(ISelectionService)); } return m_SelectionService; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabControlLite.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabControlLite.cs index 4bddbec18..e8c45edcf 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabControlLite.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabControlLite.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -173,7 +173,7 @@ protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs pe private void PaintTab(int index, RenderContext RenderContext) { - bool Selected = (SelectedIndex == index); + bool Selected = SelectedIndex == index; Rectangle TabRect = GetTabRect(index); //If Selected Then TabRect.Inflate(0, 2) @@ -237,7 +237,7 @@ private void PaintTab(int index, RenderContext RenderContext) if (tabImage != null) { - int x = TabRect.X + (tabImage.Width / 2); + int x = TabRect.X + tabImage.Width / 2; int y = TabRect.Y + (TabRect.Height - tabImage.Height) / 2; RenderContext.Graphics.DrawImage(tabImage, x, y); @@ -249,7 +249,7 @@ private void PaintTab(int index, RenderContext RenderContext) } - if (TabFont == null || (!object.ReferenceEquals(TabFont, TabFontBold) & !object.ReferenceEquals(TabFont, TabFontRegular))) + if (TabFont == null || !object.ReferenceEquals(TabFont, TabFontBold) & !object.ReferenceEquals(TabFont, TabFontRegular)) { if (RenderContext.Graphics.MeasureString(TabPages[index].Text, TabFontBold, TabRect.X, SF).Width <= TabRect.Width) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabPage.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabPage.cs index f88d146df..e82e47a87 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabPage.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabPage.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -161,7 +161,7 @@ private ISelectionService SelectionService { if (m_SelectionService == null) { - m_SelectionService = (ISelectionService)(this.GetService(typeof(ISelectionService))); + m_SelectionService = (ISelectionService)this.GetService(typeof(ISelectionService)); } return m_SelectionService; @@ -231,7 +231,7 @@ private ISelectionService SelectionService { if (m_SelectionService == null) { - m_SelectionService = (ISelectionService)(this.GetService(typeof(ISelectionService))); + m_SelectionService = (ISelectionService)this.GetService(typeof(ISelectionService)); } return m_SelectionService; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/OutlookBar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/OutlookBar.cs index 054dad26b..70a7d6ff5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/OutlookBar.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/OutlookBar.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -323,7 +323,7 @@ private void OutlookBar_MouseClick(object sender, MouseEventArgs e) { _RightClickedButton = null; OutlookBarButton? mButton = Buttons[e.X, e.Y]; - if ((mButton != null)) + if (mButton != null) { switch (e.Button) { @@ -408,7 +408,7 @@ private void OutlookBar_MouseMove(object sender, MouseEventArgs e) Invalidate(); // //adjust Tooltip... - if ((oToolTip.Tag != null)) + if (oToolTip.Tag != null) { if (!oToolTip.Tag.Equals("Configure")) { @@ -425,7 +425,7 @@ private void OutlookBar_MouseMove(object sender, MouseEventArgs e) } //EmptyLineVar = null; } - else if ((Buttons[e.X, e.Y] != null)) + else if (Buttons[e.X, e.Y] != null) { Cursor = Cursors.Hand; _HoveringButton = Buttons[e.X, e.Y]; @@ -478,16 +478,16 @@ private void OutlookBar_MouseUp(object sender, MouseEventArgs e) internal void OutlookBar_Paint(object sender, PaintEventArgs e) { //string EmptyLineVar = null; - _maxLargeButtonCount = (int)Math.Round(Math.Floor(((Height - GetBottomContainerRectangle().Height) - GetGripRectangle().Height) / ((double)GetButtonHeight()))); + _maxLargeButtonCount = (int)Math.Round(Math.Floor((Height - GetBottomContainerRectangle().Height - GetGripRectangle().Height) / (double)GetButtonHeight())); if (Buttons.CountVisible() < _maxLargeButtonCount) { _maxLargeButtonCount = Buttons.CountVisible(); } - CanShrink = (_maxLargeButtonCount != 0); - CanGrow = (_maxLargeButtonCount < Buttons.CountVisible()); + CanShrink = _maxLargeButtonCount != 0; + CanGrow = _maxLargeButtonCount < Buttons.CountVisible(); - Height = (_maxLargeButtonCount * GetButtonHeight()) + GetGripRectangle().Height + GetBottomContainerRectangle().Height; + Height = _maxLargeButtonCount * GetButtonHeight() + GetGripRectangle().Height + GetBottomContainerRectangle().Height; //Paint Grip... PaintGripRectangle(e.Graphics); @@ -499,10 +499,10 @@ internal void OutlookBar_Paint(object sender, PaintEventArgs e) { if (Buttons[iterateLargeButtons].Visible) { - Rectangle rec = new Rectangle(0, (syncLargeButtons * GetButtonHeight()) + GetGripRectangle().Height, Width, GetButtonHeight()); + Rectangle rec = new Rectangle(0, syncLargeButtons * GetButtonHeight() + GetGripRectangle().Height, Width, GetButtonHeight()); Buttons[iterateLargeButtons].Rectangle = rec; Buttons[iterateLargeButtons].IsLarge = true; - PaintButton(Buttons[iterateLargeButtons], e.Graphics, (_maxLargeButtonCount != syncLargeButtons)); + PaintButton(Buttons[iterateLargeButtons], e.Graphics, _maxLargeButtonCount != syncLargeButtons); if (syncLargeButtons == _maxLargeButtonCount) { break; // TODO: might not be correct. Was : Exit For @@ -512,20 +512,20 @@ internal void OutlookBar_Paint(object sender, PaintEventArgs e) } } //Paint Small Buttons... - _maxSmallButtonCount = (int)Math.Round(Math.Floor(((Width - GetDropDownRectangle().Width) - GetBottomContainerLeftMargin()) / ((double)GetSmallButtonWidth()))); + _maxSmallButtonCount = (int)Math.Round(Math.Floor((Width - GetDropDownRectangle().Width - GetBottomContainerLeftMargin()) / (double)GetSmallButtonWidth())); - if ((Buttons.CountVisible() - _maxLargeButtonCount) <= 0) + if (Buttons.CountVisible() - _maxLargeButtonCount <= 0) { _maxSmallButtonCount = 0; } - if (_maxSmallButtonCount >= (Buttons.CountVisible() - _maxLargeButtonCount)) + if (_maxSmallButtonCount >= Buttons.CountVisible() - _maxLargeButtonCount) { - _maxSmallButtonCount = (Buttons.CountVisible() - _maxLargeButtonCount); + _maxSmallButtonCount = Buttons.CountVisible() - _maxLargeButtonCount; } - int startX = Width - GetDropDownRectangle().Width - (_maxSmallButtonCount * GetSmallButtonWidth()); + int startX = Width - GetDropDownRectangle().Width - _maxSmallButtonCount * GetSmallButtonWidth(); int syncSmallButtons = 0; int iterateSmallButtons = 0; @@ -539,7 +539,7 @@ internal void OutlookBar_Paint(object sender, PaintEventArgs e) if (Buttons[iterateSmallButtons].Visible) { - Rectangle rec = new Rectangle(startX + (syncSmallButtons * GetSmallButtonWidth()), GetBottomContainerRectangle().Y, GetSmallButtonWidth(), GetBottomContainerRectangle().Height); + Rectangle rec = new Rectangle(startX + syncSmallButtons * GetSmallButtonWidth(), GetBottomContainerRectangle().Y, GetSmallButtonWidth(), GetBottomContainerRectangle().Height); Buttons[iterateSmallButtons].Rectangle = rec; Buttons[iterateSmallButtons].IsLarge = false; //OutlookBarButton refBtn = Buttons[IterateLargeButtons]; @@ -556,10 +556,10 @@ internal void OutlookBar_Paint(object sender, PaintEventArgs e) //Draw Empty Space... Rectangle recEmptySpace = GetBottomContainerRectangle(); { - recEmptySpace.Width = Width - (_maxSmallButtonCount * GetSmallButtonWidth()) - GetDropDownRectangle().Width; + recEmptySpace.Width = Width - _maxSmallButtonCount * GetSmallButtonWidth() - GetDropDownRectangle().Width; } - FillButton(recEmptySpace, e.Graphics, ButtonState.Passive, true, true, (isDebugMode)); + FillButton(recEmptySpace, e.Graphics, ButtonState.Passive, true, true, isDebugMode); //Paint DropDown... PaintDropDownRectangle(e.Graphics); @@ -605,7 +605,7 @@ private void PaintButton(OutlookBarButton button, Graphics graphics, bool isLast { graphics.DrawString(button.Text, GetButtonFont(), GetButtonTextBrush(button.Equals(SelectedButton)), 10 + ImageDimension_Large + 8, - (float)button.Rectangle.Y + ((GetButtonHeight() / 2) - (GetButtonFont().Height / 2)) + 2); + (float)button.Rectangle.Y + (GetButtonHeight() / 2 - GetButtonFont().Height / 2) + 2); } Rectangle recIma = new Rectangle(); switch (button.IsLarge) @@ -661,14 +661,14 @@ private void FillButton(Rectangle rectangle, Graphics graphics, ButtonState butt //Filling the top part of the button... Rectangle topRectangle = rectangle; Brush topBrush = new LinearGradientBrush(topRectangle, GetButtonColor(buttonState, 0), GetButtonColor(buttonState, 1), LinearGradientMode.Vertical); - topRectangle.Height = (GetButtonHeight() * 15) / 32; + topRectangle.Height = GetButtonHeight() * 15 / 32; graphics.FillRectangle(topBrush, topRectangle); topBrush.Dispose(); //and the bottom part... Rectangle bottomRectangle = rectangle; Brush bottomBrush = new LinearGradientBrush(bottomRectangle, GetButtonColor(buttonState, 2), GetButtonColor(buttonState, 3), LinearGradientMode.Vertical); - bottomRectangle.Y += (GetButtonHeight() * 12) / 32; - bottomRectangle.Height -= (GetButtonHeight() * 12) / 32; + bottomRectangle.Y += GetButtonHeight() * 12 / 32; + bottomRectangle.Height -= GetButtonHeight() * 12 / 32; graphics.FillRectangle(bottomBrush, bottomRectangle); bottomBrush.Dispose(); break; @@ -767,7 +767,7 @@ private void PaintGripRectangle(Graphics graphics) //Draw the icon... Icon? oIcon = GetGripIcon(); - Rectangle rectangleIcon = new Rectangle(Width / 2 - (oIcon.Width / 2), ((GetGripRectangle().Height / 2) - oIcon.Height / 2) + 1, oIcon.Width, oIcon.Height); + Rectangle rectangleIcon = new Rectangle(Width / 2 - oIcon.Width / 2, GetGripRectangle().Height / 2 - oIcon.Height / 2 + 1, oIcon.Width, oIcon.Height); if (Renderer != Renderer.Krypton) { @@ -844,7 +844,7 @@ private void PaintDropDownRectangle(Graphics graphics) //Draw the icon... Icon oIcon = GetDropDownIcon(); - Rectangle rectangleIcon = new Rectangle((GetDropDownRectangle().X + ((GetDropDownRectangle().Width / 2) - (oIcon.Width / 2))), (GetDropDownRectangle().Y + (((GetDropDownRectangle().Height / 2) - (oIcon.Height / 2)) + 1)), oIcon.Width, oIcon.Height); + Rectangle rectangleIcon = new Rectangle(GetDropDownRectangle().X + (GetDropDownRectangle().Width / 2 - oIcon.Width / 2), GetDropDownRectangle().Y + (GetDropDownRectangle().Height / 2 - oIcon.Height / 2) + 1, oIcon.Width, oIcon.Height); if (Renderer != Renderer.Krypton) { //draw icon from file @@ -1331,7 +1331,7 @@ private Color GetGripTopColor() private Rectangle GetDropDownRectangle() { - return new Rectangle((Width - GetSmallButtonWidth()), (Height - GetButtonHeight()), GetSmallButtonWidth(), GetButtonHeight()); + return new Rectangle(Width - GetSmallButtonWidth(), Height - GetButtonHeight(), GetSmallButtonWidth(), GetButtonHeight()); } private Icon? GetDropDownIcon() { @@ -1415,7 +1415,7 @@ private void CreateContextMenu() mnu.Image = oButton.Image.ToBitmap(); mnu.Tag = oButton; mnu.CheckOnClick = true; - if ((SelectedButton != null)) + if (SelectedButton != null) { if (SelectedButton.Equals(oButton)) { @@ -1428,7 +1428,7 @@ private void CreateContextMenu() } } } - oContextMenuStrip.Show(this, new Point(Width, Height - (GetButtonHeight() / 2))); + oContextMenuStrip.Show(this, new Point(Width, Height - GetButtonHeight() / 2)); } private void ShowMoreButtons(object sender, EventArgs e) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/SystemTabControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/SystemTabControl.cs index a1d0ecfe7..1addd2718 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/SystemTabControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/SystemTabControl.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -341,7 +341,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) { Rectangle recBounds = this.GetTabRect(nIndex); RectangleF tabTextArea = (RectangleF)this.GetTabRect(nIndex); - bool bSelected = (this.SelectedIndex == nIndex); + bool bSelected = this.SelectedIndex == nIndex; bool bHot = false; VisualStyleRenderer render = new VisualStyleRenderer(VisualStyleElement.Tab.Pane.Normal); @@ -353,7 +353,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) } //Align? - if (Alignment == TabAlignment.Top || Alignment == TabAlignment.Bottom) + if (Alignment is TabAlignment.Top or TabAlignment.Bottom) { recBounds.Offset(2, 0); recBounds.Width = recBounds.Width + 1; @@ -391,7 +391,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) //highter if selected and no multiline if (this.Multiline != true) { - if (Alignment == TabAlignment.Top || Alignment == TabAlignment.Bottom) + if (Alignment is TabAlignment.Top or TabAlignment.Bottom) { recBounds.Height = recBounds.Height + 2; recBounds.Width = recBounds.Width - 1; @@ -399,7 +399,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) } else //lower profile { - if (Alignment == TabAlignment.Top || Alignment == TabAlignment.Bottom) + if (Alignment is TabAlignment.Top or TabAlignment.Bottom) { recBounds.Y = recBounds.Y + 1; recBounds.Height = recBounds.Height + 1; @@ -419,7 +419,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) //highter if selected and no multiline if (this.Multiline != true) { - if (Alignment == TabAlignment.Top || Alignment == TabAlignment.Bottom) + if (Alignment is TabAlignment.Top or TabAlignment.Bottom) { recBounds.Height = recBounds.Height + 2; recBounds.Width = recBounds.Width - 1; @@ -427,7 +427,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) } else//lower if selected and multiline { - if (Alignment == TabAlignment.Top || Alignment == TabAlignment.Bottom) + if (Alignment is TabAlignment.Top or TabAlignment.Bottom) { recBounds.Y = recBounds.Y + 1; recBounds.Height = recBounds.Height + 1; @@ -439,7 +439,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) //tab Hot and not selected else { - if (Alignment == TabAlignment.Top || Alignment == TabAlignment.Bottom) + if (Alignment is TabAlignment.Top or TabAlignment.Bottom) { //smaller if not selected, text lower recBounds.Y = recBounds.Y + 3; @@ -457,7 +457,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) else { //smaller if not selected, text lower - if (Alignment == TabAlignment.Top || Alignment == TabAlignment.Bottom) + if (Alignment is TabAlignment.Top or TabAlignment.Bottom) { recBounds.Y = recBounds.Y + 3; recBounds.Height = recBounds.Height - 2; @@ -476,7 +476,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) //image management - if ((tabPage.ImageIndex >= 0) && ((ImageList != null)) && ((ImageList.Images[tabPage.ImageIndex] != null))) + if (tabPage.ImageIndex >= 0 && ImageList != null && ImageList.Images[tabPage.ImageIndex] != null) { int nLeftMargin = 8; int nRightMargin = 1; @@ -568,7 +568,7 @@ internal void DrawTab(Graphics g, TabPage tabPage, int nIndex) //Vertical Orientation - if ((this.Alignment == TabAlignment.Left) || (this.Alignment == TabAlignment.Right)) + if (this.Alignment is TabAlignment.Left or TabAlignment.Right) { //not ExtendedLayout if (_useExtendedLayout == false) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Globals/GlobalDeclarations.cs index 07f92481e..f1b713178 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Krypton.Toolkit.Suite.Extended.Navigator 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Krypton.Toolkit.Suite.Extended.Navigator 2022.csproj index 5d2fbfd1d..934b5881d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Krypton.Toolkit.Suite.Extended.Navigator 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Krypton.Toolkit.Suite.Extended.Navigator 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - + - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements additional KryptonNavigator designs and features. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements additional KryptonNavigator designs and features. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -87,9 +75,9 @@ - + - + @@ -99,9 +87,9 @@ - + - + @@ -111,9 +99,9 @@ - + - + @@ -123,9 +111,9 @@ - + - + @@ -160,9 +148,9 @@ - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Krypton.Toolkit.Suite.Extended.Navigator.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Krypton.Toolkit.Suite.Extended.Navigator.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Krypton.Toolkit.Suite.Extended.Navigator.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Krypton.Toolkit.Suite.Extended.Navigator.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/UX/OutlookBarNavigationPaneOptions.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/UX/OutlookBarNavigationPaneOptions.Designer.cs index 0d1807536..721808561 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/UX/OutlookBarNavigationPaneOptions.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/UX/OutlookBarNavigationPaneOptions.Designer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/UX/OutlookBarNavigationPaneOptions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/UX/OutlookBarNavigationPaneOptions.cs index e535e2333..09b79c2ae 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/UX/OutlookBarNavigationPaneOptions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/UX/OutlookBarNavigationPaneOptions.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/General/ComputerEnum.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/General/ComputerEnum.cs index c8e64b41a..427fb1604 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/General/ComputerEnum.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/General/ComputerEnum.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,7 +31,7 @@ public class ComputerEnum : IEnumerable, IDisposable { #region "Server type enumeration" // Possible types of servers - [FlagsAttribute] + [Flags] public enum ServerType : uint { /// @@ -155,7 +155,7 @@ public enum ServerType : uint #endregion // Holds computer information - [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] internal struct SERVER_INFO_101 { public int sv101_platform_id; @@ -376,7 +376,7 @@ public bool MoveNext() indexer++; } - return (!(indexer == aryComputers.Length)); + return !(indexer == aryComputers.Length); } } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/General/NetworkDrives.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/General/NetworkDrives.cs index dad9b1f7b..82165f83f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/General/NetworkDrives.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/General/NetworkDrives.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/General/NetworkNodeBrowser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/General/NetworkNodeBrowser.cs index f77c31f61..92921e62f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/General/NetworkNodeBrowser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/General/NetworkNodeBrowser.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -129,7 +129,7 @@ public NetworkNodeBrowser() /// /// Arraylist that represents all the SV_TYPE_WORKSTATION and SV_TYPE_SERVER /// PC's in the Domain - public ArrayList GetNetworkComputers() + public ArrayList? GetNetworkComputers() { //local fields ArrayList networkComputers = new ArrayList(); @@ -162,7 +162,7 @@ public ArrayList GetNetworkComputers() //get pointer to, Pointer to the buffer that received the data from //the call to NetServerEnum. Must ensure to use correct size of //STRUCTURE to ensure correct location in memory is pointed to - tmpBuffer = new IntPtr((int)buffer + (i * sizeofINFO)); + tmpBuffer = new IntPtr((int)buffer + i * sizeofINFO); //Have now got a pointer to the list of SV_TYPE_WORKSTATION and //SV_TYPE_SERVER PC's, which is unmanaged memory //Needs to Marshal data from an unmanaged block of memory to a @@ -178,9 +178,7 @@ public ArrayList GetNetworkComputers() } catch (Exception ex) { - ExceptionCapture.CaptureException($"Problem with accessing network computers in NetworkBrowser\r\n\r\n\r\n{ex.Message}", - "Error", KryptonMessageBoxButtons.OK, - KryptonMessageBoxIcon.Error); + DebugUtilities.NotImplemented(ex.ToString()); return null; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/General/NetworkUtilities.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/General/NetworkUtilities.cs index a38cf225d..7a878efa8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/General/NetworkUtilities.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/General/NetworkUtilities.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -40,7 +40,7 @@ public char[] GetAvailableDriveLetters() for (int i = 0; i < drives.Length; i++) { - availableDriveLetters.Remove((drives[i].Name).ToLower()[0]); + availableDriveLetters.Remove(drives[i].Name.ToLower()[0]); } return availableDriveLetters.ToArray(); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/ConnectionDetails.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/ConnectionDetails.cs index d0727118e..7f5d97f3a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/ConnectionDetails.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/ConnectionDetails.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/Info.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/Info.cs index fa610543f..d24b27916 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/Info.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/Info.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/NetStat.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/NetStat.cs index 22751a2e7..ef1339ad8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/NetStat.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/NetStat.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/PingDetails.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/PingDetails.cs index 4fcdcb6a6..822c3a4b3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/PingDetails.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/PingDetails.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/Pinger.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/Pinger.cs index 8c68f0f9e..ff6a245b0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/Pinger.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/Pinger.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -139,7 +139,7 @@ void _worker_DoWork(object sender, DoWorkEventArgs e) { try { - PingReply reply = pingSender.Send(host, timeout, buffer, options); + PingReply? reply = pingSender.Send(host, timeout, buffer, options); if (reply.Status == IPStatus.Success) { @@ -154,7 +154,7 @@ void _worker_DoWork(object sender, DoWorkEventArgs e) } catch (Exception ex) { - ExceptionCapture.CaptureException(ex); + DebugUtilities.NotImplemented(ex.ToString()); break; } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/PortScan.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/PortScan.cs index 981286e77..182e0d99b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/PortScan.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/PortScan.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -137,7 +137,7 @@ void btnScan_Click(object sender, EventArgs e) if (_txtStartPort.Text == string.Empty || _txtStopPort.Text == string.Empty) { - MessageBox.Show("Please enter a start port and a stop port"); + KryptonMessageBox.Show("Please enter a start port and a stop port"); } else { @@ -199,7 +199,7 @@ void _worker_DoWork(object sender, DoWorkEventArgs e) { PortState state = new PortState(); int diff = stop - start; - decimal progress = ((decimal)x / (decimal)diff) * (decimal)100; + decimal progress = (decimal)x / (decimal)diff * (decimal)100; try { TcpClient client = new TcpClient(_txtHost.Text, i); @@ -207,7 +207,7 @@ void _worker_DoWork(object sender, DoWorkEventArgs e) } catch (Exception ex) { - ExceptionCapture.CaptureException(ex); + DebugUtilities.NotImplemented(ex.ToString()); } state.Port = i; _worker.ReportProgress((int)progress, state); @@ -217,7 +217,7 @@ void _worker_DoWork(object sender, DoWorkEventArgs e) } catch (Exception ee) { - ExceptionCapture.CaptureException(ee); + DebugUtilities.NotImplemented(ee.ToString()); } } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/PortState.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/PortState.cs index eb658b371..4767e8aec 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/PortState.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/PortState.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Globals/GlobalDeclarations.cs index 52cc80dd5..4ee31ab79 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -44,7 +44,7 @@ global using Krypton.Toolkit.Suite.Extended.Common; -global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; +global using Krypton.Toolkit.Suite.Extended.Debug.Tools; global using Krypton.Toolkit.Suite.Extended.Shared; global using Microsoft.WindowsAPICodePack.Dialogs; \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Krypton.Toolkit.Suite.Extended.Networking 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Krypton.Toolkit.Suite.Extended.Networking 2022.csproj index 3fa61cdeb..6418bf920 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Krypton.Toolkit.Suite.Extended.Networking 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Krypton.Toolkit.Suite.Extended.Networking 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements networking features. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements networking features. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,84 +69,47 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + - + + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Krypton.Toolkit.Suite.Extended.Networking.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Krypton.Toolkit.Suite.Extended.Networking.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Krypton.Toolkit.Suite.Extended.Networking.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Krypton.Toolkit.Suite.Extended.Networking.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Network Drives/KryptonNetworkDriveOptions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Network Drives/KryptonNetworkDriveOptions.cs index 52f3a03d5..afbac2a16 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Network Drives/KryptonNetworkDriveOptions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Network Drives/KryptonNetworkDriveOptions.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Network Scanner/KryptonNetworkScanner.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Network Scanner/KryptonNetworkScanner.Designer.cs index b855ebf0c..13e7c8271 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Network Scanner/KryptonNetworkScanner.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Network Scanner/KryptonNetworkScanner.Designer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Network Scanner/KryptonNetworkScanner.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Network Scanner/KryptonNetworkScanner.cs index e5996ddc9..f2c0dded6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Network Scanner/KryptonNetworkScanner.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Network Scanner/KryptonNetworkScanner.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -106,7 +106,7 @@ private void kbtnScan_Click(object sender, EventArgs e) }//try/catch catch (Exception ex) { - ExceptionCapture.CaptureException(ex); + DebugUtilities.NotImplemented(ex.ToString()); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Network Utility/KryptonNetworkUtility.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Network Utility/KryptonNetworkUtility.cs index d55960ce9..1cd790269 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Network Utility/KryptonNetworkUtility.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Network Utility/KryptonNetworkUtility.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Node Selector/KryptonNetworkNodePicker.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Node Selector/KryptonNetworkNodePicker.cs index c830bc303..724fe0658 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Node Selector/KryptonNetworkNodePicker.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Node Selector/KryptonNetworkNodePicker.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -204,7 +204,7 @@ private void klstServers_SelectedIndexChanged(object sender, EventArgs e) klstServers.SelectedIndex = 0; } - ExceptionCapture.CaptureException(nre); + DebugUtilities.NotImplemented(nre.ToString()); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Node Viewer/KryptonNodeViewer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Node Viewer/KryptonNodeViewer.cs index 7abe8639a..6628356df 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Node Viewer/KryptonNodeViewer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/UX/Node Viewer/KryptonNodeViewer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -59,7 +59,7 @@ private void NodeViewer_Load(object sender, EventArgs e) //entry to the combo box on this form try { - NetworkNodeBrowser nb = new(); + NetworkNodeBrowser nb = new NetworkNodeBrowser(); foreach (string pc in nb.GetNetworkComputers()) { @@ -68,8 +68,7 @@ private void NodeViewer_Load(object sender, EventArgs e) } catch (Exception ex) { - ExceptionCapture.CaptureException($"An error occurred trying to access the network computers.\n\n\n{ex.Message}", "Error", - KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon.Error); + DebugUtilities.NotImplemented(ex.ToString()); } } @@ -168,7 +167,7 @@ private void kbtnExportNodeList_Click(object sender, EventArgs e) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Alternative/Alert.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Alternative/Alert.cs index e07f0441a..5939f4014 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Alternative/Alert.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Alternative/Alert.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Internal/IconExtractor.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Internal/IconExtractor.cs index 5217a628e..0e3c6e533 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Internal/IconExtractor.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Internal/IconExtractor.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Internal/NativeMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Internal/NativeMethods.cs index 83df02440..ff351a378 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Internal/NativeMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Internal/NativeMethods.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Internal/NotificationUtilityMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Internal/NotificationUtilityMethods.cs index dbffb1dcf..64e4883b0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Internal/NotificationUtilityMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Internal/NotificationUtilityMethods.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Components/PopUp/KryptonToastNotificationPopup.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Components/PopUp/KryptonToastNotificationPopup.cs index 1c1d1b329..39d0808e7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Components/PopUp/KryptonToastNotificationPopup.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Components/PopUp/KryptonToastNotificationPopup.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -180,7 +180,7 @@ public void ResetImageSize() private bool ShouldSerializeImageSize() { - return (!_imageSize.Equals(Size.Empty)); + return !_imageSize.Equals(Size.Empty); } private Size _imageSize = new Size(0, 0); @@ -216,7 +216,7 @@ private void ResetTitlePadding() private bool ShouldSerializeTitlePadding() { - return (!TitlePadding.Equals(Padding.Empty)); + return !TitlePadding.Equals(Padding.Empty); } [Category("Content")] @@ -230,7 +230,7 @@ private void ResetContentPadding() private bool ShouldSerializeContentPadding() { - return (!ContentPadding.Equals(Padding.Empty)); + return !ContentPadding.Equals(Padding.Empty); } [Category("Image")] @@ -244,7 +244,7 @@ private void ResetImagePadding() private bool ShouldSerializeImagePadding() { - return (!ImagePadding.Equals(Padding.Empty)); + return !ImagePadding.Equals(Padding.Empty); } [Category("Header"), DefaultValue(9)] @@ -366,7 +366,7 @@ public void PopUp() _realAnimationDuration = AnimationDuration; _tmrAnimation.Start(); _sw = Stopwatch.StartNew(); - Debug.WriteLine("Animation started."); + DebugUtilities.WriteLine("Animation started."); } else { @@ -388,7 +388,7 @@ public void PopUp() _isAppearing = true; _realAnimationDuration = Math.Max((int)_sw.ElapsedMilliseconds, 1); _sw.Restart(); - Debug.WriteLine("Animation direction changed."); + DebugUtilities.WriteLine("Animation direction changed."); } _frmPopup.Invalidate(); } @@ -400,8 +400,8 @@ public void PopUp() ///
public void Hide() { - Debug.WriteLine("Animation stopped."); - Debug.WriteLine("Wait timer stopped."); + DebugUtilities.WriteLine("Animation stopped."); + DebugUtilities.WriteLine("Wait timer stopped."); _tmrAnimation.Stop(); _tmrWait.Stop(); _frmPopup.Hide(); @@ -421,12 +421,12 @@ public void Hide() /// private void frmPopup_ContextMenuClosed(object sender, EventArgs e) { - Debug.WriteLine("Menu closed."); + DebugUtilities.WriteLine("Menu closed."); if (!_mouseIsOn) { _tmrWait.Interval = Delay; _tmrWait.Start(); - Debug.WriteLine("Wait timer started."); + DebugUtilities.WriteLine("Wait timer started."); } } @@ -439,9 +439,9 @@ private void frmPopup_ContextMenuClosed(object sender, EventArgs e) /// private void frmPopup_ContextMenuOpened(object sender, EventArgs e) { - Debug.WriteLine("Menu opened."); + DebugUtilities.WriteLine("Menu opened."); _tmrWait.Stop(); - Debug.WriteLine("Wait timer stopped."); + DebugUtilities.WriteLine("Wait timer stopped."); } /// @@ -504,16 +504,16 @@ private void tmAnimation_Tick(object sender, EventArgs e) { long elapsed = _sw.ElapsedMilliseconds; - int posCurrent = (int)(_posStart + ((_posStop - _posStart) * elapsed / _realAnimationDuration)); - bool neg = (_posStop - _posStart) < 0; + int posCurrent = (int)(_posStart + (_posStop - _posStart) * elapsed / _realAnimationDuration); + bool neg = _posStop - _posStart < 0; if ((neg && posCurrent < _posStop) || (!neg && posCurrent > _posStop)) { posCurrent = _posStop; } - double opacityCurrent = _opacityStart + ((_opacityStop - _opacityStart) * elapsed / _realAnimationDuration); - neg = (_opacityStop - _opacityStart) < 0; + double opacityCurrent = _opacityStart + (_opacityStop - _opacityStart) * elapsed / _realAnimationDuration; + neg = _opacityStop - _opacityStart < 0; if ((neg && opacityCurrent < _opacityStop) || (!neg && opacityCurrent > _opacityStop)) { @@ -529,7 +529,7 @@ private void tmAnimation_Tick(object sender, EventArgs e) _sw.Reset(); _tmrAnimation.Stop(); - Debug.WriteLine("Animation stopped."); + DebugUtilities.WriteLine("Animation stopped."); if (_isAppearing) { @@ -555,7 +555,7 @@ private void tmAnimation_Tick(object sender, EventArgs e) { _tmrWait.Stop(); _tmrWait.Start(); - Debug.WriteLine("Wait timer started."); + DebugUtilities.WriteLine("Wait timer started."); } } else @@ -576,12 +576,12 @@ private void tmAnimation_Tick(object sender, EventArgs e) /// private void tmWait_Tick(object sender, EventArgs e) { - Debug.WriteLine("Wait timer elapsed."); + DebugUtilities.WriteLine("Wait timer elapsed."); _tmrWait.Stop(); _tmrAnimation.Interval = AnimationInterval; _tmrAnimation.Start(); _sw.Restart(); - Debug.WriteLine("Animation started."); + DebugUtilities.WriteLine("Animation started."); } /// @@ -591,12 +591,12 @@ private void tmWait_Tick(object sender, EventArgs e) /// private void frmPopup_MouseLeave(object sender, EventArgs e) { - Debug.WriteLine("MouseLeave"); + DebugUtilities.WriteLine("MouseLeave"); if (_frmPopup.Visible && (OptionsMenu == null || !OptionsMenu.Visible)) { _tmrWait.Interval = Delay; _tmrWait.Start(); - Debug.WriteLine("Wait timer started."); + DebugUtilities.WriteLine("Wait timer started."); } _mouseIsOn = false; } @@ -608,17 +608,17 @@ private void frmPopup_MouseLeave(object sender, EventArgs e) /// private void frmPopup_MouseEnter(object sender, EventArgs e) { - Debug.WriteLine("MouseEnter"); + DebugUtilities.WriteLine("MouseEnter"); if (!_isAppearing) { _frmPopup.Top = _maxPosition; _frmPopup.Opacity = _maxOpacity; _tmrAnimation.Stop(); - Debug.WriteLine("Animation stopped."); + DebugUtilities.WriteLine("Animation stopped."); } _tmrWait.Stop(); - Debug.WriteLine("Wait timer stopped."); + DebugUtilities.WriteLine("Wait timer stopped."); _mouseIsOn = true; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Components/Toast/KryptonToastNotificationManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Components/Toast/KryptonToastNotificationManager.cs index 077027d07..cf7daa1a9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Components/Toast/KryptonToastNotificationManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Components/Toast/KryptonToastNotificationManager.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Controls/Internal/InternalKryptonButtonPanel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Controls/Internal/InternalKryptonButtonPanel.cs index 6c2a88861..ce08e41c5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Controls/Internal/InternalKryptonButtonPanel.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Controls/Internal/InternalKryptonButtonPanel.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -37,7 +37,7 @@ private void InitializeComponent() { this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); this.kbeBorder = new Krypton.Toolkit.KryptonBorderEdge(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); this.SuspendLayout(); // @@ -66,7 +66,7 @@ private void InitializeComponent() this.Controls.Add(this.kryptonPanel1); this.Name = "KryptonButtonPanel"; this.Size = new System.Drawing.Size(563, 50); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); this.ResumeLayout(false); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/ActionButtonLocation.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/ActionButtonLocation.cs index 106fde22c..7f4b3dff5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/ActionButtonLocation.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/ActionButtonLocation.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/ActionButtonType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/ActionButtonType.cs index 83a31ef0f..e9269e36d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/ActionButtonType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/ActionButtonType.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/ActionType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/ActionType.cs index 51ef82303..6264c21b9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/ActionType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/ActionType.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/AlertAction.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/AlertAction.cs index 39ac315f5..3cb9d08f2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/AlertAction.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/AlertAction.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/AlertType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/AlertType.cs index 82a7eecda..912109d54 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/AlertType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/AlertType.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/DefaultNotificationButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/DefaultNotificationButton.cs index b58282e32..b921b0256 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/DefaultNotificationButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/DefaultNotificationButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/IconType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/IconType.cs index 509609191..19135cc79 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/IconType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/IconType.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/RightToLeftSupport.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/RightToLeftSupport.cs index fd5309f25..42523bf94 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/RightToLeftSupport.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Enumerations/RightToLeftSupport.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Globals/GlobalDeclarations.cs index a82bc2132..c9ee0d1e3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -35,4 +35,4 @@ global using System.Runtime.InteropServices; global using System.Windows.Forms; -global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; \ No newline at end of file +global using Krypton.Toolkit.Suite.Extended.Debug.Tools; \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Interfaces/IToastNotification.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Interfaces/IToastNotification.cs index 37d41a0df..7589e76f8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Interfaces/IToastNotification.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Interfaces/IToastNotification.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Interfaces/IToastNotificationUIElements.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Interfaces/IToastNotificationUIElements.cs index 2ab0dbcbb..437ccccba 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Interfaces/IToastNotificationUIElements.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Interfaces/IToastNotificationUIElements.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Krypton.Toolkit.Suite.Extended.Notifications 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Krypton.Toolkit.Suite.Extended.Notifications 2022.csproj index 603b398ed..441932648 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Krypton.Toolkit.Suite.Extended.Notifications 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Krypton.Toolkit.Suite.Extended.Notifications 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements items to create notifications for your applications. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements items to create notifications for your applications. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,74 +69,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + @@ -181,6 +131,7 @@ + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Krypton.Toolkit.Suite.Extended.Notifications.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Krypton.Toolkit.Suite.Extended.Notifications.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Krypton.Toolkit.Suite.Extended.Notifications.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Krypton.Toolkit.Suite.Extended.Notifications.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/Alternative/KryptonAlertWindow.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/Alternative/KryptonAlertWindow.cs index 9e3f8d446..d705c461d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/Alternative/KryptonAlertWindow.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/Alternative/KryptonAlertWindow.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/PopUp/KryptonPopUpNotificationWindow.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/PopUp/KryptonPopUpNotificationWindow.cs index e7383f071..07526b55c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/PopUp/KryptonPopUpNotificationWindow.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/PopUp/KryptonPopUpNotificationWindow.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -176,15 +176,15 @@ private void PopupNotifierForm_MouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { - if (RectClose.Contains(e.X, e.Y) && (CloseClick != null)) + if (RectClose.Contains(e.X, e.Y) && CloseClick != null) { CloseClick(this, EventArgs.Empty); } - if (RectContentText.Contains(e.X, e.Y) && (LinkClick != null)) + if (RectContentText.Contains(e.X, e.Y) && LinkClick != null) { LinkClick(this, EventArgs.Empty); } - if (RectOptions.Contains(e.X, e.Y) && (PopUp.OptionsMenu != null)) + if (RectOptions.Contains(e.X, e.Y) && PopUp.OptionsMenu != null) { if (ContextMenuOpened != null) { @@ -303,7 +303,7 @@ private void PopupNotifierForm_Paint(object sender, PaintEventArgs e) /// first value /// value to add /// sum of both values - private int AddValueMax255(int input, int add) => (input + add < 256) ? input + add : 255; + private int AddValueMax255(int input, int add) => input + add < 256 ? input + add : 255; /// /// Subtract two values but do not returns a value below 0. @@ -311,7 +311,7 @@ private void PopupNotifierForm_Paint(object sender, PaintEventArgs e) /// first value /// value to subtract /// first value minus second value - private int DedValueMin0(int input, int ded) => (input - ded > 0) ? input - ded : 0; + private int DedValueMin0(int input, int ded) => input - ded > 0 ? input - ded : 0; /// /// Returns a color which is darker than the given color. diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/Toast/Version 1/KryptonToastNotificationVersion1.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/Toast/Version 1/KryptonToastNotificationVersion1.cs index 510a5c620..25691162b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/Toast/Version 1/KryptonToastNotificationVersion1.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/Toast/Version 1/KryptonToastNotificationVersion1.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -447,7 +447,7 @@ private void StartProcess(string process, string args, bool elevate = false) } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } else @@ -464,7 +464,7 @@ private void StartProcess(string process, string args, bool elevate = false) } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/Toast/Version 2/KryptonToastNotificationVersion2.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/Toast/Version 2/KryptonToastNotificationVersion2.cs index e007bb78f..db740b979 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/Toast/Version 2/KryptonToastNotificationVersion2.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/Toast/Version 2/KryptonToastNotificationVersion2.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -37,7 +37,8 @@ public partial class KryptonToastNotificationVersion2 : KryptonForm private bool _showActionButton; - private Color _borderColourOne, _borderColourTwo; + private Color _borderColourOne; + private Color _borderColourTwo; private int _time, _cornerRadius; @@ -49,7 +50,11 @@ public partial class KryptonToastNotificationVersion2 : KryptonForm private SoundPlayer _player; - private string _actionButtonText, _dismissButtonText, _title, _text, _process; + private string _actionButtonText; + private string _dismissButtonText; + private string _title; + private string _text; + private string _process; #endregion #region Properties @@ -378,7 +383,7 @@ private void FadeOutAndClose() _borderColourOne = BorderColourOne; - StateCommon.Border.Color1 = _borderColourOne; + StateCommon!.Border.Color1 = _borderColourOne; _borderColourTwo = BorderColourTwo; @@ -386,16 +391,9 @@ private void FadeOutAndClose() if (TimeOut != 0) { - if (_dismissButtonText != null) - { - kbtnDismiss.Text = $@"{_dismissButtonText}"; - } - else - { - kbtnDismiss.Text = $@"&Dismiss"; - } + kbtnDismiss.Text = !string.IsNullOrEmpty(_dismissButtonText) ? $@"{_dismissButtonText}" : $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss}"; - _timer = new System.Windows.Forms.Timer(); + _timer = new Timer(); _timer.Interval = 1000; @@ -405,14 +403,7 @@ private void FadeOutAndClose() pbTimeOut.Value = TimeOut - _time; - if (_dismissButtonText != null) - { - kbtnDismiss.Text = $@"{_dismissButtonText}"; - } - else - { - kbtnDismiss.Text = $@"&Dismiss"; - } + kbtnDismiss.Text = !string.IsNullOrEmpty(_dismissButtonText) ? $@"{_dismissButtonText}" : $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss}"; if (_time == TimeOut) { @@ -455,7 +446,7 @@ private void StartProcess(string process, string args, bool elevate = false) } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } else @@ -472,7 +463,7 @@ private void StartProcess(string process, string args, bool elevate = false) } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/DataGridViewPercentageCell.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/DataGridViewPercentageCell.cs deleted file mode 100644 index 6a2b1411f..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/DataGridViewPercentageCell.cs +++ /dev/null @@ -1,109 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Class for a DataGridViewPercentageCell - /// - public class DataGridViewPercentageCell : KryptonDataGridViewTextBoxCell - { - /// - /// Constructor - /// - public DataGridViewPercentageCell() - { - Style.Alignment = DataGridViewContentAlignment.MiddleCenter; - } - - /// - /// Specify the type of object used for editing. This is how the WinForms - /// framework figures out what type of edit control to make. - /// - public override Type EditType => typeof(PercentageEditingControl); - - /// - /// Overrides TypeValue - /// - public override Type ValueType => typeof(double); - - /// - /// Specify the default cell contents upon creation of a new cell. - /// - public override object DefaultNewRowValue => 0; - - /// - /// Overrides Paint - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - 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) - { - //Draw the bar - int barWidth; - if ((double)value >= 1.0) - { - barWidth = (int)(cellBounds.Width - 10); - } - else - { - barWidth = (int)((cellBounds.Width - 10) * (double)value); - } - - if ((double)value > 0 && barWidth > 0) - { - Rectangle r = new(cellBounds.X + 3, cellBounds.Y + 3, barWidth, cellBounds.Height - 8); - - using (LinearGradientBrush linearBrush = new(r, KryptonManager.CurrentGlobalPalette.GetBackColor1(PaletteBackStyle.GridHeaderColumnList, PaletteState.Normal), KryptonManager.CurrentGlobalPalette.GetBackColor2(PaletteBackStyle.GridHeaderColumnList, PaletteState.Normal), LinearGradientMode.Vertical)) - { - graphics.FillRectangle(linearBrush, r); - } - - using (Pen pen = new(KryptonManager.CurrentGlobalPalette.GetBorderColor1(PaletteBorderStyle.GridHeaderColumnList, PaletteState.Normal))) - { - graphics.DrawRectangle(pen, r); - } - - //TODO : implement customization like conditional formatting - //using (LinearGradientBrush linearBrush = new LinearGradientBrush(r, Color.FromArgb(255, 140, 197, 66), Color.FromArgb(255, 247, 251, 242), LinearGradientMode.Horizontal)) - //{ - // graphics.FillRectangle(linearBrush, r); - //} - - //using (Pen pen = new Pen(Color.FromArgb(255, 140, 197, 66))) - //{ - // graphics.DrawRectangle(pen, r); - - //} - } - - base.Paint(graphics, clipBounds, cellBounds, rowIndex, cellState, value, formattedValue, errorText, cellStyle, advancedBorderStyle, - DataGridViewPaintParts.None | DataGridViewPaintParts.ContentForeground); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/FormattingCell.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/FormattingCell.cs deleted file mode 100644 index 39bad5f6d..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/FormattingCell.cs +++ /dev/null @@ -1,181 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Formatting cell - /// - /// - public class FormattingCell : KryptonDataGridViewTextBoxCell - { - #region Instance Fields - - private DataGridViewCell _cell; - - #endregion - - /// - /// Gets or sets the type of the format. - /// - /// - /// The type of the format. - /// - public EnumConditionalFormatType FormatType { get; set; } - /// - /// Gets or sets the format parameters. - /// - /// - /// The format parameters. - /// - public IFormatParams? FormatParams { get; set; } - - #region Identity - - public FormattingCell() - { - - } - - public FormattingCell(DataGridViewCell cell) => _cell = cell; - - public FormattingCell(KryptonDataGridViewTextBoxCell textBoxCell) : base() - { - - } - - #endregion - - /// - /// Contrasts the color. - /// - /// The color. - /// - private Color ContrastColour(Color colour) - { - int d = 0; - // Counting the perceptive luminance - human eye favors green color... - double a = 1 - - (0.299 * colour.R - + (0.587 * colour.G + 0.114 * colour.B)) - / 255; - if (a < 0.5) - { - d = 0; - } - else - { - // bright colors - black font - d = 255; - } - - // dark colors - white font - return Color.FromArgb(d, d, d); - } - - /// - /// Paints the specified graphics. - /// - /// The graphics. - /// The clip bounds. - /// The cell bounds. - /// Index of the row. - /// State of the cell. - /// The value. - /// The formatted value. - /// The error text. - /// The cell style. - /// The advanced border style. - /// The paint parts. - 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) - { - if (FormatParams != null) // null can happen when cell set to Formatting but no condition has been set ! - { - switch (FormatType) - { - case EnumConditionalFormatType.Bar: - int barWidth; - BarParams par = (BarParams)FormatParams; - barWidth = (int)((cellBounds.Width - 10) * par.ProportionValue); - if (DataGridView != null) - { - Style.BackColor = DataGridView.DefaultCellStyle.BackColor; - Style.ForeColor = DataGridView.DefaultCellStyle.ForeColor; - } - - if (barWidth > 0) //(double)value > 0 && - { - Rectangle r = new(cellBounds.X + 3, cellBounds.Y + 3, barWidth, cellBounds.Height - 8); - if (par.GradientFill) - { - using (LinearGradientBrush linearBrush = new(r, par.BarColour, Color.White, LinearGradientMode.Horizontal)) //Color.FromArgb(255, 247, 251, 242) - { - graphics.FillRectangle(linearBrush, r); - } - } - else - { - using (SolidBrush solidBrush = new(par.BarColour)) //Color.FromArgb(255, 247, 251, 242) - { - graphics.FillRectangle(solidBrush, r); - } - } - - using (Pen pen = new(par.BarColour)) //Color.FromArgb(255, 140, 197, 66))) - { - graphics.DrawRectangle(pen, r); - } - } - - break; - case EnumConditionalFormatType.TwoColoursRange: - TwoColoursParams twCpar = (TwoColoursParams)FormatParams; - Style.BackColor = twCpar.ValueColour; - // if (ContrastTextColor) - Style.ForeColor = ContrastColour(twCpar.ValueColour); - break; - case EnumConditionalFormatType.ThreeColoursRange: - ThreeColoursParams thCpar = (ThreeColoursParams)FormatParams; - Style.BackColor = thCpar.ValueColour; - Style.ForeColor = ContrastColour(thCpar.ValueColour); - break; - default: - if (DataGridView != null) - { - Style.BackColor = DataGridView.DefaultCellStyle.BackColor; - Style.ForeColor = DataGridView.DefaultCellStyle.ForeColor; - } - - break; - } - } - else - { - if (DataGridView != null) - { - Style.BackColor = DataGridView.DefaultCellStyle.BackColor; - Style.ForeColor = DataGridView.DefaultCellStyle.ForeColor; - } - } - - base.Paint(graphics, clipBounds, cellBounds, rowIndex, cellState, value, formattedValue, errorText, cellStyle, advancedBorderStyle, - DataGridViewPaintParts.None | DataGridViewPaintParts.ContentForeground); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewFormattingColumn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewFormattingColumn.cs deleted file mode 100644 index 3c7a07c6f..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewFormattingColumn.cs +++ /dev/null @@ -1,49 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Class for a KryptonDataGridViewFormattingColumn : KryptonDataGridViewTextBoxColumn with conditionnal formatting abilities - /// - /// - public class KryptonDataGridViewFormattingColumn : KryptonDataGridViewTextBoxColumn - { - private bool _contrastTextColour; - - /// - /// Initializes a new instance of the class. - /// - public KryptonDataGridViewFormattingColumn() - : base() - { - CellTemplate = new FormattingCell(); - DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - ValueType = typeof(FormattingCell); - ContrastTextColour = false; - } - - /// - /// Gets or sets a value indicating whether [contrast text color]. - /// - /// - /// true if [contrast text color]; otherwise, false. - /// - public bool ContrastTextColour { get => _contrastTextColour; set => _contrastTextColour = value; } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewPercentageColumn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewPercentageColumn.cs deleted file mode 100644 index 9617f9039..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewPercentageColumn.cs +++ /dev/null @@ -1,70 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Hosts a collection of KryptonDataGridViewPercentageColumn cells. - /// - /// - public class KryptonDataGridViewPercentageColumn : DataGridViewColumn// KryptonDataGridViewTextBoxColumn - { - #region Identity - /// - /// Initialize a new instance of the KryptonDataGridViewPercentageColumn class. - /// - public KryptonDataGridViewPercentageColumn() - : base(new DataGridViewPercentageCell()) => DefaultCellStyle.Format = "P"; - - /// - /// Returns a standard compact string representation of the column. - /// - public override string ToString() - { - StringBuilder builder = new(0x40); - builder.Append("KryptonDataGridViewPercentageColumn { Name="); - builder.Append(Name); - builder.Append(", Index="); - builder.Append(Index.ToString(CultureInfo.CurrentCulture)); - builder.Append(" }"); - return builder.ToString(); - } - - #endregion - - /// - /// Overrides CellTemplate - /// - public override DataGridViewCell CellTemplate - { - get => base.CellTemplate; - - set - { - // Ensure that the cell used for the template is a DataGridViewPercentageCell. - if (value != null && !value.GetType().IsAssignableFrom(typeof(DataGridViewPercentageCell))) - { - throw new InvalidCastException("Must be a DataGridViewPercentageCell"); - } - base.CellTemplate = value; - - } - } - - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewRatingColumn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewRatingColumn.cs deleted file mode 100644 index 9925a58d9..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewRatingColumn.cs +++ /dev/null @@ -1,36 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Class for a rating column - /// - public class KryptonDataGridViewRatingColumn : DataGridViewImageColumn - { - /// - /// Constructor - /// - public KryptonDataGridViewRatingColumn() - { - CellTemplate = new RatingCell(); - DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - ValueType = typeof(int); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewTextAndImageCell.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewTextAndImageCell.cs deleted file mode 100644 index 9053ab2fa..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewTextAndImageCell.cs +++ /dev/null @@ -1,140 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Class for a TextAndImage cell - /// - public class KryptonDataGridViewTextAndImageCell : KryptonDataGridViewTextBoxCell - { - private Image _imageValue; - private Size _imageSize; - - /// - /// Constructor - /// - public KryptonDataGridViewTextAndImageCell() - : base() - { - } - - /// - /// Overrides ValueType - /// - public override Type ValueType => typeof(TextAndImage); - - /// - /// Sets the value. - /// - /// Index of the row. - /// The value. - /// - protected override bool SetValue(int rowIndex, object? value) - { - if (value != null && !((OutlookGridRow)OwningRow).IsGroupRow) //Test to catch crash when first column is text and image when grouping - { - Image = ((TextAndImage)value).Image; - } - - return base.SetValue(rowIndex, value); - } - - /// - /// Overrides Clone - /// - /// The cloned KryptonDataGridViewTextAndImageCell - public override object? Clone() - { - KryptonDataGridViewTextAndImageCell? c = base.Clone() as KryptonDataGridViewTextAndImageCell; - if (c != null) - { - c._imageValue = _imageValue; - c._imageSize = _imageSize; - return c; - } - - return null; - } - - /// - /// Gets or sets the image. - /// - /// - /// The image. - /// - public Image Image - { - get => _imageValue; - - set - { - if (Image != value) - { - _imageValue = value; - _imageSize = value.Size; - - //if (this.InheritedStyle != null) - //{ - Padding inheritedPadding = Style.Padding; - //Padding inheritedPadding = this.InheritedStyle.Padding; - Style.Padding = new(_imageSize.Width + 2, - inheritedPadding.Top, inheritedPadding.Right, - inheritedPadding.Bottom); - //} - } - } - } - - /// - /// Overrides Paint - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - 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) - { - //TODO : improve we assume it is a 16x16 image - if (Value != null && ((TextAndImage)Value).Image != null) - { - Padding inheritedPadding = Style.Padding; - Style.Padding = new(_imageSize.Width + 2, - inheritedPadding.Top, inheritedPadding.Right, - inheritedPadding.Bottom); - //To be in phase with highlight feature who forces the style. - - // Draw the image clipped to the cell. - GraphicsContainer container = graphics.BeginContainer(); - graphics.SetClip(cellBounds); - graphics.DrawImage(((TextAndImage)Value).Image, new Rectangle(cellBounds.Location.X + 2, cellBounds.Location.Y + (cellBounds.Height - 16) / 2 - 1, 16, 16)); - graphics.EndContainer(container); - } - - // Paint the base content - base.Paint(graphics, clipBounds, cellBounds, rowIndex, cellState, value, formattedValue, errorText, cellStyle, advancedBorderStyle, paintParts); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewTextAndImageColumn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewTextAndImageColumn.cs deleted file mode 100644 index d9a377bdf..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewTextAndImageColumn.cs +++ /dev/null @@ -1,219 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Hosts a collection of KryptonDataGridViewTextAndImageCell cells. - /// - public class KryptonDataGridViewTextAndImageColumn : DataGridViewColumn - { - #region Instance Fields - - private DataGridViewColumnSpecCollection _buttonSpecs; - private Image _imageValue; - private Size _imageSize; - - #endregion - - #region Events - /// - /// Occurs when the user clicks a button spec. - /// - public event EventHandler ButtonSpecClick; - #endregion - - #region Identity - /// - /// Initialize a new instance of the KryptonDataGridViewTextBoxColumn class. - /// - public KryptonDataGridViewTextAndImageColumn() - : base(new KryptonDataGridViewTextAndImageCell()) - { - _buttonSpecs = new(this); - SortMode = DataGridViewColumnSortMode.Automatic; - } - - /// - /// Returns a String that represents the current Object. - /// - /// A String that represents the current Object. - public override string ToString() - { - StringBuilder builder = new(0x40); - builder.Append("KryptonDataGridViewTextAndImageColumn { Name="); - builder.Append(Name); - builder.Append(", Index="); - builder.Append(Index.ToString(CultureInfo.CurrentCulture)); - builder.Append(" }"); - return builder.ToString(); - } - - /// - /// Create a cloned copy of the column. - /// - /// - public override object Clone() - { - KryptonDataGridViewTextAndImageColumn cloned = base.Clone() as KryptonDataGridViewTextAndImageColumn; - cloned._imageValue = _imageValue; - cloned._imageSize = _imageSize; - // Move the button specs over to the new clone - foreach (ButtonSpec bs in ButtonSpecs) - cloned.ButtonSpecs.Add(bs.Clone()); - - return cloned; - } - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing) - { - } - - base.Dispose(disposing); - } - #endregion - - #region Public - - ///// - ///// Gets or Sets the image - ///// - //public Image Image - //{ - // get { return this.imageValue; } - // set - // { - // if (this.Image != value) - // { - // this.imageValue = value; - // this.imageSize = value.Size; - // if (this.InheritedStyle != null) - // { - // Padding inheritedPadding = this.InheritedStyle.Padding; - // this.InheritedStyle.Padding = new Padding(imageSize.Width + 2, inheritedPadding.Top, inheritedPadding.Right, inheritedPadding.Bottom); - // //Padding inheritedPadding = this.InheritedStyle.Padding; - // //this.Style.Padding = new Padding(18, inheritedPadding.Top, inheritedPadding.Right, inheritedPadding.Bottom); - - // } - // } - // } - //} - - /// - /// Gets or sets the maximum number of characters that can be entered into the text box. - /// - [Category("Behavior")] - [DefaultValue(typeof(int), "32767")] - public int MaxInputLength - { - get - { - if (TextBoxCellTemplate == null) - { - throw new InvalidOperationException("KryptonDataGridViewTextAndImageColumn cell template required"); - } - - return TextBoxCellTemplate.MaxInputLength; - } - - set - { - if (MaxInputLength != value) - { - TextBoxCellTemplate.MaxInputLength = value; - if (DataGridView != null) - { - DataGridViewRowCollection rows = DataGridView.Rows; - int count = rows.Count; - for (int i = 0; i < count; i++) - { - DataGridViewTextBoxCell cell = rows.SharedRow(i).Cells[Index] as DataGridViewTextBoxCell; - if (cell != null) - { - cell.MaxInputLength = value; - } - } - } - } - } - } - - /// - /// Gets or sets the sort mode for the column. - /// - [DefaultValue(typeof(DataGridViewColumnSortMode), "Automatic")] - public new DataGridViewColumnSortMode SortMode - { - get => base.SortMode; - set => base.SortMode = value; - } - - /// - /// Gets or sets the template used to model cell appearance. - /// - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public override DataGridViewCell CellTemplate - { - get => base.CellTemplate; - - set - { - if (value != null && !(value is KryptonDataGridViewTextAndImageCell)) - { - throw new InvalidCastException("Can only assign a object of type KryptonDataGridViewTextAndImageCell"); - } - - base.CellTemplate = value; - } - } - - /// - /// Gets the collection of the button specifications. - /// - [Category("Data")] - [Description("Set of extra button specs to appear with control.")] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] - public DataGridViewColumnSpecCollection ButtonSpecs => _buttonSpecs; - - #endregion - - #region Private - private KryptonDataGridViewTextAndImageCell TextBoxCellTemplate => (KryptonDataGridViewTextAndImageCell)CellTemplate; - - #endregion - - #region Internal - internal void PerfomButtonSpecClick(DataGridViewButtonSpecClickEventArgs args) - { - if (ButtonSpecClick != null) - { - ButtonSpecClick(this, args); - } - } - - internal Size ImageSize => _imageSize; - #endregion - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewTokenColumn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewTokenColumn.cs deleted file mode 100644 index 7a358dfe6..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewTokenColumn.cs +++ /dev/null @@ -1,39 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Class for a rating column - /// - public class KryptonDataGridViewTokenColumn : KryptonDataGridViewTextBoxColumn - { - /// - /// Constructor - /// - public KryptonDataGridViewTokenColumn() - : base() - { - CellTemplate = new TokenCell(); - - DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - - ValueType = typeof(TokenCell); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewTokenListColumn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewTokenListColumn.cs deleted file mode 100644 index e4d412fdf..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewTokenListColumn.cs +++ /dev/null @@ -1,37 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Class for a rating column - /// - public class KryptonDataGridViewTokenListColumn : KryptonDataGridViewTextBoxColumn - { - /// - /// Constructor - /// - public KryptonDataGridViewTokenListColumn() - : base() - { - CellTemplate = new TokenListCell(); - DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - ValueType = typeof(List); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewTreeTextCell.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewTreeTextCell.cs deleted file mode 100644 index d1ea94694..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewTreeTextCell.cs +++ /dev/null @@ -1,330 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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 - -// ReSharper disable InconsistentNaming -// ReSharper disable UnusedVariable -// ReSharper disable UselessBinaryOperation -// ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract -namespace Krypton.Toolkit.Suite.Extended.Outlook.Grid -{ - /// - /// Class for a TextAndImage cell - /// - public class KryptonDataGridViewTreeTextCell : KryptonDataGridViewTextBoxCell - { - private const int INDENT_WIDTH = 20; - private const int INDENT_MARGIN = 5; - private Padding _defaultPadding; - // private int glyphWidth; - - /// - /// Constructor - /// - public KryptonDataGridViewTreeTextCell() - { - _defaultPadding = Style.Padding; - } - - /// - /// Overrides Clone - /// - /// The cloned KryptonDataGridViewTextAndImageCell - public override object Clone() - { - KryptonDataGridViewTreeTextCell? c = base.Clone() as KryptonDataGridViewTreeTextCell; - return c!; - } - - /// - /// Gets the glyph margin. - /// - /// - /// The glyph margin. - /// - protected virtual int GlyphMargin => (Level - 1) * INDENT_WIDTH + INDENT_MARGIN; - - /// - /// Gets the level. - /// - /// - /// The level. - /// - public int Level - { - get - { - OutlookGridRow row = (OutlookGridRow)OwningRow; - return row.NodeLevel + 1; //during calculation 0 level must be 1 for multiplication - } - } - - /// - /// Updates the style. - /// - /// padding especially. - public void UpdateStyle() - { - OutlookGridRow? node = OwningNode; - //Console.WriteLine(DateTime.Now.ToString() + " " + node.ToString()); - bool hasChildNodes = node != null && node.HasChildren; - int level = Level; - int plus = 0; - //if (hasChildNodes) - // plus = 15; - Style.Padding = new(_defaultPadding.Left + level * INDENT_WIDTH + INDENT_MARGIN + plus, - _defaultPadding.Top, _defaultPadding.Right, _defaultPadding.Bottom); - - - } - - /// - /// Paints the specified graphics. - /// - /// The graphics. - /// The clip bounds. - /// The cell bounds. - /// Index of the row. - /// State of the cell. - /// The value. - /// The formatted value. - /// The error text. - /// The cell style. - /// The advanced border style. - /// The paint parts. - 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) - { - OutlookGridRow? node = OwningNode; - // Console.WriteLine(DateTime.Now.ToString() + " " + node.ToString()); - //bool hasChildNodes = node.HasChildren; - //int level = this.Level ; - //int plus = 0; - //if (hasChildNodes) - // plus = 15; - //Padding currentPadding = this.InheritedStyle.Padding; - // this.Style.Padding = new Padding(defaultPadding.Left + (level * INDENT_WIDTH) + INDENT_MARGIN, - // defaultPadding.Top, defaultPadding.Right, defaultPadding.Bottom); - - //this.Style.Padding = new Padding(currentPadding.Left + (level * INDENT_WIDTH) + _imageWidth + INDENT_MARGIN, - // currentPadding.Top, currentPadding.Right, currentPadding.Bottom); - - //if (this.Value != null && ((TextAndImage)this.Value).Image != null) - //{ - // Padding inheritedPadding = this.InheritedStyle.Padding; - // this.Style.Padding = new Padding(18, inheritedPadding.Top, inheritedPadding.Right, inheritedPadding.Bottom); - // // Draw the image clipped to the cell. - // System.Drawing.Drawing2D.GraphicsContainer container = graphics.BeginContainer(); - // graphics.SetClip(cellBounds); - // graphics.DrawImageUnscaled(((TextAndImage)this.Value).Image, new Point(cellBounds.Location.X + 2, cellBounds.Location.Y + ((cellBounds.Height - 16) / 2) - 1)); - // graphics.EndContainer(container); - //} - - //if (node == null) return; - - //Image image = node.Image; - - //if (this._imageHeight == 0 && image != null) this.UpdateStyle(); - - // paint the cell normally - base.Paint(graphics, clipBounds, cellBounds, rowIndex, cellState, value, formattedValue, errorText, cellStyle, advancedBorderStyle, paintParts); - - // TODO: Indent width needs to take image size into account - Rectangle glyphRect = new(cellBounds.X + GlyphMargin, cellBounds.Y, INDENT_WIDTH, cellBounds.Height - 1); - - - ////TODO: This painting code needs to be rehashed to be cleaner - //int level = this.Level; - - ////TODO: Rehash this to take different Imagelayouts into account. This will speed up drawing - //// for images of the same size (ImageLayout.None) - //if (image != null) - //{ - // Point pp; - // if (_imageHeight > cellBounds.Height) - // pp = new Point(glyphRect.X + this.glyphWidth, cellBounds.Y + _imageHeightOffset); - // else - // pp = new Point(glyphRect.X + this.glyphWidth, (cellBounds.Height / 2 - _imageHeight / 2) + cellBounds.Y); - - // // Graphics container to push/pop changes. This enables us to set clipping when painting - // // the cell's image -- keeps it from bleeding outsize of cells. - // System.Drawing.Drawing2D.GraphicsContainer gc = graphics.BeginContainer(); - // { - // graphics.SetClip(cellBounds); - // graphics.DrawImageUnscaled(image, pp); - // } - // graphics.EndContainer(gc); - //} - - // Paint tree lines - if (node != null && ((KryptonOutlookGrid)node.DataGridView).ShowLines) - { - using (Pen linePen = new(SystemBrushes.ControlDark, 1.0f)) - { - linePen.DashStyle = DashStyle.Dot; - bool isLastSibling = node.IsLastSibling; - bool isFirstSibling = node.IsFirstSibling; - - if (node.NodeLevel == 0) - { - // the Root nodes display their lines differently - if (isFirstSibling && isLastSibling) - { - // only node, both first and last. Just draw horizontal line - graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2, glyphRect.Right, cellBounds.Top + cellBounds.Height / 2); - } - else if (isLastSibling) - { - // last sibling doesn't draw the line extended below. Paint horizontal then vertical - graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2, glyphRect.Right, cellBounds.Top + cellBounds.Height / 2); - graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2); - } - else if (isFirstSibling) - { - // first sibling doesn't draw the line extended above. Paint horizontal then vertical - graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2, glyphRect.Right, cellBounds.Top + cellBounds.Height / 2); - graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2, glyphRect.X + 4, cellBounds.Bottom); - } - else - { - // normal drawing draws extended from top to bottom. Paint horizontal then vertical - graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2, glyphRect.Right, cellBounds.Top + cellBounds.Height / 2); - graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top, glyphRect.X + 4, cellBounds.Bottom); - } - } - else - { - if (isLastSibling) - { - // last sibling doesn't draw the line extended below. Paint horizontal then vertical - graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2, glyphRect.Right, cellBounds.Top + cellBounds.Height / 2); - graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2); - } - else - { - // normal drawing draws extended from top to bottom. Paint horizontal then vertical - graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2, glyphRect.Right, cellBounds.Top + cellBounds.Height / 2); - graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top, glyphRect.X + 4, cellBounds.Bottom); - } - - // paint lines of previous levels to the root - OutlookGridRow? previousNode = node.ParentNode; - int horizontalStop = glyphRect.X + 4 - INDENT_WIDTH; - - while (previousNode != null)//.IsRoot) - { - if (previousNode.HasChildren && !previousNode.IsLastSibling) - { - // paint vertical line - graphics.DrawLine(linePen, horizontalStop, cellBounds.Top, horizontalStop, cellBounds.Bottom); - } - previousNode = previousNode.ParentNode; - horizontalStop = horizontalStop - INDENT_WIDTH; - } - } - - } - } - - if (node != null && node.HasChildren) - { - // Paint node glyphs - if (node.Collapsed) - { - if (KryptonManager.CurrentGlobalPalette != null && (KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2010 || KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2013)) - { - graphics.DrawImage(Resources.OutlookGridImageResources.CollapseIcon2010, glyphRect.X, glyphRect.Y + glyphRect.Height / 2 - 4, 11, 11); - } - else - { - graphics.DrawImage(Resources.OutlookGridImageResources.ExpandIcon, glyphRect.X, glyphRect.Y + glyphRect.Height / 2 - 4, 11, 11); - } - } - else - { - if (KryptonManager.CurrentGlobalPalette != null && (KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2010 || KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2013)) - { - graphics.DrawImage(Resources.OutlookGridImageResources.ExpandIcon2010, glyphRect.X, glyphRect.Y + glyphRect.Height / 2 - 4, 11, 11); - } - else - { - graphics.DrawImage(Resources.OutlookGridImageResources.CollapseIcon, glyphRect.X, glyphRect.Y + glyphRect.Height / 2 - 4, 11, 11); - } - } - } - //graphics.DrawRectangle(new Pen(new SolidBrush(Color.Red)), glyphRect); - } - - /// - /// Raises the event. - /// - /// The instance containing the event data. - protected override void OnMouseUp(DataGridViewCellMouseEventArgs e) - { - base.OnMouseUp(e); - - OutlookGridRow? node = OwningNode; - if (node != null) - { - ((KryptonOutlookGrid)node.DataGridView).InExpandCollapseMouseCapture = false; - } - } - /// - /// Raises the event. - /// - /// The instance containing the event data. - protected override void OnMouseDown(DataGridViewCellMouseEventArgs e) - { - Rectangle dis = DataGridView.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, false); - Rectangle glyphRect = new(dis.X + GlyphMargin, dis.Y, INDENT_WIDTH, dis.Height - 1); - - //if (e.X > this.InheritedStyle.Padding.Left) - if (e.X + dis.X <= glyphRect.X + 11 && - e.X + dis.X >= glyphRect.X) - { - - // Expand the node - //TODO: Calculate more precise location - OutlookGridRow? node = OwningNode; - if (node != null) - { - ((KryptonOutlookGrid)node.DataGridView).InExpandCollapseMouseCapture = true; - - if (node.Collapsed) - { - node.Expand(); - } - else - { - node.Collapse(); - } - } - } - else - { - base.OnMouseDown(e); - } - } - - /// - /// Gets the owning node. - /// - /// - /// The owning node. - /// - public OutlookGridRow? OwningNode => OwningRow as OutlookGridRow; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewTreeTextColumn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewTreeTextColumn.cs deleted file mode 100644 index 7896ab0e6..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/KryptonDataGridViewTreeTextColumn.cs +++ /dev/null @@ -1,37 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Special column used to enable nodes in the grid. - /// - /// - public class KryptonDataGridViewTreeTextColumn : KryptonDataGridViewTextBoxColumn - { - - /// - /// Initializes a new instance of the class. - /// - public KryptonDataGridViewTreeTextColumn() - : base() - { - CellTemplate = new KryptonDataGridViewTreeTextCell(); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/PercentageEditingControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/PercentageEditingControl.cs deleted file mode 100644 index de6c7492f..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/PercentageEditingControl.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Public class for the underlying editing control - /// - [ToolboxItem(false)] - public class PercentageEditingControl : DataGridViewTextBoxEditingControl - { - /// - /// Constructor - /// - public PercentageEditingControl() - : base() - { - } - - /// - /// Returns if the character is a valid digit - /// - /// The character. - /// True if valid digit, false otherwise. - private bool IsValidForNumberInput(char c) - { - return Char.IsDigit(c); - // OrElse c = Chr(8) OrElse c = "."c OrElse c = "-"c OrElse c = "("c OrElse c = ")"c - } - - /// - /// Overrides onKeypPress - /// - /// - protected override void OnKeyPress(KeyPressEventArgs e) - { - if (!IsValidForNumberInput(e.KeyChar)) - { - e.Handled = true; - } - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/RatingCell.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/RatingCell.cs deleted file mode 100644 index 6ca43c293..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/RatingCell.cs +++ /dev/null @@ -1,189 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Class for a rating celle - /// - public class RatingCell : DataGridViewImageCell - { - /// - /// Constructor - /// - public RatingCell() - { - //Value type is an integer. - //Formatted value type is an image since we derive from the ImageCell - ValueType = typeof(int); - } - - /// - /// Overrides GetFormattedValue - /// - /// - /// - /// - /// - /// - /// - /// - protected override object GetFormattedValue(object value, int rowIndex, ref DataGridViewCellStyle cellStyle, TypeConverter valueTypeConverter, TypeConverter formattedValueTypeConverter, DataGridViewDataErrorContexts context) - { - if (value == null) - { - return null; //For example it is also the case for group row... - } - else - { - return _starImages[(int)value]; - } - } - - /// - /// Overrides DefaultNewRowValue - /// - public override object DefaultNewRowValue => - //default new row to 3 stars - 3; - - /// - /// Overrides Paint - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, int rowIndex, DataGridViewElementStates elementState, object value, object formattedValue, string errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts) - { - Image cellImage = (Image)formattedValue; - if (!ReadOnly) - { - int starNumber = GetStarFromMouse(cellBounds, DataGridView.PointToClient(Control.MousePosition)); - - if (starNumber != -1) - { - cellImage = _starHotImages[starNumber]; - } - } - //supress painting of selection - base.Paint(graphics, clipBounds, cellBounds, rowIndex, elementState, value, cellImage, errorText, cellStyle, advancedBorderStyle, paintParts & ~DataGridViewPaintParts.SelectionBackground); - } - - /// - /// Update cell's value when the user clicks on a star - /// - /// A DataGridViewCellEventArgs that contains the event data. - protected override void OnContentClick(DataGridViewCellEventArgs e) - { - base.OnContentClick(e); - if (!ReadOnly) - { - int starNumber = GetStarFromMouse(DataGridView.GetCellDisplayRectangle(DataGridView.CurrentCellAddress.X, DataGridView.CurrentCellAddress.Y, false), DataGridView.PointToClient(Control.MousePosition)); - - if (starNumber != -1) - { - Value = starNumber; - } - } - } - - #region Invalidate cells when mouse moves or leaves the cell - - /// - /// Overrides OnMouseLeave - /// - /// the row that contains the cell. - protected override void OnMouseLeave(int rowIndex) - { - base.OnMouseLeave(rowIndex); - DataGridView.InvalidateCell(this); - } - - /// - /// Overrides OnMouseMove - /// - /// A DataGridViewCellMouseEventArgs that contains the event data. - protected override void OnMouseMove(DataGridViewCellMouseEventArgs e) - { - base.OnMouseMove(e); - DataGridView.InvalidateCell(this); - } - #endregion - - #region Private Implementation - - static Image[] _starImages; - static Image[] _starHotImages; - const int Imagewidth = 58; - - private int GetStarFromMouse(Rectangle cellBounds, Point mouseLocation) - { - if (cellBounds.Contains(mouseLocation)) - { - int mouseXRelativeToCell = mouseLocation.X - cellBounds.X; - int imageXArea = cellBounds.Width / 2 - Imagewidth / 2; - if (mouseXRelativeToCell + 4 < imageXArea || mouseXRelativeToCell >= imageXArea + Imagewidth) - { - return -1; - } - else - { - int oo = (int)Math.Round((float)(mouseXRelativeToCell - imageXArea + 2) / (float)Imagewidth * 10f, MidpointRounding.AwayFromZero); - if (oo > 10 || oo < 0) - { - Debugger.Break(); - } - - return oo; - } - } - else - { - return -1; - } - } - - //setup star images - #region Load star images - - static RatingCell() - { - _starImages = new Image[11]; - _starHotImages = new Image[11]; - // load normal stars - for (int i = 0; i <= 10; i++) - _starImages[i] = (Image)Resources.OutlookGridImageResources.ResourceManager.GetObject($"star{i}"); - - // load hot normal stars - for (int i = 0; i <= 10; i++) - _starHotImages[i] = (Image)Resources.OutlookGridImageResources.ResourceManager.GetObject($"starhot{i}"); - } - #endregion - - #endregion - - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/TextAndImage.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/TextAndImage.cs deleted file mode 100644 index dbbc16ffa..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/TextAndImage.cs +++ /dev/null @@ -1,78 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Class for TextAndImage object - /// - public class TextAndImage : IComparable - { - /// - /// The text - /// - public string Text; - /// - /// The image - /// - public Image Image; - - /// - /// Constructor - /// - public TextAndImage() - { } - - /// - /// Constructor - /// - /// The text. - /// The image. - public TextAndImage(string text, Image img) - { - Text = text; - Image = img; - } - - /// - /// Overrides ToString - /// - /// String that represents TextAndImage - public override string ToString() => Text; - - /// - /// Overrides Equals - /// - /// The object to compare - /// true if equal, false otherwise. - public override bool Equals(object obj) => Text.Equals(obj.ToString()); - - /// - /// Overrides GetHashCode - /// - /// - public override int GetHashCode() => base.GetHashCode(); - - /// - /// Compares to. - /// - /// The other. - /// - public int CompareTo(TextAndImage other) => Text.CompareTo(other.Text); - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/Token.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/Token.cs deleted file mode 100644 index c1a188c71..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/Token.cs +++ /dev/null @@ -1,87 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Token object - /// - public class Token : IComparable - { - /// - /// Default constructor - /// - public Token() - { - } - - /// - /// Constructor - /// - /// Text of the token - /// Background color - /// Foreground text color - public Token(string text, Color bg, Color fg) - { - Text = text; - - BackColour = bg; - - ForeColour = fg; - } - - /// - /// Text of the token - /// - public string Text { get; set; } - /// - /// Background color - /// - public Color BackColour { get; set; } - /// - /// Foreground text color - /// - public Color ForeColour { get; set; } - - /// - /// Compare a Token to another - /// - /// - /// - public int CompareTo(Token other) => Text.CompareTo(other.Text); - - /// - /// Overrides ToString - /// - /// String that represents TextAndImage - public override string ToString() => Text; - - /// - /// Overrides Equals - /// - /// The object to compare - /// true if equal, false otherwise. - public override bool Equals(object obj) => Text.Equals(obj.ToString()); - - /// - /// Overrides GetHashCode - /// - /// - public override int GetHashCode() => base.GetHashCode(); - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/TokenCell.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/TokenCell.cs deleted file mode 100644 index 607af8792..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/TokenCell.cs +++ /dev/null @@ -1,143 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Class for a Token cell - /// - public class TokenCell : KryptonDataGridViewTextBoxCell - { - //List TokenList; - /// - /// Constructor - /// - public TokenCell() - : base() - { - //Value type is an integer. - //Formatted value type is an image since we derive from the ImageCell - ValueType = typeof(TokenCell); - } - - /// - /// Returns a that represents this instance. - /// - /// - /// A that represents this instance. - /// - public override string ToString() - { - Token tok = (Token)Value; - if (tok != null) - { - return tok.Text; - } - else - { - return ""; - } - } - - /// - /// Overrides Paint - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, int rowIndex, DataGridViewElementStates elementState, object value, object formattedValue, string errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts) - { - float factorX = graphics.DpiX > 96 ? 1f * graphics.DpiX / 96 : 1f; - float factorY = graphics.DpiY > 96 ? 1f * graphics.DpiY / 96 : 1f; - - int nextPosition = cellBounds.X + (int)(1 * factorX); - Font f = KryptonManager.CurrentGlobalPalette.GetContentShortTextFont(PaletteContentStyle.GridDataCellList, PaletteState.Normal); - - Token tok = (Token)Value; - if (tok != null) - { - Rectangle rectangle = new(); - Size s = TextRenderer.MeasureText(tok.Text, f); - rectangle.Width = s.Width + (int)(10 * factorX); - rectangle.X = nextPosition; - rectangle.Y = cellBounds.Y + (int)(2 * factorY); - rectangle.Height = (int)(17 * factorY); - nextPosition += rectangle.Width + (int)(5 * factorX); - - graphics.FillRectangle(new SolidBrush(tok.BackColour), rectangle); - TextRenderer.DrawText(graphics, tok.Text, f, rectangle, tok.ForeColour); - } - } - - /// - /// Overrides GetPreferredSize - /// - /// - /// - /// - /// - /// - protected override Size GetPreferredSize(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex, Size constraintSize) - { - float factorX = graphics.DpiX > 96 ? 1f * graphics.DpiX / 96 : 1f; - float factorY = graphics.DpiY > 96 ? 1f * graphics.DpiY / 96 : 1f; - - Size tmpSize = base.GetPreferredSize(graphics, cellStyle, rowIndex, constraintSize); - Font f = KryptonManager.CurrentGlobalPalette.GetContentShortTextFont(PaletteContentStyle.GridDataCellList, PaletteState.Normal); - int nextPosition = (int)(1 * factorX); - if (Value != null) - { - Token tok = (Token)Value; - Size s = TextRenderer.MeasureText(tok.Text, f); - nextPosition += s.Width + (int)(10 * factorX) + (int)(5 * factorX); - - tmpSize.Width = nextPosition; - } - return tmpSize; - } - - /// - /// Update cell's value when the user clicks on a star - /// - /// A DataGridViewCellEventArgs that contains the event data. - protected override void OnContentClick(DataGridViewCellEventArgs e) => base.OnContentClick(e); - - #region Invalidate cells when mouse moves or leaves the cell - - /// - /// Overrides OnMouseLeave - /// - /// the row that contains the cell. - protected override void OnMouseLeave(int rowIndex) => base.OnMouseLeave(rowIndex); - - /// - /// Overrides OnMouseMove - /// - /// A DataGridViewCellMouseEventArgs that contains the event data. - protected override void OnMouseMove(DataGridViewCellMouseEventArgs e) => base.OnMouseMove(e); - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/TokenListCell.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/TokenListCell.cs deleted file mode 100644 index d411f8b20..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Custom Columns/TokenListCell.cs +++ /dev/null @@ -1,130 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Class for a rating celle - /// - public class TokenListCell : KryptonDataGridViewTextBoxCell - { - //List TokenList; - /// - /// Constructor - /// - public TokenListCell() - : base() - { - //Value type is an integer. - //Formatted value type is an image since we derive from the ImageCell - ValueType = typeof(List); - } - - /// - /// Overrides Paint - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, int rowIndex, DataGridViewElementStates elementState, object value, object formattedValue, string errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts) - { - float factorX = graphics.DpiX > 96 ? 1f * graphics.DpiX / 96 : 1f; - float factorY = graphics.DpiY > 96 ? 1f * graphics.DpiY / 96 : 1f; - - int nextPosition = cellBounds.X + (int)(1 * factorX); - Font f = KryptonManager.CurrentGlobalPalette.GetContentShortTextFont(PaletteContentStyle.GridDataCellList, PaletteState.Normal); - - foreach (Token tok in (List)Value) - { - Rectangle rectangle = new(); - Size s = TextRenderer.MeasureText(tok.Text, f); - rectangle.Width = s.Width + (int)(10 * factorX); - rectangle.X = nextPosition; - rectangle.Y = cellBounds.Y + (int)(2 * factorY); - rectangle.Height = (int)(17 * factorY); - nextPosition += rectangle.Width + (int)(5 * factorX); - - graphics.FillRectangle(new SolidBrush(tok.BackColour), rectangle); - TextRenderer.DrawText(graphics, tok.Text, f, rectangle, tok.ForeColour); - } - } - - /// - /// Overrides GetPreferredSize - /// - /// - /// - /// - /// - /// - protected override Size GetPreferredSize(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex, Size constraintSize) - { - float factorX = graphics.DpiX > 96 ? 1f * graphics.DpiX / 96 : 1f; - float factorY = graphics.DpiY > 96 ? 1f * graphics.DpiY / 96 : 1f; - - Size tmpSize = base.GetPreferredSize(graphics, cellStyle, rowIndex, constraintSize); - Font f = KryptonManager.CurrentGlobalPalette.GetContentShortTextFont(PaletteContentStyle.GridDataCellList, PaletteState.Normal); - int nextPosition = (int)(1 * factorX); - if (Value != null) - { - foreach (Token tok in (List)Value) - { - Size s = TextRenderer.MeasureText(tok.Text, f); - nextPosition += s.Width + (int)(10 * factorX) + (int)(5 * factorX); - } - tmpSize.Width = nextPosition; - } - return tmpSize; - } - - /// - /// Update cell's value when the user clicks on a star - /// - /// A DataGridViewCellEventArgs that contains the event data. - protected override void OnContentClick(DataGridViewCellEventArgs e) => base.OnContentClick(e); - - #region Invalidate cells when mouse moves or leaves the cell - - /// - /// Overrides OnMouseLeave - /// - /// the row that contains the cell. - protected override void OnMouseLeave(int rowIndex) - { - base.OnMouseLeave(rowIndex); - } - - /// - /// Overrides OnMouseMove - /// - /// A DataGridViewCellMouseEventArgs that contains the event data. - protected override void OnMouseMove(DataGridViewCellMouseEventArgs e) - { - base.OnMouseMove(e); - } - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Formating/ColourFormatting.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Formating/ColourFormatting.cs deleted file mode 100644 index a5d8b4ded..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Formating/ColourFormatting.cs +++ /dev/null @@ -1,170 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Color Formatting class : all the magic ! - /// - public static class ColourFormatting - { - /// - /// Returns the percentage value for a Bar formatting. - /// - /// The value. - /// The minimum. - /// The maximum. - /// - public static double ConvertBar(double value, double min, double max) - { - double percent; - if (min == max) - { - percent = 1.0; - } - else - { - //Min can be different from 0 - percent = (value - min) / (max - min); - } - return percent; - } - - /// - /// Returns the color for a 2scale color formatting. - /// - /// The value. - /// The minimum. - /// The maximum. - /// The 2color parameters. - /// - public static Color ConvertTwoRange(double value, double min, double max, TwoColoursParams par) - { - ColourHelper.HSVColour a = ColourToHSV(par.MinimumColour); - ColourHelper.HSVColour b = ColourToHSV(par.MaximumColour); - - //Ratio - double percent; - if (min == max) - { - percent = 1.0; - } - else - { - //Min can be different from 0 - percent = (value - min) / (max - min); - } - return Color.FromArgb((int)Math.Round(par.MinimumColour.A + (par.MaximumColour.A - par.MinimumColour.A) * percent), (int)Math.Round(par.MinimumColour.R + (par.MaximumColour.R - par.MinimumColour.R) * percent), (int)Math.Round(par.MinimumColour.G + (par.MaximumColour.G - par.MinimumColour.G) * percent), (int)Math.Round(par.MinimumColour.B + (par.MaximumColour.B - par.MinimumColour.B) * percent)); - } - - /// - /// Returns the color for a 3scale color formatting. - /// - /// The value. - /// The minimum. - /// The maximum. - /// The 3color parameters. - /// - public static Color ConvertThreeRange(double value, double min, double max, ThreeColoursParams par) - { - ColourHelper.HSVColour a = ColourToHSV(par.MinimumColour); - ColourHelper.HSVColour b = ColourToHSV(par.MaximumColour); - ColourHelper.HSVColour c = ColourToHSV(par.MediumColour); - - //Ratio - double percent; - if (min == max) - { - percent = 1.0; - } - else - { - //Min can be different from 0 - percent = (value - min) / (max - min); - } - - if (percent == 0.5) - { - return par.MediumColour; - } - else if (percent <= 0.5) - { - return Color.FromArgb((int)Math.Round(par.MinimumColour.A + (par.MediumColour.A - par.MinimumColour.A) * percent), (int)Math.Round(par.MinimumColour.R + (par.MediumColour.R - par.MinimumColour.R) * percent), (int)Math.Round(par.MinimumColour.G + (par.MediumColour.G - par.MinimumColour.G) * percent), (int)Math.Round(par.MinimumColour.B + (par.MediumColour.B - par.MinimumColour.B) * percent)); - } - else - { - return Color.FromArgb((int)Math.Round(par.MediumColour.A + (par.MaximumColour.A - par.MediumColour.A) * percent), (int)Math.Round(par.MediumColour.R + (par.MaximumColour.R - par.MediumColour.R) * percent), (int)Math.Round(par.MediumColour.G + (par.MaximumColour.G - par.MediumColour.G) * percent), (int)Math.Round(par.MediumColour.B + (par.MaximumColour.B - par.MediumColour.B) * percent)); - } - } - - private static ColourHelper.HSVColour ColourToHSV(Color colour) - { - int max = Math.Max(colour.R, Math.Max(colour.G, colour.B)); - int min = Math.Min(colour.R, Math.Min(colour.G, colour.B)); - - double hue = colour.GetHue(); - double saturation = max == 0 ? 0 : 1d - 1d * min / max; - double value = max / 255d; - - return new((float)hue, (float)saturation, (float)value); - } - - private static Color ColourFromHSV(double hue, double saturation, double value) - { - int hi = Convert.ToInt32(Math.Floor(hue / 60)) % 6; - double f = hue / 60 - Math.Floor(hue / 60); - - value = value * 255; - int v = Convert.ToInt32(value); - int p = Convert.ToInt32(value * (1 - saturation)); - int q = Convert.ToInt32(value * (1 - f * saturation)); - int t = Convert.ToInt32(value * (1 - (1 - f) * saturation)); - - switch (hi) - { - case 0: - return Color.FromArgb(255, v, t, p); - case 1: - return Color.FromArgb(255, q, v, p); - case 2: - return Color.FromArgb(255, p, v, t); - case 3: - return Color.FromArgb(255, p, q, v); - case 4: - return Color.FromArgb(255, t, p, v); - default: - return Color.FromArgb(255, v, p, q); - } - } - /// - /// Interpolate colors 0.0 - 1.0 - /// - private static Color Interpolate(double percent, params Color[] colorus) - { - int left = (int)Math.Floor(percent * (colorus.Length - 1)); - int right = (int)Math.Ceiling(percent * (colorus.Length - 1)); - Color colorLeft = colorus[left]; - Color colorRight = colorus[right]; - - double step = 1.0 / (colorus.Length - 1); - double percentRight = (percent - left * step) / step; - double percentLeft = 1.0 - percentRight; - return Color.FromArgb((byte)(colorLeft.A * percentLeft + colorRight.A * percentRight), (byte)(colorLeft.R * percentLeft + colorRight.R * percentRight), (byte)(colorLeft.G * percentLeft + colorRight.G * percentRight), (byte)(colorLeft.B * percentLeft + colorRight.B * percentRight)); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Formating/CondtionalFormatting.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Formating/CondtionalFormatting.cs deleted file mode 100644 index a8d93e685..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Formating/CondtionalFormatting.cs +++ /dev/null @@ -1,103 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Conditional Formatting class - /// - public class ConditionalFormatting - { - /// - /// Gets or sets the name of the column. - /// - /// - /// The name of the column. - /// - public string ColumnName { get; set; } - /// - /// Gets or sets the type of the Conditional Formatting. - /// - /// - /// The type of the Conditional Formatting. - /// - public EnumConditionalFormatType FormatType { get; set; } - /// - /// Gets or sets the Conditional Formatting parameters. - /// - /// - /// The Conditional Formatting parameters. - /// - public IFormatParams FormatParams { get; set; } - /// - /// Gets or sets the minimum value. - /// - /// - /// The minimum value. - /// - public double MinValue { get; set; } - /// - /// Gets or sets the maximum value. - /// - /// - /// The maximum value. - /// - public double MaxValue { get; set; } - - /// - /// Initializes a new instance of the class. - /// - public ConditionalFormatting() { } - - /// - /// Initializes a new instance of the class. (Only use for context menu !) - /// - /// Type of the Conditional Formatting. - /// The Conditional Formatting parameters. - public ConditionalFormatting(EnumConditionalFormatType formatType, IFormatParams formatParams) - { - FormatType = formatType; - FormatParams = formatParams; - } - - /// - /// Initializes a new instance of the class. - /// - /// Name of the column. - /// Type of the Conditional Formatting. - /// The Conditional Formatting parameters. - public ConditionalFormatting(string columnName, EnumConditionalFormatType formatType, IFormatParams formatParams) - { - ColumnName = columnName; - FormatType = formatType; - FormatParams = formatParams; - } - - internal void Persist(XmlWriter writer) - { - writer.WriteStartElement("Condition"); - writer.WriteElementString("ColumnName", ColumnName); - writer.WriteElementString("FormatType", FormatType.ToString()); - writer.WriteStartElement("FormatParams"); - FormatParams.Persist(writer); - writer.WriteEndElement(); //FormatParams - //No need to persist min/max Value. - writer.WriteEndElement(); //Condition - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Formating/Params/BarParams.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Formating/Params/BarParams.cs deleted file mode 100644 index af45e80e4..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Formating/Params/BarParams.cs +++ /dev/null @@ -1,70 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Parameters for Bar formatting - /// - /// - public class BarParams : IFormatParams - { - /// - /// The bar color - /// - public Color BarColour; - /// - /// The gradient fill - /// - public bool GradientFill; - /// - /// The proportion value - /// - public double ProportionValue; - - /// - /// Initializes a new instance of the class. - /// - /// Color of the bar. - /// if set to true [gradient fill]. - public BarParams(Color barColour, bool gradientFill) - { - BarColour = barColour; - GradientFill = gradientFill; - } - - /// - /// Crée un objet qui est une copie de l'instance actuelle. - /// - /// - /// Nouvel objet qui est une copie de cette instance. - /// - public object Clone() => MemberwiseClone(); - - /// - /// Persists the parameters. - /// - /// The XML writer. - void IFormatParams.Persist(XmlWriter writer) - { - writer.WriteElementString("BarColour", BarColour.ToArgb().ToString()); - writer.WriteElementString("GradientFill", CommonHelper.BoolToString(GradientFill)); - } - } -} - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Formating/Params/ThreeColoursParams.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Formating/Params/ThreeColoursParams.cs deleted file mode 100644 index 18f0c69e4..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Formating/Params/ThreeColoursParams.cs +++ /dev/null @@ -1,146 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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 - -using Krypton.Toolkit.Suite.Extended.Outlook.Grid; - -namespace Krypton.Toolkit.Suite.Extended.Outlook.Grid -{ - /// - /// Three scale color class parameters - /// - /// - public class ThreeColoursParams : IFormatParams - { - /// - /// The minimum color - /// - public Color MinimumColour; - - /// - /// The medium color - /// - public Color MediumColour; - - /// - /// The maximum color - /// - public Color MaximumColour; - - /// - /// The color associated to the value - /// - public Color ValueColour; - - /// - /// Initializes a new instance of the class. - /// - /// The minimum color. - /// Color of the medium. - /// The maximum color. - public ThreeColoursParams(Color minColour, Color mediumColour, Color maxColour) - { - MinimumColour = minColour; - MediumColour = mediumColour; - MaximumColour = maxColour; - } - - /// - /// Crée un objet qui est une copie de l'instance actuelle. - /// - /// - /// Nouvel objet qui est une copie de cette instance. - /// - public object Clone() - { - return MemberwiseClone(); - } - - /// - /// Persists the parameters. - /// - /// The XML writer. - void IFormatParams.Persist(XmlWriter writer) - { - writer.WriteElementString("MinimumColour", MinimumColour.ToArgb().ToString()); - writer.WriteElementString("MediumColour", MediumColour.ToArgb().ToString()); - writer.WriteElementString("MaximumColour", MaximumColour.ToArgb().ToString()); - } - } -} - - /// - /// Three scale color class parameters - /// - /// - public class ThreeColoursParams : IFormatParams - { - /// - /// The minimum color - /// - public Color MinimumColour; - - /// - /// The medium color - /// - public Color MediumColour; - - /// - /// The maximum color - /// - public Color MaximumColour; - - /// - /// The color associated to the value - /// - public Color ValueColour; - - /// - /// Initializes a new instance of the class. - /// - /// The minimum color. - /// Color of the medium. - /// The maximum color. - public ThreeColoursParams(Color minColour, Color mediumColour, Color maxColour) - { - MinimumColour = minColour; - MediumColour = mediumColour; - MaximumColour = maxColour; - } - - /// - /// Crée un objet qui est une copie de l'instance actuelle. - /// - /// - /// Nouvel objet qui est une copie de cette instance. - /// - public object Clone() - { - return MemberwiseClone(); - } - - /// - /// Persists the parameters. - /// - /// The XML writer. - void IFormatParams.Persist(XmlWriter writer) - { - writer.WriteElementString("MinimumColour", MinimumColour.ToArgb().ToString()); - writer.WriteElementString("MediumColour", MediumColour.ToArgb().ToString()); - writer.WriteElementString("MaximumColour", MaximumColour.ToArgb().ToString()); - } - } \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Formating/Params/TwoColoursParams.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Formating/Params/TwoColoursParams.cs deleted file mode 100644 index 8e50c5991..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Formating/Params/TwoColoursParams.cs +++ /dev/null @@ -1,72 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Two scale color class parameters - /// - /// - public class TwoColoursParams : IFormatParams - { - /// - /// Minimum color - /// - public Color MinimumColour; - /// - /// Maximum color - /// - public Color MaximumColour; - /// - /// Color associated to the value between min and max color - /// - public Color ValueColour; - - /// - /// Initializes a new instance of the class. - /// - /// The minimum color. - /// The maximum color. - public TwoColoursParams(Color minColour, Color maxColour) - { - MinimumColour = minColour; - MaximumColour = maxColour; - } - - /// - /// Crée un objet qui est une copie de l'instance actuelle. - /// - /// - /// Nouvel objet qui est une copie de cette instance. - /// - public object Clone() - { - return MemberwiseClone(); - } - - /// - /// Persists the parameters. - /// - /// The XML writer. - public void Persist(XmlWriter writer) - { - writer.WriteElementString("MinimumColor", MinimumColour.ToArgb().ToString()); - writer.WriteElementString("MaximumColor", MaximumColour.ToArgb().ToString()); - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/KryptonOutlookGrid.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/KryptonOutlookGrid.cs deleted file mode 100644 index de68272be..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/KryptonOutlookGrid.cs +++ /dev/null @@ -1,3137 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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 - -// ReSharper disable RedundantOverriddenMember -// ReSharper disable PrivateFieldCanBeConvertedToLocalVariable -// ReSharper disable UnusedVariable -// ReSharper disable RedundantAssignment -namespace Krypton.Toolkit.Suite.Extended.Outlook.Grid -{ - /// - /// Krypton DataGridView allowing nested grouping and unlimited sorting - /// - /// - public partial class KryptonOutlookGrid : KryptonDataGridView - { - #region Design Code - private IContainer? components = null; - - private void InitializeComponent() - { - components = new Container(); - - } - #endregion - - #region Variables - private KryptonOutlookGridGroupBox? _groupBox; - //Krypton - private PaletteBase? _palette; - private 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 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 FormattingBarSolidGradientSepIndex = 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 = false; - private FillMode _fillMode; - - //Formatting - private List _formatConditions; - #endregion - - /// - /// 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; - - private readonly float _factorX; - private readonly float _factorY; - - #region OutlookGrid constructor - - /// - /// 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(null); - _internalRows = new(); - _internalColumns = new(); - _fillMode = FillMode.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(_palette); - - // Create accessor objects for the back, border and content - _paletteBack = new(_paletteRedirect); - _paletteBorder = new(_paletteRedirect); - //_paletteContent = new PaletteContentInheritRedirect(_paletteRedirect); - - AllowUserToOrderColumns = false; //we will handle it ourselves - _hideColumnOnGrouping = false; - _formatConditions = new(); - - 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 - StaticValues.DefaultGroupRowHeight = (int)(StaticValues.DefaultGroupRowHeight * _factorY); - StaticValues._2013GroupRowHeight = (int)(StaticValues._2013GroupRowHeight * _factorY); - StaticValues.DefaultOffsetHeight = (int)(StaticValues.DefaultOffsetHeight * _factorY); - StaticValues._2013OffsetHeight = (int)(StaticValues.DefaultOffsetHeight * _factorY); - StaticValues.ImageOffsetwidth = (int)(StaticValues.ImageOffsetwidth * _factorX); - StaticValues.GroupLevelMultiplier = (int)(StaticValues.GroupLevelMultiplier * _factorX); - StaticValues.GroupImageSide = (int)(StaticValues.GroupImageSide * _factorX); - - //Strings = KryptonOutlookGrid.Strings; - } - - /// - /// Definitvely 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 FillMode FillMode - { - get => _fillMode; - set - { - if (value != _fillMode) - { - _fillMode = value; - Invalidate(); - } - } - } - - #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(new(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(new(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 - // supressed 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 = _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.ToString()}|{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(-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(drgevent.X, drgevent.Y)).X, PointToClient(new(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(drgevent.X, drgevent.Y)).X, PointToClient(new(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(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!! - string? r = drgevent.Data.GetData(typeof(string)) as string; - if (r != null) - { - 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]; - //System.Diagnostics.Debug.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(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); - 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) - { - UnSortColum(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 = StaticValues.DefaultGroupRowHeight; // default height - if (KryptonManager.CurrentGlobalPalette != null && KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2013) - { - h = StaticValues._2013GroupRowHeight; // 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 = _internalColumns.FindFromColumnIndex(_colSelected); - UnSortColum(col); - Fill(); - } - } - - /// - /// Ascending sort for the column selected by the menu - /// - /// - /// - private void OnColumnSortAscending(object sender, EventArgs e) - { - if (_colSelected > -1) - { - OutlookGridColumn col = _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 = _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 = _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 = _internalColumns.FindFromColumnIndex(_colSelected); - UnGroupColumn(col.Name); - ForceRefreshGroupBox(); - Fill(); - } - } - - private void OnGroupCollapse(object sender, EventArgs e) - { - OutlookGridColumn col = _internalColumns.FindFromColumnIndex(_colSelected); - Collapse(col.Name); - } - - private void OnGroupExpand(object sender, EventArgs e) - { - OutlookGridColumn col = _internalColumns.FindFromColumnIndex(_colSelected); - Expand(col.Name); - } - - private void OnSortBySummary(object sender, EventArgs e) - { - - KryptonContextMenuItem item = (KryptonContextMenuItem)sender; - OutlookGridColumn col = _internalColumns.FindFromColumnIndex(_colSelected); - if (col.GroupingType != null) - { - col.GroupingType.SortBySummaryCount = item.Checked; - } - ForceRefreshGroupBox(); - Fill(); - } - - private void OnGroupIntervalClick(object sender, EventArgs e) - { - KryptonContextMenuItem? item = (KryptonContextMenuItem)sender; - OutlookGridColumn col = _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) - { - KryptonContextMenuImageSelect item = (KryptonContextMenuImageSelect)sender; - OutlookGridColumn col = _internalColumns.FindFromColumnIndex(_colSelected); - ConditionalFormatting format = _formatConditions.Where(x => x.ColumnName == col.Name).FirstOrDefault(); - ConditionalFormatting newformat = (((List)item.Tag)!)[item.SelectedIndex]; - if (format == null) - { - _formatConditions.Add(new(col.DataGridViewColumn.Name, newformat.FormatType, newformat.FormatParams)); - } - else - { - format.FormatType = newformat.FormatType; - format.FormatParams = newformat.FormatParams; - } - ((KryptonContextMenuImageSelect)sender).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) - { - CustomFormatRule fm = new(EnumConditionalFormatType.TwoColoursRange); - fm.ShowDialog(); - if (fm.DialogResult == DialogResult.OK) - { - OutlookGridColumn col = _internalColumns.FindFromColumnIndex(_colSelected); - ConditionalFormatting? format = _formatConditions.Where(x => x.ColumnName == col.Name).FirstOrDefault(); - if (format == null) - { - ConditionalFormatting newformat = new(col.DataGridViewColumn.Name, EnumConditionalFormatType.TwoColoursRange, new TwoColoursParams(fm.MinimumColour, fm.MaximumColour)); - _formatConditions.Add(newformat); - } - else - { - format.FormatType = EnumConditionalFormatType.TwoColoursRange; - format.FormatParams = new TwoColoursParams(fm.MinimumColour, fm.MaximumColour); - } - Fill(); - } - fm.Dispose(); - } - - - private void OnThreeColorsCustomClick(object sender, EventArgs e) - { - CustomFormatRule fm = new(EnumConditionalFormatType.ThreeColoursRange); - fm.ShowDialog(); - if (fm.DialogResult == DialogResult.OK) - { - OutlookGridColumn col = _internalColumns.FindFromColumnIndex(_colSelected); - ConditionalFormatting? format = _formatConditions.Where(x => x.ColumnName == col.Name).FirstOrDefault(); - if (format == null) - { - ConditionalFormatting newformat = new(col.DataGridViewColumn.Name, EnumConditionalFormatType.ThreeColoursRange, new ThreeColoursParams(Color.FromArgb(248, 105, 107), Color.FromArgb(255, 235, 132), Color.FromArgb(99, 190, 123))); - _formatConditions.Add(newformat); - } - else - { - format.FormatType = EnumConditionalFormatType.ThreeColoursRange; - format.FormatParams = new ThreeColoursParams(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) - { - CustomFormatRule fm = new(EnumConditionalFormatType.Bar); - fm.ShowDialog(); - if (fm.DialogResult == DialogResult.OK) - { - OutlookGridColumn col = _internalColumns.FindFromColumnIndex(_colSelected); - ConditionalFormatting? format = _formatConditions.Where(x => x.ColumnName == col.Name).FirstOrDefault(); - if (format == null) - { - ConditionalFormatting newformat = new(col.DataGridViewColumn.Name, EnumConditionalFormatType.Bar, new BarParams(fm.MinimumColour, fm.Gradient)); - _formatConditions.Add(newformat); - } - else - { - format.FormatType = EnumConditionalFormatType.Bar; - format.FormatParams = new BarParams(fm.MinimumColour, fm.Gradient); - } - Fill(); - } - fm.Dispose(); - } - - private void OnClearConditionalClick(object sender, EventArgs e) - { - OutlookGridColumn col = _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) - { - KryptonContextMenuCheckBox item = (KryptonContextMenuCheckBox)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 (DEBUG) - Console.WriteLine("OutlookGrid - Receives ColumnSortChangedEvent : " + e.Column.Name + " " + e.Column.SortDirection.ToString()); -#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 = _internalColumns.FindFromColumnName(e.Column.Name); - ((OutlookGridDateTimeGroup)col.GroupingType).Interval = ((OutlookGridDateTimeGroup)e.Column.GroupingType).Interval; - Fill(); -#if (DEBUG) - Console.WriteLine("OutlookGrid - Receives GroupIntervalClickEvent"); -#endif - } - - private void SortBySummaryCountEvent(object sender, OutlookGridColumnEventArgs e) - { - OutlookGridColumn col = _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(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(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 UnSortColum(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(KryptonOutlookGridLanguageManager.GeneralStrings.SortAscending, Resources.OutlookGridImageResources.sort_az_ascending2, OnColumnSortAscending); - _menuSortDescending = new(KryptonOutlookGridLanguageManager.GeneralStrings.SortDescending, Resources.OutlookGridImageResources.sort_az_descending2, OnColumnSortDescending); - _menuClearSorting = new(KryptonOutlookGridLanguageManager.GeneralStrings.ClearSorting, Resources.OutlookGridImageResources.sort_up_down_delete_16, OnColumnClearSorting); - _menuSeparator1 = new(); - _menuExpand = new(KryptonOutlookGridLanguageManager.GeneralStrings.Expand, Resources.OutlookGridImageResources.element_plus_16, OnGroupExpand); - _menuCollapse = new(KryptonOutlookGridLanguageManager.GeneralStrings.Collapse, Resources.OutlookGridImageResources.element_minus_16, OnGroupCollapse); - _menuSeparator4 = new(); - _menuGroupByThisColumn = new(KryptonOutlookGridLanguageManager.GeneralStrings.Group, Resources.OutlookGridImageResources.element, OnGroupByThisColumn); - _menuUngroupByThisColumn = new(KryptonOutlookGridLanguageManager.GeneralStrings.UnGroup, Resources.OutlookGridImageResources.element_delete, OnUnGroupByThisColumn); - _menuShowGroupBox = new(KryptonOutlookGridLanguageManager.GeneralStrings.ShowGroupBox, null, OnShowGroupBox); - _menuHideGroupBox = new(KryptonOutlookGridLanguageManager.GeneralStrings.HideGroupBox, null, OnHideGroupBox); - _menuSeparator2 = new(); - _menuBestFitColumn = new(KryptonOutlookGridLanguageManager.GeneralStrings.BestFit, null, OnBestFitColumn); - _menuBestFitAllColumns = new(KryptonOutlookGridLanguageManager.GeneralStrings.BestFitAll, Resources.OutlookGridImageResources.fit_to_size, OnBestFitAllColumns); - _menuSeparator3 = new(); - _menuVisibleColumns = new(KryptonOutlookGridLanguageManager.GeneralStrings.Columns, Resources.OutlookGridImageResources.table2_selection_column, null); - _menuGroupInterval = new(KryptonOutlookGridLanguageManager.GeneralStrings.GroupInterval); - _menuSortBySummary = new(KryptonOutlookGridLanguageManager.GeneralStrings.SortBySummaryCount, null, OnSortBySummary); - _menuSortBySummary.CheckOnClick = true; - _menuSeparator5 = new(); - _menuConditionalFormatting = new(KryptonOutlookGridLanguageManager.GeneralStrings.ConditionalFormatting, Resources.OutlookGridImageResources.table_conditional_16, null); - - #endregion - - //Group Interval - KryptonContextMenuItems groupIntervalItems; - KryptonContextMenuItem? it = null; - string[] names = Enum.GetNames(typeof(DateInterval)); - KryptonContextMenuItemBase[] arrayOptions = new KryptonContextMenuItemBase[names.Length]; - for (int i = 0; i < names.Length; i++) - { - it = new(LanguageManager.Instance.GetString(names[i])); - it.Tag = names[i]; - it.Click += OnGroupIntervalClick; - arrayOptions[i] = it; - } - groupIntervalItems = new(arrayOptions); - _menuGroupInterval.Items.Add(groupIntervalItems); - - //Visible Columns - KryptonContextMenuCheckBox? itCheckbox = null; - KryptonContextMenuItemBase?[] arrayCols = new KryptonContextMenuItemBase?[Columns.Count]; - for (int i = 0; i < Columns.Count; i++) - { - itCheckbox = new(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(32, 32); - List tmpTag = new(); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.Databar_solid_blue_32); - tmpTag.Add(new(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(76, 118, 255), false))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.Databar_solid_green_32); - tmpTag.Add(new(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(95, 173, 123), false))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.Databar_solid_red_32); - tmpTag.Add(new(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(248, 108, 103), false))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.Databar_solid_yellow_32); - tmpTag.Add(new(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(255, 185, 56), false))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.Databar_solid_violet_32); - tmpTag.Add(new(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(185, 56, 255), false))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.Databar_solid_pink_32); - tmpTag.Add(new(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(255, 56, 185), false))); - - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.Databar_gradient_blue_32); - tmpTag.Add(new(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(76, 118, 255), true))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.Databar_gradient_green_32); - tmpTag.Add(new(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(95, 173, 123), true))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.Databar_gradient_red_32); - tmpTag.Add(new(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(248, 108, 103), true))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.Databar_gradient_yellow_32); - tmpTag.Add(new(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(255, 185, 56), true))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.Databar_gradient_violet_32); - tmpTag.Add(new(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(185, 56, 255), true))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.Databar_gradient_pink_32); - tmpTag.Add(new(EnumConditionalFormatType.Bar, new BarParams(Color.FromArgb(255, 56, 185), true))); - - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.TwoColors_white_blue_32); - tmpTag.Add(new(EnumConditionalFormatType.TwoColoursRange, new TwoColoursParams(Color.White, Color.FromArgb(76, 118, 255)))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.TwoColors_blue_white_32); - tmpTag.Add(new(EnumConditionalFormatType.TwoColoursRange, new TwoColoursParams(Color.FromArgb(76, 118, 255), Color.White))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.TwoColors_white_green_32); - tmpTag.Add(new(EnumConditionalFormatType.TwoColoursRange, new TwoColoursParams(Color.White, Color.FromArgb(95, 173, 123)))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.TwoColors_green_white_32); - tmpTag.Add(new(EnumConditionalFormatType.TwoColoursRange, new TwoColoursParams(Color.FromArgb(95, 173, 123), Color.White))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.TwoColors_white_red_32); - tmpTag.Add(new(EnumConditionalFormatType.TwoColoursRange, new TwoColoursParams(Color.White, Color.FromArgb(248, 108, 103)))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.TwoColors_red_white_32); - tmpTag.Add(new(EnumConditionalFormatType.TwoColoursRange, new TwoColoursParams(Color.FromArgb(248, 108, 103), Color.White))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.TwoColors_white_yellow_32); - tmpTag.Add(new(EnumConditionalFormatType.TwoColoursRange, new TwoColoursParams(Color.White, Color.FromArgb(255, 185, 56)))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.TwoColors_yellow_white_32); - tmpTag.Add(new(EnumConditionalFormatType.TwoColoursRange, new TwoColoursParams(Color.FromArgb(255, 185, 56), Color.White))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.TwoColors_white_violet_32); - tmpTag.Add(new(EnumConditionalFormatType.TwoColoursRange, new TwoColoursParams(Color.White, Color.FromArgb(185, 56, 255)))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.TwoColors_violet_white_32); - tmpTag.Add(new(EnumConditionalFormatType.TwoColoursRange, new TwoColoursParams(Color.FromArgb(185, 56, 255), Color.White))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.TwoColors_white_pink_32); - tmpTag.Add(new(EnumConditionalFormatType.TwoColoursRange, new TwoColoursParams(Color.White, Color.FromArgb(255, 56, 185)))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.TwoColors_pink_white_32); - tmpTag.Add(new(EnumConditionalFormatType.TwoColoursRange, new TwoColoursParams(Color.FromArgb(255, 56, 185), Color.White))); - - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.ThreeColors_green_yellow_red_32); - tmpTag.Add(new(EnumConditionalFormatType.ThreeColoursRange, new ThreeColoursParams(Color.FromArgb(84, 179, 112), Color.FromArgb(252, 229, 130), Color.FromArgb(243, 120, 97)))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.ThreeColors_red_yellow_green_32); - tmpTag.Add(new(EnumConditionalFormatType.ThreeColoursRange, new ThreeColoursParams(Color.FromArgb(243, 120, 97), Color.FromArgb(252, 229, 130), Color.FromArgb(84, 179, 112)))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.ThreeColors_green_white_red_32); - tmpTag.Add(new(EnumConditionalFormatType.ThreeColoursRange, new ThreeColoursParams(Color.FromArgb(84, 179, 112), Color.White, Color.FromArgb(243, 120, 97)))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.ThreeColors_red_white_green_32); - tmpTag.Add(new(EnumConditionalFormatType.ThreeColoursRange, new ThreeColoursParams(Color.FromArgb(243, 120, 97), Color.White, Color.FromArgb(84, 179, 112)))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.ThreeColors_blue_white_red_32); - tmpTag.Add(new(EnumConditionalFormatType.ThreeColoursRange, new ThreeColoursParams(Color.FromArgb(134, 166, 253), Color.White, Color.FromArgb(243, 120, 97)))); - imgListFormatting.Images.Add(Resources.OutlookGridImageResources.ThreeColors_red_white_blue_32); - tmpTag.Add(new(EnumConditionalFormatType.ThreeColoursRange, new ThreeColoursParams(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(LanguageManager.Instance.GetString(names[i])); - it.Tag = names[i]; - - if (names[i] == EnumConditionalFormatType.Bar.ToString()) - { - it.Image = Resources.OutlookGridImageResources.databar_generic_16; - - //Solid - KryptonContextMenuHeading kFormattingBarHeadingSolid = new(); - kFormattingBarHeadingSolid.Text = KryptonOutlookGridLanguageManager.GeneralStrings.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 = KryptonOutlookGridLanguageManager.GeneralStrings.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 = KryptonOutlookGridLanguageManager.GeneralStrings.Other; - KryptonContextMenuItem? it2 = null; - it2 = new(KryptonOutlookGridLanguageManager.GeneralStrings.CustomThreeDots); - it2.Tag = ""; - it2.Image = Resources.OutlookGridImageResources.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.TwoColoursRange.ToString()) - { - it.Image = Resources.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 = null; - it2 = new(KryptonOutlookGridLanguageManager.GeneralStrings.CustomThreeDots); - it2.Tag = ""; - it2.Image = Resources.OutlookGridImageResources.paint_bucket_green; - it2.Click += OnTwoColorsCustomClick; - - twoColors = new(new KryptonContextMenuItemBase[] { sep1, it2 }); - it.Items.Add(twoColors); - } - else if (names[i] == EnumConditionalFormatType.ThreeColoursRange.ToString()) - { - it.Image = Resources.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 = null; - it2 = new(KryptonOutlookGridLanguageManager.GeneralStrings.CustomThreeDots); - it2.Tag = ""; - it2.Image = Resources.OutlookGridImageResources.paint_bucket_green; - it2.Click += OnThreeColorsCustomClick; - - threeColors = new(new KryptonContextMenuItemBase[] { sep1, it2 }); - it.Items.Add(threeColors); - } - - arrayOptions[i] = it; - KryptonContextMenuSeparator sep2 = new(); - sep2.Tag = ""; - arrayOptions[i + 1] = sep2; - KryptonContextMenuItem? it3 = null; - it3 = new(KryptonOutlookGridLanguageManager.GeneralStrings.ClearRules); - it3.Image = Resources.OutlookGridImageResources.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(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 - if (_contextMenu == null) - { - _contextMenu = new(); - } - - // 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), ((OutlookGridDateTimeGroup)col.GroupingType).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.Where(x => x.ColumnName == col.Name).FirstOrDefault(); - - for (int i = 0; i < _menuConditionalFormatting.Items[0].ItemChildCount; i++) - { - if (format != null && ((KryptonContextMenuItems)_menuConditionalFormatting.Items[0]).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 (int 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 (int 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 (int 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 (int i = 0; i < list.Count; i++) - { - for (int 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 = (IFormatParams)_formatConditions[j].FormatParams.Clone() - }; - - switch (_formatConditions[j].FormatType) - { - case EnumConditionalFormatType.Bar: - if (typeColumn == typeof(TimeSpan)) - { - ((BarParams)fCell.FormatParams).ProportionValue = ColourFormatting.ConvertBar(((TimeSpan)list[i].Cells[formatColumn].Value).TotalMinutes, _formatConditions[j].MinValue, _formatConditions[j].MaxValue); - } - else if (typeColumn == typeof(Decimal)) - { - ((BarParams)fCell.FormatParams).ProportionValue = ColourFormatting.ConvertBar(Convert.ToDouble(list[i].Cells[formatColumn].Value), _formatConditions[j].MinValue, _formatConditions[j].MaxValue); - } - else - { - ((BarParams)fCell.FormatParams).ProportionValue = ColourFormatting.ConvertBar((double)list[i].Cells[formatColumn].Value, _formatConditions[j].MinValue, _formatConditions[j].MaxValue); - } - break; - case EnumConditionalFormatType.TwoColoursRange: - if (typeColumn == typeof(TimeSpan)) - { - ((TwoColoursParams)fCell.FormatParams).ValueColour = ColourFormatting.ConvertTwoRange(((TimeSpan)list[i].Cells[formatColumn].Value).TotalMinutes, _formatConditions[j].MinValue, _formatConditions[j].MaxValue, (TwoColoursParams)_formatConditions[j].FormatParams); - } - else if (typeColumn == typeof(Decimal)) - { - ((TwoColoursParams)fCell.FormatParams).ValueColour = ColourFormatting.ConvertTwoRange(Convert.ToDouble(list[i].Cells[formatColumn].Value), _formatConditions[j].MinValue, _formatConditions[j].MaxValue, (TwoColoursParams)_formatConditions[j].FormatParams); - } - else - { - ((TwoColoursParams)fCell.FormatParams).ValueColour = - ColourFormatting.ConvertTwoRange( - Convert.ToDouble(list[i].Cells[formatColumn].Value), _formatConditions[j].MinValue, _formatConditions[j].MaxValue, (TwoColoursParams)_formatConditions[j].FormatParams); - } - //list[i].Cells[formatColumn].Style.SelectionBackColor = list[i].Cells[formatColumn].Style.BackColor; - break; - case EnumConditionalFormatType.ThreeColoursRange: - if (typeColumn == typeof(TimeSpan)) - { - ((ThreeColoursParams)fCell.FormatParams).ValueColour = ColourFormatting.ConvertThreeRange(((TimeSpan)list[i].Cells[formatColumn].Value).TotalMinutes, _formatConditions[j].MinValue, _formatConditions[j].MaxValue, (ThreeColoursParams)_formatConditions[j].FormatParams); - } - else if (typeColumn == typeof(Decimal)) - { - ((ThreeColoursParams)fCell.FormatParams).ValueColour = ColourFormatting.ConvertThreeRange(Convert.ToDouble(list[i].Cells[formatColumn].Value), _formatConditions[j].MinValue, _formatConditions[j].MaxValue, (ThreeColoursParams)_formatConditions[j].FormatParams); - } - else - { - ((ThreeColoursParams)fCell.FormatParams).ValueColour = ColourFormatting.ConvertThreeRange(Convert.ToDouble(list[i].Cells[formatColumn].Value), _formatConditions[j].MinValue, _formatConditions[j].MaxValue, (ThreeColoursParams)_formatConditions[j].FormatParams); - } - //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 == FillMode.GroupsOnly) - { - if (list != null) - { - Rows.AddRange(list.ToArray()); - } - } - else - { - tmp = new(); - 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 = ((TextAndImage)value).Image; - } - else if (value is Token) - { - Bitmap bmp = new(13, 13); - using (Graphics gfx = Graphics.FromImage(bmp)) - { - using (SolidBrush brush = new(((Token)value).BackColour)) - { - 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(); - //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()); - } - 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 grRow; - IOutlookGridGroup? gr; - - //for each group - for (int i = 0; i < l.List.Count; i++) - { - gr = l.List[i]; - - //Create the group row - grRow = ((OutlookGridRow)RowTemplate.Clone()); - grRow.Group = gr; - grRow.IsGroupRow = true; - if (gr != null) - { - grRow.Height = gr.Height; - grRow.MinimumHeight = grRow.Height; //To handle auto resize rows correctly on high dpi - grRow.CreateCells(this, gr.Value); - tmp.Add(grRow); - - //Recusive call - if (gr.Children.Count > 0) - { - RecursiveFillOutlookGridRows(gr.Children, tmp); - } - - //We add the rows associated with the current group - if (_fillMode == FillMode.GroupsOnly) - { - tmp.AddRange(gr.Rows); - } - else - { - NonGroupedRecursiveFillOutlookGridRows(gr.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 = null; - using (XmlWriter writer = XmlWriter.Create(path, new() { 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 Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridAlphabeticGroup.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridAlphabeticGroup.cs deleted file mode 100644 index 33a4c92a1..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridAlphabeticGroup.cs +++ /dev/null @@ -1,126 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// This group simple example of an implementation which groups the items into Alphabetic categories - /// based only on the first letter of each item - /// - /// For this we need to override the Value property (used for comparison) - /// and the CompareTo function. - /// Also the Clone method must be overriden, so this Group object can create clones of itself. - /// Cloning of the group is used by the OutlookGrid - /// - public sealed class OutlookGridAlphabeticGroup : OutlookGridDefaultGroup - { - /// - /// Initializes a new instance of the class. - /// - public OutlookGridAlphabeticGroup() - : base() - { - AllowHiddenWhenGrouped = false; - } - - /// - /// Constructor. - /// - /// The parentGroup if any. - public OutlookGridAlphabeticGroup(IOutlookGridGroup? parentGroup) - : base(parentGroup) - { - AllowHiddenWhenGrouped = false; - } - - /// - /// Gets or sets the displayed text. - /// - public override string Text => $"{Column.DataGridViewColumn.HeaderText}: {Value} ({(ItemCount == 1 ? OneItemText : ItemCount + XxxItemsText)})"; - - /// - /// Gets or sets the Alphabetic value - /// - public override object? Value - { - get => base.Value; - set - { - //Note : value with Clone() is already 1 character, but no problem here - if (value != null && !string.IsNullOrEmpty(value.ToString())) //useful for text and image object - { - base.Value = value.ToString().Substring(0, 1).ToUpper(); - } - else - { - base.Value = string.Empty; - } - } - } - - #region ICloneable Members - - /// - /// Overrides the Clone() function - /// - /// OutlookGridAlphabeticGroup - public override object Clone() - { - OutlookGridAlphabeticGroup gr = new(ParentGroup) - { - Column = Column, - Value = Value, - Collapsed = Collapsed, - Height = Height, - GroupImage = GroupImage, - FormatStyle = FormatStyle, - XxxItemsText = XxxItemsText, - OneItemText = OneItemText, - AllowHiddenWhenGrouped = AllowHiddenWhenGrouped, - SortBySummaryCount = SortBySummaryCount - }; - - return gr; - } - - #endregion - - #region IComparable Members - /// - /// overide the CompareTo, so only the first character is compared, instead of the whole string - /// this will result in classifying each item into a letter of the Alphabet. - /// for instance, this is usefull when grouping names, they will be categorized under the letters A, B, C etc.. - /// - /// - /// - public override int CompareTo(object obj) - { - int orderModifier = Column.SortDirection == SortOrder.Ascending ? 1 : -1; - - if (obj is OutlookGridAlphabeticGroup) - { - return string.Compare(Value.ToString(), ((OutlookGridAlphabeticGroup)obj).Value.ToString()) * orderModifier; - } - else - { - return 0; - } - } - #endregion IComparable Members - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridColumn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridColumn.cs deleted file mode 100644 index d3a9b908e..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridColumn.cs +++ /dev/null @@ -1,145 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Column for the OutlookGrid - /// - public class OutlookGridColumn : IEquatable - { - #region Constructor - /// - /// Constructor - /// - /// 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 OutlookGridColumn(DataGridViewColumn col, IOutlookGridGroup group, SortOrder sortDirection, int groupIndex, int sortIndex, IComparer comparer) - { - DataGridViewColumn = col; - Name = col.Name; - GroupingType = group; - SortDirection = sortDirection; - GroupIndex = groupIndex; - SortIndex = sortIndex; - RowsComparer = comparer; - } - - /// - /// Constructor - /// - /// The name. - /// 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 OutlookGridColumn(string columnName, DataGridViewColumn col, IOutlookGridGroup group, SortOrder sortDirection, int groupIndex, int sortIndex, IComparer comparer) - { - DataGridViewColumn = col; - Name = columnName; - GroupingType = group; - SortDirection = sortDirection; - GroupIndex = groupIndex; - SortIndex = sortIndex; - RowsComparer = comparer; - } - - /// - /// Constructor - /// - /// The name. - /// 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 OutlookGridColumn(string columnName, DataGridViewColumn col, IOutlookGridGroup group, SortOrder sortDirection, int groupIndex, int sortIndex) - { - DataGridViewColumn = col; - Name = columnName; - GroupingType = group; - SortDirection = sortDirection; - GroupIndex = groupIndex; - SortIndex = sortIndex; - } - #endregion - - #region Properties - /// - /// Gets or sets the column name - /// - public string Name { get; set; } - - /// - /// Gets or sets if the column is grouped - /// - public bool IsGrouped => GroupIndex > -1; - - /// - /// Gets or sets the sort direction - /// - public SortOrder SortDirection { get; set; } - - /// - /// Gets or sets the associated DataGridViewColumn - /// - public DataGridViewColumn DataGridViewColumn { get; set; } - - /// - /// Gets or sets the group - /// - public IOutlookGridGroup? GroupingType { get; set; } - - /// - /// Gets or sets the column's position in grouping and at which level - /// - public int GroupIndex { get; set; } - - /// - /// Gets or sets the column's position among sorted columns - /// - public int SortIndex { get; set; } - - /// - /// Gets or sets the custom row comparer, if needed. - /// - public IComparer RowsComparer { get; set; } - - #endregion - - #region Implements - - /// - /// Defines Equals methode (interface IEquatable) - /// - /// The OutlookGridColumn to compare with - /// - public bool Equals(OutlookGridColumn other) - { - return DataGridViewColumn.Name.Equals(other.DataGridViewColumn.Name); - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridColumnCollection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridColumnCollection.cs deleted file mode 100644 index bfa4c98d0..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridColumnCollection.cs +++ /dev/null @@ -1,238 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// List of the current columns of the OutlookGrid - /// - public class OutlookGridColumnCollection : List - { - private int _maxGroupIndex, _maxSortIndex; - - /// - /// Constructor - /// - public OutlookGridColumnCollection() - : base() - { - _maxGroupIndex = -1; - _maxSortIndex = -1; - } - - /// - /// Gets the OutlookGridColumn in the list by its name - /// - /// The column name. - /// OutlookGridColumn - public OutlookGridColumn this[string columnName] => Find(c => c.DataGridViewColumn.Name.Equals(columnName)); - - /// - /// Add an OutlookGridColumn to the collection. - /// - /// The OutlookGridColumn to add. - public new void Add(OutlookGridColumn item) - { - base.Add(item); - - if (item.GroupIndex > -1) - { - _maxGroupIndex++; - } - - if (item.SortIndex > -1) - { - _maxSortIndex++; - } - } - - /// - /// Gets or Sets the maximum GroupIndex in the collection - /// - public int MaxGroupIndex { get => _maxGroupIndex; set => _maxGroupIndex = value; } - - /// - /// Gets or sets the maximum SortIndex in the collection - /// - public int MaxSortIndex { get => _maxSortIndex; set => _maxSortIndex = value; } - - /// - /// Gets the number of columns grouped - /// - /// the number of columns grouped. - public int CountGrouped() => this.Count(c => c.IsGrouped == true); - - /// - /// Gets the list of grouped columns - /// - /// The list of grouped columns. - public List? FindGroupedColumns() => this.Where(c => c.IsGrouped).OrderBy(c => c.GroupIndex).ToList(); - - /// - /// Gets a list of columns which are sorted and not grouped. - /// - /// List of Column indexes and SortDirection ordered by SortIndex. - public List> GetIndexAndSortGroupedColumns() - { - List> res = new(); - var tmp = this.OrderBy(x => x.GroupIndex); - foreach (OutlookGridColumn col in tmp) - { - if (col.IsGrouped && col.GroupIndex > -1) - { - res.Add(Tuple.Create(col.DataGridViewColumn.Index, col.SortDirection, col.RowsComparer)); - } - } - return res; - } - - /// - /// Gets the column from its real index (from the underlying DataGridViewColumn) - /// - /// The index - /// The OutlookGridColumn. - public OutlookGridColumn FindFromColumnIndex(int index) => this.FirstOrDefault(c => c.DataGridViewColumn.Index == index); - - /// - /// Gets the column from its name - /// - /// The name of the column. - /// The associated OutlookGridColumn. - public OutlookGridColumn FindFromColumnName(string name) => this.FirstOrDefault(x => x.Name == name); - - /// - /// Gets a list of columns which are sorted and not grouped. - /// - /// List of Column indexes and SortDirection ordered by SortIndex. - public List> GetIndexAndSortSortedOnlyColumns() - { - var res = new List>(); - var tmp = this.OrderBy(x => x.SortIndex); - foreach (OutlookGridColumn col in tmp) - { - if (!col.IsGrouped && col.SortIndex > -1) - { - res.Add(Tuple.Create(col.DataGridViewColumn.Index, col.SortDirection, col.RowsComparer)); - } - } - return res; - } - - /// - /// Removes a groupIndex and update the GroupIndex for all columns - /// - /// The OutlookGridColumn that will be removed. - internal void RemoveGroupIndex(OutlookGridColumn col) - { - int removed = col.GroupIndex; - - // TODO: Turn this into a foreach loop - for (int i = 0; i < Count; i++) - { - if (this[i].GroupIndex > removed) - { - this[i].GroupIndex--; - } - } - _maxGroupIndex--; - col.GroupIndex = -1; - } - - /// - /// Removes a SortIndex and update the SortIndex for all columns - /// - /// The OutlookGridColumn that will be removed. - internal void RemoveSortIndex(OutlookGridColumn col) - { - int removed = col.SortIndex; - - // TODO: Turn this into a foreach loop - for (int i = 0; i < Count; i++) - { - if (this[i].SortIndex > removed) - { - this[i].SortIndex--; - } - } - _maxSortIndex--; - col.SortIndex = -1; - } - - internal void ChangeGroupIndex(OutlookGridColumn outlookGridColumn) - { - int currentGroupIndex = -1; - int newGroupIndex = outlookGridColumn.GroupIndex; - - // TODO: Turn this into a foreach loop - for (int i = 0; i < Count; i++) - { - if (this[i].Name == outlookGridColumn.Name) - { - currentGroupIndex = this[i].GroupIndex; - } - } - - if (currentGroupIndex == -1) - { - throw new("OutlookGrid : Unable to interpret the change of GroupIndex!"); - } - -#if (DEBUG) - Console.WriteLine("currentGroupIndex=" + currentGroupIndex.ToString()); - Console.WriteLine("newGroupIndex=" + newGroupIndex.ToString()); - Console.WriteLine("Before"); - DebugOutput(); -#endif - - for (int i = 0; i < Count; i++) - { - if (this[i].IsGrouped) - { - if (this[i].GroupIndex == currentGroupIndex) - { - this[i].GroupIndex = newGroupIndex; - } - else if (this[i].GroupIndex >= newGroupIndex && this[i].GroupIndex < currentGroupIndex) - { - this[i].GroupIndex++; - } - else if (this[i].GroupIndex <= newGroupIndex && this[i].GroupIndex > currentGroupIndex) - { - this[i].GroupIndex--; - } - } - } -#if (DEBUG) - Console.WriteLine("After"); - DebugOutput(); -#endif - } - - /// - /// Outputs Debug information to the console. - /// - public void DebugOutput() - { - for (int i = 0; i < Count; i++) - { - Console.WriteLine($"{this[i].Name} , GroupIndex={this[i].GroupIndex}, SortIndex={this[i].SortIndex}"); - } - Console.WriteLine($"MaxGroupIndex={_maxGroupIndex}, MaxSortIndex={_maxSortIndex}"); - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridDateTimeGroup.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridDateTimeGroup.cs deleted file mode 100644 index 57820eb91..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridDateTimeGroup.cs +++ /dev/null @@ -1,256 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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 - -// ReSharper disable VirtualMemberCallInConstructor -namespace Krypton.Toolkit.Suite.Extended.Outlook.Grid -{ - /// this group simple example of an implementation which groups the items into day categories - /// based on, today, yesterday, last week etc - /// - /// for this we need to override the Value property (used for comparison) - /// and the CompareTo function. - /// Also the Clone method must be overriden, so this Group object can create clones of itself. - /// Cloning of the group is used by the OutlookGrid - /// - public class OutlookGridDateTimeGroup : OutlookGridDefaultGroup - { - private readonly TextInfo _ti = CultureInfo.CurrentCulture.TextInfo; - - /// - /// The Date Interval of OutlookGridDateTimeGroup - /// - public DateInterval Interval { get; set; } - - /// - /// Initializes a new instance of the class. - /// - public OutlookGridDateTimeGroup() - : base() - { - AllowHiddenWhenGrouped = true; - Interval = DateInterval.Smart; - } - - /// - /// Constructor - /// - /// The parentGroup if any. - public OutlookGridDateTimeGroup(IOutlookGridGroup? parentGroup) - : base(parentGroup) - { - AllowHiddenWhenGrouped = true; - Interval = DateInterval.Smart; - } - - /// - ///Gets or sets the displayed text. - /// - public override string Text => $"{Column.DataGridViewColumn.HeaderText}: {Value} ({(ItemCount == 1 ? OneItemText : ItemCount + XxxItemsText)})"; - - private DateTime _valDateTime; - - /// - /// Gets or sets the Date value - /// - public override object? Value - { - get => base.Value; - - set - { - switch (Interval) - { - case DateInterval.Smart: - //If no date Time let the valDateTime to the min value ! - if (value != null && value != DBNull.Value) - { - _valDateTime = DateTime.Parse(value.ToString()); - } - else - { - _valDateTime = DateTime.MinValue; - } - - base.Value = OutlookGridGroupHelpers.GetDayText(_valDateTime); - break; - case DateInterval.Year: - //If no date Time let the valDateTime to the min value ! - if (value != null && value != DBNull.Value) - { - _valDateTime = DateTime.Parse(value.ToString()); - base.Value = _valDateTime.Year; - } - else - { - _valDateTime = DateTime.MinValue; - base.Value = KryptonOutlookGridLanguageManager.GeneralStrings.NoDate; - } - break; - case DateInterval.Month: - //If no date Time let the valDateTime to the min value ! - if (value != null && value != DBNull.Value) - { - _valDateTime = DateTime.Parse(value.ToString()); - base.Value = $"{_ti.ToTitleCase(_valDateTime.ToString("MMMM"))} {_valDateTime.Year}"; - } - else - { - _valDateTime = DateTime.MinValue; - base.Value = KryptonOutlookGridLanguageManager.GeneralStrings.NoDate; - } - break; - case DateInterval.Day: - if (value != null && value != DBNull.Value) - { - _valDateTime = DateTime.Parse(value.ToString()); - base.Value = _valDateTime.Date.ToShortDateString(); - } - else - { - _valDateTime = DateTime.MinValue; - base.Value = KryptonOutlookGridLanguageManager.GeneralStrings.NoDate; - } - break; - case DateInterval.Quarter: - if (value != null && value != DBNull.Value) - { - _valDateTime = DateTime.Parse(value.ToString()); - base.Value = - $"{OutlookGridGroupHelpers.GetQuarterAsString(_valDateTime)} {_valDateTime.Year}"; - } - else - { - _valDateTime = DateTime.MinValue; - base.Value = KryptonOutlookGridLanguageManager.GeneralStrings.NoDate; - } - break; - default: - throw new("Unknown Interval !"); - - } - - } - } - - #region ICloneable Members - - /// - /// Overrides the Clone() function - /// - /// OutlookGridDateTimeGroup - public override object Clone() - { - OutlookGridDateTimeGroup gr = new(ParentGroup); - gr.Column = Column; - gr.Value = _valDateTime; //thx Resharper ! - gr.Collapsed = Collapsed; - gr.Height = Height; - gr.GroupImage = GroupImage; - gr.FormatStyle = FormatStyle; - gr.XxxItemsText = XxxItemsText; - gr.OneItemText = OneItemText; - gr.AllowHiddenWhenGrouped = AllowHiddenWhenGrouped; - gr.SortBySummaryCount = SortBySummaryCount; - gr.Interval = Interval; - - return gr; - } - - #endregion - - #region IComparable Members - - /// - /// Overrides CompareTo - /// - /// - /// - public override int CompareTo(object obj) - { - int orderModifier = Column.SortDirection == SortOrder.Ascending ? 1 : -1; - DateTime val; - if (obj is DateTime) - { - //TODO necessary ??? - val = DateTime.Parse(obj.ToString()); - } - else if (obj is OutlookGridDateTimeGroup) - { - val = ((OutlookGridDateTimeGroup)obj)._valDateTime; - } - else - { - val = new(); - } - - switch (Interval) - { - case DateInterval.Smart: - //if (OutlookGridGroupHelpers.GetDateCode(valDateTime.Date) == OutlookGridGroupHelpers.GetDateCode(val.Date)) - //{ - // return 0; - //} - //else - //{ - // return DateTime.Compare(valDateTime.Date, val.Date) * orderModifier; - //} - return OutlookGridGroupHelpers.GetDateCodeNumeric(_valDateTime).CompareTo(OutlookGridGroupHelpers.GetDateCodeNumeric(val)) * orderModifier; - case DateInterval.Year: - if (_valDateTime.Year == val.Year) - { - return 0; - } - else - { - return _valDateTime.Year.CompareTo(val.Year) * orderModifier; - } - case DateInterval.Month: - if (_valDateTime.Month == val.Month && _valDateTime.Year == val.Year) - { - return 0; - } - else - { - return _valDateTime.Date.CompareTo(val.Date) * orderModifier; - } - case DateInterval.Day: - if (_valDateTime.Date == val.Date) - { - return 0; - } - else - { - return _valDateTime.Date.CompareTo(val.Date) * orderModifier; - } - case DateInterval.Quarter: - if (OutlookGridGroupHelpers.GetQuarter(_valDateTime) == OutlookGridGroupHelpers.GetQuarter(val) && _valDateTime.Year == val.Year) - { - return 0; - } - else - { - return _valDateTime.Date.CompareTo(val.Date) * orderModifier; - } - default: - throw new("Unknown Interval !"); - - } - } - #endregion IComparable Members - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridDefaultGroup.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridDefaultGroup.cs deleted file mode 100644 index 615f76c44..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridDefaultGroup.cs +++ /dev/null @@ -1,417 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Each arrange/grouping class must implement the IOutlookGridGroup interface - /// the Group object will determine for each object in the grid, whether it - /// falls in or outside its group. - /// It uses the IComparable.CompareTo function to determine if the item is in the group. - /// This class group the elements by default (string, int, ...) - /// - public class OutlookGridDefaultGroup : IOutlookGridGroup - { - #region "Variables" - /// - /// The Value of the group - /// - private object? _val; - /// - /// Boolean if the group is collapsed or not - /// - private bool _collapsed; - /// - /// The associated DataGridView column. - /// - private OutlookGridColumn _column; - /// - /// The number of items in this group. - /// - private int _itemCount; - /// - /// The height (in pixels). - /// - private int _height; - - /// - /// The string to format the value of the group - /// - private string _formatStyle; - /// - /// The picture associated to the group - /// - private Image _groupImage; - /// - /// The text associated for the group text (1 item) - /// - private string _oneItemText; - /// - /// The text associated for the group text (XXX items) - /// - private string _xXxItemsText; - /// - /// Allows the column to be hidden when it is grouped by - /// - private bool _allowHiddenWhenGrouped; - /// - /// Sort groups using count items value - /// - private bool _sortBySummaryCount; - - private IComparer _itemsComparer; - #endregion - - #region "Constructor" - - /// - /// Initializes a new instance of the class. - /// - public OutlookGridDefaultGroup() - { - _val = null; - _column = null; - if (KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2013 || KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderMicrosoft365) - { - _height = StaticValues._2013GroupRowHeight; // special height for office 2013 - } - else - { - _height = StaticValues.DefaultGroupRowHeight; // default height - } - - Rows = new(); - Children = new(); - _formatStyle = ""; - _oneItemText = KryptonOutlookGridLanguageManager.GeneralStrings.OneItem; - _xXxItemsText = KryptonOutlookGridLanguageManager.GeneralStrings.NumberOfItems; - _allowHiddenWhenGrouped = true; - _sortBySummaryCount = false; - } - - /// - /// Constructor - /// - /// The parent group if any. - public OutlookGridDefaultGroup(IOutlookGridGroup? parentGroup) : this() - { - if (parentGroup != null) - { - Children.ParentGroup = parentGroup; - } - } - #endregion - - #region IOutlookGridGroup Members - - /// - /// Gets or sets the list of rows associated to the group. - /// - public List Rows { get; set; } - - /// - /// Gets or sets the parent group. - /// - /// The parent group. - public IOutlookGridGroup? ParentGroup { get; set; } - - /// - /// Gets or sets the level. - /// - /// The level. - public int Level { get; set; } - - /// - /// Gets or sets the children. - /// - /// The children. - public OutlookGridGroupCollection Children { get; set; } - - /// - /// Gets or sets the displayed text - /// - public virtual string Text - { - get - { - string formattedValue = ""; - string res = ""; - //For formatting number we need to cast the object value to the number before applying formatting - if (_val == null || string.IsNullOrEmpty(_val.ToString())) - { - formattedValue = KryptonOutlookGridLanguageManager.GeneralStrings.Unknown; - } - else if (!String.IsNullOrEmpty(_formatStyle)) - { - if (_val is string) - { - formattedValue = string.Format(_formatStyle, Value); - } - else if (_val is DateTime) - { - formattedValue = ((DateTime)Value).ToString(_formatStyle); - } - else if (_val is int) - { - formattedValue = ((int)Value).ToString(_formatStyle); - } - else if (_val is float) - { - formattedValue = ((float)Value).ToString(_formatStyle); - } - else if (_val is double) - { - formattedValue = ((double)Value).ToString(_formatStyle); - } - else if (_val is decimal) - { - formattedValue = ((decimal)Value).ToString(_formatStyle); - } - else if (_val is long) - { - formattedValue = ((long)Value).ToString(_formatStyle); - } - else if (_val is TimeSpan) - { - formattedValue = ((TimeSpan)Value).ToString(_formatStyle); - } - else - { - formattedValue = Value.ToString(); - } - } - else - { - formattedValue = Value.ToString(); - } - - res = - $"{_column.DataGridViewColumn.HeaderText}: {formattedValue} ({(_itemCount == 1 ? _oneItemText : _itemCount + XxxItemsText)})"; - //if (KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2013) - // return res.ToUpper(); - //else - return res; - } - //set - //{ - // text = value; - //} - } - - /// - /// Gets or sets the Value of the group - /// - public virtual object? Value { get => _val; set => _val = value; } - - /// - /// Boolean if the group is collapsed or not - /// - public virtual bool Collapsed { get => _collapsed; set => _collapsed = value; } - - /// - /// Gets or sets the associated DataGridView column. - /// - public virtual OutlookGridColumn Column { get => _column; set => _column = value; } - - /// - /// Gets or set the number of items in this group. - /// - public virtual int ItemCount { get => _itemCount; set => _itemCount = value; } - - /// - /// Gets or sets the height (in pixels). - /// - public virtual int Height { get => _height; set => _height = value; } - - /// - /// Gets or sets the Format Info. - /// - public virtual string FormatStyle { get => _formatStyle; set => _formatStyle = value; } - - /// - /// Gets or sets the picture. - /// - public virtual Image GroupImage - { - get => _groupImage; - set => _groupImage = value; - } - - /// - /// Gets or sets the text associated to One Item - /// - public virtual string OneItemText - { - get => _oneItemText; - set => _oneItemText = value; - } - - /// - /// Gets or sets the text associated to several Items - /// - public virtual string XxxItemsText - { - get => _xXxItemsText; - set => _xXxItemsText = value; - } - - /// - /// Gets or sets the boolean that hides the column automatically when grouped. - /// - public virtual bool AllowHiddenWhenGrouped - { - get => _allowHiddenWhenGrouped; - set => _allowHiddenWhenGrouped = value; - } - - /// - /// Gets or sets the boolean that sort groups using summary value - /// - public virtual bool SortBySummaryCount - { - get => _sortBySummaryCount; - set => _sortBySummaryCount = value; - } - - ///// - ///// Gets or sets the items comparer. - ///// - ///// - ///// The items comparer. - ///// - public virtual IComparer ItemsComparer - { - get => _itemsComparer; - set => _itemsComparer = value; - } - - #endregion - - #region ICloneable Members - - /// - /// Overrides the Clone() function - /// - /// OutlookgGridDefaultGroup - public virtual object Clone() - { - var gr = new OutlookGridDefaultGroup(ParentGroup) - { - _column = _column, - _val = _val, - _collapsed = _collapsed, - _height = _height, - _groupImage = _groupImage, - _formatStyle = _formatStyle, - _xXxItemsText = XxxItemsText, - _oneItemText = OneItemText, - _allowHiddenWhenGrouped = _allowHiddenWhenGrouped, - _sortBySummaryCount = _sortBySummaryCount - }; - - return gr; - } - - #endregion - - #region IComparable Members - - /// - /// This is a comparison operation based on the type of the value. - /// - /// the value in the related column of the item to compare to - /// - public virtual int CompareTo(object obj) - { - int orderModifier = Column.SortDirection == SortOrder.Ascending ? 1 : -1; - int compareResult = 0; - object? o2 = ((OutlookGridDefaultGroup)obj).Value; - - if ((_val == null || _val == DBNull.Value) && o2 != null && o2 != DBNull.Value) - { - compareResult = 1; - } - else if (_val != null && _val != DBNull.Value && (o2 == null || o2 == DBNull.Value)) - { - compareResult = -1; - } - else - { - if (_val is string) - { - compareResult = string.Compare(_val.ToString(), o2.ToString()) * orderModifier; - } - else if (_val is DateTime) - { - compareResult = ((DateTime)_val).CompareTo((DateTime)o2) * orderModifier; - } - else if (_val is int) - { - compareResult = ((int)_val).CompareTo((int)o2) * orderModifier; - } - else if (_val is bool) - { - bool b1 = (bool)_val; - bool b2 = (bool)o2; - compareResult = (b1 == b2 ? 0 : b1 == true ? 1 : -1) * orderModifier; - } - else if (_val is float) - { - float n1 = (float)_val; - float n2 = (float)o2; - compareResult = (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) * orderModifier; - } - else if (_val is double) - { - double n1 = (double)_val; - double n2 = (double)o2; - compareResult = (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) * orderModifier; - } - else if (_val is decimal) - { - decimal n1 = (decimal)_val; - decimal n2 = (decimal)o2; - compareResult = (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) * orderModifier; - } - else if (_val is long) - { - long n1 = (long)_val; - long n2 = (long)o2; - compareResult = (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) * orderModifier; - } - else if (_val is TimeSpan) - { - TimeSpan t1 = (TimeSpan)_val; - TimeSpan t2 = (TimeSpan)o2; - compareResult = (t1 > t2 ? 1 : t1 < t2 ? -1 : 0) * orderModifier; - } - else if (_val is TextAndImage) - { - compareResult = ((TextAndImage)_val).CompareTo((TextAndImage)o2) * orderModifier; - } - //TODO implement a value for Token Column ?? - else if (_val is Token) - { - compareResult = ((Token)_val).CompareTo((Token)o2) * orderModifier; - } - } - return compareResult; - } - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridGroupBoxColumn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridGroupBoxColumn.cs deleted file mode 100644 index a49d648cc..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridGroupBoxColumn.cs +++ /dev/null @@ -1,100 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Column for the OutlookGrid GroupBox - /// - public class OutlookGridGroupBoxColumn : IEquatable - { - #region "Constructor" - /// - /// Constructor - /// - /// The column name. - /// The display text of the column. - /// The column sort order. - /// The name of the used OutlookGridGroup mode. - public OutlookGridGroupBoxColumn(string columnName, string columnText, SortOrder sort, string groupingType) - { - Text = columnText; - ColumnName = columnName; - SortDirection = sort; - GroupingType = groupingType; - } - #endregion - - #region "Properties" - - /// - /// Gets or sets the associated Rectangle that represents the column - /// - public Rectangle Rect { get; set; } - /// - /// Gets or sets the HeaderText of the column. - /// - public string Text { get; set; } - /// - /// Gets or sets the boolean that indicates if the column is in a pressed state. - /// - public bool Pressed { get; set; } - /// - /// Gets or sets the Sort direction of the column. - /// - public SortOrder SortDirection { get; set; } - /// - /// Gets or sets the associated column name - /// - public string ColumnName { get; set; } - /// - /// Gets or sets the boolean that indicates if the column is currently beeing dragged. - /// - public bool IsMoving { get; set; } - /// - /// Gets or sets the boolean that indicates if the column is currently beeing hovered by the mouse. - /// - public bool IsHovered { get; set; } - /// - /// Gets or sets a string that corresponds to the name of the OutlookGridGroup - /// - public string GroupingType { get; set; } - /// - /// Gets or sets the date interval if the grouping type is OutlookDateTimeGroup - /// - public string GroupInterval { get; set; } - /// - /// Gets or sets the boolean that indicates if the column should be grouped by using the count value - /// - public bool SortBySummaryCount { get; set; } - - #endregion - - #region "Implements" - /// - /// Defines Equals method on the columnName - /// - /// The OutlookGridGroupBoxColumn to compare with. - /// True or False. - public bool Equals(OutlookGridGroupBoxColumn other) - { - return ColumnName.Equals(other.ColumnName); - } - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridGroupCollection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridGroupCollection.cs deleted file mode 100644 index 22a61a29b..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridGroupCollection.cs +++ /dev/null @@ -1,141 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// List of IOutlookGridGroups - /// - public class OutlookGridGroupCollection - { - #region "Variables" - private IOutlookGridGroup? _parentGroup; - private List _groupList; - #endregion - - #region "Constructor" - /// - /// Initializes a new instance of the class. - /// - public OutlookGridGroupCollection() - { - _groupList = new(); - } - - /// - /// Initializes a new instance of the class. - /// - /// The parent group, if any. - public OutlookGridGroupCollection(IOutlookGridGroup? parentGroup) - { - _groupList = new(); - _parentGroup = parentGroup; - } - #endregion - - #region Properties - - /// - /// Gets or Sets the parent group - /// - public IOutlookGridGroup? ParentGroup { get => _parentGroup; internal set => _parentGroup = value; } - - /// - /// Gets the list of IOutlookGridGroup. - /// - public List List => _groupList; - - /// - /// Gets the number of groups - /// - public int Count => _groupList.Count; - - #endregion - - #region "Public methods" - - /// - /// Gets the Group object - /// - /// Index in the list of groups. - /// The IOutlookGridGroup. - public IOutlookGridGroup? this[int index] => _groupList[index]; - - /// - /// Adds a new group - /// - /// The IOutlookGridGroup. - public void Add(IOutlookGridGroup? group) - { - _groupList.Add(group); - } - - /// - /// Sorts the groups - /// - public void Sort() - { - _groupList.Sort(); - } - - /// - /// Sorts the groups - /// - internal void Sort(OutlookGridGroupCountComparer? comparer) - { - if (comparer != null) - { - _groupList.Sort(comparer!); - } - } - - /// - /// Find a group by its value - /// - /// The value of the group - /// The IOutlookGridGroup. - public IOutlookGridGroup? FindGroup(object? value) - { - //We must return null if no group exist, then the OutlookGrid will create one. But we must return a group even for a null value. - if (value == null) - { - return _groupList.Find(x => x != null && x.Value == null); - //return null; - } - //return groupList.Find(x => x.Value.Equals(value)); - return _groupList.Find(x => x != null && x.Value != null && x.Value.Equals(value)); - } - - #endregion - - #region "Internals" - - internal void Clear() - { - _parentGroup = null; - //If a group is collapsed the rows will not appear. Then if we clear the group the rows should not remain "collapsed" - for (int i = 0; i < _groupList.Count; i++) - { - _groupList[i]!.Collapsed = false; - } - _groupList.Clear(); - } - - #endregion - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridGroupCountComparer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridGroupCountComparer.cs deleted file mode 100644 index a3d44d3ff..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridGroupCountComparer.cs +++ /dev/null @@ -1,53 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - internal class OutlookGridGroupCountComparer : IComparer - { - public OutlookGridGroupCountComparer() - { - } - - #region IComparer Members - - public int Compare(IOutlookGridGroup x, IOutlookGridGroup y) - { - int compareResult = 0; - try - { - int orderModifier = x.Column.SortDirection == SortOrder.Ascending ? 1 : -1; - - int c1 = x.ItemCount; - int c2 = y.ItemCount; - compareResult = c1.CompareTo(c2) * orderModifier; - - if (compareResult == 0) - { - compareResult = x.CompareTo(y); - } - return compareResult; - } - catch (Exception ex) - { - throw new($"OutlookGridGroupCountComparer: {this}", ex); - } - } - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridRow.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridRow.cs deleted file mode 100644 index 6d75396c0..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridRow.cs +++ /dev/null @@ -1,712 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// OutlookGridRow - subclasses the DataGridView's DataGridViewRow class - /// In order to support grouping with the same look and feel as Outlook, the behaviour - /// of the DataGridViewRow is overridden by the OutlookGridRow. - /// The OutlookGridRow has 2 main additional properties: the Group it belongs to and - /// a the IsRowGroup flag that indicates whether the OutlookGridRow object behaves like - /// a regular row (with data) or should behave like a Group row. - /// - public class OutlookGridRow : DataGridViewRow - { - #region "Variables" - - private bool _isGroupRow; - private IOutlookGridGroup? _group; - private bool _collapsed; //For TreeNode - private OutlookGridRowNodeCollection _nodeCollection; //For TreeNode - private int _nodeLevel; //For TreeNode - private OutlookGridRow? _parentNode; //for TreeNode - #endregion - - #region "Properties" - - /// - /// Gets or sets the group to the row belongs to. - /// - /// - /// The group. - /// - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public IOutlookGridGroup? Group - { - get => _group; - set => _group = value; - } - - - /// - /// Gets or sets a value indicating whether this instance is a group row. - /// - /// - /// true if this instance is a group row; otherwise, false. - /// - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public bool IsGroupRow - { - get => _isGroupRow; - set => _isGroupRow = value; - } - - /// - /// Gets or sets a value indicating whether this is collapsed. - /// - /// - /// true if collapsed; otherwise, false. - /// - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public bool Collapsed { get => _collapsed; set => _collapsed = value; } - - /// - /// Gets or sets the nodes. - /// - /// - /// The nodes. - /// - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public OutlookGridRowNodeCollection Nodes { get => _nodeCollection; set => _nodeCollection = value; } - - /// - /// Gets a value indicating whether this instance is first sibling. - /// - /// - /// true if this instance is first sibling; otherwise, false. - /// - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public bool IsFirstSibling => NodeIndex == 0; - - /// - /// Gets a value indicating whether this instance is last sibling. - /// - /// - /// true if this instance is last sibling; otherwise, false. - /// - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public bool IsLastSibling - { - get - { - OutlookGridRow? parent = _parentNode; - if (parent != null && parent.HasChildren) - { - return NodeIndex == parent.Nodes.Count - 1; - } - else - { - return true; - } - } - } - - /// - /// Gets a value indicating whether this instance has children. - /// - /// - /// true if this instance has children; otherwise, false. - /// - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public bool HasChildren => _nodeCollection.Count > 0; - - /// - /// Gets or sets the node level. - /// - /// - /// The node level. - /// - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public int NodeLevel { get => _nodeLevel; set => _nodeLevel = value; } - - /// - /// Gets or sets the parent node. - /// - /// - /// The parent node. - /// - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public OutlookGridRow? ParentNode { get => _parentNode; set => _parentNode = value; } - - /// - /// Gets the index of the node. - /// - /// - /// The index of the node. - /// - public int NodeIndex - { - get - { - if (_parentNode != null) - { - return _parentNode.Nodes.IndexOf(this); - } - else - { - return 0; - } - } - } - #endregion - - #region "Constructors" - - /// - /// Default Constructor - /// - public OutlookGridRow() - : this(null, false) - { - //nodeCollection = new OutlookGridRowNodeCollection(this); - //NodeLevel = 0; - //Collapsed = true; - } - - /// - /// Constructor - /// - /// The group the row is associated to. - public OutlookGridRow(IOutlookGridGroup? group) - : this(group, false) - { - //nodeCollection = new OutlookGridRowNodeCollection(this); - //NodeLevel = 0; - //Collapsed = true; - } - - /// - /// Constructor - /// - /// The group the row is associated to. - /// Determines if it a group row. - public OutlookGridRow(IOutlookGridGroup? group, bool isGroupRow) - : base() - { - _group = group; - _isGroupRow = isGroupRow; - _nodeCollection = new(this); - NodeLevel = 0; - Collapsed = true; - } - - #endregion - - #region "Overrides" - - /// - /// Overrides the GetState method - /// - /// - /// - public override DataGridViewElementStates GetState(int rowIndex) - { - //yes its readable at least it was ;) - if ((IsGroupRow && IsAParentCollapsed(_group, 0)) || (!IsGroupRow && _group != null && (_group.Collapsed || IsAParentCollapsed(_group, 0))) || (!IsGroupRow && IsAParentNodeOrGroupCollapsed(this, 0))) - { - return base.GetState(rowIndex) & DataGridViewElementStates.Selected; - } - //For the TreeGridView project if the selection mode is FullRow subnodes that where collapsed disappear when parent collapse/expands - //because for an unknown reason the state becomes None instead of at least visible. - if (base.GetState(rowIndex) == DataGridViewElementStates.None) - { - return DataGridViewElementStates.Visible; - } - else - { - return base.GetState(rowIndex); - } - } - - /// - /// the main difference with a Group row and a regular row is the way it is painted on the control. - /// the Paint method is therefore overridden and specifies how the Group row is painted. - /// Note: this method is not implemented optimally. It is merely used for demonstration purposes - /// - /// - /// - /// - /// - /// - /// - /// - protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle rowBounds, int rowIndex, DataGridViewElementStates rowState, bool isFirstDisplayedRow, bool isLastVisibleRow) - { - if (_isGroupRow) - { - KryptonOutlookGrid grid = (KryptonOutlookGrid)DataGridView; - int rowHeadersWidth = grid.RowHeadersVisible ? grid.RowHeadersWidth : 0; - int groupLevelIndentation = _group.Level * StaticValues.GroupLevelMultiplier; - - int gridwidth = grid.Columns.GetColumnsWidth(DataGridViewElementStates.Visible); - Rectangle myRowBounds = rowBounds; - myRowBounds.Width = gridwidth; - - IPaletteBack paletteBack = grid.StateNormal.DataCell.Back; - IPaletteBorder paletteBorder = grid.StateNormal.DataCell.Border; - - PaletteState state = PaletteState.Normal; - if (grid.PreviousSelectedGroupRow == rowIndex && KryptonManager.CurrentGlobalPalette.GetRenderer() != KryptonManager.RenderOffice2013) - { - state = PaletteState.CheckedNormal; - } - - using (RenderContext renderContext = new(grid, graphics, myRowBounds, grid.Renderer)) - { - using (GraphicsPath path = grid.Renderer.RenderStandardBorder.GetBackPath(renderContext, myRowBounds, paletteBorder, VisualOrientation.Top, PaletteState.Normal)) - { - //Back - IDisposable unused = grid.Renderer.RenderStandardBack.DrawBack(renderContext, - myRowBounds, - path, - paletteBack, - VisualOrientation.Top, - state, - null); - - // We never save the memento for reuse later - if (unused != null) - { - unused.Dispose(); - unused = null; - } - } - } - - // Draw the botton : solid line for 2007 palettes or dot line for 2010 palettes, full background for 2013 - if (KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2010) - { - using (Pen focusPen = new(Color.Gray)) - { - focusPen.DashStyle = DashStyle.Dash; - graphics.DrawLine(focusPen, rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset, rowBounds.Bottom - 1, gridwidth + 1, rowBounds.Bottom - 1); - } - } - else if (KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2013) - { - using (SolidBrush br = new(Color.FromArgb(225, 225, 225))) - { - graphics.FillRectangle(br, rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset, rowBounds.Bottom - StaticValues._2013GroupRowHeight, gridwidth + 1, StaticValues._2013GroupRowHeight - 1); - } - } - else - { - using (SolidBrush br = new(paletteBorder.GetBorderColor1(state))) - { - graphics.FillRectangle(br, rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset, rowBounds.Bottom - 2, gridwidth + 1, 2); - } - } - - //Draw right vertical bar - if (grid.CellBorderStyle == DataGridViewCellBorderStyle.SingleVertical || grid.CellBorderStyle == DataGridViewCellBorderStyle.Single) - { - using (SolidBrush br = new(paletteBorder.GetBorderColor1(state))) - { - graphics.FillRectangle(br, rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + gridwidth, rowBounds.Top, 1, rowBounds.Height); - } - } - - //Set the icon and lines according to the renderer - if (_group.Collapsed) - { - if (KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2010 || KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2013) - { - graphics.DrawImage(Resources.OutlookGridImageResources.CollapseIcon2010, rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + 4 + groupLevelIndentation, rowBounds.Bottom - 18, 11, 11); - } - else - { - graphics.DrawImage(Resources.OutlookGridImageResources.ExpandIcon, rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + 4 + groupLevelIndentation, rowBounds.Bottom - 18, 11, 11); - } - } - else - { - if (KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2010 || KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2013) - { - graphics.DrawImage(Resources.OutlookGridImageResources.ExpandIcon2010, rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + 4 + groupLevelIndentation, rowBounds.Bottom - 18, 11, 11); - } - else - { - graphics.DrawImage(Resources.OutlookGridImageResources.CollapseIcon, rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + 4 + groupLevelIndentation, rowBounds.Bottom - 18, 11, 11); - } - } - - //Draw image group - int imageoffset = 0; - if (_group.GroupImage != null) - { - if (KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2010 || KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2013) - { - graphics.DrawImage(_group.GroupImage, rowHeadersWidth - grid.HorizontalScrollingOffset + StaticValues.ImageOffsetwidth + groupLevelIndentation, rowBounds.Bottom - StaticValues._2013OffsetHeight, StaticValues.GroupImageSide, StaticValues.GroupImageSide); - imageoffset = StaticValues.ImageOffsetwidth; - } - else - { - graphics.DrawImage(_group.GroupImage, rowHeadersWidth - grid.HorizontalScrollingOffset + StaticValues.ImageOffsetwidth + groupLevelIndentation, rowBounds.Bottom - StaticValues.DefaultOffsetHeight, StaticValues.GroupImageSide, StaticValues.GroupImageSide); - imageoffset = StaticValues.ImageOffsetwidth; - } - } - - //Draw text, using the current grid font - int offsetText = rowHeadersWidth - grid.HorizontalScrollingOffset + 18 + imageoffset + groupLevelIndentation; - if (KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2013) - { - TextRenderer.DrawText(graphics, _group.Text, grid.GridPalette.GetContentShortTextFont(PaletteContentStyle.LabelBoldControl, state), new Rectangle(offsetText, rowBounds.Bottom - StaticValues._2013OffsetHeight, rowBounds.Width - offsetText, rowBounds.Height), grid.GridPalette.GetContentShortTextColor1(PaletteContentStyle.LabelNormalControl, state), - TextFormatFlags.EndEllipsis | TextFormatFlags.SingleLine | TextFormatFlags.PreserveGraphicsClipping); - } - else - { - TextRenderer.DrawText(graphics, _group.Text, grid.GridPalette.GetContentShortTextFont(PaletteContentStyle.LabelBoldControl, state), new Rectangle(offsetText, rowBounds.Bottom - StaticValues.DefaultOffsetHeight, rowBounds.Width - offsetText, rowBounds.Height), grid.GridPalette.GetContentShortTextColor1(PaletteContentStyle.LabelNormalControl, state), - TextFormatFlags.EndEllipsis | TextFormatFlags.SingleLine | TextFormatFlags.PreserveGraphicsClipping); - } - - ////Debug Hits - ////ExpandCollaspe icon - //graphics.DrawRectangle(new Pen(Color.Red), new Rectangle(rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + 4 + group.Level * 15, rowBounds.Bottom - 18, 11, 11)); - ////Image - //if (KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2013) - // graphics.DrawRectangle(new Pen(Color.Blue), new Rectangle(rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + StaticValues._ImageOffsetwidth + groupLevelIndentation, rowBounds.Bottom - StaticValues._2013OffsetHeight, StaticValues._groupImageSide, StaticValues._groupImageSide)); - //else - // graphics.DrawRectangle(new Pen(Color.Blue), new Rectangle(rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + StaticValues._ImageOffsetwidth + groupLevelIndentation, rowBounds.Bottom - StaticValues._defaultOffsetHeight, StaticValues._groupImageSide, StaticValues._groupImageSide)); - } - else - { - base.Paint(graphics, clipBounds, rowBounds, rowIndex, rowState, isFirstDisplayedRow, isLastVisibleRow); - } - } - - - /// - /// Paints the cells. - /// - /// The graphics. - /// The clip bounds. - /// The row bounds. - /// Index of the row. - /// State of the row. - /// if set to true [is first displayed row]. - /// if set to true [is last visible row]. - /// The paint parts. - /// Will not execute if it is a group row.) - protected override void PaintCells(Graphics graphics, Rectangle clipBounds, Rectangle rowBounds, int rowIndex, DataGridViewElementStates rowState, bool isFirstDisplayedRow, bool isLastVisibleRow, DataGridViewPaintParts paintParts) - { - if (!_isGroupRow) - { - base.PaintCells(graphics, clipBounds, rowBounds, rowIndex, rowState, isFirstDisplayedRow, isLastVisibleRow, paintParts); - } - } - - - /// - /// Returns a that represents this instance. - /// - /// - /// A that represents this instance. - /// - public override string ToString() - { - string res = ""; - try - { - res += "OutlookGridRow "; - foreach (DataGridViewCell c in Cells) - { - if (c.Value != null) - { - res += c.Value.ToString() ?? string.Empty; - } - } - } - catch { } - return res; - } - - #endregion - - #region "Public methods" - - /// - /// Gets if the row has one parent that is collapsed - /// - /// The group to look at. - /// Fill 0 to first this method (used for recursive). - /// True or false. - public bool IsAParentCollapsed(IOutlookGridGroup? gr, int i) - { - i++; - if (gr.ParentGroup != null) - { - //if it is not the original group but it is one parent and if it is collapsed just stop here - //no need to look further to the parents (one of the parents can be expanded...) - //if (i > 1 && gr.Collapsed) - if (gr.ParentGroup.Collapsed) - { - return true; - } - else - { - return IsAParentCollapsed(gr.ParentGroup, i); - } - } - else - { - //if 1 that means there is no parent - if (i == 1) - { - return false; - } - else - { - return gr.Collapsed; - } - } - } - - - /// - /// Determines if there is a parent node or a parent group collapsed. - /// - /// The specified row. - /// The i. - /// - public bool IsAParentNodeOrGroupCollapsed(OutlookGridRow? row, int i) - { - i++; - //Console.WriteLine(row.ToString()); - if (row.ParentNode != null) - { - //if it is not the original group but it is one parent and if it is collapsed just stop here - //no need to look further to the parents (one of the parents can be expanded...) - if (row.ParentNode.Collapsed) - { - return true; - } - else - { - return IsAParentNodeOrGroupCollapsed(row.ParentNode, i); - } - } - else //no parent - { - if (i == 1) //if 1 that means there is no parent - { return false; } - else //return the final parent collapsed state - { - if (row._group != null) - { - return row.Collapsed || row._group.Collapsed || IsAParentCollapsed(row._group, 0); - } - else - { - return row.Collapsed; - } - - } - } - } - - /// - /// Expand the group the row belongs to. - /// - public void ExpandGroup() - { - SetGroupCollapse(false); - } - - /// - /// Collaspe the group the row belongs to. - /// - public void CollapseGroup() - { - SetGroupCollapse(true); - } - - internal void SetGroupCollapse(bool collapsed) - { - if (IsGroupRow) - { - 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 - Visible = false; - Visible = true; - - //When collapsing the first row still seeing it. - if (Index < DataGridView.FirstDisplayedScrollingRowIndex) - { - DataGridView.FirstDisplayedScrollingRowIndex = Index; - } - } - } - - internal void SetNodeCollapse(bool collapsed) - { - if (HasChildren) - { - 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 - Visible = false; - Visible = true; - - //When collapsing the first row still seeing it. - if (Index < DataGridView.FirstDisplayedScrollingRowIndex) - { - DataGridView.FirstDisplayedScrollingRowIndex = Index; - } - } - } - - /// - /// Collapse Node (with events) - /// - public void Collapse() - { - ((KryptonOutlookGrid)DataGridView).CollapseNode(this); - } - - /// - /// Expand Node (with events) - /// - public void Expand() - { - ((KryptonOutlookGrid)DataGridView).ExpandNode(this); - } - - #endregion - - #region "Private methods" - - /// - /// this function checks if the user hit the expand (+) or collapse (-) icon. - /// if it was hit it will return true - /// - /// mouse click event arguments - /// returns true if the icon was hit, false otherwise - internal bool IsIconHit(DataGridViewCellMouseEventArgs e) - { - if (e.ColumnIndex < 0) - { - return false; - } - - if (!_isGroupRow) - { - return false; - } - - KryptonOutlookGrid grid = (KryptonOutlookGrid)DataGridView; - Rectangle rowBounds = grid.GetRowDisplayRectangle(Index, false); - - int rowHeadersWidth = grid.RowHeadersVisible ? grid.RowHeadersWidth : 0; - int l = e.X + grid.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, false).Left; - if (_isGroupRow && - l >= rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + 4 + _group.Level * StaticValues.GroupLevelMultiplier && - l <= rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + 4 + _group.Level * StaticValues.GroupLevelMultiplier + 11 && - e.Y >= rowBounds.Height - 18 && - e.Y <= rowBounds.Height - 7) - { - return true; - } - - return false; - } - - //internal bool IsNodeIconHit(DataGridViewCellMouseEventArgs e) - //{ - // if (e.ColumnIndex < 0) return false; - // if (!this.HasChildren) return false; - - // DataGridViewCell cell = this.Cells[e.ColumnIndex]; - // if (cell.GetType() is KryptonDataGridViewTreeTextCell) { - // cell. - // } - // KryptonOutlookGrid grid = (KryptonOutlookGrid)this.DataGridView; - - - // Rectangle glyphRect = new Rectangle(rect.X + this.GlyphMargin, rect.ContentBounds.Y, INDENT_WIDTH, this.ContentBounds.Height - 1); - - // if ((e.X <= glyphRect.X + 11) && - // (e.X >= glyphRect.X) && - // (e.Y >= glyphRect.Y + (glyphRect.Height / 2) - 4) && - // (e.Y <= glyphRect.Y + (glyphRect.Height / 2) - 4 + 11)) - - - // if (this.isGroupRow && - // (l >= rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + 4 + group.Level * StaticValues._groupLevelMultiplier) && - // (l <= rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + 4 + group.Level * StaticValues._groupLevelMultiplier + 11) && - // (e.Y >= rowBounds.Height - 18) && - // (e.Y <= rowBounds.Height - 7)) - // return true; - - // return false; - //} - - internal bool IsGroupImageHit(DataGridViewCellMouseEventArgs e) - { - if (e.ColumnIndex < 0) - { - return false; - } - - if (!_isGroupRow || _group.GroupImage == null) - { - return false; - } - - - KryptonOutlookGrid grid = (KryptonOutlookGrid)DataGridView; - Rectangle rowBounds = grid.GetRowDisplayRectangle(Index, false); - - int rowHeadersWidth = grid.RowHeadersVisible ? grid.RowHeadersWidth : 0; - int l = e.X + grid.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, false).Left; - int offsetHeight; - if (KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2013) - { - offsetHeight = StaticValues._2013OffsetHeight; - } - else - { - offsetHeight = StaticValues.DefaultOffsetHeight; - } - - if (_isGroupRow && - l >= rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + 18 + _group.Level * StaticValues.GroupLevelMultiplier && - l <= rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + 18 + _group.Level * StaticValues.GroupLevelMultiplier + 16 && - e.Y >= rowBounds.Height - offsetHeight && - e.Y <= rowBounds.Height - 6) - { - return true; - } - - return false; - } - - #endregion - - - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridRowComparer2.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridRowComparer2.cs deleted file mode 100644 index 51138dd32..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridRowComparer2.cs +++ /dev/null @@ -1,142 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - internal class OutlookGridRowComparer2 : IComparer - { - List> _sortColumnIndexAndOrder; - - /// - /// Initializes a new instance of the class. - /// - /// The sort list, tuple (column index, sortorder, Icomparer) - public OutlookGridRowComparer2(List> sortList) - { - _sortColumnIndexAndOrder = sortList; - } - - #region IComparer Members - - /// - /// Compares the specified x. - /// - /// The x. - /// The y. - /// - /// OutlookGridRowComparer: + this.ToString() - public int Compare(OutlookGridRow x, OutlookGridRow y) - { - int compareResult = 0, orderModifier; - - try - { - for (int i = 0; i < _sortColumnIndexAndOrder.Count; i++) - { - if (compareResult == 0) - { - orderModifier = _sortColumnIndexAndOrder[i].Item2 == SortOrder.Ascending ? 1 : -1; - - object o1 = x.Cells[_sortColumnIndexAndOrder[i].Item1].Value; - object o2 = y.Cells[_sortColumnIndexAndOrder[i].Item1].Value; - if (_sortColumnIndexAndOrder[i].Item3 != null) - { - compareResult = _sortColumnIndexAndOrder[i].Item3.Compare(o1, o2) * orderModifier; - } - else - { - if ((o1 == null || o1 == DBNull.Value) && o2 != null && o2 != DBNull.Value) - { - compareResult = 1; - } - else if (o1 != null && o1 != DBNull.Value && (o2 == null || o2 == DBNull.Value)) - { - compareResult = -1; - } - else - { - if (o1 is string) - { - compareResult = string.Compare(o1.ToString(), o2.ToString()) * orderModifier; - } - else if (o1 is DateTime) - { - compareResult = ((DateTime)o1).CompareTo((DateTime)o2) * orderModifier; - } - else if (o1 is int) - { - compareResult = ((int)o1).CompareTo((int)o2) * orderModifier; - } - else if (o1 is bool) - { - bool b1 = (bool)o1; - bool b2 = (bool)o2; - compareResult = (b1 == b2 ? 0 : b1 == true ? 1 : -1) * orderModifier; - } - else if (o1 is float) - { - float n1 = (float)o1; - float n2 = (float)o2; - compareResult = (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) * orderModifier; - } - else if (o1 is double) - { - double n1 = (double)o1; - double n2 = (double)o2; - compareResult = (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) * orderModifier; - } - else if (o1 is decimal) - { - decimal d1 = (decimal)o1; - decimal d2 = (decimal)o2; - compareResult = (d1 > d2 ? 1 : d1 < d2 ? -1 : 0) * orderModifier; - } - else if (o1 is long) - { - long n1 = (long)o1; - long n2 = (long)o2; - compareResult = (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) * orderModifier; - } - else if (o1 is TimeSpan) - { - TimeSpan t1 = (TimeSpan)o1; - TimeSpan t2 = (TimeSpan)o2; - compareResult = (t1 > t2 ? 1 : t1 < t2 ? -1 : 0) * orderModifier; - } - else if (o1 is TextAndImage) - { - compareResult = ((TextAndImage)o1).CompareTo((TextAndImage)o2) * orderModifier; - } - else if (o1 is Token) - { - compareResult = ((Token)o1).CompareTo((Token)o2) * orderModifier; - } - } - } - } - } - return compareResult; - } - catch (Exception ex) - { - throw new($"OutlookGridRowComparer: {ToString()}", ex); - } - } - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridRowNodeCollection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridRowNodeCollection.cs deleted file mode 100644 index aa9092784..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridRowNodeCollection.cs +++ /dev/null @@ -1,146 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// List of IOutlookGridGroups - /// - public class OutlookGridRowNodeCollection - { - #region "Variables" - private OutlookGridRow? _parentNode; - private List _subNodes; - #endregion - - #region "Constructor" - /// - /// Initializes a new instance of the class. - /// - /// The parent node. - public OutlookGridRowNodeCollection(OutlookGridRow? parentNode) - { - _parentNode = parentNode; - _subNodes = new(); - } - #endregion - - #region Properties - - /// - /// Gets the parent node. - /// - /// - /// The parent node. - /// - public OutlookGridRow? ParentNode { get => _parentNode; set => _parentNode = value; } - - /// - /// Gets the nodes. - /// - /// - /// The nodes. - /// - public List Nodes => _subNodes; - - - /// - /// Gets the number of groups - /// - /// - /// The count. - /// - public int Count => _subNodes.Count; - - #endregion - - #region "Public methods" - - - /// - /// Gets the at the specified index. - /// - /// - /// The . - /// - /// The index. - /// The IOutlookGridGroup. - public OutlookGridRow this[int index] => _subNodes[index]; - - /// - /// Adds the specified row. - /// - /// The row. - public void Add(OutlookGridRow row) - { - row.ParentNode = _parentNode; - if (ParentNode != null) - { - row.NodeLevel = ParentNode.NodeLevel + 1; //Not ++ - } - _subNodes.Add(row); - } - - /// - /// Sorts this instance. - /// - public void Sort() - { - _subNodes.Sort(); - } - - /// - /// Sorts the specified comparer. - /// - /// The comparer. - internal void Sort(OutlookGridRowComparer2 comparer) - { - _subNodes.Sort(comparer); - } - - /// - /// Gets the Index of a row - /// - /// The OutlookGrid row. - /// - public int IndexOf(OutlookGridRow row) - { - return _subNodes.IndexOf(row); - } - - #endregion - - #region "Internals" - - /// - /// Clears all subnodes. - /// - internal void Clear() - { - _parentNode = null; - //If a group is collapsed the rows will not appear. Then if we clear the group the rows should not remain "collapsed" - for (int i = 0; i < _subNodes.Count; i++) - { - _subNodes[i].Collapsed = false; - } - _subNodes.Clear(); - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/StaticValues.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/StaticValues.cs deleted file mode 100644 index a5be3e991..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/StaticValues.cs +++ /dev/null @@ -1,55 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Static values - /// - public static class StaticValues - { - /// - /// The default group row height - /// - public static int DefaultGroupRowHeight = 34; - /// - /// The group row height for 2013 palettes - /// - public static int _2013GroupRowHeight = 24; - /// - /// The default offset height - /// - public static int DefaultOffsetHeight = 22; - /// - /// The offset height for 2013 palettes - /// - public static int _2013OffsetHeight = 11; - /// - /// The image offset width - /// - public static int ImageOffsetwidth = 18; - /// - /// The group level multiplier - /// - public static int GroupLevelMultiplier = 15; - /// - /// The group image side size - /// - public static int GroupImageSide = 16; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Helpers/ColourHelper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Helpers/ColourHelper.cs deleted file mode 100644 index 1daab4ffb..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Helpers/ColourHelper.cs +++ /dev/null @@ -1,485 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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 - -// ReSharper disable InconsistentNaming -namespace Krypton.Toolkit.Suite.Extended.Outlook.Grid -{ - /// - /// Helper for color manipulations - /// - public static class ColourHelper - { - #region Structures for HSL and HSV colors - - /// - /// HSV Structure - /// - public struct HSVColour - { - private float _hue; - - /// - /// Hue value, from 0° to 360° - /// - public float Hue - { - get => _hue; - set => _hue = value; - } - - private float _saturation; - - /// - /// Saturation value, from 0 to 1 - /// - public float Saturation - { - get => _saturation; - set => _saturation = value; - } - - private float _valueOrBrightness; - - /// - /// Value or Brightness value, from 0 to 1 - /// - public float ValueOrBrightness - { - get => _valueOrBrightness; - set => _valueOrBrightness = value; - } - - /// - /// Initializes a new instance of the struct. - /// - /// The hue. - /// The saturation. - /// The value. - public HSVColour(float hue, float saturation, float value) - { - _hue = hue; - _saturation = saturation; - _valueOrBrightness = value; - } - } - - /// - /// HSL Structure - /// - public struct HSLColour - { - private float _hue; - - /// - /// Hue value, from 0° to 360° - /// - public float Hue - { - get => _hue; - set => _hue = value; - } - - private float _saturation; - - /// - /// Saturation value, from 0 to 1 - /// - public float Saturation - { - get => _saturation; - set => _saturation = value; - } - - private float _lightness; - - /// - /// Value or Lightness value, from 0 to 1 - /// - public float Lightness - { - get => _lightness; - set => _lightness = value; - } - - /// - /// Initializes a new instance of the struct. - /// - /// The hue. - /// The saturation. - /// The lightness. - public HSLColour(float hue, float saturation, float lightness) - { - _hue = hue; - _saturation = saturation; - _lightness = lightness; - } - } - - #endregion - - - /// - /// Returns a System.Color from HSL values - /// - /// Hue (0 to 360°) - /// Saturation (0 to 1) - /// Value/Brightness (0 to 1) - /// - public static Color FromHSV(float h, float s, float v) - { - // Hue checking - if (h < 0f) - { - h = 0f; - } - else if (h > 360f) - { - h = 360f; - } - - // Saturation checking - if (s < 0f) - { - s = 0f; - } - else if (s > 1f) - { - s = 1f; - } - - // Value/Brightness checking - if (v < 0f) - { - v = 0f; - } - else if (v > 1f) - { - v = 1f; - } - - // === Conversion === - float fRed = 0f; - float fGreen = 0f; - float fBlue = 0f; - - if (s == 0) - { - // No saturation => shade of gray - int grayValue = Convert.ToInt32(v * 255); - return Color.FromArgb(grayValue, grayValue, grayValue); - } - else - { - float hVal = h / 360f; // 0 <= hVah < 1 - - float varH = hVal * 6f; - if (varH == 6f) - { - varH = 0f; - } - - int i = (int)varH; //Or ... vari = floor( varh ) - float var1 = v * (1f - s); - float var2 = v * (1f - s * (varH - (float)i)); - float var3 = v * (1f - s * (1f - (varH - i))); - - switch (i) - { - case 0: - fRed = v; - fGreen = var3; - fBlue = var1; - break; - case 1: - fRed = var2; - fGreen = v; - fBlue = var1; - break; - case 2: - fRed = var1; - fGreen = v; - fBlue = var3; - break; - case 3: - fRed = var1; - fGreen = var2; - fBlue = v; - break; - case 4: - fRed = var3; - fGreen = var1; - fBlue = v; - break; - default: - fRed = v; - fGreen = var1; - fBlue = var2; - break; - } - - return Color.FromArgb((int)(fRed * 255f), (int)(fGreen * 255f), (int)(fBlue * 255f)); - } - } - - - /// - /// Returns HSV values from RGB - /// - /// Red component from 0 to 255 - /// Green component from 0 to 255 - /// Blue component from 0 to 255 - /// - public static HSVColour ToHSV(int red, int green, int blue) - { - float varR = red / 255f; //RGB from 0 to 255 - float varG = green / 255f; - float varB = blue / 255f; - - float varMin = Math.Min(varR, Math.Min(varG, varB)); //Min. value of RGB - float varMax = Math.Max(varR, Math.Max(varG, varB)); //Max. value of RGB - float deltaMax = varMax - varMin; //Delta RGB value - - float h = 0; - float s = 0; - float v = 0; - - // Value / Brightness - v = varMax; - - if (deltaMax == 0) - { - // Gray scale - h = 0; //HSV results from 0 to 1 - s = 0; - } - else - { - // Saturation - s = deltaMax / varMax; - - // Hue - float deltaR = ((varMax - varR) / 6f + deltaMax / 2f) / deltaMax; - float deltaG = ((varMax - varG) / 6f + deltaMax / 2f) / deltaMax; - float deltaB = ((varMax - varB) / 6f + deltaMax / 2f) / deltaMax; - - if (varR == varMax) - { - h = deltaB - deltaG; - } - else if (varG == varMax) - { - h = 1f / 3f + deltaR - deltaB; - } - else if (varB == varMax) - { - h = 2f / 3f + deltaG - deltaR; - } - - if (h < 0f) - { - h += 1; - } - - if (h > 1f) - { - h -= 1; - } - } - - return new(h * 360f, s, v); - } - - - /// - /// Returns a System.Color from HSL values - /// - /// Hue (0 to 360°) - /// Saturation (0 to 1) - /// Lightness (0 to 1) - /// - public static Color FromHSL(float h, float s, float l) - { - // Hue checking - if (h < 0f) - { - h = 0f; - } - else if (h > 360f) - { - h = 360f; - } - - // Saturation checking - if (s < 0f) - { - s = 0f; - } - else if (s > 1f) - { - s = 1f; - } - - // Lightness checking - if (l < 0f) - { - l = 0f; - } - else if (l > 1f) - { - l = 1f; - } - - // === Conversion === - if (s == 0) - { - // No saturation => shade of gray - int grayValue = Convert.ToInt32(l * 255); - return Color.FromArgb(grayValue, grayValue, grayValue); - } - - float var1, var2, hval; - - if (l < 0.5f) - { - var2 = l * (1f + s); - } - else - { - var2 = l + s - s * l; - } - - var1 = 2f * l - var2; - hval = h / 360f; - - int red = Convert.ToInt32(255f * FromHueToRGB(var1, var2, hval + 1f / 3f)); - int green = Convert.ToInt32(255f * FromHueToRGB(var1, var2, hval)); - int blue = Convert.ToInt32(255f * FromHueToRGB(var1, var2, hval - 1f / 3f)); - - return Color.FromArgb(red, green, blue); - } - - private static float FromHueToRGB(float var1, float var2, float hue) - { - float rgbColor; - - if (hue < 0f) - { - hue += 1f; - } - - if (hue > 1f) - { - hue -= 1f; - } - - if (6f * hue < 1f) - { - rgbColor = var1 + (var2 - var1) * 6f * hue; - } - else if (2f * hue < 1f) - { - rgbColor = var2; - } - else if (3f * hue < 2f) - { - rgbColor = var1 + (var2 - var1) * (2f / 3f - hue) * 6f; - } - else - { - rgbColor = var1; - } - - return rgbColor; - } - - /// - /// Returns HSL values from RGB - /// - /// Red component from 0 to 255 - /// Green component from 0 to 255 - /// Blue component from 0 to 255 - /// - public static HSLColour ToHSL(int red, int green, int blue) - { - float varR = red / 255f; //RGB from 0 to 255 - float varG = green / 255f; - float varB = blue / 255f; - - float varMin = Math.Min(varR, Math.Min(varG, varB)); //Min. value of RGB - float varMax = Math.Max(varR, Math.Max(varG, varB)); //Max. value of RGB - float deltaMax = varMax - varMin; //Delta RGB value - - float h = 0; - float s = 0; - float l = 0; - - // Lightness - l = (varMax + varMin) / 2f; - - if (deltaMax == 0) - { - // Gray scale - h = 0; //HSL results from 0 to 1 - s = 0; - } - else - { - // Saturation - if (l < 0.5f) - { - s = deltaMax / (varMax + varMin); - } - else - { - s = deltaMax / (2f - varMax - varMin); - } - - // Hue - float deltaR = ((varMax - varR) / 6f + deltaMax / 2f) / deltaMax; - float deltaG = ((varMax - varG) / 6f + deltaMax / 2f) / deltaMax; - float deltaB = ((varMax - varB) / 6f + deltaMax / 2f) / deltaMax; - - if (varR == varMax) - { - h = deltaB - deltaG; - } - else if (varG == varMax) - { - h = 1f / 3f + deltaR - deltaB; - } - else if (varB == varMax) - { - h = 2f / 3f + deltaG - deltaR; - } - - if (h < 0f) - { - h += 1f; - } - - if (h > 1f) - { - h -= 1f; - } - } - - return new(h * 360f, s, l); - } - - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Helpers/OutlookGridGroupHelpers.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Helpers/OutlookGridGroupHelpers.cs deleted file mode 100644 index 8f0b31b4b..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Helpers/OutlookGridGroupHelpers.cs +++ /dev/null @@ -1,356 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Class containing functions for the IOutlookGridGroups - /// - public class OutlookGridGroupHelpers - { - /// - /// Gets the title for a specific datetime - /// - /// The DateTime - /// The text to display - public static string? GetDayText(DateTime date) - { - switch (GetDateCode(date)) - { - case "NODATE": - return KryptonOutlookGridLanguageManager.GeneralStrings.NoDate;// "Today"; - case "TODAY": - return KryptonOutlookGridLanguageManager.GeneralStrings.Today;// "Today"; - case "YESTERDAY": - return KryptonOutlookGridLanguageManager.GeneralStrings.Yesterday;//"Yesterday"; - case "TOMORROW": - return KryptonOutlookGridLanguageManager.GeneralStrings.Tomorrow;//"Tomorrow"; - case "Monday": - return KryptonOutlookGridLanguageManager.GeneralStrings.Monday; - case "Tuesday": - return KryptonOutlookGridLanguageManager.GeneralStrings.Tuesday; - case "Wednesday": - return KryptonOutlookGridLanguageManager.GeneralStrings.Wednesday; - case "Thursday": - return KryptonOutlookGridLanguageManager.GeneralStrings.Thursday; - case "Friday": - return KryptonOutlookGridLanguageManager.GeneralStrings.Friday; - case "Saturday": - return KryptonOutlookGridLanguageManager.GeneralStrings.Saturday; - case "Sunday": - return UppercaseFirst(date.ToString("dddd")); - case "NEXTWEEK": - return KryptonOutlookGridLanguageManager.GeneralStrings.NextWeek;//"Next Week"; - case "INTWOWEEKS": //dans le deux semaines a venir - return KryptonOutlookGridLanguageManager.GeneralStrings.InTwoWeeks;//"In two weeks"; //dans le deux semaines a venir - case "INTHREEWEEKS": //dans les trois semaines à venir - return KryptonOutlookGridLanguageManager.GeneralStrings.InThreeWeeks;//"In three weeks"; //dans les trois semaines à venir - case "LATERDURINGTHISMONTH": //Plus tard au cours de ce mois - return KryptonOutlookGridLanguageManager.GeneralStrings.LaterDuringThisMonth;//"Later during this month"; //Plus tard au cours de ce mois - case "NEXTMONTH": //Prochain mois - return KryptonOutlookGridLanguageManager.GeneralStrings.NextMonth;//"Next month"; //Prochain mois - case "AFTERNEXTMONTH": //Au-delà du prochain mois - return KryptonOutlookGridLanguageManager.GeneralStrings.AfterNextMonth;//"After next month"; //Au-delà du prochain mois - case "PREVIOUSWEEK": - return KryptonOutlookGridLanguageManager.GeneralStrings.PreviousWeek;//"Previous Week"; - case "TWOWEEKSAGO": //Il y a deux semaines - return KryptonOutlookGridLanguageManager.GeneralStrings.TwoWeeksAgo;//"Two weeks ago"; //Il y a deux semaines - case "THREEWEEKSAGO": //Il y a trois semaines - return KryptonOutlookGridLanguageManager.GeneralStrings.ThreeWeeksAgo;//"Three weeks ago"; //Il y a deux semaines - case "EARLIERDURINGTHISMONTH": //Plus tôt durant ce mois - return KryptonOutlookGridLanguageManager.GeneralStrings.EarlierDuringThisMonth;//"Earlier during this month"; //Plus tot au cours de ce mois - case "PREVIOUSMONTH": //Mois précédent - return KryptonOutlookGridLanguageManager.GeneralStrings.PreviousMonth;//"Previous Month"; //Mois dernier - case "BEFOREPREVIOUSMONTH": //Mois dernier // no longer exist - return KryptonOutlookGridLanguageManager.GeneralStrings.BeforePreviousMonth;//"Before Previous Month"; //Avant le mois dernier - case "EARLIERTHISYEAR": //Mois dernier // no longer exist - return KryptonOutlookGridLanguageManager.GeneralStrings.EarlierDuringThisYear;//"Before Previous Month"; //Avant le mois dernier - case "PREVIOUSYEAR": //Mois dernier // no longer exist - return KryptonOutlookGridLanguageManager.GeneralStrings.PreviousYear;//"Before Previous Month"; //Avant le mois dernier - case "OLDER": //Mois dernier // no longer exist - return KryptonOutlookGridLanguageManager.GeneralStrings.Older;//"Before Previous Month"; //Avant le mois dernier - - default: - return date.Date.ToShortDateString(); - } - } - - /// - /// Gets the code according to a datetime - /// - /// The DateTime to analyze. - /// The associated code. - public static string GetDateCode(DateTime date) - { - if (date.Date == DateTime.MinValue)//Today - { - return "NODATE"; - } - else if (date.Date == DateTime.Now.Date)//Today - { - return "TODAY"; - } - else if (date.Date == DateTime.Now.AddDays(-1).Date) - { - return "YESTERDAY"; - } - else if (date.Date == DateTime.Now.AddDays(1).Date) - { - return "TOMORROW"; - } - else if (date.Date >= GetFirstDayOfWeek(DateTime.Now) && date.Date <= GetLastDayOfWeek(DateTime.Now)) - { - return date.Date.DayOfWeek.ToString();//"DAYOFWEEK"; - } - else if (date.Date > GetLastDayOfWeek(DateTime.Now) && date.Date <= GetLastDayOfWeek(DateTime.Now).AddDays(6)) - { - return "NEXTWEEK"; - } - else if (date.Date > GetLastDayOfWeek(DateTime.Now).AddDays(6) && date.Date <= GetLastDayOfWeek(DateTime.Now).AddDays(12)) - { - return "INTWOWEEKS"; //dans les deux semaines a venir - } - else if (date.Date > GetLastDayOfWeek(DateTime.Now).AddDays(12) && date.Date <= GetLastDayOfWeek(DateTime.Now).AddDays(18)) - { - return "INTHREEWEEKS"; //dans les trois semaines à venir - } - else if (date.Date > GetLastDayOfWeek(DateTime.Now).AddDays(18) && date.Date <= new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(1).AddDays(-1))//AddDays(DateTime.DaysInMonth(DateTime.Now.Year,DateTime.Now.Month)-1))) - { - return "LATERDURINGTHISMONTH"; //Plus tard au cours de ce mois - } - else if (date.Date > GetLastDayOfWeek(DateTime.Now).AddDays(18) && date.Date > new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(1).AddDays(-1) && date.Date <= new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(2).AddDays(-1)) - { - return "NEXTMONTH"; //Prochain mois - } - else if (date.Date > GetLastDayOfWeek(DateTime.Now).AddDays(18) && date.Date > new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(2).AddDays(-1)) - { - return "AFTERNEXTMONTH"; //Au-delà du prochain mois - } - else if (date.Date < GetFirstDayOfWeek(DateTime.Now) && date.Date >= GetFirstDayOfWeek(DateTime.Now).AddDays(-7)) - { - return "PREVIOUSWEEK"; - } - else if (date.Date <= GetFirstDayOfWeek(DateTime.Now).AddDays(-7) && date.Date >= GetFirstDayOfWeek(DateTime.Now).AddDays(-14)) - { - return "TWOWEEKSAGO"; //Il y a deux semaines - } - else if (date.Date <= GetFirstDayOfWeek(DateTime.Now).AddDays(-14) && date.Date >= GetFirstDayOfWeek(DateTime.Now).AddDays(-21)) - { - return "THREEWEEKSAGO"; //Il y a trois semaines - } - else if (date.Date <= GetFirstDayOfWeek(DateTime.Now).AddDays(-21) && date.Date >= new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1)) - { - return "EARLIERDURINGTHISMONTH"; //Plus tôt durant ce mois - } - else if (date.Date <= GetFirstDayOfWeek(DateTime.Now).AddDays(-21) && date.Date >= new DateTime(DateTime.Now.Year, DateTime.Now.AddMonths(-1).Month, 1) && date.Date <= new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddDays(-1)) - { - return "PREVIOUSMONTH"; //Mois précédent - } - //On simplifie les tests, il n'y a pas de raison de tout tester - else if (date.Date >= new DateTime(DateTime.Now.Year, 1, 1)) - { - return "EARLIERTHISYEAR"; //Plus tôt cet année - } - else if (date.Date >= new DateTime(DateTime.Now.Year - 1, 1, 1) && date.Date <= new DateTime(DateTime.Now.Year, 1, 1).AddDays(-1)) - { - return "PREVIOUSYEAR"; //L'année dernière - } - else if (date.Date <= new DateTime(DateTime.Now.Year - 1, 1, 1).AddDays(-1)) - { - return "OLDER"; //Older - } - else - { - return date.Date.ToShortDateString(); - } - } - - /// Gets the date code numeric. - /// The date. - /// - public static int GetDateCodeNumeric(DateTime date) - { - switch (GetDateCode(date)) - { - case "NODATE": - return int.MaxValue; - case "AFTERNEXTMONTH": //Au-delà du prochain mois - return 14; - case "NEXTMONTH": //Prochain mois - return 13; - case "LATERDURINGTHISMONTH": //Plus tard au cours de ce mois - return 12; - case "INTHREEWEEKS": //dans les trois semaines à venir - return 11; - case "INTWOWEEKS": //dans les deux semaines a venir - return 10; - case "NEXTWEEK": - return 9; - case "Sunday": - return 8; - case "Saturday": - return 7; - case "Friday": - return 6; - case "Thursday": - return 5; - case "Wednesday": - return 4; - case "Tuesday": - return 3; - case "Monday": - return 2; - case "TOMORROW": - return 1; - case "TODAY": - return 0; - case "YESTERDAY": - return -1; - case "PREVIOUSWEEK": - return -2; - case "TWOWEEKSAGO": //Il y a deux semaines - return -3; - case "THREEWEEKSAGO": //Il y a trois semaines - return -4; - case "EARLIERDURINGTHISMONTH": //Plus tôt durant ce mois - return -5; - case "PREVIOUSMONTH": //Mois précédent - return -6; - case "EARLIERTHISYEAR": //Plus tôt cet année - return -7; - case "PREVIOUSYEAR": //L'année dernière - return -8; - case "OLDER": //Older - return -9; - //case date.Date.ToShortDateString(): - default: - return int.MinValue; - } - } - - /// - /// Uppercase the first letter of the string - /// - /// The string. - /// The tring with the first letter uppercased. - private static string? UppercaseFirst(string s) - { - if (string.IsNullOrEmpty(s)) - { - return string.Empty; - } - char[] a = s.ToCharArray(); - a[0] = char.ToUpper(a[0]); - return new(a); - } - - /// - /// Returns the first day of the week that the specified date is in using the current culture. - /// - /// The date to analyse - /// The first day of week. - public static DateTime GetFirstDayOfWeek(DateTime dayInWeek) - { - CultureInfo defaultCultureInfo = CultureInfo.CurrentCulture; - return GetFirstDayOfWeek(dayInWeek, defaultCultureInfo); - } - - /// - /// Returns the last day of the week that the specified date is in using the current culture. - /// - /// The date to analyse - /// The last day of week. - public static DateTime GetLastDayOfWeek(DateTime dayInWeek) - { - CultureInfo defaultCultureInfo = CultureInfo.CurrentCulture; - return GetFirstDayOfWeek(dayInWeek, defaultCultureInfo).AddDays(6); - } - - /// - /// Returns the first day of the week that the specified date is in. - /// - /// The date to analyse - /// The CultureInfo - /// The first day of week. - public static DateTime GetFirstDayOfWeek(DateTime dayInWeek, CultureInfo cultureInfo) - { - DayOfWeek firstDay = cultureInfo.DateTimeFormat.FirstDayOfWeek; - DateTime firstDayInWeek = dayInWeek.Date; - int difference = (int)dayInWeek.DayOfWeek - (int)firstDay; - difference = (7 + difference) % 7; - return dayInWeek.AddDays(-difference).Date; - } - - /// - /// Gets the user-friendly and localized text of quarter - /// - /// - /// - public static string GetQuarterAsString(DateTime dateTime) - { - switch (GetQuarter(dateTime)) - { - case 1: - return KryptonOutlookGridLanguageManager.GeneralStrings.QuarterOne; - case 2: - return KryptonOutlookGridLanguageManager.GeneralStrings.QuarterTwo; - case 3: - return KryptonOutlookGridLanguageManager.GeneralStrings.QuarterThree; - case 4: - return KryptonOutlookGridLanguageManager.GeneralStrings.QuarterFour; - default: - return ""; - } - } - - /// - /// Gets the quarter according to the month. - /// - /// The date DateTime - /// The quarter number. - public static int GetQuarter(DateTime dateTime) - { - if (dateTime.Month <= 3) - { - return 1; - } - - if (dateTime.Month <= 6) - { - return 2; - } - - if (dateTime.Month <= 9) - { - return 3; - } - - return 4; - } - - /// - /// Returns a fully qualified type name without the version, culture, or token - /// - /// - /// - public static string SimpleQualifiedName(Type t) - { - return $"{t.FullName}, {t.Assembly.GetName().Name}"; - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Utilities/Language/LanguageManagerOld.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Utilities/Language/LanguageManagerOld.cs deleted file mode 100644 index 0190ed574..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/Utilities/Language/LanguageManagerOld.cs +++ /dev/null @@ -1,78 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Handle localization (singleton) - /// - // Note: Overhaul this! - public class LanguageManager - { - private static LanguageManager? _mInstance = null; - - private static readonly object _myLock = new(); - private ResourceManager _rm; - - private CultureInfo _ci; - //Used for blocking critical sections on updates - private object _locker = new(); - - private LanguageManager() - { - _rm = new("Krypton.Toolkit.Suite.Extended.Outlook.Grid.Resources.Language.Strings.en-Neutral", Assembly.GetExecutingAssembly()); - _ci = Thread.CurrentThread.CurrentCulture; //CultureInfo.CurrentCulture; - } - - /// - /// Gets or sets the P locker. - /// - /// The P locker. - public object PLocker { get => _locker; set => _locker = value; } - - /// - /// Gets the instance of the singleton. - /// - public static LanguageManager Instance - { - get - { - if (_mInstance == null) - { - lock (_myLock) - { - if (_mInstance == null) - { - _mInstance = new(); - } - } - } - - return _mInstance; - } - } - - /// - /// Get localized string - /// - /// - /// - /// - public string GetString(string name) => _rm.GetString(name, _ci)!; - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Control Visuals/Formatting/CustomFormatRule.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Control Visuals/Formatting/CustomFormatRule.Designer.cs deleted file mode 100644 index 6c14a29b3..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Control Visuals/Formatting/CustomFormatRule.Designer.cs +++ /dev/null @@ -1,284 +0,0 @@ -namespace Krypton.Toolkit.Suite.Extended.Outlook.Grid -{ - partial class CustomFormatRule - { - /// - /// 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(CustomFormatRule)); - this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.kbtnOk = new Krypton.Toolkit.KryptonButton(); - this.kbtnCancel = new Krypton.Toolkit.KryptonButton(); - this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); - this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel(); - this.kcmbFillMode = new Krypton.Toolkit.KryptonComboBox(); - this.pbxPreview = new System.Windows.Forms.PictureBox(); - this.kcmbFormatStyle = new Krypton.Toolkit.KryptonComboBox(); - this.klblFill = new Krypton.Toolkit.KryptonLabel(); - this.kryptonGroup1 = new Krypton.Toolkit.KryptonGroup(); - this.kcolbtnMaximumColour = new Krypton.Toolkit.KryptonColorButton(); - this.kcolbtnIntermediateColour = new Krypton.Toolkit.KryptonColorButton(); - this.kcolbtnMinimumColour = new Krypton.Toolkit.KryptonColorButton(); - this.kryptonLabel2 = new Krypton.Toolkit.KryptonLabel(); - this.kryptonLabel1 = new Krypton.Toolkit.KryptonLabel(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); - this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); - this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbFillMode)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbxPreview)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbFormatStyle)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroup1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroup1.Panel)).BeginInit(); - this.kryptonGroup1.Panel.SuspendLayout(); - this.kryptonGroup1.SuspendLayout(); - this.SuspendLayout(); - // - // kryptonPanel1 - // - this.kryptonPanel1.Controls.Add(this.kbtnOk); - this.kryptonPanel1.Controls.Add(this.kbtnCancel); - this.kryptonPanel1.Controls.Add(this.kryptonBorderEdge1); - this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.kryptonPanel1.Location = new System.Drawing.Point(0, 150); - this.kryptonPanel1.Name = "kryptonPanel1"; - this.kryptonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel1.Size = new System.Drawing.Size(638, 50); - this.kryptonPanel1.TabIndex = 1; - // - // kbtnOk - // - this.kbtnOk.DialogResult = System.Windows.Forms.DialogResult.OK; - this.kbtnOk.Enabled = false; - this.kbtnOk.Location = new System.Drawing.Point(310, 13); - this.kbtnOk.Name = "kbtnOk"; - this.kbtnOk.Size = new System.Drawing.Size(155, 25); - this.kbtnOk.TabIndex = 2; - this.kbtnOk.Values.Text = "kryptonButton2"; - 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(471, 13); - this.kbtnCancel.Name = "kbtnCancel"; - this.kbtnCancel.Size = new System.Drawing.Size(155, 25); - this.kbtnCancel.TabIndex = 1; - this.kbtnCancel.Values.Text = "kryptonButton1"; - this.kbtnCancel.Click += new System.EventHandler(this.kbtnCancel_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(638, 1); - this.kryptonBorderEdge1.Text = "kryptonBorderEdge1"; - // - // kryptonPanel2 - // - this.kryptonPanel2.Controls.Add(this.kcmbFillMode); - this.kryptonPanel2.Controls.Add(this.pbxPreview); - this.kryptonPanel2.Controls.Add(this.kcmbFormatStyle); - this.kryptonPanel2.Controls.Add(this.klblFill); - this.kryptonPanel2.Controls.Add(this.kryptonGroup1); - this.kryptonPanel2.Controls.Add(this.kryptonLabel2); - this.kryptonPanel2.Controls.Add(this.kryptonLabel1); - 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(638, 150); - this.kryptonPanel2.TabIndex = 2; - // - // kcmbFillMode - // - this.kcmbFillMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.kcmbFillMode.DropDownWidth = 208; - this.kcmbFillMode.IntegralHeight = false; - this.kcmbFillMode.Location = new System.Drawing.Point(48, 115); - 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 = 7; - // - // pbxPreview - // - this.pbxPreview.BackColor = System.Drawing.Color.Transparent; - this.pbxPreview.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.pbxPreview.Location = new System.Drawing.Point(79, 40); - this.pbxPreview.Name = "pbxPreview"; - this.pbxPreview.Size = new System.Drawing.Size(318, 22); - this.pbxPreview.TabIndex = 6; - this.pbxPreview.TabStop = false; - this.pbxPreview.Paint += new System.Windows.Forms.PaintEventHandler(this.pbxPreview_Paint); - // - // kcmbFormatStyle - // - this.kcmbFormatStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.kcmbFormatStyle.DropDownWidth = 318; - this.kcmbFormatStyle.IntegralHeight = false; - this.kcmbFormatStyle.Location = new System.Drawing.Point(79, 12); - 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); - // - // klblFill - // - this.klblFill.LabelStyle = Krypton.Toolkit.LabelStyle.NormalPanel; - this.klblFill.Location = new System.Drawing.Point(13, 115); - this.klblFill.Name = "klblFill"; - this.klblFill.Size = new System.Drawing.Size(28, 20); - this.klblFill.TabIndex = 3; - this.klblFill.Values.Text = "Fill:"; - // - // kryptonGroup1 - // - this.kryptonGroup1.GroupBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonGroup1.Location = new System.Drawing.Point(13, 67); - this.kryptonGroup1.Name = "kryptonGroup1"; - // - // kryptonGroup1.Panel - // - this.kryptonGroup1.Panel.Controls.Add(this.kcolbtnMaximumColour); - this.kryptonGroup1.Panel.Controls.Add(this.kcolbtnIntermediateColour); - this.kryptonGroup1.Panel.Controls.Add(this.kcolbtnMinimumColour); - this.kryptonGroup1.Size = new System.Drawing.Size(613, 36); - this.kryptonGroup1.TabIndex = 2; - // - // kcolbtnMaximumColour - // - this.kcolbtnMaximumColour.CustomColorPreviewShape = Krypton.Toolkit.KryptonColorButtonCustomColorPreviewShape.Circle; - this.kcolbtnMaximumColour.Location = new System.Drawing.Point(373, 4); - this.kcolbtnMaximumColour.Name = "kcolbtnMaximumColour"; - this.kcolbtnMaximumColour.SelectedColor = System.Drawing.Color.Transparent; - this.kcolbtnMaximumColour.Size = new System.Drawing.Size(182, 25); - this.kcolbtnMaximumColour.TabIndex = 2; - this.kcolbtnMaximumColour.Values.Image = ((System.Drawing.Image)(resources.GetObject("kcolbtnMaximumColour.Values.Image"))); - this.kcolbtnMaximumColour.Values.RoundedCorners = 8; - this.kcolbtnMaximumColour.Values.Text = "Ma&ximum Colour"; - this.kcolbtnMaximumColour.SelectedColorChanged += new System.EventHandler(this.kcolbtnMaximumColour_SelectedColorChanged); - // - // kcolbtnIntermediateColour - // - this.kcolbtnIntermediateColour.CustomColorPreviewShape = Krypton.Toolkit.KryptonColorButtonCustomColorPreviewShape.Circle; - this.kcolbtnIntermediateColour.Location = new System.Drawing.Point(181, 4); - this.kcolbtnIntermediateColour.Name = "kcolbtnIntermediateColour"; - this.kcolbtnIntermediateColour.SelectedColor = System.Drawing.Color.Transparent; - this.kcolbtnIntermediateColour.Size = new System.Drawing.Size(185, 25); - this.kcolbtnIntermediateColour.TabIndex = 1; - this.kcolbtnIntermediateColour.Values.Image = ((System.Drawing.Image)(resources.GetObject("kcolbtnIntermediateColour.Values.Image"))); - this.kcolbtnIntermediateColour.Values.RoundedCorners = 8; - this.kcolbtnIntermediateColour.Values.Text = "Inter&mediate Colour"; - this.kcolbtnIntermediateColour.SelectedColorChanged += new System.EventHandler(this.kcolbtnIntermediateColour_SelectedColorChanged); - // - // kcolbtnMinimumColour - // - this.kcolbtnMinimumColour.CustomColorPreviewShape = Krypton.Toolkit.KryptonColorButtonCustomColorPreviewShape.Circle; - this.kcolbtnMinimumColour.Location = new System.Drawing.Point(4, 4); - this.kcolbtnMinimumColour.Name = "kcolbtnMinimumColour"; - this.kcolbtnMinimumColour.SelectedColor = System.Drawing.Color.Transparent; - this.kcolbtnMinimumColour.Size = new System.Drawing.Size(171, 25); - this.kcolbtnMinimumColour.TabIndex = 0; - this.kcolbtnMinimumColour.Values.Image = ((System.Drawing.Image)(resources.GetObject("kcolbtnMinimumColour.Values.Image"))); - this.kcolbtnMinimumColour.Values.RoundedCorners = 8; - this.kcolbtnMinimumColour.Values.Text = "M&inimum Colour"; - this.kcolbtnMinimumColour.SelectedColorChanged += new System.EventHandler(this.kcolbtnMinimumColour_SelectedColorChanged); - // - // kryptonLabel2 - // - this.kryptonLabel2.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl; - this.kryptonLabel2.Location = new System.Drawing.Point(13, 40); - this.kryptonLabel2.Name = "kryptonLabel2"; - this.kryptonLabel2.Size = new System.Drawing.Size(60, 20); - this.kryptonLabel2.TabIndex = 1; - this.kryptonLabel2.Values.Text = "Preview:"; - // - // kryptonLabel1 - // - this.kryptonLabel1.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl; - this.kryptonLabel1.Location = new System.Drawing.Point(13, 13); - this.kryptonLabel1.Name = "kryptonLabel1"; - this.kryptonLabel1.Size = new System.Drawing.Size(56, 20); - this.kryptonLabel1.TabIndex = 0; - this.kryptonLabel1.Values.Text = "Format:"; - // - // CustomFormatRule - // - 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(638, 200); - this.Controls.Add(this.kryptonPanel2); - this.Controls.Add(this.kryptonPanel1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; - this.Name = "CustomFormatRule"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Custom Rule"; - this.Load += new System.EventHandler(this.CustomFormatRule_Load); - this.Controls.SetChildIndex(this.kryptonPanel1, 0); - this.Controls.SetChildIndex(this.kryptonPanel2, 0); - ((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(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbFillMode)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbxPreview)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbFormatStyle)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroup1.Panel)).EndInit(); - this.kryptonGroup1.Panel.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroup1)).EndInit(); - this.kryptonGroup1.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private KryptonPanel kryptonPanel1; - private KryptonBorderEdge kryptonBorderEdge1; - private KryptonPanel kryptonPanel2; - private KryptonLabel klblFill; - private KryptonGroup kryptonGroup1; - private KryptonColorButton kcolbtnIntermediateColour; - private KryptonColorButton kcolbtnMinimumColour; - private KryptonLabel kryptonLabel2; - private KryptonLabel kryptonLabel1; - private KryptonButton kbtnOk; - private KryptonButton kbtnCancel; - private KryptonComboBox kcmbFillMode; - private PictureBox pbxPreview; - private KryptonComboBox kcmbFormatStyle; - private KryptonColorButton kcolbtnMaximumColour; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Control Visuals/Formatting/CustomFormatRule.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Control Visuals/Formatting/CustomFormatRule.cs deleted file mode 100644 index 37328a87b..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Control Visuals/Formatting/CustomFormatRule.cs +++ /dev/null @@ -1,225 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - public partial class CustomFormatRule : KryptonForm - { - #region Instance Fields - - private bool _gradient; - - private Color _minimumColour; - - private Color _maximumColour; - - private Color _intermediateColour; - - private EnumConditionalFormatType _conditionalFormatType; - - #endregion - - #region Public - - public bool Gradient => _gradient; - - public Color MaximumColour => _maximumColour; - - public Color MinimumColour => _minimumColour; - - public Color IntermediateColour => _intermediateColour; - - #endregion - - #region Identity - - public CustomFormatRule(EnumConditionalFormatType conditionalFormatType) - { - InitializeComponent(); - - _conditionalFormatType = conditionalFormatType; - - StartUp(); - } - - #endregion - - #region Implementation - - private void StartUp() - { - kbtnCancel.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel; - - kbtnOk.Text = KryptonLanguageManager.GeneralToolkitStrings.OK; - - kcmbFillMode.SelectedIndex = 0; - - kcmbFormatStyle.SelectedIndex = -1; - - _maximumColour = Color.FromArgb(243, 120, 97); - - _intermediateColour = Color.FromArgb(252, 229, 130); - - _minimumColour = Color.FromArgb(84, 179, 122); - - - } - - private void UpdateFormatType(EnumConditionalFormatType conditionalFormatType) - { - switch (conditionalFormatType) - { - case EnumConditionalFormatType.TwoColoursRange: - klblFill.Visible = false; - kcmbFillMode.Visible = false; - kcolbtnMinimumColour.Visible = true; - kcolbtnIntermediateColour.Visible = false; - kcolbtnMaximumColour.Visible = true; - break; - case EnumConditionalFormatType.ThreeColoursRange: - klblFill.Visible = false; - kcmbFillMode.Visible = false; - kcolbtnMinimumColour.Visible = true; - kcolbtnIntermediateColour.Visible = true; - kcolbtnMaximumColour.Visible = true; - break; - case EnumConditionalFormatType.Bar: - klblFill.Visible = true; - kcmbFillMode.Visible = true; - kcolbtnMinimumColour.Visible = true; - kcolbtnIntermediateColour.Visible = false; - kcolbtnMaximumColour.Visible = false; - break; - } - - pbxPreview.Invalidate(); - } - - private void CustomFormatRule_Load(object sender, EventArgs e) - { - kcolbtnMinimumColour.SelectedColor = _minimumColour; - - kcolbtnIntermediateColour.SelectedColor = _intermediateColour; - - kcolbtnMaximumColour.SelectedColor = _maximumColour; - - 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(LanguageManager.Instance.GetString(names[i]))); - } - - kcmbFormatStyle.SelectedIndex = selected; - } - - private void pbxPreview_Paint(object sender, PaintEventArgs e) - { - e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; - switch (_conditionalFormatType) - { - case EnumConditionalFormatType.Bar: - if (_gradient) - { - using (LinearGradientBrush br = new LinearGradientBrush(e.ClipRectangle, _minimumColour, Color.White, LinearGradientMode.Horizontal)) - { - e.Graphics.FillRectangle(br, e.ClipRectangle); - } - } - else - { - using (SolidBrush br = new SolidBrush(_minimumColour)) - { - e.Graphics.FillRectangle(br, e.ClipRectangle); - } - } - using (Pen pen = new Pen(_minimumColour)) //Color.FromArgb(255, 140, 197, 66))) - { - Rectangle rect = e.ClipRectangle; - rect.Inflate(-1, -1); - e.Graphics.DrawRectangle(pen, rect); - } - break; - case EnumConditionalFormatType.TwoColoursRange: - // Draw the background gradient. - using (LinearGradientBrush br = new LinearGradientBrush(e.ClipRectangle, _minimumColour, _maximumColour, LinearGradientMode.Horizontal)) - { - e.Graphics.FillRectangle(br, e.ClipRectangle); - } - break; - case EnumConditionalFormatType.ThreeColoursRange: - // Draw the background gradient. - using (LinearGradientBrush br = new LinearGradientBrush(e.ClipRectangle, _minimumColour, _maximumColour, LinearGradientMode.Horizontal)) - { - ColorBlend blend = new ColorBlend(); - blend.Colors = new[] { _minimumColour, _intermediateColour, _maximumColour }; - blend.Positions = new[] { 0f, 0.5f, 1.0f }; - br.InterpolationColors = blend; - e.Graphics.FillRectangle(br, e.ClipRectangle); - } - break; - } - } - - private void kbtnOk_Click(object sender, EventArgs e) => DialogResult = DialogResult.OK; - - private void kbtnCancel_Click(object sender, EventArgs e) => DialogResult = DialogResult.Cancel; - - private void kcolbtnMinimumColour_SelectedColorChanged(object sender, ColorEventArgs e) - { - _minimumColour = e.Color; - - pbxPreview.Invalidate(); - } - - private void kcolbtnIntermediateColour_SelectedColorChanged(object sender, ColorEventArgs e) - { - _intermediateColour = e.Color; - - pbxPreview.Invalidate(); - } - - private void kcolbtnMaximumColour_SelectedColorChanged(object sender, ColorEventArgs e) - { - _maximumColour = e.Color; - - pbxPreview.Invalidate(); - } - - private void kcmbFormatStyle_SelectedIndexChanged(object sender, EventArgs e) - { - var tag = ((KryptonListItem)kcmbFormatStyle.Items[kcmbFormatStyle.SelectedIndex]).Tag; - - if (tag != null) - { - _conditionalFormatType = (EnumConditionalFormatType)Enum.Parse(typeof(EnumConditionalFormatType), tag.ToString()); - } - - UpdateFormatType(_conditionalFormatType); - } - } - - #endregion -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Control Visuals/Formatting/CustomFormatRule.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Control Visuals/Formatting/CustomFormatRule.resx deleted file mode 100644 index 87a4f0511..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Control Visuals/Formatting/CustomFormatRule.resx +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Controls Toolkit/KryptonOutlookGridLanguageManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Controls Toolkit/KryptonOutlookGridLanguageManager.cs deleted file mode 100644 index 52249ed57..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Controls Toolkit/KryptonOutlookGridLanguageManager.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Krypton.Toolkit.Suite.Extended.Outlook.Grid -{ - public class KryptonOutlookGridLanguageManager : Component - { - #region Public - - /// - /// Gets a set of language strings used by KryptonOutlookGrid that can be localized. - /// - [Category(@"Visuals")] - [Description(@"Collection of language strings.")] - [MergableProperty(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] - [Localizable(true)] - public OutlookGridGeneralStrings OutlookGridGeneralStrings => GeneralStrings; - - private bool ShouldSerializeOutlookGridGeneralStrings() => !GeneralStrings.IsDefault; - - public void ResetOutlookGridGeneralStrings() => GeneralStrings.Reset(); - - #endregion - - #region Static Strings - - public static OutlookGridGeneralStrings GeneralStrings { get; } = new(); - - #endregion - - #region Identity - - public KryptonOutlookGridLanguageManager() - { - - } - - #endregion - - #region Implementation - - [EditorBrowsable(EditorBrowsableState.Never)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public bool IsDefault => !ShouldSerializeOutlookGridGeneralStrings(); - - public void Reset() - { - ResetOutlookGridGeneralStrings(); - } - - #endregion - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Enumerations/DateInterval.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Enumerations/DateInterval.cs deleted file mode 100644 index 2500e1fd4..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Enumerations/DateInterval.cs +++ /dev/null @@ -1,60 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Outlook.Grid -{ - /// - /// Enum of Date interval for the OutlookGridDateTimeGroup - /// - public enum DateInterval - { - /// - /// Day - /// - Day, - - /// - /// Month - /// - Month, - - /// - /// Quarter - /// - Quarter, - - /// - /// Year - /// - Year, - - /// - /// Smart : intelligent grouping like Outlook for dates - /// - Smart - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Enumerations/EnumConditionalFormatType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Enumerations/EnumConditionalFormatType.cs deleted file mode 100644 index decfd3ac6..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Enumerations/EnumConditionalFormatType.cs +++ /dev/null @@ -1,39 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Conditional Formatting type - /// - public enum EnumConditionalFormatType - { - /// - /// Two scale color - /// - TwoColoursRange, - /// - /// Three scale color - /// - ThreeColoursRange, - /// - /// Bar - /// - Bar - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Enumerations/FillMode.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Enumerations/FillMode.cs deleted file mode 100644 index 98d4b209e..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Enumerations/FillMode.cs +++ /dev/null @@ -1,45 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Outlook.Grid -{ - /// - /// Grid filling mode - /// - public enum FillMode - { - /// - /// The grid contains only groups (faster). - /// - GroupsOnly, - - /// - /// The grid contains groups and nodes (no choice, choose this one !) - /// - GroupsAndNodes - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/CollapsedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/CollapsedEventArgs.cs deleted file mode 100644 index 58cb11b01..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/CollapsedEventArgs.cs +++ /dev/null @@ -1,36 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Class for Node collapsed events - /// - /// - public class CollapsedEventArgs : OutlookGridRowNodeEventBase - { - /// - /// Initializes a new instance of the class. - /// - /// The node. - public CollapsedEventArgs(OutlookGridRow node) - : base(node) - { - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/CollapsingEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/CollapsingEventArgs.cs deleted file mode 100644 index 8cab347d7..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/CollapsingEventArgs.cs +++ /dev/null @@ -1,36 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Class for Node collapsing events - /// - /// - public class CollapsingEventArgs : OutlookGridRowNodeCancelEventBase - { - /// - /// Initializes a new instance of the class. - /// - /// The node. - public CollapsingEventArgs(OutlookGridRow node) - : base(node) - { - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/ExpandedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/ExpandedEventArgs.cs deleted file mode 100644 index 2b1709116..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/ExpandedEventArgs.cs +++ /dev/null @@ -1,35 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Class for Node expanding events - /// - /// - public class ExpandedEventArgs : OutlookGridRowNodeEventBase - { - /// - /// Initializes a new instance of the class. - /// - /// The node. - public ExpandedEventArgs(OutlookGridRow node) : base(node) - { - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/ExpandingEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/ExpandingEventArgs.cs deleted file mode 100644 index bb2193617..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/ExpandingEventArgs.cs +++ /dev/null @@ -1,35 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Class for Node expanding events - /// - /// - public class ExpandingEventArgs : OutlookGridRowNodeCancelEventBase - { - /// - /// Initializes a new instance of the class. - /// - /// The node. - public ExpandingEventArgs(OutlookGridRow node) : base(node) - { - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/OutlookGridColumnEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/OutlookGridColumnEventArgs.cs deleted file mode 100644 index bbdc4d547..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/OutlookGridColumnEventArgs.cs +++ /dev/null @@ -1,46 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Class for events of the column in the groupbox. - /// - public class OutlookGridColumnEventArgs : EventArgs - { - private OutlookGridColumn _column; - - /// - /// Constructor - /// - /// The OutlookGridColumn. - public OutlookGridColumnEventArgs(OutlookGridColumn col) - { - _column = col; - } - - /// - /// Gets or sets the name of the column. - /// - public OutlookGridColumn Column - { - get => _column; - set => _column = value; - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/OutlookGridGroupImageEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/OutlookGridGroupImageEventArgs.cs deleted file mode 100644 index c61cb6673..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/OutlookGridGroupImageEventArgs.cs +++ /dev/null @@ -1,46 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Class for events of the group image of a group row. - /// - public class OutlookGridGroupImageEventArgs : EventArgs - { - private OutlookGridRow _row; - - /// - /// Constructor - /// - /// The OutlookGridRow. - public OutlookGridGroupImageEventArgs(OutlookGridRow row) - { - _row = row; - } - - /// - /// Gets or sets the row. - /// - public OutlookGridRow Row - { - get => _row; - set => _row = value; - } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/OutlookGridRowNodeCancelEventBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/OutlookGridRowNodeCancelEventBase.cs deleted file mode 100644 index 99aecc7c0..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/OutlookGridRowNodeCancelEventBase.cs +++ /dev/null @@ -1,46 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Base class OutlookGridRowNode cancellable events - /// - /// - public class OutlookGridRowNodeCancelEventBase : CancelEventArgs - { - private OutlookGridRow _row; - - /// - /// Initializes a new instance of the class. - /// - /// The node. - public OutlookGridRowNodeCancelEventBase(OutlookGridRow node) - { - _row = node; - } - - /// - /// Gets the node. - /// - /// - /// The node. - /// - public OutlookGridRow Node => _row; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/OutlookGridRowNodeEventBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/OutlookGridRowNodeEventBase.cs deleted file mode 100644 index ce2e3424a..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Events/OutlookGridRowNodeEventBase.cs +++ /dev/null @@ -1,46 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Base class for OutlookGridRowNode events - /// - /// - public class OutlookGridRowNodeEventBase : EventArgs - { - private OutlookGridRow _row; - - /// - /// Initializes a new instance of the class. - /// - /// The node. - public OutlookGridRowNodeEventBase(OutlookGridRow node) - { - _row = node; - } - - /// - /// Gets the node. - /// - /// - /// The node. - /// - public OutlookGridRow Node => _row; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Globals/GlobalDeclarations.cs deleted file mode 100644 index 4039571da..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Globals/GlobalDeclarations.cs +++ /dev/null @@ -1,33 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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 - -global using System; -global using System.Collections; -global using System.Collections.Generic; -global using System.ComponentModel; -global using System.Diagnostics; -global using System.Drawing; -global using System.Drawing.Drawing2D; -global using System.Globalization; -global using System.Reflection; -global using System.Resources; -global using System.Text; -global using System.Threading; -global using System.Windows.Forms; -global using System.Xml; -global using System.Linq; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Interfaces/Formatting/IFormatParams.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Interfaces/Formatting/IFormatParams.cs deleted file mode 100644 index 6cdfc3973..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Interfaces/Formatting/IFormatParams.cs +++ /dev/null @@ -1,33 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// Parameter class for Conditionnal Formatting - /// - /// - public interface IFormatParams : ICloneable - { - /// - /// Persists the parameters. - /// - /// The XML writer. - void Persist(XmlWriter writer); - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Interfaces/General/IOutlookGridGroup.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Interfaces/General/IOutlookGridGroup.cs deleted file mode 100644 index bb9de8d50..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Interfaces/General/IOutlookGridGroup.cs +++ /dev/null @@ -1,123 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// - /// IOutlookGridGroup specifies the interface of any implementation of a OutlookGridGroup class - /// Each implementation of the IOutlookGridGroup can override the behaviour of the grouping mechanism - /// Notice also that ICloneable must be implemented. The OutlookGrid makes use of the Clone method of the Group - /// to create new Group clones. Related to this is the OutlookGrid.GroupTemplate property, which determines what - /// type of Group must be cloned. - /// - public interface IOutlookGridGroup : IComparable, ICloneable - { - /// - /// the text to be displayed in the group row - /// - string Text { get; } //set; } - - /// - /// determines the value of the current group. this is used to compare the group value - /// against each item's value. - /// - object? Value { get; set; } - - /// - /// indicates whether the group is collapsed. If it is collapsed, it group items (rows) will - /// not be displayed. - /// - bool Collapsed { get; set; } - - /// - /// specifies the number of items that are part of the current group - /// this value is automatically filled each time the grid is re-drawn - /// e.g. after sorting the grid. - /// - int ItemCount { get; set; } - - /// - /// specifies the default height of the group - /// each group is cloned from the GroupStyle object. Setting the height of this object - /// will also set the default height of each group. - /// - int Height { get; set; } - - //New additions - - /// - /// specifies which column is associated with this group - /// - OutlookGridColumn Column { get; set; } - - /// - /// The list of the rows contained in a group - /// - List Rows { get; set; } - - /// - /// The parent group if any - /// - IOutlookGridGroup? ParentGroup { get; set; } - - /// - /// The level in the depth of groups - /// - int Level { get; set; } - - /// - /// The children groups - /// - OutlookGridGroupCollection Children { get; set; } - - /// - /// Format style of the cell - /// - string FormatStyle { get; set; } - - /// - /// Image associated to the group if any - /// - Image GroupImage { get; set; } - - /// - /// The text associated for the group text (1 item) - /// - string OneItemText { get; set; } - - /// - /// The text associated for the group text (XXX items) - /// - string XxxItemsText { get; set; } - - /// - /// Allows the column to be hidden when it is grouped by - /// - bool AllowHiddenWhenGrouped { get; set; } - - /// - /// Sort groups using count items value - /// - bool SortBySummaryCount { get; set; } - - ///// - ///// Gets or sets the items comparer, if overriding the default IComparable is needed - ///// - IComparer ItemsComparer { get; set; } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Krypton.Toolkit.Suite.Extended.Outlook.Grid 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Krypton.Toolkit.Suite.Extended.Outlook.Grid 2022.csproj deleted file mode 100644 index 22fddd1f1..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Krypton.Toolkit.Suite.Extended.Outlook.Grid 2022.csproj +++ /dev/null @@ -1,245 +0,0 @@ - - - - - - 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 - - - - - - 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 - - - - - - library - Krypton.Toolkit.Suite.Extended.Outlook.Grid - Krypton.Toolkit.Suite.Extended.Outlook.Grid - - false - - true - en - Debug;Release;Nightly;Canary - preview - enable - 6 - true - - - - - - - Krypton.Toolkit.Suite.Extended.Outlook.Grid.Canary - - - - - - Krypton.Toolkit.Suite.Extended.Outlook.Grid.Nightly - - - - - - Krypton.Toolkit.Suite.Extended.Outlook.Grid - - - - - Krypton.Toolkit.Suite.Extended.Outlook.Grid - - - - - - - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements the 'OutlookGrid' control. - - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. - Also, all libraries are included targeting each specific framework version for performance purposes. - - To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - - preview - - - - - - - - - - - True - 4.0.0.0 - True - - - True - 5.0.0.0 - True - - - True - 6.0.0.0 - True - - - - - - - - True - True - Resources.resx - - - - True - True - Strings.en-Neutral.resx - - - - True - True - OutlookGridImageResources.resx - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - ResXFileCodeGenerator - Strings.en-Neutral.Designer.cs - - - - ResXFileCodeGenerator - OutlookGridImageResources.Designer.cs - - - - - - ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.Outlook.Grid\Krypton.Toolkit.Suite.Extended.Outlook.Grid.xml - ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.Outlook.Grid\ - enable - - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Krypton.Toolkit.Suite.Extended.Outlook.Grid.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Krypton.Toolkit.Suite.Extended.Outlook.Grid.licenseheader deleted file mode 100644 index f7309c0f1..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Krypton.Toolkit.Suite.Extended.Outlook.Grid.licenseheader +++ /dev/null @@ -1,18 +0,0 @@ -extensions: .cs -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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 diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/License/License.txt b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/License/License.txt deleted file mode 100644 index 62db0c638..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/License/License.txt +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2020 - 2022, Krypton Suite -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Properties/Resources.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Properties/Resources.Designer.cs deleted file mode 100644 index ac8b2fcc5..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Krypton.Toolkit.Suite.Extended.Outlook.Grid.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Krypton.Toolkit.Suite.Extended.Outlook.Grid.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/CollapseIcon.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/CollapseIcon.png deleted file mode 100644 index c41bda487..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/CollapseIcon.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/CollapseIcon2010.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/CollapseIcon2010.png deleted file mode 100644 index 546a733ce..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/CollapseIcon2010.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient2_blue_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient2_blue_32.png deleted file mode 100644 index b5004fc1b..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient2_blue_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_blue_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_blue_32.png deleted file mode 100644 index 807c86c08..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_blue_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_green_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_green_32.png deleted file mode 100644 index 99175d7dd..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_green_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_pink_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_pink_32.png deleted file mode 100644 index 7cdf53c82..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_pink_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_red_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_red_32.png deleted file mode 100644 index 45eed8334..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_red_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_rose_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_rose_32.png deleted file mode 100644 index 7cdf53c82..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_rose_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_violet_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_violet_32.png deleted file mode 100644 index ecf1edf5a..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_violet_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_yellow_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_yellow_32.png deleted file mode 100644 index 9c03bd4c4..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_gradient_yellow_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_blue_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_blue_32.png deleted file mode 100644 index 80c841d19..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_blue_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_green_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_green_32.png deleted file mode 100644 index f1d246781..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_green_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_pink_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_pink_32.png deleted file mode 100644 index b5bc8b896..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_pink_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_red_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_red_32.png deleted file mode 100644 index e23775f25..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_red_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_rose_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_rose_32.png deleted file mode 100644 index b5bc8b896..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_rose_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_violet_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_violet_32.png deleted file mode 100644 index 06afeb1ac..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_violet_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_yellow_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_yellow_32.png deleted file mode 100644 index 718ea1774..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Databar_solid_yellow_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ExpandIcon.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ExpandIcon.png deleted file mode 100644 index 29081d458..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ExpandIcon.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ExpandIcon2010.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ExpandIcon2010.png deleted file mode 100644 index c21ce6807..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ExpandIcon2010.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Language/Strings.de-DE.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Language/Strings.de-DE.resx deleted file mode 100644 index c229073ec..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Language/Strings.de-DE.resx +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Anfang dieses Monats - - - Ende dieses Monats - - - Vor dem letzten Monat - - - Ab nächstem Monat - - - Vor drei Wochen - - - In drei Wochen - - - In zwei Wochen - - - Nächster Monat - - - Nächste Woche - - - Vorige Woche - - - Vorheriger Monat - - - Heute - - - Morgen - - - Vor zwei Wochen - - - Gestern - - - Ziehen Sie eine Spaltenüberschrift hierher, um nach dieser Spalte zu gruppieren. - - - Optimale Breite (alle Spalten) - - - Gruppierung löschen - - - Sortierung löschen - - - Vollständig einklappen - - - Vollständig ausklappen - - - Nach dieser Spalte gruppieren - - - Gruppierung ausblenden - - - Gruppierung anzeigen - - - Sortierung aufsteigend - - - Sortierung absteigend - - - Auflösen der Gruppe - - - Optimale Breite - - - Kein Datum - - - Alphabetisch - - - Datum - - - 1 Eintrag - - - Einträge - - - Jahr - - - Spalten - - - Schließen - - - Öffnen - - - Gruppenintervall - - - Q1 - - - Q2 - - - Q3 - - - Q4 - - - Tag - Enum - - - Monat - Enum - - - Quartal - Enum - - - Smart - Enum - - - Jahr - Enum - - - Sortieren nach der Gesamtzahl - - - Unbekannt - - - Bedingte Formatierung - - - Data Bars - Enum - - - Farbverlauf füllen - - - Solide Füllung - - - Drei-Farben-Skala - Enum - - - Zweifarbige Skala - Enum - - - Regeln löschen... - - - Benutzerdefiniert... - - - Andere - - - Abbruch - - - Ende - - - Benutzerdefiniert... - - - Benutzerdefinierte Paletten - - - Zu Beginn dieses Jahres - - - Ältere - - - Voriges Jahr - - \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Language/Strings.en-Neutral.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Language/Strings.en-Neutral.Designer.cs deleted file mode 100644 index 3e7f3c0eb..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Language/Strings.en-Neutral.Designer.cs +++ /dev/null @@ -1,649 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Krypton.Toolkit.Suite.Extended.Outlook.Grid.Resources.Language { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Strings_en_Neutral { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Strings_en_Neutral() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Krypton.Toolkit.Suite.Extended.Outlook.Grid.Resources.Language.Strings.en-Neutral" + - "", typeof(Strings_en_Neutral).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to After next month. - /// - internal static string AFTERNEXTMONTH { - get { - return ResourceManager.GetString("AFTERNEXTMONTH", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Alphabetic. - /// - internal static string AlphabeticGroupText { - get { - return ResourceManager.GetString("AlphabeticGroupText", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Data Bars. - /// - internal static string Bar { - get { - return ResourceManager.GetString("Bar", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Before previous month. - /// - internal static string BEFOREPREVIOUSMONTH { - get { - return ResourceManager.GetString("BEFOREPREVIOUSMONTH", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Best fit. - /// - internal static string BESTFIT { - get { - return ResourceManager.GetString("BESTFIT", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Best fit (all columns). - /// - internal static string BESTFITALL { - get { - return ResourceManager.GetString("BESTFITALL", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cancel. - /// - internal static string Cancel { - get { - return ResourceManager.GetString("Cancel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Clear grouping. - /// - internal static string CLEARGROUPING { - get { - return ResourceManager.GetString("CLEARGROUPING", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Clear rules.... - /// - internal static string ClearRules { - get { - return ResourceManager.GetString("ClearRules", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Clear sorting. - /// - internal static string CLEARSORTING { - get { - return ResourceManager.GetString("CLEARSORTING", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Collapse. - /// - internal static string COLLAPSE { - get { - return ResourceManager.GetString("COLLAPSE", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Columns. - /// - internal static string COLUMNS { - get { - return ResourceManager.GetString("COLUMNS", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Conditional formatting. - /// - internal static string CONDITIONALFORMATTING { - get { - return ResourceManager.GetString("CONDITIONALFORMATTING", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Custom.... - /// - internal static string CustomThreeDots { - get { - return ResourceManager.GetString("CustomThreeDots", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Date. - /// - internal static string DateGroupText { - get { - return ResourceManager.GetString("DateGroupText", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Day. - /// - internal static string Day { - get { - return ResourceManager.GetString("Day", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Drag a column header here to group by that column. - /// - internal static string DRAGCOLUMNTOGROUP { - get { - return ResourceManager.GetString("DRAGCOLUMNTOGROUP", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Earlier during this month. - /// - internal static string EARLIERDURINGTHISMONTH { - get { - return ResourceManager.GetString("EARLIERDURINGTHISMONTH", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Earlier this year. - /// - internal static string EARLIERTHISYEAR { - get { - return ResourceManager.GetString("EARLIERTHISYEAR", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Expand. - /// - internal static string EXPAND { - get { - return ResourceManager.GetString("EXPAND", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Finish. - /// - internal static string Finish { - get { - return ResourceManager.GetString("Finish", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Full collapse. - /// - internal static string FULLCOLLAPSE { - get { - return ResourceManager.GetString("FULLCOLLAPSE", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Full expand. - /// - internal static string FULLEXPAND { - get { - return ResourceManager.GetString("FULLEXPAND", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Gradient Fill. - /// - internal static string GradientFill { - get { - return ResourceManager.GetString("GradientFill", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Group by this column. - /// - internal static string GROUP { - get { - return ResourceManager.GetString("GROUP", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Group interval. - /// - internal static string GROUPINTERVAL { - get { - return ResourceManager.GetString("GROUPINTERVAL", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Hide GroupBox. - /// - internal static string HIDEGROUPBOX { - get { - return ResourceManager.GetString("HIDEGROUPBOX", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to In three weeks. - /// - internal static string INTHREEWEEKS { - get { - return ResourceManager.GetString("INTHREEWEEKS", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to In two weeks. - /// - internal static string INTWOWEEKS { - get { - return ResourceManager.GetString("INTWOWEEKS", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Later during this month. - /// - internal static string LATERDURINGTHISMONTH { - get { - return ResourceManager.GetString("LATERDURINGTHISMONTH", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Month. - /// - internal static string Month { - get { - return ResourceManager.GetString("Month", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Next month. - /// - internal static string NEXTMONTH { - get { - return ResourceManager.GetString("NEXTMONTH", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Next Week. - /// - internal static string NEXTWEEK { - get { - return ResourceManager.GetString("NEXTWEEK", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No date. - /// - internal static string NODATE { - get { - return ResourceManager.GetString("NODATE", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Older. - /// - internal static string OLDER { - get { - return ResourceManager.GetString("OLDER", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 1 item. - /// - internal static string OneItem { - get { - return ResourceManager.GetString("OneItem", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Other. - /// - internal static string Other { - get { - return ResourceManager.GetString("Other", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Custom.... - /// - internal static string PaletteCustom { - get { - return ResourceManager.GetString("PaletteCustom", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Custom palettes. - /// - internal static string PaletteCustomHeading { - get { - return ResourceManager.GetString("PaletteCustomHeading", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Previous month. - /// - internal static string PREVIOUSMONTH { - get { - return ResourceManager.GetString("PREVIOUSMONTH", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Previous week. - /// - internal static string PREVIOUSWEEK { - get { - return ResourceManager.GetString("PREVIOUSWEEK", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Previous year. - /// - internal static string PREVIOUSYEAR { - get { - return ResourceManager.GetString("PREVIOUSYEAR", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Q1. - /// - internal static string Q1 { - get { - return ResourceManager.GetString("Q1", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Q2. - /// - internal static string Q2 { - get { - return ResourceManager.GetString("Q2", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Q3. - /// - internal static string Q3 { - get { - return ResourceManager.GetString("Q3", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Q4. - /// - internal static string Q4 { - get { - return ResourceManager.GetString("Q4", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Quarter. - /// - internal static string Quarter { - get { - return ResourceManager.GetString("Quarter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Show GroupBox. - /// - internal static string SHOWGROUPBOX { - get { - return ResourceManager.GetString("SHOWGROUPBOX", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Smart. - /// - internal static string Smart { - get { - return ResourceManager.GetString("Smart", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Solid Fill. - /// - internal static string SolidFill { - get { - return ResourceManager.GetString("SolidFill", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Sort ascending. - /// - internal static string SORTASCENDING { - get { - return ResourceManager.GetString("SORTASCENDING", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Sort by summary count. - /// - internal static string SORTBYSUMMARYCOUNT { - get { - return ResourceManager.GetString("SORTBYSUMMARYCOUNT", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Sort descending. - /// - internal static string SORTDESCENDING { - get { - return ResourceManager.GetString("SORTDESCENDING", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Three Color Scale. - /// - internal static string ThreeColorsRange { - get { - return ResourceManager.GetString("ThreeColorsRange", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Three weeks ago. - /// - internal static string THREEWEEKSAGO { - get { - return ResourceManager.GetString("THREEWEEKSAGO", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Today. - /// - internal static string TODAY { - get { - return ResourceManager.GetString("TODAY", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Tomorrow. - /// - internal static string TOMORROW { - get { - return ResourceManager.GetString("TOMORROW", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Two Color Scale. - /// - internal static string TwoColorsRange { - get { - return ResourceManager.GetString("TwoColorsRange", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Two weeks ago. - /// - internal static string TWOWEEKSAGO { - get { - return ResourceManager.GetString("TWOWEEKSAGO", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Ungroup. - /// - internal static string UNGROUP { - get { - return ResourceManager.GetString("UNGROUP", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unknown. - /// - internal static string UNKNOWN { - get { - return ResourceManager.GetString("UNKNOWN", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to items. - /// - internal static string XXXItems { - get { - return ResourceManager.GetString("XXXItems", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Year. - /// - internal static string Year { - get { - return ResourceManager.GetString("Year", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Year. - /// - internal static string YearGroupText { - get { - return ResourceManager.GetString("YearGroupText", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Yesterday. - /// - internal static string YESTERDAY { - get { - return ResourceManager.GetString("YESTERDAY", resourceCulture); - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Language/Strings.en-Neutral.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Language/Strings.en-Neutral.resx deleted file mode 100644 index 226084882..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Language/Strings.en-Neutral.resx +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - Earlier during this month - - - Later during this month - - - Before previous month - - - After next month - - - Three weeks ago - - - In three weeks - - - In two weeks - - - Next month - - - Next Week - - - Previous week - - - Previous month - - - Today - - - Tomorrow - - - Two weeks ago - - - Yesterday - - - Drag a column header here to group by that column - - - Best fit (all columns) - - - Clear grouping - - - Clear sorting - - - Full collapse - - - Full expand - - - Group by this column - - - Hide GroupBox - - - Show GroupBox - - - Sort ascending - - - Sort descending - - - Ungroup - - - Best fit - - - No date - - - Alphabetic - - - Date - - - 1 item - - - items - - - Year - - - Columns - - - Collapse - - - Expand - - - Group interval - - - Q1 - - - Q2 - - - Q3 - - - Q4 - - - Day - Enum - - - Month - Enum - - - Quarter - Enum - - - Smart - Enum - - - Year - Enum - - - Sort by summary count - - - Unknown - - - Conditional formatting - - - Data Bars - Enum - - - Gradient Fill - - - Solid Fill - - - Three Color Scale - Enum - - - Two Color Scale - Enum - - - Clear rules... - - - Custom... - - - Other - - - Cancel - - - Finish - - - Custom... - - - Custom palettes - - - Earlier this year - - - Older - - - Previous year - - \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Language/Strings.es-ES.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Language/Strings.es-ES.resx deleted file mode 100644 index fd0c2d73d..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Language/Strings.es-ES.resx +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - Antes durante el mes actual - - - Después durante el mes actual - - - Antes del mes anterior - - - Después del mes siguiente - - - Tres semanas atrás - - - Dentro de tres semanas - - - Dentro de dos semanas - - - Siguiente mes - - - Siguiente semana - - - Semana anterior - - - Mes anterior - - - Hoy - - - Mañana - - - Hace dos semanas - - - Ayer - - - Arrastre un encabezado de columna hasta aqui para agrupar los datos - - - Mejor ajuste (todas las columnas) - - - Desagrupar - - - Eliminar ordenación - - - Contraer nodos - - - Expandir nodos - - - Agrupar por esta columna - - - Esconder cuadro de grupo - - - Mostrar cuadro de grupo - - - Orden ascendente - - - Orden descendente - - - Desagrupar - - - Mejor ajuste - - - Sin fecha - - - Alfabético - - - Fecha - - - 1 elemento - - - elementos - - - Año - - - Columnas - - - Contraer - - - Expandir - - - Intervalo de grupo - - - T1 - - - T2 - - - T3 - - - T4 - - - Dia - Enum - - - Mes - Enum - - - Trimestre - Enum - - - Inteligente - Enum - - - Año - Enum - - - Ordernar por sumatorio - - - Desconocido - - - Formato condicional - - - Barras de datos - Enum - - - Relleno de gradiente - - - Relleno sólido - - - Escala de tres colores - Enum - - - Escala de dos colores - Enum - - - Limpiar reglas... - - - Personalizado... - - - Otro - - - Cancel - - - Finalizar - - - Personalizar... - - - Paleta personalizada - - - Antes durante este año - - - Antiguo - - - Año anterior - - \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Language/Strings.fr-FR.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Language/Strings.fr-FR.resx deleted file mode 100644 index 495a07c9d..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/Language/Strings.fr-FR.resx +++ /dev/null @@ -1,298 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Plus tôt durant ce mois - - - Plus tard durant ce mois - - - Avant le mois dernier - - - Après le mois prochain - - - Il y a trois semaines - - - Dans trois semaines - - - Dans deux semaines - - - Mois prochain - - - Semaine prochaine - - - Semaine dernière - - - Mois dernier - - - Aujourd'hui - - - Demain - - - Il y a deux semaines - - - Hier - - - Faites glisser ici un entête de colonne pour grouper par cette colonne - - - Meilleur ajustement (toutes colonnes) - - - Supprimer les regroupements - - - Supprimer le tri - - - Tout réduire - - - Tout étendre - - - Regrouper par ce champ - - - Cacher la boîte de regroupement - - - Afficher la boîte de regroupement - - - Tri croissant - - - Tri décroissant - - - Ne pas regrouper par ce champ - - - Meilleur ajustement - - - Pas de date - - - Alphabétique - - - Date - - - 1 élément - - - éléments - - - Année - - - Colonnes - - - Réduire - - - Etendre - - - Intervalle de regroupement - - - Trim. 1 - - - Trim. 2 - - - Trim. 3 - - - Trim. 4 - - - Jour - Enum - - - Mois - Enum - - - Trimestre - Enum - - - Intelligent - Enum - - - Année - Enum - - - Trier par nombre d'éléments - - - Inconnu - - - Mise en forme conditionnelle - - - Barres de données - Enum - - - Remplissage dégradé - - - Remplissage uni - - - Échelle de trois couleurs - Enum - - - Échelle de deux couleurs - Enum - - - Effacer règles... - - - Personnalisé... - - - Autre - - - Annuler - - - Terminer - - - Plus tôt cette année - - - Plus ancien - - - L'année dernière - - \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/OutlookGridImageResources.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/OutlookGridImageResources.Designer.cs deleted file mode 100644 index 21faeb240..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/OutlookGridImageResources.Designer.cs +++ /dev/null @@ -1,783 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Krypton.Toolkit.Suite.Extended.Outlook.Grid.Resources { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class OutlookGridImageResources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal OutlookGridImageResources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Krypton.Toolkit.Suite.Extended.Outlook.Grid.Resources.OutlookGridImageResources", typeof(OutlookGridImageResources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap CollapseIcon { - get { - object obj = ResourceManager.GetObject("CollapseIcon", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap CollapseIcon2010 { - get { - object obj = ResourceManager.GetObject("CollapseIcon2010", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap color2scale_generic_16 { - get { - object obj = ResourceManager.GetObject("color2scale_generic_16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap color3scale_generic_16 { - get { - object obj = ResourceManager.GetObject("color3scale_generic_16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap databar_generic_16 { - get { - object obj = ResourceManager.GetObject("databar_generic_16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Databar_gradient_blue_32 { - get { - object obj = ResourceManager.GetObject("Databar_gradient_blue_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Databar_gradient_green_32 { - get { - object obj = ResourceManager.GetObject("Databar_gradient_green_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Databar_gradient_pink_32 { - get { - object obj = ResourceManager.GetObject("Databar_gradient_pink_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Databar_gradient_red_32 { - get { - object obj = ResourceManager.GetObject("Databar_gradient_red_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Databar_gradient_rose_32 { - get { - object obj = ResourceManager.GetObject("Databar_gradient_rose_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Databar_gradient_violet_32 { - get { - object obj = ResourceManager.GetObject("Databar_gradient_violet_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Databar_gradient_yellow_32 { - get { - object obj = ResourceManager.GetObject("Databar_gradient_yellow_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Databar_gradient2_blue_32 { - get { - object obj = ResourceManager.GetObject("Databar_gradient2_blue_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Databar_solid_blue_32 { - get { - object obj = ResourceManager.GetObject("Databar_solid_blue_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Databar_solid_green_32 { - get { - object obj = ResourceManager.GetObject("Databar_solid_green_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Databar_solid_pink_32 { - get { - object obj = ResourceManager.GetObject("Databar_solid_pink_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Databar_solid_red_32 { - get { - object obj = ResourceManager.GetObject("Databar_solid_red_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Databar_solid_rose_32 { - get { - object obj = ResourceManager.GetObject("Databar_solid_rose_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Databar_solid_violet_32 { - get { - object obj = ResourceManager.GetObject("Databar_solid_violet_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Databar_solid_yellow_32 { - get { - object obj = ResourceManager.GetObject("Databar_solid_yellow_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap element { - get { - object obj = ResourceManager.GetObject("element", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap element_delete { - get { - object obj = ResourceManager.GetObject("element_delete", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap element_minus_16 { - get { - object obj = ResourceManager.GetObject("element_minus_16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap element_plus_16 { - get { - object obj = ResourceManager.GetObject("element_plus_16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap element_selection_delete { - get { - object obj = ResourceManager.GetObject("element_selection_delete", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap elements_minus_16 { - get { - object obj = ResourceManager.GetObject("elements_minus_16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap elements_plus_16 { - get { - object obj = ResourceManager.GetObject("elements_plus_16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap eraser { - get { - object obj = ResourceManager.GetObject("eraser", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap ExpandIcon { - get { - object obj = ResourceManager.GetObject("ExpandIcon", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap ExpandIcon2010 { - get { - object obj = ResourceManager.GetObject("ExpandIcon2010", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap fit_to_size { - get { - object obj = ResourceManager.GetObject("fit_to_size", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap navigate_minus { - get { - object obj = ResourceManager.GetObject("navigate_minus", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap navigate_plus { - get { - object obj = ResourceManager.GetObject("navigate_plus", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap paint_bucket_green { - get { - object obj = ResourceManager.GetObject("paint_bucket_green", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap sort_az_ascending2 { - get { - object obj = ResourceManager.GetObject("sort_az_ascending2", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap sort_az_descending2 { - get { - object obj = ResourceManager.GetObject("sort_az_descending2", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap sort_up_down_delete_16 { - get { - object obj = ResourceManager.GetObject("sort_up_down_delete_16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap star_yellow { - get { - object obj = ResourceManager.GetObject("star_yellow", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap star_yellow_disabled { - get { - object obj = ResourceManager.GetObject("star_yellow_disabled", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap star_yellow_half_16 { - get { - object obj = ResourceManager.GetObject("star_yellow_half_16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap star0 { - get { - object obj = ResourceManager.GetObject("star0", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap star1 { - get { - object obj = ResourceManager.GetObject("star1", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap star2 { - get { - object obj = ResourceManager.GetObject("star2", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap star3 { - get { - object obj = ResourceManager.GetObject("star3", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap star4 { - get { - object obj = ResourceManager.GetObject("star4", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap star5 { - get { - object obj = ResourceManager.GetObject("star5", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap starhot0 { - get { - object obj = ResourceManager.GetObject("starhot0", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap starhot1 { - get { - object obj = ResourceManager.GetObject("starhot1", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap starhot2 { - get { - object obj = ResourceManager.GetObject("starhot2", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap starhot3 { - get { - object obj = ResourceManager.GetObject("starhot3", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap starhot4 { - get { - object obj = ResourceManager.GetObject("starhot4", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap starhot5 { - get { - object obj = ResourceManager.GetObject("starhot5", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap table_conditional_16 { - get { - object obj = ResourceManager.GetObject("table_conditional_16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap table2_selection_column { - get { - object obj = ResourceManager.GetObject("table2_selection_column", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap ThreeColors_blue_white_red_32 { - get { - object obj = ResourceManager.GetObject("ThreeColors_blue_white_red_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap ThreeColors_green_white_red_32 { - get { - object obj = ResourceManager.GetObject("ThreeColors_green_white_red_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap ThreeColors_green_yellow_red_32 { - get { - object obj = ResourceManager.GetObject("ThreeColors_green_yellow_red_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap ThreeColors_red_white_blue_32 { - get { - object obj = ResourceManager.GetObject("ThreeColors_red_white_blue_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap ThreeColors_red_white_green_32 { - get { - object obj = ResourceManager.GetObject("ThreeColors_red_white_green_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap ThreeColors_red_yellow_green_32 { - get { - object obj = ResourceManager.GetObject("ThreeColors_red_yellow_green_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap TwoColors_blue_white_32 { - get { - object obj = ResourceManager.GetObject("TwoColors_blue_white_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap TwoColors_green_white_32 { - get { - object obj = ResourceManager.GetObject("TwoColors_green_white_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap TwoColors_pink_white_32 { - get { - object obj = ResourceManager.GetObject("TwoColors_pink_white_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap TwoColors_red_white_32 { - get { - object obj = ResourceManager.GetObject("TwoColors_red_white_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap TwoColors_violet_white_32 { - get { - object obj = ResourceManager.GetObject("TwoColors_violet_white_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap TwoColors_white_blue_32 { - get { - object obj = ResourceManager.GetObject("TwoColors_white_blue_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap TwoColors_white_green_32 { - get { - object obj = ResourceManager.GetObject("TwoColors_white_green_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap TwoColors_white_pink_32 { - get { - object obj = ResourceManager.GetObject("TwoColors_white_pink_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap TwoColors_white_red_32 { - get { - object obj = ResourceManager.GetObject("TwoColors_white_red_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap TwoColors_white_violet_32 { - get { - object obj = ResourceManager.GetObject("TwoColors_white_violet_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap TwoColors_white_yellow_32 { - get { - object obj = ResourceManager.GetObject("TwoColors_white_yellow_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap TwoColors_yellow_white_32 { - get { - object obj = ResourceManager.GetObject("TwoColors_yellow_white_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/OutlookGridImageResources.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/OutlookGridImageResources.resx deleted file mode 100644 index d6a2581e1..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/OutlookGridImageResources.resx +++ /dev/null @@ -1,337 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - CollapseIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - CollapseIcon2010.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - color2scale_generic_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - color3scale_generic_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - databar_generic_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Databar_gradient2_blue_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Databar_gradient_blue_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Databar_gradient_green_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Databar_gradient_pink_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Databar_gradient_red_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Databar_gradient_rose_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Databar_gradient_violet_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Databar_gradient_yellow_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Databar_solid_blue_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Databar_solid_green_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Databar_solid_pink_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Databar_solid_red_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Databar_solid_rose_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Databar_solid_violet_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Databar_solid_yellow_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - element.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - elements_minus_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - elements_plus_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - element_delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - element_minus_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - element_plus_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - element_selection_delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - eraser.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ExpandIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ExpandIcon2010.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - fit_to_size.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - navigate_minus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - navigate_plus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - paint_bucket_green.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - sort_az_ascending2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - sort_az_descending2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - sort_up_down_delete_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - star0.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - star1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - star2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - star3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - star4.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - star5.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - starhot0.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - starhot1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - starhot2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - starhot3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - starhot4.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - starhot5.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - star_yellow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - star_yellow_disabled.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - star_yellow_half_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - table2_selection_column.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - table_conditional_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ThreeColors_blue_white_red_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ThreeColors_green_white_red_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ThreeColors_green_yellow_red_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ThreeColors_red_white_blue_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ThreeColors_red_white_green_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ThreeColors_red_yellow_green_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - TwoColors_blue_white_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - TwoColors_green_white_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - TwoColors_pink_white_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - TwoColors_red_white_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - TwoColors_violet_white_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - TwoColors_white_blue_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - TwoColors_white_green_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - TwoColors_white_pink_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - TwoColors_white_red_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - TwoColors_white_violet_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - TwoColors_white_yellow_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - TwoColors_yellow_white_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ThreeColors_blue_white_red_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ThreeColors_blue_white_red_32.png deleted file mode 100644 index ae73b5e28..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ThreeColors_blue_white_red_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ThreeColors_green_white_red_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ThreeColors_green_white_red_32.png deleted file mode 100644 index e455721d1..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ThreeColors_green_white_red_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ThreeColors_green_yellow_red_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ThreeColors_green_yellow_red_32.png deleted file mode 100644 index 45a0d7d33..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ThreeColors_green_yellow_red_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ThreeColors_red_white_blue_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ThreeColors_red_white_blue_32.png deleted file mode 100644 index 04c610ff0..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ThreeColors_red_white_blue_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ThreeColors_red_white_green_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ThreeColors_red_white_green_32.png deleted file mode 100644 index 432f6c42d..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ThreeColors_red_white_green_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ThreeColors_red_yellow_green_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ThreeColors_red_yellow_green_32.png deleted file mode 100644 index e3a61712a..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/ThreeColors_red_yellow_green_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_blue_white_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_blue_white_32.png deleted file mode 100644 index 60f577de8..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_blue_white_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_green_white_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_green_white_32.png deleted file mode 100644 index 11ab3eca4..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_green_white_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_pink_white_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_pink_white_32.png deleted file mode 100644 index d6ba96fcb..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_pink_white_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_red_white_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_red_white_32.png deleted file mode 100644 index 9ebb121d4..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_red_white_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_violet_white_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_violet_white_32.png deleted file mode 100644 index 54875ccd2..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_violet_white_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_white_blue_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_white_blue_32.png deleted file mode 100644 index d48f79c92..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_white_blue_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_white_green_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_white_green_32.png deleted file mode 100644 index cb24224a3..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_white_green_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_white_pink_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_white_pink_32.png deleted file mode 100644 index 5ecd0c300..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_white_pink_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_white_red_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_white_red_32.png deleted file mode 100644 index e94a34b02..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_white_red_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_white_violet_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_white_violet_32.png deleted file mode 100644 index 8c8648354..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_white_violet_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_white_yellow_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_white_yellow_32.png deleted file mode 100644 index e7b120ee0..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_white_yellow_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_yellow_white_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_yellow_white_32.png deleted file mode 100644 index 41f13aeca..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/TwoColors_yellow_white_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/color2scale_generic_16.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/color2scale_generic_16.png deleted file mode 100644 index 8b57ba5f5..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/color2scale_generic_16.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/color3scale_generic_16.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/color3scale_generic_16.png deleted file mode 100644 index e0876a0aa..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/color3scale_generic_16.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/databar_generic_16.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/databar_generic_16.png deleted file mode 100644 index e02a4c5a4..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/databar_generic_16.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/element.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/element.png deleted file mode 100644 index 9747dec88..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/element.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/element_delete.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/element_delete.png deleted file mode 100644 index 421142c38..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/element_delete.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/element_minus_16.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/element_minus_16.png deleted file mode 100644 index e4992dc6e..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/element_minus_16.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/element_plus_16.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/element_plus_16.png deleted file mode 100644 index 8233437e9..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/element_plus_16.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/element_selection_delete.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/element_selection_delete.png deleted file mode 100644 index 4973b061c..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/element_selection_delete.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/elements_minus_16.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/elements_minus_16.png deleted file mode 100644 index 43bf6644d..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/elements_minus_16.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/elements_plus_16.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/elements_plus_16.png deleted file mode 100644 index 43928e946..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/elements_plus_16.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/eraser.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/eraser.png deleted file mode 100644 index 6ac282911..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/eraser.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/fit_to_size.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/fit_to_size.png deleted file mode 100644 index 9734bd66b..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/fit_to_size.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/navigate_minus.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/navigate_minus.png deleted file mode 100644 index bb6527961..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/navigate_minus.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/navigate_plus.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/navigate_plus.png deleted file mode 100644 index 22a7dc84d..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/navigate_plus.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/paint_bucket_green.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/paint_bucket_green.png deleted file mode 100644 index 25e4d9376..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/paint_bucket_green.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/sort_az_ascending2.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/sort_az_ascending2.png deleted file mode 100644 index 28b8a410d..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/sort_az_ascending2.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/sort_az_descending2.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/sort_az_descending2.png deleted file mode 100644 index 0abfff8b2..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/sort_az_descending2.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/sort_up_down_delete_16.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/sort_up_down_delete_16.png deleted file mode 100644 index 0452b9544..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/sort_up_down_delete_16.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star0.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star0.png deleted file mode 100644 index 4e0bc23e1..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star0.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star1.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star1.png deleted file mode 100644 index ffc7184bd..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star1.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star2.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star2.png deleted file mode 100644 index 471ccec73..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star2.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star3.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star3.png deleted file mode 100644 index 888f66743..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star3.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star4.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star4.png deleted file mode 100644 index e256aa6a5..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star4.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star5.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star5.png deleted file mode 100644 index abacb9323..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star5.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star_yellow.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star_yellow.png deleted file mode 100644 index 2990e70df..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star_yellow.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star_yellow_disabled.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star_yellow_disabled.png deleted file mode 100644 index ada6b5c98..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star_yellow_disabled.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star_yellow_half_16.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star_yellow_half_16.png deleted file mode 100644 index 2ae4a0189..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/star_yellow_half_16.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/starhot0.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/starhot0.png deleted file mode 100644 index 4e0bc23e1..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/starhot0.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/starhot1.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/starhot1.png deleted file mode 100644 index a61d3b29f..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/starhot1.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/starhot2.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/starhot2.png deleted file mode 100644 index b5069c7fe..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/starhot2.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/starhot3.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/starhot3.png deleted file mode 100644 index 7973d841e..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/starhot3.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/starhot4.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/starhot4.png deleted file mode 100644 index ed59d9e59..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/starhot4.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/starhot5.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/starhot5.png deleted file mode 100644 index 9b29b45a0..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/starhot5.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/table2_selection_column.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/table2_selection_column.png deleted file mode 100644 index b5aa552f4..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/table2_selection_column.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/table_conditional_16.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/table_conditional_16.png deleted file mode 100644 index 2fe9fc3d9..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Resources/table_conditional_16.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Translations/OutlookGridGeneralStrings.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Translations/OutlookGridGeneralStrings.cs deleted file mode 100644 index f20aa708f..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Translations/OutlookGridGeneralStrings.cs +++ /dev/null @@ -1,648 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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.Suite.Extended.Outlook.Grid -{ - /// Expose a global set of strings used within the Krypton Outlook Grid and that are localizable. - [TypeConverter(nameof(ExpandableObjectConverter))] - public class OutlookGridGeneralStrings : GlobalId - { - #region Static Fields - - private const string DEFAULT_AFTER_NEXT_MONTH = @"After next month"; - - private const string DEFAULT_ALPHABETIC_GROUP_TEXT = @"Alphabetic"; - - private const string DEFAULT_BAR = @"Data Bars"; - - private const string DEFAULT_BEFORE_PREVIOUS_MONTH = @"Before previous month"; - - private const string DEFAULT_BEST_FIT_ALL = @"Best fit (all columns)"; - - private const string DEFAULT_BEST_FIT = @"Best fit"; - - private const string DEFAULT_CANCEL = @"Cancel"; - - private const string DEFAULT_CLEAR_GROUPING = @"Clear grouping"; - - private const string DEFAULT_CLEAR_RULES = @"Clear rules..."; - - private const string DEFAULT_CLEAR_SORTING = @"Clear sorting"; - - private const string DEFAULT_COLLAPSE = @"Collapse"; - - private const string DEFAULT_COLUMNS = @"Columns"; - - private const string DEFAULT_CONDITIONAL_FORMATTING = @"Conditional formatting"; - - private const string DEFAULT_CUSTOM_THREE_DOTS = @"Custom..."; - - private const string DEFAULT_DATE_GROUP_TEXT = @"Date"; - - private const string DEFAULT_DAY = @"Day"; - - private const string DEFAULT_DRAG_COLUMN_TO_GROUP = @"Drag a column header here to group by that column"; - - private const string DEFAULT_EARLIER_DURING_THIS_MONTH = @"Earlier during this month"; - - private const string DEFAULT_EARLIER_THIS_YEAR = @"Earlier this year"; - - private const string DEFAULT_EXPAND = @"Expand"; - - private const string DEFAULT_FINISH = @"Finish"; - - private const string DEFAULT_FULL_COLLAPSE = @"Full collapse"; - - private const string DEFAULT_FULL_EXPAND = @"Full expand"; - - private const string DEFAULT_GRADIENT_FILL = @"Gradient Fill"; - - private const string DEFAULT_GROUP = @"Group by this column"; - - private const string DEFAULT_GROUP_INTERVAL = @"Group interval"; - - private const string DEFAULT_HIDE_GROUP_BOX = @"Hide GroupBox"; - - private const string DEFAULT_IN_THREE_WEEKS = @"In three weeks"; - - private const string DEFAULT_IN_TWO_WEEKS = @"In two weeks"; - - private const string DEFAULT_LATER_DURING_THIS_MONTH = @"Later during this month"; - - private const string DEFAULT_MONTH = @"Month"; - - private const string DEFAULT_NEXT_MONTH = @"Next month"; - - private const string DEFAULT_NEXT_WEEK = @"Next week"; - - private const string DEFAULT_NO_DATE = @"No date"; - - private const string DEFAULT_OLDER = @"Older"; - - private const string DEFAULT_ONE_ITEM = @"1 item"; - - private const string DEFAULT_OTHER = @"Other"; - - private const string DEFAULT_PALETTE_CUSTOM = @"Custom..."; - - private const string DEFAULT_PALETTE_CUSTOM_HEADING = @"Custom palettes"; - - private const string DEFAULT_PREVIOUS_MONTH = @"Previous month"; - - private const string DEFAULT_PREVIOUS_WEEK = @"Previous week"; - - private const string DEFAULT_PREVIOUS_YEAR = @"Previous year"; - - private const string DEFAULT_QUARTER_ONE = @"Q1"; - - private const string DEFAULT_QUARTER_TWO = @"Q2"; - - private const string DEFAULT_QUARTER_THREE = @"Q3"; - - private const string DEFAULT_QUARTER_FOUR = @"Q4"; - - private const string DEFAULT_QUARTER = @"Quarter"; - - private const string DEFAULT_SHOW_GROUP_BOX = @"Show GroupBox"; - - private const string DEFAULT_SMART = @"Smart"; - - private const string DEFAULT_SOLID_FILL = @"Solid Fill"; - - private const string DEFAULT_SORT_ASCENDING = @"Sort ascending"; - - private const string DEFAULT_SORT_BY_SUMMARY_COUNT = @"Sort by summary count"; - - private const string DEFAULT_SORT_DESCENDING = @"Sort descending"; - - private const string DEFAULT_THREE_COLOURS_RANGE = @"Three Colour Scale"; - - private const string DEFAULT_THREE_WEEKS_AGO = @"Three weeks ago"; - - private const string DEFAULT_TODAY = @"Today"; - - private const string DEFAULT_TOMORROW = @"Tomorrow"; - - private const string DEFAULT_TWO_COLOURS_RANGE = @"Two Colour Scale"; - - private const string DEFAULT_TWO_WEEKS_AGO = @"Two weeks ago"; - - private const string DEFAULT_UNGROUP = @"Ungroup"; - - private const string DEFAULT_UNKNOWN = @"Unknown"; - - private const string DEFAULT_NUMBER_OF_ITEMS = @" items"; - - private const string DEFAULT_YEAR = @"Year"; - - private const string DEFAULT_YEAR_GROUP_TEXT = @"Year"; - - private const string DEFAULT_YESTERDAY = @"Yesterday"; - - private const string DEFAULT_MONDAY = @"Monday"; - - private const string DEFAULT_TUESDAY = @"Tuesday"; - - private const string DEFAULT_WEDNESDAY = @"Wednesday"; - - private const string DEFAULT_THURSDAY = @"Thursday"; - - private const string DEFAULT_FRIDAY = @"Friday"; - - private const string DEFAULT_SATURDAY = @"Saturday"; - - private const string DEFAULT_SUNDAY = @"Sunday"; - - private const string DEFAULT_MINIMUM_COLOUR = @"Min Colour"; - - private const string DEFAULT_MEDIUM_COLOUR = @"Medium Colour"; - - private const string DEFAULT_MAXIMUM_COLOUR = @"Max Colour"; - - #endregion - - #region Identity - - public OutlookGridGeneralStrings() - { - Reset(); - } - - public override string ToString() => !IsDefault ? "Modified" : string.Empty; - - #endregion - - #region Public - - [Browsable(false)] - public bool IsDefault => AfterNextMonth.Equals(DEFAULT_AFTER_NEXT_MONTH) && - AlphabeticGroupText.Equals(DEFAULT_ALPHABETIC_GROUP_TEXT) && - Bar.Equals(DEFAULT_BAR) && - BeforePreviousMonth.Equals(DEFAULT_BEFORE_PREVIOUS_MONTH) && - BestFitAll.Equals(DEFAULT_BEST_FIT_ALL) && - BestFit.Equals(DEFAULT_BEST_FIT) && - Cancel.Equals(DEFAULT_CANCEL) && - ClearGrouping.Equals(DEFAULT_CLEAR_GROUPING) && - ClearRules.Equals(DEFAULT_CLEAR_RULES) && - ClearSorting.Equals(DEFAULT_CLEAR_SORTING) && - Collapse.Equals(DEFAULT_COLLAPSE) && - Columns.Equals(DEFAULT_COLUMNS) && - ConditionalFormatting.Equals(DEFAULT_CONDITIONAL_FORMATTING) && - CustomThreeDots.Equals(DEFAULT_CUSTOM_THREE_DOTS) && - DateGroupText.Equals(DEFAULT_DATE_GROUP_TEXT) && - Day.Equals(DEFAULT_DAY) && - DragColumnToGroup.Equals(DEFAULT_DRAG_COLUMN_TO_GROUP) && - EarlierDuringThisMonth.Equals(DEFAULT_EARLIER_DURING_THIS_MONTH) && - EarlierDuringThisYear.Equals(DEFAULT_EARLIER_THIS_YEAR) && - Expand.Equals(DEFAULT_EXPAND) && - Finish.Equals(DEFAULT_FINISH) && - FullCollapse.Equals(DEFAULT_FULL_COLLAPSE) && - FullExpand.Equals(DEFAULT_FULL_EXPAND) && - GradientFill.Equals(DEFAULT_GRADIENT_FILL) && - Group.Equals(DEFAULT_GROUP) && - GroupInterval.Equals(DEFAULT_GROUP_INTERVAL) && - HideGroupBox.Equals(DEFAULT_HIDE_GROUP_BOX) && - InThreeWeeks.Equals(DEFAULT_IN_THREE_WEEKS) && - InTwoWeeks.Equals(DEFAULT_IN_TWO_WEEKS) && - LaterDuringThisMonth.Equals(DEFAULT_LATER_DURING_THIS_MONTH) && - Month.Equals(DEFAULT_MONTH) && - NextMonth.Equals(DEFAULT_NEXT_MONTH) && - NextWeek.Equals(DEFAULT_NEXT_WEEK) && - NoDate.Equals(DEFAULT_NO_DATE) && - Older.Equals(DEFAULT_OLDER) && - OneItem.Equals(DEFAULT_ONE_ITEM) && - Other.Equals(DEFAULT_OTHER) && - PaletteCustom.Equals(DEFAULT_PALETTE_CUSTOM) && - PaletteCustomHeading.Equals(DEFAULT_PALETTE_CUSTOM_HEADING) && - PreviousMonth.Equals(DEFAULT_PREVIOUS_MONTH) && - PreviousWeek.Equals(DEFAULT_PREVIOUS_WEEK) && - PreviousYear.Equals(DEFAULT_PREVIOUS_YEAR) && - QuarterOne.Equals(DEFAULT_QUARTER_ONE) && - QuarterTwo.Equals(DEFAULT_QUARTER_TWO) && - QuarterThree.Equals(DEFAULT_QUARTER_THREE) && - QuarterFour.Equals(DEFAULT_QUARTER_FOUR) && - Quarter.Equals(DEFAULT_QUARTER) && - ShowGroupBox.Equals(DEFAULT_SHOW_GROUP_BOX) && - Smart.Equals(DEFAULT_SMART) && - SolidFill.Equals(DEFAULT_SOLID_FILL) && - SortAscending.Equals(DEFAULT_SORT_ASCENDING) && - SortBySummaryCount.Equals(DEFAULT_SORT_BY_SUMMARY_COUNT) && - SortDescending.Equals(DEFAULT_SORT_DESCENDING) && - ThreeColoursRange.Equals(DEFAULT_THREE_COLOURS_RANGE) && - ThreeWeeksAgo.Equals(DEFAULT_THREE_WEEKS_AGO) && - Today.Equals(DEFAULT_TODAY) && - Tomorrow.Equals(DEFAULT_TOMORROW) && - TwoColoursRange.Equals(DEFAULT_TWO_COLOURS_RANGE) && - TwoWeeksAgo.Equals(DEFAULT_TWO_WEEKS_AGO) && - UnGroup.Equals(DEFAULT_UNGROUP) && - Unknown.Equals(DEFAULT_UNKNOWN) && - NumberOfItems.Equals(DEFAULT_NUMBER_OF_ITEMS) && - Year.Equals(DEFAULT_YEAR) && - YearGroupText.Equals(DEFAULT_YEAR_GROUP_TEXT) && - Yesterday.Equals(DEFAULT_YESTERDAY) && - Monday.Equals(DEFAULT_MONDAY) && - Tuesday.Equals(DEFAULT_TUESDAY) && - Wednesday.Equals(DEFAULT_WEDNESDAY) && - Thursday.Equals(DEFAULT_THURSDAY) && - Friday.Equals(DEFAULT_FRIDAY) && - Saturday.Equals(DEFAULT_SATURDAY) && - Sunday.Equals(DEFAULT_SUNDAY) && - MinimumColour.Equals(DEFAULT_MINIMUM_COLOUR) && - MediumColour.Equals(DEFAULT_MEDIUM_COLOUR) && - MaximumColour.Equals(DEFAULT_MAXIMUM_COLOUR); - - public void Reset() - { - AfterNextMonth = DEFAULT_AFTER_NEXT_MONTH; - - AlphabeticGroupText = DEFAULT_ALPHABETIC_GROUP_TEXT; - - Bar = DEFAULT_BAR; - - BeforePreviousMonth = DEFAULT_BEFORE_PREVIOUS_MONTH; - - BestFitAll = DEFAULT_BEST_FIT_ALL; - - BestFit = DEFAULT_BEST_FIT; - - Cancel = DEFAULT_CANCEL; - - ClearGrouping = DEFAULT_CLEAR_GROUPING; - - ClearRules = DEFAULT_CLEAR_RULES; - - ClearSorting = DEFAULT_CLEAR_SORTING; - - Collapse = DEFAULT_COLLAPSE; - - Columns = DEFAULT_COLUMNS; - - ConditionalFormatting = DEFAULT_CONDITIONAL_FORMATTING; - - CustomThreeDots = DEFAULT_CUSTOM_THREE_DOTS; - - DateGroupText = DEFAULT_DATE_GROUP_TEXT; - - Day = DEFAULT_DAY; - - DragColumnToGroup = DEFAULT_DRAG_COLUMN_TO_GROUP; - - EarlierDuringThisMonth = DEFAULT_EARLIER_DURING_THIS_MONTH; - - EarlierDuringThisYear = DEFAULT_EARLIER_THIS_YEAR; - - Expand = DEFAULT_EXPAND; - - Finish = DEFAULT_FINISH; - - FullCollapse = DEFAULT_FULL_COLLAPSE; - - FullExpand = DEFAULT_FULL_EXPAND; - - GradientFill = DEFAULT_GRADIENT_FILL; - - Group = DEFAULT_GROUP; - - GroupInterval = DEFAULT_GROUP_INTERVAL; - - HideGroupBox = DEFAULT_HIDE_GROUP_BOX; - - InThreeWeeks = DEFAULT_IN_THREE_WEEKS; - - InTwoWeeks = DEFAULT_IN_TWO_WEEKS; - - LaterDuringThisMonth = DEFAULT_LATER_DURING_THIS_MONTH; - - Month = DEFAULT_MONTH; - - NextMonth = DEFAULT_NEXT_MONTH; - - NextWeek = DEFAULT_NEXT_WEEK; - - NoDate = DEFAULT_NO_DATE; - - Older = DEFAULT_OLDER; - - OneItem = DEFAULT_ONE_ITEM; - - Other = DEFAULT_OTHER; - - PaletteCustom = DEFAULT_PALETTE_CUSTOM; - - PaletteCustomHeading = DEFAULT_PALETTE_CUSTOM_HEADING; - - PreviousMonth = DEFAULT_PREVIOUS_MONTH; - - PreviousWeek = DEFAULT_PREVIOUS_WEEK; - - PreviousYear = DEFAULT_PREVIOUS_YEAR; - - QuarterOne = DEFAULT_QUARTER_ONE; - - QuarterTwo = DEFAULT_QUARTER_TWO; - - QuarterThree = DEFAULT_QUARTER_THREE; - - QuarterFour = DEFAULT_QUARTER_FOUR; - - Quarter = DEFAULT_QUARTER; - - ShowGroupBox = DEFAULT_SHOW_GROUP_BOX; - - Smart = DEFAULT_SMART; - - SolidFill = DEFAULT_SOLID_FILL; - - SortAscending = DEFAULT_SORT_ASCENDING; - - SortBySummaryCount = DEFAULT_SORT_BY_SUMMARY_COUNT; - - SortDescending = DEFAULT_SORT_DESCENDING; - - ThreeColoursRange = DEFAULT_THREE_COLOURS_RANGE; - - ThreeWeeksAgo = DEFAULT_THREE_WEEKS_AGO; - - Today = DEFAULT_TODAY; - - Tomorrow = DEFAULT_TOMORROW; - - TwoColoursRange = DEFAULT_TWO_COLOURS_RANGE; - - TwoWeeksAgo = DEFAULT_TWO_WEEKS_AGO; - - UnGroup = DEFAULT_UNGROUP; - - Unknown = DEFAULT_UNKNOWN; - - NumberOfItems = DEFAULT_NUMBER_OF_ITEMS; - - Year = DEFAULT_YEAR; - - YearGroupText = DEFAULT_YEAR_GROUP_TEXT; - - Yesterday = DEFAULT_YESTERDAY; - - Monday = DEFAULT_MONDAY; - - Tuesday = DEFAULT_TUESDAY; - - Wednesday = DEFAULT_WEDNESDAY; - - Thursday = DEFAULT_THURSDAY; - - Friday = DEFAULT_FRIDAY; - - Saturday = DEFAULT_SATURDAY; - - Sunday = DEFAULT_SUNDAY; - - MinimumColour = DEFAULT_MINIMUM_COLOUR; - - MediumColour = DEFAULT_MEDIUM_COLOUR; - - MaximumColour = DEFAULT_MAXIMUM_COLOUR; - } - - #endregion - - #region Properties - - /// Gets or sets the after next month string for the KryptonOutlookGrid. - [Localizable(true)] - [Category(@"Visuals")] - [Description(@"AfterNextMonth string used for Krypton Outlook Grid.")] - [DefaultValue(DEFAULT_AFTER_NEXT_MONTH)] - [RefreshProperties(RefreshProperties.All)] - public string? AfterNextMonth { get; set; } - - /// Gets or sets the alphabetic group string for the KryptonOutlookGrid. - public string AlphabeticGroupText { get; set; } - - /// Gets or sets the bar string for the KryptonOutlookGrid. - public string Bar { get; set; } - - /// Gets or sets the before previous month string for the KryptonOutlookGrid. - public string? BeforePreviousMonth { get; set; } - - /// Gets or sets the best fit all string for the KryptonOutlookGrid. - public string BestFitAll { get; set; } - - /// Gets or sets the best fit string for the KryptonOutlookGrid. - public string BestFit { get; set; } - - /// Gets or sets the cancel string for the KryptonOutlookGrid. - public string Cancel { get; set; } - - /// Gets or sets the clear grouping string for the KryptonOutlookGrid. - public string ClearGrouping { get; set; } - - /// Gets or sets the clear rules string for the KryptonOutlookGrid. - public string ClearRules { get; set; } - - /// Gets or sets the clear sorting string for the KryptonOutlookGrid. - public string ClearSorting { get; set; } - - /// Gets or sets the collapse string for the KryptonOutlookGrid. - public string Collapse { get; set; } - - /// Gets or sets the columns string for the KryptonOutlookGrid. - public string Columns { get; set; } - - /// Gets or sets the conditional formatting string for the KryptonOutlookGrid. - public string ConditionalFormatting { get; set; } - - /// Gets or sets the custom three dots string for the KryptonOutlookGrid. - public string CustomThreeDots { get; set; } - - /// Gets or sets the date group text string for the KryptonOutlookGrid. - public string DateGroupText { get; set; } - - /// Gets or sets the day string for the KryptonOutlookGrid. - public string Day { get; set; } - - /// Gets or sets the drag column to group string for the KryptonOutlookGrid. - public string DragColumnToGroup { get; set; } - - /// Gets or sets the earlier during this month string for the KryptonOutlookGrid. - public string? EarlierDuringThisMonth { get; set; } - - /// Gets or sets the earlier during this year string for the KryptonOutlookGrid. - public string? EarlierDuringThisYear { get; set; } - - /// Gets or sets the expand string for the KryptonOutlookGrid. - public string Expand { get; set; } - - /// Gets or sets the finish string for the KryptonOutlookGrid. - public string Finish { get; set; } - - /// Gets or sets the full collapse string for the KryptonOutlookGrid. - public string FullCollapse { get; set; } - - /// Gets or sets the full expand string for the KryptonOutlookGrid. - public string FullExpand { get; set; } - - /// Gets or sets the gradient fill string for the KryptonOutlookGrid. - public string GradientFill { get; set; } - - /// Gets or sets the group string for the KryptonOutlookGrid. - public string Group { get; set; } - - /// Gets or sets the group interval string for the KryptonOutlookGrid. - public string GroupInterval { get; set; } - - /// Gets or sets the hide group box string for the KryptonOutlookGrid. - public string HideGroupBox { get; set; } - - /// Gets or sets the in three weeks string for the KryptonOutlookGrid. - public string? InThreeWeeks { get; set; } - - /// Gets or sets the in two weeks string for the KryptonOutlookGrid. - public string? InTwoWeeks { get; set; } - - /// Gets or sets the later during this month string for the KryptonOutlookGrid. - public string? LaterDuringThisMonth { get; set; } - - /// Gets or sets the month string for the KryptonOutlookGrid. - public string Month { get; set; } - - /// Gets or sets the next month string for the KryptonOutlookGrid. - public string? NextMonth { get; set; } - - /// Gets or sets the next week string for the KryptonOutlookGrid. - public string? NextWeek { get; set; } - - /// Gets or sets the no date string for the KryptonOutlookGrid. - public string? NoDate { get; set; } - - /// Gets or sets the older string for the KryptonOutlookGrid. - public string? Older { get; set; } - - /// Gets or sets the one item string for the KryptonOutlookGrid. - public string OneItem { get; set; } - - /// Gets or sets the other string for the KryptonOutlookGrid. - public string Other { get; set; } - - /// Gets or sets the palette custom string for the KryptonOutlookGrid. - public string PaletteCustom { get; set; } - - /// Gets or sets the palette custom heading string for the KryptonOutlookGrid. - public string PaletteCustomHeading { get; set; } - - /// Gets or sets the previous month string for the KryptonOutlookGrid. - public string? PreviousMonth { get; set; } - - /// Gets or sets the previous week string for the KryptonOutlookGrid. - public string? PreviousWeek { get; set; } - - /// Gets or sets the previous year string for the KryptonOutlookGrid. - public string? PreviousYear { get; set; } - - /// Gets or sets the quarter one string for the KryptonOutlookGrid. - public string QuarterOne { get; set; } - - /// Gets or sets the quarter two string for the KryptonOutlookGrid. - public string QuarterTwo { get; set; } - - /// Gets or sets the quarter three string for the KryptonOutlookGrid. - public string QuarterThree { get; set; } - - /// Gets or sets the quarter four string for the KryptonOutlookGrid. - public string QuarterFour { get; set; } - - /// Gets or sets the quarter string for the KryptonOutlookGrid. - public string Quarter { get; set; } - - /// Gets or sets the show group box string for the KryptonOutlookGrid. - public string ShowGroupBox { get; set; } - - /// Gets or sets the smart string for the KryptonOutlookGrid. - public string Smart { get; set; } - - /// Gets or sets the solid fill string for the KryptonOutlookGrid. - public string SolidFill { get; set; } - - /// Gets or sets the sort ascending string for the KryptonOutlookGrid. - public string SortAscending { get; set; } - - /// Gets or sets the sort by summary count string for the KryptonOutlookGrid. - public string SortBySummaryCount { get; set; } - - /// Gets or sets the sort descending string for the KryptonOutlookGrid. - public string SortDescending { get; set; } - - /// Gets or sets the three colours range string for the KryptonOutlookGrid. - public string ThreeColoursRange { get; set; } - - /// Gets or sets the three weeks ago string for the KryptonOutlookGrid. - public string? ThreeWeeksAgo { get; set; } - - /// Gets or sets the today string for the KryptonOutlookGrid. - public string? Today { get; set; } - - /// Gets or sets the tomorrow string for the KryptonOutlookGrid. - public string? Tomorrow { get; set; } - - /// Gets or sets the two colours range string for the KryptonOutlookGrid. - public string TwoColoursRange { get; set; } - - /// Gets or sets the two weeks ago string for the KryptonOutlookGrid. - public string? TwoWeeksAgo { get; set; } - - /// Gets or sets the UnGroup string for the KryptonOutlookGrid. - public string UnGroup { get; set; } - - /// Gets or sets the unknown string for the KryptonOutlookGrid. - public string Unknown { get; set; } - - /// Gets or sets the number of items string for the KryptonOutlookGrid. - public string NumberOfItems { get; set; } - - /// Gets or sets the year string for the KryptonOutlookGrid. - public string Year { get; set; } - - /// Gets or sets the year group text string for the KryptonOutlookGrid. - public string YearGroupText { get; set; } - - /// Gets or sets the yesterday string for the KryptonOutlookGrid. - public string? Yesterday { get; set; } - - public string? Monday { get; set; } - - public string? Tuesday { get; set; } - - public string? Wednesday { get; set; } - - public string? Thursday { get; set; } - - public string? Friday { get; set; } - - public string? Saturday { get; set; } - - public string Sunday { get; set; } - - public string MinimumColour { get; set; } - - public string MediumColour { get; set; } - - public string MaximumColour { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/User Control/KryptonOutlookGridGroupBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/User Control/KryptonOutlookGridGroupBox.cs deleted file mode 100644 index e41177782..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/User Control/KryptonOutlookGridGroupBox.cs +++ /dev/null @@ -1,1110 +0,0 @@ -#region BSD License -/* - * Use of this source code is governed by a BSD-style - * license or other governing licenses that can be found in the LICENSE.md file or at - * https://raw.githubusercontent.com/Krypton-Suite/Extended-Toolkit/master/LICENSE - */ - -//-------------------------------------------------------------------------------- -// 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 - -// ReSharper disable ConditionIsAlwaysTrueOrFalse -namespace Krypton.Toolkit.Suite.Extended.Outlook.Grid -{ - /// - /// GroupBox for the Krypton OutlookGrid - /// - public partial class KryptonOutlookGridGroupBox : UserControl - { - #region Design Code - private IContainer components = null; - - private void InitializeComponent() - { - SuspendLayout(); - // - // KryptonOutlookGridGroupBox - // - AllowDrop = true; - Name = "KryptonOutlookGridGroupBox"; - Size = new(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(); - - // 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(_palette); - - // Create accessor objects for the back, border and content - // Store the inherit instances - _paletteBack = new(_paletteRedirect); - _paletteBorder = new(_paletteRedirect); - _paletteContent = new(_paletteRedirect); - _paletteDataGridView = new(_paletteRedirect, null); - _paletteDataGridViewAll = new(_paletteDataGridView, null); - - // Create storage that maps onto the inherit instances - _border = new(_paletteBorder, null); - _dragColumnToGroupText = KryptonOutlookGridLanguageManager.GeneralStrings.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(); - 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(new(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(new(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(new(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()); - _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()); - } - - /// - /// Handles the FullExpand event - /// - /// Source of the event. - /// A EventArgs that contains the event data. - private void OnFullExpand(object sender, EventArgs e) - { - OnFullExpand(new()); - } - - /// - /// Handles the GroupCollapse event - /// - /// Source of the event. - /// A OutlookGridColumnEventArgs that contains the event data. - private void OnGroupCollapse(object sender, EventArgs e) - { - OnGroupCollapse(new(new(_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(new(_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(new(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(new(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(new(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) - { - KryptonContextMenuItem item = (KryptonContextMenuItem)sender; - OutlookGridGroupBoxColumn col = _columnsList[_indexselected]; - OutlookGridColumn colEvent = new(col.ColumnName, null, null, SortOrder.None, -1, -1, null); - colEvent.GroupingType = new OutlookGridDateTimeGroup(null) { Interval = (DateInterval)Enum.Parse(typeof(DateInterval), item.Tag.ToString()) }; - col.GroupInterval = ((OutlookGridDateTimeGroup)colEvent.GroupingType).Interval.ToString(); - //Raise event - OnGroupIntervalClick(new(colEvent)); - } - - /// - /// Handles the OnSortBySummaryCount event - /// - /// Source of the event. - /// A EventArgs that contains the event data. - private void OnSortBySummaryCount(object sender, EventArgs e) - { - KryptonContextMenuItem item = (KryptonContextMenuItem)sender; - OutlookGridGroupBoxColumn col = _columnsList[_indexselected]; - OutlookGridColumn colEvent = new(col.ColumnName, null, null, SortOrder.None, -1, -1, null); - colEvent.GroupingType = new OutlookGridDefaultGroup(null) { SortBySummaryCount = item.Checked }; - col.SortBySummaryCount = item.Checked; - //Raise event - OnSortBySummaryCount(new(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) - colToAdd.GroupInterval = res[5]; - colToAdd.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(new(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) - { - string columnToMove = column.Name, columnName = column.Name, columnText = column.HeaderText; - SortOrder sortOrder; - DataGridViewColumnSortMode sortMode; - string[] 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); - - colToAdd.GroupInterval = res[0]; - colToAdd.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(new(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(KryptonOutlookGridLanguageManager.GeneralStrings.SortAscending, Resources.OutlookGridImageResources.sort_az_ascending2, OnSortAscending); - _menuSortDescending = new(KryptonOutlookGridLanguageManager.GeneralStrings.SortDescending, Resources.OutlookGridImageResources.sort_az_descending2, OnSortDescending); - _menuSeparator1 = new(); - _menuExpand = new(KryptonOutlookGridLanguageManager.GeneralStrings.Expand, Resources.OutlookGridImageResources.element_plus_16, OnGroupExpand); - _menuCollapse = new(KryptonOutlookGridLanguageManager.GeneralStrings.Collapse, Resources.OutlookGridImageResources.element_minus_16, OnGroupCollapse); - _menuUnGroup = new(KryptonOutlookGridLanguageManager.GeneralStrings.UnGroup, Resources.OutlookGridImageResources.element_delete, OnUngroup); - _menuSeparator2 = new(); - _menuFullExpand = new(KryptonOutlookGridLanguageManager.GeneralStrings.FullExpand, Resources.OutlookGridImageResources.elements_plus_16, OnFullExpand); - _menuFullCollapse = new(KryptonOutlookGridLanguageManager.GeneralStrings.FullCollapse, Resources.OutlookGridImageResources.elements_minus_16, OnFullCollapse); - _menuSeparator3 = new(); - _menuClearGrouping = new(KryptonOutlookGridLanguageManager.GeneralStrings.ClearGrouping, Resources.OutlookGridImageResources.element_selection_delete, OnClearGrouping); - _menuHideGroupBox = new(KryptonOutlookGridLanguageManager.GeneralStrings.HideGroupBox, null, OnHideGroupBox); - _menuGroupInterval = new(KryptonOutlookGridLanguageManager.GeneralStrings.GroupInterval); - _menuSortBySummary = new(KryptonOutlookGridLanguageManager.GeneralStrings.SortBySummaryCount, null, OnSortBySummaryCount); - - #endregion - - _menuSortBySummary.CheckOnClick = true; - - //Group Interval - KryptonContextMenuItems groupIntervalItems; - KryptonContextMenuItem it = null; - string[] names = Enum.GetNames(typeof(DateInterval)); - KryptonContextMenuItemBase[] arrayOptions = new KryptonContextMenuItemBase[names.Length]; - for (int i = 0; i < names.Length; i++) - { - it = new(LanguageManager.Instance.GetString(names[i])); - it.Tag = names[i]; - it.Click += OnGroupIntervalClick; - arrayOptions[i] = it; - } - groupIntervalItems = new(arrayOptions); - _menuGroupInterval.Items.Add(groupIntervalItems); - - // Add items inside an items collection (apart from separator1 which is only added if required) - _menuItems = new(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(); - } - - - // 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 == typeof(OutlookGridDateTimeGroup).Name; - if (_menuGroupInterval.Visible) - { - foreach (KryptonContextMenuItem item in ((KryptonContextMenuItems)_menuGroupInterval.Items[0]).Items) - { - 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(list[i].DataGridViewColumn.Name, list[i].DataGridViewColumn.HeaderText, list[i].SortDirection, list[i].GroupingType.GetType().Name); - if (colToAdd.GroupingType == typeof(OutlookGridDateTimeGroup).Name) - { - colToAdd.GroupInterval = ((OutlookGridDateTimeGroup)list[i].GroupingType).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 Toolkit/Krypton.Toolkit.Suite.Extended.PDF/Krypton.Toolkit.Suite.Extended.PDF 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.PDF/Krypton.Toolkit.Suite.Extended.PDF 2022.csproj index 8f75de76f..730f7ddfc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.PDF/Krypton.Toolkit.Suite.Extended.PDF 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.PDF/Krypton.Toolkit.Suite.Extended.PDF 2022.csproj @@ -1,27 +1,15 @@ - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -38,6 +26,7 @@ en Debug;Release;Nightly;Canary true + preview @@ -68,9 +57,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements PDF viewing controls. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements PDF viewing controls. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -78,74 +67,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Palette.Selectors/Krypton.Toolkit.Suite.Extended.Palette.Selectors 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Palette.Selectors/Krypton.Toolkit.Suite.Extended.Palette.Selectors 2022.csproj index df0f84370..f01e6d4a6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Palette.Selectors/Krypton.Toolkit.Suite.Extended.Palette.Selectors 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Palette.Selectors/Krypton.Toolkit.Suite.Extended.Palette.Selectors 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -38,6 +26,7 @@ en Debug;Release;Nightly;Canary true + preview @@ -68,9 +57,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements palette creation tools. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements palette creation tools. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -78,74 +67,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Palette.Selectors/Krypton.Toolkit.Suite.Extended.Palette.Selectors.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Palette.Selectors/Krypton.Toolkit.Suite.Extended.Palette.Selectors.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Palette.Selectors/Krypton.Toolkit.Suite.Extended.Palette.Selectors.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Palette.Selectors/Krypton.Toolkit.Suite.Extended.Palette.Selectors.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Controls Toolkit/KryptonButtonPanel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Controls Toolkit/KryptonButtonPanel.cs index 6e0d3cec8..be475e009 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Controls Toolkit/KryptonButtonPanel.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Controls Toolkit/KryptonButtonPanel.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -38,7 +38,7 @@ private void InitializeComponent() { this.kpnlContents = new Krypton.Toolkit.KryptonPanel(); this.kbeEdge = new Krypton.Toolkit.KryptonBorderEdge(); - ((System.ComponentModel.ISupportInitialize)(this.kpnlContents)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kpnlContents).BeginInit(); this.kpnlContents.SuspendLayout(); this.SuspendLayout(); // @@ -67,7 +67,7 @@ private void InitializeComponent() this.Controls.Add(this.kpnlContents); this.Name = "KryptonButtonPanel"; this.Size = new System.Drawing.Size(614, 50); - ((System.ComponentModel.ISupportInitialize)(this.kpnlContents)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kpnlContents).EndInit(); this.kpnlContents.ResumeLayout(false); this.kpnlContents.PerformLayout(); this.ResumeLayout(false); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Controls Toolkit/KryptonPanelExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Controls Toolkit/KryptonPanelExtended.cs index bd372e24b..252b554a7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Controls Toolkit/KryptonPanelExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Controls Toolkit/KryptonPanelExtended.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Globals/GlobalDeclarations.cs index 6630ec4ef..19002f4da 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Krypton.Toolkit.Suite.Extended.Panels 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Krypton.Toolkit.Suite.Extended.Panels 2022.csproj index 8caafea15..d26b0de60 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Krypton.Toolkit.Suite.Extended.Panels 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Krypton.Toolkit.Suite.Extended.Panels 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements extra 'KryptonPanel' features and functionality. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements extra 'KryptonPanel' features and functionality. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,74 +69,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Krypton.Toolkit.Suite.Extended.Panels.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Krypton.Toolkit.Suite.Extended.Panels.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Krypton.Toolkit.Suite.Extended.Panels.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Krypton.Toolkit.Suite.Extended.Panels.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Resources/Krypton.Toolkit.Suite.Extended.Resources 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Resources/Krypton.Toolkit.Suite.Extended.Resources 2022.csproj index 0f9aeb47a..c603018b4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Resources/Krypton.Toolkit.Suite.Extended.Resources 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Resources/Krypton.Toolkit.Suite.Extended.Resources 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -70,9 +58,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements global resources used by the extended toolkit. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements global resources used by the extended toolkit. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -80,74 +68,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Resources/Krypton.Toolkit.Suite.Extended.Resources.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Resources/Krypton.Toolkit.Suite.Extended.Resources.licenseheader index c890e86c0..a0e5e0a62 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Resources/Krypton.Toolkit.Suite.Extended.Resources.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Resources/Krypton.Toolkit.Suite.Extended.Resources.licenseheader @@ -4,7 +4,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Classes/Generic/MathExtensions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Classes/Generic/MathExtensions.cs index 46fcfbdd6..9ed219219 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Classes/Generic/MathExtensions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Classes/Generic/MathExtensions.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -54,9 +54,9 @@ public static class MathExtensions { #region Constants // Constant containing the value used to convert degrees to radians. - private const float DegConvert = ((float)Math.PI / 180.0f); + private const float DegConvert = (float)Math.PI / 180.0f; // Constant containing the value used to convert radians to degrees. - private const float RadConvert = (180.0f / (float)Math.PI); + private const float RadConvert = 180.0f / (float)Math.PI; /// /// Constant value for π. @@ -86,27 +86,27 @@ public static class MathExtensions public static float FastSin(this float rads) { int i32I = (int)(rads * 0.31830988618379067153776752674503); // 1 / PI. - double radians = rads - ((i32I) * 3.1415926535897932384626433832795); + 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)))))))))))))))); + 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)))))))); } /// @@ -130,27 +130,27 @@ public static float FastSin(this float rads) public static float FastCos(this float rads) { int i32I = (int)(rads * 0.31830988618379067153776752674503); // 1 / PI. - double radians = rads - ((i32I) * 3.1415926535897932384626433832795); + 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))))))))))))))); + 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))))))); } /// @@ -160,7 +160,7 @@ public static float FastCos(this float rads) /// 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; + public static byte Max(this byte value1, byte value2) => value1 > value2 ? value1 : value2; /// /// Function to return the minimum value between two values. @@ -169,7 +169,7 @@ public static float FastCos(this float rads) /// 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; + public static byte Min(this byte value1, byte value2) => value1 < value2 ? value1 : value2; /// /// Function to return the maximum value between two values. @@ -178,7 +178,7 @@ public static float FastCos(this float rads) /// 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; + public static ushort Max(this ushort value1, ushort value2) => value1 > value2 ? value1 : value2; /// /// Function to return the minimum value between two values. @@ -187,7 +187,7 @@ public static float FastCos(this float rads) /// 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; + public static ushort Min(this ushort value1, ushort value2) => value1 < value2 ? value1 : value2; /// /// Function to return the maximum value between two values. @@ -196,7 +196,7 @@ public static float FastCos(this float rads) /// 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; + public static short Max(this short value1, short value2) => value1 > value2 ? value1 : value2; /// /// Function to return the minimum value between two values. @@ -205,7 +205,7 @@ public static float FastCos(this float rads) /// 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; + public static short Min(this short value1, short value2) => value1 < value2 ? value1 : value2; /// /// Function to return the maximum value between two values. @@ -214,7 +214,7 @@ public static float FastCos(this float rads) /// 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; + public static uint Max(this uint value1, uint value2) => value1 > value2 ? value1 : value2; /// /// Function to return the minimum value between two values. @@ -223,7 +223,7 @@ public static float FastCos(this float rads) /// 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; + public static uint Min(this uint value1, uint value2) => value1 < value2 ? value1 : value2; /// /// Function to return the maximum value between two values. @@ -232,7 +232,7 @@ public static float FastCos(this float rads) /// 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; + public static int Max(this int value1, int value2) => value1 > value2 ? value1 : value2; /// /// Function to return the minimum value between two values. @@ -241,7 +241,7 @@ public static float FastCos(this float rads) /// 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; + public static int Min(this int value1, int value2) => value1 < value2 ? value1 : value2; /// /// Function to return the maximum value between two values. @@ -250,7 +250,7 @@ public static float FastCos(this float rads) /// 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; + public static ulong Max(this ulong value1, ulong value2) => value1 > value2 ? value1 : value2; /// /// Function to return the minimum value between two values. @@ -259,7 +259,7 @@ public static float FastCos(this float rads) /// 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; + public static ulong Min(this ulong value1, ulong value2) => value1 < value2 ? value1 : value2; /// /// Function to return the maximum value between two values. @@ -268,7 +268,7 @@ public static float FastCos(this float rads) /// 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; + public static long Max(this long value1, long value2) => value1 > value2 ? value1 : value2; /// /// Function to return the minimum value between two values.. @@ -277,7 +277,7 @@ public static float FastCos(this float rads) /// 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; + public static long Min(this long value1, long value2) => value1 < value2 ? value1 : value2; /// /// Function to return the maximum value between two values. @@ -286,7 +286,7 @@ public static float FastCos(this float rads) /// 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; + public static float Max(this float value1, float value2) => value1 > value2 ? value1 : value2; /// /// Function to return the minimum value between two values. @@ -295,7 +295,7 @@ public static float FastCos(this float rads) /// 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; + public static float Min(this float value1, float value2) => value1 < value2 ? value1 : value2; /// /// Function to return the maximum value between two values. @@ -304,7 +304,7 @@ public static float FastCos(this float rads) /// 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; + public static double Max(this double value1, double value2) => value1 > value2 ? value1 : value2; /// /// Function to return the minimum value between two values. @@ -313,7 +313,7 @@ public static float FastCos(this float rads) /// 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; + public static double Min(this double value1, double value2) => value1 < value2 ? value1 : value2; /// /// Function to return the maximum value between two values. @@ -322,7 +322,7 @@ public static float FastCos(this float rads) /// 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; + public static decimal Max(this decimal value1, decimal value2) => value1 > value2 ? value1 : value2; /// /// Function to return the minimum value between two values. @@ -331,7 +331,7 @@ public static float FastCos(this float rads) /// 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; + public static decimal Min(this decimal value1, decimal value2) => value1 < value2 ? value1 : value2; /// /// Function to return the absolute value of a value. @@ -392,7 +392,7 @@ public static float FastCos(this float rads) /// 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)); + 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. @@ -802,7 +802,7 @@ public static float FastFloor(this float value) { int result = (int)value; - return (value < result) ? result - 1 : result; + return value < result ? result - 1 : result; } /// @@ -815,7 +815,7 @@ public static float FastFloor(this double value) { int result = (int)value; - return (value < result) ? result - 1 : result; + return value < result ? result - 1 : result; } /// @@ -828,7 +828,7 @@ public static float FastCeiling(this float value) { int result = (int)value; - return (value > result) ? result + 1 : result; + return value > result ? result + 1 : result; } /// @@ -841,7 +841,7 @@ public static float FastCeiling(this double value) { int result = (int)value; - return (value > result) ? result + 1 : result; + return value > result ? result + 1 : result; } /// @@ -1323,7 +1323,7 @@ public static long LimitAngle(this long angle, long min = 0, long max = 360) /// 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); + 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. @@ -1333,7 +1333,7 @@ public static long LimitAngle(this long angle, long min = 0, long max = 360) /// 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); + 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. @@ -1343,7 +1343,7 @@ public static long LimitAngle(this long angle, long min = 0, long max = 360) /// 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); + 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 Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Classes/Generic/RibbonMerger.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Classes/Generic/RibbonMerger.cs index 0612e869d..d919d6133 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Classes/Generic/RibbonMerger.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Classes/Generic/RibbonMerger.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -143,8 +143,8 @@ private void UnmergeGroups(KryptonRibbonGroupCollection sourceGroups, KryptonRib { 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))); + 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) { @@ -171,10 +171,10 @@ private void MergeGroups(KryptonRibbonGroupCollection sourceGroups, KryptonRibbo 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))); + 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))) + if (existingGroup is null && !targetGroups.Contains(sourceGroup)) { sourceGroups.Remove(sourceGroup); @@ -206,7 +206,7 @@ private void MergeTabs(KryptonRibbon sourceRibbon, KryptonRibbon targetRibbon) 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))) + if (existingTab is null && !targetRibbon.RibbonTabs.Contains(tab)) { sourceRibbon.RibbonTabs.Remove(tab); @@ -244,7 +244,7 @@ private void UnmergeContexts(KryptonRibbon sourceRibbon, KryptonRibbon targetRib 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))) + if (existing is not null || sourceRibbon.RibbonContexts.Contains(context)) { continue; } @@ -269,7 +269,7 @@ private void MergeContexts(KryptonRibbon sourceRibbon, KryptonRibbon targetRibbo 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))) + if (existing is not null || targetRibbon.RibbonContexts.Contains(context)) { continue; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Classes/KryptonRibbonThemeManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Classes/KryptonRibbonThemeManager.cs index 20589d006..0c724b2d0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Classes/KryptonRibbonThemeManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Classes/KryptonRibbonThemeManager.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,12 +29,14 @@ namespace Krypton.Toolkit.Suite.Extended.Ribbon { internal class KryptonRibbonThemeManager { - #region Theme Array + #region Theme Array + /// /// The supported themes /// // TODO: This should use the list from Z:\GitHub\Krypton-Suite\Standard-Toolkit\Source\Krypton Components\Krypton.Toolkit\Converters\PaletteModeConverter.cs - private static readonly BiDictionary _supportedThemes = new(new Dictionary + private static readonly BiDictionary _supportedThemes = new( + new Dictionary { { @"Professional - System", PaletteMode.ProfessionalSystem }, { @"Professional - Office 2003", PaletteMode.ProfessionalOffice2003 }, @@ -47,7 +49,7 @@ internal class KryptonRibbonThemeManager { @"Office 2007 - White", PaletteMode.Office2007White }, { @"Office 2007 - Black", PaletteMode.Office2007Black }, { @"Office 2007 - Black (Dark Mode)", PaletteMode.Office2007BlackDarkMode }, - { @"Office 2007 - Dark Gray", PaletteMode.Office2007DarkGray }, + //{ @"Office 2007 - Dark Gray", PaletteMode.Office2007DarkGray }, { @"Office 2010 - Blue", PaletteMode.Office2010Blue }, { @"Office 2010 - Blue (Dark Mode)", PaletteMode.Office2010BlueDarkMode }, { @"Office 2010 - Blue (Light Mode)", PaletteMode.Office2010BlueLightMode }, @@ -57,8 +59,8 @@ internal class KryptonRibbonThemeManager { @"Office 2010 - White", PaletteMode.Office2010White }, { @"Office 2010 - Black", PaletteMode.Office2010Black }, { @"Office 2010 - Black (Dark Mode)", PaletteMode.Office2010BlackDarkMode }, - { @"Office 2010 - Dark Gray", PaletteMode.Office2010DarkGray }, - { @"Office 2013 - Dark Gray", PaletteMode.Office2013DarkGray }, + //{ @"Office 2010 - Dark Gray", PaletteMode.Office2010DarkGray }, + //{ @"Office 2013 - Dark Gray", PaletteMode.Office2013DarkGray }, //{ @"Office 2013", PaletteMode.Office2013 }, { @"Office 2013 - White", PaletteMode.Office2013White }, { @"Sparkle - Blue", PaletteMode.SparkleBlue }, @@ -79,7 +81,7 @@ internal class KryptonRibbonThemeManager { @"Microsoft 365 - White", PaletteMode.Microsoft365White }, { @"Microsoft 365 - Black", PaletteMode.Microsoft365Black }, { @"Microsoft 365 - Black (Dark Mode)", PaletteMode.Microsoft365BlackDarkMode }, - { @"Microsoft 365 - Dark Gray", PaletteMode.Microsoft365DarkGray }, + //{ @"Microsoft 365 - Dark Gray", PaletteMode.Microsoft365DarkGray }, { @"Custom", PaletteMode.Custom } }); @@ -152,7 +154,7 @@ public static void SetTheme(string themeName, KryptonManager manager) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } @@ -203,13 +205,13 @@ public static void LoadCustomTheme(KryptonCustomPaletteBase palette, KryptonMana } // Set manager - manager.GlobalPalette = palette; + manager.GlobalCustomPalette = palette; ApplyTheme(PaletteMode.Custom, manager); } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } @@ -238,7 +240,7 @@ public static void ApplyGlobalTheme(KryptonManager manager, PaletteMode paletteM } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } @@ -270,7 +272,7 @@ private static void AddToCollection(IList target, string[] excludes) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Globals/GlobalDeclarations.cs index b3a1d64c0..60e776193 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -37,5 +37,5 @@ global using Krypton.Ribbon; -global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; +global using Krypton.Toolkit.Suite.Extended.Debug.Tools; global using Krypton.Toolkit.Suite.Extended.Shared; \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Group Contents/KryptonRibbonGroupThemeComboBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Group Contents/KryptonRibbonGroupThemeComboBox.cs index 821ac52f6..bc5101b30 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Group Contents/KryptonRibbonGroupThemeComboBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Group Contents/KryptonRibbonGroupThemeComboBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -112,9 +112,9 @@ protected override void OnSelectedIndexChanged(EventArgs e) base.OnSelectedIndexChanged(e); - if ((KryptonRibbonThemeManager.GetThemeManagerMode(Text) == PaletteMode.Custom) && (KryptonCustomPalette != null)) + if (KryptonRibbonThemeManager.GetThemeManagerMode(Text) == PaletteMode.Custom && KryptonCustomPalette != null) { - Manager.GlobalPalette = KryptonCustomPalette; + Manager.GlobalCustomPalette = KryptonCustomPalette; } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Krypton.Toolkit.Suite.Extended.Ribbon 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Krypton.Toolkit.Suite.Extended.Ribbon 2022.csproj index bfac45ea4..2fd69931d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Krypton.Toolkit.Suite.Extended.Ribbon 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Krypton.Toolkit.Suite.Extended.Ribbon 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - + - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements extra 'KryptonRibbon' features and functionality. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements extra 'KryptonRibbon' features and functionality. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -87,9 +75,9 @@ - + - + @@ -99,9 +87,9 @@ - + - + @@ -111,9 +99,9 @@ - + - + @@ -123,9 +111,9 @@ - + - + @@ -160,9 +148,9 @@ - + - + @@ -175,6 +163,7 @@ + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Krypton.Toolkit.Suite.Extended.Ribbon.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Krypton.Toolkit.Suite.Extended.Ribbon.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Krypton.Toolkit.Suite.Extended.Ribbon.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Krypton.Toolkit.Suite.Extended.Ribbon.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Scintilla.NET/Krypton.Toolkit.Suite.Extended.Scintilla.NET 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Scintilla.NET/Krypton.Toolkit.Suite.Extended.Scintilla.NET 2022.csproj index da8885b9d..689f9bf93 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Scintilla.NET/Krypton.Toolkit.Suite.Extended.Scintilla.NET 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Scintilla.NET/Krypton.Toolkit.Suite.Extended.Scintilla.NET 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -38,6 +26,7 @@ en Debug;Release;Nightly;Canary true + preview @@ -68,9 +57,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements the ScintillaNET control and other extras. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements the ScintillaNET control and other extras. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -78,74 +67,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Application Updater/ApplicationUpdaterThemeSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Application Updater/ApplicationUpdaterThemeSettingsManager.cs index 70320de37..b8be72c49 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Application Updater/ApplicationUpdaterThemeSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Application Updater/ApplicationUpdaterThemeSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Application Updater/InternalApplicationUpdaterSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Application Updater/InternalApplicationUpdaterSettingsManager.cs index 330bdd2d1..6bfe7f87e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Application Updater/InternalApplicationUpdaterSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Application Updater/InternalApplicationUpdaterSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Application Updater/XMLFileApplicationUpdaterSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Application Updater/XMLFileApplicationUpdaterSettingsManager.cs index d68914af4..5a311346f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Application Updater/XMLFileApplicationUpdaterSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Application Updater/XMLFileApplicationUpdaterSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Controls/BooleanSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Controls/BooleanSettingsManager.cs index 8d4b66db9..0155c2bd7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Controls/BooleanSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Controls/BooleanSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Controls/ControlThemeSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Controls/ControlThemeSettingsManager.cs index 24c69d86a..e12801344 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Controls/ControlThemeSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Controls/ControlThemeSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Controls/StringSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Controls/StringSettingsManager.cs index 790d0190e..aa0496797 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Controls/StringSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Controls/StringSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Controls/WindowLocationSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Controls/WindowLocationSettingsManager.cs index 7e6d033bf..ddaa0df9f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Controls/WindowLocationSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Controls/WindowLocationSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Core/ColourIntegerSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Core/ColourIntegerSettingsManager.cs index 5a9dc7ac5..3be1099d6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Core/ColourIntegerSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Core/ColourIntegerSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Core/ColourStringSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Core/ColourStringSettingsManager.cs index 06ca08e26..580287bc1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Core/ColourStringSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Core/ColourStringSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Dialogs/Run/RunDialogSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Dialogs/Run/RunDialogSettingsManager.cs index 66fa55980..7451562ee 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Dialogs/Run/RunDialogSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Dialogs/Run/RunDialogSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Dialogs/Text Finder/TextFinderDialogSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Dialogs/Text Finder/TextFinderDialogSettingsManager.cs index e626d1986..f6a50d1ad 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Dialogs/Text Finder/TextFinderDialogSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Dialogs/Text Finder/TextFinderDialogSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Global/GlobalBooleanSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Global/GlobalBooleanSettingsManager.cs index 2a66ad020..a76677399 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Global/GlobalBooleanSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Global/GlobalBooleanSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Global/GlobalStringSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Global/GlobalStringSettingsManager.cs index 575d11dcc..70f096ac5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Global/GlobalStringSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Global/GlobalStringSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Global/GlobalTypefaceSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Global/GlobalTypefaceSettingsManager.cs index 4b68a2dbc..ce83aa5d0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Global/GlobalTypefaceSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Global/GlobalTypefaceSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Helpers/ColourMerger.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Helpers/ColourMerger.cs index b1a844f79..a84fd99e2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Helpers/ColourMerger.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Helpers/ColourMerger.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Helpers/General.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Helpers/General.cs index fea1fb30f..af57ca914 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Helpers/General.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Helpers/General.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Helpers/SettingsVarifier.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Helpers/SettingsVarifier.cs index 2dc01b88c..337cb9ace 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Helpers/SettingsVarifier.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Helpers/SettingsVarifier.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Management/Settings/Theming/ThemeSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Management/Settings/Theming/ThemeSettingsManager.cs index 01f2649e1..4ba94130c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Management/Settings/Theming/ThemeSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Management/Settings/Theming/ThemeSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Other/ExceptionHandler.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Other/ExceptionHandler.cs index 77443f6c8..8a43f0828 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Other/ExceptionHandler.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Other/ExceptionHandler.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,6 +26,8 @@ */ #endregion +using DebugUtilities = Krypton.Toolkit.Suite.Extended.Debug.Tools.DebugUtilities; + namespace Krypton.Toolkit.Suite.Extended.Settings { /// @@ -118,7 +120,7 @@ public static void PrintStackTrace(Exception exc, string fileName) { try { - ExceptionDispatchInfo exceptionInfo = null; + ExceptionDispatchInfo? exceptionInfo = null; if (!File.Exists(fileName)) { @@ -137,7 +139,7 @@ public static void PrintStackTrace(Exception exc, string fileName) } catch (Exception ex) { - ExceptionCapture.CaptureException(ex); + DebugUtilities.NotImplemented(ex.ToString()); } } @@ -165,7 +167,7 @@ public static void PrintExceptionStackTrace(Exception exc, string fileName) } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Other/ExtendedKryptonMessageBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Other/ExtendedKryptonMessageBox.cs index 30a7e20e6..4d53a3c4c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Other/ExtendedKryptonMessageBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Other/ExtendedKryptonMessageBox.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -52,14 +52,14 @@ private void InitialiseComponent() _button1 = new(); _button2 = new(); _doNotShowAgainOption = new(); - ((ISupportInitialize)(_panelMessage)).BeginInit(); + ((ISupportInitialize)_panelMessage).BeginInit(); _panelMessage.SuspendLayout(); - ((ISupportInitialize)(_panelMessageText)).BeginInit(); + ((ISupportInitialize)_panelMessageText).BeginInit(); _panelMessageText.SuspendLayout(); - ((ISupportInitialize)(_panelMessageIcon)).BeginInit(); + ((ISupportInitialize)_panelMessageIcon).BeginInit(); _panelMessageIcon.SuspendLayout(); - ((ISupportInitialize)(_messageIcon)).BeginInit(); - ((ISupportInitialize)(_panelButtons)).BeginInit(); + ((ISupportInitialize)_messageIcon).BeginInit(); + ((ISupportInitialize)_panelButtons).BeginInit(); _panelButtons.SuspendLayout(); SuspendLayout(); // @@ -214,15 +214,15 @@ private void InitialiseComponent() SizeGripStyle = SizeGripStyle.Hide; StartPosition = FormStartPosition.CenterParent; TopMost = true; - ((ISupportInitialize)(_panelMessage)).EndInit(); + ((ISupportInitialize)_panelMessage).EndInit(); _panelMessage.ResumeLayout(false); _panelMessage.PerformLayout(); - ((ISupportInitialize)(_panelMessageText)).EndInit(); + ((ISupportInitialize)_panelMessageText).EndInit(); _panelMessageText.ResumeLayout(false); - ((ISupportInitialize)(_panelMessageIcon)).EndInit(); + ((ISupportInitialize)_panelMessageIcon).EndInit(); _panelMessageIcon.ResumeLayout(false); - ((ISupportInitialize)(_messageIcon)).EndInit(); - ((ISupportInitialize)(_panelButtons)).EndInit(); + ((ISupportInitialize)_messageIcon).EndInit(); + ((ISupportInitialize)_panelButtons).EndInit(); _panelButtons.ResumeLayout(false); _panelButtons.PerformLayout(); ResumeLayout(false); @@ -452,10 +452,10 @@ protected override void WndProc(ref Message m) if (IgnoreAltF4) { // Extract the keys being pressed - Keys keys = ((Keys)((int)m.WParam.ToInt64())); + Keys keys = (Keys)(int)m.WParam.ToInt64(); // If the user standard combination ALT + F4 - if ((keys == Keys.F4) && ((ModifierKeys & Keys.Alt) == Keys.Alt)) + if (keys == Keys.F4 && (ModifierKeys & Keys.Alt) == Keys.Alt) { // Eat the message, so standard window proc does not close the window return; @@ -1063,26 +1063,26 @@ private static DialogResult InternalShow(IWin32Window owner, string button1Text = null, string button2Text = null, string button3Text = null) { // 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)) + 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)) + 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 ((helpInformation != null) && ((options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) != 0)) + if (helpInformation != null && (options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) != 0) { throw new ArgumentException(@"Cannot show message box from a service with help specified", nameof(options)); } // If help information provided or we are not a service/default desktop application then grab an owner for showing the message box IWin32Window showOwner = null; - if ((helpInformation != null) || ((options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) == 0)) + if (helpInformation != 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 ?? FromHandle(PlatformInvoke.GetActiveWindow()); @@ -1099,7 +1099,7 @@ private static DialogResult InternalShow(IWin32Window owner, private void UpdateText() { - Text = (string.IsNullOrEmpty(_caption) ? string.Empty : _caption.Split(Environment.NewLine.ToCharArray())[0]); + Text = string.IsNullOrEmpty(_caption) ? string.Empty : _caption.Split(Environment.NewLine.ToCharArray())[0]; _messageText.StateCommon.Font = MessageBoxTypeface; _messageText.Text = _text; } @@ -1169,14 +1169,14 @@ private void UpdateButtons() switch (_buttons) { case MessageBoxButtons.OK: - _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + _button1.Text = KryptonManager.Strings.GeneralStrings.OK; _button1.DialogResult = DialogResult.OK; _button1.StateCommon.Content.ShortText.Font = MessageBoxTypeface; _button2.Visible = _button3.Visible = false; break; case MessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -1184,8 +1184,8 @@ private void UpdateButtons() _button3.Visible = false; break; case MessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -1194,9 +1194,9 @@ private void UpdateButtons() ControlBox = false; break; case MessageBoxButtons.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; @@ -1205,8 +1205,8 @@ private void UpdateButtons() _button3.StateCommon.Content.ShortText.Font = MessageBoxTypeface; break; case MessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -1214,9 +1214,9 @@ private void UpdateButtons() _button3.Visible = false; break; case MessageBoxButtons.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; @@ -1241,14 +1241,14 @@ private void UpdateButtons(bool timeOutTimerEnabled, int timeOut, DialogResult d switch (_buttons) { case MessageBoxButtons.OK: - _button1.Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + _button1.Text = KryptonManager.Strings.GeneralStrings.OK; _button1.DialogResult = DialogResult.OK; _button1.StateCommon.Content.ShortText.Font = MessageBoxTypeface; _button2.Visible = _button3.Visible = false; break; case MessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -1256,8 +1256,8 @@ private void UpdateButtons(bool timeOutTimerEnabled, int timeOut, DialogResult d _button3.Visible = false; break; case MessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -1266,9 +1266,9 @@ private void UpdateButtons(bool timeOutTimerEnabled, int timeOut, DialogResult d ControlBox = false; break; case MessageBoxButtons.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; @@ -1277,8 +1277,8 @@ private void UpdateButtons(bool timeOutTimerEnabled, int timeOut, DialogResult d _button3.StateCommon.Content.ShortText.Font = MessageBoxTypeface; break; case MessageBoxButtons.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.StateCommon.Content.ShortText.Font = MessageBoxTypeface; @@ -1286,9 +1286,9 @@ private void UpdateButtons(bool timeOutTimerEnabled, int timeOut, DialogResult d _button3.Visible = false; break; case MessageBoxButtons.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; @@ -1459,7 +1459,7 @@ private Size UpdateMessageSizing(IWin32Window showOwner) // 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.Width *= 2 / 3.0f; scaledMonitorSize.Height *= 0.95f; _messageText.UpdateFont(); SizeF messageSize = g.MeasureString(_text, _messageText.Font, scaledMonitorSize); @@ -1468,8 +1468,8 @@ private Size UpdateMessageSizing(IWin32Window showOwner) float messageXSize = Math.Max(messageSize.Width, captionSize.Width); // Work out DPI adjustment factor - float factorX = g.DpiX > 96 ? ((1.0f * g.DpiX) / 96) : 1.0f; - float factorY = g.DpiY > 96 ? ((1.0f * g.DpiY) / 96) : 1.0f; + float factorX = g.DpiX > 96 ? 1.0f * g.DpiX / 96 : 1.0f; + float factorY = g.DpiY > 96 ? 1.0f * g.DpiY / 96 : 1.0f; messageSize.Width = messageXSize * factorX; messageSize.Height = messageSize.Height * factorY; @@ -1578,23 +1578,23 @@ private Size UpdateButtonsSizing() _button1.Size = maxButtonSize; // Size the panel for the buttons - _panelButtons.Size = new((maxButtonSize.Width * numButtons) + (GAP * (numButtons + 1)), maxButtonSize.Height + (GAP * 2)); + _panelButtons.Size = new(maxButtonSize.Width * numButtons + GAP * (numButtons + 1), maxButtonSize.Height + GAP * 2); // Button area is the number of buttons with gaps between them and 10 pixels around all edges - return new((maxButtonSize.Width * numButtons) + (GAP * (numButtons + 1)), maxButtonSize.Height + (GAP * 2)); + return new(maxButtonSize.Width * numButtons + GAP * (numButtons + 1), maxButtonSize.Height + GAP * 2); } private void button_keyDown(object sender, KeyEventArgs e) { // Escape key kills the dialog if we allow it to be closed - if ((e.KeyCode == Keys.Escape) && ControlBox) + if (e.KeyCode == Keys.Escape && ControlBox) { Close(); } else { // Pressing Ctrl+C should copy message text into the clipboard - if ((e.Modifiers == Keys.Control) && (e.KeyCode == Keys.C)) + if (e.Modifiers == Keys.Control && e.KeyCode == Keys.C) { StringBuilder sb = new(); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Other/StringCollectionSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Other/StringCollectionSettingsManager.cs index 9ceae6e19..ddc6175d8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Other/StringCollectionSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Other/StringCollectionSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/AllMergedColourSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/AllMergedColourSettingsManager.cs index 714a3df4e..1c0734afb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/AllMergedColourSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/AllMergedColourSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/BasicColourSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/BasicColourSettingsManager.cs index 65ef2d03f..615e910ea 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/BasicColourSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/BasicColourSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/CustomColourSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/CustomColourSettingsManager.cs index a2c3f8830..2139bb88d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/CustomColourSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/CustomColourSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/CustomTextColourSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/CustomTextColourSettingsManager.cs index 5e2088edd..41e15e37c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/CustomTextColourSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/CustomTextColourSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/LinkTextColourSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/LinkTextColourSettingsManager.cs index 00d5e2c58..0ffc1ef25 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/LinkTextColourSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/LinkTextColourSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/MiscellaneousColourSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/MiscellaneousColourSettingsManager.cs index 3aa6817ef..a1bf034d4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/MiscellaneousColourSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/MiscellaneousColourSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/StandardControlTextColourSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/StandardControlTextColourSettingsManager.cs index 8caf4132e..5a67f8f04 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/StandardControlTextColourSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/StandardControlTextColourSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/TextColourSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/TextColourSettingsManager.cs index 7f09e3aac..6bcb2bbdc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/TextColourSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/TextColourSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/ColourCollectionStringSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/ColourCollectionStringSettingsManager.cs index 0afc1fb46..579d1dd7d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/ColourCollectionStringSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/ColourCollectionStringSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/ColourIntensitySettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/ColourIntensitySettingsManager.cs index 19d197cb0..b5307c7d9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/ColourIntensitySettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/ColourIntensitySettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/GeneralPaletteExplorerSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/GeneralPaletteExplorerSettingsManager.cs index 825867757..968e665bb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/GeneralPaletteExplorerSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/GeneralPaletteExplorerSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/PaletteExplorerBooleanSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/PaletteExplorerBooleanSettingsManager.cs index 525014a29..8b90492cd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/PaletteExplorerBooleanSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/PaletteExplorerBooleanSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/PaletteExplorerWindowLocationSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/PaletteExplorerWindowLocationSettingsManager.cs index aebb8caab..affbcbe58 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/PaletteExplorerWindowLocationSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/PaletteExplorerWindowLocationSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/PaletteThemeSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/PaletteThemeSettingsManager.cs index cd9b61b45..c97ecad0c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/PaletteThemeSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/PaletteThemeSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/PaletteTypefaceSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/PaletteTypefaceSettingsManager.cs index 44de2049b..60d318887 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/PaletteTypefaceSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/General/PaletteTypefaceSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Properties/ColourPropertyWindowSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Properties/ColourPropertyWindowSettingsManager.cs index 5eada51b8..addd6c0f9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Properties/ColourPropertyWindowSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Properties/ColourPropertyWindowSettingsManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Globals/GlobalDeclarations.cs index b029e3980..7e9a3c38e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Globals/GlobalDeclarations.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Krypton.Toolkit.Suite.Extended.Settings 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Krypton.Toolkit.Suite.Extended.Settings 2022.csproj index c6c6d4878..70fdd4bc0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Krypton.Toolkit.Suite.Extended.Settings 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Krypton.Toolkit.Suite.Extended.Settings 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -70,9 +58,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements global settings used by the extended toolkit. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements global settings used by the extended toolkit. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -80,74 +68,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + @@ -229,11 +179,12 @@ - + + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Krypton.Toolkit.Suite.Extended.Settings.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Krypton.Toolkit.Suite.Extended.Settings.licenseheader index c890e86c0..a0e5e0a62 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Krypton.Toolkit.Suite.Extended.Settings.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Krypton.Toolkit.Suite.Extended.Settings.licenseheader @@ -4,7 +4,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Application Updater/InternalApplicationUpdaterSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Application Updater/InternalApplicationUpdaterSettings.Designer.cs index 25f1805be..68587c926 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Application Updater/InternalApplicationUpdaterSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Application Updater/InternalApplicationUpdaterSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Application Updater/ThemeSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Application Updater/ThemeSettings.Designer.cs index 3b78004c7..3e9b31a1e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Application Updater/ThemeSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Application Updater/ThemeSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Application Updater/XMLFileApplicationUpdaterSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Application Updater/XMLFileApplicationUpdaterSettings.Designer.cs index d3b3a805b..ee2cd34a9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Application Updater/XMLFileApplicationUpdaterSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Application Updater/XMLFileApplicationUpdaterSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Controls/BooleanSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Controls/BooleanSettings.Designer.cs index 545131046..ff73c7ece 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Controls/BooleanSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Controls/BooleanSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Controls/ControlThemeSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Controls/ControlThemeSettings.Designer.cs index 7328bfe9d..d58720712 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Controls/ControlThemeSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Controls/ControlThemeSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Controls/StringSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Controls/StringSettings.Designer.cs index f84e67f5d..1614c3dd9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Controls/StringSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Controls/StringSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Controls/WindowLocationSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Controls/WindowLocationSettings.Designer.cs index fbc2a5280..25fb05c4e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Controls/WindowLocationSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Controls/WindowLocationSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Core/ColourIntegerSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Core/ColourIntegerSettings.Designer.cs index 572a64eff..6c0efff58 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Core/ColourIntegerSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Core/ColourIntegerSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Core/ColourStringSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Core/ColourStringSettings.Designer.cs index b08ac68d0..6587c6e5f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Core/ColourStringSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Core/ColourStringSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Core/CoreSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Core/CoreSettings.Designer.cs index 1197826d8..2c9e6639f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Core/CoreSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Core/CoreSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Dialogs/Run/RunDialogSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Dialogs/Run/RunDialogSettings.Designer.cs index da1b82d11..9dd666efb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Dialogs/Run/RunDialogSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Dialogs/Run/RunDialogSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Dialogs/Text Finder/TextFinderDialogSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Dialogs/Text Finder/TextFinderDialogSettings.Designer.cs index 3e2e8da46..6e99126b0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Dialogs/Text Finder/TextFinderDialogSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Dialogs/Text Finder/TextFinderDialogSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Globals/GlobalBooleanSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Globals/GlobalBooleanSettings.Designer.cs index 8e11392a4..060c71604 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Globals/GlobalBooleanSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Globals/GlobalBooleanSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Globals/GlobalEnumerationSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Globals/GlobalEnumerationSettings.Designer.cs index b40423ced..e4f0f83ae 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Globals/GlobalEnumerationSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Globals/GlobalEnumerationSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Globals/GlobalStringSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Globals/GlobalStringSettings.Designer.cs index 015ae8cb4..14820e713 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Globals/GlobalStringSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Globals/GlobalStringSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Other/StringCollectionSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Other/StringCollectionSettings.Designer.cs index 3b569aedd..483c3b278 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Other/StringCollectionSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Other/StringCollectionSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/AllMergedColourSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/AllMergedColourSettings.Designer.cs index 69fb34832..d95f3fdc3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/AllMergedColourSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/AllMergedColourSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/BasicColourSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/BasicColourSettings.Designer.cs index 0caebe47f..172fae9ca 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/BasicColourSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/BasicColourSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/CustomColourSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/CustomColourSettings.Designer.cs index 11368779f..9d49b0629 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/CustomColourSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/CustomColourSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/CustomTextColourSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/CustomTextColourSettings.Designer.cs index 84d6a0872..f4b13a050 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/CustomTextColourSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/CustomTextColourSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/LinkTextColourSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/LinkTextColourSettings.Designer.cs index 670da54a7..d4c80f39c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/LinkTextColourSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/LinkTextColourSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/MiscellaneousColourSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/MiscellaneousColourSettings.Designer.cs index 92e4121e0..85dfaf1e7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/MiscellaneousColourSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/MiscellaneousColourSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/StandardControlTextColourSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/StandardControlTextColourSettings.Designer.cs index 96b91d883..cde203972 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/StandardControlTextColourSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/StandardControlTextColourSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/TextColourSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/TextColourSettings.Designer.cs index 9bdb2884f..f5c822b60 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/TextColourSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Colours/TextColourSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/ColourCollectionStringSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/ColourCollectionStringSettings.Designer.cs index 49bbef140..b465c20e3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/ColourCollectionStringSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/ColourCollectionStringSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/ColourIntensitySettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/ColourIntensitySettings.Designer.cs index 38db9a1a3..1d775276f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/ColourIntensitySettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/ColourIntensitySettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/GeneralPaletteExplorerSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/GeneralPaletteExplorerSettings.Designer.cs index 7ff070e97..90b159edd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/GeneralPaletteExplorerSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/GeneralPaletteExplorerSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/PaletteExplorerBooleanSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/PaletteExplorerBooleanSettings.Designer.cs index da9b11b5a..c1d18dea1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/PaletteExplorerBooleanSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/PaletteExplorerBooleanSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/PaletteExplorerWindowLocationSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/PaletteExplorerWindowLocationSettings.Designer.cs index 1f997b83c..b21fb1a32 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/PaletteExplorerWindowLocationSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/PaletteExplorerWindowLocationSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/PaletteThemeSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/PaletteThemeSettings.Designer.cs index 6a2a5e2ca..0f5ca8392 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/PaletteThemeSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/PaletteThemeSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/PaletteTypefaceSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/PaletteTypefaceSettings.Designer.cs index 41c732651..7a3bbd353 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/PaletteTypefaceSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/General/PaletteTypefaceSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Properties/ColourPropertyWindowSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Properties/ColourPropertyWindowSettings.Designer.cs index b6b6e62a7..171a00537 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Properties/ColourPropertyWindowSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Palette Explorer/Properties/ColourPropertyWindowSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Theming/GlobalThemeSettings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Theming/GlobalThemeSettings.Designer.cs index 140a319fb..4e07a7fad 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Theming/GlobalThemeSettings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Settings/Theming/GlobalThemeSettings.Designer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Control Visuals/CommonDialogHandler.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Control Visuals/CommonDialogHandler.cs index 61da77535..ad0cc1ca5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Control Visuals/CommonDialogHandler.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Control Visuals/CommonDialogHandler.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -73,10 +73,11 @@ public CommonDialogHandler(bool embed) _embed = embed; // Gain access to the global palette _manager = new KryptonManager(); - _backColour = _manager.GlobalPalette.GetBackColor1(PaletteBackStyle.PanelClient, PaletteState.Normal); - _defaultFontColour = _manager.GlobalPalette.GetContentShortTextColor1(PaletteContentStyle.LabelNormalPanel, PaletteState.Normal); - _inputFontColour = _manager.GlobalPalette.GetContentShortTextColor1(PaletteContentStyle.InputControlStandalone, PaletteState.Normal); - _labelFont = _manager.GlobalPalette.GetContentShortTextFont(PaletteContentStyle.LabelNormalPanel, PaletteState.Normal); + // ToDo: Use CurrentGlobal_Palette equivalent + //_backColour = _manager.GlobalPaletteMode!.GetBackColor1(PaletteBackStyle.PanelClient, PaletteState.Normal); + //_defaultFontColour = _manager.GlobalCustomPalette!.GetContentShortTextColor1(PaletteContentStyle.LabelNormalPanel, PaletteState.Normal); + //_inputFontColour = _manager.GlobalCustomPalette!.GetContentShortTextColor1(PaletteContentStyle.InputControlStandalone, PaletteState.Normal); + //_labelFont = _manager.GlobalCustomPalette?.GetContentShortTextFont(PaletteContentStyle.LabelNormalPanel, PaletteState.Normal)!; } #endregion @@ -133,8 +134,8 @@ public CommonDialogHandler(bool embed) var labelLogFont = _labelFont.ToHfont(); //var buttonFont = _kryptonManager.GlobalPalette.GetContentShortTextFont(PaletteContentStyle.ButtonStandalone, PaletteState.Normal); //var buttonLogFont = buttonFont.ToHfont(); - var editFont = _manager.GlobalPalette.GetContentShortTextFont(PaletteContentStyle.InputControlStandalone, PaletteState.Normal); - var editLogFont = editFont.ToHfont(); + var editFont = _manager.GlobalCustomPalette?.GetContentShortTextFont(PaletteContentStyle.InputControlStandalone, PaletteState.Normal); + var editLogFont = editFont!.ToHfont(); foreach (Attributes control in _controls) { switch (control.ClassName) @@ -212,8 +213,8 @@ public CommonDialogHandler(bool embed) { PlatformInvoke.SendMessage(control.hWnd, PlatformInvoke.WM_.SETFONT, labelLogFont, new IntPtr(1)); } - else if (((control.WinInfo.dwStyle & PlatformInvoke.BS_.AUTORADIOBUTTON) == PlatformInvoke.BS_.AUTORADIOBUTTON) - || ((control.WinInfo.dwStyle & PlatformInvoke.BS_.RADIOBUTTON) == PlatformInvoke.BS_.RADIOBUTTON)) + else if ((control.WinInfo.dwStyle & PlatformInvoke.BS_.AUTORADIOBUTTON) == PlatformInvoke.BS_.AUTORADIOBUTTON + || (control.WinInfo.dwStyle & PlatformInvoke.BS_.RADIOBUTTON) == PlatformInvoke.BS_.RADIOBUTTON) { //PlatformInvoke.SendMessage(control.hWnd, PlatformInvoke.WM_.SETFONT, buttonLogFont, new IntPtr(1)); var panel = new KryptonPanel @@ -241,10 +242,10 @@ public CommonDialogHandler(bool embed) }; PlatformInvoke.ShowWindow(control.hWnd, PlatformInvoke.ShowWindowCommands.SW_HIDE); } - else if (((control.WinInfo.dwStyle & PlatformInvoke.BS_.AUTO3STATE) == PlatformInvoke.BS_.AUTO3STATE) - || ((control.WinInfo.dwStyle & PlatformInvoke.BS_._3STATE) == PlatformInvoke.BS_._3STATE) - || ((control.WinInfo.dwStyle & PlatformInvoke.BS_.AUTOCHECKBOX) == PlatformInvoke.BS_.AUTOCHECKBOX) - || ((control.WinInfo.dwStyle & PlatformInvoke.BS_.CHECKBOX) == PlatformInvoke.BS_.CHECKBOX)) + else if ((control.WinInfo.dwStyle & PlatformInvoke.BS_.AUTO3STATE) == PlatformInvoke.BS_.AUTO3STATE + || (control.WinInfo.dwStyle & PlatformInvoke.BS_._3STATE) == PlatformInvoke.BS_._3STATE + || (control.WinInfo.dwStyle & PlatformInvoke.BS_.AUTOCHECKBOX) == PlatformInvoke.BS_.AUTOCHECKBOX + || (control.WinInfo.dwStyle & PlatformInvoke.BS_.CHECKBOX) == PlatformInvoke.BS_.CHECKBOX) { var panel = new KryptonPanel { @@ -255,10 +256,10 @@ public CommonDialogHandler(bool embed) var button = new KryptonCheckBox { - AutoCheck = ((control.WinInfo.dwStyle & PlatformInvoke.BS_.AUTO3STATE) == PlatformInvoke.BS_.AUTO3STATE) - || ((control.WinInfo.dwStyle & PlatformInvoke.BS_.AUTOCHECKBOX) == PlatformInvoke.BS_.AUTOCHECKBOX), - ThreeState = ((control.WinInfo.dwStyle & PlatformInvoke.BS_.AUTO3STATE) == PlatformInvoke.BS_.AUTO3STATE) - || ((control.WinInfo.dwStyle & PlatformInvoke.BS_._3STATE) == PlatformInvoke.BS_._3STATE), + AutoCheck = (control.WinInfo.dwStyle & PlatformInvoke.BS_.AUTO3STATE) == PlatformInvoke.BS_.AUTO3STATE + || (control.WinInfo.dwStyle & PlatformInvoke.BS_.AUTOCHECKBOX) == PlatformInvoke.BS_.AUTOCHECKBOX, + ThreeState = (control.WinInfo.dwStyle & PlatformInvoke.BS_.AUTO3STATE) == PlatformInvoke.BS_.AUTO3STATE + || (control.WinInfo.dwStyle & PlatformInvoke.BS_._3STATE) == PlatformInvoke.BS_._3STATE, AutoSize = false, Text = control.Text, Dock = DockStyle.Fill, @@ -349,9 +350,9 @@ public CommonDialogHandler(bool embed) using (Graphics g = Graphics.FromHdc(hdc)) { g.SmoothingMode = SmoothingMode.AntiAlias; - var lineColor = _manager.GlobalPalette.GetBorderColor1(PaletteBorderStyle.ControlGroupBox, PaletteState.Normal); + var lineColor = _manager.GlobalCustomPalette!.GetBorderColor1(PaletteBorderStyle.ControlGroupBox, PaletteState.Normal); DrawRoundedRectangle(g, new Pen(lineColor), new Point(0, 10), control.Size - new Size(1, 11), 5); - var font = _manager.GlobalPalette.GetContentShortTextFont( + var font = _manager.GlobalCustomPalette!.GetContentShortTextFont( PaletteContentStyle.LabelNormalPanel, PaletteState.Normal); TextRenderer.DrawText(g, control.Text, font, new Point(4, 0), _defaultFontColour, _backColour, TextFormatFlags.HidePrefix | TextFormatFlags.NoClipping); @@ -387,8 +388,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 = _manager.GlobalPalette.GetContentShortTextColor1(PaletteContentStyle.ButtonStandalone, PaletteState.Normal); - var backColour = _manager.GlobalPalette.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); + var fontColour = _manager.GlobalCustomPalette!.GetContentShortTextColor1(PaletteContentStyle.ButtonStandalone, PaletteState.Normal); + var backColour = _manager.GlobalCustomPalette!.GetBackColor1(PaletteBackStyle.ButtonStandalone, PaletteState.Normal); PlatformInvoke.SetTextColor(wparam, ColorTranslator.ToWin32(fontColour)); PlatformInvoke.SetBkColor(wparam, ColorTranslator.ToWin32(backColour)); //PlatformInvoke.SetBkMode(wparam, ColorTranslator.ToWin32(Color.Transparent)); @@ -406,7 +407,7 @@ public CommonDialogHandler(bool embed) //} case PlatformInvoke.WM_.CTLCOLOREDIT: { - var backColour = _manager.GlobalPalette.GetBackColor1(PaletteBackStyle.InputControlStandalone, PaletteState.Normal); + var backColour = _manager.GlobalCustomPalette!.GetBackColor1(PaletteBackStyle.InputControlStandalone, PaletteState.Normal); PlatformInvoke.SetTextColor(wparam, ColorTranslator.ToWin32(_inputFontColour)); PlatformInvoke.SetBkColor(wparam, ColorTranslator.ToWin32(backColour)); PlatformInvoke.SetBkMode(wparam, ColorTranslator.ToWin32(Color.Black)); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Controller/ToolTipController.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Controller/ToolTipController.cs index 7c5e1ad08..a40c3f866 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Controller/ToolTipController.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Controller/ToolTipController.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Enumerations/FileDialogType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Enumerations/FileDialogType.cs index af68b6ed9..b89e1cebb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Enumerations/FileDialogType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Enumerations/FileDialogType.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Enumerations/KryptonFormTitleStyle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Enumerations/KryptonFormTitleStyle.cs index 1860d0d89..6432a1199 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Enumerations/KryptonFormTitleStyle.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Enumerations/KryptonFormTitleStyle.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Enumerations/ShellAnimation.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Enumerations/ShellAnimation.cs index b72ee3fed..e14d3b509 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Enumerations/ShellAnimation.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Enumerations/ShellAnimation.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/EventArgs/ToolTipEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/EventArgs/ToolTipEventArgs.cs index eeca751f9..0d2b2b36a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/EventArgs/ToolTipEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/EventArgs/ToolTipEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/EventArgs/ToolTipNeededEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/EventArgs/ToolTipNeededEventArgs.cs index e1c81dd96..d50ab502c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/EventArgs/ToolTipNeededEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/EventArgs/ToolTipNeededEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/General/ColorHSL.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/General/ColorHSL.cs index a9cc00c5b..2637344af 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/General/ColorHSL.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/General/ColorHSL.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -86,12 +86,12 @@ public Color Color } else { - temp2 = Luminance + Saturation - (Luminance * Saturation); + temp2 = Luminance + Saturation - Luminance * Saturation; } - var temp1 = (2.0 * Luminance) - temp2; + var temp1 = 2.0 * Luminance - temp2; - double[] t3 = { Hue + (1.0 / 3.0), Hue, Hue - (1.0 / 3.0) }; + double[] t3 = { Hue + 1.0 / 3.0, Hue, Hue - 1.0 / 3.0 }; double[] clr = { 0, 0, 0 }; for (var i = 0; i < 3; i++) @@ -106,17 +106,17 @@ public Color Color t3[i] -= 1.0; } - if ((6.0 * t3[i]) < 1.0) + if (6.0 * t3[i] < 1.0) { - clr[i] = temp1 + ((temp2 - temp1) * t3[i] * 6.0); + clr[i] = temp1 + (temp2 - temp1) * t3[i] * 6.0; } - else if ((2.0 * t3[i]) < 1.0) + else if (2.0 * t3[i] < 1.0) { clr[i] = temp2; } - else if ((3.0 * t3[i]) < 2.0) + else if (3.0 * t3[i] < 2.0) { - clr[i] = temp1 + ((temp2 - temp1) * ((2.0 / 3.0) - t3[i]) * 6.0); + clr[i] = temp1 + (temp2 - temp1) * (2.0 / 3.0 - t3[i]) * 6.0; } else { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/General/PlatformInvoke.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/General/PlatformInvoke.cs index c3c3035cf..2afec95bd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/General/PlatformInvoke.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/General/PlatformInvoke.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -2853,13 +2853,13 @@ public enum WH_ : int public static int LOWORD(IntPtr value) { var int32 = (int)value.ToInt64() & 0xFFFF; - return (int32 > 32767) ? int32 - 65536 : int32; + return int32 > 32767 ? int32 - 65536 : int32; } public static int HIWORD(IntPtr value) { var int32 = ((int)value.ToInt64() >> 0x10) & 0xFFFF; - return (int32 > 32767) ? int32 - 65536 : int32; + return int32 > 32767 ? int32 - 65536 : int32; } public static int LOWORD(int value) => value & 0xFFFF; @@ -4129,13 +4129,13 @@ public struct OFNOTIFYW public enum CDN_ : uint { FIRST = 0xFFFFFDA7, // -601 - INITDONE = (FIRST - 0x0000), - SELCHANGE = (FIRST - 0x0001), // -602 - FOLDERCHANGE = (FIRST - 0x0002), - SHAREVIOLATION = (FIRST - 0x0003), // -604 - HELP = (FIRST - 0x0004), - FILEOK = (FIRST - 0x0005), // -606 - TYPECHANGE = (FIRST - 0x0006), + INITDONE = FIRST - 0x0000, + SELCHANGE = FIRST - 0x0001, // -602 + FOLDERCHANGE = FIRST - 0x0002, + SHAREVIOLATION = FIRST - 0x0003, // -604 + HELP = FIRST - 0x0004, + FILEOK = FIRST - 0x0005, // -606 + TYPECHANGE = FIRST - 0x0006, } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/General/ToolTipManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/General/ToolTipManager.cs index f5642faa5..4c82d982a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/General/ToolTipManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/General/ToolTipManager.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -286,8 +286,8 @@ private void OnStopTimerTick(object sender, EventArgs e) _stopTimer.Stop(); // Is the target is not the same as the currently showing tooltip - if ((_currentTarget != _startTarget) - || (_startTarget == null) // SKC: Default tooltip not using a viewbase ?? + if (_currentTarget != _startTarget + || _startTarget == null // SKC: Default tooltip not using a viewbase ?? ) { // Leave tooltips mode diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Globals/GlobalDeclarations.cs index d78a3f277..a19df3905 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Globals/GlobalDeclarations.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Krypton - Backup.Toolkit.Suite.Extended.Shared 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Krypton - Backup.Toolkit.Suite.Extended.Shared 2022.csproj index 6914ee4d3..578d1fbba 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Krypton - Backup.Toolkit.Suite.Extended.Shared 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Krypton - Backup.Toolkit.Suite.Extended.Shared 2022.csproj @@ -3,25 +3,25 @@ - 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 + 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 + 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -62,9 +62,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements shared APIs that are used by the extended toolkit. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements shared APIs that are used by the extended toolkit. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Krypton.Toolkit.Suite.Extended.Shared 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Krypton.Toolkit.Suite.Extended.Shared 2022.csproj index 28e119db2..94bdfcdfe 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Krypton.Toolkit.Suite.Extended.Shared 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Krypton.Toolkit.Suite.Extended.Shared 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -70,9 +58,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements APIs that are in the standard toolkit, but are inaccessible outside of it. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements APIs that are in the standard toolkit, but are inaccessible outside of it. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -80,74 +68,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Krypton.Toolkit.Suite.Extended.Shared.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Krypton.Toolkit.Suite.Extended.Shared.licenseheader index c890e86c0..a0e5e0a62 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Krypton.Toolkit.Suite.Extended.Shared.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Krypton.Toolkit.Suite.Extended.Shared.licenseheader @@ -4,7 +4,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Utilities/Portable.System.ValueTuple.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Utilities/Portable.System.ValueTuple.cs index 63c243820..5cc77d71d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Utilities/Portable.System.ValueTuple.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Utilities/Portable.System.ValueTuple.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Values/ToolTipValues.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Values/ToolTipValues.cs index 0a1782e7b..c8d9033b0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Values/ToolTipValues.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Values/ToolTipValues.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/Globals/GlobalDeclarations.cs index 977d74d6f..36b498b99 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/Globals/GlobalDeclarations.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/Krypton.Toolkit.Suite.Extended.Software.Updater.Core 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/Krypton.Toolkit.Suite.Extended.Software.Updater.Core 2022.csproj index a813bffc8..e662e4e5a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/Krypton.Toolkit.Suite.Extended.Software.Updater.Core 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/Krypton.Toolkit.Suite.Extended.Software.Updater.Core 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - + - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -70,9 +58,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements core utilities that are fundamental to the extended toolkit. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements core utilities that are fundamental to the extended toolkit. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -86,13 +74,13 @@ - + - + - + - + @@ -102,13 +90,13 @@ - + - + - + - + @@ -118,13 +106,13 @@ - + - + - + - + @@ -134,13 +122,13 @@ - + - + - + - + @@ -183,13 +171,13 @@ - + - + - + - + @@ -206,7 +194,8 @@ - + + @@ -234,19 +223,19 @@ - 22.4.0 + 24.4.0 - 22.4.0 + 23.9.0-preview.3 - 22.4.0 + 24.4.0 diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/NetSparkle/Libraries/MarkdownSharp.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/NetSparkle/Libraries/MarkdownSharp.cs index 83dac7339..7dd1103dd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/NetSparkle/Libraries/MarkdownSharp.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/NetSparkle/Libraries/MarkdownSharp.cs @@ -1506,7 +1506,7 @@ private static string HandleTrailingParens(Match match) var tail = ""; if (level < 0) { - link = Regex.Replace(link, @"\){1," + (-level) + "}$", m => { tail = m.Value; return ""; }); + link = Regex.Replace(link, @"\){1," + -level + "}$", m => { tail = m.Value; return ""; }); } if (tail.Length > 0) { @@ -1795,7 +1795,7 @@ private string Normalize(string text) line.Length = 0; valid = false; break; case '\r': - if ((i < text.Length - 1) && (text[i + 1] != '\n')) + if (i < text.Length - 1 && text[i + 1] != '\n') { if (valid) { @@ -1807,7 +1807,7 @@ private string Normalize(string text) } break; case '\t': - int width = (TAB_WIDTH - (line.Length % TAB_WIDTH)); + int width = TAB_WIDTH - line.Length % TAB_WIDTH; for (int k = 0; k < width; k++) { line.Append(' '); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/NetSparkle/Miscellaneous/AppCastItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/NetSparkle/Miscellaneous/AppCastItem.cs index e9bcf9722..232282db8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/NetSparkle/Miscellaneous/AppCastItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/NetSparkle/Miscellaneous/AppCastItem.cs @@ -103,7 +103,7 @@ public bool IsWindowsUpdate if (OperatingSystemString != null) { var lowercasedOS = OperatingSystemString.ToLower(); - if (lowercasedOS == "win" || lowercasedOS == "windows") + if (lowercasedOS is "win" or "windows") { return true; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/NetSparkle/Miscellaneous/SparkleUpdater.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/NetSparkle/Miscellaneous/SparkleUpdater.cs index 2a90be210..6db7dc2a4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/NetSparkle/Miscellaneous/SparkleUpdater.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/NetSparkle/Miscellaneous/SparkleUpdater.cs @@ -1231,7 +1231,7 @@ public async void InstallUpdate(AppCastItem? item, string installPath = null) result = ValidationResult.Invalid; DownloadedFileThrewWhileCheckingSignature?.Invoke(item, path); } - if (result == ValidationResult.Valid || result == ValidationResult.Unchecked) + if (result is ValidationResult.Valid or ValidationResult.Unchecked) { await RunDownloadedInstaller(path); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/NetSparkle/SignatureVerifiers/Ed25519Checker.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/NetSparkle/SignatureVerifiers/Ed25519Checker.cs index 1f839f047..03b3b0c32 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/NetSparkle/SignatureVerifiers/Ed25519Checker.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/NetSparkle/SignatureVerifiers/Ed25519Checker.cs @@ -52,7 +52,7 @@ public bool HasValidKeyInformation() /// if true, reads the file this checker is verifying in chunks rather than all at once /// if reading the file in chunks, size of chunks to read with. Defaults to 25 MB. public Ed25519Checker(SecurityMode mode, string? publicKey = null, string publicKeyFile = "NetSparkle_Ed25519.pub", - bool readFileBeingVerifiedInChunks = false, int chunkSize = (1024 * 1024 * 25)) + bool readFileBeingVerifiedInChunks = false, int chunkSize = 1024 * 1024 * 25) { SecurityMode = mode; ReadFileBeingVerifiedInChunks = readFileBeingVerifiedInChunks; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Globals/GlobalDeclarations.cs index 28fc38a70..cf7ecc4b2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Krypton - Backup.Toolkit.Suite.Extended.Software.Updater 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Krypton - Backup.Toolkit.Suite.Extended.Software.Updater 2022.csproj index 62b8d3dc5..b6a67af40 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Krypton - Backup.Toolkit.Suite.Extended.Software.Updater 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Krypton - Backup.Toolkit.Suite.Extended.Software.Updater 2022.csproj @@ -3,25 +3,25 @@ - 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 + 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 + 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -70,9 +70,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements software updating features. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements software updating features. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -106,7 +106,7 @@ - + @@ -116,7 +116,7 @@ - + @@ -147,7 +147,7 @@ - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Krypton.Toolkit.Suite.Extended.Software.Updater 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Krypton.Toolkit.Suite.Extended.Software.Updater 2022.csproj index 1decfbfe4..3e759ac86 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Krypton.Toolkit.Suite.Extended.Software.Updater 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Krypton.Toolkit.Suite.Extended.Software.Updater 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements software updating features. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements software updating features. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,74 +69,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + @@ -166,9 +116,9 @@ - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Krypton.Toolkit.Suite.Extended.Software.Updater.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Krypton.Toolkit.Suite.Extended.Software.Updater.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Krypton.Toolkit.Suite.Extended.Software.Updater.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Krypton.Toolkit.Suite.Extended.Software.Updater.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/GlobalMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/GlobalMethods.cs index bbb54e5b0..a2a906e77 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/GlobalMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/GlobalMethods.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -126,7 +126,7 @@ public bool CheckIfTargetPlatformIsSupported(bool useLegacyVistaSupport = false) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc, "Exception Thrown", KryptonMessageBoxButtons.OK, KryptonMessageBoxIcon.Error, "GlobalMethods", "CheckIfTargetPlatformIsSupported(bool useLegacyVistaSupport = false)"); + DebugUtilities.NotImplemented(exc.ToString()); SetIsTargetPlatformSupported(false); } @@ -153,7 +153,7 @@ public bool IsTargetPlatformRunningIn64BITMode() } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); SetIsTargetPlatform64BIT(false); } @@ -173,7 +173,7 @@ public bool AreAssemblies64BIT() } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); SetIsAssemblies64BIT(false); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/IconExtractor.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/IconExtractor.cs index c6e4b4b59..fe0a6330c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/IconExtractor.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/IconExtractor.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/NativeMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/NativeMethods.cs index 13b4f4512..b2f9bfa51 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/NativeMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/NativeMethods.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/PlatformHelper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/PlatformHelper.cs index 65c61efe6..72325feff 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/PlatformHelper.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/PlatformHelper.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -40,8 +40,8 @@ static PlatformHelper() PlatformHelper.Win32NT = Environment.OSVersion.Platform == PlatformID.Win32NT; PlatformHelper.XpOrHigher = PlatformHelper.Win32NT && Environment.OSVersion.Version.Major >= 5; PlatformHelper.VistaOrHigher = PlatformHelper.Win32NT && Environment.OSVersion.Version.Major >= 6; - PlatformHelper.SevenOrHigher = PlatformHelper.Win32NT && (Environment.OSVersion.Version >= new Version(6, 1)); - PlatformHelper.EightOrHigher = PlatformHelper.Win32NT && (Environment.OSVersion.Version >= new Version(6, 2, 9200)); + PlatformHelper.SevenOrHigher = PlatformHelper.Win32NT && Environment.OSVersion.Version >= new Version(6, 1); + PlatformHelper.EightOrHigher = PlatformHelper.Win32NT && Environment.OSVersion.Version >= new Version(6, 2, 9200); PlatformHelper.VisualStylesEnabled = VisualStyleInformation.IsEnabledByUser; SystemEvents.UserPreferenceChanged += (s, e) => diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/UACSecurity.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/UACSecurity.cs index 40fcc29be..f486cb8f0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/UACSecurity.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/UACSecurity.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -36,7 +36,7 @@ public static class UACSecurity #endregion #region Constants - internal const int BCM_FIRST = 0x1600, BCM_SETSHIELD = (BCM_FIRST + 0x000C); + internal const int BCM_FIRST = 0x1600, BCM_SETSHIELD = BCM_FIRST + 0x000C; #endregion #region Methods @@ -81,7 +81,7 @@ internal static void RestartElevated() catch (Win32Exception ex) { //return; //If cancelled, do nothing - ExceptionCapture.CaptureException(ex); + DebugUtilities.NotImplemented(ex.ToString()); } Application.Exit(); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/UtilityMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/UtilityMethods.cs index d8bbb5b75..f8a1c56b3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/UtilityMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Classes/Utilities/UtilityMethods.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,7 +25,6 @@ */ #endregion -#pragma warning disable CS1574, CS1584, CS1581, CS1580 namespace Krypton.Toolkit.Suite.Extended.Specialised.Dialogs { /// Provides useful methods for specified tasks. @@ -67,7 +66,7 @@ public static void ElevateProcessWithAdministrativeRights(string processName) } catch (Win32Exception wexc) { - ExceptionCapture.CaptureException(wexc); + DebugUtilities.NotImplemented(wexc.ToString()); } } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Controls Toolkit/Buttons/KryptonUACButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Controls Toolkit/Buttons/KryptonUACButton.cs index 9c05cf70d..df718836e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Controls Toolkit/Buttons/KryptonUACButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Controls Toolkit/Buttons/KryptonUACButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Enumerations/RunDialogIconVisibility.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Enumerations/RunDialogIconVisibility.cs index 85d94e856..98477d24d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Enumerations/RunDialogIconVisibility.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Enumerations/RunDialogIconVisibility.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Enumerations/RunDialogType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Enumerations/RunDialogType.cs index 3296cc6e3..65f75326d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Enumerations/RunDialogType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Enumerations/RunDialogType.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Events/ExecuteProcessAsAdministratorEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Events/ExecuteProcessAsAdministratorEventArgs.cs index aed429d1e..6bed68484 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Events/ExecuteProcessAsAdministratorEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Events/ExecuteProcessAsAdministratorEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -105,7 +105,7 @@ private void ElevateProcessWithAdministrativeRights(object objectToElevate, stri } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } @@ -139,7 +139,7 @@ public void ElevateProcessWithAdministrativeRights(string processName, string? a } catch (Win32Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Globals/GlobalDeclarations.cs index f42d373cc..5b2f20233 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -39,7 +39,7 @@ global using System.Windows.Forms.VisualStyles; global using Krypton.Toolkit.Suite.Extended.Common; -global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; +global using Krypton.Toolkit.Suite.Extended.Debug.Tools; global using Microsoft.Win32; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs 2022.csproj index f29b8f4da..4f119597a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements system dialogs, using the Krypton themes. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements system dialogs, using the Krypton themes. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -81,74 +69,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + @@ -161,6 +111,7 @@ + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/UX/Run/KryptonRunDialog.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/UX/Run/KryptonRunDialog.Designer.cs index 5ea1921d5..c6272e42f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/UX/Run/KryptonRunDialog.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/UX/Run/KryptonRunDialog.Designer.cs @@ -152,10 +152,10 @@ private void InitializeComponent() this.kbtnRun.Location = new System.Drawing.Point(244, 14); this.kbtnRun.Margin = new System.Windows.Forms.Padding(3, 3, 5, 15); this.kbtnRun.Name = "kbtnRun"; - this.kbtnRun.ShowSplitOption = true; + this.kbtnRun.Values.ShowSplitOption = true; this.kbtnRun.Size = new System.Drawing.Size(47, 22); this.kbtnRun.TabIndex = 1; - this.kbtnRun.UseAsUACElevationButton = true; + this.kbtnRun.Values.UseAsUACElevationButton = true; this.kbtnRun.Values.Image = ((System.Drawing.Image)(resources.GetObject("kbtnRun.Values.Image"))); this.kbtnRun.Values.Text = "&Run"; this.kbtnRun.Click += new System.EventHandler(this.kbtnRun_Click); @@ -171,7 +171,7 @@ private void InitializeComponent() this.kbtnCancel.Name = "kbtnCancel"; this.kbtnCancel.Size = new System.Drawing.Size(45, 22); this.kbtnCancel.TabIndex = 2; - this.kbtnCancel.UseAsADialogButton = true; + this.kbtnCancel.Values.UseAsADialogButton = true; this.kbtnCancel.Values.Text = "Cance&l"; // // kbtnBrowse @@ -188,8 +188,8 @@ private void InitializeComponent() // // pictureBox1 // - this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.pictureBox1.BackColor = System.Drawing.Color.Transparent; this.pictureBox1.Image = global::Krypton.Toolkit.Suite.Extended.Specialised.Dialogs.Properties.Resources.Run1; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/UX/Run/KryptonRunDialog.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/UX/Run/KryptonRunDialog.cs index c2973c6d6..02e50e50f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/UX/Run/KryptonRunDialog.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/UX/Run/KryptonRunDialog.cs @@ -104,7 +104,7 @@ private void LocateResource(string resourcePath) } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } @@ -121,7 +121,7 @@ private void BrowseForFile() } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } @@ -154,7 +154,7 @@ private void RunProcess(string path) } catch (Exception exc) { - ExceptionCapture.CaptureException(exc); + DebugUtilities.NotImplemented(exc.ToString()); } } @@ -169,7 +169,7 @@ private void RunProcess(string path) private void kcmdRunTaskAsAdministrator_Execute(object sender, EventArgs e) { - kbtnRun.UseAsUACElevationButton = true; + kbtnRun.Values.UseAsUACElevationButton = true; try { @@ -184,13 +184,13 @@ private void kcmdRunTaskAsAdministrator_Execute(object sender, EventArgs e) } catch (Exception exception) { - ExceptionCapture.CaptureException(exception); + DebugUtilities.NotImplemented(exception.ToString()); } } private void kcmdRunTaskAsNormalUser_Execute(object sender, EventArgs e) { - kbtnRun.UseAsUACElevationButton = false; + kbtnRun.Values.UseAsUACElevationButton = false; try { @@ -205,13 +205,13 @@ private void kcmdRunTaskAsNormalUser_Execute(object sender, EventArgs e) } catch (Exception exception) { - ExceptionCapture.CaptureException(exception); + DebugUtilities.NotImplemented(exception.ToString()); } } private void kbtnRun_Click(object sender, EventArgs e) { - if (kbtnRun.UseAsUACElevationButton) + if (kbtnRun.Values.UseAsUACElevationButton) { kcmdRunTaskAsAdministrator.PerformExecute(); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TaskDialogs/Krypton.Toolkit.Suite.Extended.Task.Dialogs.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TaskDialogs/Krypton.Toolkit.Suite.Extended.Task.Dialogs.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TaskDialogs/Krypton.Toolkit.Suite.Extended.Task.Dialogs.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TaskDialogs/Krypton.Toolkit.Suite.Extended.Task.Dialogs.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TaskDialogs/Krypton.Toolkit.Suite.Extended.TaskDialogs 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TaskDialogs/Krypton.Toolkit.Suite.Extended.TaskDialogs 2022.csproj index 51970f82b..6d221346c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TaskDialogs/Krypton.Toolkit.Suite.Extended.TaskDialogs 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TaskDialogs/Krypton.Toolkit.Suite.Extended.TaskDialogs 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -38,6 +26,7 @@ en Debug;Release;Nightly;Canary true + preview @@ -68,9 +57,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements extra 'KryptonTaskDialog' features and functionality. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements extra 'KryptonTaskDialog' features and functionality. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -78,74 +67,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Classes/SettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Classes/SettingsManager.cs index 92df36003..a6868fdbd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Classes/SettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Classes/SettingsManager.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Classes/ThemeManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Classes/ThemeManager.cs index c598c6358..5e2dbbf53 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Classes/ThemeManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Classes/ThemeManager.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Classes/ThemeSettingsParser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Classes/ThemeSettingsParser.cs index d49128f20..de0058abe 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Classes/ThemeSettingsParser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Classes/ThemeSettingsParser.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Enumerations/ExternalThemeType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Enumerations/ExternalThemeType.cs index f3e54525f..3c7f73f90 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Enumerations/ExternalThemeType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Enumerations/ExternalThemeType.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Enumerations/ExternalThemeViewerType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Enumerations/ExternalThemeViewerType.cs index ba5879ab1..499dd0e23 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Enumerations/ExternalThemeViewerType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Enumerations/ExternalThemeViewerType.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Globals/GlobalDeclarations.cs index 29641615c..7f4574a65 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -35,7 +35,7 @@ global using System.Windows.Forms; global using Krypton.Navigator; -global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; +global using Krypton.Toolkit.Suite.Extended.Debug.Tools; global using Krypton.Toolkit.Suite.Extended.Settings; global using Krypton.Toolkit.Suite.Extended.Shared; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Krypton.Toolkit.Suite.Extended.Theme.Switcher 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Krypton.Toolkit.Suite.Extended.Theme.Switcher 2022.csproj index 87a99d146..e016b992c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Krypton.Toolkit.Suite.Extended.Theme.Switcher 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Krypton.Toolkit.Suite.Extended.Theme.Switcher 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - + - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements a easy to use theme switcher. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements a easy to use theme switcher. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -87,9 +75,9 @@ - + - + @@ -99,9 +87,9 @@ - + - + @@ -111,9 +99,9 @@ - + - + @@ -123,9 +111,9 @@ - + - + @@ -160,18 +148,19 @@ - + - + - + + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Krypton.Toolkit.Suite.Extended.Theme.Switcher.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Krypton.Toolkit.Suite.Extended.Theme.Switcher.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Krypton.Toolkit.Suite.Extended.Theme.Switcher.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Krypton.Toolkit.Suite.Extended.Theme.Switcher.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Properties/Settings.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Properties/Settings.Designer.cs index 73f8e8445..70060ec14 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Properties/Settings.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Properties/Settings.Designer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/DownloadThemePackage.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/DownloadThemePackage.cs index 8d6c1e90e..6ac40b318 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/DownloadThemePackage.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/DownloadThemePackage.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -49,9 +49,9 @@ private void InitializeComponent() this.kwlSpeed = new Krypton.Toolkit.KryptonWrapLabel(); this.pbDownloadProgress = new System.Windows.Forms.ProgressBar(); this.kbtnStop = new Krypton.Toolkit.KryptonButton(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); this.SuspendLayout(); // @@ -91,12 +91,12 @@ private void InitializeComponent() // this.kwlSize.AutoSize = false; this.kwlSize.Dock = System.Windows.Forms.DockStyle.Top; - this.kwlSize.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlSize.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kwlSize.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); + this.kwlSize.ForeColor = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kwlSize.Location = new System.Drawing.Point(0, 0); this.kwlSize.Name = "kwlSize"; this.kwlSize.Size = new System.Drawing.Size(598, 38); - this.kwlSize.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kwlSize.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kwlSize.Text = "{0} {1} / {2} {3}"; this.kwlSize.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // @@ -104,12 +104,12 @@ private void InitializeComponent() // this.kwlProgressPercentage.AutoSize = false; this.kwlProgressPercentage.Dock = System.Windows.Forms.DockStyle.Top; - this.kwlProgressPercentage.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlProgressPercentage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kwlProgressPercentage.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); + this.kwlProgressPercentage.ForeColor = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kwlProgressPercentage.Location = new System.Drawing.Point(0, 38); this.kwlProgressPercentage.Name = "kwlProgressPercentage"; this.kwlProgressPercentage.Size = new System.Drawing.Size(598, 38); - this.kwlProgressPercentage.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kwlProgressPercentage.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kwlProgressPercentage.Text = "{0}%"; this.kwlProgressPercentage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // @@ -117,12 +117,12 @@ private void InitializeComponent() // this.kwlSpeed.AutoSize = false; this.kwlSpeed.Dock = System.Windows.Forms.DockStyle.Bottom; - this.kwlSpeed.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlSpeed.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kwlSpeed.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); + this.kwlSpeed.ForeColor = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kwlSpeed.Location = new System.Drawing.Point(0, 106); this.kwlSpeed.Name = "kwlSpeed"; this.kwlSpeed.Size = new System.Drawing.Size(598, 38); - this.kwlSpeed.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kwlSpeed.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kwlSpeed.Text = "{0} kb/s"; this.kwlSpeed.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // @@ -152,10 +152,10 @@ private void InitializeComponent() this.Name = "DownloadThemePackage"; this.ShowIcon = false; this.ShowInTaskbar = false; - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); this.ResumeLayout(false); @@ -199,7 +199,7 @@ private void DownloadFile(string urlAddress, string location) } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } } @@ -231,14 +231,14 @@ private void DownloadCompleted(object sender, AsyncCompletedEventArgs e) { try { - if (_downloadLocation != null || _downloadLocation != string.Empty) + if (_downloadLocation is not (null and "")) { Process.Start(_downloadLocation); } } catch (Exception exception) { - ExceptionCapture.CaptureException(exception); + DebugUtilities.NotImplemented(exception.ToString()); } } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/KryptonExternalThemeSelectorForm.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/KryptonExternalThemeSelectorForm.Designer.cs index 39de3283f..2bc32b116 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/KryptonExternalThemeSelectorForm.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/KryptonExternalThemeSelectorForm.Designer.cs @@ -135,16 +135,10 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.klvThemesList.HideSelection = false; - this.klvThemesList.ItemStyle = Krypton.Toolkit.ButtonStyle.ListItem; this.klvThemesList.Location = new System.Drawing.Point(10, 4); this.klvThemesList.Name = "klvThemesList"; - this.klvThemesList.OwnerDraw = true; this.klvThemesList.Size = new System.Drawing.Size(775, 357); - this.klvThemesList.StateCommon.Item.Content.ShortText.MultiLine = Krypton.Toolkit.InheritBool.True; - this.klvThemesList.StateCommon.Item.Content.ShortText.MultiLineH = Krypton.Toolkit.PaletteRelativeAlign.Center; - this.klvThemesList.StateCommon.Item.Content.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.klvThemesList.TabIndex = 1; - this.klvThemesList.SelectedIndexChanged += new System.EventHandler(this.klvThemesList_SelectedIndexChanged); // // klbThemesList // @@ -183,7 +177,6 @@ private void InitializeComponent() // // kcpbCustom // - this.kcpbCustom.BaseFontSize = 9F; this.kcpbCustom.BasePaletteType = Krypton.Toolkit.BasePaletteType.Custom; this.kcpbCustom.ThemeName = null; // @@ -197,7 +190,6 @@ private void InitializeComponent() // // kbtnApply // - this.kbtnApply.CornerRoundingRadius = -1F; this.kbtnApply.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kbtnApply.Enabled = false; this.kbtnApply.Location = new System.Drawing.Point(698, 13); @@ -208,7 +200,6 @@ private void InitializeComponent() // // kbtnCancel // - this.kbtnCancel.CornerRoundingRadius = -1F; this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kbtnCancel.Location = new System.Drawing.Point(602, 13); this.kbtnCancel.Name = "kbtnCancel"; @@ -218,7 +209,6 @@ private void InitializeComponent() // // kbtnOk // - this.kbtnOk.CornerRoundingRadius = -1F; this.kbtnOk.DialogResult = System.Windows.Forms.DialogResult.OK; this.kbtnOk.Location = new System.Drawing.Point(506, 13); this.kbtnOk.Name = "kbtnOk"; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/KryptonExternalThemeSelectorForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/KryptonExternalThemeSelectorForm.cs index 24c6dadba..12ba0d010 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/KryptonExternalThemeSelectorForm.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/KryptonExternalThemeSelectorForm.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -52,11 +52,11 @@ public KryptonExternalThemeSelectorForm(ExternalThemeType? externalThemeType, Ex _externalThemeViewerType = externalThemeViewerType ?? ExternalThemeViewerType.ListBox; - kbtnApply.Text = KryptonLanguageManager.CustomToolkitStrings.Apply; + kbtnApply.Text = KryptonManager.Strings.CustomStrings.Apply; - kbtnCancel.Text = KryptonLanguageManager.GeneralToolkitStrings.Cancel; + kbtnCancel.Text = KryptonManager.Strings.GeneralStrings.Cancel; - kbtnOk.Text = KryptonLanguageManager.GeneralToolkitStrings.OK; + kbtnOk.Text = KryptonManager.Strings.GeneralStrings.OK; UpdateUI(externalThemeType, externalThemeViewerType); } @@ -225,7 +225,7 @@ private void LoadThemesFromDirectory(string themeLocation) } catch (Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } @@ -240,7 +240,7 @@ private void klvThemesList_SelectedIndexChanged(object sender, EventArgs e) kmanCustom.GlobalPaletteMode = PaletteMode.Custom; - kmanCustom.CustomPalette = kcpbCustom; + kmanCustom.GlobalCustomPalette = kcpbCustom; kbtnApply.Enabled = true; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/ThemeSelector.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/ThemeSelector.cs index cc4aa7d35..3d0bdf11d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/ThemeSelector.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/ThemeSelector.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -53,11 +53,11 @@ private void InitializeComponent() this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel(); this.kryptonLabel1 = new Krypton.Toolkit.KryptonLabel(); this.kcmbSelectedTheme = new Krypton.Toolkit.KryptonThemeComboBox(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbSelectedTheme)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbSelectedTheme).BeginInit(); this.SuspendLayout(); // // kryptonPanel1 @@ -76,8 +76,7 @@ private void InitializeComponent() // // kbtnOptions // - this.kbtnOptions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnOptions.CornerRoundingRadius = -1F; + this.kbtnOptions.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnOptions.Location = new System.Drawing.Point(272, 13); this.kbtnOptions.Name = "kbtnOptions"; this.kbtnOptions.Size = new System.Drawing.Size(90, 25); @@ -88,8 +87,7 @@ private void InitializeComponent() // // kbtnResetTheme // - this.kbtnResetTheme.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.kbtnResetTheme.CornerRoundingRadius = -1F; + this.kbtnResetTheme.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); this.kbtnResetTheme.Enabled = false; this.kbtnResetTheme.Location = new System.Drawing.Point(108, 13); this.kbtnResetTheme.Name = "kbtnResetTheme"; @@ -100,8 +98,7 @@ private void InitializeComponent() // // kbtnLoadTheme // - this.kbtnLoadTheme.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.kbtnLoadTheme.CornerRoundingRadius = -1F; + this.kbtnLoadTheme.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); this.kbtnLoadTheme.Location = new System.Drawing.Point(12, 13); this.kbtnLoadTheme.Name = "kbtnLoadTheme"; this.kbtnLoadTheme.Size = new System.Drawing.Size(90, 25); @@ -111,8 +108,7 @@ 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.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kbtnCancel.Location = new System.Drawing.Point(368, 13); this.kbtnCancel.Name = "kbtnCancel"; @@ -151,7 +147,6 @@ private void InitializeComponent() // // kcmbSelectedTheme // - this.kcmbSelectedTheme.CornerRoundingRadius = -1F; this.kcmbSelectedTheme.DropDownWidth = 445; this.kcmbSelectedTheme.IntegralHeight = false; this.kcmbSelectedTheme.Location = new System.Drawing.Point(13, 39); @@ -175,13 +170,13 @@ private void InitializeComponent() this.Text = "Select a Theme"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ThemeSelector_FormClosing); this.Load += new System.EventHandler(this.ThemeSelector_Load); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); this.kryptonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbSelectedTheme)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbSelectedTheme).EndInit(); this.ResumeLayout(false); } @@ -256,7 +251,7 @@ private void kbtnResetTheme_Click(object sender, EventArgs e) _settingsManager.SaveSettings(_settingsManager.GetAskMe()); - _manager.GlobalPalette = null; + _manager.GlobalCustomPalette = null; _manager.GlobalPaletteMode = PaletteMode.Microsoft365Blue; @@ -269,7 +264,7 @@ private void kbtnLoadTheme_Click(object sender, EventArgs e) { _palette.Import(); - _manager.GlobalPalette = _palette; + _manager.GlobalCustomPalette = _palette; _manager.GlobalPaletteMode = PaletteMode.Custom; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/ThemeSelectorOld.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/ThemeSelectorOld.cs index 538ac48bb..f3b1609c3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/ThemeSelectorOld.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/ThemeSelectorOld.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -54,11 +54,11 @@ private void InitializeComponent() this.kryptonPanel2 = new(); this.kcmbPaletteMode = new(); this.kryptonLabel1 = new(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbPaletteMode)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbPaletteMode).BeginInit(); this.SuspendLayout(); // // kryptonPanel1 @@ -107,7 +107,7 @@ private void InitializeComponent() // // kbtnApply // - this.kbtnApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.kbtnApply.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnApply.DialogResult = System.Windows.Forms.DialogResult.OK; this.kbtnApply.Enabled = false; this.kbtnApply.Location = new(392, 13); @@ -119,7 +119,7 @@ private void InitializeComponent() // // kbtnCancel // - this.kbtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.kbtnCancel.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kbtnCancel.Location = new(488, 13); this.kbtnCancel.Name = "kbtnCancel"; @@ -176,7 +176,7 @@ private void InitializeComponent() this.Controls.Add(this.kryptonPanel2); this.Controls.Add(this.kryptonPanel1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon"); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "ThemeSelector"; @@ -186,13 +186,13 @@ private void InitializeComponent() this.Text = "Select Theme"; this.FormClosing += new(this.ThemeSelector_FormClosing); this.Load += new(this.ThemeSelector_Load); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); this.kryptonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbPaletteMode)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbPaletteMode).EndInit(); this.ResumeLayout(false); } @@ -239,7 +239,7 @@ private void kbtnLoadTheme_Click(object sender, EventArgs e) { _palette.Import(); - _manager.GlobalPalette = _palette; + _manager.GlobalCustomPalette = _palette; _manager.GlobalPaletteMode = PaletteMode.Custom; @@ -262,7 +262,7 @@ private void kbtnResetTheme_Click(object sender, EventArgs e) _settingsManager.SaveSettings(_settingsManager.GetAskMe()); - _manager.GlobalPalette = null; + _manager.GlobalCustomPalette = null; _manager.GlobalPaletteMode = PaletteMode.Microsoft365Blue; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/ThemeSwitcherOptions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/ThemeSwitcherOptions.cs index 3e5db3565..c1b4c6f8b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/ThemeSwitcherOptions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/ThemeSwitcherOptions.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -87,25 +87,25 @@ private void InitializeComponent() this.kcmbPaletteMode = new Krypton.Toolkit.KryptonThemeComboBox(); this.kcmbDarkTheme = new Krypton.Toolkit.KryptonThemeComboBox(); this.kcmbLightTheme = new Krypton.Toolkit.KryptonThemeComboBox(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).BeginInit(); this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonNavigator1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonNavigator1).BeginInit(); this.kryptonNavigator1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage1).BeginInit(); this.kryptonPage1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage2).BeginInit(); this.kryptonPage2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage3).BeginInit(); this.kryptonPage3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1.Panel).BeginInit(); this.kryptonGroupBox1.Panel.SuspendLayout(); this.kryptonGroupBox1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbPaletteMode)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbDarkTheme)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbLightTheme)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbPaletteMode).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbDarkTheme).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbLightTheme).BeginInit(); this.SuspendLayout(); // // kryptonPanel1 @@ -123,7 +123,6 @@ private void InitializeComponent() // // kbtnReset // - this.kbtnReset.CornerRoundingRadius = -1F; this.kbtnReset.Enabled = false; this.kbtnReset.Location = new System.Drawing.Point(12, 13); this.kbtnReset.Name = "kbtnReset"; @@ -134,8 +133,7 @@ private void InitializeComponent() // // kbtnApply // - this.kbtnApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnApply.CornerRoundingRadius = -1F; + this.kbtnApply.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnApply.DialogResult = System.Windows.Forms.DialogResult.OK; this.kbtnApply.Enabled = false; this.kbtnApply.Location = new System.Drawing.Point(428, 13); @@ -147,8 +145,7 @@ 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.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kbtnCancel.Location = new System.Drawing.Point(524, 13); this.kbtnCancel.Name = "kbtnCancel"; @@ -222,7 +219,6 @@ private void InitializeComponent() // // kbtnRequestTheme // - this.kbtnRequestTheme.CornerRoundingRadius = -1F; this.kbtnRequestTheme.Location = new System.Drawing.Point(160, 201); this.kbtnRequestTheme.Name = "kbtnRequestTheme"; this.kbtnRequestTheme.Size = new System.Drawing.Size(121, 25); @@ -232,7 +228,6 @@ private void InitializeComponent() // // kbtnDownload // - this.kbtnDownload.CornerRoundingRadius = -1F; this.kbtnDownload.Location = new System.Drawing.Point(256, 161); this.kbtnDownload.Name = "kbtnDownload"; this.kbtnDownload.Size = new System.Drawing.Size(189, 25); @@ -242,7 +237,6 @@ private void InitializeComponent() // // kbtnSubmit // - this.kbtnSubmit.CornerRoundingRadius = -1F; this.kbtnSubmit.Location = new System.Drawing.Point(16, 201); this.kbtnSubmit.Name = "kbtnSubmit"; this.kbtnSubmit.Size = new System.Drawing.Size(138, 25); @@ -253,18 +247,17 @@ private void InitializeComponent() // kwlPaletteName // this.kwlPaletteName.AutoSize = false; - this.kwlPaletteName.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kwlPaletteName.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kwlPaletteName.ForeColor = System.Drawing.Color.Black; this.kwlPaletteName.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl; this.kwlPaletteName.Location = new System.Drawing.Point(16, 55); this.kwlPaletteName.Name = "kwlPaletteName"; this.kwlPaletteName.Size = new System.Drawing.Size(566, 93); - this.kwlPaletteName.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kwlPaletteName.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kwlPaletteName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // kbtnLocate // - this.kbtnLocate.CornerRoundingRadius = -1F; this.kbtnLocate.Enabled = false; this.kbtnLocate.Location = new System.Drawing.Point(112, 161); this.kbtnLocate.Name = "kbtnLocate"; @@ -275,7 +268,6 @@ private void InitializeComponent() // // kbtnImport // - this.kbtnImport.CornerRoundingRadius = -1F; this.kbtnImport.Location = new System.Drawing.Point(16, 161); this.kbtnImport.Name = "kbtnImport"; this.kbtnImport.Size = new System.Drawing.Size(90, 25); @@ -311,7 +303,6 @@ private void InitializeComponent() // // kbtnResetDarkAndLightTheme // - this.kbtnResetDarkAndLightTheme.CornerRoundingRadius = -1F; this.kbtnResetDarkAndLightTheme.Enabled = false; this.kbtnResetDarkAndLightTheme.Location = new System.Drawing.Point(16, 136); this.kbtnResetDarkAndLightTheme.Name = "kbtnResetDarkAndLightTheme"; @@ -394,7 +385,6 @@ private void InitializeComponent() // // kcmbPaletteMode // - this.kcmbPaletteMode.CornerRoundingRadius = -1F; this.kcmbPaletteMode.DropDownWidth = 507; this.kcmbPaletteMode.IntegralHeight = false; this.kcmbPaletteMode.Location = new System.Drawing.Point(75, 19); @@ -405,7 +395,6 @@ private void InitializeComponent() // // kcmbDarkTheme // - this.kcmbDarkTheme.CornerRoundingRadius = -1F; this.kcmbDarkTheme.DropDownWidth = 555; this.kcmbDarkTheme.IntegralHeight = false; this.kcmbDarkTheme.Location = new System.Drawing.Point(22, 47); @@ -416,7 +405,6 @@ private void InitializeComponent() // // kcmbLightTheme // - this.kcmbLightTheme.CornerRoundingRadius = -1F; this.kcmbLightTheme.DropDownWidth = 555; this.kcmbLightTheme.IntegralHeight = false; this.kcmbLightTheme.Location = new System.Drawing.Point(22, 109); @@ -439,29 +427,29 @@ private void InitializeComponent() this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Theme Switcher Options"; this.Load += new System.EventHandler(this.ThemeSwitcherOptions_Load); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel2).EndInit(); this.kryptonPanel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonNavigator1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonNavigator1).EndInit(); this.kryptonNavigator1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage1).EndInit(); this.kryptonPage1.ResumeLayout(false); this.kryptonPage1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage2).EndInit(); this.kryptonPage2.ResumeLayout(false); this.kryptonPage2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPage3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPage3).EndInit(); this.kryptonPage3.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1.Panel).EndInit(); this.kryptonGroupBox1.Panel.ResumeLayout(false); this.kryptonGroupBox1.Panel.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1).EndInit(); this.kryptonGroupBox1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kcmbPaletteMode)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbDarkTheme)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbLightTheme)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbPaletteMode).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbDarkTheme).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbLightTheme).EndInit(); this.ResumeLayout(false); } @@ -554,7 +542,7 @@ private void kbtnSubmit_Click(object sender, EventArgs e) private void kbtnRequestTheme_Click(object sender, EventArgs e) { - ApplicationUtilities.UnderConstruction(); + DebugUtilities.NotImplemented(@"This feature has not been implemented yet."); } private void kbtnResetDarkAndLightTheme_Click(object sender, EventArgs e) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/ThemeSwitcherOptionsOld.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/ThemeSwitcherOptionsOld.cs index 3fe4517f3..2e8f7d995 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/ThemeSwitcherOptionsOld.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/ThemeSwitcherOptionsOld.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -67,15 +67,15 @@ private void InitializeComponent() this.kchkImport = new Krypton.Toolkit.KryptonCheckBox(); this.kcmbPaletteMode = new Krypton.Toolkit.KryptonComboBox(); this.kryptonLabel1 = new Krypton.Toolkit.KryptonLabel(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).BeginInit(); this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.klblCustomPalettePath)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.klblCustomPalettePath).BeginInit(); this.klblCustomPalettePath.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1.Panel).BeginInit(); this.kryptonGroupBox1.Panel.SuspendLayout(); this.kryptonGroupBox1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kcmbPaletteMode)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbPaletteMode).BeginInit(); this.SuspendLayout(); // // kryptonPanel1 @@ -103,7 +103,7 @@ private void InitializeComponent() // // kbtnApply // - this.kbtnApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.kbtnApply.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnApply.DialogResult = System.Windows.Forms.DialogResult.OK; this.kbtnApply.Enabled = false; this.kbtnApply.Location = new System.Drawing.Point(428, 13); @@ -115,7 +115,7 @@ private void InitializeComponent() // // kbtnCancel // - this.kbtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.kbtnCancel.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.kbtnCancel.Location = new System.Drawing.Point(524, 13); this.kbtnCancel.Name = "kbtnCancel"; @@ -170,13 +170,13 @@ private void InitializeComponent() // kwlPaletteName // this.kwlPaletteName.AutoSize = false; - this.kwlPaletteName.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlPaletteName.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this.kwlPaletteName.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); + this.kwlPaletteName.ForeColor = System.Drawing.Color.FromArgb((int)(byte)30, (int)(byte)57, (int)(byte)91); this.kwlPaletteName.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl; this.kwlPaletteName.Location = new System.Drawing.Point(12, 58); this.kwlPaletteName.Name = "kwlPaletteName"; this.kwlPaletteName.Size = new System.Drawing.Size(602, 37); - this.kwlPaletteName.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.kwlPaletteName.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)0); this.kwlPaletteName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // kbtnLocate @@ -274,18 +274,18 @@ private void InitializeComponent() this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Theme Switcher Options"; this.Load += new System.EventHandler(this.ThemeSwitcherOptions_Load); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonPanel1).EndInit(); this.kryptonPanel1.ResumeLayout(false); this.kryptonPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.klblCustomPalettePath)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.klblCustomPalettePath).EndInit(); this.klblCustomPalettePath.ResumeLayout(false); this.klblCustomPalettePath.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1.Panel).EndInit(); this.kryptonGroupBox1.Panel.ResumeLayout(false); this.kryptonGroupBox1.Panel.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kryptonGroupBox1).EndInit(); this.kryptonGroupBox1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kcmbPaletteMode)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this.kcmbPaletteMode).EndInit(); this.ResumeLayout(false); } @@ -339,7 +339,7 @@ private void kbtnImport_Click(object sender, EventArgs e) kcmbPaletteMode.Text = "Custom"; - KryptonManager.GlobalPalette = KryptonPalette; + KryptonManager.GlobalCustomPalette = KryptonPalette; KryptonManager.GlobalPaletteMode = PaletteMode.Custom; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/UploadThemeBrowser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/UploadThemeBrowser.cs index 766648715..812fd49e0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/UploadThemeBrowser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/UX/UploadThemeBrowser.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -53,7 +53,7 @@ public UploadThemeBrowser() private void UploadThemeBrowser_Load(object sender, EventArgs e) { - ApplicationUtilities.UnderConstruction(); + DebugUtilities.NotImplemented(@"This feature has not been implemented yet."); Hide(); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Themes/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Themes/Globals/GlobalDeclarations.cs index 5dd7e51c4..513a71297 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Themes/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Themes/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Themes/Krypton.Toolkit.Suite.Extended.Themes 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Themes/Krypton.Toolkit.Suite.Extended.Themes 2022.csproj index 10b2df1a9..c04f63728 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Themes/Krypton.Toolkit.Suite.Extended.Themes 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Themes/Krypton.Toolkit.Suite.Extended.Themes 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -37,6 +25,7 @@ true Debug;Release;Nightly;Canary true + preview @@ -67,9 +56,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements theme utilities for use with KryptonFormExtended. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements theme utilities for use with KryptonFormExtended. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -77,74 +66,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Themes/Palettes/Base/CustomPaletteBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Themes/Palettes/Base/CustomPaletteBase.cs index 48b8e761f..6a41ff2c8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Themes/Palettes/Base/CustomPaletteBase.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Themes/Palettes/Base/CustomPaletteBase.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ namespace Krypton.Toolkit.Suite.Extended.Themes { [ToolboxItem(false)] - public abstract class CustomPaletteBase : Component, IPalette + public abstract class CustomPaletteBase : Component, PaletteBase { #region Instance Fields private BasePaletteType _basePaletteType; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Classes/ToastNotificationController.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Classes/ToastNotificationController.cs deleted file mode 100644 index 64c5b48e6..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Classes/ToastNotificationController.cs +++ /dev/null @@ -1,33 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - public class ToastNotificationController - { - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Classes/UtilityMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Classes/UtilityMethods.cs deleted file mode 100644 index 42526780d..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Classes/UtilityMethods.cs +++ /dev/null @@ -1,222 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - /// Provides useful methods for specified tasks. - internal class UtilityMethods - { - #region Constructor - /// - /// Initialises a new instance of . - /// - public UtilityMethods() - { - - } - #endregion - - #region Methods - /// Changes the control location. - /// The control. - /// The location. - public static void ChangeControlLocation(Control control, Point location) => control.Location = location; - - /// - /// Bitmaps to image. - /// - /// The bitmap. - /// - public static Image BitmapToImage(Bitmap bitmap) - { - Image tmp = new Bitmap(bitmap); - - return tmp; - } - - public static void SetIconType(IconType iconType, Image customImage, PictureBox target) - { - switch (iconType) - { - case IconType.Custom: - SetIconImage(target, customImage); - break; - case IconType.Ok: - SetIconImage(target, Properties.Resources.Input_Box_Ok_128_x_128); - break; - case IconType.Error: - SetIconImage(target, Properties.Resources.Input_Box_Critical_128_x_128); - break; - case IconType.Exclamation: - SetIconImage(target, Properties.Resources.Input_Box_Warning_128_x_115); - break; - case IconType.Information: - SetIconImage(target, Properties.Resources.Input_Box_Information_128_x_128); - break; - case IconType.Question: - SetIconImage(target, Properties.Resources.Input_Box_Question_128_x_128); - break; - case IconType.None: - SetIconImage(target, null); - break; - case IconType.Stop: - SetIconImage(target, Properties.Resources.Input_Box_Stop_128_x_128); - break; - case IconType.Hand: - SetIconImage(target, Properties.Resources.Input_Box_Hand_128_x_128); - break; - case IconType.Warning: - SetIconImage(target, Properties.Resources.Input_Box_Warning_128_x_115); - break; - case IconType.Asterisk: - SetIconImage(target, Properties.Resources.Input_Box_Asterisk_128_x_128); - break; - case IconType.Shield: - if (Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build >= 22000) - { - SetIconImage(target, Properties.Resources.Input_Box_UAC_Shield_Windows_11_128_x_128); - } - // Windows 10 - else if (Environment.OSVersion.Version.Major == 10 && Environment.OSVersion.Version.Build <= 19044 /* RTM - 21H2 */) - { - SetIconImage(target, Properties.Resources.Input_Box_UAC_Shield_Windows_10_128_x_128); - } - else - { - SetIconImage(target, Properties.Resources.Input_Box_UAC_Shield_Windows_7_and_8_128_x_128); - } - break; - case IconType.WindowsLogo: - // Because Windows 11 displays a generic application icon, - // we need to rely on a image instead - if (Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build >= 22000) - { - SetIconImage(target, Properties.Resources.Input_Box_Windows_11_128_x_128); - } - // Windows 10 - else if (Environment.OSVersion.Version.Major == 10 && Environment.OSVersion.Version.Build <= 19044 /* RTM - 21H2 */) - { - SetIconImage(target, Properties.Resources.Input_Box_Windows_10_128_x_121); - } - else - { - SetIconImage(target, SystemIcons.WinLogo.ToBitmap()); - } - break; - } - } - - private static void SetIconImage(PictureBox pictureBox, Image image) => pictureBox.Image = image; - - public static void FadeIn(KryptonForm activeWindow) - { - Timer timer = new Timer(); - - timer.Interval = 10; - - timer.Tick += (sender, args) => - { - if (activeWindow.Opacity == 1d) - { - timer.Stop(); - } - - activeWindow.Opacity += 0.02d; - }; - - timer.Start(); - } - - public static void FadeOutAndClose(KryptonForm activeWindow) - { - Timer timer = new Timer(); - - timer.Interval = 10; - - timer.Tick += (sender, args) => - { - if (activeWindow.Opacity == 0d) - { - timer.Stop(); - - activeWindow.Close(); - } - - activeWindow.Opacity -= 0.02d; - }; - - timer.Start(); - } - - /// Calibrates the UI layout. - /// The owner. - /// The controls. - /// The right to left. - public static void CalibrateUILayout(KryptonForm owner, Control[] controls, RightToLeft rightToLeft) - { - owner.RightToLeft = rightToLeft; - - if (controls.Length > 0) - { - foreach (Control control in controls) - { - control.RightToLeft = rightToLeft; - } - } - } - - /// Configures the toast notification button. - /// The toast button. - /// Type of the action. - /// The is accept button. - /// The is deny button. - /// The open in explorer. - /// The optional parameters. - /// Name of the process. - /// The text. - public static void ConfigureToastNotificationButton(KryptonToastButton toastButton, ActionType actionType, - bool? isAcceptButton, bool? isDenyButton, bool? openInExplorer, object optionalParameters = null, - string processName = null, string text = null) - { - toastButton.ActionType = actionType; - - toastButton.IsAcceptButton = isAcceptButton ?? false; - - toastButton.IsDenyButton = isDenyButton ?? false; - - toastButton.OpenInExplorer = openInExplorer ?? false; - - toastButton.OptionalParameters = optionalParameters; - - toastButton.ProcessName = processName ?? string.Empty; - - toastButton.Text = text ?? string.Empty; - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Components/KryptonToastNotificationManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Components/KryptonToastNotificationManager.cs deleted file mode 100644 index 1d1493d2c..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Components/KryptonToastNotificationManager.cs +++ /dev/null @@ -1,528 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - public class KryptonToastNotificationManager : Component - { - #region Variables - - private ActionType _actionType; - - private ActionButtonLocation _actionButtonLocation; - - private bool _showActionButton, _useUserResponse, _useProgressBar, _usePanelColourInTextArea, _useNativeBackColourInUserResponseArea, _showCloseButton, _openProcessInExplorer; - - private Color _contentTextColour, _headerTextColour, _userPromptTextColour, _userResponsePromptColour; - - private DefaultNotificationButton _defaultNotificationButton; - - private PaletteRelativeAlign _userResponsePromptAlignHorizontal, _userResponsePromptAlignVertical; - - private Font _contentTypeface, _headerTypeface, _userResponsePromptFont; - - private IconType _iconType; - - private int _time, _seconds; - - private Timer _timer; - - private SoundPlayer _soundPlayer; - - private string _actionButtonText, _title, _contentText, _soundPath, _dismissText, _userResponsePrompt, _processPath, _processName; - - private object _optionalParameters; - - private Stream _soundStream; - - private Image _customImage; - - private RightToLeftSupport _rightToLeftSupport; - - private ToastNotificationContentAreaType _contentAreaType; - - private ToastNotificationSystemSounds _soundSystemSounds; - - private KryptonCommand _actionButtonCommand; - #endregion - - #region Properties - - [DefaultValue(typeof(ActionType), "ActionType.Default")] - public ActionType ActionType { get => _actionType; set => _actionType = value; } - - [DefaultValue(typeof(ActionButtonLocation), "ActionButtonLocation.Left")] - public ActionButtonLocation ActionButtonLocation { get => _actionButtonLocation; set => _actionButtonLocation = value; } - - [DefaultValue(false)] - public bool ShowActionButton { get => _showActionButton; set => _showActionButton = value; } - - [DefaultValue(false), Description(@"Allows the user to type a response in a toast window.")] - public bool UseUserResponsePrompt { get => _useUserResponse; set => _useUserResponse = value; } - - [DefaultValue(false), Description(@"Shows a progress bar in a toast window.")] - public bool UseProgressBar { get => _useProgressBar; set => _useProgressBar = value; } - - [DefaultValue(false), Description(@"")] - public bool UsePanelColourInTextArea { get => _usePanelColourInTextArea; set => _usePanelColourInTextArea = value; } - - [DefaultValue(false), Description(@"")] - public bool UseNativeBackColourInUserResponseArea { get => _useNativeBackColourInUserResponseArea; set => _useNativeBackColourInUserResponseArea = value; } - - [DefaultValue(false), Description(@"")] - public bool ShowCloseButton { get => _showCloseButton; set => _showCloseButton = value; } - - [DefaultValue(false)] - public bool OpenProcessInExplorer { get => _openProcessInExplorer; set => _openProcessInExplorer = value; } - - [DefaultValue(typeof(Color), "Color.Gray"), Description(@"")] - public Color UserResponsePromptColour { get => _userResponsePromptColour; set => _userResponsePromptColour = value; } - - [DefaultValue(typeof(DefaultNotificationButton), "DefaultNotificationButton.DismissButton")] - public DefaultNotificationButton DefaultNotificationButton { get => _defaultNotificationButton; set => _defaultNotificationButton = value; } - - [DefaultValue(typeof(PaletteRelativeAlign), "PaletteRelativeAlign.Center"), Description(@"")] - public PaletteRelativeAlign UserResponsePromptAlignHorizontal { get => _userResponsePromptAlignHorizontal; set => _userResponsePromptAlignHorizontal = value; } - - [DefaultValue(typeof(PaletteRelativeAlign), "PaletteRelativeAlign.Center"), Description(@"")] - public PaletteRelativeAlign UserResponsePromptAlignVertical { get => _userResponsePromptAlignVertical; set => _userResponsePromptAlignVertical = value; } - - [DefaultValue(typeof(Font), "Segoe UI, 8.25F"), Description(@"")] - public Font ContentTypeface { get => _contentTypeface; set => _contentTypeface = value; } - - [DefaultValue(typeof(Font), "Segoe UI, 12F"), Description(@"")] - public Font HeaderTypeface { get => _headerTypeface; set => _headerTypeface = value; } - - [DefaultValue(typeof(Font), "Segoe UI, 8.25F"), Description(@"")] - public Font UserResponsePromptFont { get => _userResponsePromptFont; set => _userResponsePromptFont = value; } - - [DefaultValue(typeof(IconType), "IconType.None"), Description(@"")] - public IconType IconType { get => _iconType; set => _iconType = value; } - - [DefaultValue(60), Description(@"")] - public int Time { get => _time; set => _time = value; } - - [DefaultValue(60), Description(@"")] - public int Seconds { get => _seconds; set => _seconds = value; } - - [DefaultValue(@"O&pen")] - public string ActionButtonText { get => _actionButtonText; set => _actionButtonText = value; } - - [DefaultValue(@""), Description(@"")] - public string Title { get => _title; set => _title = value; } - - [DefaultValue(@""), Description(@"")] - public string ContentText { get => _contentText; set => _contentText = value; } - - [DefaultValue(@""), Description(@"")] - public string SoundPath { get => _soundPath; set => _soundPath = value; } - - [DefaultValue(@""), Description(@"")] - public string DismissText { get => _dismissText; set => _dismissText = value; } - - [DefaultValue(@"Type response here..."), Description(@"")] - public string UserResponsePromptText { get => _userResponsePrompt; set => _userResponsePrompt = value; } - - [DefaultValue(@"")] - public string ProcessPath { get => _processPath; set => _processPath = value; } - - [DefaultValue(@"")] - public string ProcessName { get => _processName; set => _processName = value; } - - [DefaultValue(null)] - public object OptionalParameters { get => _optionalParameters; set => _optionalParameters = value; } - - [DefaultValue(null), Description(@"")] - public Stream SoundStream { get => _soundStream; set => _soundStream = value; } - - [DefaultValue(null), Description(@"")] - public Image CustomImage { get => _customImage; set => _customImage = value; } - - [DefaultValue(typeof(RightToLeftSupport), "RightToLeftSupport.LeftToRight"), Description(@"")] - public RightToLeftSupport RightToLeftSupport { get => _rightToLeftSupport; set => _rightToLeftSupport = value; } - - [DefaultValue(typeof(ToastNotificationContentAreaType), "ContentAreaType.WrappedLabel"), Description(@"")] - public ToastNotificationContentAreaType ContentAreaType { get => _contentAreaType; set => _contentAreaType = value; } - - [DefaultValue(typeof(ToastNotificationSystemSounds), "ToastNotificationSystemSounds.None")] - public ToastNotificationSystemSounds ToastNotificationSound { get => _soundSystemSounds; set => _soundSystemSounds = value; } - - [DefaultValue(null)] - public KryptonCommand ActionButtonCommand { get => _actionButtonCommand; set => _actionButtonCommand = value; } - - #endregion - - #region Custom Events - public event EventHandler DisplayNotification; - #endregion - - #region Constructor - - /// Initializes a new instance of the class. - public KryptonToastNotificationManager() - { - ActionButtonLocation = ActionButtonLocation.Left; - - ActionType = ActionType.Default; - - ShowActionButton = false; - - UseUserResponsePrompt = false; - - UseProgressBar = false; - - UsePanelColourInTextArea = false; - - UseNativeBackColourInUserResponseArea = false; - - ShowCloseButton = false; - - OpenProcessInExplorer = false; - - UserResponsePromptColour = Color.Gray; - - DefaultNotificationButton = DefaultNotificationButton.DismissButton; - - UserResponsePromptAlignHorizontal = PaletteRelativeAlign.Center; - - UserResponsePromptAlignVertical = PaletteRelativeAlign.Center; - - ContentTypeface = new Font("Segoe UI", 8.25F); - - HeaderTypeface = new Font("Segoe UI", 12F); - - UserResponsePromptFont = new Font("Segoe UI", 8.25F); - - IconType = IconType.None; - - Time = 60; - - Seconds = 60; - - ActionButtonText = @"O&pen"; - - Title = @""; - - ContentText = @""; - - SoundPath = @""; - - DismissText = @"&Dismiss"; - - UserResponsePromptText = @"Type response here..."; - - ProcessName = @""; - - ProcessPath = @""; - - OptionalParameters = null; - - SoundStream = null; - - CustomImage = null; - - RightToLeftSupport = RightToLeftSupport.LeftToRight; - - ContentAreaType = ToastNotificationContentAreaType.WrappedLabel; - - ToastNotificationSound = ToastNotificationSystemSounds.None; - - ActionButtonCommand = null; - } - - /// Initializes a new instance of the class. - /// Type of the action. - /// The action button location. - /// if set to true [use user response]. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The use native back colour in user response area. - /// The show close button. - /// The user response prompt colour. - /// The default notification button. - /// The user response prompt align horizontal. - /// The user response prompt align vertical. - /// The global typeface. - /// The user response prompt font. - /// Type of the icon. - /// The time. - /// The seconds. - /// The sound path. - /// The dismiss text. - /// The user response prompt text. - /// The sound stream. - /// The custom image. - /// The right to left support. - /// if set to true [use progress bar]. - /// Type of the content area. - /// The notification system sound. - public KryptonToastNotificationManager(ActionType? actionType, ActionButtonLocation? actionButtonLocation, - bool useUserResponse, string title, string contentText, - bool? usePanelColourInTextArea, bool? useNativeBackColourInUserResponseArea, - bool? showCloseButton, bool? showActionButton, - Color? userResponsePromptColour = null, - DefaultNotificationButton? defaultNotificationButton = null, - PaletteRelativeAlign userResponsePromptAlignHorizontal = PaletteRelativeAlign.Near, - PaletteRelativeAlign userResponsePromptAlignVertical = PaletteRelativeAlign.Near, - Font contentTypeface = null, Font headerTypeface = null, - Font userResponsePromptFont = null, - IconType iconType = IconType.None, - int time = 0, int seconds = 0, string actionButtonText = @"O&pen", - string soundPath = null, string dismissText = "Di&smiss", - string userResponsePromptText = "Type response here...", - Stream soundStream = null, - Image customImage = null, - RightToLeftSupport rightToLeftSupport = RightToLeftSupport.LeftToRight, - bool useProgressBar = false, - ToastNotificationContentAreaType contentAreaType = ToastNotificationContentAreaType.WrappedLabel, - ToastNotificationSystemSounds? notificationSystemSound = ToastNotificationSystemSounds.None, - KryptonCommand actionButtonCommand = null, - string processName = null, - string processPath = null, - bool? openProcessInExplorer = null, - object optionalParameters = null) - { - ActionButtonLocation = actionButtonLocation ?? ActionButtonLocation.Left; - - ActionType = actionType ?? ActionType.Default; - - ShowActionButton = showActionButton ?? false; - - UseProgressBar = useProgressBar; - - UseUserResponsePrompt = useUserResponse; - - ShowCloseButton = showCloseButton ?? false; - - OpenProcessInExplorer = openProcessInExplorer ?? false; - - Title = title; - - ContentText = contentText; - - UsePanelColourInTextArea = usePanelColourInTextArea ?? usePanelColourInTextArea.GetValueOrDefault(); - - UseNativeBackColourInUserResponseArea = useNativeBackColourInUserResponseArea ?? useNativeBackColourInUserResponseArea.GetValueOrDefault(); - - UserResponsePromptColour = userResponsePromptColour ?? Color.Gray; - - DefaultNotificationButton = defaultNotificationButton ?? DefaultNotificationButton.DismissButton; - - UserResponsePromptAlignHorizontal = userResponsePromptAlignHorizontal; - - UserResponsePromptAlignVertical = userResponsePromptAlignVertical; - - ContentTypeface = contentTypeface ?? new Font("Segoe UI", 8.25F); - - HeaderTypeface = headerTypeface ?? new Font("Segoe UI", 12F); - - UserResponsePromptFont = userResponsePromptFont ?? new Font("Segoe UI", 8.25F); - - IconType = iconType; - - Time = time; - - Seconds = seconds; - - ActionButtonText = actionButtonText; - - SoundPath = soundPath; - - DismissText = dismissText; - - UserResponsePromptText = userResponsePromptText; - - ProcessPath = processPath; - - ProcessName = processName; - - OptionalParameters = optionalParameters; - - SoundStream = soundStream; - - CustomImage = customImage; - - RightToLeftSupport = rightToLeftSupport; - - ContentAreaType = contentAreaType; - - ToastNotificationSound = notificationSystemSound ?? ToastNotificationSystemSounds.None; - - ActionButtonCommand = actionButtonCommand ?? null; - } - #endregion - - #region Methods - public void DisplayNotificationToast() - { - if (_rightToLeftSupport == RightToLeftSupport.LeftToRight) - { - if (!_useUserResponse) - { - if (!_useProgressBar) - { - if (_contentAreaType == ToastNotificationContentAreaType.Label) - { - ApplicationUtilities.UnderConstruction(); - } - else if (_contentAreaType == ToastNotificationContentAreaType.WrappedLabel) - { - BasicNotificationAlternativeUI notification = new BasicNotificationAlternativeUI(ActionButtonLocation, ActionType, - IconType, - Title, ContentText, ShowCloseButton, - Seconds, SoundPath, - CustomImage, DismissText, - RightToLeftSupport, - ActionButtonCommand); - - notification.Show(); - } - else if (_contentAreaType == ToastNotificationContentAreaType.MultiLinedTextBox) - { - ApplicationUtilities.UnderConstruction(); - } - else if (_contentAreaType == ToastNotificationContentAreaType.RichTextBox) - { - BasicNotification notification = new BasicNotification(ActionButtonLocation, ActionType, - IconType, Title, ContentText, - UsePanelColourInTextArea, - ShowCloseButton, ShowActionButton, - CustomImage, DismissText, - ActionButtonText, - RightToLeftSupport, - ActionButtonCommand, - OpenProcessInExplorer, - ProcessPath, - OptionalParameters); - - notification.Show(); - } - } - else - { - if (_contentAreaType == ToastNotificationContentAreaType.Label) - { - ApplicationUtilities.UnderConstruction(); - } - else if (_contentAreaType == ToastNotificationContentAreaType.WrappedLabel) - { - BasicNotificationWithProgressBarAlternativeUI notification = - new BasicNotificationWithProgressBarAlternativeUI(IconType, Title, ContentText, - ShowCloseButton, - Seconds, SoundStream, - CustomImage, DismissText, RightToLeftSupport); - - notification.Show(); - } - else if (_contentAreaType == ToastNotificationContentAreaType.MultiLinedTextBox) - { - ApplicationUtilities.UnderConstruction(); - } - else if (_contentAreaType == ToastNotificationContentAreaType.RichTextBox) - { - BasicNotificationWithProgressBar notification = new BasicNotificationWithProgressBar(ActionButtonLocation, ActionType, - IconType, Title, ContentText, - UsePanelColourInTextArea, - ShowCloseButton, ShowActionButton, - SoundStream, CustomImage, DismissText, - RightToLeftSupport, ActionButtonCommand); - - notification.Show(); - } - } - } - else - { - if (!_useProgressBar) - { - if (_contentAreaType == ToastNotificationContentAreaType.Label) - { - ApplicationUtilities.UnderConstruction(); - } - else if (_contentAreaType == ToastNotificationContentAreaType.WrappedLabel) - { - BasicNotificationWithUserResponseWrappedLabel notification = new BasicNotificationWithUserResponseWrappedLabel(ActionButtonLocation, ActionType, - IconType, Title, ContentText, - Seconds, SoundPath, CustomImage, - DismissText, UserResponsePromptText, - UserResponsePromptColour, - UserResponsePromptAlignHorizontal, - UserResponsePromptAlignVertical, - UserResponsePromptFont, - RightToLeftSupport, - ActionButtonCommand); - - notification.Show(); - } - else if (_contentAreaType == ToastNotificationContentAreaType.MultiLinedTextBox) - { - ApplicationUtilities.UnderConstruction(); - } - else if (_contentAreaType == ToastNotificationContentAreaType.RichTextBox) - { - BasicNotificationWithUserResponse notification = new BasicNotificationWithUserResponse(ActionButtonLocation, ActionType, - IconType, Title, ContentText, - UsePanelColourInTextArea, - UseNativeBackColourInUserResponseArea, - ShowCloseButton, - Seconds, - SoundPath, CustomImage, - DismissText, UserResponsePromptText, - UserResponsePromptColour, - UserResponsePromptAlignHorizontal, UserResponsePromptAlignVertical, - UserResponsePromptFont, RightToLeftSupport, - ActionButtonCommand); - - notification.Show(); - } - } - } - } - else - { - if (!_useUserResponse) - { - - } - else - { - - } - } - } - - public DialogResult DisplayNotificationToastResult() - { - DialogResult result = DialogResult.None; - - - return result; - } - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Controls Toolkit/KryptonToastButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Controls Toolkit/KryptonToastButton.cs deleted file mode 100644 index 612ffce2e..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Controls Toolkit/KryptonToastButton.cs +++ /dev/null @@ -1,360 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - [ToolboxItem(false)] - public class KryptonToastButton : KryptonButton - { - #region Instance Fields - - private ActionType _actionType; - - private bool _useAcceptDenyColours, _isAcceptButton, _isDenyButton, _openInExplorer; - - private Color _acceptButtonBackColour1, - _acceptButtonBackColour2, - _denyButtonBackColour1, - _denyButtonBackColour2, - _acceptButtonTextColour1, - _acceptButtonTextColour2, - _denyButtonTextColour1, - _denyButtonTextColour2; - - private object _optionalParameters; - - private string _processNane; - - #endregion - - #region Public - - [DefaultValue(typeof(ActionType), @"ActionType.Default")] - public ActionType ActionType { get => _actionType; set { _actionType = value; Invalidate(); } } - - [DefaultValue(false)] - public bool UseAcceptDenyColours { get => _useAcceptDenyColours; set { _useAcceptDenyColours = value; Invalidate(); } } - - [DefaultValue(false)] - public bool IsAcceptButton { get => _isAcceptButton; set => _isAcceptButton = value; } - - [DefaultValue(false)] - public bool IsDenyButton { get => _isDenyButton; set => _isDenyButton = value; } - - [DefaultValue(false)] - public bool OpenInExplorer { get => _openInExplorer; set => _openInExplorer = value; } - - [DefaultValue(typeof(Color), @"Color.Green")] - public Color AcceptButtonBackColour1 { get => _acceptButtonBackColour1; set { _acceptButtonBackColour1 = value; Invalidate(); } } - - [DefaultValue(typeof(Color), @"Color.Empty")] - public Color AcceptButtonBackColour2 { get => _acceptButtonBackColour2; set { _acceptButtonBackColour2 = value; Invalidate(); } } - - [DefaultValue(typeof(Color), @"Color.Red")] - public Color DenyButtonBackColour1 { get => _denyButtonBackColour1; set { _denyButtonBackColour1 = value; Invalidate(); } } - - [DefaultValue(typeof(Color), @"Color.Empty")] - public Color DenyButtonBackColour2 { get => _denyButtonBackColour2; set { _denyButtonBackColour2 = value; Invalidate(); } } - - [DefaultValue(typeof(Color), @"Color.Empty")] - public Color AcceptButtonTextColour1 { get => _acceptButtonTextColour1; set { _acceptButtonTextColour1 = value; Invalidate(); } } - - [DefaultValue(typeof(Color), @"Color.Empty")] - public Color AcceptButtonTextColour2 { get => _acceptButtonTextColour2; set { _acceptButtonTextColour2 = value; Invalidate(); } } - - [DefaultValue(typeof(Color), @"Color.Empty")] - public Color DenyButtonTextColour1 { get => _denyButtonTextColour1; set { _denyButtonTextColour1 = value; Invalidate(); } } - - [DefaultValue(typeof(Color), @"Color.Empty")] - public Color DenyButtonTextColour2 { get => _denyButtonTextColour2; set { _denyButtonTextColour2 = value; Invalidate(); } } - - [DefaultValue(null)] - public object OptionalParameters { get => _optionalParameters; set => _optionalParameters = value; } - - [DefaultValue(null)] - public string ProcessName { get => _processNane; set => _processNane = value; } - - #endregion - - #region Identity - - /// Initializes a new instance of the class. - public KryptonToastButton() - { - _actionType = ActionType.Default; - - _isAcceptButton = false; - - _isDenyButton = false; - - _openInExplorer = false; - - _acceptButtonBackColour1 = Color.Green; - - _acceptButtonBackColour2 = Color.Green; - - _acceptButtonTextColour1 = Color.Empty; - - _acceptButtonTextColour2 = Color.Empty; - - _denyButtonBackColour1 = Color.Red; - - _denyButtonBackColour2 = Color.Red; - - _denyButtonTextColour1 = Color.Empty; - - _denyButtonTextColour2 = Color.Empty; - - _optionalParameters = null; - - _processNane = null; - } - - #endregion - - #region Implementation - - /// Returns the display string. - /// The button text. - /// - private KryptonButtonBuiltInDisplayString ReturnDisplayString(string buttonText) - { - if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.Abort) - { - return KryptonButtonBuiltInDisplayString.Abort; - } - else if (buttonText == KryptonLanguageManager.CustomToolkitStrings.Apply) - { - return KryptonButtonBuiltInDisplayString.Apply; - } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.Cancel) - { - return KryptonButtonBuiltInDisplayString.Cancel; - } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.Close) - { - return KryptonButtonBuiltInDisplayString.Close; - } - else if (buttonText == KryptonLanguageManager.CustomToolkitStrings.Collapse) - { - return KryptonButtonBuiltInDisplayString.Collapse; - } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.Continue) - { - return KryptonButtonBuiltInDisplayString.Continue; - } - else if (buttonText == KryptonLanguageManager.CustomToolkitStrings.Expand) - { - return KryptonButtonBuiltInDisplayString.Expand; - } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.Help) - { - return KryptonButtonBuiltInDisplayString.Help; - } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.Ignore) - { - return KryptonButtonBuiltInDisplayString.Ignore; - } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.No) - { - return KryptonButtonBuiltInDisplayString.No; - } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.OK) - { - return KryptonButtonBuiltInDisplayString.Ok; - } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.Retry) - { - return KryptonButtonBuiltInDisplayString.Retry; - } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.Today) - { - return KryptonButtonBuiltInDisplayString.Today; - } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.TryAgain) - { - return KryptonButtonBuiltInDisplayString.TryAgain; - } - else if (buttonText == KryptonLanguageManager.GeneralToolkitStrings.Yes) - { - return KryptonButtonBuiltInDisplayString.Yes; - } - else - { - return KryptonButtonBuiltInDisplayString.Custom; - } - } - - /// Changes the back colour. - /// The first back colour. - /// The second back colour. - private void ChangeBackColour(Color backColour, Color? backColour2) - { - if (backColour2 != null) - { - StateCommon.Back.Color1 = backColour; - - StateCommon.Back.Color2 = backColour2 ?? backColour; - } - else - { - StateCommon.Back.Color1 = backColour; - - StateCommon.Back.Color2 = backColour; - } - } - - /// Changes the text colour. - /// The text colour1. - /// The text colour2. - private void ChangeTextColour(Color textColour1, Color? textColour2) - { - if (textColour2 != null) - { - StateCommon.Content.ShortText.Color1 = textColour1; - - StateCommon.Content.ShortText.Color2 = textColour2 ?? textColour1; - } - else - { - StateCommon.Content.ShortText.Color1 = textColour1; - - StateCommon.Content.ShortText.Color2 = textColour1; - } - } - - /// Sets the accept button. - /// if set to true [value]. - private void SetAcceptButton(bool value) => _isAcceptButton = value; - - /// Sets the deny button. - /// if set to true [value]. - private bool SetDenyButton(bool value) => _isDenyButton = value; - - private void LaunchProcess(object value) - { - try - { - Process.Start(value.ToString()); - } - catch (Exception e) - { - ExceptionCapture.CaptureException(e); - } - } - - private void OpenProcess(object value, string processName, bool openInExplorer = false) - { - try - { - if (openInExplorer) - { - processName = null; - - Process.Start(@"explorer.exe", value.ToString()); - } - else - { - Process.Start(processName, value.ToString()); - } - } - catch (Exception e) - { - ExceptionCapture.CaptureException(e); - } - } - - #endregion - - #region Protected - - /// Raises the TextChanged event. - /// An EventArgs that contains the event data. - protected override void OnTextChanged(EventArgs e) - { - base.OnTextChanged(e); - } - - /// Raises the event. - /// The instance containing the event data. - protected override void OnPaint(PaintEventArgs e) - { - if (_useAcceptDenyColours) - { - if (_isAcceptButton) - { - if (_acceptButtonBackColour2 != Color.Empty) - { - ChangeBackColour(AcceptButtonBackColour1, AcceptButtonBackColour2); - } - else - { - ChangeBackColour(AcceptButtonBackColour1, null); - } - - } - else if (_isDenyButton) - { - if (_denyButtonTextColour2 != Color.Empty) - { - ChangeBackColour(DenyButtonBackColour1, DenyButtonBackColour2); - } - else - { - ChangeBackColour(DenyButtonBackColour1, null); - } - } - else - { - ChangeBackColour(Color.Empty, Color.Empty); - } - } - else - { - ChangeBackColour(Color.Empty, Color.Empty); - } - - base.OnPaint(e); - } - - protected override void OnClick(EventArgs e) - { - if (_actionType == ActionType.LaunchProcess) - { - LaunchProcess(_optionalParameters); - } - else if (_actionType == ActionType.Open) - { - OpenProcess(_optionalParameters, _processNane, _openInExplorer); - } - - base.OnClick(e); - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/ActionButtonLocation.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/ActionButtonLocation.cs deleted file mode 100644 index 26db2b08c..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/ActionButtonLocation.cs +++ /dev/null @@ -1,35 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - public enum ActionButtonLocation - { - Left = 0, - Right = 1 - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/ActionType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/ActionType.cs deleted file mode 100644 index e62c4a090..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/ActionType.cs +++ /dev/null @@ -1,37 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - public enum ActionType - { - Default = 0, - Dismiss = 1, - LaunchProcess = 2, - Open = 3 - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/DefaultNotificationButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/DefaultNotificationButton.cs deleted file mode 100644 index c1db24762..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/DefaultNotificationButton.cs +++ /dev/null @@ -1,39 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - public enum DefaultNotificationButton - { - /// Use the 'action' button as the default button. - ActionButton = 0, - /// Use the 'dismiss' button as the default button. - DismissButton = 1, - /// Use neither button as the default button. - None = 2 - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/IconType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/IconType.cs deleted file mode 100644 index 83d79ad12..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/IconType.cs +++ /dev/null @@ -1,62 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - /// - ///
- ///
- public enum IconType - { - /// Specify no icon. - None = 0, - /// Specify a hand icon. - Hand = 1, - /// Specify a question icon. - Question = 2, - /// Specify a exclamation icon. - Exclamation = 3, - /// Specify a asterisk icon. - Asterisk = 4, - /// Specify a stop icon. - Stop = 5, - /// Specify a error icon. - Error = 6, - /// Specify a warning icon. - Warning = 7, - /// Specify a information icon. - Information = 8, - /// Specify a UAC shield icon. - Shield = 9, - /// Specify a Windows logo icon. - WindowsLogo = 10, - /// Use a custom icon. - Custom = 11, - /// Use a Ok icon. - Ok = 12 - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/KryptonButtonBuiltInDisplayString.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/KryptonButtonBuiltInDisplayString.cs deleted file mode 100644 index 4fcaf0ee4..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/KryptonButtonBuiltInDisplayString.cs +++ /dev/null @@ -1,54 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - public enum KryptonButtonBuiltInDisplayString - { - Abort = 0, - Apply = 1, - Cancel = 2, - Collapse = 3, - Continue = 4, - Close = 5, - Custom = 6, - Yes = 7, - No = 8, - Ok = 9, - Retry = 10, - Ignore = 11, - Help = 12, - TryAgain = 13, - Expand = 14, - Today = 15, - Back = 16, - Exit = 17, - Finish = 18, - Next = 19, - Previous = 20 - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/RightToLeftSupport.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/RightToLeftSupport.cs deleted file mode 100644 index 2d9fd64be..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/RightToLeftSupport.cs +++ /dev/null @@ -1,36 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - public enum RightToLeftSupport - { - Inherit = 0, - LeftToRight = 1, - RightToLeft = 2 - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/ToastNotificationContentAreaType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/ToastNotificationContentAreaType.cs deleted file mode 100644 index 370c5a54b..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/ToastNotificationContentAreaType.cs +++ /dev/null @@ -1,37 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - public enum ToastNotificationContentAreaType - { - Label = 0, - WrappedLabel = 1, - MultiLinedTextBox = 2, - RichTextBox = 3 - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/ToastNotificationSystemSounds.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/ToastNotificationSystemSounds.cs deleted file mode 100644 index c0df88775..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Enumerations/ToastNotificationSystemSounds.cs +++ /dev/null @@ -1,40 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - public enum ToastNotificationSystemSounds - { - Asterisk = 0, - Beep = 1, - Exclamation = 2, - Hand = 3, - Question = 4, - Custom = 5, - None = 6 - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Globals/GlobalDeclarations.cs deleted file mode 100644 index 311d62dc2..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Globals/GlobalDeclarations.cs +++ /dev/null @@ -1,36 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -global using System; -global using System.ComponentModel; -global using System.Drawing; -global using System.Diagnostics; -global using System.IO; -global using System.Media; -global using System.Windows.Forms; - -global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Interfaces/IToastNotification.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Interfaces/IToastNotification.cs deleted file mode 100644 index 5ab23eb49..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Interfaces/IToastNotification.cs +++ /dev/null @@ -1,149 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - /// Contains elements of . - public interface IToastNotification - { - /// Gets or sets the button location. - /// The action button location. - public ActionButtonLocation ButtonLocation { get; set; } - - /// - /// Gets or sets the type of the action. - /// - /// - /// The type of the action. - /// - public ActionType Action { get; set; } - - /// - /// Gets or sets a value indicating whether this is fade. - /// - /// - /// true if fade; otherwise, false. - /// - public bool Fade { get; set; } - - /// - /// Gets or sets a value indicating whether [show action button]. - /// - /// - /// true if [show action button]; otherwise, false. - /// - public bool ShowActionButton { get; set; } - - /// - /// Gets or sets the sound path. - /// - /// - /// The sound path. - /// - public string SoundPath { get; set; } - - /// - /// Gets or sets the sound stream. - /// - /// - /// The sound stream. - /// - public Stream SoundStream { get; set; } - - /// - /// Gets or sets the header text. - /// - /// - /// The header text. - /// - public string HeaderText { get; set; } - - /// - /// Gets or sets the content text. - /// - /// - /// The content text. - /// - public string ContentText { get; set; } - - /// - /// Gets or sets the name of the process. - /// - /// - /// The name of the process. - /// - public string ProcessName { get; set; } - - /// - /// Gets or sets the icon image. - /// - /// - /// The icon image. - /// - public Image IconImage { get; set; } - - /// - /// Gets or sets the seconds. - /// - /// - /// The seconds. - /// - public int Seconds { get; set; } - - /// Gets or sets the corner radius. - /// The corner radius. - public int CornerRadius { get; set; } - - /// Gets or sets the palette draw borders. - /// The palette draw borders. - public PaletteDrawBorders PaletteDrawBorders { get; set; } - - /// Gets or sets the type of the icon. - /// The type of the icon. - public IconType IconType { get; set; } - - /// - /// Gets or sets the right to left support. - /// - /// - /// The right to left support. - /// - public RightToLeftSupport RightToLeft { get; set; } - - /// Gets or sets the dismiss text. - /// The dismiss text. - public string DismissText { get; set; } - - /// Gets or sets the action text. - /// The action text. - public string ActionText { get; set; } - - /// Gets or sets the icon size mode. - /// The icon size mode. - public PictureBoxSizeMode IconSizeMode { get; set; } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Interfaces/IToastNotificationUIElements.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Interfaces/IToastNotificationUIElements.cs deleted file mode 100644 index fad64536a..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Interfaces/IToastNotificationUIElements.cs +++ /dev/null @@ -1,64 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - public interface IToastNotificationUIElements - { - /// Gets the base window. - /// The base window. - public KryptonForm BaseWindow { get; } - - /// Gets the content panel. - /// The content panel. - public KryptonPanel ContentPanel { get; } - - /// Gets the button panel. - /// The button panel. - public KryptonPanel ButtonPanel { get; } - - /// Gets the header label. - /// The header label. - public KryptonLabel HeaderLabel { get; } - - /// Gets the content label. - /// The content label. - public KryptonWrapLabel ContentLabel { get; } - - /// Gets the action button. - /// The action button. - public KryptonButton ActionButton { get; } - - /// Gets the dismiss button. - /// The dismiss button. - public KryptonButton DismissButton { get; } - - /// Gets the icon box. - /// The icon box. - public PictureBox IconBox { get; } - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Krypton.Toolkit.Suite.Extended.Toast 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Krypton.Toolkit.Suite.Extended.Toast 2022.csproj deleted file mode 100644 index 8fc935eb7..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Krypton.Toolkit.Suite.Extended.Toast 2022.csproj +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - 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 - - - - - - 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 - - - - - - library - Krypton.Toolkit.Suite.Extended.Toast - Krypton.Toolkit.Suite.Extended.Toast - - false - True - StrongKrypton.snk - true - en - Debug;Release;Nightly;Canary - preview - enable - 6 - true - - - - - - - Krypton.Toolkit.Suite.Extended.Toast.Canary - - - - - - Krypton.Toolkit.Suite.Extended.Toast.Nightly - - - - - - Krypton.Toolkit.Suite.Extended.Toast - - - - - Krypton.Toolkit.Suite.Extended.Toast - - - - - - - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package contains a framework that allows the creation of toast notifications. - - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. - Also, all libraries are included targeting each specific framework version for performance purposes. - - To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - - preview - - - - - - - - - - - ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.Toast\Krypton.Toolkit.Suite.Extended.Toast.xml - ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.Toast\ - enable - - - - - - - - - True - True - Resources.resx - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - - - - true - - - - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Krypton.Toolkit.Suite.Extended.Toast.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Krypton.Toolkit.Suite.Extended.Toast.licenseheader deleted file mode 100644 index 017566f45..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Krypton.Toolkit.Suite.Extended.Toast.licenseheader +++ /dev/null @@ -1,27 +0,0 @@ -extensions: .cs -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/License/License.txt b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/License/License.txt deleted file mode 100644 index 5a46453cb..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/License/License.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 - 2023 Krypton Suite - -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 -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -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. \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Properties/Resources.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Properties/Resources.Designer.cs deleted file mode 100644 index 35ad749fc..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Properties/Resources.Designer.cs +++ /dev/null @@ -1,403 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Krypton.Toolkit.Suite.Extended.Toast.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Krypton.Toolkit.Suite.Extended.Toast.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Asterisk_128_x_128 { - get { - object obj = ResourceManager.GetObject("Input_Box_Asterisk_128_x_128", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Critical_128_x_128 { - get { - object obj = ResourceManager.GetObject("Input_Box_Critical_128_x_128", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Critical_32_x_32 { - get { - object obj = ResourceManager.GetObject("Input_Box_Critical_32_x_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Critical_48_x_48 { - get { - object obj = ResourceManager.GetObject("Input_Box_Critical_48_x_48", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Critical_64_x_64 { - get { - object obj = ResourceManager.GetObject("Input_Box_Critical_64_x_64", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Hand_128_x_128 { - get { - object obj = ResourceManager.GetObject("Input_Box_Hand_128_x_128", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Hand_32_x_32 { - get { - object obj = ResourceManager.GetObject("Input_Box_Hand_32_x_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Hand_48_x_48 { - get { - object obj = ResourceManager.GetObject("Input_Box_Hand_48_x_48", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Hand_64_x_64 { - get { - object obj = ResourceManager.GetObject("Input_Box_Hand_64_x_64", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Information_128_x_128 { - get { - object obj = ResourceManager.GetObject("Input_Box_Information_128_x_128", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Information_32_x_32 { - get { - object obj = ResourceManager.GetObject("Input_Box_Information_32_x_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Information_48_x_48 { - get { - object obj = ResourceManager.GetObject("Input_Box_Information_48_x_48", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Information_64_x_64 { - get { - object obj = ResourceManager.GetObject("Input_Box_Information_64_x_64", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Ok_128_x_128 { - get { - object obj = ResourceManager.GetObject("Input_Box_Ok_128_x_128", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Ok_32_x_32 { - get { - object obj = ResourceManager.GetObject("Input_Box_Ok_32_x_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Ok_48_x_48 { - get { - object obj = ResourceManager.GetObject("Input_Box_Ok_48_x_48", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Ok_64_x_64 { - get { - object obj = ResourceManager.GetObject("Input_Box_Ok_64_x_64", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Question_128_x_128 { - get { - object obj = ResourceManager.GetObject("Input_Box_Question_128_x_128", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Question_32_x_32 { - get { - object obj = ResourceManager.GetObject("Input_Box_Question_32_x_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Question_48_x_48 { - get { - object obj = ResourceManager.GetObject("Input_Box_Question_48_x_48", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Question_64_x_64 { - get { - object obj = ResourceManager.GetObject("Input_Box_Question_64_x_64", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Stop_128_x_128 { - get { - object obj = ResourceManager.GetObject("Input_Box_Stop_128_x_128", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Stop_32_x_32 { - get { - object obj = ResourceManager.GetObject("Input_Box_Stop_32_x_32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Stop_48_x_48 { - get { - object obj = ResourceManager.GetObject("Input_Box_Stop_48_x_48", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Stop_64_x_64 { - get { - object obj = ResourceManager.GetObject("Input_Box_Stop_64_x_64", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_UAC_Shield_Windows_10_128_x_128 { - get { - object obj = ResourceManager.GetObject("Input_Box_UAC_Shield_Windows_10_128_x_128", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_UAC_Shield_Windows_11_128_x_128 { - get { - object obj = ResourceManager.GetObject("Input_Box_UAC_Shield_Windows_11_128_x_128", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_UAC_Shield_Windows_7_and_8_128_x_128 { - get { - object obj = ResourceManager.GetObject("Input_Box_UAC_Shield_Windows_7_and_8_128_x_128", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Warning_128_x_115 { - get { - object obj = ResourceManager.GetObject("Input_Box_Warning_128_x_115", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Warning_32_x_29 { - get { - object obj = ResourceManager.GetObject("Input_Box_Warning_32_x_29", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Warning_48_x_43 { - get { - object obj = ResourceManager.GetObject("Input_Box_Warning_48_x_43", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Warning_64_x_58 { - get { - object obj = ResourceManager.GetObject("Input_Box_Warning_64_x_58", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Windows_10_128_x_121 { - get { - object obj = ResourceManager.GetObject("Input_Box_Windows_10_128_x_121", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Input_Box_Windows_11_128_x_128 { - get { - object obj = ResourceManager.GetObject("Input_Box_Windows_11_128_x_128", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Properties/Resources.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Properties/Resources.resx deleted file mode 100644 index 49f6f5538..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Properties/Resources.resx +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - ..\Resources\Input_Box_Asterisk_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Critical_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Critical_32_x_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Critical_48_x_48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Critical_64_x_64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Hand_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Hand_32_x_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Hand_48_x_48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Hand_64_x_64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Information_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Information_32_x_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Information_48_x_48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Information_64_x_64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Ok_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Ok_32_x_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Ok_48_x_48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Ok_64_x_64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Question_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Question_32_x_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Question_48_x_48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Question_64_x_64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Stop_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Stop_32_x_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Stop_48_x_48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Stop_64_x_64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_UAC_Shield_Windows_10_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_UAC_Shield_Windows_11_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_UAC_Shield_Windows_7_and_8_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Warning_128_x_115.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Warning_32_x_29.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Warning_48_x_43.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Warning_64_x_58.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Windows_10_128_x_121.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Input_Box_Windows_11_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Readme.md b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Readme.md deleted file mode 100644 index 5f282702b..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Readme.md +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Critical_32_x_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Critical_32_x_32.png deleted file mode 100644 index fbe1d2c30..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Critical_32_x_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Critical_48_x_48.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Critical_48_x_48.png deleted file mode 100644 index afbf66ebd..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Critical_48_x_48.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Critical_64_x_64.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Critical_64_x_64.png deleted file mode 100644 index 1e8383156..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Critical_64_x_64.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Hand_32_x_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Hand_32_x_32.png deleted file mode 100644 index 51436a788..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Hand_32_x_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Hand_48_x_48.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Hand_48_x_48.png deleted file mode 100644 index 5d68b3d31..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Hand_48_x_48.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Hand_64_x_64.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Hand_64_x_64.png deleted file mode 100644 index 418f9fbaf..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Hand_64_x_64.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Information_32_x_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Information_32_x_32.png deleted file mode 100644 index 2febe1c77..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Information_32_x_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Information_48_x_48.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Information_48_x_48.png deleted file mode 100644 index 8cccbc36e..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Information_48_x_48.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Information_64_x_64.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Information_64_x_64.png deleted file mode 100644 index 896d14baa..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Information_64_x_64.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Ok_32_x_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Ok_32_x_32.png deleted file mode 100644 index 0f4005350..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Ok_32_x_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Ok_48_x_48.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Ok_48_x_48.png deleted file mode 100644 index 859c67ea6..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Ok_48_x_48.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Ok_64_x_64.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Ok_64_x_64.png deleted file mode 100644 index 20abc25b6..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Ok_64_x_64.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Question_32_x_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Question_32_x_32.png deleted file mode 100644 index fc3b590e9..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Question_32_x_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Question_48_x_48.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Question_48_x_48.png deleted file mode 100644 index b7bb9f1ec..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Question_48_x_48.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Question_64_x_64.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Question_64_x_64.png deleted file mode 100644 index 5b0cfd890..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Question_64_x_64.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Stop_32_x_32.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Stop_32_x_32.png deleted file mode 100644 index e8bf3e142..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Stop_32_x_32.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Stop_48_x_48.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Stop_48_x_48.png deleted file mode 100644 index 33ae21712..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Stop_48_x_48.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Stop_64_x_64.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Stop_64_x_64.png deleted file mode 100644 index 50cbcd346..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Stop_64_x_64.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Warning_32_x_29.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Warning_32_x_29.png deleted file mode 100644 index 7f360c0b2..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Warning_32_x_29.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Warning_48_x_43.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Warning_48_x_43.png deleted file mode 100644 index 29df2d19f..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Warning_48_x_43.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Warning_64_x_58.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Warning_64_x_58.png deleted file mode 100644 index e2c050f49..000000000 Binary files a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Warning_64_x_58.png and /dev/null differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/RichTextBox/BasicNotification.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/RichTextBox/BasicNotification.Designer.cs deleted file mode 100644 index 9864f4978..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/RichTextBox/BasicNotification.Designer.cs +++ /dev/null @@ -1,382 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - partial class BasicNotification - { - /// - /// 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(BasicNotification)); - this.kpnlContent = new Krypton.Toolkit.KryptonPanel(); - this.krtbContent = new Krypton.Toolkit.KryptonRichTextBox(); - this.kwlTitle = new Krypton.Toolkit.KryptonWrapLabel(); - this.pbxToastImage = new System.Windows.Forms.PictureBox(); - this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.tlpButtons = new Krypton.Toolkit.KryptonTableLayoutPanel(); - this.kbtnToastButtonPanel3 = new Krypton.Toolkit.KryptonPanel(); - this.kbtnToastButton3 = new Krypton.Toolkit.KryptonButton(); - this.kbtnToastButtonPanel2 = new Krypton.Toolkit.KryptonPanel(); - this.kbtnToastButton2 = new Krypton.Toolkit.KryptonButton(); - this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); - this.kbtnToastButtonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton1 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton1 = new Krypton.Toolkit.KryptonButton(); - this.ktbActionButton3 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.ktbActionButton2 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).BeginInit(); - this.kpnlContent.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbxToastImage)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); - this.kryptonPanel1.SuspendLayout(); - this.tlpButtons.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel3)).BeginInit(); - this.kbtnToastButtonPanel3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel2)).BeginInit(); - this.kbtnToastButtonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); - this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel1)).BeginInit(); - this.kbtnToastButtonPanel1.SuspendLayout(); - this.SuspendLayout(); - // - // kpnlContent - // - this.kpnlContent.Controls.Add(this.krtbContent); - this.kpnlContent.Controls.Add(this.kwlTitle); - this.kpnlContent.Controls.Add(this.pbxToastImage); - this.kpnlContent.Dock = System.Windows.Forms.DockStyle.Fill; - this.kpnlContent.Location = new System.Drawing.Point(0, 0); - this.kpnlContent.Name = "kpnlContent"; - this.kpnlContent.Size = new System.Drawing.Size(609, 243); - this.kpnlContent.TabIndex = 4; - // - // krtbContent - // - this.krtbContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.krtbContent.Location = new System.Drawing.Point(146, 89); - this.krtbContent.Name = "krtbContent"; - this.krtbContent.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedVertical; - this.krtbContent.Size = new System.Drawing.Size(451, 148); - this.krtbContent.TabIndex = 4; - this.krtbContent.Text = ""; - // - // kwlTitle - // - this.kwlTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.kwlTitle.AutoSize = false; - this.kwlTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); - this.kwlTitle.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl; - this.kwlTitle.Location = new System.Drawing.Point(146, 12); - this.kwlTitle.Name = "kwlTitle"; - this.kwlTitle.Size = new System.Drawing.Size(451, 74); - this.kwlTitle.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlTitle.Text = "{0}"; - this.kwlTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // pbxToastImage - // - this.pbxToastImage.BackColor = System.Drawing.Color.Transparent; - this.pbxToastImage.Location = new System.Drawing.Point(12, 12); - this.pbxToastImage.Name = "pbxToastImage"; - this.pbxToastImage.Size = new System.Drawing.Size(128, 128); - this.pbxToastImage.TabIndex = 1; - this.pbxToastImage.TabStop = false; - // - // kryptonPanel1 - // - this.kryptonPanel1.Controls.Add(this.tlpButtons); - this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.kryptonPanel1.Location = new System.Drawing.Point(0, 243); - this.kryptonPanel1.Name = "kryptonPanel1"; - this.kryptonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel1.Size = new System.Drawing.Size(609, 50); - this.kryptonPanel1.TabIndex = 3; - // - // tlpButtons - // - this.tlpButtons.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tlpButtons.BackgroundImage"))); - this.tlpButtons.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.tlpButtons.ColumnCount = 3; - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel3, 2, 1); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel2, 1, 1); - this.tlpButtons.Controls.Add(this.kryptonPanel2, 0, 0); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel1, 0, 1); - this.tlpButtons.Dock = System.Windows.Forms.DockStyle.Fill; - this.tlpButtons.Location = new System.Drawing.Point(0, 0); - this.tlpButtons.Name = "tlpButtons"; - this.tlpButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.tlpButtons.RowCount = 2; - this.tlpButtons.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tlpButtons.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpButtons.Size = new System.Drawing.Size(609, 50); - this.tlpButtons.TabIndex = 0; - // - // kbtnToastButtonPanel3 - // - this.kbtnToastButtonPanel3.Controls.Add(this.ktbActionButton3); - this.kbtnToastButtonPanel3.Controls.Add(this.kbtnToastButton3); - this.kbtnToastButtonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel3.Location = new System.Drawing.Point(79, 10); - this.kbtnToastButtonPanel3.Name = "kbtnToastButtonPanel3"; - this.kbtnToastButtonPanel3.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel3.Size = new System.Drawing.Size(527, 37); - this.kbtnToastButtonPanel3.TabIndex = 3; - // - // kbtnToastButton3 - // - this.kbtnToastButton3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnToastButton3.AutoSize = true; - this.kbtnToastButton3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton3.CornerRoundingRadius = -1F; - this.kbtnToastButton3.Location = new System.Drawing.Point(496, 6); - this.kbtnToastButton3.Name = "kbtnToastButton3"; - this.kbtnToastButton3.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton3.TabIndex = 0; - this.kbtnToastButton3.Values.Text = "B3"; - // - // kbtnToastButtonPanel2 - // - this.kbtnToastButtonPanel2.Controls.Add(this.ktbActionButton2); - this.kbtnToastButtonPanel2.Controls.Add(this.kbtnToastButton2); - this.kbtnToastButtonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel2.Location = new System.Drawing.Point(59, 10); - this.kbtnToastButtonPanel2.Name = "kbtnToastButtonPanel2"; - this.kbtnToastButtonPanel2.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel2.Size = new System.Drawing.Size(14, 37); - this.kbtnToastButtonPanel2.TabIndex = 2; - // - // kbtnToastButton2 - // - this.kbtnToastButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnToastButton2.AutoSize = true; - this.kbtnToastButton2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton2.CornerRoundingRadius = -1F; - this.kbtnToastButton2.Location = new System.Drawing.Point(-11, 6); - this.kbtnToastButton2.Name = "kbtnToastButton2"; - this.kbtnToastButton2.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton2.TabIndex = 0; - this.kbtnToastButton2.Values.Text = "B2"; - // - // kryptonPanel2 - // - this.tlpButtons.SetColumnSpan(this.kryptonPanel2, 3); - this.kryptonPanel2.Controls.Add(this.kryptonBorderEdge1); - this.kryptonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonPanel2.Location = new System.Drawing.Point(3, 3); - this.kryptonPanel2.Name = "kryptonPanel2"; - this.kryptonPanel2.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel2.Size = new System.Drawing.Size(603, 1); - this.kryptonPanel2.TabIndex = 0; - // - // 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(603, 1); - this.kryptonBorderEdge1.Text = "kryptonBorderEdge1"; - // - // kbtnToastButtonPanel1 - // - this.kbtnToastButtonPanel1.Controls.Add(this.ktbActionButton1); - this.kbtnToastButtonPanel1.Controls.Add(this.kbtnToastButton1); - this.kbtnToastButtonPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel1.Location = new System.Drawing.Point(3, 10); - this.kbtnToastButtonPanel1.Name = "kbtnToastButtonPanel1"; - this.kbtnToastButtonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel1.Size = new System.Drawing.Size(50, 37); - this.kbtnToastButtonPanel1.TabIndex = 1; - this.kbtnToastButtonPanel1.Visible = false; - // - // ktbActionButton1 - // - this.ktbActionButton1.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton1.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton1.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton1.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton1.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.ktbActionButton1.AutoSize = true; - this.ktbActionButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton1.CornerRoundingRadius = -1F; - this.ktbActionButton1.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton1.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton1.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton1.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton1.Location = new System.Drawing.Point(9, 6); - this.ktbActionButton1.Name = "ktbActionButton1"; - this.ktbActionButton1.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton1.TabIndex = 1; - this.ktbActionButton1.Values.Text = "AB1"; - // - // kbtnToastButton1 - // - this.kbtnToastButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.kbtnToastButton1.AutoSize = true; - this.kbtnToastButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton1.CornerRoundingRadius = -1F; - this.kbtnToastButton1.Location = new System.Drawing.Point(9, 6); - this.kbtnToastButton1.Name = "kbtnToastButton1"; - this.kbtnToastButton1.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton1.TabIndex = 0; - this.kbtnToastButton1.Values.Text = "B1"; - // - // ktbActionButton3 - // - this.ktbActionButton3.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton3.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton3.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton3.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton3.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ktbActionButton3.AutoSize = true; - this.ktbActionButton3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton3.CornerRoundingRadius = -1F; - this.ktbActionButton3.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton3.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton3.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton3.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton3.Location = new System.Drawing.Point(488, 6); - this.ktbActionButton3.Name = "ktbActionButton3"; - this.ktbActionButton3.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton3.TabIndex = 2; - this.ktbActionButton3.Values.Text = "AB3"; - // - // ktbActionButton2 - // - this.ktbActionButton2.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton2.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton2.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton2.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton2.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ktbActionButton2.AutoSize = true; - this.ktbActionButton2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton2.CornerRoundingRadius = -1F; - this.ktbActionButton2.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton2.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton2.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton2.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton2.Location = new System.Drawing.Point(-20, 6); - this.ktbActionButton2.Name = "ktbActionButton2"; - this.ktbActionButton2.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton2.TabIndex = 2; - this.ktbActionButton2.Values.Text = "AB2"; - // - // BasicNotification - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(609, 293); - this.Controls.Add(this.kpnlContent); - this.Controls.Add(this.kryptonPanel1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "BasicNotification"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; - this.Load += new System.EventHandler(this.BasicNotification_Load); - ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).EndInit(); - this.kpnlContent.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pbxToastImage)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); - this.kryptonPanel1.ResumeLayout(false); - this.tlpButtons.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel3)).EndInit(); - this.kbtnToastButtonPanel3.ResumeLayout(false); - this.kbtnToastButtonPanel3.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel2)).EndInit(); - this.kbtnToastButtonPanel2.ResumeLayout(false); - this.kbtnToastButtonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); - this.kryptonPanel2.ResumeLayout(false); - this.kryptonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel1)).EndInit(); - this.kbtnToastButtonPanel1.ResumeLayout(false); - this.kbtnToastButtonPanel1.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private KryptonPanel kpnlContent; - private KryptonRichTextBox krtbContent; - private KryptonWrapLabel kwlTitle; - private PictureBox pbxToastImage; - private KryptonPanel kryptonPanel1; - private KryptonTableLayoutPanel tlpButtons; - private KryptonPanel kbtnToastButtonPanel3; - private KryptonPanel kbtnToastButtonPanel2; - private KryptonPanel kryptonPanel2; - private KryptonBorderEdge kryptonBorderEdge1; - private KryptonPanel kbtnToastButtonPanel1; - private KryptonButton kbtnToastButton3; - private KryptonButton kbtnToastButton2; - private KryptonButton kbtnToastButton1; - private KryptonToastButton ktbActionButton1; - private KryptonToastButton ktbActionButton3; - private KryptonToastButton ktbActionButton2; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/RichTextBox/BasicNotification.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/RichTextBox/BasicNotification.cs deleted file mode 100644 index e26f62f21..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/RichTextBox/BasicNotification.cs +++ /dev/null @@ -1,628 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - public partial class BasicNotification : KryptonForm - { - #region Variables - - private ActionButtonLocation _actionButtonLocation; - - private ActionType _actionType; - - private bool _showActionButton, _usePanelColourInTextArea, _showCloseButton, _openProcessInExplorer; - - private Font _contentTypeface, _headerTypeface; - - private IconType _iconType; - - private int _time, _seconds; - - private Timer _timer; - - private SoundPlayer _soundPlayer; - - private string _actionButtonText, _title, _contentText, _soundPath, _dismissText, _processPath; - - private object _optionalParameters; - - private Stream _soundStream; - - private Image _customImage; - - private RightToLeftSupport _rightToLeft; - - private KryptonCommand _actionButtonCommand; - - #endregion - - #region Properties - - public ActionButtonLocation ActionButtonLocation { get => _actionButtonLocation; set => _actionButtonLocation = value; } - - public ActionType ActionType { get => _actionType; set => _actionType = value; } - - public bool ShowActionButton { get => _showActionButton; set => _showActionButton = value; } - - public bool UsePanelColourInTextArea { get => _usePanelColourInTextArea; set => _usePanelColourInTextArea = value; } - - public bool ShowCloseButton { get => _showCloseButton; set => _showCloseButton = value; } - - public bool OpenProcessInExplorer { get => _openProcessInExplorer; set => _openProcessInExplorer = value; } - - public IconType IconType { get => _iconType; set => _iconType = value; } - - public int Time { get => _time; set => _time = value; } - - public int Seconds { get => _seconds; set => _seconds = value; } - - public string ActionButtonText { get => _actionButtonText; set => _actionButtonText = value; } - - public string Title { get => _title; set => _title = value; } - - public string ContentText { get => _contentText; set => _contentText = value; } - - public string SoundPath { get => _soundPath; set => _soundPath = value; } - - public string DismissText { get => _dismissText; set => _dismissText = value; } - - public string ProcessPath { get => _processPath; set => _processPath = value; } - - public object OptionalParameters { get => _optionalParameters; set => _optionalParameters = value; } - - public Stream SoundStream { get => _soundStream; set => _soundStream = value; } - - public Image CustomImage { get => _customImage; set => _customImage = value; } - - public RightToLeftSupport RightToLeftSupport { get => _rightToLeft; set { _rightToLeft = value; Invalidate(); } } - - public KryptonCommand ActionButtonCommand { get => _actionButtonCommand; set => _actionButtonCommand = value; } - - #endregion - - #region Constructor - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The show close button. - /// The show action button. - /// The custom image. - /// The dismiss text. - /// The action button text. - /// The right to left. - /// The action button command. - /// The open process in explorer. - /// The process path. - /// The optional parameters. - public BasicNotification(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, bool? showCloseButton, bool? showActionButton, - Image customImage = null, - string dismissText = "&Dismiss", - string actionButtonText = @"L&aunch Process", - RightToLeftSupport? rightToLeft = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null, - bool? openProcessInExplorer = null, - string processPath = null, - object optionalParameters = null) - { - InitializeComponent(); - - SetupBaseUI(actionButtonLocation, actionType, iconType, title, contentText, usePanelColourInTextArea, showCloseButton, showActionButton, customImage, dismissText, actionButtonText, rightToLeft, actionButtonCommand, openProcessInExplorer, processPath, optionalParameters); - } - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The show close button. - /// The show action button. - /// The seconds. - /// The custom image. - /// The dismiss text. - /// The action button text. - /// The right to left. - /// The action button command. - public BasicNotification(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, bool? showCloseButton, bool? showActionButton, - int seconds, Image customImage = null, - string dismissText = "&Dismiss", - string actionButtonText = @"L&aunch Process", - RightToLeftSupport? rightToLeft = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - usePanelColourInTextArea, showCloseButton, showActionButton, customImage, - dismissText, actionButtonText, - rightToLeft, actionButtonCommand) => Seconds = seconds; - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The show close button. - /// The show action button. - /// The seconds. - /// The sound path. - /// The custom image. - /// The dismiss text. - /// The action button text. - /// The right to left. - /// The action button command. - public BasicNotification(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, - bool? showCloseButton, bool? showActionButton, int seconds, - string soundPath, Image customImage = null, - string dismissText = "&Dismiss", - string actionButtonText = @"L&aunch Process", - RightToLeftSupport? rightToLeft = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - usePanelColourInTextArea, showCloseButton, - showActionButton, - seconds, customImage, - dismissText, actionButtonText, - rightToLeft, actionButtonCommand) => SoundPath = soundPath; - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The show close button. - /// The show action button. - /// The sound stream. - /// The custom image. - /// The dismiss text. - /// The action button text. - /// The right to left. - /// The action button command. - public BasicNotification(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, - bool? showCloseButton, bool? showActionButton, - Stream soundStream, - Image customImage = null, - string dismissText = "&Dismiss", - string actionButtonText = @"L&aunch Process", - RightToLeftSupport? rightToLeft = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - usePanelColourInTextArea, showCloseButton, showActionButton, - customImage, - dismissText, actionButtonText, - rightToLeft, actionButtonCommand) => SoundStream = soundStream; - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The show close button. - /// The show action button. - /// The seconds. - /// The sound stream. - /// The custom image. - /// The dismiss text. - /// The action button text. - /// The right to left. - /// The action button command. - public BasicNotification(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, - bool? showCloseButton, bool? showActionButton, - int seconds, - Stream soundStream, Image customImage = null, - string dismissText = "&Dismiss", - string actionButtonText = @"L&aunch Process", - RightToLeftSupport? rightToLeft = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - usePanelColourInTextArea, showCloseButton, showActionButton, - seconds, customImage, - dismissText, actionButtonText, - rightToLeft, actionButtonCommand) => SoundStream = soundStream; - #endregion - - #region Event Handlers - private void BasicNotification_Load(object sender, EventArgs e) => SetupUI(RightToLeftSupport); - - private void BasicNotification_GotFocus(object sender, EventArgs e) - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Focus(); - } - else - { - kbtnToastButton1.Focus(); - } - } - - private void BasicNotification_Resize(object sender, EventArgs e) - { - if (WindowState == FormWindowState.Maximized) - { - WindowState = FormWindowState.Normal; - } - } - - private void kbtnDismiss_Click(object sender, EventArgs e) => UtilityMethods.FadeOutAndClose(this); - #endregion - - #region Methods - - private void SetupTextArea() - { - if (!_usePanelColourInTextArea) - { - krtbContent.InputControlStyle = InputControlStyle.Standalone; - } - else - { - if (kpnlContent.PanelBackStyle == PaletteBackStyle.PanelClient) - { - krtbContent.InputControlStyle = InputControlStyle.PanelClient; - } - else if (kpnlContent.PanelBackStyle == PaletteBackStyle.PanelAlternate) - { - krtbContent.InputControlStyle = InputControlStyle.PanelAlternate; - } - else - { - krtbContent.InputControlStyle = InputControlStyle.Standalone; - } - } - } - - public new void Show() - { - Opacity = 0; - - UtilityMethods.SetIconType(IconType, CustomImage, pbxToastImage); - - kwlTitle.Text = Title; - - krtbContent.Text = ContentText; - - if (Seconds != 0) - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time})"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time})"; - } - - _timer = new Timer(); - - _timer.Interval = 1000; - - _timer.Tick += (sender, e) => - { - _time++; - - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time}s)"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time}s)"; - } - - if (_time == Seconds) - { - _timer.Stop(); - - UtilityMethods.FadeOutAndClose(this); - } - }; - } - else - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = DismissText; - } - else - { - kbtnToastButton1.Text = DismissText; - } - } - - if (SoundPath != null) - { - _soundPlayer = new SoundPlayer(SoundPath); - } - else - { - _soundPlayer = null; - } - - if (SoundStream != null) - { - _soundPlayer = new SoundPlayer(SoundStream); - } - else - { - _soundPlayer = null; - } - - base.Show(); - } - - /// Setups the action button. - /// if set to true [show action button]. - /// The action button location. - private void SetupActionButton(bool? showActionButton, ActionButtonLocation? actionButtonLocation) - { - if (showActionButton != null) - { - if (_rightToLeft == RightToLeftSupport.LeftToRight) - { - if (actionButtonLocation == ActionButtonLocation.Left) - { - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - else - { - kbtnToastButtonPanel2.Visible = true; - - ktbActionButton2.Visible = true; - } - } - else if (_rightToLeft == RightToLeftSupport.RightToLeft) - { - if (actionButtonLocation == ActionButtonLocation.Right) - { - tlpButtons.ColumnStyles[0].SizeType = SizeType.Percent; - - tlpButtons.ColumnStyles[0].Width = 100F; - - tlpButtons.ColumnStyles[2].SizeType = SizeType.AutoSize; - - kbtnToastButtonPanel3.Visible = true; - - ktbActionButton3.Visible = true; - } - else - { - tlpButtons.ColumnStyles[0].SizeType = SizeType.Percent; - - tlpButtons.ColumnStyles[0].Width = 100F; - - tlpButtons.ColumnStyles[2].SizeType = SizeType.AutoSize; - - kbtnToastButtonPanel3.Visible = false; - - ktbActionButton3.Visible = false; - - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - } - } - else - { - if (_rightToLeft == RightToLeftSupport.LeftToRight) - { - kbtnToastButtonPanel1.Visible = false; - - kbtnToastButtonPanel2.Visible = false; - } - else if (_rightToLeft == RightToLeftSupport.RightToLeft) - { - kbtnToastButtonPanel2.Visible = false; - - kbtnToastButtonPanel3.Visible = false; - - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - } - } - - private void SetControlBoxVisibility(bool visibilityToggle) => ControlBox = visibilityToggle; - - private void SetWindowBorderStyle(FormBorderStyle borderStyle) => FormBorderStyle = borderStyle; - - private void SetupBaseUI(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, bool? showCloseButton, bool? showActionButton, - Image customImage = null, - string dismissText = "&Dismiss", - string actionButtonText = @"L&aunch Process", - RightToLeftSupport? rightToLeft = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null, - bool? openProcessInExplorer = null, - string processPath = null, - object optionalParameters = null) - { - ActionButtonLocation = actionButtonLocation ?? ActionButtonLocation.Left; - - ActionType = actionType ?? ActionType.Default; - - IconType = iconType; - - ActionButtonText = actionButtonText; - - Title = title; - - ContentText = contentText; - - ShowActionButton = showActionButton ?? false; - - UsePanelColourInTextArea = usePanelColourInTextArea ?? false; - - ShowCloseButton = showCloseButton ?? false; - - OpenProcessInExplorer = openProcessInExplorer ?? false; - - CustomImage = customImage; - - DismissText = dismissText; - - ProcessPath = processPath ?? string.Empty; - - OptionalParameters = optionalParameters ?? null; - - RightToLeftSupport = rightToLeft ?? RightToLeftSupport.RightToLeft; - - TopMost = true; - - ActionButtonCommand = actionButtonCommand; - - SetControlBoxVisibility(ShowCloseButton); - - Resize += BasicNotification_Resize; - - GotFocus += BasicNotification_GotFocus; - - DoubleBuffered = true; - - SetupTextArea(); - - RearrangeUI(rightToLeft); - - ConfigureRightToLeftActions(rightToLeft); - - SetupActionButton(showActionButton, actionButtonLocation); - } - - private void SetupUI(RightToLeftSupport rightToLeft = RightToLeftSupport.LeftToRight) - { - //Once loaded, position the form to the bottom left of the screen with added padding - Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - Width - 5, - Screen.PrimaryScreen.WorkingArea.Height - Height - 5); - - UtilityMethods.FadeIn(this); - - if (_timer != null) - { - _timer.Start(); - } - - if (_soundPlayer != null) - { - _soundPlayer.Play(); - } - - RearrangeUI(rightToLeft); - - if (rightToLeft == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = _dismissText; - } - else - { - kbtnToastButton1.Text = _dismissText; - } - } - - private void RearrangeUI(RightToLeftSupport? rightToLeft) - { - switch (rightToLeft) - { - case RightToLeftSupport.Inherit: - break; - case RightToLeftSupport.LeftToRight: - UtilityMethods.CalibrateUILayout(this, new Control[]{ktbActionButton1, ktbActionButton2, ktbActionButton3, kwlTitle, krtbContent}, RightToLeft.No); - - RightToLeftLayout = false; - - UtilityMethods.ChangeControlLocation(pbxToastImage, new Point(12, 12)); - - UtilityMethods.ChangeControlLocation(kwlTitle, new Point(146, 12)); - - UtilityMethods.ChangeControlLocation(krtbContent, new Point(146, 89)); - break; - case RightToLeftSupport.RightToLeft: - UtilityMethods.CalibrateUILayout(this, new Control[] { ktbActionButton1, ktbActionButton2, ktbActionButton3, kwlTitle, krtbContent }, RightToLeft.Yes); - - RightToLeftLayout = true; - - UtilityMethods.ChangeControlLocation(pbxToastImage, new Point(469, 12)); - - UtilityMethods.ChangeControlLocation(kwlTitle, new Point(12, 12)); - - UtilityMethods.ChangeControlLocation(krtbContent, new Point(12, 89)); - break; - } - } - - /// Configures the right to left action buttons. - /// The layout of the toast window. - private void ConfigureRightToLeftActions(RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight) - { - switch (rightToLeftSupport) - { - case RightToLeftSupport.Inherit: - break; - case RightToLeftSupport.LeftToRight: - UtilityMethods.ConfigureToastNotificationButton(ktbActionButton1, _actionType, false, false, _openProcessInExplorer, _optionalParameters, _processPath, _actionButtonText); - - UtilityMethods.ConfigureToastNotificationButton(ktbActionButton3, ActionType.Default, false, false, false, null, null, _dismissText); - break; - case RightToLeftSupport.RightToLeft: - UtilityMethods.ConfigureToastNotificationButton(ktbActionButton1, ActionType.Default, false, false, false, null, null, _dismissText); - - UtilityMethods.ConfigureToastNotificationButton(ktbActionButton3, _actionType, false, false, _openProcessInExplorer, _optionalParameters, _processPath, _actionButtonText); - break; - } - } - - #endregion - - #region Overrides - protected override bool ShowWithoutActivation => true; - #endregion - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/RichTextBox/BasicNotification.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/RichTextBox/BasicNotification.resx deleted file mode 100644 index d96a483c7..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/RichTextBox/BasicNotification.resx +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - - iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAD0SURBVHhe7dExAQAgDMAw/ItBBDYmZtjI0SMKcu6bjaMQ - TCGYQjCFYArBFIIpBFMIphBMIZhCMIVgCsEUgikEUwimEEwhmEIwhWAKwRSCKQRTCKYQTCGYQjCFYArB - FIIpBFMIphBMIZhCMIVgCsEUgikEUwimEEwhmEIwhWAKwRSCKQRTCKYQTCGYQjCFYArBFIIpBFMIphBM - IZhCMIVgCsEUgikEUwimEEwhmEIwhWAKwRSCKQRTCKYQTCGYQjCFYArBFIIpBFMIphBMIZhCMIVgCsEU - gikEUwimEEwhmEIwhWAKwRSCKQRTCKYQTCGYQiizH+yXgiFwEL30AAAAAElFTkSuQmCC - - - \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/RichTextBox/BasicNotificationWithProgressBar.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/RichTextBox/BasicNotificationWithProgressBar.Designer.cs deleted file mode 100644 index 70d5c992e..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/RichTextBox/BasicNotificationWithProgressBar.Designer.cs +++ /dev/null @@ -1,389 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - partial class BasicNotificationWithProgressBar - { - /// - /// 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(BasicNotificationWithProgressBar)); - this.kpnlContent = new Krypton.Toolkit.KryptonPanel(); - this.pbCountdown = new Krypton.Toolkit.KryptonProgressBar(); - this.krtbContent = new Krypton.Toolkit.KryptonRichTextBox(); - this.kwlTitle = new Krypton.Toolkit.KryptonWrapLabel(); - this.pbxToastImage = new System.Windows.Forms.PictureBox(); - this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.tlpButtons = new Krypton.Toolkit.KryptonTableLayoutPanel(); - this.kbtnToastButtonPanel3 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton3 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton3 = new Krypton.Toolkit.KryptonButton(); - this.kbtnToastButtonPanel2 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton2 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton2 = new Krypton.Toolkit.KryptonButton(); - this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); - this.kbtnToastButtonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton1 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton1 = new Krypton.Toolkit.KryptonButton(); - ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).BeginInit(); - this.kpnlContent.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbxToastImage)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); - this.kryptonPanel1.SuspendLayout(); - this.tlpButtons.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel3)).BeginInit(); - this.kbtnToastButtonPanel3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel2)).BeginInit(); - this.kbtnToastButtonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); - this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel1)).BeginInit(); - this.kbtnToastButtonPanel1.SuspendLayout(); - this.SuspendLayout(); - // - // kpnlContent - // - this.kpnlContent.Controls.Add(this.pbCountdown); - this.kpnlContent.Controls.Add(this.krtbContent); - this.kpnlContent.Controls.Add(this.kwlTitle); - this.kpnlContent.Controls.Add(this.pbxToastImage); - this.kpnlContent.Dock = System.Windows.Forms.DockStyle.Fill; - this.kpnlContent.Location = new System.Drawing.Point(0, 0); - this.kpnlContent.Name = "kpnlContent"; - this.kpnlContent.Size = new System.Drawing.Size(609, 243); - this.kpnlContent.TabIndex = 5; - // - // pbCountdown - // - this.pbCountdown.Dock = System.Windows.Forms.DockStyle.Bottom; - this.pbCountdown.Location = new System.Drawing.Point(0, 238); - this.pbCountdown.Name = "pbCountdown"; - this.pbCountdown.Size = new System.Drawing.Size(609, 5); - this.pbCountdown.TabIndex = 4; - this.pbCountdown.Values.Text = ""; - // - // krtbContent - // - this.krtbContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.krtbContent.Location = new System.Drawing.Point(146, 89); - this.krtbContent.Name = "krtbContent"; - this.krtbContent.ReadOnly = true; - this.krtbContent.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedVertical; - this.krtbContent.Size = new System.Drawing.Size(451, 143); - this.krtbContent.TabIndex = 4; - this.krtbContent.Text = ""; - // - // kwlTitle - // - this.kwlTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.kwlTitle.AutoSize = false; - this.kwlTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); - this.kwlTitle.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl; - this.kwlTitle.Location = new System.Drawing.Point(146, 12); - this.kwlTitle.Name = "kwlTitle"; - this.kwlTitle.Size = new System.Drawing.Size(451, 74); - this.kwlTitle.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlTitle.Text = "{0}"; - this.kwlTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // pbxToastImage - // - this.pbxToastImage.BackColor = System.Drawing.Color.Transparent; - this.pbxToastImage.Location = new System.Drawing.Point(12, 12); - this.pbxToastImage.Name = "pbxToastImage"; - this.pbxToastImage.Size = new System.Drawing.Size(128, 128); - this.pbxToastImage.TabIndex = 1; - this.pbxToastImage.TabStop = false; - // - // kryptonPanel1 - // - this.kryptonPanel1.Controls.Add(this.tlpButtons); - this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.kryptonPanel1.Location = new System.Drawing.Point(0, 243); - this.kryptonPanel1.Name = "kryptonPanel1"; - this.kryptonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel1.Size = new System.Drawing.Size(609, 50); - this.kryptonPanel1.TabIndex = 4; - // - // tlpButtons - // - this.tlpButtons.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tlpButtons.BackgroundImage"))); - this.tlpButtons.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.tlpButtons.ColumnCount = 3; - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel3, 2, 1); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel2, 1, 1); - this.tlpButtons.Controls.Add(this.kryptonPanel2, 0, 0); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel1, 0, 1); - this.tlpButtons.Dock = System.Windows.Forms.DockStyle.Fill; - this.tlpButtons.Location = new System.Drawing.Point(0, 0); - this.tlpButtons.Name = "tlpButtons"; - this.tlpButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.tlpButtons.RowCount = 2; - this.tlpButtons.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tlpButtons.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpButtons.Size = new System.Drawing.Size(609, 50); - this.tlpButtons.TabIndex = 2; - // - // kbtnToastButtonPanel3 - // - this.kbtnToastButtonPanel3.Controls.Add(this.ktbActionButton3); - this.kbtnToastButtonPanel3.Controls.Add(this.kbtnToastButton3); - this.kbtnToastButtonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel3.Location = new System.Drawing.Point(79, 10); - this.kbtnToastButtonPanel3.Name = "kbtnToastButtonPanel3"; - this.kbtnToastButtonPanel3.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel3.Size = new System.Drawing.Size(527, 37); - this.kbtnToastButtonPanel3.TabIndex = 3; - // - // ktbActionButton3 - // - this.ktbActionButton3.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton3.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton3.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton3.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton3.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ktbActionButton3.AutoSize = true; - this.ktbActionButton3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton3.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton3.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton3.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton3.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton3.Location = new System.Drawing.Point(488, 6); - this.ktbActionButton3.Name = "ktbActionButton3"; - this.ktbActionButton3.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton3.TabIndex = 2; - this.ktbActionButton3.Values.Text = "AB3"; - // - // kbtnToastButton3 - // - this.kbtnToastButton3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnToastButton3.AutoSize = true; - this.kbtnToastButton3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton3.Location = new System.Drawing.Point(496, 6); - this.kbtnToastButton3.Name = "kbtnToastButton3"; - this.kbtnToastButton3.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton3.TabIndex = 0; - this.kbtnToastButton3.Values.Text = "B3"; - // - // kbtnToastButtonPanel2 - // - this.kbtnToastButtonPanel2.Controls.Add(this.ktbActionButton2); - this.kbtnToastButtonPanel2.Controls.Add(this.kbtnToastButton2); - this.kbtnToastButtonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel2.Location = new System.Drawing.Point(59, 10); - this.kbtnToastButtonPanel2.Name = "kbtnToastButtonPanel2"; - this.kbtnToastButtonPanel2.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel2.Size = new System.Drawing.Size(14, 37); - this.kbtnToastButtonPanel2.TabIndex = 2; - // - // ktbActionButton2 - // - this.ktbActionButton2.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton2.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton2.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton2.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton2.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ktbActionButton2.AutoSize = true; - this.ktbActionButton2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton2.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton2.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton2.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton2.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton2.Location = new System.Drawing.Point(-20, 6); - this.ktbActionButton2.Name = "ktbActionButton2"; - this.ktbActionButton2.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton2.TabIndex = 2; - this.ktbActionButton2.Values.Text = "AB2"; - // - // kbtnToastButton2 - // - this.kbtnToastButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnToastButton2.AutoSize = true; - this.kbtnToastButton2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton2.Location = new System.Drawing.Point(-11, 6); - this.kbtnToastButton2.Name = "kbtnToastButton2"; - this.kbtnToastButton2.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton2.TabIndex = 0; - this.kbtnToastButton2.Values.Text = "B2"; - // - // kryptonPanel2 - // - this.tlpButtons.SetColumnSpan(this.kryptonPanel2, 3); - this.kryptonPanel2.Controls.Add(this.kryptonBorderEdge1); - this.kryptonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonPanel2.Location = new System.Drawing.Point(3, 3); - this.kryptonPanel2.Name = "kryptonPanel2"; - this.kryptonPanel2.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel2.Size = new System.Drawing.Size(603, 1); - this.kryptonPanel2.TabIndex = 0; - // - // 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(603, 1); - this.kryptonBorderEdge1.Text = "kryptonBorderEdge1"; - // - // kbtnToastButtonPanel1 - // - this.kbtnToastButtonPanel1.Controls.Add(this.ktbActionButton1); - this.kbtnToastButtonPanel1.Controls.Add(this.kbtnToastButton1); - this.kbtnToastButtonPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel1.Location = new System.Drawing.Point(3, 10); - this.kbtnToastButtonPanel1.Name = "kbtnToastButtonPanel1"; - this.kbtnToastButtonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel1.Size = new System.Drawing.Size(50, 37); - this.kbtnToastButtonPanel1.TabIndex = 1; - this.kbtnToastButtonPanel1.Visible = false; - // - // ktbActionButton1 - // - this.ktbActionButton1.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton1.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton1.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton1.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton1.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.ktbActionButton1.AutoSize = true; - this.ktbActionButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton1.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton1.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton1.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton1.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton1.Location = new System.Drawing.Point(9, 6); - this.ktbActionButton1.Name = "ktbActionButton1"; - this.ktbActionButton1.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton1.TabIndex = 1; - this.ktbActionButton1.Values.Text = "AB1"; - // - // kbtnToastButton1 - // - this.kbtnToastButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.kbtnToastButton1.AutoSize = true; - this.kbtnToastButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton1.Location = new System.Drawing.Point(9, 6); - this.kbtnToastButton1.Name = "kbtnToastButton1"; - this.kbtnToastButton1.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton1.TabIndex = 0; - this.kbtnToastButton1.Values.Text = "B1"; - // - // BasicNotificationWithProgressBar - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(609, 293); - this.Controls.Add(this.kpnlContent); - this.Controls.Add(this.kryptonPanel1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "BasicNotificationWithProgressBar"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; - this.Load += new System.EventHandler(this.BasicNotificationWithProgressBar_Load); - ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).EndInit(); - this.kpnlContent.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pbxToastImage)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); - this.kryptonPanel1.ResumeLayout(false); - this.tlpButtons.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel3)).EndInit(); - this.kbtnToastButtonPanel3.ResumeLayout(false); - this.kbtnToastButtonPanel3.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel2)).EndInit(); - this.kbtnToastButtonPanel2.ResumeLayout(false); - this.kbtnToastButtonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); - this.kryptonPanel2.ResumeLayout(false); - this.kryptonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel1)).EndInit(); - this.kbtnToastButtonPanel1.ResumeLayout(false); - this.kbtnToastButtonPanel1.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private KryptonPanel kpnlContent; - private KryptonProgressBar pbCountdown; - private KryptonRichTextBox krtbContent; - private KryptonWrapLabel kwlTitle; - private PictureBox pbxToastImage; - private KryptonPanel kryptonPanel1; - private KryptonTableLayoutPanel tlpButtons; - private KryptonPanel kbtnToastButtonPanel3; - private KryptonToastButton ktbActionButton3; - private KryptonButton kbtnToastButton3; - private KryptonPanel kbtnToastButtonPanel2; - private KryptonToastButton ktbActionButton2; - private KryptonButton kbtnToastButton2; - private KryptonPanel kryptonPanel2; - private KryptonBorderEdge kryptonBorderEdge1; - private KryptonPanel kbtnToastButtonPanel1; - private KryptonToastButton ktbActionButton1; - private KryptonButton kbtnToastButton1; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/RichTextBox/BasicNotificationWithProgressBar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/RichTextBox/BasicNotificationWithProgressBar.cs deleted file mode 100644 index 3d77de448..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/RichTextBox/BasicNotificationWithProgressBar.cs +++ /dev/null @@ -1,626 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - public partial class BasicNotificationWithProgressBar : KryptonForm - { - #region Variables - - private ActionButtonLocation _actionButtonLocation; - - private ActionType _actionType; - - private bool _showActionButton, _usePanelColourInTextArea, _showCloseButton, _openProcessInExplorer; - - private IconType _iconType; - - private int _time, _seconds; - - private Timer _timer; - - private SoundPlayer _soundPlayer; - - private string _actionButtonText, _title, _contentText, _soundPath, _dismissText, _processPath; - - private object _optionalParameters; - - private Stream _soundStream; - - private Image _customImage; - - private RightToLeftSupport _rightToLeft; - - private KryptonCommand _actionButtonCommand; - - #endregion - - #region Properties - - public ActionButtonLocation ActionButtonLocation { get => _actionButtonLocation; set => _actionButtonLocation = value; } - - public ActionType ActionType { get => _actionType; set => _actionType = value; } - - public bool ShowActionButton { get => _showActionButton; set => _showActionButton = value; } - - public bool UsePanelColourInTextArea { get => _usePanelColourInTextArea; set => _usePanelColourInTextArea = value; } - - public bool ShowCloseButton { get => _showCloseButton; set => _showCloseButton = value; } - - public bool OpenProcessInExplorer { get => _openProcessInExplorer; set => _openProcessInExplorer = value; } - - public IconType IconType { get => _iconType; set => _iconType = value; } - - public int Time { get => _time; set => _time = value; } - - public int Seconds { get => _seconds; set => _seconds = value; } - - public string ActionButtonText { get => _actionButtonText; set => _actionButtonText = value; } - - public string Title { get => _title; set => _title = value; } - - public string ContentText { get => _contentText; set => _contentText = value; } - - public string SoundPath { get => _soundPath; set => _soundPath = value; } - - public string DismissText { get => _dismissText; set => _dismissText = value; } - - public string ProcessPath { get => _processPath; set => _processPath = value; } - - public object OptionalParameters { get => _optionalParameters; set => _optionalParameters = value; } - - public Stream SoundStream { get => _soundStream; set => _soundStream = value; } - - public Image CustomImage { get => _customImage; set => _customImage = value; } - - public RightToLeftSupport RightToLeftSupport { get => _rightToLeft; set { _rightToLeft = value; Invalidate(); } } - - public KryptonCommand ActionButtonCommand { get => _actionButtonCommand; set => _actionButtonCommand = value; } - - #endregion - - #region Constructor - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The show close button. - /// The custom image. - /// The dismiss text. - /// The right to left support. - /// The action button command. - public BasicNotificationWithProgressBar(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, bool? showCloseButton, - bool? showActionButton, - Image customImage = null, - string dismissText = "&Dismiss", - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null, - bool? openProcessInExplorer = null, - string processPath = null, - object optionalParameters = null) - { - InitializeComponent(); - - SetupBaseUI(actionButtonLocation, actionType, iconType, title, contentText, usePanelColourInTextArea, showActionButton, showCloseButton, customImage, dismissText, rightToLeftSupport, actionButtonCommand, openProcessInExplorer, processPath, optionalParameters); - } - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The show close button. - /// The seconds. - /// The custom image. - /// The dismiss text. - /// The right to left support. - /// The action button command. - public BasicNotificationWithProgressBar(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, bool? showCloseButton, - bool? showActionButton, int seconds, - Image customImage = null, string dismissText = "&Dismiss", - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - usePanelColourInTextArea, showCloseButton, showActionButton, customImage, dismissText, - rightToLeftSupport, actionButtonCommand) - { - Seconds = seconds; - - if (seconds > 0) - { - // Setup the timer - _timer = new Timer(); - - _timer.Interval = 1000; - - _timer.Enabled = true; - - _timer.Tick += CountdownTimer_Tick; - } - } - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The show close button. - /// The seconds. - /// The sound path. - /// The custom image. - /// The dismiss text. - /// The right to left support. - /// The action button command. - public BasicNotificationWithProgressBar(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, bool? showCloseButton, - bool? showActionButton, int seconds, - string soundPath, Image customImage = null, - string dismissText = "&Dismiss", - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - usePanelColourInTextArea, showCloseButton, showActionButton, seconds, customImage, - dismissText, rightToLeftSupport, actionButtonCommand) => SoundPath = soundPath; - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The show close button. - /// The sound stream. - /// The custom image. - /// The dismiss text. - /// The right to left support. - /// The action button command. - public BasicNotificationWithProgressBar(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, bool? showCloseButton, - bool? showActionButton, Stream soundStream, - Image customImage = null, string dismissText = "&Dismiss", - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - usePanelColourInTextArea, showCloseButton, showActionButton, - customImage, dismissText, - rightToLeftSupport, actionButtonCommand) => SoundStream = soundStream; - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The show close button. - /// The seconds. - /// The sound stream. - /// The custom image. - /// The dismiss text. - /// The right to left support. - /// The action button command. - public BasicNotificationWithProgressBar(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, bool? showCloseButton, - bool? showActionButton, int seconds, - Stream soundStream, Image customImage = null, - string dismissText = "&Dismiss", - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - usePanelColourInTextArea, showCloseButton, showActionButton, - seconds, customImage, - dismissText, rightToLeftSupport, actionButtonCommand) => SoundStream = soundStream; - #endregion - - #region Event Handlers - - private void BasicNotificationWithProgressBar_GotFocus(object sender, EventArgs e) - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Focus(); - } - else - { - kbtnToastButton1.Focus(); - } - } - - private void BasicNotificationWithProgressBar_Resize(object sender, EventArgs e) - { - if (WindowState == FormWindowState.Maximized) - { - WindowState = FormWindowState.Normal; - } - } - - private void BasicNotificationWithProgressBar_Load(object sender, EventArgs e) => SetupUI(RightToLeftSupport); - - private void kbtnDismiss_Click(object sender, EventArgs e) => UtilityMethods.FadeOutAndClose(this); - - private void BasicNotificationWithProgressBar_MouseLeave(object sender, EventArgs e) => _timer.Enabled = true; - - private void BasicNotificationWithProgressBar_MouseHover(object sender, EventArgs e) => _timer.Enabled = false; - - private void BasicNotificationWithProgressBar_MouseEnter(object sender, EventArgs e) => _timer.Enabled = false; - - private void CountdownTimer_Tick(object sender, EventArgs e) - { - _time++; - - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time}s)"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time}s)"; - } - - if (_time == Seconds) - { - _timer.Stop(); - - UtilityMethods.FadeOutAndClose(this); - } - } - #endregion - - #region Methods - private void SetupTextArea() - { - if (!_usePanelColourInTextArea) - { - krtbContent.InputControlStyle = InputControlStyle.Standalone; - } - else - { - if (kpnlContent.PanelBackStyle == PaletteBackStyle.PanelClient) - { - krtbContent.InputControlStyle = InputControlStyle.PanelClient; - } - else if (kpnlContent.PanelBackStyle == PaletteBackStyle.PanelAlternate) - { - krtbContent.InputControlStyle = InputControlStyle.PanelAlternate; - } - else - { - krtbContent.InputControlStyle = InputControlStyle.Standalone; - } - } - } - - public new void Show() - { - int currentValue; - - Opacity = 0; - - UtilityMethods.SetIconType(IconType, CustomImage, pbxToastImage); - - kwlTitle.Text = Title; - - krtbContent.Text = ContentText; - - if (Seconds != 0) - { - pbCountdown.Maximum = Seconds; - - currentValue = pbCountdown.Maximum; - - pbCountdown.Value = currentValue; - - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time})"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time})"; - } - } - else - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = DismissText; - } - else - { - kbtnToastButton1.Text = DismissText; - } - } - - if (SoundPath != null) - { - _soundPlayer = new SoundPlayer(SoundPath); - } - else - { - _soundPlayer = null; - } - - if (SoundStream != null) - { - _soundPlayer = new SoundPlayer(SoundStream); - } - else - { - _soundPlayer = null; - } - - base.Show(); - } - - private void SetControlBoxVisibility(bool visibilityToggle) => ControlBox = visibilityToggle; - - private void SetWindowBorderStyle(FormBorderStyle borderStyle) => FormBorderStyle = borderStyle; - - private void SetupBaseUI(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, bool? showCloseButton, - bool? showActionButton, - Image customImage = null, - string dismissText = "&Dismiss", - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null, - bool? openProcessInExplorer = null, - string processPath = null, - object optionalParameters = null) - { - ActionButtonLocation = actionButtonLocation ?? ActionButtonLocation.Left; - - ActionType = actionType ?? ActionType.Default; - - IconType = iconType; - - Title = title; - - ContentText = contentText; - - ShowActionButton = showActionButton ?? false; - - UsePanelColourInTextArea = usePanelColourInTextArea ?? false; - - ShowCloseButton = showCloseButton ?? false; - - OpenProcessInExplorer = openProcessInExplorer ?? false; - - CustomImage = customImage; - - DismissText = dismissText; - - ProcessPath = processPath ?? string.Empty; - - OptionalParameters = optionalParameters ?? null; - - RightToLeftSupport = rightToLeftSupport ?? RightToLeftSupport.LeftToRight; - - TopMost = true; - - ActionButtonCommand = actionButtonCommand; - - SetControlBoxVisibility(ShowCloseButton); - - Resize += BasicNotificationWithProgressBar_Resize; - - GotFocus += BasicNotificationWithProgressBar_GotFocus; - - MouseEnter += BasicNotificationWithProgressBar_MouseEnter; - - MouseHover += BasicNotificationWithProgressBar_MouseHover; - - MouseLeave += BasicNotificationWithProgressBar_MouseLeave; - - DoubleBuffered = true; - - SetupTextArea(); - - RearrangeUI(rightToLeftSupport); - - ConfigureRightToLeftActions(rightToLeftSupport); - - SetupActionButton(showActionButton, actionButtonLocation); - } - - private void SetupUI(RightToLeftSupport rightToLeft = RightToLeftSupport.LeftToRight) - { - //Once loaded, position the form to the bottom left of the screen with added padding - Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - Width - 5, - Screen.PrimaryScreen.WorkingArea.Height - Height - 5); - - UtilityMethods.FadeIn(this); - - if (_timer != null) - { - _timer.Start(); - } - - if (_soundPlayer != null) - { - _soundPlayer.Play(); - } - - RearrangeUI(rightToLeft); - - if (rightToLeft == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = _dismissText; - } - else - { - kbtnToastButton1.Text = _dismissText; - } - } - - private void RearrangeUI(RightToLeftSupport? rightToLeft) - { - switch (rightToLeft) - { - case RightToLeftSupport.Inherit: - // Note: Come back to this - break; - case RightToLeftSupport.LeftToRight: - UtilityMethods.CalibrateUILayout(this, new Control[] { ktbActionButton1, ktbActionButton2, ktbActionButton3, kwlTitle, krtbContent }, RightToLeft.No); - - RightToLeftLayout = false; - - UtilityMethods.ChangeControlLocation(pbxToastImage, new Point(12, 12)); - - UtilityMethods.ChangeControlLocation(kwlTitle, new Point(146, 12)); - - UtilityMethods.ChangeControlLocation(krtbContent, new Point(146, 89)); - break; - case RightToLeftSupport.RightToLeft: - UtilityMethods.CalibrateUILayout(this, new Control[] { ktbActionButton1, ktbActionButton2, ktbActionButton3, kwlTitle, krtbContent }, RightToLeft.Yes); - - RightToLeftLayout = true; - - UtilityMethods.ChangeControlLocation(pbxToastImage, new Point(469, 12)); - - UtilityMethods.ChangeControlLocation(kwlTitle, new Point(12, 12)); - - UtilityMethods.ChangeControlLocation(krtbContent, new Point(12, 89)); - break; - } - } - - /// Configures the right to left action buttons. - /// The layout of the toast window. - private void ConfigureRightToLeftActions(RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight) - { - switch (rightToLeftSupport) - { - case RightToLeftSupport.Inherit: - break; - case RightToLeftSupport.LeftToRight: - UtilityMethods.ConfigureToastNotificationButton(ktbActionButton1, _actionType, false, false, _openProcessInExplorer, _optionalParameters, _processPath, _actionButtonText); - - UtilityMethods.ConfigureToastNotificationButton(ktbActionButton3, ActionType.Default, false, false, false, null, null, _dismissText); - break; - case RightToLeftSupport.RightToLeft: - UtilityMethods.ConfigureToastNotificationButton(ktbActionButton1, ActionType.Default, false, false, false, null, null, _dismissText); - - UtilityMethods.ConfigureToastNotificationButton(ktbActionButton3, _actionType, false, false, _openProcessInExplorer, _optionalParameters, _processPath, _actionButtonText); - break; - } - } - - /// Setups the action button. - /// if set to true [show action button]. - /// The action button location. - private void SetupActionButton(bool? showActionButton, ActionButtonLocation? actionButtonLocation) - { - if (showActionButton != null) - { - if (_rightToLeft == RightToLeftSupport.LeftToRight) - { - if (actionButtonLocation == ActionButtonLocation.Left) - { - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - else - { - kbtnToastButtonPanel2.Visible = true; - - ktbActionButton2.Visible = true; - } - } - else if (_rightToLeft == RightToLeftSupport.RightToLeft) - { - if (actionButtonLocation == ActionButtonLocation.Right) - { - tlpButtons.ColumnStyles[0].SizeType = SizeType.Percent; - - tlpButtons.ColumnStyles[0].Width = 100F; - - tlpButtons.ColumnStyles[2].SizeType = SizeType.AutoSize; - - kbtnToastButtonPanel3.Visible = true; - - ktbActionButton3.Visible = true; - } - else - { - tlpButtons.ColumnStyles[0].SizeType = SizeType.Percent; - - tlpButtons.ColumnStyles[0].Width = 100F; - - tlpButtons.ColumnStyles[2].SizeType = SizeType.AutoSize; - - kbtnToastButtonPanel3.Visible = false; - - ktbActionButton3.Visible = false; - - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - } - } - else - { - if (_rightToLeft == RightToLeftSupport.LeftToRight) - { - kbtnToastButtonPanel1.Visible = false; - - kbtnToastButtonPanel2.Visible = false; - } - else if (_rightToLeft == RightToLeftSupport.RightToLeft) - { - kbtnToastButtonPanel2.Visible = false; - - kbtnToastButtonPanel3.Visible = false; - - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - } - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/RichTextBox/BasicNotificationWithProgressBar.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/RichTextBox/BasicNotificationWithProgressBar.resx deleted file mode 100644 index d96a483c7..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/RichTextBox/BasicNotificationWithProgressBar.resx +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - - iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAD0SURBVHhe7dExAQAgDMAw/ItBBDYmZtjI0SMKcu6bjaMQ - TCGYQjCFYArBFIIpBFMIphBMIZhCMIVgCsEUgikEUwimEEwhmEIwhWAKwRSCKQRTCKYQTCGYQjCFYArB - FIIpBFMIphBMIZhCMIVgCsEUgikEUwimEEwhmEIwhWAKwRSCKQRTCKYQTCGYQjCFYArBFIIpBFMIphBM - IZhCMIVgCsEUgikEUwimEEwhmEIwhWAKwRSCKQRTCKYQTCGYQjCFYArBFIIpBFMIphBMIZhCMIVgCsEU - gikEUwimEEwhmEIwhWAKwRSCKQRTCKYQTCGYQiizH+yXgiFwEL30AAAAAElFTkSuQmCC - - - \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/WrapLabel/BasicNotificationAlternativeUI.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/WrapLabel/BasicNotificationAlternativeUI.Designer.cs deleted file mode 100644 index 5ead6bca2..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/WrapLabel/BasicNotificationAlternativeUI.Designer.cs +++ /dev/null @@ -1,386 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - partial class BasicNotificationAlternativeUI - { - /// - /// 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(BasicNotificationAlternativeUI)); - this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel(); - this.kwlContent = new Krypton.Toolkit.KryptonWrapLabel(); - this.kwlTitle = new Krypton.Toolkit.KryptonWrapLabel(); - this.pbxToastImage = new System.Windows.Forms.PictureBox(); - this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.tlpButtons = new Krypton.Toolkit.KryptonTableLayoutPanel(); - this.kbtnToastButtonPanel3 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton3 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton3 = new Krypton.Toolkit.KryptonButton(); - this.kbtnToastButtonPanel2 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton2 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton2 = new Krypton.Toolkit.KryptonButton(); - this.kryptonPanel3 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); - this.kbtnToastButtonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton1 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton1 = new Krypton.Toolkit.KryptonButton(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); - this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbxToastImage)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); - this.kryptonPanel1.SuspendLayout(); - this.tlpButtons.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel3)).BeginInit(); - this.kbtnToastButtonPanel3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel2)).BeginInit(); - this.kbtnToastButtonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel3)).BeginInit(); - this.kryptonPanel3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel1)).BeginInit(); - this.kbtnToastButtonPanel1.SuspendLayout(); - this.SuspendLayout(); - // - // kryptonPanel2 - // - this.kryptonPanel2.Controls.Add(this.kwlContent); - this.kryptonPanel2.Controls.Add(this.kwlTitle); - this.kryptonPanel2.Controls.Add(this.pbxToastImage); - 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(609, 243); - this.kryptonPanel2.TabIndex = 6; - // - // kwlContent - // - this.kwlContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.kwlContent.AutoSize = false; - this.kwlContent.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlContent.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); - this.kwlContent.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl; - this.kwlContent.Location = new System.Drawing.Point(146, 92); - this.kwlContent.Name = "kwlContent"; - this.kwlContent.Size = new System.Drawing.Size(451, 148); - this.kwlContent.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlContent.Text = "{0}"; - this.kwlContent.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // kwlTitle - // - this.kwlTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.kwlTitle.AutoSize = false; - this.kwlTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); - this.kwlTitle.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl; - this.kwlTitle.Location = new System.Drawing.Point(146, 12); - this.kwlTitle.Name = "kwlTitle"; - this.kwlTitle.Size = new System.Drawing.Size(451, 74); - this.kwlTitle.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlTitle.Text = "{0}"; - this.kwlTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // pbxToastImage - // - this.pbxToastImage.BackColor = System.Drawing.Color.Transparent; - this.pbxToastImage.Location = new System.Drawing.Point(12, 12); - this.pbxToastImage.Name = "pbxToastImage"; - this.pbxToastImage.Size = new System.Drawing.Size(128, 128); - this.pbxToastImage.TabIndex = 1; - this.pbxToastImage.TabStop = false; - // - // kryptonPanel1 - // - this.kryptonPanel1.Controls.Add(this.tlpButtons); - this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.kryptonPanel1.Location = new System.Drawing.Point(0, 243); - this.kryptonPanel1.Name = "kryptonPanel1"; - this.kryptonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel1.Size = new System.Drawing.Size(609, 50); - this.kryptonPanel1.TabIndex = 5; - // - // tlpButtons - // - this.tlpButtons.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tlpButtons.BackgroundImage"))); - this.tlpButtons.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.tlpButtons.ColumnCount = 3; - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel3, 2, 1); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel2, 1, 1); - this.tlpButtons.Controls.Add(this.kryptonPanel3, 0, 0); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel1, 0, 1); - this.tlpButtons.Dock = System.Windows.Forms.DockStyle.Fill; - this.tlpButtons.Location = new System.Drawing.Point(0, 0); - this.tlpButtons.Name = "tlpButtons"; - this.tlpButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.tlpButtons.RowCount = 2; - this.tlpButtons.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tlpButtons.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpButtons.Size = new System.Drawing.Size(609, 50); - this.tlpButtons.TabIndex = 2; - // - // kbtnToastButtonPanel3 - // - this.kbtnToastButtonPanel3.Controls.Add(this.ktbActionButton3); - this.kbtnToastButtonPanel3.Controls.Add(this.kbtnToastButton3); - this.kbtnToastButtonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel3.Location = new System.Drawing.Point(79, 10); - this.kbtnToastButtonPanel3.Name = "kbtnToastButtonPanel3"; - this.kbtnToastButtonPanel3.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel3.Size = new System.Drawing.Size(527, 37); - this.kbtnToastButtonPanel3.TabIndex = 3; - // - // ktbActionButton3 - // - this.ktbActionButton3.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton3.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton3.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton3.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton3.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ktbActionButton3.AutoSize = true; - this.ktbActionButton3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton3.CornerRoundingRadius = -1F; - this.ktbActionButton3.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton3.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton3.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton3.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton3.Location = new System.Drawing.Point(488, 6); - this.ktbActionButton3.Name = "ktbActionButton3"; - this.ktbActionButton3.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton3.TabIndex = 2; - this.ktbActionButton3.Values.Text = "AB3"; - // - // kbtnToastButton3 - // - this.kbtnToastButton3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnToastButton3.AutoSize = true; - this.kbtnToastButton3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton3.CornerRoundingRadius = -1F; - this.kbtnToastButton3.Location = new System.Drawing.Point(496, 6); - this.kbtnToastButton3.Name = "kbtnToastButton3"; - this.kbtnToastButton3.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton3.TabIndex = 0; - this.kbtnToastButton3.Values.Text = "B3"; - // - // kbtnToastButtonPanel2 - // - this.kbtnToastButtonPanel2.Controls.Add(this.ktbActionButton2); - this.kbtnToastButtonPanel2.Controls.Add(this.kbtnToastButton2); - this.kbtnToastButtonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel2.Location = new System.Drawing.Point(59, 10); - this.kbtnToastButtonPanel2.Name = "kbtnToastButtonPanel2"; - this.kbtnToastButtonPanel2.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel2.Size = new System.Drawing.Size(14, 37); - this.kbtnToastButtonPanel2.TabIndex = 2; - // - // ktbActionButton2 - // - this.ktbActionButton2.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton2.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton2.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton2.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton2.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ktbActionButton2.AutoSize = true; - this.ktbActionButton2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton2.CornerRoundingRadius = -1F; - this.ktbActionButton2.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton2.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton2.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton2.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton2.Location = new System.Drawing.Point(-20, 6); - this.ktbActionButton2.Name = "ktbActionButton2"; - this.ktbActionButton2.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton2.TabIndex = 2; - this.ktbActionButton2.Values.Text = "AB2"; - // - // kbtnToastButton2 - // - this.kbtnToastButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnToastButton2.AutoSize = true; - this.kbtnToastButton2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton2.CornerRoundingRadius = -1F; - this.kbtnToastButton2.Location = new System.Drawing.Point(-11, 6); - this.kbtnToastButton2.Name = "kbtnToastButton2"; - this.kbtnToastButton2.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton2.TabIndex = 0; - this.kbtnToastButton2.Values.Text = "B2"; - // - // kryptonPanel3 - // - this.tlpButtons.SetColumnSpan(this.kryptonPanel3, 3); - this.kryptonPanel3.Controls.Add(this.kryptonBorderEdge1); - this.kryptonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonPanel3.Location = new System.Drawing.Point(3, 3); - this.kryptonPanel3.Name = "kryptonPanel3"; - this.kryptonPanel3.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel3.Size = new System.Drawing.Size(603, 1); - this.kryptonPanel3.TabIndex = 0; - // - // 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(603, 1); - this.kryptonBorderEdge1.Text = "kryptonBorderEdge1"; - // - // kbtnToastButtonPanel1 - // - this.kbtnToastButtonPanel1.Controls.Add(this.ktbActionButton1); - this.kbtnToastButtonPanel1.Controls.Add(this.kbtnToastButton1); - this.kbtnToastButtonPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel1.Location = new System.Drawing.Point(3, 10); - this.kbtnToastButtonPanel1.Name = "kbtnToastButtonPanel1"; - this.kbtnToastButtonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel1.Size = new System.Drawing.Size(50, 37); - this.kbtnToastButtonPanel1.TabIndex = 1; - this.kbtnToastButtonPanel1.Visible = false; - // - // ktbActionButton1 - // - this.ktbActionButton1.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton1.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton1.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton1.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton1.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.ktbActionButton1.AutoSize = true; - this.ktbActionButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton1.CornerRoundingRadius = -1F; - this.ktbActionButton1.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton1.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton1.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton1.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton1.Location = new System.Drawing.Point(9, 6); - this.ktbActionButton1.Name = "ktbActionButton1"; - this.ktbActionButton1.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton1.TabIndex = 1; - this.ktbActionButton1.Values.Text = "AB1"; - // - // kbtnToastButton1 - // - this.kbtnToastButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.kbtnToastButton1.AutoSize = true; - this.kbtnToastButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton1.CornerRoundingRadius = -1F; - this.kbtnToastButton1.Location = new System.Drawing.Point(9, 6); - this.kbtnToastButton1.Name = "kbtnToastButton1"; - this.kbtnToastButton1.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton1.TabIndex = 0; - this.kbtnToastButton1.Values.Text = "B1"; - // - // BasicNotificationAlternativeUI - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(609, 293); - 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 = "BasicNotificationAlternativeUI"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; - this.Load += new System.EventHandler(this.BasicNotificationAlternativeUI_Load); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); - this.kryptonPanel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pbxToastImage)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); - this.kryptonPanel1.ResumeLayout(false); - this.tlpButtons.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel3)).EndInit(); - this.kbtnToastButtonPanel3.ResumeLayout(false); - this.kbtnToastButtonPanel3.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel2)).EndInit(); - this.kbtnToastButtonPanel2.ResumeLayout(false); - this.kbtnToastButtonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel3)).EndInit(); - this.kryptonPanel3.ResumeLayout(false); - this.kryptonPanel3.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel1)).EndInit(); - this.kbtnToastButtonPanel1.ResumeLayout(false); - this.kbtnToastButtonPanel1.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private KryptonPanel kryptonPanel2; - private KryptonWrapLabel kwlContent; - private KryptonWrapLabel kwlTitle; - private PictureBox pbxToastImage; - private KryptonPanel kryptonPanel1; - private KryptonTableLayoutPanel tlpButtons; - private KryptonPanel kbtnToastButtonPanel3; - private KryptonToastButton ktbActionButton3; - private KryptonButton kbtnToastButton3; - private KryptonPanel kbtnToastButtonPanel2; - private KryptonToastButton ktbActionButton2; - private KryptonButton kbtnToastButton2; - private KryptonPanel kryptonPanel3; - private KryptonBorderEdge kryptonBorderEdge1; - private KryptonPanel kbtnToastButtonPanel1; - private KryptonToastButton ktbActionButton1; - private KryptonButton kbtnToastButton1; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/WrapLabel/BasicNotificationAlternativeUI.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/WrapLabel/BasicNotificationAlternativeUI.cs deleted file mode 100644 index 19df2c9ce..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/WrapLabel/BasicNotificationAlternativeUI.cs +++ /dev/null @@ -1,504 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - public partial class BasicNotificationAlternativeUI : KryptonForm - { - #region Variables - - private ActionButtonLocation _actionButtonLocation; - - private ActionType _actionType; - - private bool _showControlButton, _showCloseButton; - - private IconType _iconType; - - private int _time, _seconds; - - private Timer _timer; - - private SoundPlayer _soundPlayer; - - private string _title, _contentText, _soundPath, _dismissText; - - private Stream _soundStream; - - private Image _customImage; - - private RightToLeftSupport _rightToLeft; - - private KryptonCommand _actionButtonCommand; - - #endregion - - #region Properties - - public ActionButtonLocation ActionButtonLocation { get => _actionButtonLocation; set => _actionButtonLocation = value; } - - public ActionType ActionType { get => _actionType; set => _actionType = value; } - - public bool ShowCloseButton { get => _showControlButton; set => _showControlButton = value; } - - public IconType IconType { get => _iconType; set => _iconType = value; } - - public int Time { get => _time; set => _time = value; } - - public int Seconds { get => _seconds; set => _seconds = value; } - - public string Title { get => _title; set => _title = value; } - - public string ContentText { get => _contentText; set => _contentText = value; } - - public string SoundPath { get => _soundPath; set => _soundPath = value; } - - public string DismissText { get => _dismissText; set => _dismissText = value; } - - public Stream SoundStream { get => _soundStream; set => _soundStream = value; } - - public Image CustomImage { get => _customImage; set => _customImage = value; } - - public RightToLeftSupport RightToLeftSupport { get => _rightToLeft; set { _rightToLeft = value; Invalidate(); } } - - public KryptonCommand ActionButtonCommand { get => _actionButtonCommand; set => _actionButtonCommand = value; } - - #endregion - - #region Constructor - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The show close button. - /// The custom image. - /// The dismiss text. - /// The right to left support. - /// The action button command. - public BasicNotificationAlternativeUI(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? showCloseButton, - Image customImage = null, string dismissText = "&Dismiss", - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - { - InitializeComponent(); - - SetupBaseUI(actionButtonLocation, actionType, iconType, title, contentText, showCloseButton, customImage, dismissText, rightToLeftSupport, actionButtonCommand); - } - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The show close button. - /// The seconds. - /// The custom image. - /// The dismiss text. - /// The right to left support. - /// The action button command. - public BasicNotificationAlternativeUI(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? showCloseButton, int seconds, - Image customImage = null, string dismissText = "&Dismiss", - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - showCloseButton, customImage, dismissText, - rightToLeftSupport, actionButtonCommand) => Seconds = seconds; - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The show close button. - /// The seconds. - /// The sound path. - /// The custom image. - /// The dismiss text. - /// The right to left support. - /// The action button command. - public BasicNotificationAlternativeUI(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? showCloseButton, int seconds, - string soundPath, Image customImage = null, - string dismissText = "&Dismiss", - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - showCloseButton, seconds, customImage, dismissText, - rightToLeftSupport, actionButtonCommand) => SoundPath = soundPath; - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The show close button. - /// The sound stream. - /// The custom image. - /// The dismiss text. - /// The right to left support. - /// The action button command. - public BasicNotificationAlternativeUI(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? showCloseButton, - Stream soundStream, Image customImage = null, - string dismissText = "&Dismiss", - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - showCloseButton, customImage, dismissText, - rightToLeftSupport, actionButtonCommand) => SoundStream = soundStream; - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The show close button. - /// The seconds. - /// The sound stream. - /// The custom image. - /// The dismiss text. - /// The right to left support. - /// The action button command. - public BasicNotificationAlternativeUI(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? showCloseButton, int seconds, - Stream soundStream, Image customImage = null, - string dismissText = "&Dismiss", - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - showCloseButton, seconds, customImage, dismissText, - rightToLeftSupport, actionButtonCommand) => SoundStream = soundStream; - #endregion - - #region Event Handlers - - private void BasicNotificationAlternativeUI_Load(object sender, EventArgs e) => SetupUI(RightToLeftSupport); - - private void BasicNotificationAlternativeUI_GotFocus(object sender, EventArgs e) - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Focus(); - } - else - { - kbtnToastButton1.Focus(); - } - } - - private void BasicNotificationAlternativeUI_Resize(object sender, EventArgs e) - { - if (WindowState == FormWindowState.Maximized) - { - WindowState = FormWindowState.Normal; - } - } - - private void kbtnDismiss_Click(object sender, EventArgs e) => UtilityMethods.FadeOutAndClose(this); - #endregion - - #region Methods - public new void Show() - { - Opacity = 0; - - UtilityMethods.SetIconType(IconType, CustomImage, pbxToastImage); - - kwlTitle.Text = Title; - - kwlContent.Text = ContentText; - - if (Seconds != 0) - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time})"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time})"; - } - - _timer = new Timer(); - - _timer.Interval = 1000; - - _timer.Tick += (sender, e) => - { - _time++; - - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time}s)"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time}s)"; - } - - if (_time == Seconds) - { - _timer.Stop(); - - UtilityMethods.FadeOutAndClose(this); - } - }; - } - else - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = DismissText; - } - else - { - kbtnToastButton1.Text = DismissText; - } - } - - if (SoundPath != null) - { - _soundPlayer = new SoundPlayer(SoundPath); - } - else - { - _soundPlayer = null; - } - - if (SoundStream != null) - { - _soundPlayer = new SoundPlayer(SoundStream); - } - else - { - _soundPlayer = null; - } - - base.Show(); - } - - private void SetControlBoxVisibility(bool visibilityToggle) => ControlBox = visibilityToggle; - - private void SetWindowBorderStyle(FormBorderStyle borderStyle) => FormBorderStyle = borderStyle; - - private void SetupBaseUI(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? showCloseButton, Image customImage, - string dismissText, RightToLeftSupport? rightToLeftSupport, - KryptonCommand actionButtonCommand) - { - ActionButtonLocation = actionButtonLocation ?? ActionButtonLocation.Left; - - ActionType = actionType ?? ActionType.Default; - - IconType = iconType; - - Title = title; - - ContentText = contentText; - - ShowCloseButton = showCloseButton ?? false; - - CustomImage = customImage; - - DismissText = dismissText; - - RightToLeftSupport = rightToLeftSupport ?? RightToLeftSupport.LeftToRight; - - TopMost = true; - - SetControlBoxVisibility(ShowCloseButton); - - Resize += BasicNotificationAlternativeUI_Resize; - - GotFocus += BasicNotificationAlternativeUI_GotFocus; - - DoubleBuffered = true; - - ActionButtonCommand = actionButtonCommand; - - RearrangeUI(rightToLeftSupport); - } - - private void SetupUI(RightToLeftSupport rightToLeft = RightToLeftSupport.LeftToRight) - { - //Once loaded, position the form to the bottom left of the screen with added padding - Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - Width - 5, - Screen.PrimaryScreen.WorkingArea.Height - Height - 5); - - UtilityMethods.FadeIn(this); - - if (_timer != null) - { - _timer.Start(); - } - - if (_soundPlayer != null) - { - _soundPlayer.Play(); - } - - RearrangeUI(rightToLeft); - - if (rightToLeft == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = _dismissText; - } - else - { - kbtnToastButton1.Text = _dismissText; - } - } - - private void RearrangeUI(RightToLeftSupport? rightToLeft) - { - switch (rightToLeft) - { - case RightToLeftSupport.Inherit: - // Note: Come back to this - break; - case RightToLeftSupport.LeftToRight: - UtilityMethods.CalibrateUILayout(this, new Control[] { ktbActionButton1, ktbActionButton2, ktbActionButton3, kwlTitle, kwlContent }, RightToLeft.No); - - RightToLeftLayout = false; - - pbxToastImage.Location = new Point(12, 12); - - kwlTitle.Location = new Point(146, 12); - - kwlContent.Location = new Point(146, 92); //89); - break; - case RightToLeftSupport.RightToLeft: - UtilityMethods.CalibrateUILayout(this, new Control[] { ktbActionButton1, ktbActionButton2, ktbActionButton3, kwlTitle, kwlContent }, RightToLeft.Yes); - - RightToLeftLayout = true; - - pbxToastImage.Location = new Point(469, 12); - - kwlTitle.Location = new Point(12, 12); - - kwlContent.Location = new Point(12, 92); - break; - } - } - - /// Setups the action button. - /// if set to true [show action button]. - /// The action button location. - private void SetupActionButton(bool? showActionButton, ActionButtonLocation? actionButtonLocation) - { - if (showActionButton != null) - { - if (_rightToLeft == RightToLeftSupport.LeftToRight) - { - if (actionButtonLocation == ActionButtonLocation.Left) - { - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - else - { - kbtnToastButtonPanel2.Visible = true; - - ktbActionButton2.Visible = true; - } - } - else if (_rightToLeft == RightToLeftSupport.RightToLeft) - { - if (actionButtonLocation == ActionButtonLocation.Right) - { - tlpButtons.ColumnStyles[0].SizeType = SizeType.Percent; - - tlpButtons.ColumnStyles[0].Width = 100F; - - tlpButtons.ColumnStyles[2].SizeType = SizeType.AutoSize; - - kbtnToastButtonPanel3.Visible = true; - - ktbActionButton3.Visible = true; - } - else - { - tlpButtons.ColumnStyles[0].SizeType = SizeType.Percent; - - tlpButtons.ColumnStyles[0].Width = 100F; - - tlpButtons.ColumnStyles[2].SizeType = SizeType.AutoSize; - - kbtnToastButtonPanel3.Visible = false; - - ktbActionButton3.Visible = false; - - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - } - } - else - { - if (_rightToLeft == RightToLeftSupport.LeftToRight) - { - kbtnToastButtonPanel1.Visible = false; - - kbtnToastButtonPanel2.Visible = false; - } - else if (_rightToLeft == RightToLeftSupport.RightToLeft) - { - kbtnToastButtonPanel2.Visible = false; - - kbtnToastButtonPanel3.Visible = false; - - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - } - } - - #endregion - - #region Overrides - protected override bool ShowWithoutActivation => true; - #endregion - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/WrapLabel/BasicNotificationAlternativeUI.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/WrapLabel/BasicNotificationAlternativeUI.resx deleted file mode 100644 index 23731e0ef..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/WrapLabel/BasicNotificationAlternativeUI.resx +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - - iVBORw0KGgoAAAANSUhEUgAAAmEAAAAyCAYAAAAUcAw7AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFQSURBVHhe7dmxDQNBCARAt3vNuQi34WLeeqR3RAqbTDA6 - 7dHACl7nnOv2/nzrlWVZlmVZludzlbD7AwCAHVXCugEAALNswgAAljlHAgAEKGEAAAFVwroBAACzbMIA - AJY5RwIABChhAAABVcK6AQAAs2zCAACWOUcCAAQoYQAAAVXCugEAALNswgAAljlHAgAEKGEAAAFVwroB - AACzbMIAAJY5RwIABChhAAABVcK6AQAAs2zCAACWOUcCAAQoYQAAAVXCugEAALNswgAAljlHAgAEKGEA - AAFVwroBAACzbMIAAJY5RwIABChhAAABVcK6AQAAs2zCAACWOUcCAAQoYQAAAVXCugEAALNswgAAljlH - AgAEKGEAAAFVwroBAACzbMIAAJY5RwIABChhAAABVcK6AQAAs2zCAACWOUcCAAT8S9jj+ZRlWZZlWZYn - 87l+YA83ApLrx/sAAAAASUVORK5CYII= - - - \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/WrapLabel/BasicNotificationWithProgressBarAlternativeUI.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/WrapLabel/BasicNotificationWithProgressBarAlternativeUI.Designer.cs deleted file mode 100644 index 2d253ee3e..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/WrapLabel/BasicNotificationWithProgressBarAlternativeUI.Designer.cs +++ /dev/null @@ -1,392 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - partial class BasicNotificationWithProgressBarAlternativeUI - { - /// - /// 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(BasicNotificationWithProgressBarAlternativeUI)); - this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel(); - this.kwlContent = new Krypton.Toolkit.KryptonWrapLabel(); - this.pbCountdown = new Krypton.Toolkit.KryptonProgressBar(); - this.kwlTitle = new Krypton.Toolkit.KryptonWrapLabel(); - this.pbxToastImage = new System.Windows.Forms.PictureBox(); - this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.tlpButtons = new Krypton.Toolkit.KryptonTableLayoutPanel(); - this.kbtnToastButtonPanel3 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton3 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton3 = new Krypton.Toolkit.KryptonButton(); - this.kbtnToastButtonPanel2 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton2 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton2 = new Krypton.Toolkit.KryptonButton(); - this.kryptonPanel3 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); - this.kbtnToastButtonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton1 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton1 = new Krypton.Toolkit.KryptonButton(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); - this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbxToastImage)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); - this.kryptonPanel1.SuspendLayout(); - this.tlpButtons.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel3)).BeginInit(); - this.kbtnToastButtonPanel3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel2)).BeginInit(); - this.kbtnToastButtonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel3)).BeginInit(); - this.kryptonPanel3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel1)).BeginInit(); - this.kbtnToastButtonPanel1.SuspendLayout(); - this.SuspendLayout(); - // - // kryptonPanel2 - // - this.kryptonPanel2.Controls.Add(this.kwlContent); - this.kryptonPanel2.Controls.Add(this.pbCountdown); - this.kryptonPanel2.Controls.Add(this.kwlTitle); - this.kryptonPanel2.Controls.Add(this.pbxToastImage); - 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(609, 243); - this.kryptonPanel2.TabIndex = 6; - // - // kwlContent - // - this.kwlContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.kwlContent.AutoSize = false; - this.kwlContent.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlContent.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); - this.kwlContent.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl; - this.kwlContent.Location = new System.Drawing.Point(146, 95); - this.kwlContent.Name = "kwlContent"; - this.kwlContent.Size = new System.Drawing.Size(451, 140); - this.kwlContent.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlContent.Text = "{0}"; - this.kwlContent.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // pbCountdown - // - this.pbCountdown.Dock = System.Windows.Forms.DockStyle.Bottom; - this.pbCountdown.Location = new System.Drawing.Point(0, 238); - this.pbCountdown.Name = "pbCountdown"; - this.pbCountdown.Size = new System.Drawing.Size(609, 5); - this.pbCountdown.TabIndex = 4; - this.pbCountdown.Values.Text = ""; - // - // kwlTitle - // - this.kwlTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.kwlTitle.AutoSize = false; - this.kwlTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); - this.kwlTitle.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl; - this.kwlTitle.Location = new System.Drawing.Point(146, 12); - this.kwlTitle.Name = "kwlTitle"; - this.kwlTitle.Size = new System.Drawing.Size(451, 74); - this.kwlTitle.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlTitle.Text = "{0}"; - this.kwlTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // pbxToastImage - // - this.pbxToastImage.BackColor = System.Drawing.Color.Transparent; - this.pbxToastImage.Location = new System.Drawing.Point(12, 12); - this.pbxToastImage.Name = "pbxToastImage"; - this.pbxToastImage.Size = new System.Drawing.Size(128, 128); - this.pbxToastImage.TabIndex = 1; - this.pbxToastImage.TabStop = false; - // - // kryptonPanel1 - // - this.kryptonPanel1.Controls.Add(this.tlpButtons); - this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.kryptonPanel1.Location = new System.Drawing.Point(0, 243); - this.kryptonPanel1.Name = "kryptonPanel1"; - this.kryptonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel1.Size = new System.Drawing.Size(609, 50); - this.kryptonPanel1.TabIndex = 5; - // - // tlpButtons - // - this.tlpButtons.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tlpButtons.BackgroundImage"))); - this.tlpButtons.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.tlpButtons.ColumnCount = 3; - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel3, 2, 1); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel2, 1, 1); - this.tlpButtons.Controls.Add(this.kryptonPanel3, 0, 0); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel1, 0, 1); - this.tlpButtons.Dock = System.Windows.Forms.DockStyle.Fill; - this.tlpButtons.Location = new System.Drawing.Point(0, 0); - this.tlpButtons.Name = "tlpButtons"; - this.tlpButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.tlpButtons.RowCount = 2; - this.tlpButtons.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tlpButtons.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpButtons.Size = new System.Drawing.Size(609, 50); - this.tlpButtons.TabIndex = 2; - // - // kbtnToastButtonPanel3 - // - this.kbtnToastButtonPanel3.Controls.Add(this.ktbActionButton3); - this.kbtnToastButtonPanel3.Controls.Add(this.kbtnToastButton3); - this.kbtnToastButtonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel3.Location = new System.Drawing.Point(79, 10); - this.kbtnToastButtonPanel3.Name = "kbtnToastButtonPanel3"; - this.kbtnToastButtonPanel3.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel3.Size = new System.Drawing.Size(527, 37); - this.kbtnToastButtonPanel3.TabIndex = 3; - // - // ktbActionButton3 - // - this.ktbActionButton3.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton3.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton3.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton3.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton3.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ktbActionButton3.AutoSize = true; - this.ktbActionButton3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton3.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton3.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton3.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton3.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton3.Location = new System.Drawing.Point(488, 6); - this.ktbActionButton3.Name = "ktbActionButton3"; - this.ktbActionButton3.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton3.TabIndex = 2; - this.ktbActionButton3.Values.Text = "AB3"; - // - // kbtnToastButton3 - // - this.kbtnToastButton3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnToastButton3.AutoSize = true; - this.kbtnToastButton3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton3.Location = new System.Drawing.Point(496, 6); - this.kbtnToastButton3.Name = "kbtnToastButton3"; - this.kbtnToastButton3.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton3.TabIndex = 0; - this.kbtnToastButton3.Values.Text = "B3"; - // - // kbtnToastButtonPanel2 - // - this.kbtnToastButtonPanel2.Controls.Add(this.ktbActionButton2); - this.kbtnToastButtonPanel2.Controls.Add(this.kbtnToastButton2); - this.kbtnToastButtonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel2.Location = new System.Drawing.Point(59, 10); - this.kbtnToastButtonPanel2.Name = "kbtnToastButtonPanel2"; - this.kbtnToastButtonPanel2.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel2.Size = new System.Drawing.Size(14, 37); - this.kbtnToastButtonPanel2.TabIndex = 2; - // - // ktbActionButton2 - // - this.ktbActionButton2.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton2.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton2.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton2.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton2.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ktbActionButton2.AutoSize = true; - this.ktbActionButton2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton2.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton2.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton2.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton2.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton2.Location = new System.Drawing.Point(-20, 6); - this.ktbActionButton2.Name = "ktbActionButton2"; - this.ktbActionButton2.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton2.TabIndex = 2; - this.ktbActionButton2.Values.Text = "AB2"; - // - // kbtnToastButton2 - // - this.kbtnToastButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnToastButton2.AutoSize = true; - this.kbtnToastButton2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton2.Location = new System.Drawing.Point(-11, 6); - this.kbtnToastButton2.Name = "kbtnToastButton2"; - this.kbtnToastButton2.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton2.TabIndex = 0; - this.kbtnToastButton2.Values.Text = "B2"; - // - // kryptonPanel3 - // - this.tlpButtons.SetColumnSpan(this.kryptonPanel3, 3); - this.kryptonPanel3.Controls.Add(this.kryptonBorderEdge1); - this.kryptonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonPanel3.Location = new System.Drawing.Point(3, 3); - this.kryptonPanel3.Name = "kryptonPanel3"; - this.kryptonPanel3.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel3.Size = new System.Drawing.Size(603, 1); - this.kryptonPanel3.TabIndex = 0; - // - // 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(603, 1); - this.kryptonBorderEdge1.Text = "kryptonBorderEdge1"; - // - // kbtnToastButtonPanel1 - // - this.kbtnToastButtonPanel1.Controls.Add(this.ktbActionButton1); - this.kbtnToastButtonPanel1.Controls.Add(this.kbtnToastButton1); - this.kbtnToastButtonPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel1.Location = new System.Drawing.Point(3, 10); - this.kbtnToastButtonPanel1.Name = "kbtnToastButtonPanel1"; - this.kbtnToastButtonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel1.Size = new System.Drawing.Size(50, 37); - this.kbtnToastButtonPanel1.TabIndex = 1; - this.kbtnToastButtonPanel1.Visible = false; - // - // ktbActionButton1 - // - this.ktbActionButton1.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton1.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton1.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton1.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton1.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.ktbActionButton1.AutoSize = true; - this.ktbActionButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton1.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton1.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton1.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton1.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton1.Location = new System.Drawing.Point(9, 6); - this.ktbActionButton1.Name = "ktbActionButton1"; - this.ktbActionButton1.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton1.TabIndex = 1; - this.ktbActionButton1.Values.Text = "AB1"; - // - // kbtnToastButton1 - // - this.kbtnToastButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.kbtnToastButton1.AutoSize = true; - this.kbtnToastButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton1.Location = new System.Drawing.Point(9, 6); - this.kbtnToastButton1.Name = "kbtnToastButton1"; - this.kbtnToastButton1.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton1.TabIndex = 0; - this.kbtnToastButton1.Values.Text = "B1"; - // - // BasicNotificationWithProgressBarAlternativeUI - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(609, 293); - 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 = "BasicNotificationWithProgressBarAlternativeUI"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; - this.Load += new System.EventHandler(this.BasicNotificationWithProgressBarAlternativeUI_Load); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); - this.kryptonPanel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pbxToastImage)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); - this.kryptonPanel1.ResumeLayout(false); - this.tlpButtons.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel3)).EndInit(); - this.kbtnToastButtonPanel3.ResumeLayout(false); - this.kbtnToastButtonPanel3.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel2)).EndInit(); - this.kbtnToastButtonPanel2.ResumeLayout(false); - this.kbtnToastButtonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel3)).EndInit(); - this.kryptonPanel3.ResumeLayout(false); - this.kryptonPanel3.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel1)).EndInit(); - this.kbtnToastButtonPanel1.ResumeLayout(false); - this.kbtnToastButtonPanel1.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private KryptonPanel kryptonPanel2; - private KryptonWrapLabel kwlContent; - private KryptonProgressBar pbCountdown; - private KryptonWrapLabel kwlTitle; - private PictureBox pbxToastImage; - private KryptonPanel kryptonPanel1; - private KryptonTableLayoutPanel tlpButtons; - private KryptonPanel kbtnToastButtonPanel3; - private KryptonToastButton ktbActionButton3; - private KryptonButton kbtnToastButton3; - private KryptonPanel kbtnToastButtonPanel2; - private KryptonToastButton ktbActionButton2; - private KryptonButton kbtnToastButton2; - private KryptonPanel kryptonPanel3; - private KryptonBorderEdge kryptonBorderEdge1; - private KryptonPanel kbtnToastButtonPanel1; - private KryptonToastButton ktbActionButton1; - private KryptonButton kbtnToastButton1; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/WrapLabel/BasicNotificationWithProgressBarAlternativeUI.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/WrapLabel/BasicNotificationWithProgressBarAlternativeUI.cs deleted file mode 100644 index 6a0a19460..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/WrapLabel/BasicNotificationWithProgressBarAlternativeUI.cs +++ /dev/null @@ -1,477 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - public partial class BasicNotificationWithProgressBarAlternativeUI : KryptonForm - { - #region Variables - private bool _showCloseButton; - - private IconType _iconType; - - private int _time, _seconds; - - private Timer _timer; - - private SoundPlayer _soundPlayer; - - private string _title, _contentText, _soundPath, _dismissText; - - private Stream _soundStream; - - private Image _customImage; - - private RightToLeftSupport _rightToLeft; - #endregion - - #region Properties - public bool ShowCloseButton { get => _showCloseButton; set => _showCloseButton = value; } - - public IconType IconType { get => _iconType; set => _iconType = value; } - - public int Time { get => _time; set => _time = value; } - - public int Seconds { get => _seconds; set => _seconds = value; } - - public string Title { get => _title; set => _title = value; } - - public string ContentText { get => _contentText; set => _contentText = value; } - - public string SoundPath { get => _soundPath; set => _soundPath = value; } - - public string DismissText { get => _dismissText; set => _dismissText = value; } - - public Stream SoundStream { get => _soundStream; set => _soundStream = value; } - - public Image CustomImage { get => _customImage; set => _customImage = value; } - - public RightToLeftSupport RightToLeftSupport { get => _rightToLeft; set { _rightToLeft = value; Invalidate(); } } - #endregion - - #region Constructor - /// Initializes a new instance of the class. - /// Type of the icon. - /// The title. - /// The content text. - /// The show close button. - /// The custom image. - /// The dismiss text. - /// The right to left support. - public BasicNotificationWithProgressBarAlternativeUI(IconType iconType, string title, string contentText, - bool? showCloseButton, - Image customImage = null, string dismissText = "&Dismiss", - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight) - { - InitializeComponent(); - - SetupBaseUI(iconType, title, contentText, showCloseButton, customImage, dismissText, rightToLeftSupport); - } - - /// Initializes a new instance of the class. - /// Type of the icon. - /// The title. - /// The content text. - /// The show close button. - /// The seconds. - /// The custom image. - /// The dismiss text. - /// The right to left support. - public BasicNotificationWithProgressBarAlternativeUI(IconType iconType, string title, string contentText, - bool? showCloseButton, - int seconds, Image customImage = null, - string dismissText = "&Dismiss", - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight) - : this(iconType, title, contentText, showCloseButton, customImage, dismissText, rightToLeftSupport) - { - Seconds = seconds; - - if (seconds > 0) - { - // Setup the timer - _timer = new Timer(); - - _timer.Interval = 1000; - - _timer.Enabled = true; - - _timer.Tick += CountdownTimer_Tick; - } - } - - /// Initializes a new instance of the class. - /// Type of the icon. - /// The title. - /// The content text. - /// The show close button. - /// The seconds. - /// The sound path. - /// The custom image. - /// The dismiss text. - /// The right to left support. - public BasicNotificationWithProgressBarAlternativeUI(IconType iconType, string title, string contentText, - bool? showCloseButton, - int seconds, string soundPath, Image customImage = null, - string dismissText = "&Dismiss", - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight) - : this(iconType, title, contentText, showCloseButton, seconds, customImage, dismissText, rightToLeftSupport) => SoundPath = soundPath; - - /// Initializes a new instance of the class. - /// Type of the icon. - /// The title. - /// The content text. - /// The show close button. - /// The sound stream. - /// The custom image. - /// The dismiss text. - /// The right to left support. - public BasicNotificationWithProgressBarAlternativeUI(IconType iconType, string title, string contentText, - bool? showCloseButton, - Stream soundStream, Image customImage = null, - string dismissText = "&Dismiss", - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight) - : this(iconType, title, contentText, showCloseButton, customImage, dismissText, rightToLeftSupport) => SoundStream = soundStream; - - /// Initializes a new instance of the class. - /// Type of the icon. - /// The title. - /// The content text. - /// The show close button. - /// The seconds. - /// The sound stream. - /// The custom image. - /// The dismiss text. - /// The right to left support. - public BasicNotificationWithProgressBarAlternativeUI(IconType iconType, string title, string contentText, - bool? showCloseButton, - int seconds, Stream soundStream, Image customImage = null, - string dismissText = "&Dismiss", - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight) - : this(iconType, title, contentText, showCloseButton, seconds, customImage, dismissText, rightToLeftSupport) => SoundStream = soundStream; - #endregion - - #region Event Handlers - - private void BasicNotificationWithProgressBarAlternativeUI_Load(object sender, EventArgs e) => SetupUI(RightToLeftSupport); - - private void BasicNotificationWithProgressBarAlternativeUI_GotFocus(object sender, EventArgs e) - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Focus(); - } - else - { - kbtnToastButton1.Focus(); - } - } - - private void BasicNotificationWithProgressBarAlternativeUI_Resize(object sender, EventArgs e) - { - if (WindowState == FormWindowState.Maximized) - { - WindowState = FormWindowState.Normal; - } - } - - private void kbtnDismiss_Click(object sender, EventArgs e) => UtilityMethods.FadeOutAndClose(this); - - private void BasicNotificationWithProgressBarAlternativeUI_MouseLeave(object sender, EventArgs e) => _timer.Enabled = true; - - private void BasicNotificationWithProgressBarAlternativeUI_MouseHover(object sender, EventArgs e) => _timer.Enabled = false; - - private void BasicNotificationWithProgressBarAlternativeUI_MouseEnter(object sender, EventArgs e) => _timer.Enabled = false; - - private void CountdownTimer_Tick(object sender, EventArgs e) - { - _time++; - - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time}s)"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time}s)"; - } - - if (_time == Seconds) - { - _timer.Stop(); - - UtilityMethods.FadeOutAndClose(this); - } - } - #endregion - - #region Methods - public new void Show() - { - int currentValue; - - Opacity = 0; - - UtilityMethods.SetIconType(IconType, CustomImage, pbxToastImage); - - kwlTitle.Text = Title; - - kwlContent.Text = ContentText; - - if (Seconds != 0) - { - pbCountdown.Maximum = Seconds; - - currentValue = pbCountdown.Maximum; - - pbCountdown.Value = currentValue; - - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time})"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time})"; - } - } - else - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = DismissText; - } - else - { - kbtnToastButton1.Text = DismissText; - } - } - - if (SoundPath != null) - { - _soundPlayer = new SoundPlayer(SoundPath); - } - else - { - _soundPlayer = null; - } - - if (SoundStream != null) - { - _soundPlayer = new SoundPlayer(SoundStream); - } - else - { - _soundPlayer = null; - } - - base.Show(); - } - - private void SetControlBoxVisibility(bool visibilityToggle) => ControlBox = visibilityToggle; - - private void SetWindowBorderStyle(FormBorderStyle borderStyle) => FormBorderStyle = borderStyle; - - private void SetupBaseUI(IconType iconType, string title, string contentText, bool? showCloseButton, Image customImage, - string dismissText, RightToLeftSupport? rightToLeftSupport) - { - IconType = iconType; - - Title = title; - - ContentText = contentText; - - ShowCloseButton = showCloseButton ?? false; - - CustomImage = customImage; - - DismissText = dismissText; - - RightToLeftSupport = rightToLeftSupport ?? RightToLeftSupport.LeftToRight; - - TopMost = true; - - SetControlBoxVisibility(ShowCloseButton); - - Resize += BasicNotificationWithProgressBarAlternativeUI_Resize; - - GotFocus += BasicNotificationWithProgressBarAlternativeUI_GotFocus; - - MouseEnter += BasicNotificationWithProgressBarAlternativeUI_MouseEnter; - - MouseHover += BasicNotificationWithProgressBarAlternativeUI_MouseHover; - - MouseLeave += BasicNotificationWithProgressBarAlternativeUI_MouseLeave; - - DoubleBuffered = true; - - RearrangeUI(rightToLeftSupport); - } - - private void SetupUI(RightToLeftSupport rightToLeft = RightToLeftSupport.LeftToRight) - { - //Once loaded, position the form to the bottom left of the screen with added padding - Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - Width - 5, - Screen.PrimaryScreen.WorkingArea.Height - Height - 5); - - UtilityMethods.FadeIn(this); - - if (_timer != null) - { - _timer.Start(); - } - - if (_soundPlayer != null) - { - _soundPlayer.Play(); - } - - RearrangeUI(rightToLeft); - - if (rightToLeft == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = _dismissText; - } - else - { - kbtnToastButton1.Text = _dismissText; - } - } - - private void RearrangeUI(RightToLeftSupport? rightToLeft) - { - switch (rightToLeft) - { - case RightToLeftSupport.Inherit: - // Note: Come back to this - break; - case RightToLeftSupport.LeftToRight: - UtilityMethods.CalibrateUILayout(this, new Control[] { ktbActionButton1, ktbActionButton2, ktbActionButton3, kwlTitle, kwlContent }, RightToLeft.No); - - RightToLeftLayout = false; - - pbxToastImage.Location = new Point(12, 12); - - kwlTitle.Location = new Point(146, 12); - - kwlContent.Location = new Point(146, 95); - break; - case RightToLeftSupport.RightToLeft: - UtilityMethods.CalibrateUILayout(this, new Control[] { ktbActionButton1, ktbActionButton2, ktbActionButton3, kwlTitle, kwlContent }, RightToLeft.Yes); - - RightToLeftLayout = true; - - pbxToastImage.Location = new Point(469, 12); - - kwlTitle.Location = new Point(12, 12); - - kwlContent.Location = new Point(12, 95); - break; - } - } - - /// Setups the action button. - /// if set to true [show action button]. - /// The action button location. - private void SetupActionButton(bool? showActionButton, ActionButtonLocation? actionButtonLocation) - { - if (showActionButton != null) - { - if (_rightToLeft == RightToLeftSupport.LeftToRight) - { - if (actionButtonLocation == ActionButtonLocation.Left) - { - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - else - { - kbtnToastButtonPanel2.Visible = true; - - ktbActionButton2.Visible = true; - } - } - else if (_rightToLeft == RightToLeftSupport.RightToLeft) - { - if (actionButtonLocation == ActionButtonLocation.Right) - { - tlpButtons.ColumnStyles[0].SizeType = SizeType.Percent; - - tlpButtons.ColumnStyles[0].Width = 100F; - - tlpButtons.ColumnStyles[2].SizeType = SizeType.AutoSize; - - kbtnToastButtonPanel3.Visible = true; - - ktbActionButton3.Visible = true; - } - else - { - tlpButtons.ColumnStyles[0].SizeType = SizeType.Percent; - - tlpButtons.ColumnStyles[0].Width = 100F; - - tlpButtons.ColumnStyles[2].SizeType = SizeType.AutoSize; - - kbtnToastButtonPanel3.Visible = false; - - ktbActionButton3.Visible = false; - - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - } - } - else - { - if (_rightToLeft == RightToLeftSupport.LeftToRight) - { - kbtnToastButtonPanel1.Visible = false; - - kbtnToastButtonPanel2.Visible = false; - } - else if (_rightToLeft == RightToLeftSupport.RightToLeft) - { - kbtnToastButtonPanel2.Visible = false; - - kbtnToastButtonPanel3.Visible = false; - - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - } - } - - #endregion - - #region Overrides - protected override bool ShowWithoutActivation => true; - #endregion - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/WrapLabel/BasicNotificationWithProgressBarAlternativeUI.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/WrapLabel/BasicNotificationWithProgressBarAlternativeUI.resx deleted file mode 100644 index d96a483c7..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic UI/WrapLabel/BasicNotificationWithProgressBarAlternativeUI.resx +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - - iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAD0SURBVHhe7dExAQAgDMAw/ItBBDYmZtjI0SMKcu6bjaMQ - TCGYQjCFYArBFIIpBFMIphBMIZhCMIVgCsEUgikEUwimEEwhmEIwhWAKwRSCKQRTCKYQTCGYQjCFYArB - FIIpBFMIphBMIZhCMIVgCsEUgikEUwimEEwhmEIwhWAKwRSCKQRTCKYQTCGYQjCFYArBFIIpBFMIphBM - IZhCMIVgCsEUgikEUwimEEwhmEIwhWAKwRSCKQRTCKYQTCGYQjCFYArBFIIpBFMIphBMIZhCMIVgCsEU - gikEUwimEEwhmEIwhWAKwRSCKQRTCKYQTCGYQiizH+yXgiFwEL30AAAAAElFTkSuQmCC - - - \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic/BasicKryptonNotificationForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic/BasicKryptonNotificationForm.cs deleted file mode 100644 index 5f282702b..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Basic/BasicKryptonNotificationForm.cs +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Controls Visuals/VirtualToastNotificationForm.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Controls Visuals/VirtualToastNotificationForm.Designer.cs deleted file mode 100644 index 24d6d252e..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Controls Visuals/VirtualToastNotificationForm.Designer.cs +++ /dev/null @@ -1,442 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - partial class VirtualToastNotificationForm - { - /// - /// 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.tlpBase = new System.Windows.Forms.TableLayoutPanel(); - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.kryptonRichTextBox1 = new Krypton.Toolkit.KryptonRichTextBox(); - this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonLabel1 = new Krypton.Toolkit.KryptonLabel(); - this.kryptonWrapLabel2 = new Krypton.Toolkit.KryptonWrapLabel(); - this.progressBar1 = new System.Windows.Forms.ProgressBar(); - this.kryptonPanel3 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); - this.kryptonPanel4 = new Krypton.Toolkit.KryptonPanel(); - this.tlpButtons = new System.Windows.Forms.TableLayoutPanel(); - this.kpnlActionPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.kpnlActionPanel2 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonPanel7 = new Krypton.Toolkit.KryptonPanel(); - this.kbtnActionButton1 = new Krypton.Toolkit.KryptonButton(); - this.kbtnActionButton2 = new Krypton.Toolkit.KryptonButton(); - this.kbtnDismissButton = new Krypton.Toolkit.KryptonButton(); - this.kryptonPanel8 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonTextBox1 = new Krypton.Toolkit.KryptonTextBox(); - this.kryptonPanel5 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonWrapLabel1 = new Krypton.Toolkit.KryptonWrapLabel(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); - this.kryptonPanel1.SuspendLayout(); - this.tlpBase.SuspendLayout(); - this.tableLayoutPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); - this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel3)).BeginInit(); - this.kryptonPanel3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel4)).BeginInit(); - this.kryptonPanel4.SuspendLayout(); - this.tlpButtons.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kpnlActionPanel1)).BeginInit(); - this.kpnlActionPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kpnlActionPanel2)).BeginInit(); - this.kpnlActionPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel7)).BeginInit(); - this.kryptonPanel7.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel8)).BeginInit(); - this.kryptonPanel8.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel5)).BeginInit(); - this.kryptonPanel5.SuspendLayout(); - this.SuspendLayout(); - // - // kryptonPanel1 - // - this.kryptonPanel1.Controls.Add(this.tlpBase); - 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(609, 331); - this.kryptonPanel1.TabIndex = 0; - // - // tlpBase - // - this.tlpBase.BackColor = System.Drawing.Color.Transparent; - this.tlpBase.ColumnCount = 2; - this.tlpBase.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpBase.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpBase.Controls.Add(this.pictureBox1, 0, 0); - this.tlpBase.Controls.Add(this.tableLayoutPanel1, 1, 0); - this.tlpBase.Controls.Add(this.progressBar1, 0, 1); - this.tlpBase.Controls.Add(this.kryptonPanel3, 0, 2); - this.tlpBase.Controls.Add(this.kryptonPanel4, 0, 3); - this.tlpBase.Dock = System.Windows.Forms.DockStyle.Fill; - this.tlpBase.Location = new System.Drawing.Point(0, 0); - this.tlpBase.Name = "tlpBase"; - this.tlpBase.RowCount = 4; - 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.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tlpBase.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tlpBase.Size = new System.Drawing.Size(609, 331); - this.tlpBase.TabIndex = 1; - // - // tableLayoutPanel1 - // - this.tableLayoutPanel1.ColumnCount = 1; - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel1.Controls.Add(this.kryptonPanel2, 0, 1); - this.tableLayoutPanel1.Controls.Add(this.kryptonPanel8, 0, 2); - this.tableLayoutPanel1.Controls.Add(this.kryptonPanel5, 0, 0); - this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel1.Location = new System.Drawing.Point(143, 3); - this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.RowCount = 3; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(463, 246); - this.tableLayoutPanel1.TabIndex = 1; - // - // pictureBox1 - // - this.pictureBox1.Location = new System.Drawing.Point(8, 4); - this.pictureBox1.Margin = new System.Windows.Forms.Padding(8, 4, 4, 4); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(128, 128); - this.pictureBox1.TabIndex = 0; - this.pictureBox1.TabStop = false; - // - // kryptonRichTextBox1 - // - this.kryptonRichTextBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonRichTextBox1.Location = new System.Drawing.Point(0, 0); - this.kryptonRichTextBox1.Name = "kryptonRichTextBox1"; - this.kryptonRichTextBox1.Size = new System.Drawing.Size(457, 107); - this.kryptonRichTextBox1.TabIndex = 2; - this.kryptonRichTextBox1.Text = "kryptonRichTextBox1"; - // - // kryptonPanel2 - // - this.kryptonPanel2.Controls.Add(this.kryptonLabel1); - this.kryptonPanel2.Controls.Add(this.kryptonRichTextBox1); - this.kryptonPanel2.Controls.Add(this.kryptonWrapLabel2); - this.kryptonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonPanel2.Location = new System.Drawing.Point(3, 116); - this.kryptonPanel2.Name = "kryptonPanel2"; - this.kryptonPanel2.Size = new System.Drawing.Size(457, 107); - this.kryptonPanel2.TabIndex = 3; - // - // kryptonLabel1 - // - this.kryptonLabel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonLabel1.Location = new System.Drawing.Point(0, 0); - this.kryptonLabel1.Name = "kryptonLabel1"; - this.kryptonLabel1.Size = new System.Drawing.Size(457, 107); - this.kryptonLabel1.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kryptonLabel1.TabIndex = 2; - this.kryptonLabel1.Values.Text = "kryptonLabel1"; - // - // kryptonWrapLabel2 - // - this.kryptonWrapLabel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonWrapLabel2.Font = new System.Drawing.Font("Segoe UI", 9F); - this.kryptonWrapLabel2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); - this.kryptonWrapLabel2.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl; - this.kryptonWrapLabel2.Location = new System.Drawing.Point(0, 0); - this.kryptonWrapLabel2.Name = "kryptonWrapLabel2"; - this.kryptonWrapLabel2.Size = new System.Drawing.Size(110, 15); - this.kryptonWrapLabel2.Text = "kryptonWrapLabel2"; - this.kryptonWrapLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // progressBar1 - // - this.tlpBase.SetColumnSpan(this.progressBar1, 2); - this.progressBar1.Dock = System.Windows.Forms.DockStyle.Fill; - this.progressBar1.Location = new System.Drawing.Point(3, 255); - this.progressBar1.Name = "progressBar1"; - this.progressBar1.Size = new System.Drawing.Size(603, 10); - this.progressBar1.TabIndex = 2; - // - // kryptonPanel3 - // - this.tlpBase.SetColumnSpan(this.kryptonPanel3, 2); - this.kryptonPanel3.Controls.Add(this.kryptonBorderEdge1); - this.kryptonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonPanel3.Location = new System.Drawing.Point(3, 271); - this.kryptonPanel3.Name = "kryptonPanel3"; - this.kryptonPanel3.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel3.Size = new System.Drawing.Size(603, 1); - this.kryptonPanel3.TabIndex = 3; - // - // kryptonBorderEdge1 - // - this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary; - this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 0); - this.kryptonBorderEdge1.Name = "kryptonBorderEdge1"; - this.kryptonBorderEdge1.Size = new System.Drawing.Size(603, 1); - this.kryptonBorderEdge1.Text = "kryptonBorderEdge1"; - // - // kryptonPanel4 - // - this.tlpBase.SetColumnSpan(this.kryptonPanel4, 2); - this.kryptonPanel4.Controls.Add(this.tlpButtons); - this.kryptonPanel4.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonPanel4.Location = new System.Drawing.Point(3, 278); - this.kryptonPanel4.Name = "kryptonPanel4"; - this.kryptonPanel4.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel4.Size = new System.Drawing.Size(603, 50); - this.kryptonPanel4.TabIndex = 4; - // - // tlpButtons - // - this.tlpButtons.ColumnCount = 3; - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpButtons.Controls.Add(this.kryptonPanel7, 2, 0); - this.tlpButtons.Controls.Add(this.kpnlActionPanel2, 1, 0); - this.tlpButtons.Controls.Add(this.kpnlActionPanel1, 0, 0); - this.tlpButtons.Dock = System.Windows.Forms.DockStyle.Fill; - this.tlpButtons.Location = new System.Drawing.Point(0, 0); - 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(603, 50); - this.tlpButtons.TabIndex = 0; - // - // kpnlActionPanel1 - // - this.kpnlActionPanel1.Controls.Add(this.kbtnActionButton1); - this.kpnlActionPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.kpnlActionPanel1.Location = new System.Drawing.Point(3, 3); - this.kpnlActionPanel1.Name = "kpnlActionPanel1"; - this.kpnlActionPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kpnlActionPanel1.Size = new System.Drawing.Size(100, 44); - this.kpnlActionPanel1.TabIndex = 0; - this.kpnlActionPanel1.Visible = false; - // - // kpnlActionPanel2 - // - this.kpnlActionPanel2.Controls.Add(this.kbtnActionButton2); - this.kpnlActionPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.kpnlActionPanel2.Location = new System.Drawing.Point(109, 3); - this.kpnlActionPanel2.Name = "kpnlActionPanel2"; - this.kpnlActionPanel2.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kpnlActionPanel2.Size = new System.Drawing.Size(285, 44); - this.kpnlActionPanel2.TabIndex = 1; - this.kpnlActionPanel2.Visible = false; - // - // kryptonPanel7 - // - this.kryptonPanel7.Controls.Add(this.kbtnDismissButton); - this.kryptonPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonPanel7.Location = new System.Drawing.Point(400, 3); - this.kryptonPanel7.Name = "kryptonPanel7"; - this.kryptonPanel7.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel7.Size = new System.Drawing.Size(200, 44); - this.kryptonPanel7.TabIndex = 2; - // - // kbtnActionButton1 - // - this.kbtnActionButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.kbtnActionButton1.AutoSize = true; - this.kbtnActionButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnActionButton1.CornerRoundingRadius = -1F; - this.kbtnActionButton1.Location = new System.Drawing.Point(6, 16); - this.kbtnActionButton1.Name = "kbtnActionButton1"; - this.kbtnActionButton1.Size = new System.Drawing.Size(40, 22); - this.kbtnActionButton1.TabIndex = 0; - this.kbtnActionButton1.Values.Text = "{0} {1}"; - // - // kbtnActionButton2 - // - this.kbtnActionButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnActionButton2.AutoSize = true; - this.kbtnActionButton2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnActionButton2.CornerRoundingRadius = -1F; - this.kbtnActionButton2.Location = new System.Drawing.Point(242, 16); - this.kbtnActionButton2.Name = "kbtnActionButton2"; - this.kbtnActionButton2.Size = new System.Drawing.Size(40, 22); - this.kbtnActionButton2.TabIndex = 1; - this.kbtnActionButton2.Values.Text = "{0} {1}"; - // - // kbtnDismissButton - // - this.kbtnDismissButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnDismissButton.AutoSize = true; - this.kbtnDismissButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnDismissButton.CornerRoundingRadius = -1F; - this.kbtnDismissButton.Location = new System.Drawing.Point(146, 16); - this.kbtnDismissButton.Name = "kbtnDismissButton"; - this.kbtnDismissButton.Size = new System.Drawing.Size(48, 22); - this.kbtnDismissButton.TabIndex = 1; - this.kbtnDismissButton.Values.Text = "{0} ({1})"; - // - // kryptonPanel8 - // - this.kryptonPanel8.Controls.Add(this.kryptonTextBox1); - this.kryptonPanel8.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonPanel8.Location = new System.Drawing.Point(3, 229); - this.kryptonPanel8.Name = "kryptonPanel8"; - this.kryptonPanel8.Size = new System.Drawing.Size(457, 14); - this.kryptonPanel8.TabIndex = 4; - // - // kryptonTextBox1 - // - this.kryptonTextBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonTextBox1.Location = new System.Drawing.Point(0, 0); - this.kryptonTextBox1.Name = "kryptonTextBox1"; - this.kryptonTextBox1.Size = new System.Drawing.Size(457, 23); - this.kryptonTextBox1.TabIndex = 5; - this.kryptonTextBox1.Text = "kryptonTextBox1"; - // - // kryptonPanel5 - // - this.kryptonPanel5.Controls.Add(this.kryptonWrapLabel1); - this.kryptonPanel5.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonPanel5.Location = new System.Drawing.Point(3, 3); - this.kryptonPanel5.Name = "kryptonPanel5"; - this.kryptonPanel5.Size = new System.Drawing.Size(457, 107); - this.kryptonPanel5.TabIndex = 5; - // - // kryptonWrapLabel1 - // - this.kryptonWrapLabel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonWrapLabel1.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kryptonWrapLabel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); - this.kryptonWrapLabel1.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl; - this.kryptonWrapLabel1.Location = new System.Drawing.Point(0, 0); - this.kryptonWrapLabel1.Name = "kryptonWrapLabel1"; - this.kryptonWrapLabel1.Size = new System.Drawing.Size(31, 21); - this.kryptonWrapLabel1.StateCommon.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kryptonWrapLabel1.Text = "{0}"; - this.kryptonWrapLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // VirtualToastNotificationForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(609, 331); - this.Controls.Add(this.kryptonPanel1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "VirtualToastNotificationForm"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; - this.Load += new System.EventHandler(this.VirtualToastNotificationForm_Load); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); - this.kryptonPanel1.ResumeLayout(false); - this.tlpBase.ResumeLayout(false); - this.tableLayoutPanel1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); - this.kryptonPanel2.ResumeLayout(false); - this.kryptonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel3)).EndInit(); - this.kryptonPanel3.ResumeLayout(false); - this.kryptonPanel3.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel4)).EndInit(); - this.kryptonPanel4.ResumeLayout(false); - this.tlpButtons.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kpnlActionPanel1)).EndInit(); - this.kpnlActionPanel1.ResumeLayout(false); - this.kpnlActionPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kpnlActionPanel2)).EndInit(); - this.kpnlActionPanel2.ResumeLayout(false); - this.kpnlActionPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel7)).EndInit(); - this.kryptonPanel7.ResumeLayout(false); - this.kryptonPanel7.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel8)).EndInit(); - this.kryptonPanel8.ResumeLayout(false); - this.kryptonPanel8.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel5)).EndInit(); - this.kryptonPanel5.ResumeLayout(false); - this.kryptonPanel5.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private KryptonPanel kryptonPanel1; - private TableLayoutPanel tlpBase; - private PictureBox pictureBox1; - private TableLayoutPanel tableLayoutPanel1; - private KryptonPanel kryptonPanel2; - private KryptonLabel kryptonLabel1; - private KryptonRichTextBox kryptonRichTextBox1; - private KryptonWrapLabel kryptonWrapLabel2; - private ProgressBar progressBar1; - private KryptonPanel kryptonPanel3; - private KryptonBorderEdge kryptonBorderEdge1; - private KryptonPanel kryptonPanel4; - private KryptonPanel kryptonPanel8; - private KryptonTextBox kryptonTextBox1; - private TableLayoutPanel tlpButtons; - private KryptonPanel kryptonPanel7; - private KryptonButton kbtnDismissButton; - private KryptonPanel kpnlActionPanel2; - private KryptonButton kbtnActionButton2; - private KryptonPanel kpnlActionPanel1; - private KryptonButton kbtnActionButton1; - private KryptonPanel kryptonPanel5; - private KryptonWrapLabel kryptonWrapLabel1; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Controls Visuals/VirtualToastNotificationForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Controls Visuals/VirtualToastNotificationForm.cs deleted file mode 100644 index 9cf4915a6..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Controls Visuals/VirtualToastNotificationForm.cs +++ /dev/null @@ -1,42 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - public partial class VirtualToastNotificationForm : KryptonForm - { - public VirtualToastNotificationForm() - { - InitializeComponent(); - } - - private void VirtualToastNotificationForm_Load(object sender, EventArgs e) - { - - } - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/RichTextBox/BasicNotificationWithUserResponse.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/RichTextBox/BasicNotificationWithUserResponse.Designer.cs deleted file mode 100644 index 42d5dca7a..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/RichTextBox/BasicNotificationWithUserResponse.Designer.cs +++ /dev/null @@ -1,394 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - partial class BasicNotificationWithUserResponse - { - /// - /// 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(BasicNotificationWithUserResponse)); - this.kpnlContent = new Krypton.Toolkit.KryptonPanel(); - this.ktxtUserResponse = new Krypton.Toolkit.KryptonTextBox(); - this.krtbContent = new Krypton.Toolkit.KryptonRichTextBox(); - this.kwlTitle = new Krypton.Toolkit.KryptonWrapLabel(); - this.pbxToastImage = new System.Windows.Forms.PictureBox(); - this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.tlpButtons = new Krypton.Toolkit.KryptonTableLayoutPanel(); - this.kbtnToastButtonPanel3 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton3 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton3 = new Krypton.Toolkit.KryptonButton(); - this.kbtnToastButtonPanel2 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton2 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton2 = new Krypton.Toolkit.KryptonButton(); - this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); - this.kbtnToastButtonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton1 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton1 = new Krypton.Toolkit.KryptonButton(); - ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).BeginInit(); - this.kpnlContent.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbxToastImage)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); - this.kryptonPanel1.SuspendLayout(); - this.tlpButtons.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel3)).BeginInit(); - this.kbtnToastButtonPanel3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel2)).BeginInit(); - this.kbtnToastButtonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); - this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel1)).BeginInit(); - this.kbtnToastButtonPanel1.SuspendLayout(); - this.SuspendLayout(); - // - // kpnlContent - // - this.kpnlContent.Controls.Add(this.ktxtUserResponse); - this.kpnlContent.Controls.Add(this.krtbContent); - this.kpnlContent.Controls.Add(this.kwlTitle); - this.kpnlContent.Controls.Add(this.pbxToastImage); - this.kpnlContent.Dock = System.Windows.Forms.DockStyle.Fill; - this.kpnlContent.Location = new System.Drawing.Point(0, 0); - this.kpnlContent.Name = "kpnlContent"; - this.kpnlContent.Size = new System.Drawing.Size(609, 277); - this.kpnlContent.TabIndex = 4; - // - // ktxtUserResponse - // - this.ktxtUserResponse.Location = new System.Drawing.Point(146, 247); - this.ktxtUserResponse.Name = "ktxtUserResponse"; - this.ktxtUserResponse.Size = new System.Drawing.Size(451, 23); - this.ktxtUserResponse.TabIndex = 3; - // - // krtbContent - // - this.krtbContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.krtbContent.Location = new System.Drawing.Point(146, 89); - this.krtbContent.Name = "krtbContent"; - this.krtbContent.ReadOnly = true; - this.krtbContent.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedVertical; - this.krtbContent.Size = new System.Drawing.Size(451, 152); - this.krtbContent.TabIndex = 4; - this.krtbContent.Text = ""; - // - // kwlTitle - // - this.kwlTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.kwlTitle.AutoSize = false; - this.kwlTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); - this.kwlTitle.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl; - this.kwlTitle.Location = new System.Drawing.Point(146, 12); - this.kwlTitle.Name = "kwlTitle"; - this.kwlTitle.Size = new System.Drawing.Size(451, 74); - this.kwlTitle.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlTitle.Text = "{0}"; - this.kwlTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // pbxToastImage - // - this.pbxToastImage.BackColor = System.Drawing.Color.Transparent; - this.pbxToastImage.Location = new System.Drawing.Point(12, 12); - this.pbxToastImage.Name = "pbxToastImage"; - this.pbxToastImage.Size = new System.Drawing.Size(128, 128); - this.pbxToastImage.TabIndex = 1; - this.pbxToastImage.TabStop = false; - // - // kryptonPanel1 - // - this.kryptonPanel1.Controls.Add(this.tlpButtons); - this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.kryptonPanel1.Location = new System.Drawing.Point(0, 277); - this.kryptonPanel1.Name = "kryptonPanel1"; - this.kryptonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel1.Size = new System.Drawing.Size(609, 50); - this.kryptonPanel1.TabIndex = 3; - // - // tlpButtons - // - this.tlpButtons.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tlpButtons.BackgroundImage"))); - this.tlpButtons.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.tlpButtons.ColumnCount = 3; - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel3, 2, 1); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel2, 1, 1); - this.tlpButtons.Controls.Add(this.kryptonPanel2, 0, 0); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel1, 0, 1); - this.tlpButtons.Dock = System.Windows.Forms.DockStyle.Fill; - this.tlpButtons.Location = new System.Drawing.Point(0, 0); - this.tlpButtons.Name = "tlpButtons"; - this.tlpButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.tlpButtons.RowCount = 2; - this.tlpButtons.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tlpButtons.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpButtons.Size = new System.Drawing.Size(609, 50); - this.tlpButtons.TabIndex = 2; - // - // kbtnToastButtonPanel3 - // - this.kbtnToastButtonPanel3.Controls.Add(this.ktbActionButton3); - this.kbtnToastButtonPanel3.Controls.Add(this.kbtnToastButton3); - this.kbtnToastButtonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel3.Location = new System.Drawing.Point(79, 10); - this.kbtnToastButtonPanel3.Name = "kbtnToastButtonPanel3"; - this.kbtnToastButtonPanel3.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel3.Size = new System.Drawing.Size(527, 37); - this.kbtnToastButtonPanel3.TabIndex = 3; - // - // ktbActionButton3 - // - this.ktbActionButton3.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton3.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton3.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton3.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton3.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ktbActionButton3.AutoSize = true; - this.ktbActionButton3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton3.CornerRoundingRadius = -1F; - this.ktbActionButton3.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton3.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton3.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton3.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton3.Location = new System.Drawing.Point(488, 6); - this.ktbActionButton3.Name = "ktbActionButton3"; - this.ktbActionButton3.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton3.TabIndex = 2; - this.ktbActionButton3.Values.Text = "AB3"; - // - // kbtnToastButton3 - // - this.kbtnToastButton3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnToastButton3.AutoSize = true; - this.kbtnToastButton3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton3.CornerRoundingRadius = -1F; - this.kbtnToastButton3.Location = new System.Drawing.Point(496, 6); - this.kbtnToastButton3.Name = "kbtnToastButton3"; - this.kbtnToastButton3.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton3.TabIndex = 0; - this.kbtnToastButton3.Values.Text = "B3"; - // - // kbtnToastButtonPanel2 - // - this.kbtnToastButtonPanel2.Controls.Add(this.ktbActionButton2); - this.kbtnToastButtonPanel2.Controls.Add(this.kbtnToastButton2); - this.kbtnToastButtonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel2.Location = new System.Drawing.Point(59, 10); - this.kbtnToastButtonPanel2.Name = "kbtnToastButtonPanel2"; - this.kbtnToastButtonPanel2.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel2.Size = new System.Drawing.Size(14, 37); - this.kbtnToastButtonPanel2.TabIndex = 2; - // - // ktbActionButton2 - // - this.ktbActionButton2.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton2.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton2.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton2.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton2.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ktbActionButton2.AutoSize = true; - this.ktbActionButton2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton2.CornerRoundingRadius = -1F; - this.ktbActionButton2.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton2.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton2.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton2.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton2.Location = new System.Drawing.Point(-20, 6); - this.ktbActionButton2.Name = "ktbActionButton2"; - this.ktbActionButton2.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton2.TabIndex = 2; - this.ktbActionButton2.Values.Text = "AB2"; - // - // kbtnToastButton2 - // - this.kbtnToastButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnToastButton2.AutoSize = true; - this.kbtnToastButton2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton2.CornerRoundingRadius = -1F; - this.kbtnToastButton2.Location = new System.Drawing.Point(-11, 6); - this.kbtnToastButton2.Name = "kbtnToastButton2"; - this.kbtnToastButton2.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton2.TabIndex = 0; - this.kbtnToastButton2.Values.Text = "B2"; - // - // kryptonPanel2 - // - this.tlpButtons.SetColumnSpan(this.kryptonPanel2, 3); - this.kryptonPanel2.Controls.Add(this.kryptonBorderEdge1); - this.kryptonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonPanel2.Location = new System.Drawing.Point(3, 3); - this.kryptonPanel2.Name = "kryptonPanel2"; - this.kryptonPanel2.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel2.Size = new System.Drawing.Size(603, 1); - this.kryptonPanel2.TabIndex = 0; - // - // 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(603, 1); - this.kryptonBorderEdge1.Text = "kryptonBorderEdge1"; - // - // kbtnToastButtonPanel1 - // - this.kbtnToastButtonPanel1.Controls.Add(this.ktbActionButton1); - this.kbtnToastButtonPanel1.Controls.Add(this.kbtnToastButton1); - this.kbtnToastButtonPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel1.Location = new System.Drawing.Point(3, 10); - this.kbtnToastButtonPanel1.Name = "kbtnToastButtonPanel1"; - this.kbtnToastButtonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel1.Size = new System.Drawing.Size(50, 37); - this.kbtnToastButtonPanel1.TabIndex = 1; - this.kbtnToastButtonPanel1.Visible = false; - // - // ktbActionButton1 - // - this.ktbActionButton1.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton1.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton1.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton1.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton1.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.ktbActionButton1.AutoSize = true; - this.ktbActionButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton1.CornerRoundingRadius = -1F; - this.ktbActionButton1.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton1.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton1.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton1.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton1.Location = new System.Drawing.Point(9, 6); - this.ktbActionButton1.Name = "ktbActionButton1"; - this.ktbActionButton1.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton1.TabIndex = 1; - this.ktbActionButton1.Values.Text = "AB1"; - // - // kbtnToastButton1 - // - this.kbtnToastButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.kbtnToastButton1.AutoSize = true; - this.kbtnToastButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton1.CornerRoundingRadius = -1F; - this.kbtnToastButton1.Location = new System.Drawing.Point(9, 6); - this.kbtnToastButton1.Name = "kbtnToastButton1"; - this.kbtnToastButton1.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton1.TabIndex = 0; - this.kbtnToastButton1.Values.Text = "B1"; - // - // BasicNotificationWithUserResponse - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(609, 327); - this.Controls.Add(this.kpnlContent); - this.Controls.Add(this.kryptonPanel1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "BasicNotificationWithUserResponse"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; - this.Load += new System.EventHandler(this.BasicNotificationWithUserResponse_Load); - ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).EndInit(); - this.kpnlContent.ResumeLayout(false); - this.kpnlContent.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbxToastImage)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); - this.kryptonPanel1.ResumeLayout(false); - this.tlpButtons.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel3)).EndInit(); - this.kbtnToastButtonPanel3.ResumeLayout(false); - this.kbtnToastButtonPanel3.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel2)).EndInit(); - this.kbtnToastButtonPanel2.ResumeLayout(false); - this.kbtnToastButtonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); - this.kryptonPanel2.ResumeLayout(false); - this.kryptonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel1)).EndInit(); - this.kbtnToastButtonPanel1.ResumeLayout(false); - this.kbtnToastButtonPanel1.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private KryptonPanel kpnlContent; - private KryptonTextBox ktxtUserResponse; - private KryptonRichTextBox krtbContent; - private KryptonWrapLabel kwlTitle; - private PictureBox pbxToastImage; - private KryptonPanel kryptonPanel1; - private KryptonTableLayoutPanel tlpButtons; - private KryptonPanel kbtnToastButtonPanel3; - private KryptonToastButton ktbActionButton3; - private KryptonButton kbtnToastButton3; - private KryptonPanel kbtnToastButtonPanel2; - private KryptonToastButton ktbActionButton2; - private KryptonButton kbtnToastButton2; - private KryptonPanel kryptonPanel2; - private KryptonBorderEdge kryptonBorderEdge1; - private KryptonPanel kbtnToastButtonPanel1; - private KryptonToastButton ktbActionButton1; - private KryptonButton kbtnToastButton1; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/RichTextBox/BasicNotificationWithUserResponse.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/RichTextBox/BasicNotificationWithUserResponse.cs deleted file mode 100644 index 4a4ec46fc..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/RichTextBox/BasicNotificationWithUserResponse.cs +++ /dev/null @@ -1,737 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - public partial class BasicNotificationWithUserResponse : KryptonForm - { - #region Variables - - private ActionButtonLocation _actionButtonLocation; - - private ActionType _actionType; - - private bool _usePanelColourInTextArea, _useNativeBackColourInUserResponseArea, _showCloseButton; - - private Color _userResponsePromptColour; - - private PaletteRelativeAlign _userResponsePromptAlignHorizontal, _userResponsePromptAlignVertical; - - private Font _userResponsePromptFont; - - private IconType _iconType; - - private int _time, _seconds; - - private Timer _timer; - - private SoundPlayer _soundPlayer; - - private string _title, _contentText, _soundPath, _dismissText, _userResponsePrompt; - - private Stream _soundStream; - - private Image _customImage; - - private RightToLeftSupport _rightToLeft; - - private KryptonCommand _actionButtonCommand; - - #endregion - - #region Properties - - public ActionButtonLocation ActionButtonLocation { get => _actionButtonLocation; set => _actionButtonLocation = value; } - - public ActionType ActionType { get => _actionType; set => _actionType = value; } - - public bool UsePanelColourInTextArea { get => _usePanelColourInTextArea; set => _usePanelColourInTextArea = value; } - - public bool UseNativeBackColourInUserResponseArea { get => _useNativeBackColourInUserResponseArea; set => _useNativeBackColourInUserResponseArea = value; } - - public bool ShowCloseButton { get => _showCloseButton; set => _showCloseButton = value; } - - public Color UserResponsePromptColour { get => _userResponsePromptColour; set => _userResponsePromptColour = value; } - - public PaletteRelativeAlign UserResponsePromptAlignHorizontal { get => _userResponsePromptAlignHorizontal; set => _userResponsePromptAlignHorizontal = value; } - - public PaletteRelativeAlign UserResponsePromptAlignVertical { get => _userResponsePromptAlignVertical; set => _userResponsePromptAlignVertical = value; } - - public Font UserResponsePromptFont { get => _userResponsePromptFont; set => _userResponsePromptFont = value; } - - public IconType IconType { get => _iconType; set => _iconType = value; } - - public int Time { get => _time; set => _time = value; } - - public int Seconds { get => _seconds; set => _seconds = value; } - - public string Title { get => _title; set => _title = value; } - - public string ContentText { get => _contentText; set => _contentText = value; } - - public string SoundPath { get => _soundPath; set => _soundPath = value; } - - public string DismissText { get => _dismissText; set => _dismissText = value; } - - public string UserResponsePrompt { get => _userResponsePrompt; set => _userResponsePrompt = value; } - - public Stream SoundStream { get => _soundStream; set => _soundStream = value; } - - public Image CustomImage { get => _customImage; set => _customImage = value; } - - public RightToLeftSupport RightToLeftSupport { get => _rightToLeft; set { _rightToLeft = value; Invalidate(); } } - - public KryptonCommand ActionButtonCommand { get => _actionButtonCommand; set => _actionButtonCommand = value; } - - #endregion - - #region Constructors - /// Initializes a new instance of the class. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The use native back colour in user response area. - /// The custom image. - /// The dismiss text. - /// The user response cue text. - /// The user response cue colour. - /// The user response cue align horizontal. - /// The user response cue align vertical. - /// The user response cue font. - public BasicNotificationWithUserResponse(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, - bool? useNativeBackColourInUserResponseArea, - bool? showCloseButton, - Image customImage = null, - string dismissText = "&Dismiss", - string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - { - InitializeComponent(); - - SetupBaseUI(actionButtonLocation, actionType, iconType, title, contentText, usePanelColourInTextArea, - useNativeBackColourInUserResponseArea, showCloseButton, customImage, dismissText, - userResponseCueText, userResponseCueColour, userResponseCueAlignHorizontal, - userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, - actionButtonCommand); - } - - /// Initializes a new instance of the class. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The use native back colour in user response area. - /// The seconds. - /// The custom image. - /// The dismiss text. - /// The user response cue text. - /// The user response cue colour. - /// The user response cue align horizontal. - /// The user response cue align vertical. - /// The user response cue font. - public BasicNotificationWithUserResponse(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, - bool? useNativeBackColourInUserResponseArea, - bool? showCloseButton, - int seconds, Image customImage = null, - string dismissText = "&Dismiss", string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, usePanelColourInTextArea, useNativeBackColourInUserResponseArea, showCloseButton, customImage, dismissText, userResponseCueText, - userResponseCueColour, userResponseCueAlignHorizontal, - userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, actionButtonCommand) => Seconds = seconds; - - /// Initializes a new instance of the class. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The use native back colour in user response area. - /// The seconds. - /// The sound path. - /// The custom image. - /// The dismiss text. - /// The user response cue text. - /// The user response cue colour. - /// The user response cue align horizontal. - /// The user response cue align vertical. - /// The user response cue font. - public BasicNotificationWithUserResponse(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, - bool? useNativeBackColourInUserResponseArea, - bool? showCloseButton, - int seconds, string soundPath, Image customImage = null, - string dismissText = "&Dismiss", string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - usePanelColourInTextArea, useNativeBackColourInUserResponseArea, showCloseButton, - seconds, customImage, dismissText, userResponseCueText, - userResponseCueColour, userResponseCueAlignHorizontal, - userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, - actionButtonCommand) => SoundPath = soundPath; - - /// Initializes a new instance of the class. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The use native back colour in user response area. - /// The sound stream. - /// The custom image. - /// The dismiss text. - /// The user response cue text. - /// The user response cue colour. - /// The user response cue align horizontal. - /// The user response cue align vertical. - /// The user response cue font. - public BasicNotificationWithUserResponse(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, - bool? useNativeBackColourInUserResponseArea, - bool? showCloseButton, - Stream soundStream, Image customImage = null, - string dismissText = "&Dismiss", string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, usePanelColourInTextArea, - useNativeBackColourInUserResponseArea, showCloseButton, - customImage, dismissText, userResponseCueText, - userResponseCueColour, userResponseCueAlignHorizontal, - userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, - actionButtonCommand) => SoundStream = soundStream; - - /// Initializes a new instance of the class. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The use native back colour in user response area. - /// The seconds. - /// The sound stream. - /// The custom image. - /// The dismiss text. - /// The user response cue text. - /// The user response cue colour. - /// The user response cue align horizontal. - /// The user response cue align vertical. - /// The user response cue font. - public BasicNotificationWithUserResponse(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, - bool? useNativeBackColourInUserResponseArea, - bool? showCloseButton, - int seconds, Stream soundStream, Image customImage = null, - string dismissText = "&Dismiss", string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - usePanelColourInTextArea, useNativeBackColourInUserResponseArea, showCloseButton, - seconds, customImage, dismissText, userResponseCueText, - userResponseCueColour, userResponseCueAlignHorizontal, - userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, - actionButtonCommand) => SoundStream = soundStream; - #endregion - - #region Event Handlers - private void BasicNotificationWithUserResponse_Load(object sender, EventArgs e) - { - SetupUI(RightToLeftSupport); - } - - private void BasicNotificationWithUserResponse_GotFocus(object sender, EventArgs e) - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Focus(); - } - else - { - kbtnToastButton1.Focus(); - } - - if (_timer != null) - { - _timer.Stop(); - } - } - - private void BasicNotificationWithUserResponse_LostFocus(object sender, EventArgs e) - { - if (_timer != null) - { - _timer.Start(); - } - } - - private void BasicNotificationWithUserResponse_Resize(object sender, EventArgs e) - { - if (WindowState == FormWindowState.Maximized) - { - WindowState = FormWindowState.Normal; - } - } - - private void kbtnDismiss_Click(object sender, EventArgs e) => UtilityMethods.FadeOutAndClose(this); - #endregion - - #region Methods - private void SetupTextArea() - { - if (!_usePanelColourInTextArea) - { - krtbContent.InputControlStyle = InputControlStyle.Standalone; - } - else - { - if (kpnlContent.PanelBackStyle == PaletteBackStyle.PanelClient) - { - krtbContent.InputControlStyle = InputControlStyle.PanelClient; - } - else if (kpnlContent.PanelBackStyle == PaletteBackStyle.PanelAlternate) - { - krtbContent.InputControlStyle = InputControlStyle.PanelAlternate; - } - else - { - krtbContent.InputControlStyle = InputControlStyle.Standalone; - } - } - - if (_useNativeBackColourInUserResponseArea) - { - ktxtUserResponse.InputControlStyle = InputControlStyle.Standalone; - } - else - { - if (kpnlContent.PanelBackStyle == PaletteBackStyle.PanelClient) - { - ktxtUserResponse.InputControlStyle = InputControlStyle.PanelClient; - } - else if (kpnlContent.PanelBackStyle == PaletteBackStyle.PanelAlternate) - { - ktxtUserResponse.InputControlStyle = InputControlStyle.PanelAlternate; - } - else - { - ktxtUserResponse.InputControlStyle = InputControlStyle.Standalone; - } - } - } - - public new void Show() - { - Opacity = 0; - - UtilityMethods.SetIconType(IconType, CustomImage, pbxToastImage); - - kwlTitle.Text = Title; - - krtbContent.Text = ContentText; - - ktxtUserResponse.CueHint.CueHintText = UserResponsePrompt; - - ktxtUserResponse.CueHint.Color1 = UserResponsePromptColour; - - ktxtUserResponse.CueHint.Font = UserResponsePromptFont; - - ktxtUserResponse.CueHint.TextH = UserResponsePromptAlignHorizontal; - - ktxtUserResponse.CueHint.TextV = UserResponsePromptAlignVertical; - - if (Seconds != 0) - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time})"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time})"; - } - - _timer = new Timer(); - - _timer.Interval = 1000; - - _timer.Tick += (sender, e) => - { - _time++; - - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time}s)"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time}s)"; - } - - if (_time == Seconds) - { - _timer.Stop(); - - UtilityMethods.FadeOutAndClose(this); - } - }; - - MouseEnter += (sender, e) => { _timer.Enabled = false; }; - - MouseLeave += (sender, e) => { _timer.Enabled = true; }; - } - - if (SoundPath != null) - { - _soundPlayer = new SoundPlayer(SoundPath); - } - else - { - _soundPlayer = null; - } - - if (SoundStream != null) - { - _soundPlayer = new SoundPlayer(SoundStream); - } - else - { - _soundPlayer = null; - } - - base.Show(); - } - - public new DialogResult ShowDialog() - { - Opacity = 0; - - UtilityMethods.SetIconType(IconType, CustomImage, pbxToastImage); - - kwlTitle.Text = Title; - - krtbContent.Text = ContentText; - - ktxtUserResponse.CueHint.CueHintText = UserResponsePrompt; - - ktxtUserResponse.CueHint.Color1 = UserResponsePromptColour; - - ktxtUserResponse.CueHint.Font = UserResponsePromptFont; - - ktxtUserResponse.CueHint.TextH = UserResponsePromptAlignHorizontal; - - ktxtUserResponse.CueHint.TextV = UserResponsePromptAlignVertical; - - if (Seconds != 0) - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time})"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time})"; - } - - _timer = new Timer(); - - _timer.Interval = 1000; - - _timer.Tick += (sender, e) => - { - _time++; - - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time}s)"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time}s)"; - } - - if (_time == Seconds) - { - _timer.Stop(); - - UtilityMethods.FadeOutAndClose(this); - } - }; - } - - if (SoundPath != null) - { - _soundPlayer = new SoundPlayer(SoundPath); - } - else - { - _soundPlayer = null; - } - - if (SoundStream != null) - { - _soundPlayer = new SoundPlayer(SoundStream); - } - else - { - _soundPlayer = null; - } - - return base.ShowDialog(); - } - - public string GetUserResponse() => ktxtUserResponse.Text; - - private void SetupBaseUI(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, bool? useNativeBackColourInUserResponseArea, - bool? showCloseButton, Image customImage, string dismissText, - string userResponseCueText, Color? userResponseCueColour, - PaletteRelativeAlign? userResponseCueAlignHorizontal, - PaletteRelativeAlign? userResponseCueAlignVertical, Font userResponseCueFont, - RightToLeftSupport? rightToLeftSupport, KryptonCommand actionButtonCommand) - { - ActionButtonLocation = actionButtonLocation ?? ActionButtonLocation.Left; - - ActionType = actionType ?? ActionType.Default; - - IconType = iconType; - - Title = title; - - ContentText = contentText; - - CustomImage = customImage; - - UsePanelColourInTextArea = usePanelColourInTextArea ?? false; - - UseNativeBackColourInUserResponseArea = useNativeBackColourInUserResponseArea ?? false; - - ShowCloseButton = showCloseButton ?? false; - - DismissText = dismissText; - - UserResponsePrompt = userResponseCueText; - - UserResponsePromptColour = userResponseCueColour ?? Color.Empty; - - UserResponsePromptAlignHorizontal = userResponseCueAlignHorizontal ?? PaletteRelativeAlign.Near; - - UserResponsePromptAlignVertical = userResponseCueAlignVertical ?? PaletteRelativeAlign.Near; - - UserResponsePromptFont = userResponseCueFont; - - RightToLeftSupport = rightToLeftSupport ?? RightToLeftSupport.LeftToRight; - - ActionButtonCommand = actionButtonCommand; - - TopMost = true; - - Resize += BasicNotificationWithUserResponse_Resize; - - GotFocus += BasicNotificationWithUserResponse_GotFocus; - - LostFocus += BasicNotificationWithUserResponse_LostFocus; - - DoubleBuffered = true; - - SetupTextArea(); - - RearrangeUI(rightToLeftSupport); - } - - private void SetupUI(RightToLeftSupport rightToLeft) - { - //Once loaded, position the form to the bottom left of the screen with added padding - Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - Width - 5, - Screen.PrimaryScreen.WorkingArea.Height - Height - 5); - - UtilityMethods.FadeIn(this); - - if (_timer != null) - { - _timer.Start(); - } - - if (_soundPlayer != null) - { - _soundPlayer.Play(); - } - - if (rightToLeft == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = _dismissText; - } - else - { - kbtnToastButton1.Text = _dismissText; - } - } - - private void RearrangeUI(RightToLeftSupport? rightToLeft) - { - switch (rightToLeft) - { - case RightToLeftSupport.Inherit: - // Note: Come back to this - break; - case RightToLeftSupport.LeftToRight: - UtilityMethods.CalibrateUILayout(this, new Control[] { ktbActionButton1, ktbActionButton2, ktbActionButton3, kwlTitle, krtbContent, ktxtUserResponse }, RightToLeft.No); - - RightToLeftLayout = false; - - pbxToastImage.Location = new Point(12, 12); - - kwlTitle.Location = new Point(146, 12); - - krtbContent.Location = new Point(146, 89); - - ktxtUserResponse.Location = new Point(146, 247); - break; - case RightToLeftSupport.RightToLeft: - UtilityMethods.CalibrateUILayout(this, new Control[] { ktbActionButton1, ktbActionButton2, ktbActionButton3, kwlTitle, krtbContent, ktxtUserResponse }, RightToLeft.Yes); - - RightToLeftLayout = true; - - pbxToastImage.Location = new Point(469, 12); - - kwlTitle.Location = new Point(12, 12); - - krtbContent.Location = new Point(12, 89); - - ktxtUserResponse.Location = new Point(12, 247); - break; - } - } - - /// Setups the action button. - /// if set to true [show action button]. - /// The action button location. - private void SetupActionButton(bool? showActionButton, ActionButtonLocation? actionButtonLocation) - { - if (showActionButton != null) - { - if (_rightToLeft == RightToLeftSupport.LeftToRight) - { - if (actionButtonLocation == ActionButtonLocation.Left) - { - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - else - { - kbtnToastButtonPanel2.Visible = true; - - ktbActionButton2.Visible = true; - } - } - else if (_rightToLeft == RightToLeftSupport.RightToLeft) - { - if (actionButtonLocation == ActionButtonLocation.Right) - { - tlpButtons.ColumnStyles[0].SizeType = SizeType.Percent; - - tlpButtons.ColumnStyles[0].Width = 100F; - - tlpButtons.ColumnStyles[2].SizeType = SizeType.AutoSize; - - kbtnToastButtonPanel3.Visible = true; - - ktbActionButton3.Visible = true; - } - else - { - tlpButtons.ColumnStyles[0].SizeType = SizeType.Percent; - - tlpButtons.ColumnStyles[0].Width = 100F; - - tlpButtons.ColumnStyles[2].SizeType = SizeType.AutoSize; - - kbtnToastButtonPanel3.Visible = false; - - ktbActionButton3.Visible = false; - - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - } - } - else - { - if (_rightToLeft == RightToLeftSupport.LeftToRight) - { - kbtnToastButtonPanel1.Visible = false; - - kbtnToastButtonPanel2.Visible = false; - } - else if (_rightToLeft == RightToLeftSupport.RightToLeft) - { - kbtnToastButtonPanel2.Visible = false; - - kbtnToastButtonPanel3.Visible = false; - - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - } - } - - #endregion - - #region Overrides - protected override bool ShowWithoutActivation => true; - #endregion - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/RichTextBox/BasicNotificationWithUserResponse.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/RichTextBox/BasicNotificationWithUserResponse.resx deleted file mode 100644 index 23731e0ef..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/RichTextBox/BasicNotificationWithUserResponse.resx +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - - iVBORw0KGgoAAAANSUhEUgAAAmEAAAAyCAYAAAAUcAw7AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFQSURBVHhe7dmxDQNBCARAt3vNuQi34WLeeqR3RAqbTDA6 - 7dHACl7nnOv2/nzrlWVZlmVZludzlbD7AwCAHVXCugEAALNswgAAljlHAgAEKGEAAAFVwroBAACzbMIA - AJY5RwIABChhAAABVcK6AQAAs2zCAACWOUcCAAQoYQAAAVXCugEAALNswgAAljlHAgAEKGEAAAFVwroB - AACzbMIAAJY5RwIABChhAAABVcK6AQAAs2zCAACWOUcCAAQoYQAAAVXCugEAALNswgAAljlHAgAEKGEA - AAFVwroBAACzbMIAAJY5RwIABChhAAABVcK6AQAAs2zCAACWOUcCAAQoYQAAAVXCugEAALNswgAAljlH - AgAEKGEAAAFVwroBAACzbMIAAJY5RwIABChhAAABVcK6AQAAs2zCAACWOUcCAAT8S9jj+ZRlWZZlWZYn - 87l+YA83ApLrx/sAAAAASUVORK5CYII= - - - \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/RichTextBox/BasicNotificationWithUserResponseAndProgressBar.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/RichTextBox/BasicNotificationWithUserResponseAndProgressBar.Designer.cs deleted file mode 100644 index adb154872..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/RichTextBox/BasicNotificationWithUserResponseAndProgressBar.Designer.cs +++ /dev/null @@ -1,400 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - partial class BasicNotificationWithUserResponseAndProgressBar - { - /// - /// 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(BasicNotificationWithUserResponseAndProgressBar)); - this.kpnlContent = new Krypton.Toolkit.KryptonPanel(); - this.pbCountdown = new Krypton.Toolkit.KryptonProgressBar(); - this.ktxtUserResponse = new Krypton.Toolkit.KryptonTextBox(); - this.krtbContent = new Krypton.Toolkit.KryptonRichTextBox(); - this.kwlTitle = new Krypton.Toolkit.KryptonWrapLabel(); - this.pbxToastImage = new System.Windows.Forms.PictureBox(); - this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.tlpButtons = new Krypton.Toolkit.KryptonTableLayoutPanel(); - this.kbtnToastButtonPanel3 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton3 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton3 = new Krypton.Toolkit.KryptonButton(); - this.kbtnToastButtonPanel2 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton2 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton2 = new Krypton.Toolkit.KryptonButton(); - this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); - this.kbtnToastButtonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton1 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton1 = new Krypton.Toolkit.KryptonButton(); - ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).BeginInit(); - this.kpnlContent.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbxToastImage)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); - this.kryptonPanel1.SuspendLayout(); - this.tlpButtons.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel3)).BeginInit(); - this.kbtnToastButtonPanel3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel2)).BeginInit(); - this.kbtnToastButtonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); - this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel1)).BeginInit(); - this.kbtnToastButtonPanel1.SuspendLayout(); - this.SuspendLayout(); - // - // kpnlContent - // - this.kpnlContent.Controls.Add(this.pbCountdown); - this.kpnlContent.Controls.Add(this.ktxtUserResponse); - this.kpnlContent.Controls.Add(this.krtbContent); - this.kpnlContent.Controls.Add(this.kwlTitle); - this.kpnlContent.Controls.Add(this.pbxToastImage); - this.kpnlContent.Dock = System.Windows.Forms.DockStyle.Fill; - this.kpnlContent.Location = new System.Drawing.Point(0, 0); - this.kpnlContent.Name = "kpnlContent"; - this.kpnlContent.Size = new System.Drawing.Size(609, 281); - this.kpnlContent.TabIndex = 4; - // - // pbCountdown - // - this.pbCountdown.Dock = System.Windows.Forms.DockStyle.Bottom; - this.pbCountdown.Location = new System.Drawing.Point(0, 276); - this.pbCountdown.Name = "pbCountdown"; - this.pbCountdown.Size = new System.Drawing.Size(609, 5); - this.pbCountdown.TabIndex = 6; - this.pbCountdown.Values.Text = ""; - // - // ktxtUserResponse - // - this.ktxtUserResponse.Location = new System.Drawing.Point(146, 247); - this.ktxtUserResponse.Name = "ktxtUserResponse"; - this.ktxtUserResponse.Size = new System.Drawing.Size(451, 23); - this.ktxtUserResponse.TabIndex = 3; - // - // krtbContent - // - this.krtbContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.krtbContent.Location = new System.Drawing.Point(146, 89); - this.krtbContent.Name = "krtbContent"; - this.krtbContent.ReadOnly = true; - this.krtbContent.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedVertical; - this.krtbContent.Size = new System.Drawing.Size(451, 152); - this.krtbContent.TabIndex = 4; - this.krtbContent.Text = ""; - // - // kwlTitle - // - this.kwlTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.kwlTitle.AutoSize = false; - this.kwlTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); - this.kwlTitle.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl; - this.kwlTitle.Location = new System.Drawing.Point(146, 12); - this.kwlTitle.Name = "kwlTitle"; - this.kwlTitle.Size = new System.Drawing.Size(451, 74); - this.kwlTitle.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlTitle.Text = "{0}"; - this.kwlTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // pbxToastImage - // - this.pbxToastImage.BackColor = System.Drawing.Color.Transparent; - this.pbxToastImage.Location = new System.Drawing.Point(12, 12); - this.pbxToastImage.Name = "pbxToastImage"; - this.pbxToastImage.Size = new System.Drawing.Size(128, 128); - this.pbxToastImage.TabIndex = 1; - this.pbxToastImage.TabStop = false; - // - // kryptonPanel1 - // - this.kryptonPanel1.Controls.Add(this.tlpButtons); - this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.kryptonPanel1.Location = new System.Drawing.Point(0, 281); - this.kryptonPanel1.Name = "kryptonPanel1"; - this.kryptonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel1.Size = new System.Drawing.Size(609, 50); - this.kryptonPanel1.TabIndex = 3; - // - // tlpButtons - // - this.tlpButtons.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tlpButtons.BackgroundImage"))); - this.tlpButtons.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.tlpButtons.ColumnCount = 3; - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel3, 2, 1); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel2, 1, 1); - this.tlpButtons.Controls.Add(this.kryptonPanel2, 0, 0); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel1, 0, 1); - this.tlpButtons.Dock = System.Windows.Forms.DockStyle.Fill; - this.tlpButtons.Location = new System.Drawing.Point(0, 0); - this.tlpButtons.Name = "tlpButtons"; - this.tlpButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.tlpButtons.RowCount = 2; - this.tlpButtons.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tlpButtons.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpButtons.Size = new System.Drawing.Size(609, 50); - this.tlpButtons.TabIndex = 2; - // - // kbtnToastButtonPanel3 - // - this.kbtnToastButtonPanel3.Controls.Add(this.ktbActionButton3); - this.kbtnToastButtonPanel3.Controls.Add(this.kbtnToastButton3); - this.kbtnToastButtonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel3.Location = new System.Drawing.Point(79, 10); - this.kbtnToastButtonPanel3.Name = "kbtnToastButtonPanel3"; - this.kbtnToastButtonPanel3.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel3.Size = new System.Drawing.Size(527, 37); - this.kbtnToastButtonPanel3.TabIndex = 3; - // - // ktbActionButton3 - // - this.ktbActionButton3.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton3.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton3.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton3.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton3.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ktbActionButton3.AutoSize = true; - this.ktbActionButton3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton3.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton3.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton3.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton3.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton3.Location = new System.Drawing.Point(488, 6); - this.ktbActionButton3.Name = "ktbActionButton3"; - this.ktbActionButton3.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton3.TabIndex = 2; - this.ktbActionButton3.Values.Text = "AB3"; - // - // kbtnToastButton3 - // - this.kbtnToastButton3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnToastButton3.AutoSize = true; - this.kbtnToastButton3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton3.Location = new System.Drawing.Point(496, 6); - this.kbtnToastButton3.Name = "kbtnToastButton3"; - this.kbtnToastButton3.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton3.TabIndex = 0; - this.kbtnToastButton3.Values.Text = "B3"; - // - // kbtnToastButtonPanel2 - // - this.kbtnToastButtonPanel2.Controls.Add(this.ktbActionButton2); - this.kbtnToastButtonPanel2.Controls.Add(this.kbtnToastButton2); - this.kbtnToastButtonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel2.Location = new System.Drawing.Point(59, 10); - this.kbtnToastButtonPanel2.Name = "kbtnToastButtonPanel2"; - this.kbtnToastButtonPanel2.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel2.Size = new System.Drawing.Size(14, 37); - this.kbtnToastButtonPanel2.TabIndex = 2; - // - // ktbActionButton2 - // - this.ktbActionButton2.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton2.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton2.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton2.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton2.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ktbActionButton2.AutoSize = true; - this.ktbActionButton2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton2.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton2.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton2.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton2.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton2.Location = new System.Drawing.Point(-20, 6); - this.ktbActionButton2.Name = "ktbActionButton2"; - this.ktbActionButton2.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton2.TabIndex = 2; - this.ktbActionButton2.Values.Text = "AB2"; - // - // kbtnToastButton2 - // - this.kbtnToastButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnToastButton2.AutoSize = true; - this.kbtnToastButton2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton2.Location = new System.Drawing.Point(-11, 6); - this.kbtnToastButton2.Name = "kbtnToastButton2"; - this.kbtnToastButton2.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton2.TabIndex = 0; - this.kbtnToastButton2.Values.Text = "B2"; - // - // kryptonPanel2 - // - this.tlpButtons.SetColumnSpan(this.kryptonPanel2, 3); - this.kryptonPanel2.Controls.Add(this.kryptonBorderEdge1); - this.kryptonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonPanel2.Location = new System.Drawing.Point(3, 3); - this.kryptonPanel2.Name = "kryptonPanel2"; - this.kryptonPanel2.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel2.Size = new System.Drawing.Size(603, 1); - this.kryptonPanel2.TabIndex = 0; - // - // 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(603, 1); - this.kryptonBorderEdge1.Text = "kryptonBorderEdge1"; - // - // kbtnToastButtonPanel1 - // - this.kbtnToastButtonPanel1.Controls.Add(this.ktbActionButton1); - this.kbtnToastButtonPanel1.Controls.Add(this.kbtnToastButton1); - this.kbtnToastButtonPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel1.Location = new System.Drawing.Point(3, 10); - this.kbtnToastButtonPanel1.Name = "kbtnToastButtonPanel1"; - this.kbtnToastButtonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel1.Size = new System.Drawing.Size(50, 37); - this.kbtnToastButtonPanel1.TabIndex = 1; - this.kbtnToastButtonPanel1.Visible = false; - // - // ktbActionButton1 - // - this.ktbActionButton1.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton1.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton1.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton1.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton1.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.ktbActionButton1.AutoSize = true; - this.ktbActionButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton1.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton1.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton1.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton1.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton1.Location = new System.Drawing.Point(9, 6); - this.ktbActionButton1.Name = "ktbActionButton1"; - this.ktbActionButton1.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton1.TabIndex = 1; - this.ktbActionButton1.Values.Text = "AB1"; - // - // kbtnToastButton1 - // - this.kbtnToastButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.kbtnToastButton1.AutoSize = true; - this.kbtnToastButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton1.Location = new System.Drawing.Point(9, 6); - this.kbtnToastButton1.Name = "kbtnToastButton1"; - this.kbtnToastButton1.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton1.TabIndex = 0; - this.kbtnToastButton1.Values.Text = "B1"; - // - // BasicNotificationWithUserResponseAndProgressBar - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(609, 331); - this.Controls.Add(this.kpnlContent); - this.Controls.Add(this.kryptonPanel1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "BasicNotificationWithUserResponseAndProgressBar"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; - this.Load += new System.EventHandler(this.BasicNotificationWithUserResponseAndProgressBar_Load); - ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).EndInit(); - this.kpnlContent.ResumeLayout(false); - this.kpnlContent.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbxToastImage)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); - this.kryptonPanel1.ResumeLayout(false); - this.tlpButtons.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel3)).EndInit(); - this.kbtnToastButtonPanel3.ResumeLayout(false); - this.kbtnToastButtonPanel3.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel2)).EndInit(); - this.kbtnToastButtonPanel2.ResumeLayout(false); - this.kbtnToastButtonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); - this.kryptonPanel2.ResumeLayout(false); - this.kryptonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel1)).EndInit(); - this.kbtnToastButtonPanel1.ResumeLayout(false); - this.kbtnToastButtonPanel1.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private KryptonPanel kpnlContent; - private KryptonProgressBar pbCountdown; - private KryptonTextBox ktxtUserResponse; - private KryptonRichTextBox krtbContent; - private KryptonWrapLabel kwlTitle; - private PictureBox pbxToastImage; - private KryptonPanel kryptonPanel1; - private KryptonTableLayoutPanel tlpButtons; - private KryptonPanel kbtnToastButtonPanel3; - private KryptonToastButton ktbActionButton3; - private KryptonButton kbtnToastButton3; - private KryptonPanel kbtnToastButtonPanel2; - private KryptonToastButton ktbActionButton2; - private KryptonButton kbtnToastButton2; - private KryptonPanel kryptonPanel2; - private KryptonBorderEdge kryptonBorderEdge1; - private KryptonPanel kbtnToastButtonPanel1; - private KryptonToastButton ktbActionButton1; - private KryptonButton kbtnToastButton1; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/RichTextBox/BasicNotificationWithUserResponseAndProgressBar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/RichTextBox/BasicNotificationWithUserResponseAndProgressBar.cs deleted file mode 100644 index 68e979b48..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/RichTextBox/BasicNotificationWithUserResponseAndProgressBar.cs +++ /dev/null @@ -1,792 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - public partial class BasicNotificationWithUserResponseAndProgressBar : KryptonForm - { - #region Variables - - private ActionButtonLocation _actionButtonLocation; - - private ActionType _actionType; - - private bool _usePanelColourInTextArea, _useNativeBackColourInUserResponseArea, _showCloseButton; - - private Color _userResponsePromptColour; - - private PaletteRelativeAlign _userResponsePromptAlignHorizontal, _userResponsePromptAlignVertical; - - private Font _userResponsePromptFont; - - private IconType _iconType; - - private int _time, _seconds; - - private Timer _timer; - - private SoundPlayer _soundPlayer; - - private string _title, _contentText, _soundPath, _dismissText, _userResponsePrompt; - - private Stream _soundStream; - - private Image _customImage; - - private RightToLeftSupport _rightToLeft; - - private KryptonCommand _actionButtonCommand; - - #endregion - - #region Properties - - public ActionButtonLocation ActionButtonLocation { get => _actionButtonLocation; set => _actionButtonLocation = value; } - - public ActionType ActionType { get => _actionType; set => _actionType = value; } - - public bool UsePanelColourInTextArea { get => _usePanelColourInTextArea; set => _usePanelColourInTextArea = value; } - - public bool UseNativeBackColourInUserResponseArea { get => _useNativeBackColourInUserResponseArea; set => _useNativeBackColourInUserResponseArea = value; } - - public bool ShowCloseButton { get => _showCloseButton; set => _showCloseButton = value; } - - public Color UserResponsePromptColour { get => _userResponsePromptColour; set => _userResponsePromptColour = value; } - - public PaletteRelativeAlign UserResponsePromptAlignHorizontal { get => _userResponsePromptAlignHorizontal; set => _userResponsePromptAlignHorizontal = value; } - - public PaletteRelativeAlign UserResponsePromptAlignVertical { get => _userResponsePromptAlignVertical; set => _userResponsePromptAlignVertical = value; } - - public Font UserResponsePromptFont { get => _userResponsePromptFont; set => _userResponsePromptFont = value; } - - public IconType IconType { get => _iconType; set => _iconType = value; } - - public int Time { get => _time; set => _time = value; } - - public int Seconds { get => _seconds; set => _seconds = value; } - - public string Title { get => _title; set => _title = value; } - - public string ContentText { get => _contentText; set => _contentText = value; } - - public string SoundPath { get => _soundPath; set => _soundPath = value; } - - public string DismissText { get => _dismissText; set => _dismissText = value; } - - public string UserResponsePrompt { get => _userResponsePrompt; set => _userResponsePrompt = value; } - - public Stream SoundStream { get => _soundStream; set => _soundStream = value; } - - public Image CustomImage { get => _customImage; set => _customImage = value; } - - public RightToLeftSupport RightToLeftSupport { get => _rightToLeft; set { _rightToLeft = value; Invalidate(); } } - - public KryptonCommand ActionButtonCommand { get => _actionButtonCommand; set => _actionButtonCommand = value; } - - #endregion - - #region Constructors - - /// Initializes a new instance of the class. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The use native back colour in user response area. - /// The custom image. - /// The dismiss text. - /// The user response cue text. - /// The user response cue colour. - /// The user response cue align horizontal. - /// The user response cue align vertical. - /// The user response cue font. - public BasicNotificationWithUserResponseAndProgressBar(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, - bool? useNativeBackColourInUserResponseArea, - Image customImage = null, - string dismissText = "&Dismiss", - string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - { - InitializeComponent(); - - SetupBaseUI(actionButtonLocation, actionType, iconType, title, contentText, usePanelColourInTextArea, useNativeBackColourInUserResponseArea, customImage, dismissText, userResponseCueText, userResponseCueColour, userResponseCueAlignHorizontal, userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, actionButtonCommand); - } - - /// Initializes a new instance of the class. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The use native back colour in user response area. - /// The seconds. - /// The custom image. - /// The dismiss text. - /// The user response cue text. - /// The user response cue colour. - /// The user response cue align horizontal. - /// The user response cue align vertical. - /// The user response cue font. - public BasicNotificationWithUserResponseAndProgressBar(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, - bool? useNativeBackColourInUserResponseArea, - int seconds, Image customImage = null, - string dismissText = "&Dismiss", - string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, usePanelColourInTextArea, - useNativeBackColourInUserResponseArea, - customImage, dismissText, userResponseCueText, - userResponseCueColour, userResponseCueAlignHorizontal, - userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, - actionButtonCommand) - { - Seconds = seconds; - - if (seconds > 0) - { - // Setup the timer - _timer = new Timer(); - - _timer.Interval = 1000; - - _timer.Enabled = true; - - _timer.Tick += CountdownTimer_Tick; - } - } - - /// Initializes a new instance of the class. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The use native back colour in user response area. - /// The seconds. - /// The sound path. - /// The custom image. - /// The dismiss text. - /// The user response cue text. - /// The user response cue colour. - /// The user response cue align horizontal. - /// The user response cue align vertical. - /// The user response cue font. - public BasicNotificationWithUserResponseAndProgressBar(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, - bool? useNativeBackColourInUserResponseArea, - int seconds, string soundPath, - Image customImage = null, - string dismissText = "&Dismiss", - string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, usePanelColourInTextArea, - useNativeBackColourInUserResponseArea, seconds, customImage, dismissText, userResponseCueText, - userResponseCueColour, userResponseCueAlignHorizontal, - userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, - actionButtonCommand) => SoundPath = soundPath; - - /// Initializes a new instance of the class. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The use native back colour in user response area. - /// The sound stream. - /// The custom image. - /// The dismiss text. - /// The user response cue text. - /// The user response cue colour. - /// The user response cue align horizontal. - /// The user response cue align vertical. - /// The user response cue font. - public BasicNotificationWithUserResponseAndProgressBar(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, - bool? useNativeBackColourInUserResponseArea, - Stream soundStream, Image customImage = null, - string dismissText = "&Dismiss", - string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, usePanelColourInTextArea, - useNativeBackColourInUserResponseArea, customImage, dismissText, userResponseCueText, - userResponseCueColour, userResponseCueAlignHorizontal, - userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, - actionButtonCommand) => SoundStream = soundStream; - - /// Initializes a new instance of the class. - /// Type of the icon. - /// The title. - /// The content text. - /// The use panel colour in text area. - /// The use native back colour in user response area. - /// The seconds. - /// The sound stream. - /// The custom image. - /// The dismiss text. - /// The user response cue text. - /// The user response cue colour. - /// The user response cue align horizontal. - /// The user response cue align vertical. - /// The user response cue font. - public BasicNotificationWithUserResponseAndProgressBar(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - bool? usePanelColourInTextArea, - bool? useNativeBackColourInUserResponseArea, - int seconds, Stream soundStream, Image customImage = null, - string dismissText = "&Dismiss", string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - usePanelColourInTextArea, useNativeBackColourInUserResponseArea, - seconds, customImage, dismissText, userResponseCueText, - userResponseCueColour, userResponseCueAlignHorizontal, - userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, - actionButtonCommand) => SoundStream = soundStream; - #endregion - - #region Event Handlers - private void BasicNotificationWithUserResponseAndProgressBar_GotFocus(object sender, EventArgs e) - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Focus(); - } - else - { - kbtnToastButton1.Focus(); - } - } - - private void BasicNotificationWithUserResponseAndProgressBar_Resize(object sender, EventArgs e) - { - if (WindowState == FormWindowState.Maximized) - { - WindowState = FormWindowState.Normal; - } - } - - private void ktxtUserResponse_TextChanged(object sender, EventArgs e) - { - if (string.IsNullOrEmpty(ktxtUserResponse.Text)) - { - _timer.Stop(); - } - else - { - _timer.Start(); - } - } - - private void BasicNotificationWithUserResponseAndProgressBar_Load(object sender, EventArgs e) - { - SetupUI(RightToLeftSupport); - } - - private void kbtnDismiss_Click(object sender, EventArgs e) => UtilityMethods.FadeOutAndClose(this); - - private void BasicNotificationWithUserResponseAndProgressBar_MouseLeave(object sender, EventArgs e) => _timer.Enabled = true; - - private void BasicNotificationWithUserResponseAndProgressBar_MouseHover(object sender, EventArgs e) => _timer.Enabled = false; - - private void BasicNotificationWithUserResponseAndProgressBar_MouseEnter(object sender, EventArgs e) => _timer.Enabled = false; - - private void CountdownTimer_Tick(object sender, EventArgs e) - { - _time++; - - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time}s)"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time}s)"; - } - - if (_time == Seconds) - { - _timer.Stop(); - - UtilityMethods.FadeOutAndClose(this); - } - } - #endregion - - #region Methods - private void SetupTextArea() - { - if (!_usePanelColourInTextArea) - { - krtbContent.InputControlStyle = InputControlStyle.Standalone; - } - else - { - if (kpnlContent.PanelBackStyle == PaletteBackStyle.PanelClient) - { - krtbContent.InputControlStyle = InputControlStyle.PanelClient; - } - else if (kpnlContent.PanelBackStyle == PaletteBackStyle.PanelAlternate) - { - krtbContent.InputControlStyle = InputControlStyle.PanelAlternate; - } - else - { - krtbContent.InputControlStyle = InputControlStyle.Standalone; - } - } - - if (_useNativeBackColourInUserResponseArea) - { - ktxtUserResponse.InputControlStyle = InputControlStyle.Standalone; - } - else - { - if (kpnlContent.PanelBackStyle == PaletteBackStyle.PanelClient) - { - ktxtUserResponse.InputControlStyle = InputControlStyle.PanelClient; - } - else if (kpnlContent.PanelBackStyle == PaletteBackStyle.PanelAlternate) - { - ktxtUserResponse.InputControlStyle = InputControlStyle.PanelAlternate; - } - else - { - ktxtUserResponse.InputControlStyle = InputControlStyle.Standalone; - } - } - } - - public new void Show() - { - int currentValue; - - Opacity = 0; - - UtilityMethods.SetIconType(IconType, CustomImage, pbxToastImage); - - kwlTitle.Text = Title; - - krtbContent.Text = ContentText; - - ktxtUserResponse.CueHint.CueHintText = UserResponsePrompt; - - ktxtUserResponse.CueHint.Color1 = UserResponsePromptColour; - - ktxtUserResponse.CueHint.Font = UserResponsePromptFont; - - ktxtUserResponse.CueHint.TextH = UserResponsePromptAlignHorizontal; - - ktxtUserResponse.CueHint.TextV = UserResponsePromptAlignVertical; - - if (Seconds != 0) - { - pbCountdown.Maximum = Seconds; - - currentValue = pbCountdown.Maximum; - - pbCountdown.Value = currentValue; - - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time})"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time})"; - } - - _timer = new Timer(); - - _timer.Interval = 1000; - - _timer.Tick += (sender, e) => - { - _time++; - - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time}s)"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time}s)"; - } - - pbCountdown.Value = Seconds - Time; - - if (string.IsNullOrEmpty(ktxtUserResponse.Text)) - { - _timer.Stop(); - } - else - { - _timer.Start(); - } - - if (_time == Seconds) - { - _timer.Stop(); - - UtilityMethods.FadeOutAndClose(this); - } - }; - - MouseEnter += (sender, e) => { _timer.Enabled = false; }; - - MouseLeave += (sender, e) => { _timer.Enabled = true; }; - } - - if (SoundPath != null) - { - _soundPlayer = new SoundPlayer(SoundPath); - } - else - { - _soundPlayer = null; - } - - if (SoundStream != null) - { - _soundPlayer = new SoundPlayer(SoundStream); - } - else - { - _soundPlayer = null; - } - - base.Show(); - } - - public new DialogResult ShowDialog() - { - int currentValue; - - Opacity = 0; - - UtilityMethods.SetIconType(IconType, CustomImage, pbxToastImage); - - kwlTitle.Text = Title; - - krtbContent.Text = ContentText; - - ktxtUserResponse.CueHint.CueHintText = UserResponsePrompt; - - ktxtUserResponse.CueHint.Color1 = UserResponsePromptColour; - - ktxtUserResponse.CueHint.Font = UserResponsePromptFont; - - ktxtUserResponse.CueHint.TextH = UserResponsePromptAlignHorizontal; - - ktxtUserResponse.CueHint.TextV = UserResponsePromptAlignVertical; - - if (Seconds != 0) - { - pbCountdown.Maximum = Seconds; - - currentValue = pbCountdown.Maximum; - - pbCountdown.Value = currentValue; - - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time})"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time})"; - } - } - - if (SoundPath != null) - { - _soundPlayer = new SoundPlayer(SoundPath); - } - else - { - _soundPlayer = null; - } - - if (SoundStream != null) - { - _soundPlayer = new SoundPlayer(SoundStream); - } - else - { - _soundPlayer = null; - } - - return base.ShowDialog(); - } - - public string GetUserResponse() => ktxtUserResponse.Text; - - private void SetupBaseUI(ActionButtonLocation? actionButtonLocation, ActionType? actionType, IconType iconType, - string title, string contentText, bool? usePanelColourInTextArea, bool? useNativeBackColourInUserResponseArea, - Image customImage, string dismissText, string userResponseCueText, Color? userResponseCueColour, - PaletteRelativeAlign? userResponseCueAlignHorizontal, PaletteRelativeAlign? userResponseCueAlignVertical, - Font userResponseCueFont, RightToLeftSupport? rightToLeftSupport, KryptonCommand actionButtonCommand) - { - ActionButtonLocation = actionButtonLocation ?? ActionButtonLocation.Left; - - ActionType = actionType ?? ActionType.Default; - - IconType = iconType; - - Title = title; - - ContentText = contentText; - - UsePanelColourInTextArea = usePanelColourInTextArea ?? false; - - UseNativeBackColourInUserResponseArea = useNativeBackColourInUserResponseArea ?? false; - - CustomImage = customImage; - - DismissText = dismissText; - - UserResponsePrompt = userResponseCueText; - - UserResponsePromptColour = userResponseCueColour ?? Color.Empty; - - UserResponsePromptAlignHorizontal = userResponseCueAlignHorizontal ?? PaletteRelativeAlign.Near; - - UserResponsePromptAlignVertical = userResponseCueAlignVertical ?? PaletteRelativeAlign.Near; - - UserResponsePromptFont = userResponseCueFont; - - RightToLeftSupport = rightToLeftSupport ?? RightToLeftSupport.LeftToRight; - - TopMost = true; - - ActionButtonCommand = actionButtonCommand; - - Resize += BasicNotificationWithUserResponseAndProgressBar_Resize; - - GotFocus += BasicNotificationWithUserResponseAndProgressBar_GotFocus; - - MouseEnter += BasicNotificationWithUserResponseAndProgressBar_MouseEnter; - - MouseHover += BasicNotificationWithUserResponseAndProgressBar_MouseHover; - - MouseLeave += BasicNotificationWithUserResponseAndProgressBar_MouseLeave; - - DoubleBuffered = true; - - SetupTextArea(); - - RearrangeUI(rightToLeftSupport); - } - - private void SetupUI(RightToLeftSupport rightToLeft) - { - //Once loaded, position the form to the bottom left of the screen with added padding - Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - Width - 5, - Screen.PrimaryScreen.WorkingArea.Height - Height - 5); - - UtilityMethods.FadeIn(this); - - if (_timer != null) - { - _timer.Start(); - } - - if (_soundPlayer != null) - { - _soundPlayer.Play(); - } - - RearrangeUI(rightToLeft); - - if (rightToLeft == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = _dismissText; - } - else - { - kbtnToastButton1.Text = _dismissText; - } - } - - private void RearrangeUI(RightToLeftSupport? rightToLeft) - { - switch (rightToLeft) - { - case RightToLeftSupport.Inherit: - // Note: Come back to this - break; - case RightToLeftSupport.LeftToRight: - UtilityMethods.CalibrateUILayout(this, new Control[] { ktbActionButton1, ktbActionButton2, ktbActionButton3, kwlTitle, krtbContent, ktxtUserResponse }, RightToLeft.No); - - RightToLeftLayout = false; - - pbxToastImage.Location = new Point(12, 12); - - kwlTitle.Location = new Point(146, 12); - - krtbContent.Location = new Point(146, 89); - - ktxtUserResponse.Location = new Point(146, 247); - break; - case RightToLeftSupport.RightToLeft: - UtilityMethods.CalibrateUILayout(this, new Control[] { ktbActionButton1, ktbActionButton2, ktbActionButton3, kwlTitle, krtbContent, ktxtUserResponse }, RightToLeft.Yes); - - RightToLeftLayout = true; - - pbxToastImage.Location = new Point(469, 12); - - kwlTitle.Location = new Point(12, 12); - - krtbContent.Location = new Point(12, 89); - - ktxtUserResponse.Location = new Point(12, 247); - break; - } - } - - /// Setups the action button. - /// if set to true [show action button]. - /// The action button location. - private void SetupActionButton(bool? showActionButton, ActionButtonLocation? actionButtonLocation) - { - if (showActionButton != null) - { - if (_rightToLeft == RightToLeftSupport.LeftToRight) - { - if (actionButtonLocation == ActionButtonLocation.Left) - { - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - else - { - kbtnToastButtonPanel2.Visible = true; - - ktbActionButton2.Visible = true; - } - } - else if (_rightToLeft == RightToLeftSupport.RightToLeft) - { - if (actionButtonLocation == ActionButtonLocation.Right) - { - tlpButtons.ColumnStyles[0].SizeType = SizeType.Percent; - - tlpButtons.ColumnStyles[0].Width = 100F; - - tlpButtons.ColumnStyles[2].SizeType = SizeType.AutoSize; - - kbtnToastButtonPanel3.Visible = true; - - ktbActionButton3.Visible = true; - } - else - { - tlpButtons.ColumnStyles[0].SizeType = SizeType.Percent; - - tlpButtons.ColumnStyles[0].Width = 100F; - - tlpButtons.ColumnStyles[2].SizeType = SizeType.AutoSize; - - kbtnToastButtonPanel3.Visible = false; - - ktbActionButton3.Visible = false; - - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - } - } - else - { - if (_rightToLeft == RightToLeftSupport.LeftToRight) - { - kbtnToastButtonPanel1.Visible = false; - - kbtnToastButtonPanel2.Visible = false; - } - else if (_rightToLeft == RightToLeftSupport.RightToLeft) - { - kbtnToastButtonPanel2.Visible = false; - - kbtnToastButtonPanel3.Visible = false; - - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - } - } - - #endregion - - #region Overrides - protected override bool ShowWithoutActivation => true; - - protected override void OnMouseEnter(EventArgs e) - { - _timer?.Stop(); - - base.OnMouseEnter(e); - } - - protected override void OnMouseLeave(EventArgs e) - { - _timer?.Start(); - - base.OnMouseLeave(e); - } - #endregion - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/RichTextBox/BasicNotificationWithUserResponseAndProgressBar.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/RichTextBox/BasicNotificationWithUserResponseAndProgressBar.resx deleted file mode 100644 index d96a483c7..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/RichTextBox/BasicNotificationWithUserResponseAndProgressBar.resx +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - - iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAD0SURBVHhe7dExAQAgDMAw/ItBBDYmZtjI0SMKcu6bjaMQ - TCGYQjCFYArBFIIpBFMIphBMIZhCMIVgCsEUgikEUwimEEwhmEIwhWAKwRSCKQRTCKYQTCGYQjCFYArB - FIIpBFMIphBMIZhCMIVgCsEUgikEUwimEEwhmEIwhWAKwRSCKQRTCKYQTCGYQjCFYArBFIIpBFMIphBM - IZhCMIVgCsEUgikEUwimEEwhmEIwhWAKwRSCKQRTCKYQTCGYQjCFYArBFIIpBFMIphBMIZhCMIVgCsEU - gikEUwimEEwhmEIwhWAKwRSCKQRTCKYQTCGYQiizH+yXgiFwEL30AAAAAElFTkSuQmCC - - - \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/Wrapped Label/BasicNotificationWithUserResponseWrappedLabel.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/Wrapped Label/BasicNotificationWithUserResponseWrappedLabel.Designer.cs deleted file mode 100644 index c35db8eea..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/Wrapped Label/BasicNotificationWithUserResponseWrappedLabel.Designer.cs +++ /dev/null @@ -1,400 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - partial class BasicNotificationWithUserResponseWrappedLabel - { - /// - /// 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(BasicNotificationWithUserResponseWrappedLabel)); - this.kpnlContent = new Krypton.Toolkit.KryptonPanel(); - this.kwlContent = new Krypton.Toolkit.KryptonWrapLabel(); - this.ktxtUserResponse = new Krypton.Toolkit.KryptonTextBox(); - this.kwlTitle = new Krypton.Toolkit.KryptonWrapLabel(); - this.pbxToastImage = new System.Windows.Forms.PictureBox(); - this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.tlpButtons = new Krypton.Toolkit.KryptonTableLayoutPanel(); - this.kbtnToastButtonPanel3 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton3 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton3 = new Krypton.Toolkit.KryptonButton(); - this.kbtnToastButtonPanel2 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton2 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton2 = new Krypton.Toolkit.KryptonButton(); - this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); - this.kbtnToastButtonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton1 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton1 = new Krypton.Toolkit.KryptonButton(); - ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).BeginInit(); - this.kpnlContent.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbxToastImage)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); - this.kryptonPanel1.SuspendLayout(); - this.tlpButtons.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel3)).BeginInit(); - this.kbtnToastButtonPanel3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel2)).BeginInit(); - this.kbtnToastButtonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); - this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel1)).BeginInit(); - this.kbtnToastButtonPanel1.SuspendLayout(); - this.SuspendLayout(); - // - // kpnlContent - // - this.kpnlContent.Controls.Add(this.kwlContent); - this.kpnlContent.Controls.Add(this.ktxtUserResponse); - this.kpnlContent.Controls.Add(this.kwlTitle); - this.kpnlContent.Controls.Add(this.pbxToastImage); - this.kpnlContent.Dock = System.Windows.Forms.DockStyle.Fill; - this.kpnlContent.Location = new System.Drawing.Point(0, 0); - this.kpnlContent.Name = "kpnlContent"; - this.kpnlContent.Size = new System.Drawing.Size(609, 277); - this.kpnlContent.TabIndex = 5; - // - // kwlContent - // - this.kwlContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.kwlContent.AutoSize = false; - this.kwlContent.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlContent.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); - this.kwlContent.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl; - this.kwlContent.Location = new System.Drawing.Point(146, 90); - this.kwlContent.Name = "kwlContent"; - this.kwlContent.Size = new System.Drawing.Size(451, 154); - this.kwlContent.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlContent.Text = "{0}"; - this.kwlContent.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // ktxtUserResponse - // - this.ktxtUserResponse.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.ktxtUserResponse.Location = new System.Drawing.Point(146, 247); - this.ktxtUserResponse.Name = "ktxtUserResponse"; - this.ktxtUserResponse.Size = new System.Drawing.Size(451, 23); - this.ktxtUserResponse.TabIndex = 3; - // - // kwlTitle - // - this.kwlTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.kwlTitle.AutoSize = false; - this.kwlTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); - this.kwlTitle.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl; - this.kwlTitle.Location = new System.Drawing.Point(146, 12); - this.kwlTitle.Name = "kwlTitle"; - this.kwlTitle.Size = new System.Drawing.Size(451, 74); - this.kwlTitle.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlTitle.Text = "{0}"; - this.kwlTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // pbxToastImage - // - this.pbxToastImage.BackColor = System.Drawing.Color.Transparent; - this.pbxToastImage.Location = new System.Drawing.Point(12, 12); - this.pbxToastImage.Name = "pbxToastImage"; - this.pbxToastImage.Size = new System.Drawing.Size(128, 128); - this.pbxToastImage.TabIndex = 1; - this.pbxToastImage.TabStop = false; - // - // kryptonPanel1 - // - this.kryptonPanel1.Controls.Add(this.tlpButtons); - this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.kryptonPanel1.Location = new System.Drawing.Point(0, 277); - this.kryptonPanel1.Name = "kryptonPanel1"; - this.kryptonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel1.Size = new System.Drawing.Size(609, 50); - this.kryptonPanel1.TabIndex = 4; - // - // tlpButtons - // - this.tlpButtons.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tlpButtons.BackgroundImage"))); - this.tlpButtons.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.tlpButtons.ColumnCount = 3; - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel3, 2, 1); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel2, 1, 1); - this.tlpButtons.Controls.Add(this.kryptonPanel2, 0, 0); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel1, 0, 1); - this.tlpButtons.Dock = System.Windows.Forms.DockStyle.Fill; - this.tlpButtons.Location = new System.Drawing.Point(0, 0); - this.tlpButtons.Name = "tlpButtons"; - this.tlpButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.tlpButtons.RowCount = 2; - this.tlpButtons.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tlpButtons.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpButtons.Size = new System.Drawing.Size(609, 50); - this.tlpButtons.TabIndex = 2; - // - // kbtnToastButtonPanel3 - // - this.kbtnToastButtonPanel3.Controls.Add(this.ktbActionButton3); - this.kbtnToastButtonPanel3.Controls.Add(this.kbtnToastButton3); - this.kbtnToastButtonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel3.Location = new System.Drawing.Point(79, 10); - this.kbtnToastButtonPanel3.Name = "kbtnToastButtonPanel3"; - this.kbtnToastButtonPanel3.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel3.Size = new System.Drawing.Size(527, 37); - this.kbtnToastButtonPanel3.TabIndex = 3; - // - // ktbActionButton3 - // - this.ktbActionButton3.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton3.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton3.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton3.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton3.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ktbActionButton3.AutoSize = true; - this.ktbActionButton3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton3.CornerRoundingRadius = -1F; - this.ktbActionButton3.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton3.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton3.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton3.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton3.Location = new System.Drawing.Point(488, 6); - this.ktbActionButton3.Name = "ktbActionButton3"; - this.ktbActionButton3.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton3.TabIndex = 2; - this.ktbActionButton3.Values.Text = "AB3"; - // - // kbtnToastButton3 - // - this.kbtnToastButton3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnToastButton3.AutoSize = true; - this.kbtnToastButton3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton3.CornerRoundingRadius = -1F; - this.kbtnToastButton3.Location = new System.Drawing.Point(496, 6); - this.kbtnToastButton3.Name = "kbtnToastButton3"; - this.kbtnToastButton3.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton3.TabIndex = 0; - this.kbtnToastButton3.Values.Text = "B3"; - // - // kbtnToastButtonPanel2 - // - this.kbtnToastButtonPanel2.Controls.Add(this.ktbActionButton2); - this.kbtnToastButtonPanel2.Controls.Add(this.kbtnToastButton2); - this.kbtnToastButtonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel2.Location = new System.Drawing.Point(59, 10); - this.kbtnToastButtonPanel2.Name = "kbtnToastButtonPanel2"; - this.kbtnToastButtonPanel2.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel2.Size = new System.Drawing.Size(14, 37); - this.kbtnToastButtonPanel2.TabIndex = 2; - // - // ktbActionButton2 - // - this.ktbActionButton2.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton2.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton2.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton2.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton2.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ktbActionButton2.AutoSize = true; - this.ktbActionButton2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton2.CornerRoundingRadius = -1F; - this.ktbActionButton2.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton2.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton2.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton2.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton2.Location = new System.Drawing.Point(-20, 6); - this.ktbActionButton2.Name = "ktbActionButton2"; - this.ktbActionButton2.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton2.TabIndex = 2; - this.ktbActionButton2.Values.Text = "AB2"; - // - // kbtnToastButton2 - // - this.kbtnToastButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnToastButton2.AutoSize = true; - this.kbtnToastButton2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton2.CornerRoundingRadius = -1F; - this.kbtnToastButton2.Location = new System.Drawing.Point(-11, 6); - this.kbtnToastButton2.Name = "kbtnToastButton2"; - this.kbtnToastButton2.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton2.TabIndex = 0; - this.kbtnToastButton2.Values.Text = "B2"; - // - // kryptonPanel2 - // - this.tlpButtons.SetColumnSpan(this.kryptonPanel2, 3); - this.kryptonPanel2.Controls.Add(this.kryptonBorderEdge1); - this.kryptonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonPanel2.Location = new System.Drawing.Point(3, 3); - this.kryptonPanel2.Name = "kryptonPanel2"; - this.kryptonPanel2.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel2.Size = new System.Drawing.Size(603, 1); - this.kryptonPanel2.TabIndex = 0; - // - // 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(603, 1); - this.kryptonBorderEdge1.Text = "kryptonBorderEdge1"; - // - // kbtnToastButtonPanel1 - // - this.kbtnToastButtonPanel1.Controls.Add(this.ktbActionButton1); - this.kbtnToastButtonPanel1.Controls.Add(this.kbtnToastButton1); - this.kbtnToastButtonPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel1.Location = new System.Drawing.Point(3, 10); - this.kbtnToastButtonPanel1.Name = "kbtnToastButtonPanel1"; - this.kbtnToastButtonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel1.Size = new System.Drawing.Size(50, 37); - this.kbtnToastButtonPanel1.TabIndex = 1; - this.kbtnToastButtonPanel1.Visible = false; - // - // ktbActionButton1 - // - this.ktbActionButton1.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton1.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton1.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton1.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton1.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.ktbActionButton1.AutoSize = true; - this.ktbActionButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton1.CornerRoundingRadius = -1F; - this.ktbActionButton1.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton1.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton1.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton1.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton1.Location = new System.Drawing.Point(9, 6); - this.ktbActionButton1.Name = "ktbActionButton1"; - this.ktbActionButton1.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton1.TabIndex = 1; - this.ktbActionButton1.Values.Text = "AB1"; - // - // kbtnToastButton1 - // - this.kbtnToastButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.kbtnToastButton1.AutoSize = true; - this.kbtnToastButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton1.CornerRoundingRadius = -1F; - this.kbtnToastButton1.Location = new System.Drawing.Point(9, 6); - this.kbtnToastButton1.Name = "kbtnToastButton1"; - this.kbtnToastButton1.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton1.TabIndex = 0; - this.kbtnToastButton1.Values.Text = "B1"; - // - // BasicNotificationWithUserResponseWrappedLabel - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(609, 327); - this.Controls.Add(this.kpnlContent); - this.Controls.Add(this.kryptonPanel1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "BasicNotificationWithUserResponseWrappedLabel"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; - this.Load += new System.EventHandler(this.BasicNotificationWithUserResponseWrappedLabel_Load); - ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).EndInit(); - this.kpnlContent.ResumeLayout(false); - this.kpnlContent.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbxToastImage)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); - this.kryptonPanel1.ResumeLayout(false); - this.tlpButtons.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel3)).EndInit(); - this.kbtnToastButtonPanel3.ResumeLayout(false); - this.kbtnToastButtonPanel3.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel2)).EndInit(); - this.kbtnToastButtonPanel2.ResumeLayout(false); - this.kbtnToastButtonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); - this.kryptonPanel2.ResumeLayout(false); - this.kryptonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel1)).EndInit(); - this.kbtnToastButtonPanel1.ResumeLayout(false); - this.kbtnToastButtonPanel1.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private KryptonPanel kpnlContent; - private KryptonWrapLabel kwlContent; - private KryptonTextBox ktxtUserResponse; - private KryptonWrapLabel kwlTitle; - private PictureBox pbxToastImage; - private KryptonPanel kryptonPanel1; - private KryptonTableLayoutPanel tlpButtons; - private KryptonPanel kbtnToastButtonPanel3; - private KryptonToastButton ktbActionButton3; - private KryptonButton kbtnToastButton3; - private KryptonPanel kbtnToastButtonPanel2; - private KryptonToastButton ktbActionButton2; - private KryptonButton kbtnToastButton2; - private KryptonPanel kryptonPanel2; - private KryptonBorderEdge kryptonBorderEdge1; - private KryptonPanel kbtnToastButtonPanel1; - private KryptonToastButton ktbActionButton1; - private KryptonButton kbtnToastButton1; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/Wrapped Label/BasicNotificationWithUserResponseWrappedLabel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/Wrapped Label/BasicNotificationWithUserResponseWrappedLabel.cs deleted file mode 100644 index 9683f54a4..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/Wrapped Label/BasicNotificationWithUserResponseWrappedLabel.cs +++ /dev/null @@ -1,606 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast -{ - public partial class BasicNotificationWithUserResponseWrappedLabel : KryptonForm - { - #region Variables - - private ActionButtonLocation _actionButtonLocation; - - private ActionType _actionType; - - private bool _useNativeBackColourInUserResponseArea, _showCloseButton; - - private Color _userResponsePromptColour; - - private PaletteRelativeAlign _userResponsePromptAlignHorizontal, _userResponsePromptAlignVertical; - - private Font _userResponsePromptFont; - - private IconType _iconType; - - private int _time, _seconds; - - private Timer _timer; - - private SoundPlayer _soundPlayer; - - private string _title, _contentText, _soundPath, _dismissText, _userResponsePrompt; - - private Stream _soundStream; - - private Image _customImage; - - private RightToLeftSupport _rightToLeft; - - private KryptonCommand _actionButtonCommand; - - #endregion - - #region Properties - - public ActionButtonLocation ActionButtonLocation { get => _actionButtonLocation; set => _actionButtonLocation = value; } - - public ActionType ActionType { get => _actionType; set => _actionType = value; } - - public bool ShowCloseButton { get => _showCloseButton; set => _showCloseButton = value; } - - public Color UserResponsePromptColour { get => _userResponsePromptColour; set => _userResponsePromptColour = value; } - - public PaletteRelativeAlign UserResponsePromptAlignHorizontal { get => _userResponsePromptAlignHorizontal; set => _userResponsePromptAlignHorizontal = value; } - - public PaletteRelativeAlign UserResponsePromptAlignVertical { get => _userResponsePromptAlignVertical; set => _userResponsePromptAlignVertical = value; } - - public Font UserResponsePromptFont { get => _userResponsePromptFont; set => _userResponsePromptFont = value; } - - public IconType IconType { get => _iconType; set => _iconType = value; } - - public int Time { get => _time; set => _time = value; } - - public int Seconds { get => _seconds; set => _seconds = value; } - - public string Title { get => _title; set => _title = value; } - - public string ContentText { get => _contentText; set => _contentText = value; } - - public string SoundPath { get => _soundPath; set => _soundPath = value; } - - public string DismissText { get => _dismissText; set => _dismissText = value; } - - public string UserResponsePrompt { get => _userResponsePrompt; set => _userResponsePrompt = value; } - - public Stream SoundStream { get => _soundStream; set => _soundStream = value; } - - public Image CustomImage { get => _customImage; set => _customImage = value; } - - public RightToLeftSupport RightToLeftSupport { get => _rightToLeft; set { _rightToLeft = value; Invalidate(); } } - - public KryptonCommand ActionButtonCommand { get => _actionButtonCommand; set => _actionButtonCommand = value; } - - #endregion - - #region Constructors - public BasicNotificationWithUserResponseWrappedLabel(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - Image customImage = null, - string dismissText = "&Dismiss", string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - { - InitializeComponent(); - - SetupUI(actionButtonLocation, actionType, iconType, title, contentText, customImage, dismissText, userResponseCueText, userResponseCueColour, userResponseCueAlignHorizontal, userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, actionButtonCommand); - } - - public BasicNotificationWithUserResponseWrappedLabel(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - int seconds, Image customImage = null, - string dismissText = "&Dismiss", string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - customImage, dismissText, userResponseCueText, - userResponseCueColour, userResponseCueAlignHorizontal, - userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, - actionButtonCommand) => Seconds = seconds; - - public BasicNotificationWithUserResponseWrappedLabel(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - int seconds, string soundPath, Image customImage = null, - string dismissText = "&Dismiss", string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - seconds, customImage, dismissText, userResponseCueText, - userResponseCueColour, userResponseCueAlignHorizontal, - userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, - actionButtonCommand) => SoundPath = soundPath; - - public BasicNotificationWithUserResponseWrappedLabel(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - Stream soundStream, Image customImage = null, - string dismissText = "&Dismiss", string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - customImage, dismissText, userResponseCueText, - userResponseCueColour, userResponseCueAlignHorizontal, - userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, - actionButtonCommand) => SoundStream = soundStream; - - public BasicNotificationWithUserResponseWrappedLabel(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - int seconds, Stream soundStream, Image customImage = null, - string dismissText = "&Dismiss", string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - seconds, customImage, dismissText, userResponseCueText, - userResponseCueColour, userResponseCueAlignHorizontal, - userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, - actionButtonCommand) => SoundStream = soundStream; - #endregion - - #region Event Handlers - private void BasicNotificationWithUserResponseWrappedLabel_Load(object sender, EventArgs e) => SetupBaseUI(RightToLeftSupport); - - private void BasicNotificationWithUserResponseWrappedLabel_GotFocus(object sender, EventArgs e) - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Focus(); - } - else - { - kbtnToastButton1.Focus(); - } - - if (_timer != null) - { - _timer.Stop(); - } - } - - private void BasicNotificationWithUserResponseWrappedLabel_LostFocus(object sender, EventArgs e) - { - if (_timer != null) - { - _timer.Start(); - } - } - - private void BasicNotificationWithUserResponseWrappedLabel_Resize(object sender, EventArgs e) - { - if (WindowState == FormWindowState.Maximized) - { - WindowState = FormWindowState.Normal; - } - } - - private void kbtnDismiss_Click(object sender, EventArgs e) => UtilityMethods.FadeOutAndClose(this); - #endregion - - #region Methods - private void SetupTextArea() - { - if (_useNativeBackColourInUserResponseArea) - { - ktxtUserResponse.InputControlStyle = InputControlStyle.Standalone; - } - else - { - if (kpnlContent.PanelBackStyle == PaletteBackStyle.PanelClient) - { - ktxtUserResponse.InputControlStyle = InputControlStyle.PanelClient; - } - else if (kpnlContent.PanelBackStyle == PaletteBackStyle.PanelAlternate) - { - ktxtUserResponse.InputControlStyle = InputControlStyle.PanelAlternate; - } - else - { - ktxtUserResponse.InputControlStyle = InputControlStyle.Standalone; - } - } - } - - public new void Show() - { - Opacity = 0; - - UtilityMethods.SetIconType(IconType, CustomImage, pbxToastImage); - - kwlTitle.Text = Title; - - kwlContent.Text = ContentText; - - ktxtUserResponse.CueHint.CueHintText = UserResponsePrompt; - - ktxtUserResponse.CueHint.Color1 = UserResponsePromptColour; - - ktxtUserResponse.CueHint.Font = UserResponsePromptFont; - - ktxtUserResponse.CueHint.TextH = UserResponsePromptAlignHorizontal; - - ktxtUserResponse.CueHint.TextV = UserResponsePromptAlignVertical; - - if (Seconds != 0) - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time})"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time})"; - } - - _timer = new Timer(); - - _timer.Interval = 1000; - - _timer.Tick += (sender, e) => - { - _time++; - - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time}s)"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time}s)"; - } - - if (_time == Seconds) - { - _timer.Stop(); - - UtilityMethods.FadeOutAndClose(this); - } - }; - - MouseEnter += (sender, e) => { _timer.Enabled = false; }; - - MouseLeave += (sender, e) => { _timer.Enabled = true; }; - } - - if (SoundPath != null) - { - _soundPlayer = new SoundPlayer(SoundPath); - } - else - { - _soundPlayer = null; - } - - if (SoundStream != null) - { - _soundPlayer = new SoundPlayer(SoundStream); - } - else - { - _soundPlayer = null; - } - - base.Show(); - } - - public new DialogResult ShowDialog() - { - Opacity = 0; - - UtilityMethods.SetIconType(IconType, CustomImage, pbxToastImage); - - kwlTitle.Text = Title; - - kwlContent.Text = ContentText; - - ktxtUserResponse.CueHint.CueHintText = UserResponsePrompt; - - ktxtUserResponse.CueHint.Color1 = UserResponsePromptColour; - - ktxtUserResponse.CueHint.Font = UserResponsePromptFont; - - ktxtUserResponse.CueHint.TextH = UserResponsePromptAlignHorizontal; - - ktxtUserResponse.CueHint.TextV = UserResponsePromptAlignVertical; - - if (Seconds != 0) - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time})"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time})"; - } - - _timer = new Timer(); - - _timer.Interval = 1000; - - _timer.Tick += (sender, e) => - { - _time++; - - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time}s)"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time}s)"; - } - - if (_time == Seconds) - { - _timer.Stop(); - - UtilityMethods.FadeOutAndClose(this); - } - }; - } - - if (SoundPath != null) - { - _soundPlayer = new SoundPlayer(SoundPath); - } - else - { - _soundPlayer = null; - } - - if (SoundStream != null) - { - _soundPlayer = new SoundPlayer(SoundStream); - } - else - { - _soundPlayer = null; - } - - return base.ShowDialog(); - } - - public string GetUserResponse() => ktxtUserResponse.Text; - - private void SetupUI(ActionButtonLocation? actionButtonLocation, ActionType? actionType, IconType iconType, - string title, string contentText, Image customImage, string dismissText, string userResponseCueText, - Color? userResponseCueColour, PaletteRelativeAlign? userResponseCueAlignHorizontal, - PaletteRelativeAlign? userResponseCueAlignVertical, Font userResponseCueFont, - RightToLeftSupport? rightToLeftSupport, KryptonCommand actionButtonCommand) - { - ActionButtonLocation = actionButtonLocation ?? ActionButtonLocation.Left; - - ActionType = actionType ?? ActionType.Default; - - IconType = iconType; - - Title = title; - - ContentText = contentText; - - CustomImage = customImage; - - DismissText = dismissText; - - UserResponsePrompt = userResponseCueText; - - UserResponsePromptColour = userResponseCueColour ?? Color.Empty; - - UserResponsePromptAlignHorizontal = userResponseCueAlignHorizontal ?? PaletteRelativeAlign.Near; - - UserResponsePromptAlignVertical = userResponseCueAlignVertical ?? PaletteRelativeAlign.Near; - - UserResponsePromptFont = userResponseCueFont; - - RightToLeftSupport = rightToLeftSupport ?? RightToLeftSupport.LeftToRight; - - ActionButtonCommand = actionButtonCommand; - - TopMost = true; - - Resize += BasicNotificationWithUserResponseWrappedLabel_Resize; - - GotFocus += BasicNotificationWithUserResponseWrappedLabel_GotFocus; - - LostFocus += BasicNotificationWithUserResponseWrappedLabel_LostFocus; - - DoubleBuffered = true; - - RearrangeUI(rightToLeftSupport); - } - - private void SetupBaseUI(RightToLeftSupport rightToLeft) - { - //Once loaded, position the form to the bottom left of the screen with added padding - Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - Width - 5, - Screen.PrimaryScreen.WorkingArea.Height - Height - 5); - - UtilityMethods.FadeIn(this); - - if (_timer != null) - { - _timer.Start(); - } - - if (_soundPlayer != null) - { - _soundPlayer.Play(); - } - - if (rightToLeft == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = _dismissText; - } - else - { - kbtnToastButton1.Text = _dismissText; - } - } - private void RearrangeUI(RightToLeftSupport? rightToLeft) - { - switch (rightToLeft) - { - case RightToLeftSupport.Inherit: - // Note: Come back to this - break; - case RightToLeftSupport.LeftToRight: - UtilityMethods.CalibrateUILayout(this, new Control[] { ktbActionButton1, ktbActionButton2, ktbActionButton3, kwlTitle, kwlContent, ktxtUserResponse }, RightToLeft.No); - - RightToLeftLayout = false; - - pbxToastImage.Location = new Point(12, 12); - - kwlTitle.Location = new Point(146, 12); - - kwlContent.Location = new Point(146, 90); - - ktxtUserResponse.Location = new Point(146, 247); - break; - case RightToLeftSupport.RightToLeft: - UtilityMethods.CalibrateUILayout(this, new Control[] { ktbActionButton1, ktbActionButton2, ktbActionButton3, kwlTitle, kwlContent, ktxtUserResponse }, RightToLeft.Yes); - - RightToLeftLayout = true; - - pbxToastImage.Location = new Point(469, 12); - - kwlTitle.Location = new Point(12, 12); - - kwlContent.Location = new Point(12, 90); - - ktxtUserResponse.Location = new Point(12, 247); - break; - } - } - - /// Setups the action button. - /// if set to true [show action button]. - /// The action button location. - private void SetupActionButton(bool? showActionButton, ActionButtonLocation? actionButtonLocation) - { - if (showActionButton != null) - { - if (_rightToLeft == RightToLeftSupport.LeftToRight) - { - if (actionButtonLocation == ActionButtonLocation.Left) - { - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - else - { - kbtnToastButtonPanel2.Visible = true; - - ktbActionButton2.Visible = true; - } - } - else if (_rightToLeft == RightToLeftSupport.RightToLeft) - { - if (actionButtonLocation == ActionButtonLocation.Right) - { - tlpButtons.ColumnStyles[0].SizeType = SizeType.Percent; - - tlpButtons.ColumnStyles[0].Width = 100F; - - tlpButtons.ColumnStyles[2].SizeType = SizeType.AutoSize; - - kbtnToastButtonPanel3.Visible = true; - - ktbActionButton3.Visible = true; - } - else - { - tlpButtons.ColumnStyles[0].SizeType = SizeType.Percent; - - tlpButtons.ColumnStyles[0].Width = 100F; - - tlpButtons.ColumnStyles[2].SizeType = SizeType.AutoSize; - - kbtnToastButtonPanel3.Visible = false; - - ktbActionButton3.Visible = false; - - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - } - } - else - { - if (_rightToLeft == RightToLeftSupport.LeftToRight) - { - kbtnToastButtonPanel1.Visible = false; - - kbtnToastButtonPanel2.Visible = false; - } - else if (_rightToLeft == RightToLeftSupport.RightToLeft) - { - kbtnToastButtonPanel2.Visible = false; - - kbtnToastButtonPanel3.Visible = false; - - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - } - } - - #endregion - - #region Overrides - protected override bool ShowWithoutActivation => true; - #endregion - } -} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/Wrapped Label/BasicNotificationWithUserResponseWrappedLabel.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/Wrapped Label/BasicNotificationWithUserResponseWrappedLabel.resx deleted file mode 100644 index 23731e0ef..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/Wrapped Label/BasicNotificationWithUserResponseWrappedLabel.resx +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - - iVBORw0KGgoAAAANSUhEUgAAAmEAAAAyCAYAAAAUcAw7AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFQSURBVHhe7dmxDQNBCARAt3vNuQi34WLeeqR3RAqbTDA6 - 7dHACl7nnOv2/nzrlWVZlmVZludzlbD7AwCAHVXCugEAALNswgAAljlHAgAEKGEAAAFVwroBAACzbMIA - AJY5RwIABChhAAABVcK6AQAAs2zCAACWOUcCAAQoYQAAAVXCugEAALNswgAAljlHAgAEKGEAAAFVwroB - AACzbMIAAJY5RwIABChhAAABVcK6AQAAs2zCAACWOUcCAAQoYQAAAVXCugEAALNswgAAljlHAgAEKGEA - AAFVwroBAACzbMIAAJY5RwIABChhAAABVcK6AQAAs2zCAACWOUcCAAQoYQAAAVXCugEAALNswgAAljlH - AgAEKGEAAAFVwroBAACzbMIAAJY5RwIABChhAAABVcK6AQAAs2zCAACWOUcCAAT8S9jj+ZRlWZZlWZYn - 87l+YA83ApLrx/sAAAAASUVORK5CYII= - - - \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/Wrapped Label/BasicNotificationWithUserResponseWrappedLabelAndProgressBar.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/Wrapped Label/BasicNotificationWithUserResponseWrappedLabelAndProgressBar.Designer.cs deleted file mode 100644 index 40fe4dd01..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/Wrapped Label/BasicNotificationWithUserResponseWrappedLabelAndProgressBar.Designer.cs +++ /dev/null @@ -1,408 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast.UX -{ - partial class BasicNotificationWithUserResponseWrappedLabelAndProgressBar - { - /// - /// 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(BasicNotificationWithUserResponseWrappedLabelAndProgressBar)); - this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.kpnlContent = new Krypton.Toolkit.KryptonPanel(); - this.pbProgress = new Krypton.Toolkit.KryptonProgressBar(); - this.kwlContent = new Krypton.Toolkit.KryptonWrapLabel(); - this.ktxtUserResponse = new Krypton.Toolkit.KryptonTextBox(); - this.kwlTitle = new Krypton.Toolkit.KryptonWrapLabel(); - this.pbxToastImage = new System.Windows.Forms.PictureBox(); - this.tlpButtons = new Krypton.Toolkit.KryptonTableLayoutPanel(); - this.kbtnToastButtonPanel3 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton3 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton3 = new Krypton.Toolkit.KryptonButton(); - this.kbtnToastButtonPanel2 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton2 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton2 = new Krypton.Toolkit.KryptonButton(); - this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel(); - this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); - this.kbtnToastButtonPanel1 = new Krypton.Toolkit.KryptonPanel(); - this.ktbActionButton1 = new Krypton.Toolkit.Suite.Extended.Toast.KryptonToastButton(); - this.kbtnToastButton1 = new Krypton.Toolkit.KryptonButton(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); - this.kryptonPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).BeginInit(); - this.kpnlContent.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbxToastImage)).BeginInit(); - this.tlpButtons.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel3)).BeginInit(); - this.kbtnToastButtonPanel3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel2)).BeginInit(); - this.kbtnToastButtonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); - this.kryptonPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel1)).BeginInit(); - this.kbtnToastButtonPanel1.SuspendLayout(); - this.SuspendLayout(); - // - // kryptonPanel1 - // - this.kryptonPanel1.Controls.Add(this.tlpButtons); - this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.kryptonPanel1.Location = new System.Drawing.Point(0, 282); - this.kryptonPanel1.Name = "kryptonPanel1"; - this.kryptonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel1.Size = new System.Drawing.Size(609, 50); - this.kryptonPanel1.TabIndex = 5; - // - // kpnlContent - // - this.kpnlContent.Controls.Add(this.pbProgress); - this.kpnlContent.Controls.Add(this.kwlContent); - this.kpnlContent.Controls.Add(this.ktxtUserResponse); - this.kpnlContent.Controls.Add(this.kwlTitle); - this.kpnlContent.Controls.Add(this.pbxToastImage); - this.kpnlContent.Dock = System.Windows.Forms.DockStyle.Fill; - this.kpnlContent.Location = new System.Drawing.Point(0, 0); - this.kpnlContent.Name = "kpnlContent"; - this.kpnlContent.Size = new System.Drawing.Size(609, 282); - this.kpnlContent.TabIndex = 6; - // - // pbProgress - // - this.pbProgress.Dock = System.Windows.Forms.DockStyle.Bottom; - this.pbProgress.Location = new System.Drawing.Point(0, 277); - this.pbProgress.Name = "pbProgress"; - this.pbProgress.Size = new System.Drawing.Size(609, 5); - this.pbProgress.TabIndex = 5; - // - // kwlContent - // - this.kwlContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.kwlContent.AutoSize = false; - this.kwlContent.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlContent.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); - this.kwlContent.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl; - this.kwlContent.Location = new System.Drawing.Point(146, 115); - this.kwlContent.Name = "kwlContent"; - this.kwlContent.Size = new System.Drawing.Size(451, 116); - this.kwlContent.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlContent.Text = "{0}"; - this.kwlContent.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // ktxtUserResponse - // - this.ktxtUserResponse.Location = new System.Drawing.Point(146, 247); - this.ktxtUserResponse.Name = "ktxtUserResponse"; - this.ktxtUserResponse.Size = new System.Drawing.Size(451, 23); - this.ktxtUserResponse.TabIndex = 3; - // - // kwlTitle - // - this.kwlTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.kwlTitle.AutoSize = false; - this.kwlTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); - this.kwlTitle.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl; - this.kwlTitle.Location = new System.Drawing.Point(146, 12); - this.kwlTitle.Name = "kwlTitle"; - this.kwlTitle.Size = new System.Drawing.Size(451, 87); - this.kwlTitle.StateCommon.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.kwlTitle.Text = "{0}"; - this.kwlTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // pbxToastImage - // - this.pbxToastImage.BackColor = System.Drawing.Color.Transparent; - this.pbxToastImage.Location = new System.Drawing.Point(12, 12); - this.pbxToastImage.Name = "pbxToastImage"; - this.pbxToastImage.Size = new System.Drawing.Size(128, 128); - this.pbxToastImage.TabIndex = 1; - this.pbxToastImage.TabStop = false; - // - // tlpButtons - // - this.tlpButtons.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tlpButtons.BackgroundImage"))); - this.tlpButtons.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.tlpButtons.ColumnCount = 3; - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpButtons.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel3, 2, 1); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel2, 1, 1); - this.tlpButtons.Controls.Add(this.kryptonPanel2, 0, 0); - this.tlpButtons.Controls.Add(this.kbtnToastButtonPanel1, 0, 1); - this.tlpButtons.Dock = System.Windows.Forms.DockStyle.Fill; - this.tlpButtons.Location = new System.Drawing.Point(0, 0); - this.tlpButtons.Name = "tlpButtons"; - this.tlpButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.tlpButtons.RowCount = 2; - this.tlpButtons.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tlpButtons.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpButtons.Size = new System.Drawing.Size(609, 50); - this.tlpButtons.TabIndex = 2; - // - // kbtnToastButtonPanel3 - // - this.kbtnToastButtonPanel3.Controls.Add(this.ktbActionButton3); - this.kbtnToastButtonPanel3.Controls.Add(this.kbtnToastButton3); - this.kbtnToastButtonPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel3.Location = new System.Drawing.Point(79, 10); - this.kbtnToastButtonPanel3.Name = "kbtnToastButtonPanel3"; - this.kbtnToastButtonPanel3.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel3.Size = new System.Drawing.Size(527, 37); - this.kbtnToastButtonPanel3.TabIndex = 3; - // - // ktbActionButton3 - // - this.ktbActionButton3.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton3.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton3.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton3.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton3.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ktbActionButton3.AutoSize = true; - this.ktbActionButton3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton3.CornerRoundingRadius = -1F; - this.ktbActionButton3.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton3.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton3.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton3.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton3.Location = new System.Drawing.Point(488, 6); - this.ktbActionButton3.Name = "ktbActionButton3"; - this.ktbActionButton3.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton3.TabIndex = 2; - this.ktbActionButton3.Values.Text = "AB3"; - // - // kbtnToastButton3 - // - this.kbtnToastButton3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnToastButton3.AutoSize = true; - this.kbtnToastButton3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton3.CornerRoundingRadius = -1F; - this.kbtnToastButton3.Location = new System.Drawing.Point(496, 6); - this.kbtnToastButton3.Name = "kbtnToastButton3"; - this.kbtnToastButton3.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton3.TabIndex = 0; - this.kbtnToastButton3.Values.Text = "B3"; - // - // kbtnToastButtonPanel2 - // - this.kbtnToastButtonPanel2.Controls.Add(this.ktbActionButton2); - this.kbtnToastButtonPanel2.Controls.Add(this.kbtnToastButton2); - this.kbtnToastButtonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel2.Location = new System.Drawing.Point(59, 10); - this.kbtnToastButtonPanel2.Name = "kbtnToastButtonPanel2"; - this.kbtnToastButtonPanel2.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel2.Size = new System.Drawing.Size(14, 37); - this.kbtnToastButtonPanel2.TabIndex = 2; - // - // ktbActionButton2 - // - this.ktbActionButton2.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton2.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton2.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton2.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton2.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ktbActionButton2.AutoSize = true; - this.ktbActionButton2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton2.CornerRoundingRadius = -1F; - this.ktbActionButton2.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton2.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton2.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton2.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton2.Location = new System.Drawing.Point(-20, 6); - this.ktbActionButton2.Name = "ktbActionButton2"; - this.ktbActionButton2.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton2.TabIndex = 2; - this.ktbActionButton2.Values.Text = "AB2"; - // - // kbtnToastButton2 - // - this.kbtnToastButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.kbtnToastButton2.AutoSize = true; - this.kbtnToastButton2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton2.CornerRoundingRadius = -1F; - this.kbtnToastButton2.Location = new System.Drawing.Point(-11, 6); - this.kbtnToastButton2.Name = "kbtnToastButton2"; - this.kbtnToastButton2.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton2.TabIndex = 0; - this.kbtnToastButton2.Values.Text = "B2"; - // - // kryptonPanel2 - // - this.tlpButtons.SetColumnSpan(this.kryptonPanel2, 3); - this.kryptonPanel2.Controls.Add(this.kryptonBorderEdge1); - this.kryptonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.kryptonPanel2.Location = new System.Drawing.Point(3, 3); - this.kryptonPanel2.Name = "kryptonPanel2"; - this.kryptonPanel2.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kryptonPanel2.Size = new System.Drawing.Size(603, 1); - this.kryptonPanel2.TabIndex = 0; - // - // 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(603, 1); - this.kryptonBorderEdge1.Text = "kryptonBorderEdge1"; - // - // kbtnToastButtonPanel1 - // - this.kbtnToastButtonPanel1.Controls.Add(this.ktbActionButton1); - this.kbtnToastButtonPanel1.Controls.Add(this.kbtnToastButton1); - this.kbtnToastButtonPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.kbtnToastButtonPanel1.Location = new System.Drawing.Point(3, 10); - this.kbtnToastButtonPanel1.Name = "kbtnToastButtonPanel1"; - this.kbtnToastButtonPanel1.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; - this.kbtnToastButtonPanel1.Size = new System.Drawing.Size(50, 37); - this.kbtnToastButtonPanel1.TabIndex = 1; - this.kbtnToastButtonPanel1.Visible = false; - // - // ktbActionButton1 - // - this.ktbActionButton1.AcceptButtonBackColour1 = System.Drawing.Color.Green; - this.ktbActionButton1.AcceptButtonBackColour2 = System.Drawing.Color.Green; - this.ktbActionButton1.AcceptButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton1.AcceptButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton1.ActionType = Krypton.Toolkit.Suite.Extended.Toast.ActionType.Default; - this.ktbActionButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.ktbActionButton1.AutoSize = true; - this.ktbActionButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ktbActionButton1.CornerRoundingRadius = -1F; - this.ktbActionButton1.DenyButtonBackColour1 = System.Drawing.Color.Red; - this.ktbActionButton1.DenyButtonBackColour2 = System.Drawing.Color.Red; - this.ktbActionButton1.DenyButtonTextColour1 = System.Drawing.Color.Empty; - this.ktbActionButton1.DenyButtonTextColour2 = System.Drawing.Color.Empty; - this.ktbActionButton1.Location = new System.Drawing.Point(9, 6); - this.ktbActionButton1.Name = "ktbActionButton1"; - this.ktbActionButton1.Size = new System.Drawing.Size(30, 22); - this.ktbActionButton1.TabIndex = 1; - this.ktbActionButton1.Values.Text = "AB1"; - // - // kbtnToastButton1 - // - this.kbtnToastButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.kbtnToastButton1.AutoSize = true; - this.kbtnToastButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.kbtnToastButton1.CornerRoundingRadius = -1F; - this.kbtnToastButton1.Location = new System.Drawing.Point(9, 6); - this.kbtnToastButton1.Name = "kbtnToastButton1"; - this.kbtnToastButton1.Size = new System.Drawing.Size(22, 22); - this.kbtnToastButton1.TabIndex = 0; - this.kbtnToastButton1.Values.Text = "B1"; - // - // BasicNotificationWithUserResponseWrappedLabelAndProgressBar - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(609, 332); - this.Controls.Add(this.kpnlContent); - this.Controls.Add(this.kryptonPanel1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "BasicNotificationWithUserResponseWrappedLabelAndProgressBar"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; - this.Load += new System.EventHandler(this.BasicNotificationWithUserResponseWrappedLabelAndProgressBar_Load); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); - this.kryptonPanel1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).EndInit(); - this.kpnlContent.ResumeLayout(false); - this.kpnlContent.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbxToastImage)).EndInit(); - this.tlpButtons.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel3)).EndInit(); - this.kbtnToastButtonPanel3.ResumeLayout(false); - this.kbtnToastButtonPanel3.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel2)).EndInit(); - this.kbtnToastButtonPanel2.ResumeLayout(false); - this.kbtnToastButtonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); - this.kryptonPanel2.ResumeLayout(false); - this.kryptonPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.kbtnToastButtonPanel1)).EndInit(); - this.kbtnToastButtonPanel1.ResumeLayout(false); - this.kbtnToastButtonPanel1.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private KryptonPanel kryptonPanel1; - private KryptonPanel kpnlContent; - private KryptonProgressBar pbProgress; - private KryptonWrapLabel kwlContent; - private KryptonTextBox ktxtUserResponse; - private KryptonWrapLabel kwlTitle; - private PictureBox pbxToastImage; - private KryptonTableLayoutPanel tlpButtons; - private KryptonPanel kbtnToastButtonPanel3; - private KryptonToastButton ktbActionButton3; - private KryptonButton kbtnToastButton3; - private KryptonPanel kbtnToastButtonPanel2; - private KryptonToastButton ktbActionButton2; - private KryptonButton kbtnToastButton2; - private KryptonPanel kryptonPanel2; - private KryptonBorderEdge kryptonBorderEdge1; - private KryptonPanel kbtnToastButtonPanel1; - private KryptonToastButton ktbActionButton1; - private KryptonButton kbtnToastButton1; - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/Wrapped Label/BasicNotificationWithUserResponseWrappedLabelAndProgressBar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/Wrapped Label/BasicNotificationWithUserResponseWrappedLabelAndProgressBar.cs deleted file mode 100644 index 377f0b958..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/Wrapped Label/BasicNotificationWithUserResponseWrappedLabelAndProgressBar.cs +++ /dev/null @@ -1,694 +0,0 @@ -#region MIT License -/* - * MIT License - * - * Copyright (c) 2017 - 2023 Krypton Suite - * - * 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 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * 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. - * - */ -#endregion - -namespace Krypton.Toolkit.Suite.Extended.Toast.UX -{ - public partial class BasicNotificationWithUserResponseWrappedLabelAndProgressBar : KryptonForm - { - #region Variables - - private ActionButtonLocation _actionButtonLocation; - - private ActionType _actionType; - - private bool _useNativeBackColourInUserResponseArea, _showCloseButton; - - private Color _userResponsePromptColour; - - private PaletteRelativeAlign _userResponsePromptAlignHorizontal, _userResponsePromptAlignVertical; - - private Font _userResponsePromptFont; - - private IconType _iconType; - - private int _time, _seconds; - - private Timer _timer; - - private SoundPlayer _soundPlayer; - - private string _title, _contentText, _soundPath, _dismissText, _userResponsePrompt; - - private Stream _soundStream; - - private Image _customImage; - - private RightToLeftSupport _rightToLeft; - - private KryptonCommand _actionButtonCommand; - - #endregion - - #region Properties - - public ActionButtonLocation ActionButtonLocation { get => _actionButtonLocation; set => _actionButtonLocation = value; } - - public ActionType ActionType { get => _actionType; set => _actionType = value; } - - public bool ShowCloseButton { get => _showCloseButton; set => _showCloseButton = value; } - - public Color UserResponsePromptColour { get => _userResponsePromptColour; set => _userResponsePromptColour = value; } - - public PaletteRelativeAlign UserResponsePromptAlignHorizontal { get => _userResponsePromptAlignHorizontal; set => _userResponsePromptAlignHorizontal = value; } - - public PaletteRelativeAlign UserResponsePromptAlignVertical { get => _userResponsePromptAlignVertical; set => _userResponsePromptAlignVertical = value; } - - public Font UserResponsePromptFont { get => _userResponsePromptFont; set => _userResponsePromptFont = value; } - - public IconType IconType { get => _iconType; set => _iconType = value; } - - public int Time { get => _time; set => _time = value; } - - public int Seconds { get => _seconds; set => _seconds = value; } - - public string Title { get => _title; set => _title = value; } - - public string ContentText { get => _contentText; set => _contentText = value; } - - public string SoundPath { get => _soundPath; set => _soundPath = value; } - - public string DismissText { get => _dismissText; set => _dismissText = value; } - - public string UserResponsePrompt { get => _userResponsePrompt; set => _userResponsePrompt = value; } - - public Stream SoundStream { get => _soundStream; set => _soundStream = value; } - - public Image CustomImage { get => _customImage; set => _customImage = value; } - - public RightToLeftSupport RightToLeftSupport { get => _rightToLeft; set { _rightToLeft = value; Invalidate(); } } - - public KryptonCommand ActionButtonCommand { get => _actionButtonCommand; set => _actionButtonCommand = value; } - - #endregion - - #region Identity - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The custom image. - /// The dismiss text. - /// The user response cue text. - /// The user response cue colour. - /// The user response cue align horizontal. - /// The user response cue align vertical. - /// The user response cue font. - /// The right to left support. - /// The action button command. - public BasicNotificationWithUserResponseWrappedLabelAndProgressBar(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - Image customImage = null, - string dismissText = "&Dismiss", string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - { - InitializeComponent(); - - SetupUI(actionButtonLocation, actionType, iconType, title, contentText, customImage, dismissText, userResponseCueText, userResponseCueColour, userResponseCueAlignHorizontal, userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, actionButtonCommand); - } - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The seconds. - /// The custom image. - /// The dismiss text. - /// The user response cue text. - /// The user response cue colour. - /// The user response cue align horizontal. - /// The user response cue align vertical. - /// The user response cue font. - /// The right to left support. - /// The action button command. - public BasicNotificationWithUserResponseWrappedLabelAndProgressBar(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - int seconds, Image customImage = null, - string dismissText = "&Dismiss", string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - customImage, dismissText, userResponseCueText, - userResponseCueColour, userResponseCueAlignHorizontal, - userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, - actionButtonCommand) => Seconds = seconds; - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The seconds. - /// The sound path. - /// The custom image. - /// The dismiss text. - /// The user response cue text. - /// The user response cue colour. - /// The user response cue align horizontal. - /// The user response cue align vertical. - /// The user response cue font. - /// The right to left support. - /// The action button command. - public BasicNotificationWithUserResponseWrappedLabelAndProgressBar(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - int seconds, string soundPath, Image customImage = null, - string dismissText = "&Dismiss", string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - seconds, customImage, dismissText, userResponseCueText, - userResponseCueColour, userResponseCueAlignHorizontal, - userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, - actionButtonCommand) => SoundPath = soundPath; - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The sound stream. - /// The custom image. - /// The dismiss text. - /// The user response cue text. - /// The user response cue colour. - /// The user response cue align horizontal. - /// The user response cue align vertical. - /// The user response cue font. - /// The right to left support. - /// The action button command. - public BasicNotificationWithUserResponseWrappedLabelAndProgressBar(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - Stream soundStream, Image customImage = null, - string dismissText = "&Dismiss", string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - customImage, dismissText, userResponseCueText, - userResponseCueColour, userResponseCueAlignHorizontal, - userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, - actionButtonCommand) => SoundStream = soundStream; - - /// Initializes a new instance of the class. - /// The action button location. - /// Type of the action. - /// Type of the icon. - /// The title. - /// The content text. - /// The seconds. - /// The sound stream. - /// The custom image. - /// The dismiss text. - /// The user response cue text. - /// The user response cue colour. - /// The user response cue align horizontal. - /// The user response cue align vertical. - /// The user response cue font. - /// The right to left support. - /// The action button command. - public BasicNotificationWithUserResponseWrappedLabelAndProgressBar(ActionButtonLocation? actionButtonLocation, ActionType? actionType, - IconType iconType, string title, string contentText, - int seconds, Stream soundStream, Image customImage = null, - string dismissText = "&Dismiss", string userResponseCueText = "", - Color? userResponseCueColour = null, - PaletteRelativeAlign? userResponseCueAlignHorizontal = null, - PaletteRelativeAlign? userResponseCueAlignVertical = null, - Font userResponseCueFont = null, - RightToLeftSupport? rightToLeftSupport = RightToLeftSupport.LeftToRight, - KryptonCommand actionButtonCommand = null) - : this(actionButtonLocation, actionType, iconType, title, contentText, - seconds, customImage, dismissText, userResponseCueText, - userResponseCueColour, userResponseCueAlignHorizontal, - userResponseCueAlignVertical, userResponseCueFont, rightToLeftSupport, - actionButtonCommand) => SoundStream = soundStream; - - #endregion - - #region Event Handlers - private void BasicNotificationWithUserResponseWrappedLabelAndProgressBar_Load(object sender, EventArgs e) => SetupBaseUI(RightToLeftSupport); - - private void BasicNotificationWithUserResponseWrappedLabelAndProgressBar_GotFocus(object sender, EventArgs e) - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Focus(); - } - else - { - kbtnToastButton1.Focus(); - } - - if (_timer != null) - { - _timer.Stop(); - } - } - - private void BasicNotificationWithUserResponseWrappedLabelAndProgressBar_LostFocus(object sender, EventArgs e) - { - if (_timer != null) - { - _timer.Start(); - } - } - - private void BasicNotificationWithUserResponseWrappedLabelAndProgressBar_Resize(object sender, EventArgs e) - { - if (WindowState == FormWindowState.Maximized) - { - WindowState = FormWindowState.Normal; - } - } - - private void Dismiss_Click(object sender, EventArgs e) => UtilityMethods.FadeOutAndClose(this); - #endregion - - #region Methods - private void SetupTextArea() - { - if (_useNativeBackColourInUserResponseArea) - { - ktxtUserResponse.InputControlStyle = InputControlStyle.Standalone; - } - else - { - if (kpnlContent.PanelBackStyle == PaletteBackStyle.PanelClient) - { - ktxtUserResponse.InputControlStyle = InputControlStyle.PanelClient; - } - else if (kpnlContent.PanelBackStyle == PaletteBackStyle.PanelAlternate) - { - ktxtUserResponse.InputControlStyle = InputControlStyle.PanelAlternate; - } - else - { - ktxtUserResponse.InputControlStyle = InputControlStyle.Standalone; - } - } - } - - public new void Show() - { - Opacity = 0; - - UtilityMethods.SetIconType(IconType, CustomImage, pbxToastImage); - - kwlTitle.Text = Title; - - kwlContent.Text = ContentText; - - ktxtUserResponse.CueHint.CueHintText = UserResponsePrompt; - - ktxtUserResponse.CueHint.Color1 = UserResponsePromptColour; - - ktxtUserResponse.CueHint.Font = UserResponsePromptFont; - - ktxtUserResponse.CueHint.TextH = UserResponsePromptAlignHorizontal; - - ktxtUserResponse.CueHint.TextV = UserResponsePromptAlignVertical; - - if (Seconds != 0) - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time})"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time})"; - } - - _timer = new Timer(); - - _timer.Interval = 1000; - - _timer.Tick += (sender, e) => - { - _time++; - - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time}s)"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time}s)"; - } - - if (_time == Seconds) - { - _timer.Stop(); - - UtilityMethods.FadeOutAndClose(this); - } - }; - - MouseEnter += (sender, e) => { _timer.Enabled = false; }; - - MouseLeave += (sender, e) => { _timer.Enabled = true; }; - } - - if (SoundPath != null) - { - _soundPlayer = new SoundPlayer(SoundPath); - } - else - { - _soundPlayer = null; - } - - if (SoundStream != null) - { - _soundPlayer = new SoundPlayer(SoundStream); - } - else - { - _soundPlayer = null; - } - - base.Show(); - } - - public new DialogResult ShowDialog() - { - Opacity = 0; - - UtilityMethods.SetIconType(IconType, CustomImage, pbxToastImage); - - kwlTitle.Text = Title; - - kwlContent.Text = ContentText; - - ktxtUserResponse.CueHint.CueHintText = UserResponsePrompt; - - ktxtUserResponse.CueHint.Color1 = UserResponsePromptColour; - - ktxtUserResponse.CueHint.Font = UserResponsePromptFont; - - ktxtUserResponse.CueHint.TextH = UserResponsePromptAlignHorizontal; - - ktxtUserResponse.CueHint.TextV = UserResponsePromptAlignVertical; - - if (Seconds != 0) - { - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time})"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time})"; - } - - _timer = new Timer(); - - _timer.Interval = 1000; - - _timer.Tick += (sender, e) => - { - _time++; - - if (RightToLeftSupport == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = $"{DismissText} ({Seconds - Time}s)"; - } - else - { - kbtnToastButton1.Text = $"{DismissText} ({Seconds - Time}s)"; - } - - if (_time == Seconds) - { - _timer.Stop(); - - UtilityMethods.FadeOutAndClose(this); - } - }; - } - - if (SoundPath != null) - { - _soundPlayer = new SoundPlayer(SoundPath); - } - else - { - _soundPlayer = null; - } - - if (SoundStream != null) - { - _soundPlayer = new SoundPlayer(SoundStream); - } - else - { - _soundPlayer = null; - } - - return base.ShowDialog(); - } - - public string GetUserResponse() => ktxtUserResponse.Text; - - private void SetupUI(ActionButtonLocation? actionButtonLocation, ActionType? actionType, IconType iconType, - string title, string contentText, Image customImage, string dismissText, string userResponseCueText, - Color? userResponseCueColour, PaletteRelativeAlign? userResponseCueAlignHorizontal, - PaletteRelativeAlign? userResponseCueAlignVertical, Font userResponseCueFont, - RightToLeftSupport? rightToLeftSupport, KryptonCommand actionButtonCommand) - { - ActionButtonLocation = actionButtonLocation ?? ActionButtonLocation.Left; - - ActionType = actionType ?? ActionType.Default; - - IconType = iconType; - - Title = title; - - ContentText = contentText; - - CustomImage = customImage; - - DismissText = dismissText; - - UserResponsePrompt = userResponseCueText; - - UserResponsePromptColour = userResponseCueColour ?? Color.Empty; - - UserResponsePromptAlignHorizontal = userResponseCueAlignHorizontal ?? PaletteRelativeAlign.Near; - - UserResponsePromptAlignVertical = userResponseCueAlignVertical ?? PaletteRelativeAlign.Near; - - UserResponsePromptFont = userResponseCueFont; - - RightToLeftSupport = rightToLeftSupport ?? RightToLeftSupport.LeftToRight; - - ActionButtonCommand = actionButtonCommand; - - TopMost = true; - - Resize += BasicNotificationWithUserResponseWrappedLabelAndProgressBar_Resize; - - GotFocus += BasicNotificationWithUserResponseWrappedLabelAndProgressBar_GotFocus; - - LostFocus += BasicNotificationWithUserResponseWrappedLabelAndProgressBar_LostFocus; - - DoubleBuffered = true; - - RearrangeUI(rightToLeftSupport); - } - - private void SetupBaseUI(RightToLeftSupport rightToLeft) - { - //Once loaded, position the form to the bottom left of the screen with added padding - Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - Width - 5, - Screen.PrimaryScreen.WorkingArea.Height - Height - 5); - - UtilityMethods.FadeIn(this); - - if (_timer != null) - { - _timer.Start(); - } - - if (_soundPlayer != null) - { - _soundPlayer.Play(); - } - - if (rightToLeft == RightToLeftSupport.LeftToRight) - { - kbtnToastButton3.Text = _dismissText; - } - else - { - kbtnToastButton1.Text = _dismissText; - } - } - private void RearrangeUI(RightToLeftSupport? rightToLeft) - { - switch (rightToLeft) - { - case RightToLeftSupport.Inherit: - // Note: Come back to this - break; - case RightToLeftSupport.LeftToRight: - UtilityMethods.CalibrateUILayout(this, new Control[] { ktbActionButton1, ktbActionButton2, ktbActionButton3, kwlTitle, kwlContent, ktxtUserResponse }, RightToLeft.No); - - RightToLeftLayout = false; - - pbxToastImage.Location = new Point(12, 12); - - kwlTitle.Location = new Point(146, 12); - - kwlContent.Location = new Point(146, 90); - - ktxtUserResponse.Location = new Point(146, 247); - break; - case RightToLeftSupport.RightToLeft: - UtilityMethods.CalibrateUILayout(this, new Control[] { ktbActionButton1, ktbActionButton2, ktbActionButton3, kwlTitle, kwlContent, ktxtUserResponse }, RightToLeft.Yes); - - RightToLeftLayout = true; - - pbxToastImage.Location = new Point(469, 12); - - kwlTitle.Location = new Point(12, 12); - - kwlContent.Location = new Point(12, 90); - - ktxtUserResponse.Location = new Point(12, 247); - break; - } - } - - private void SetupProgressBar(int value) - { - pbProgress.Maximum = value; - - pbProgress.Value = value; - } - - private void ChangeProgressBarValue(int value) => pbProgress.Value = value; - - /// Setups the action button. - /// if set to true [show action button]. - /// The action button location. - private void SetupActionButton(bool? showActionButton, ActionButtonLocation? actionButtonLocation) - { - if (showActionButton != null) - { - if (_rightToLeft == RightToLeftSupport.LeftToRight) - { - if (actionButtonLocation == ActionButtonLocation.Left) - { - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - else - { - kbtnToastButtonPanel2.Visible = true; - - ktbActionButton2.Visible = true; - } - } - else if (_rightToLeft == RightToLeftSupport.RightToLeft) - { - if (actionButtonLocation == ActionButtonLocation.Right) - { - tlpButtons.ColumnStyles[0].SizeType = SizeType.Percent; - - tlpButtons.ColumnStyles[0].Width = 100F; - - tlpButtons.ColumnStyles[2].SizeType = SizeType.AutoSize; - - kbtnToastButtonPanel3.Visible = true; - - ktbActionButton3.Visible = true; - } - else - { - tlpButtons.ColumnStyles[0].SizeType = SizeType.Percent; - - tlpButtons.ColumnStyles[0].Width = 100F; - - tlpButtons.ColumnStyles[2].SizeType = SizeType.AutoSize; - - kbtnToastButtonPanel3.Visible = false; - - ktbActionButton3.Visible = false; - - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - } - } - else - { - if (_rightToLeft == RightToLeftSupport.LeftToRight) - { - kbtnToastButtonPanel1.Visible = false; - - kbtnToastButtonPanel2.Visible = false; - } - else if (_rightToLeft == RightToLeftSupport.RightToLeft) - { - kbtnToastButtonPanel2.Visible = false; - - kbtnToastButtonPanel3.Visible = false; - - kbtnToastButtonPanel1.Visible = true; - - ktbActionButton1.Visible = true; - } - } - } - - #endregion - } -} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/Wrapped Label/BasicNotificationWithUserResponseWrappedLabelAndProgressBar.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/Wrapped Label/BasicNotificationWithUserResponseWrappedLabelAndProgressBar.resx deleted file mode 100644 index 23731e0ef..000000000 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/User Response/Wrapped Label/BasicNotificationWithUserResponseWrappedLabelAndProgressBar.resx +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - - iVBORw0KGgoAAAANSUhEUgAAAmEAAAAyCAYAAAAUcAw7AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFQSURBVHhe7dmxDQNBCARAt3vNuQi34WLeeqR3RAqbTDA6 - 7dHACl7nnOv2/nzrlWVZlmVZludzlbD7AwCAHVXCugEAALNswgAAljlHAgAEKGEAAAFVwroBAACzbMIA - AJY5RwIABChhAAABVcK6AQAAs2zCAACWOUcCAAQoYQAAAVXCugEAALNswgAAljlHAgAEKGEAAAFVwroB - AACzbMIAAJY5RwIABChhAAABVcK6AQAAs2zCAACWOUcCAAQoYQAAAVXCugEAALNswgAAljlHAgAEKGEA - AAFVwroBAACzbMIAAJY5RwIABChhAAABVcK6AQAAs2zCAACWOUcCAAQoYQAAAVXCugEAALNswgAAljlH - AgAEKGEAAAFVwroBAACzbMIAAJY5RwIABChhAAABVcK6AQAAs2zCAACWOUcCAAT8S9jj+ZRlWZZlWZYn - 87l+YA83ApLrx/sAAAAASUVORK5CYII= - - - \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Controls Toolkit/KryptonToastNotification.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Controls Toolkit/KryptonToastNotification.cs new file mode 100644 index 000000000..8896f0549 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Controls Toolkit/KryptonToastNotification.cs @@ -0,0 +1,42 @@ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion + +namespace Krypton.Toolkit.Suite.Extended.ToastNotification +{ + public class KryptonToastNotification + { + public static void ShowBasicToastNotification(KryptonBasicToastNotificationData data) => + VisualToastNotificationBasicForm.InternalShow(data); + + public static void ShowBasicProgressBarNotification(KryptonBasicToastNotificationData data) + { + VisualToastNotificationBasicPBForm.InternalShow(data); + } + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Controls Visuals/Basic/LTR/VisualToastNotificationBasicForm.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Controls Visuals/Basic/LTR/VisualToastNotificationBasicForm.Designer.cs new file mode 100644 index 000000000..bb267b757 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Controls Visuals/Basic/LTR/VisualToastNotificationBasicForm.Designer.cs @@ -0,0 +1,238 @@ +namespace Krypton.Toolkit.Suite.Extended.ToastNotification +{ + 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.tlpButtonsAndControls = new System.Windows.Forms.TableLayoutPanel(); + this.kbtnDismiss = new Krypton.Toolkit.KryptonButton(); + this.kbtnExtraAction = new Krypton.Toolkit.KryptonButton(); + this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); + this.kpnlMain = new Krypton.Toolkit.KryptonPanel(); + this.tlpMain = new System.Windows.Forms.TableLayoutPanel(); + this.pbxNotificationIcon = new System.Windows.Forms.PictureBox(); + this.klblNotificationTitle = new Krypton.Toolkit.KryptonLabel(); + this.krtbNotificationContent = new Krypton.Toolkit.KryptonRichTextBox(); + this.kbtnClose = new Krypton.Toolkit.KryptonButton(); + ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit(); + this.kpnlButtons.SuspendLayout(); + this.tlpButtonsAndControls.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit(); + this.kpnlMain.SuspendLayout(); + this.tlpMain.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit(); + this.SuspendLayout(); + // + // kpnlButtons + // + this.kpnlButtons.Controls.Add(this.tlpButtonsAndControls); + this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom; + this.kpnlButtons.Location = new System.Drawing.Point(0, 153); + this.kpnlButtons.Name = "kpnlButtons"; + this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; + this.kpnlButtons.Size = new System.Drawing.Size(439, 50); + this.kpnlButtons.TabIndex = 0; + // + // tlpButtonsAndControls + // + this.tlpButtonsAndControls.BackColor = System.Drawing.Color.Transparent; + this.tlpButtonsAndControls.ColumnCount = 3; + this.tlpButtonsAndControls.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpButtonsAndControls.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tlpButtonsAndControls.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tlpButtonsAndControls.Controls.Add(this.kbtnDismiss, 2, 0); + this.tlpButtonsAndControls.Controls.Add(this.kbtnExtraAction, 1, 0); + this.tlpButtonsAndControls.Dock = System.Windows.Forms.DockStyle.Fill; + this.tlpButtonsAndControls.Location = new System.Drawing.Point(0, 0); + this.tlpButtonsAndControls.Name = "tlpButtonsAndControls"; + this.tlpButtonsAndControls.RowCount = 1; + this.tlpButtonsAndControls.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpButtonsAndControls.Size = new System.Drawing.Size(439, 50); + this.tlpButtonsAndControls.TabIndex = 0; + // + // kbtnDismiss + // + this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.kbtnDismiss.AutoSize = true; + this.kbtnDismiss.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.kbtnDismiss.Location = new System.Drawing.Point(335, 14); + this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10); + this.kbtnDismiss.Name = "kbtnDismiss"; + this.kbtnDismiss.Size = new System.Drawing.Size(94, 22); + this.kbtnDismiss.TabIndex = 0; + this.kbtnDismiss.Values.DropDownArrowColor = System.Drawing.Color.Empty; + this.kbtnDismiss.Values.Text = "kryptonButton1"; + this.kbtnDismiss.Click += new System.EventHandler(this.kbtnDismiss_Click); + // + // kbtnExtraAction + // + this.kbtnExtraAction.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.kbtnExtraAction.AutoSize = true; + this.kbtnExtraAction.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.kbtnExtraAction.Location = new System.Drawing.Point(221, 14); + this.kbtnExtraAction.Margin = new System.Windows.Forms.Padding(10); + this.kbtnExtraAction.Name = "kbtnExtraAction"; + this.kbtnExtraAction.Size = new System.Drawing.Size(94, 22); + this.kbtnExtraAction.TabIndex = 1; + this.kbtnExtraAction.Values.DropDownArrowColor = System.Drawing.Color.Empty; + this.kbtnExtraAction.Values.Text = "kryptonButton2"; + this.kbtnExtraAction.Visible = false; + this.kbtnExtraAction.Click += new System.EventHandler(this.kbtnExtraAction_Click); + // + // kryptonBorderEdge1 + // + this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary; + this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 152); + this.kryptonBorderEdge1.Name = "kryptonBorderEdge1"; + this.kryptonBorderEdge1.Size = new System.Drawing.Size(439, 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(439, 152); + this.kpnlMain.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.pbxNotificationIcon, 0, 0); + this.tlpMain.Controls.Add(this.klblNotificationTitle, 1, 1); + this.tlpMain.Controls.Add(this.krtbNotificationContent, 1, 2); + this.tlpMain.Controls.Add(this.kbtnClose, 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 = 3; + this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpMain.Size = new System.Drawing.Size(439, 152); + this.tlpMain.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.Padding = new System.Windows.Forms.Padding(5); + this.tlpMain.SetRowSpan(this.pbxNotificationIcon, 3); + this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 142); + this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; + this.pbxNotificationIcon.TabIndex = 0; + this.pbxNotificationIcon.TabStop = false; + // + // klblNotificationTitle + // + this.klblNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill; + this.klblNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitlePanel; + this.klblNotificationTitle.Location = new System.Drawing.Point(141, 29); + this.klblNotificationTitle.Name = "klblNotificationTitle"; + this.klblNotificationTitle.Size = new System.Drawing.Size(295, 29); + this.klblNotificationTitle.TabIndex = 2; + this.klblNotificationTitle.Values.Text = "kryptonLabel2"; + // + // krtbNotificationContent + // + this.krtbNotificationContent.Dock = System.Windows.Forms.DockStyle.Fill; + this.krtbNotificationContent.InputControlStyle = Krypton.Toolkit.InputControlStyle.PanelClient; + this.krtbNotificationContent.Location = new System.Drawing.Point(141, 64); + this.krtbNotificationContent.Name = "krtbNotificationContent"; + this.krtbNotificationContent.Size = new System.Drawing.Size(295, 85); + this.krtbNotificationContent.StateCommon.Border.Color1 = System.Drawing.Color.Transparent; + this.krtbNotificationContent.StateCommon.Border.Color2 = System.Drawing.Color.Transparent; + this.krtbNotificationContent.TabIndex = 3; + this.krtbNotificationContent.Text = "kryptonRichTextBox1"; + // + // kbtnClose + // + this.kbtnClose.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.kbtnClose.AutoSize = true; + this.kbtnClose.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.kbtnClose.ButtonStyle = Krypton.Toolkit.ButtonStyle.FormClose; + this.kbtnClose.Location = new System.Drawing.Point(422, 3); + this.kbtnClose.Name = "kbtnClose"; + this.kbtnClose.Size = new System.Drawing.Size(14, 20); + this.kbtnClose.TabIndex = 4; + this.kbtnClose.Values.DropDownArrowColor = System.Drawing.Color.Empty; + this.kbtnClose.Values.Text = "X"; + this.kbtnClose.Click += new System.EventHandler(this.kbtnClose_Click); + // + // VisualToastNotificationBasicForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(439, 203); + this.Controls.Add(this.kpnlMain); + this.Controls.Add(this.kryptonBorderEdge1); + this.Controls.Add(this.kpnlButtons); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "VisualToastNotificationBasicForm"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; + this.Load += new System.EventHandler(this.VisualToastNotificationBasicForm_Load); + ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).EndInit(); + this.kpnlButtons.ResumeLayout(false); + this.tlpButtonsAndControls.ResumeLayout(false); + this.tlpButtonsAndControls.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit(); + this.kpnlMain.ResumeLayout(false); + this.tlpMain.ResumeLayout(false); + this.tlpMain.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private KryptonPanel kpnlButtons; + private KryptonBorderEdge kryptonBorderEdge1; + private KryptonPanel kpnlMain; + private TableLayoutPanel tlpButtonsAndControls; + private TableLayoutPanel tlpMain; + private PictureBox pbxNotificationIcon; + private KryptonLabel klblNotificationTitle; + private KryptonRichTextBox krtbNotificationContent; + private KryptonButton kbtnDismiss; + private KryptonButton kbtnExtraAction; + private KryptonButton kbtnClose; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Controls Visuals/Basic/LTR/VisualToastNotificationBasicForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Controls Visuals/Basic/LTR/VisualToastNotificationBasicForm.cs new file mode 100644 index 000000000..2a480cfe2 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Controls Visuals/Basic/LTR/VisualToastNotificationBasicForm.cs @@ -0,0 +1,356 @@ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion + +namespace Krypton.Toolkit.Suite.Extended.ToastNotification +{ + internal partial class VisualToastNotificationBasicForm : KryptonForm + { + #region Instance Fields + + private int _time; + + private Timer _timer; + + private SoundPlayer? _soundPlayer; + + private PaletteBase _palette; + + private readonly KryptonBasicToastNotificationData _toastNotificationData; + + #endregion + + #region Identity + + public VisualToastNotificationBasicForm(KryptonBasicToastNotificationData toastNotificationData) + { + InitializeComponent(); + + _toastNotificationData = toastNotificationData; + + GotFocus += VisualToastNotificationBasicForm_GotFocus; + + LocationChanged += VisualToastNotificationBasicForm_LocationChanged; + + DoubleBuffered = true; + } + + #endregion + + private void VisualToastNotificationBasicForm_LocationChanged(object sender, EventArgs e) + { + + } + + private void VisualToastNotificationBasicForm_GotFocus(object sender, EventArgs e) => kbtnDismiss.Focus(); + + private void VisualToastNotificationBasicForm_Load(object sender, EventArgs e) + { + UpdateSizing(); + + UpdateLocation(); + + ReportToastLocation(); + + ShowCloseButton(); + + _timer?.Start(); + + _soundPlayer?.Play(); + } + + private void kbtnClose_Click(object sender, EventArgs e) + { + Close(); + } + + private void kbtnDismiss_Click(object sender, EventArgs e) + { + Close(); + } + + private void kbtnExtraAction_Click(object sender, EventArgs e) + { + + } + + private void UpdateText() + { + krtbNotificationContent.Text = _toastNotificationData.NotificationContent ?? string.Empty; + + klblNotificationTitle.Text = _toastNotificationData.NotificationTitle; + + klblNotificationTitle.StateCommon.ShortText.TextH = _toastNotificationData.TitleAlignment ?? PaletteRelativeAlign.Inherit; + + krtbNotificationContent.DetectUrls = _toastNotificationData.EnableHyperLinks ?? true; + } + + private void UpdateFonts() + { + krtbNotificationContent.Font = _toastNotificationData.NotificationContentFont ?? + KryptonManager.CurrentGlobalPalette.BaseFont; + + if (_toastNotificationData.NotificationTitleFont != null) + { + krtbNotificationContent.InputControlStyle = InputControlStyle.PanelClient; + + klblNotificationTitle.Font = + _toastNotificationData.NotificationTitleFont ?? _palette.Header1ShortFont; + } + else + { + klblNotificationTitle.LabelStyle = LabelStyle.TitleControl; + } + } + + private void UpdateIcon() + { + switch (_toastNotificationData.NotificationIcon) + { + case KryptonToastNotificationIcon.None: + SetIcon(null); + break; + case KryptonToastNotificationIcon.Hand: + SetIcon(Resources.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(Resources.Toast_Notification_Question_128_x_128); + break; + case KryptonToastNotificationIcon.SystemQuestion: + break; + case KryptonToastNotificationIcon.Exclamation: + SetIcon(Resources.Toast_Notification_Warning_128_x_115); + break; + case KryptonToastNotificationIcon.SystemExclamation: + break; + case KryptonToastNotificationIcon.Asterisk: + SetIcon(Resources.Toast_Notification_Asterisk_128_x_128); + break; + case KryptonToastNotificationIcon.SystemAsterisk: + break; + case KryptonToastNotificationIcon.Stop: + SetIcon(Resources.Toast_Notification_Stop_128_x_128); + break; + case KryptonToastNotificationIcon.Error: + SetIcon(Resources.Toast_Notification_Critical_128_x_128); + break; + case KryptonToastNotificationIcon.Warning: + SetIcon(Resources.Toast_Notification_Warning_128_x_115); + break; + case KryptonToastNotificationIcon.Information: + SetIcon(Resources.Toast_Notification_Information_128_x_128); + break; + case KryptonToastNotificationIcon.Shield: + if (OSUtilities.IsAtLeastWindowsEleven) + { + SetIcon(Resources.Toast_Notification_UAC_Shield_Windows_11_128_x_128); + } + else if (OSUtilities.IsWindowsTen) + { + SetIcon(Resources.Toast_Notification_UAC_Shield_Windows_10_128_x_128); + } + else + { + SetIcon(Resources.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(Resources.Toast_Notification_Ok_128_x_128); + break; + case KryptonToastNotificationIcon.Custom: + SetIcon(_toastNotificationData.CustomImage != null + ? new Bitmap(_toastNotificationData.CustomImage) + : null); + break; + case null: + SetIcon(null); + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + + private void SetIcon(Bitmap? image) => pbxNotificationIcon.Image = image; + + private void ShowCloseButton() => kbtnClose.Visible = _toastNotificationData.ShowCloseButton ?? false; + + private void ReportToastLocation() + { + + } + + private void UpdateLocation() => + // Once loaded, position the form, or position it to the bottom left of the screen with added padding + Location = _toastNotificationData.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5, + Screen.PrimaryScreen.WorkingArea.Height - Height - 5); + + private void UpdateSizing() + { + + } + + #region Show + + public new void Show() + { + TopMost = _toastNotificationData.TopMost ?? true; + + UpdateText(); + + UpdateIcon(); + + if (_toastNotificationData.CountDownSeconds != 0) + { + kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_toastNotificationData.CountDownSeconds - _time})"; + + kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_toastNotificationData.CountDownSeconds - _time})"; + + _timer = new Timer(); + + _timer.Interval = _toastNotificationData.CountDownTimerInterval ?? 1000; + + _timer.Tick += (sender, args) => + { + _time++; + + kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_toastNotificationData.CountDownSeconds - _time})"; + + kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_toastNotificationData.CountDownSeconds - _time})"; + + if (_time == _toastNotificationData.CountDownSeconds) + { + _timer.Stop(); + + Close(); + } + }; + } + + + base.Show(); + } + + public new DialogResult ShowDialog() + { + TopMost = _toastNotificationData.TopMost ?? true; + + UpdateText(); + + UpdateIcon(); + + if (_toastNotificationData.IsDoNotShowAgainOptionChecked) + { + //UpdateDoNotShowAgainOptionChecked(); + } + + if (_toastNotificationData.DoNotShowAgainOptionCheckState != null) + { + //UpdateDoNotShowAgainOptionCheckState(); + } + + if (_toastNotificationData.CountDownSeconds != 0) + { + kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_toastNotificationData.CountDownSeconds - _time})"; + + kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_toastNotificationData.CountDownSeconds - _time})"; + + _timer = new Timer(); + + _timer.Interval = _toastNotificationData.CountDownTimerInterval ?? 1000; + + _timer.Tick += (sender, args) => + { + _time++; + + kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_toastNotificationData.CountDownSeconds - _time})"; + + kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss} ({_toastNotificationData.CountDownSeconds - _time})"; + + if (_time == _toastNotificationData.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 true; + } + else + { + return false; + } + } + + internal static CheckState InternalShowWithCheckStateReturnValue( + KryptonBasicToastNotificationData toastNotificationData) + { + using var toast = new VisualToastNotificationBasicForm(toastNotificationData); + + return toast.ShowDialog() == DialogResult.OK + ? /*toast.ReturnCheckBoxStateValue*/ CheckState.Checked + : CheckState.Unchecked; + } + + internal static void InternalShow(KryptonBasicToastNotificationData toastNotificationData) + { + var toast = new VisualToastNotificationBasicForm(toastNotificationData); + + toast.Show(); + } + + #endregion + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Properties/Resources.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Controls Visuals/Basic/LTR/VisualToastNotificationBasicForm.resx similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Properties/Resources.resx rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Controls Visuals/Basic/LTR/VisualToastNotificationBasicForm.resx diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Controls Visuals/Basic/LTR/VisualToastNotificationBasicPBForm.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Controls Visuals/Basic/LTR/VisualToastNotificationBasicPBForm.Designer.cs new file mode 100644 index 000000000..2cd1fb0be --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Controls Visuals/Basic/LTR/VisualToastNotificationBasicPBForm.Designer.cs @@ -0,0 +1,256 @@ +namespace Krypton.Toolkit.Suite.Extended.ToastNotification +{ + partial class VisualToastNotificationBasicPBForm + { + /// + /// 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.tlpButtonsAndControls = new System.Windows.Forms.TableLayoutPanel(); + this.kbtnDismiss = new Krypton.Toolkit.KryptonButton(); + this.kbtnExtraAction = new Krypton.Toolkit.KryptonButton(); + this.kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); + this.kpnlMain = new Krypton.Toolkit.KryptonPanel(); + this.tlpMain = new System.Windows.Forms.TableLayoutPanel(); + this.pbxNotificationIcon = new System.Windows.Forms.PictureBox(); + this.klblNotificationTitle = new Krypton.Toolkit.KryptonLabel(); + this.krtbNotificationContent = new Krypton.Toolkit.KryptonRichTextBox(); + this.kbtnClose = new Krypton.Toolkit.KryptonButton(); + this.kpbCountDown = new Krypton.Toolkit.KryptonProgressBar(); + ((System.ComponentModel.ISupportInitialize)(this.kpnlButtons)).BeginInit(); + this.kpnlButtons.SuspendLayout(); + this.tlpButtonsAndControls.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).BeginInit(); + this.kpnlMain.SuspendLayout(); + this.tlpMain.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).BeginInit(); + this.SuspendLayout(); + // + // kpnlButtons + // + this.kpnlButtons.Controls.Add(this.tlpButtonsAndControls); + this.kpnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom; + this.kpnlButtons.Location = new System.Drawing.Point(0, 180); + this.kpnlButtons.Name = "kpnlButtons"; + this.kpnlButtons.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; + this.kpnlButtons.Size = new System.Drawing.Size(439, 50); + this.kpnlButtons.TabIndex = 1; + // + // tlpButtonsAndControls + // + this.tlpButtonsAndControls.BackColor = System.Drawing.Color.Transparent; + this.tlpButtonsAndControls.ColumnCount = 3; + this.tlpButtonsAndControls.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpButtonsAndControls.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tlpButtonsAndControls.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tlpButtonsAndControls.Controls.Add(this.kbtnDismiss, 2, 0); + this.tlpButtonsAndControls.Controls.Add(this.kbtnExtraAction, 1, 0); + this.tlpButtonsAndControls.Dock = System.Windows.Forms.DockStyle.Fill; + this.tlpButtonsAndControls.Location = new System.Drawing.Point(0, 0); + this.tlpButtonsAndControls.Name = "tlpButtonsAndControls"; + this.tlpButtonsAndControls.RowCount = 1; + this.tlpButtonsAndControls.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpButtonsAndControls.Size = new System.Drawing.Size(439, 50); + this.tlpButtonsAndControls.TabIndex = 0; + // + // kbtnDismiss + // + this.kbtnDismiss.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.kbtnDismiss.AutoSize = true; + this.kbtnDismiss.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.kbtnDismiss.Location = new System.Drawing.Point(335, 14); + this.kbtnDismiss.Margin = new System.Windows.Forms.Padding(10); + this.kbtnDismiss.Name = "kbtnDismiss"; + this.kbtnDismiss.Size = new System.Drawing.Size(94, 22); + this.kbtnDismiss.TabIndex = 0; + this.kbtnDismiss.Values.DropDownArrowColor = System.Drawing.Color.Empty; + this.kbtnDismiss.Values.Text = "kryptonButton1"; + this.kbtnDismiss.Click += new System.EventHandler(this.kbtnDismiss_Click); + // + // kbtnExtraAction + // + this.kbtnExtraAction.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.kbtnExtraAction.AutoSize = true; + this.kbtnExtraAction.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.kbtnExtraAction.Location = new System.Drawing.Point(221, 14); + this.kbtnExtraAction.Margin = new System.Windows.Forms.Padding(10); + this.kbtnExtraAction.Name = "kbtnExtraAction"; + this.kbtnExtraAction.Size = new System.Drawing.Size(94, 22); + this.kbtnExtraAction.TabIndex = 1; + this.kbtnExtraAction.Values.DropDownArrowColor = System.Drawing.Color.Empty; + this.kbtnExtraAction.Values.Text = "kryptonButton2"; + this.kbtnExtraAction.Visible = false; + this.kbtnExtraAction.Click += new System.EventHandler(this.kbtnExtraAction_Click); + // + // kryptonBorderEdge1 + // + this.kryptonBorderEdge1.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary; + this.kryptonBorderEdge1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.kryptonBorderEdge1.Location = new System.Drawing.Point(0, 179); + this.kryptonBorderEdge1.Name = "kryptonBorderEdge1"; + this.kryptonBorderEdge1.Size = new System.Drawing.Size(439, 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(439, 179); + this.kpnlMain.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.pbxNotificationIcon, 0, 0); + this.tlpMain.Controls.Add(this.klblNotificationTitle, 1, 1); + this.tlpMain.Controls.Add(this.krtbNotificationContent, 1, 2); + this.tlpMain.Controls.Add(this.kbtnClose, 1, 0); + this.tlpMain.Controls.Add(this.kpbCountDown, 0, 3); + this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill; + this.tlpMain.Location = new System.Drawing.Point(0, 0); + this.tlpMain.Name = "tlpMain"; + this.tlpMain.RowCount = 4; + this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + 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(439, 179); + this.tlpMain.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.Padding = new System.Windows.Forms.Padding(5); + this.tlpMain.SetRowSpan(this.pbxNotificationIcon, 3); + this.pbxNotificationIcon.Size = new System.Drawing.Size(128, 133); + this.pbxNotificationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; + this.pbxNotificationIcon.TabIndex = 0; + this.pbxNotificationIcon.TabStop = false; + // + // klblNotificationTitle + // + this.klblNotificationTitle.Dock = System.Windows.Forms.DockStyle.Fill; + this.klblNotificationTitle.LabelStyle = Krypton.Toolkit.LabelStyle.TitlePanel; + this.klblNotificationTitle.Location = new System.Drawing.Point(141, 29); + this.klblNotificationTitle.Name = "klblNotificationTitle"; + this.klblNotificationTitle.Size = new System.Drawing.Size(295, 29); + this.klblNotificationTitle.TabIndex = 2; + this.klblNotificationTitle.Values.Text = "kryptonLabel2"; + // + // krtbNotificationContent + // + this.krtbNotificationContent.Dock = System.Windows.Forms.DockStyle.Fill; + this.krtbNotificationContent.InputControlStyle = Krypton.Toolkit.InputControlStyle.PanelClient; + this.krtbNotificationContent.Location = new System.Drawing.Point(141, 64); + this.krtbNotificationContent.Name = "krtbNotificationContent"; + this.krtbNotificationContent.Size = new System.Drawing.Size(295, 76); + this.krtbNotificationContent.StateCommon.Border.Color1 = System.Drawing.Color.Transparent; + this.krtbNotificationContent.StateCommon.Border.Color2 = System.Drawing.Color.Transparent; + this.krtbNotificationContent.TabIndex = 3; + this.krtbNotificationContent.Text = "kryptonRichTextBox1"; + // + // kbtnClose + // + this.kbtnClose.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.kbtnClose.AutoSize = true; + this.kbtnClose.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.kbtnClose.ButtonStyle = Krypton.Toolkit.ButtonStyle.FormClose; + this.kbtnClose.Location = new System.Drawing.Point(422, 3); + this.kbtnClose.Name = "kbtnClose"; + this.kbtnClose.Size = new System.Drawing.Size(14, 20); + this.kbtnClose.TabIndex = 4; + this.kbtnClose.Values.DropDownArrowColor = System.Drawing.Color.Empty; + this.kbtnClose.Values.Text = "X"; + this.kbtnClose.Click += new System.EventHandler(this.kbtnClose_Click); + // + // kpbCountDown + // + this.tlpMain.SetColumnSpan(this.kpbCountDown, 2); + this.kpbCountDown.Dock = System.Windows.Forms.DockStyle.Fill; + this.kpbCountDown.Location = new System.Drawing.Point(5, 148); + this.kpbCountDown.Margin = new System.Windows.Forms.Padding(5); + this.kpbCountDown.Name = "kpbCountDown"; + this.kpbCountDown.Size = new System.Drawing.Size(429, 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.Values.Text = ""; + // + // VisualToastNotificationBasicWithProgressBarForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(439, 230); + this.Controls.Add(this.kpnlMain); + this.Controls.Add(this.kryptonBorderEdge1); + this.Controls.Add(this.kpnlButtons); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + 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.kpnlButtons)).EndInit(); + this.kpnlButtons.ResumeLayout(false); + this.tlpButtonsAndControls.ResumeLayout(false); + this.tlpButtonsAndControls.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kpnlMain)).EndInit(); + this.kpnlMain.ResumeLayout(false); + this.tlpMain.ResumeLayout(false); + this.tlpMain.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbxNotificationIcon)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private KryptonPanel kpnlButtons; + private TableLayoutPanel tlpButtonsAndControls; + private KryptonButton kbtnDismiss; + private KryptonButton kbtnExtraAction; + private KryptonBorderEdge kryptonBorderEdge1; + private KryptonPanel kpnlMain; + private TableLayoutPanel tlpMain; + private PictureBox pbxNotificationIcon; + private KryptonLabel klblNotificationTitle; + private KryptonRichTextBox krtbNotificationContent; + private KryptonButton kbtnClose; + private KryptonProgressBar kpbCountDown; + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Controls Visuals/Basic/LTR/VisualToastNotificationBasicPBForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Controls Visuals/Basic/LTR/VisualToastNotificationBasicPBForm.cs new file mode 100644 index 000000000..d0c570494 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Controls Visuals/Basic/LTR/VisualToastNotificationBasicPBForm.cs @@ -0,0 +1,321 @@ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2024 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion + +namespace Krypton.Toolkit.Suite.Extended.ToastNotification +{ + internal partial class VisualToastNotificationBasicPBForm : KryptonForm + { + #region Instance Fields + + private int _time, _countdownValue; + + private Timer _timer; + + private SoundPlayer? _soundPlayer; + + private PaletteBase _palette; + + private readonly KryptonBasicToastNotificationData _toastNotificationData; + + #endregion + + public VisualToastNotificationBasicPBForm(KryptonBasicToastNotificationData toastNotificationData) + { + InitializeComponent(); + + _toastNotificationData = toastNotificationData; + + GotFocus += VisualToastNotificationBasicWithProgressBarForm_GotFocus; + + DoubleBuffered = true; + } + + private void VisualToastNotificationBasicWithProgressBarForm_Load(object sender, EventArgs e) + { + UpdateLocation(); + + ShowCloseButton(); + + _timer.Start(); + + _soundPlayer?.Play(); + + kbtnDismiss.Text = KryptonManager.Strings.ToastNotificationStrings.Dismiss; + } + + private void kbtnClose_Click(object sender, EventArgs e) => Close(); + + private void kbtnDismiss_Click(object sender, EventArgs e) => Close(); + + private void kbtnExtraAction_Click(object sender, EventArgs e) + { + try + { + + } + catch (Exception exception) + { + KryptonMessageBox.Show($"An error has occurred: {exception}", @"Error", KryptonMessageBoxButtons.OK, + KryptonMessageBoxIcon.Error); + } + } + + private void VisualToastNotificationBasicWithProgressBarForm_GotFocus(object sender, EventArgs e) + { + kbtnDismiss.Focus(); + } + + private void UpdateText() + { + krtbNotificationContent.Text = _toastNotificationData.NotificationContent ?? string.Empty; + + klblNotificationTitle.Text = _toastNotificationData.NotificationTitle; + + klblNotificationTitle.StateCommon.ShortText.TextH = + _toastNotificationData.TitleAlignment ?? PaletteRelativeAlign.Inherit; + } + + private void UpdateFonts() + { + krtbNotificationContent.Font = _toastNotificationData.NotificationContentFont ?? + KryptonManager.CurrentGlobalPalette.BaseFont; + + if (_toastNotificationData.NotificationTitleFont != null) + { + krtbNotificationContent.InputControlStyle = InputControlStyle.PanelClient; + + klblNotificationTitle.Font = + _toastNotificationData.NotificationTitleFont ?? _palette.Header1ShortFont; + } + else + { + klblNotificationTitle.LabelStyle = LabelStyle.TitleControl; + } + } + + private void UpdateIcon() + { + switch (_toastNotificationData.NotificationIcon) + { + case KryptonToastNotificationIcon.None: + SetIcon(null); + break; + case KryptonToastNotificationIcon.Hand: + SetIcon(Resources.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(Resources.Toast_Notification_Question_128_x_128); + break; + case KryptonToastNotificationIcon.SystemQuestion: + break; + case KryptonToastNotificationIcon.Exclamation: + SetIcon(Resources.Toast_Notification_Warning_128_x_115); + break; + case KryptonToastNotificationIcon.SystemExclamation: + break; + case KryptonToastNotificationIcon.Asterisk: + SetIcon(Resources.Toast_Notification_Asterisk_128_x_128); + break; + case KryptonToastNotificationIcon.SystemAsterisk: + break; + case KryptonToastNotificationIcon.Stop: + SetIcon(Resources.Toast_Notification_Stop_128_x_128); + break; + case KryptonToastNotificationIcon.Error: + SetIcon(Resources.Toast_Notification_Critical_128_x_128); + break; + case KryptonToastNotificationIcon.Warning: + SetIcon(Resources.Toast_Notification_Warning_128_x_115); + break; + case KryptonToastNotificationIcon.Information: + SetIcon(Resources.Toast_Notification_Information_128_x_128); + break; + case KryptonToastNotificationIcon.Shield: + if (OSUtilities.IsAtLeastWindowsEleven) + { + SetIcon(Resources.Toast_Notification_UAC_Shield_Windows_11_128_x_128); + } + else if (OSUtilities.IsWindowsTen) + { + SetIcon(Resources.Toast_Notification_UAC_Shield_Windows_10_128_x_128); + } + else + { + SetIcon(Resources.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(Resources.Toast_Notification_Ok_128_x_128); + break; + case KryptonToastNotificationIcon.Custom: + SetIcon(_toastNotificationData.CustomImage != null + ? new Bitmap(_toastNotificationData.CustomImage) + : null); + break; + case null: + SetIcon(null); + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + + 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 = _toastNotificationData.NotificationLocation ?? new Point(Screen.PrimaryScreen!.WorkingArea.Width - Width - 5, + Screen.PrimaryScreen!.WorkingArea.Height - Height - 5); + } + + private void ShowCloseButton() => kbtnClose.Visible = _toastNotificationData.ShowCloseButton ?? false; + + private void UpdateProgressBarText() => kpbCountDown.Text = _toastNotificationData.ShowCountDownSecondsOnProgressBar ? $@"{_toastNotificationData.CountDownSeconds - _time}" : string.Empty; + + public new void Show() + { + TopMost = _toastNotificationData.TopMost ?? true; + + UpdateText(); + + UpdateIcon(); + + if (_toastNotificationData.CountDownSeconds != 0) + { + _countdownValue = _toastNotificationData.CountDownSeconds ?? 60; + + kpbCountDown.Maximum = _countdownValue; + + kpbCountDown.Value = _countdownValue; + + UpdateProgressBarText(); + + _timer = new Timer(); + + _timer.Interval = _toastNotificationData.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 = _toastNotificationData.TopMost ?? true; + + UpdateText(); + + UpdateIcon(); + + //if (_toastNotificationData.IsDoNotShowAgainOptionChecked) + //{ + // UpdateDoNotShowAgainOptionChecked(); + //} + + //if (_toastNotificationData.DoNotShowAgainOptionCheckState != null) + //{ + // UpdateDoNotShowAgainOptionCheckState(); + //} + + if (_toastNotificationData.CountDownSeconds != 0) + { + _countdownValue = _toastNotificationData.CountDownSeconds ?? 60; + + kpbCountDown.Maximum = _countdownValue; + + kpbCountDown.Value = _countdownValue; + + UpdateProgressBarText(); + + kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss}"; + + _timer = new Timer(); + + _timer.Interval = _toastNotificationData.CountDownTimerInterval ?? 1000; + + _timer.Tick += (sender, args) => + { + _time++; + + kpbCountDown.Value -= 1; + + UpdateProgressBarText(); + + kbtnDismiss.Text = $@"{KryptonManager.Strings.ToastNotificationStrings.Dismiss}"; + + if (_time == _toastNotificationData.CountDownSeconds) + { + _timer.Stop(); + + Close(); + } + }; + } + + return base.ShowDialog(); + } + + internal static void InternalShow(KryptonBasicToastNotificationData toastNotificationData) + { + var kt = new VisualToastNotificationBasicPBForm(toastNotificationData); + + kt.Show(); + } + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Controls Visuals/VirtualToastNotificationForm.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Controls Visuals/Basic/LTR/VisualToastNotificationBasicPBForm.resx similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/UX/Controls Visuals/VirtualToastNotificationForm.resx rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Controls Visuals/Basic/LTR/VisualToastNotificationBasicPBForm.resx diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/General/KryptonBasicToastNotificationData.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/General/KryptonBasicToastNotificationData.cs new file mode 100644 index 000000000..85d9df780 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/General/KryptonBasicToastNotificationData.cs @@ -0,0 +1,151 @@ +namespace Krypton.Toolkit.Suite.Extended.ToastNotification +{ + /// Contains the data and information required, to create a basic toast notification. + public struct KryptonBasicToastNotificationData + { + #region Public + + /// Gets or sets the enable hyper links. + /// The enable hyper links. + public bool? EnableHyperLinks { get; set; } + + /// Gets or sets the use fade. + /// The use fade. + public bool UseFade { get; set; } + + /// Gets or sets the top most. + /// The top most. + public bool? TopMost { get; set; } + + /// Gets or sets the show close button. + /// The show close button. + public bool? ShowCloseButton { get; set; } + + /// Gets or sets the show do not show again option. + /// The show do not show again option. + public bool? ShowDoNotShowAgainOption { get; set; } + + /// Gets or sets a value indicating whether [show count down seconds on progress bar]. + /// true if [show count down seconds on progress bar]; otherwise, false. + public bool ShowCountDownSecondsOnProgressBar { get; set; } + + /// Gets or sets the state of the use do not show again option three. + /// The state of the use do not show again option three. + public bool? UseDoNotShowAgainOptionThreeState { get; set; } + + /// Gets or sets the do not show again option checked value. + /// The do not show again option checked value. + public bool IsDoNotShowAgainOptionChecked { get; set; } + + /// Gets or sets the report toast location. Use this for development purposes only. + /// Reports the toast location. + public bool ReportToastLocation { get; set; } + + /// Gets or sets a value indicating whether [use RTL reading]. + /// true if [use RTL reading]; otherwise, false. + public KryptonUseRTLLayout UseRtlReading { get; set; } + + /// Gets or sets the state of the do not show again option check. + /// The state of the do not show again option check. + public CheckState? DoNotShowAgainOptionCheckState { get; set; } + + /// Gets or sets the first border color. + /// The first border color. + public Color? BorderColor1 { get; set; } + + /// Gets or sets the second border color. + /// The second border color. + public Color? BorderColor2 { get; set; } + + /// Gets or sets the notification content font. + /// The notification content font. + public Font? NotificationContentFont { get; set; } + + /// Gets or sets the notification title font. + /// The notification title font. + public Font? NotificationTitleFont { get; set; } + + /// Gets or sets the count-down seconds. + /// The count-down seconds. + public int? CountDownSeconds { get; set; } + + /// Gets or sets the count-down timer interval. + /// The count-down timer interval. + public int? CountDownTimerInterval { get; set; } + + /// Gets or sets the content of the notification. + /// The content of the notification. + public string? NotificationContent { get; set; } + + /// Gets or sets the notification title. + /// The notification title. + public string? NotificationTitle { get; set; } + + /// Gets or sets the optional CheckBox text. + /// The optional CheckBox text. + public string? OptionalCheckBoxText { get; set; } + + /// Gets or sets the custom image. + /// The custom image. + public Bitmap? CustomImage { get; set; } + + /// Gets or sets the notification location. + /// The notification location. + public Point? NotificationLocation { get; set; } + + /// Gets or sets the toast host. + /// The toast host. + public IWin32Window? ToastHost { get; set; } + + /// Gets or sets the right to left layout. + /// The right to left layout. + public RightToLeftLayout? RightToLeftLayout { get; set; } + + /// Gets or sets the notification icon. + /// The notification icon. + public KryptonToastNotificationIcon? NotificationIcon { get; set; } + + public PaletteRelativeAlign? TitleAlignment { get; set; } + + #endregion + + #region Identity + + /// Initializes a new instance of the struct. + public KryptonBasicToastNotificationData() + { + // Defaults, when needed + UseFade = false; + + ReportToastLocation = false; + + UseRtlReading = KryptonUseRTLLayout.No; + + ShowCountDownSecondsOnProgressBar = true; + + #region Do Not Show Again Values + + ShowDoNotShowAgainOption = false; + + UseDoNotShowAgainOptionThreeState = false; + + DoNotShowAgainOptionCheckState = CheckState.Unchecked; + + #endregion + + CountDownTimerInterval = 1000; + + BorderColor1 = GlobalStaticValues.EMPTY_COLOR; + + BorderColor2 = GlobalStaticValues.EMPTY_COLOR; + + OptionalCheckBoxText = KryptonManager.Strings.CustomStrings.DoNotShowAgain; + + ToastHost = null; + + RightToLeftLayout = Toolkit.RightToLeftLayout.LeftToRight; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/GlobalUsings.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/GlobalUsings.cs new file mode 100644 index 000000000..869294842 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/GlobalUsings.cs @@ -0,0 +1,37 @@ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2024 Krypton Suite + * + * 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 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * 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. + * + */ + +#endregion + +// Global using directives + +global using System; +global using System.Drawing; +global using System.Media; +global using System.Windows.Forms; + +global using Krypton.Toolkit.Suite.Extended.ToastNotification.Properties; \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Krypton - Backup.Toolkit.Suite.Extended.ToastNotification 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Krypton - Backup.Toolkit.Suite.Extended.ToastNotification 2022.csproj new file mode 100644 index 000000000..91d41005f --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Krypton - Backup.Toolkit.Suite.Extended.ToastNotification 2022.csproj @@ -0,0 +1,180 @@ + + + + + + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows + + + + + + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows + + + + + + library + Krypton.Toolkit.Suite.Extended.ToastNotification + Krypton.Toolkit.Suite.Extended.ToastNotification + + false + true + en + Debug;Release;Nightly;Canary + preview + enable + 6 + true + + + + + + + Krypton.Toolkit.Suite.Extended.ToastNotification.Canary + + + + + + Krypton.Toolkit.Suite.Extended.ToastNotification.Nightly + + + + + + Krypton.Toolkit.Suite.Extended.ToastNotification + + + + + Krypton.Toolkit.Suite.Extended.ToastNotification + + + + + + + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package holds extensions to the KryptonButton controls. + + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. + Also, all libraries are included targeting each specific framework version for performance purposes. + + To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + 4.0.0.0 + True + + + True + 5.0.0.0 + True + + + True + 6.0.0.0 + True + + + + + + + ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.ToastNotification\Krypton.Toolkit.Suite.Extended.ToastNotification.xml + ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.ToastNotification\ + True + True + StrongKrypton.snk + enable + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Krypton.Toolkit.Suite.Extended.ToastNotification 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Krypton.Toolkit.Suite.Extended.ToastNotification 2022.csproj new file mode 100644 index 000000000..14db5af58 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Krypton.Toolkit.Suite.Extended.ToastNotification 2022.csproj @@ -0,0 +1,180 @@ + + + + + + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows + + + + + + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows + + + + + + library + Krypton.Toolkit.Suite.Extended.ToastNotification + Krypton.Toolkit.Suite.Extended.ToastNotification + + false + true + en + Debug;Release;Nightly;Canary + preview + enable + 6 + true + + + + + + + Krypton.Toolkit.Suite.Extended.ToastNotification.Canary + + + + + + Krypton.Toolkit.Suite.Extended.ToastNotification.Nightly + + + + + + Krypton.Toolkit.Suite.Extended.ToastNotification + + + + + Krypton.Toolkit.Suite.Extended.ToastNotification + + + + + + + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package holds extensions to the KryptonButton controls. + + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. + Also, all libraries are included targeting each specific framework version for performance purposes. + + To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + 4.0.0.0 + True + + + True + 5.0.0.0 + True + + + True + 6.0.0.0 + True + + + + + + + ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.ToastNotification\Krypton.Toolkit.Suite.Extended.ToastNotification.xml + ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.ToastNotification\ + True + True + StrongKrypton.snk + enable + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Krypton.Toolkit.Suite.Extended.ToastNotification.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Krypton.Toolkit.Suite.Extended.ToastNotification.licenseheader new file mode 100644 index 000000000..26a2db6cc --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Krypton.Toolkit.Suite.Extended.ToastNotification.licenseheader @@ -0,0 +1,13 @@ +extensions: designer.cs generated.cs +extensions: .cs .cpp .h +// Copyright (c) 2011 rubicon IT GmbH +extensions: .aspx .ascx +<%-- +Copyright (c) 2011 rubicon IT GmbH +--%> +extensions: .vb +'Sample license text. +extensions: .xml .config .xsd + \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Properties/Resources.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Properties/Resources.Designer.cs new file mode 100644 index 000000000..aad1830dc --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Properties/Resources.Designer.cs @@ -0,0 +1,193 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Krypton.Toolkit.Suite.Extended.ToastNotification.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Krypton.Toolkit.Suite.Extended.ToastNotification.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Toast_Notification_Asterisk_128_x_128 { + get { + object obj = ResourceManager.GetObject("Toast_Notification_Asterisk_128_x_128", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Toast_Notification_Critical_128_x_128 { + get { + object obj = ResourceManager.GetObject("Toast_Notification_Critical_128_x_128", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Toast_Notification_Hand_128_x_128 { + get { + object obj = ResourceManager.GetObject("Toast_Notification_Hand_128_x_128", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Toast_Notification_Information_128_x_128 { + get { + object obj = ResourceManager.GetObject("Toast_Notification_Information_128_x_128", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Toast_Notification_Ok_128_x_128 { + get { + object obj = ResourceManager.GetObject("Toast_Notification_Ok_128_x_128", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Toast_Notification_Question_128_x_128 { + get { + object obj = ResourceManager.GetObject("Toast_Notification_Question_128_x_128", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Toast_Notification_Stop_128_x_128 { + get { + object obj = ResourceManager.GetObject("Toast_Notification_Stop_128_x_128", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Toast_Notification_UAC_Shield_Windows_10_128_x_128 { + get { + object obj = ResourceManager.GetObject("Toast_Notification_UAC_Shield_Windows_10_128_x_128", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Toast_Notification_UAC_Shield_Windows_11_128_x_128 { + get { + object obj = ResourceManager.GetObject("Toast_Notification_UAC_Shield_Windows_11_128_x_128", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128 { + get { + object obj = ResourceManager.GetObject("Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Toast_Notification_Warning_128_x_115 { + get { + object obj = ResourceManager.GetObject("Toast_Notification_Warning_128_x_115", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Toast_Notification_Windows_10_128_x_121 { + get { + object obj = ResourceManager.GetObject("Toast_Notification_Windows_10_128_x_121", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Toast_Notification_Windows_11_128_x_128 { + get { + object obj = ResourceManager.GetObject("Toast_Notification_Windows_11_128_x_128", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Properties/Resources.resx b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Properties/Resources.resx new file mode 100644 index 000000000..c2ef34485 --- /dev/null +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Properties/Resources.resx @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + ..\Resources\Toast_Notification_Asterisk_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Toast_Notification_Critical_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Toast_Notification_Hand_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Toast_Notification_Information_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Toast_Notification_Ok_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Toast_Notification_Question_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Toast_Notification_Stop_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Toast_Notification_UAC_Shield_Windows_10_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Toast_Notification_UAC_Shield_Windows_11_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Toast_Notification_Warning_128_x_115.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Toast_Notification_Windows_10_128_x_121.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Toast_Notification_Windows_11_128_x_128.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Asterisk_128_x_128.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Asterisk_128_x_128.png similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Asterisk_128_x_128.png rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Asterisk_128_x_128.png diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Critical_128_x_128.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Critical_128_x_128.png similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Critical_128_x_128.png rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Critical_128_x_128.png diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Hand_128_x_128.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Hand_128_x_128.png similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Hand_128_x_128.png rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Hand_128_x_128.png diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Information_128_x_128.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Information_128_x_128.png similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Information_128_x_128.png rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Information_128_x_128.png diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Ok_128_x_128.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Ok_128_x_128.png similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Ok_128_x_128.png rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Ok_128_x_128.png diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Question_128_x_128.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Question_128_x_128.png similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Question_128_x_128.png rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Question_128_x_128.png diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Stop_128_x_128.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Stop_128_x_128.png similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Stop_128_x_128.png rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Stop_128_x_128.png diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_UAC_Shield_Windows_10_128_x_128.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_UAC_Shield_Windows_10_128_x_128.png similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_UAC_Shield_Windows_10_128_x_128.png rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_UAC_Shield_Windows_10_128_x_128.png diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_UAC_Shield_Windows_11_128_x_128.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_UAC_Shield_Windows_11_128_x_128.png similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_UAC_Shield_Windows_11_128_x_128.png rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_UAC_Shield_Windows_11_128_x_128.png diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_UAC_Shield_Windows_7_and_8_128_x_128.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128.png similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_UAC_Shield_Windows_7_and_8_128_x_128.png rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_UAC_Shield_Windows_7_and_8_128_x_128.png diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Warning_128_x_115.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Warning_128_x_115.png similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Warning_128_x_115.png rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Warning_128_x_115.png diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Windows_10_128_x_121.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Windows_10_128_x_121.png similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Windows_10_128_x_121.png rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Windows_10_128_x_121.png diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Windows_11_128_x_128.png b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Windows_11_128_x_128.png similarity index 100% rename from Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toast/Resources/Input_Box_Windows_11_128_x_128.png rename to Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Resources/Toast_Notification_Windows_11_128_x_128.png diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/StrongKrypton.snk b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/StrongKrypton.snk new file mode 100644 index 000000000..19b31088e Binary files /dev/null and b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/StrongKrypton.snk differ diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/GraphicsExtensionMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/GraphicsExtensionMethods.cs index a48076f7e..71528d842 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/GraphicsExtensionMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/GraphicsExtensionMethods.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -38,7 +38,7 @@ public static Color ToGrayScale(this Color originalColour) return originalColour; } - int grayScale = (int)((originalColour.R * .299) + (originalColour.G * .587) + (originalColour.B * .114)); + int grayScale = (int)(originalColour.R * .299 + originalColour.G * .587 + originalColour.B * .114); return Color.FromArgb(grayScale, grayScale, grayScale); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/ImageHelper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/ImageHelper.cs index 5485422ae..c6f328ef3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/ImageHelper.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/ImageHelper.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/ToggleSwitchRendererBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/ToggleSwitchRendererBase.cs index 9d2bd759a..a58e7567e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/ToggleSwitchRendererBase.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/ToggleSwitchRendererBase.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -103,7 +103,7 @@ public void RenderControl(PaintEventArgs e) public void FillBackground(Graphics g, Rectangle controlRectangle) { - Color backColour = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? ToggleSwitch.BackColor.ToGrayScale() : ToggleSwitch.BackColor; + Color backColour = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? ToggleSwitch.BackColor.ToGrayScale() : ToggleSwitch.BackColor; using (Brush backBrush = new SolidBrush(backColour)) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchAndroidKryptonRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchAndroidKryptonRenderer.cs index f1e9e4d67..8b60fee81 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchAndroidKryptonRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchAndroidKryptonRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -183,7 +183,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) if (buttonImage != null || !string.IsNullOrEmpty(buttonText)) { - ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment); + ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment; if (buttonImage != null) { @@ -192,7 +192,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) int imageXPos = (int)adjustedButtonRect.X; - bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit); + bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit; if (scaleImage) { @@ -201,14 +201,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)adjustedButtonRect.X + (((float)adjustedButtonRect.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)adjustedButtonRect.X + ((float)adjustedButtonRect.Width - (float)resizedImageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)adjustedButtonRect.X + (float)adjustedButtonRect.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)adjustedButtonRect.Y + (((float)adjustedButtonRect.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)adjustedButtonRect.Y + ((float)adjustedButtonRect.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -223,14 +223,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)adjustedButtonRect.X + (((float)adjustedButtonRect.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)adjustedButtonRect.X + ((float)adjustedButtonRect.Width - (float)imageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)adjustedButtonRect.X + (float)adjustedButtonRect.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)adjustedButtonRect.Y + (((float)adjustedButtonRect.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)adjustedButtonRect.Y + ((float)adjustedButtonRect.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -258,14 +258,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) if (alignment == ToggleSwitchButtonAlignment.Center) { - textXPos = (float)adjustedButtonRect.X + (((float)adjustedButtonRect.Width - (float)textSize.Width) / 2); + textXPos = (float)adjustedButtonRect.X + ((float)adjustedButtonRect.Width - (float)textSize.Width) / 2; } else if (alignment == ToggleSwitchButtonAlignment.Right) { textXPos = (float)adjustedButtonRect.X + (float)adjustedButtonRect.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)adjustedButtonRect.Y + (((float)adjustedButtonRect.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)adjustedButtonRect.Y + ((float)adjustedButtonRect.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); using (Brush textBrush = new SolidBrush(buttonForeColour)) { @@ -309,7 +309,7 @@ public int GetHalfCathetusLengthBasedOnAngle() double degrees = Math.Abs(SlantAngle); double radians = degrees * (Math.PI / 180); - double length = (Math.Tan(radians) * ToggleSwitch.Height) / 2; + double length = Math.Tan(radians) * ToggleSwitch.Height / 2; return (int)length; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchBrushedMetalKryptonRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchBrushedMetalKryptonRenderer.cs index b4cef9d3b..bfa5834db 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchBrushedMetalKryptonRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchBrushedMetalKryptonRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -86,8 +86,8 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(outerControlPath); - Color borderColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? BorderColour1.ToGrayScale() : BorderColour1; - Color borderColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? BorderColour2.ToGrayScale() : BorderColour2; + Color borderColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? BorderColour1.ToGrayScale() : BorderColour1; + Color borderColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? BorderColour2.ToGrayScale() : BorderColour2; using (Brush borderBrush = new LinearGradientBrush(borderRectangle, borderColour1, borderColour2, LinearGradientMode.Vertical)) { @@ -104,8 +104,8 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(innerControlPath); - Color backColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? BackColour1.ToGrayScale() : BackColour1; - Color backColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? BackColour2.ToGrayScale() : BackColour2; + Color backColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? BackColour1.ToGrayScale() : BackColour1; + Color backColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? BackColour2.ToGrayScale() : BackColour2; using (Brush backgroundBrush = new LinearGradientBrush(borderRectangle, backColour1, backColour2, LinearGradientMode.Horizontal)) { @@ -159,14 +159,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -181,14 +181,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, { if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -208,14 +208,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OnForeColour; @@ -268,14 +268,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -290,14 +290,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle { if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -317,14 +317,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OffForeColour; @@ -375,7 +375,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) } //Draw "metal" surface - PointF centerPoint1 = new PointF(buttonRectangle.X + (buttonRectangle.Width / 2f), buttonRectangle.Y + 1.2f * (buttonRectangle.Height / 2f)); + PointF centerPoint1 = new PointF(buttonRectangle.X + buttonRectangle.Width / 2f, buttonRectangle.Y + 1.2f * (buttonRectangle.Height / 2f)); using (PathGradientBrush firstMetalBrush = GetBrush(new Color[] { @@ -387,7 +387,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) g.FillEllipse(firstMetalBrush, buttonRectangle); } - PointF centerPoint2 = new PointF(buttonRectangle.X + 0.8f * (buttonRectangle.Width / 2f), buttonRectangle.Y + (buttonRectangle.Height / 2f)); + PointF centerPoint2 = new PointF(buttonRectangle.X + 0.8f * (buttonRectangle.Width / 2f), buttonRectangle.Y + buttonRectangle.Height / 2f); using (PathGradientBrush secondMetalBrush = GetBrush(new Color[] { @@ -399,7 +399,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) g.FillEllipse(secondMetalBrush, buttonRectangle); } - PointF centerPoint3 = new PointF(buttonRectangle.X + 1.2f * (buttonRectangle.Width / 2f), buttonRectangle.Y + (buttonRectangle.Height / 2f)); + PointF centerPoint3 = new PointF(buttonRectangle.X + 1.2f * (buttonRectangle.Width / 2f), buttonRectangle.Y + buttonRectangle.Height / 2f); using (PathGradientBrush thirdMetalBrush = GetBrush(new Color[] { @@ -500,7 +500,7 @@ private PathGradientBrush GetBrush(Color[] Colors, RectangleF r, PointF centerPo float cx = r.Width / 2f; float cy = r.Height / 2f; - int w = (int)(Math.Floor((180.0 * (i - 2.0) / i) / 2.0)); + int w = (int)Math.Floor(180.0 * (i - 2.0) / i / 2.0); double wi = w * Math.PI / 180.0; double faktor = 1.0 / Math.Sin(wi); @@ -509,7 +509,7 @@ private PathGradientBrush GetBrush(Color[] Colors, RectangleF r, PointF centerPo while (a <= Math.PI * 2) { - points[n] = new PointF((float)((cx + (Math.Cos(a) * radx))) + r.Left, (float)((cy + (Math.Sin(a) * rady))) + r.Top); + points[n] = new PointF((float)(cx + Math.Cos(a) * radx) + r.Left, (float)(cy + Math.Sin(a) * rady) + r.Top); n += 1; a += (float)(Math.PI * 2 / i); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchCarbonKryptonRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchCarbonKryptonRenderer.cs index f4d4351f1..61583d9a9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchCarbonKryptonRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchCarbonKryptonRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -128,7 +128,7 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(outerBorderPath); - Color outerBorderColor = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? OuterBorderColour.ToGrayScale() : OuterBorderColour; + Color outerBorderColor = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? OuterBorderColour.ToGrayScale() : OuterBorderColour; using (Brush outerBorderBrush = new SolidBrush(outerBorderColor)) { @@ -145,8 +145,8 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(innerBorderPath); - Color borderColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; - Color borderColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; + Color borderColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; + Color borderColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; using (Brush borderBrush = new LinearGradientBrush(borderRectangle, borderColour1, borderColour2, LinearGradientMode.Vertical)) { @@ -172,8 +172,8 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, int gradientRectWidth = leftRectangle.Width + buttonWidth / 2; Rectangle gradientRectangle = new Rectangle(leftRectangle.X, leftRectangle.Y, gradientRectWidth, leftRectangle.Height); - Color leftSideBackColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideBackColour1.ToGrayScale() : LeftSideBackColour1; - Color leftSideBackColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideBackColour2.ToGrayScale() : LeftSideBackColour2; + Color leftSideBackColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideBackColour1.ToGrayScale() : LeftSideBackColour1; + Color leftSideBackColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideBackColour2.ToGrayScale() : LeftSideBackColour2; if (_innerControlPath != null) { @@ -244,14 +244,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -266,14 +266,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, { if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -293,14 +293,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColor = ToggleSwitch.OnForeColour; @@ -331,8 +331,8 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle int gradientRectWidth = rightRectangle.Width + buttonWidth / 2; Rectangle gradientRectangle = new Rectangle(rightRectangle.X - buttonWidth / 2, rightRectangle.Y, gradientRectWidth, rightRectangle.Height); - Color rightSideBackColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideBackColour1.ToGrayScale() : RightSideBackColour1; - Color rightSideBackColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideBackColour2.ToGrayScale() : RightSideBackColour2; + Color rightSideBackColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideBackColour1.ToGrayScale() : RightSideBackColour1; + Color rightSideBackColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideBackColour2.ToGrayScale() : RightSideBackColour2; if (_innerControlPath != null) { @@ -403,14 +403,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -425,14 +425,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle { if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -452,14 +452,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColor = ToggleSwitch.OffForeColour; @@ -554,7 +554,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { g.SetClip(buttonPath); - ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment); + ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment; Size imageSize = buttonImage.Size; @@ -562,7 +562,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) int imageXPos = buttonRectangle.X; - bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit); + bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit; if (scaleImage) { @@ -571,14 +571,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -593,14 +593,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)imageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchFancyKryptonRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchFancyKryptonRenderer.cs index e58ab855f..841e4b901 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchFancyKryptonRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchFancyKryptonRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -127,8 +127,8 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(outerBorderPath); - Color outerBorderColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? OuterBorderColour1.ToGrayScale() : OuterBorderColour1; - Color outerBorderColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? OuterBorderColour2.ToGrayScale() : OuterBorderColour2; + Color outerBorderColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? OuterBorderColour1.ToGrayScale() : OuterBorderColour1; + Color outerBorderColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? OuterBorderColour2.ToGrayScale() : OuterBorderColour2; using (Brush outerBorderBrush = new LinearGradientBrush(borderRectangle, outerBorderColour1, outerBorderColour2, LinearGradientMode.Vertical)) { @@ -145,8 +145,8 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(innerBorderPath); - Color innerBorderColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; - Color innerBorderColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; + Color innerBorderColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; + Color innerBorderColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; using (Brush borderBrush = new LinearGradientBrush(borderRectangle, innerBorderColour1, innerBorderColour2, LinearGradientMode.Vertical)) { @@ -172,8 +172,8 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, int gradientRectWidth = leftRectangle.Width + buttonWidth / 2; Rectangle gradientRectangle = new Rectangle(leftRectangle.X, leftRectangle.Y, gradientRectWidth, leftRectangle.Height); - Color leftSideBackColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideBackColour1.ToGrayScale() : LeftSideBackColour1; - Color leftSideBackColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideBackColour2.ToGrayScale() : LeftSideBackColour2; + Color leftSideBackColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideBackColour1.ToGrayScale() : LeftSideBackColour1; + Color leftSideBackColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideBackColour2.ToGrayScale() : LeftSideBackColour2; if (_innerControlPath != null) { @@ -244,14 +244,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -266,14 +266,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, { if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -293,14 +293,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OnForeColour; @@ -331,8 +331,8 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle int gradientRectWidth = rightRectangle.Width + buttonWidth / 2; Rectangle gradientRectangle = new Rectangle(rightRectangle.X - buttonWidth / 2, rightRectangle.Y, gradientRectWidth, rightRectangle.Height); - Color rightSideBackColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideBackColour1.ToGrayScale() : RightSideBackColour1; - Color rightSideBackColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideBackColour2.ToGrayScale() : RightSideBackColour2; + Color rightSideBackColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideBackColour1.ToGrayScale() : RightSideBackColour1; + Color rightSideBackColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideBackColour2.ToGrayScale() : RightSideBackColour2; if (_innerControlPath != null) { @@ -403,14 +403,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -425,14 +425,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle { if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -452,14 +452,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OffForeColour; @@ -584,7 +584,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { g.SetClip(buttonPath); - ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment); + ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment; Size imageSize = buttonImage.Size; @@ -592,7 +592,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) int imageXPos = buttonRectangle.X; - bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit); + bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit; if (scaleImage) { @@ -601,14 +601,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -623,14 +623,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)imageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchIOS5KryptonRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchIOS5KryptonRenderer.cs index d13b33ad7..31a6a77fa 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchIOS5KryptonRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchIOS5KryptonRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -127,8 +127,8 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, upperGradientPath.AddLine(upperGradientRectangle.X + upperGradientRectangle.Width, upperGradientRectangle.Y, upperGradientRectangle.X + upperGradientRectangle.Width, upperGradientRectangle.Y + upperGradientRectangle.Height); upperGradientPath.AddLine(upperGradientRectangle.X, upperGradientRectangle.Y + upperGradientRectangle.Height, upperGradientRectangle.X + upperGradientRectangle.Width, upperGradientRectangle.Y + upperGradientRectangle.Height); - Color upperColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideUpperColour1.ToGrayScale() : LeftSideUpperColour1; - Color upperColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideUpperColour2.ToGrayScale() : LeftSideUpperColour2; + Color upperColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideUpperColour1.ToGrayScale() : LeftSideUpperColour1; + Color upperColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideUpperColour2.ToGrayScale() : LeftSideUpperColour2; using (Brush upperGradientBrush = new LinearGradientBrush(upperGradientRectangle, upperColour1, upperColour2, LinearGradientMode.Vertical)) { @@ -141,7 +141,7 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, //Draw lower gradient field int lowerGradientRectHeight = (int)Math.Ceiling((double)0.5 * (double)(leftRectangle.Height - 2)); - Rectangle lowerGradientRectangle = new Rectangle(leftRectangle.X, leftRectangle.Y + (leftRectangle.Height / 2), gradientRectWidth, lowerGradientRectHeight); + Rectangle lowerGradientRectangle = new Rectangle(leftRectangle.X, leftRectangle.Y + leftRectangle.Height / 2, gradientRectWidth, lowerGradientRectHeight); g.SetClip(controlClipPath); g.IntersectClip(lowerGradientRectangle); @@ -154,8 +154,8 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, lowerGradientPath.AddLine(lowerGradientRectangle.X + buttonWidth / 4, lowerGradientRectangle.Y + lowerGradientRectangle.Height, lowerGradientRectangle.X + lowerGradientRectangle.Width, lowerGradientRectangle.Y + lowerGradientRectangle.Height); lowerGradientPath.AddArc(1, 1, ToggleSwitch.Height - 1, ToggleSwitch.Height - 1, 90, 70); //Arc from side to bottom - Color lowerColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideLowerColour1.ToGrayScale() : LeftSideLowerColour1; - Color lowerColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideLowerColour2.ToGrayScale() : LeftSideLowerColour2; + Color lowerColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideLowerColour1.ToGrayScale() : LeftSideLowerColour1; + Color lowerColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideLowerColour2.ToGrayScale() : LeftSideLowerColour2; using (Brush lowerGradientBrush = new LinearGradientBrush(lowerGradientRectangle, lowerColour1, lowerColour2, LinearGradientMode.Vertical)) { @@ -180,7 +180,7 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, using (Pen upperBorderPen = new Pen(upperBordercolor)) { - g.DrawLine(upperBorderPen, leftRectangle.X, leftRectangle.Y + 1, leftRectangle.X + leftRectangle.Width + (buttonWidth / 2), leftRectangle.Y + 1); + g.DrawLine(upperBorderPen, leftRectangle.X, leftRectangle.Y + 1, leftRectangle.X + leftRectangle.Width + buttonWidth / 2, leftRectangle.Y + 1); } //Draw lower inside border @@ -193,7 +193,7 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, using (Pen lowerBorderPen = new Pen(lowerBordercolor)) { - g.DrawLine(lowerBorderPen, leftRectangle.X, leftRectangle.Y + leftRectangle.Height - 1, leftRectangle.X + leftRectangle.Width + (buttonWidth / 2), leftRectangle.Y + leftRectangle.Height - 1); + g.DrawLine(lowerBorderPen, leftRectangle.X, leftRectangle.Y + leftRectangle.Height - 1, leftRectangle.X + leftRectangle.Width + buttonWidth / 2, leftRectangle.Y + leftRectangle.Height - 1); } //Draw image or text @@ -217,14 +217,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -239,14 +239,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, { if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -266,14 +266,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OnForeColour; @@ -318,8 +318,8 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle upperGradientPath.AddLine(upperGradientRectangle.X + upperGradientRectangle.Width, upperGradientRectangle.Y + upperGradientRectangle.Height, upperGradientRectangle.X, upperGradientRectangle.Y + upperGradientRectangle.Height); upperGradientPath.AddLine(upperGradientRectangle.X, upperGradientRectangle.Y + upperGradientRectangle.Height, upperGradientRectangle.X, upperGradientRectangle.Y); - Color upperColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideUpperColour1.ToGrayScale() : RightSideUpperColour1; - Color upperColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideUpperColour2.ToGrayScale() : RightSideUpperColour2; + Color upperColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideUpperColour1.ToGrayScale() : RightSideUpperColour1; + Color upperColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideUpperColour2.ToGrayScale() : RightSideUpperColour2; using (Brush upperGradientBrush = new LinearGradientBrush(upperGradientRectangle, upperColour1, upperColour2, LinearGradientMode.Vertical)) { @@ -332,7 +332,7 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle //Draw lower gradient field int lowerGradientRectHeight = (int)Math.Ceiling((double)0.5 * (double)(rightRectangle.Height - 2)); - Rectangle lowerGradientRectangle = new Rectangle(rightRectangle.X - buttonRectangle.Width / 2, rightRectangle.Y + (rightRectangle.Height / 2), gradientRectWidth - 1, lowerGradientRectHeight); + Rectangle lowerGradientRectangle = new Rectangle(rightRectangle.X - buttonRectangle.Width / 2, rightRectangle.Y + rightRectangle.Height / 2, gradientRectWidth - 1, lowerGradientRectHeight); g.SetClip(controlClipPath); g.IntersectClip(lowerGradientRectangle); @@ -345,8 +345,8 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle lowerGradientPath.AddLine(lowerGradientRectangle.X + lowerGradientRectangle.Width, lowerGradientRectangle.Y + lowerGradientRectangle.Height, lowerGradientRectangle.X, lowerGradientRectangle.Y + lowerGradientRectangle.Height); lowerGradientPath.AddLine(lowerGradientRectangle.X, lowerGradientRectangle.Y + lowerGradientRectangle.Height, lowerGradientRectangle.X, lowerGradientRectangle.Y); - Color lowerColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideLowerColour1.ToGrayScale() : RightSideLowerColour1; - Color lowerColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideLowerColour2.ToGrayScale() : RightSideLowerColour2; + Color lowerColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideLowerColour1.ToGrayScale() : RightSideLowerColour1; + Color lowerColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideLowerColour2.ToGrayScale() : RightSideLowerColour2; using (Brush lowerGradientBrush = new LinearGradientBrush(lowerGradientRectangle, lowerColour1, lowerColour2, LinearGradientMode.Vertical)) { @@ -371,7 +371,7 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle using (Pen upperBorderPen = new Pen(upperBordercolour)) { - g.DrawLine(upperBorderPen, rightRectangle.X - (buttonRectangle.Width / 2), rightRectangle.Y + 1, rightRectangle.X + rightRectangle.Width, rightRectangle.Y + 1); + g.DrawLine(upperBorderPen, rightRectangle.X - buttonRectangle.Width / 2, rightRectangle.Y + 1, rightRectangle.X + rightRectangle.Width, rightRectangle.Y + 1); } //Draw lower inside border @@ -384,7 +384,7 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle using (Pen lowerBorderPen = new Pen(lowerBordercolour)) { - g.DrawLine(lowerBorderPen, rightRectangle.X - (buttonRectangle.Width / 2), rightRectangle.Y + rightRectangle.Height - 1, rightRectangle.X + rightRectangle.Width, rightRectangle.Y + rightRectangle.Height - 1); + g.DrawLine(lowerBorderPen, rightRectangle.X - buttonRectangle.Width / 2, rightRectangle.Y + rightRectangle.Height - 1, rightRectangle.X + rightRectangle.Width, rightRectangle.Y + rightRectangle.Height - 1); } //Draw image or text @@ -408,14 +408,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -430,14 +430,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle { if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -457,14 +457,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OffForeColour; @@ -515,7 +515,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) g.SetClip(shadowClipRectangle); - Color buttonShadowColour = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? ButtonShadowColour.ToGrayScale() : ButtonShadowColour; + Color buttonShadowColour = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? ButtonShadowColour.ToGrayScale() : ButtonShadowColour; using (Pen buttonShadowPen = new Pen(buttonShadowColour)) { @@ -620,7 +620,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) using (GraphicsPath borderPath = GetControlClipPath(controlRectangle)) { - Color controlBorderColour = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? BorderColour.ToGrayScale() : BorderColour; + Color controlBorderColour = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? BorderColour.ToGrayScale() : BorderColour; using (Pen borderPen = new Pen(controlBorderColour)) { @@ -637,7 +637,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { g.SetClip(GetButtonClipPath()); - ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment); + ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment; Size imageSize = buttonImage.Size; @@ -645,7 +645,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) int imageXPos = buttonRectangle.X; - bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit); + bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit; if (scaleImage) { @@ -654,14 +654,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -676,14 +676,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)imageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchIphoneKryptonRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchIphoneKryptonRenderer.cs index 2aae88d6a..10f2b6049 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchIphoneKryptonRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchIphoneKryptonRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -117,7 +117,7 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(outerBorderPath); - Color outerBorderColor = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? OuterBorderColour.ToGrayScale() : OuterBorderColour; + Color outerBorderColor = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? OuterBorderColour.ToGrayScale() : OuterBorderColour; using (Brush outerBorderBrush = new SolidBrush(outerBorderColor)) { @@ -134,8 +134,8 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(innerBorderPath); - Color borderColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; - Color borderColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; + Color borderColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; + Color borderColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; using (Brush borderBrush = new LinearGradientBrush(borderRectangle, borderColour1, borderColour2, LinearGradientMode.Vertical)) { @@ -161,8 +161,8 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, int gradientRectWidth = leftRectangle.Width + buttonWidth / 2; Rectangle gradientRectangle = new Rectangle(leftRectangle.X, leftRectangle.Y, gradientRectWidth, leftRectangle.Height); - Color leftSideBackColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideBackColour1.ToGrayScale() : LeftSideBackColour1; - Color leftSideBackColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideBackColour2.ToGrayScale() : LeftSideBackColour2; + Color leftSideBackColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideBackColour1.ToGrayScale() : LeftSideBackColour1; + Color leftSideBackColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideBackColour2.ToGrayScale() : LeftSideBackColour2; if (_innerControlPath != null) { @@ -233,14 +233,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -255,14 +255,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, { if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -282,14 +282,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OnForeColour; @@ -320,8 +320,8 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle int gradientRectWidth = rightRectangle.Width + buttonWidth / 2; Rectangle gradientRectangle = new Rectangle(rightRectangle.X - buttonWidth / 2, rightRectangle.Y, gradientRectWidth, rightRectangle.Height); - Color rightSideBackColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideBackColour1.ToGrayScale() : RightSideBackColour1; - Color rightSideBackColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideBackColour2.ToGrayScale() : RightSideBackColour2; + Color rightSideBackColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideBackColour1.ToGrayScale() : RightSideBackColour1; + Color rightSideBackColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideBackColour2.ToGrayScale() : RightSideBackColour2; if (_innerControlPath != null) { @@ -392,14 +392,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -414,14 +414,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle { if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -441,14 +441,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OffForeColour; @@ -549,7 +549,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { g.SetClip(buttonPath); - ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment); + ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment; Size imageSize = buttonImage.Size; @@ -557,7 +557,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) int imageXPos = buttonRectangle.X; - bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit); + bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit; if (scaleImage) { @@ -566,14 +566,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -588,14 +588,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)imageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchMetroKryptonRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchMetroKryptonRenderer.cs index f7fed6030..db61a6a10 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchMetroKryptonRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchMetroKryptonRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -129,14 +129,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -151,14 +151,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, { if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -178,14 +178,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OnForeColour; @@ -254,14 +254,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -276,14 +276,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle { if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -303,14 +303,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OffForeColour; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchModernKryptonRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchModernKryptonRenderer.cs index d8c692ca3..13992d0b3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchModernKryptonRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchModernKryptonRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -124,7 +124,7 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(outerBorderPath); - Color outerBorderColour = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? OuterBorderColour.ToGrayScale() : OuterBorderColour; + Color outerBorderColour = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? OuterBorderColour.ToGrayScale() : OuterBorderColour; using (Brush outerBorderBrush = new SolidBrush(outerBorderColour)) { @@ -141,8 +141,8 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(innerBorderPath); - Color borderColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; - Color borderColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; + Color borderColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; + Color borderColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; using (Brush borderBrush = new LinearGradientBrush(borderRectangle, borderColour1, borderColour2, LinearGradientMode.Vertical)) { @@ -168,8 +168,8 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, int gradientRectWidth = leftRectangle.Width + buttonWidth / 2; Rectangle gradientRectangle = new Rectangle(leftRectangle.X, leftRectangle.Y, gradientRectWidth, leftRectangle.Height); - Color leftSideBackColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideBackColour1.ToGrayScale() : LeftSideBackColour1; - Color leftSideBackColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideBackColour2.ToGrayScale() : LeftSideBackColour2; + Color leftSideBackColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideBackColour1.ToGrayScale() : LeftSideBackColour1; + Color leftSideBackColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideBackColour2.ToGrayScale() : LeftSideBackColour2; if (_innerControlPath != null) { @@ -240,14 +240,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -262,14 +262,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, { if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -289,14 +289,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OnForeColour; @@ -327,8 +327,8 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle int gradientRectWidth = rightRectangle.Width + buttonWidth / 2; Rectangle gradientRectangle = new Rectangle(rightRectangle.X - buttonWidth / 2, rightRectangle.Y, gradientRectWidth, rightRectangle.Height); - Color rightSideBackColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideBackColour1.ToGrayScale() : RightSideBackColour1; - Color rightSideBackColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideBackColour2.ToGrayScale() : RightSideBackColour2; + Color rightSideBackColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideBackColour1.ToGrayScale() : RightSideBackColour1; + Color rightSideBackColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideBackColour2.ToGrayScale() : RightSideBackColour2; if (_innerControlPath != null) { @@ -399,14 +399,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -421,14 +421,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle { if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -448,14 +448,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OffForeColour; @@ -621,7 +621,7 @@ public GraphicsPath GetArrowLeftPath(Rectangle arrowRectangle) Point top = new Point(arrowRectangle.X + 8, arrowRectangle.Y); Point bottom = new Point(arrowRectangle.X + 8, arrowRectangle.Y + arrowRectangle.Height); - Point tip = new Point(arrowRectangle.X, arrowRectangle.Y + (arrowRectangle.Height / 2)); + Point tip = new Point(arrowRectangle.X, arrowRectangle.Y + arrowRectangle.Height / 2); gp.AddLine(top, bottom); gp.AddLine(bottom, tip); @@ -636,7 +636,7 @@ public GraphicsPath GetArrowRightPath(Rectangle arrowRectangle) Point top = new Point(arrowRectangle.X + 14, arrowRectangle.Y); Point bottom = new Point(arrowRectangle.X + 14, arrowRectangle.Y + arrowRectangle.Height); - Point tip = new Point(arrowRectangle.X + arrowRectangle.Width, arrowRectangle.Y + (arrowRectangle.Height / 2)); + Point tip = new Point(arrowRectangle.X + arrowRectangle.Width, arrowRectangle.Y + arrowRectangle.Height / 2); gp.AddLine(top, bottom); gp.AddLine(bottom, tip); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchOSXKryptonRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchOSXKryptonRenderer.cs index f8358cb83..31dda1108 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchOSXKryptonRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchOSXKryptonRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -112,7 +112,7 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(outerBorderPath); - Color outerBorderColour = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? OuterBorderColour.ToGrayScale() : OuterBorderColour; + Color outerBorderColour = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? OuterBorderColour.ToGrayScale() : OuterBorderColour; using (Brush outerBorderBrush = new SolidBrush(outerBorderColour)) { @@ -129,8 +129,8 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(innerBorderPath); - Color borderColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; - Color borderColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; + Color borderColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; + Color borderColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; using (Brush borderBrush = new LinearGradientBrush(borderRectangle, borderColour1, borderColour2, LinearGradientMode.Vertical)) { @@ -147,8 +147,8 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) g.SetClip(_innerControlPath); - Color backColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? BackColour1.ToGrayScale() : BackColour1; - Color backColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? BackColour2.ToGrayScale() : BackColour2; + Color backColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? BackColour1.ToGrayScale() : BackColour1; + Color backColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? BackColour2.ToGrayScale() : BackColour2; using (Brush backgroundBrush = new LinearGradientBrush(borderRectangle, backColour1, backColour2, LinearGradientMode.Vertical)) { @@ -216,14 +216,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -238,14 +238,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, { if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -265,14 +265,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OnForeColour; @@ -349,14 +349,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -371,14 +371,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle { if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -398,14 +398,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OffForeColour; @@ -500,7 +500,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { g.SetClip(buttonPath); - ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment); + ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment; Size imageSize = buttonImage.Size; @@ -508,7 +508,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) int imageXPos = buttonRectangle.X; - bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit); + bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit; if (scaleImage) { @@ -517,14 +517,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -539,14 +539,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)imageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchPlainAndSimpleKryptonRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchPlainAndSimpleKryptonRenderer.cs index c428e9e35..458147bb0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchPlainAndSimpleKryptonRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Krypton/ToggleSwitchPlainAndSimpleKryptonRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -174,8 +174,8 @@ public GraphicsPath GetInnerBorderClipPath(Rectangle controlRectangle) { Rectangle innerBorderRectangle = new Rectangle(controlRectangle.X + BorderWidth, controlRectangle.Y + BorderWidth, - controlRectangle.Width - (2 * BorderWidth), - controlRectangle.Height - (2 * BorderWidth)); + controlRectangle.Width - 2 * BorderWidth, + controlRectangle.Height - 2 * BorderWidth); GraphicsPath borderPath = new GraphicsPath(); borderPath.AddArc(innerBorderRectangle.X, innerBorderRectangle.Y, innerBorderRectangle.Height, innerBorderRectangle.Height, 90, 180); @@ -191,14 +191,14 @@ public GraphicsPath GetButtonClipPath() GraphicsPath buttonPath = new GraphicsPath(); - buttonPath.AddArc(buttonRectangle.X + ButtonMargin, buttonRectangle.Y + ButtonMargin, buttonRectangle.Height - (2 * ButtonMargin), buttonRectangle.Height - (2 * ButtonMargin), 0, 360); + buttonPath.AddArc(buttonRectangle.X + ButtonMargin, buttonRectangle.Y + ButtonMargin, buttonRectangle.Height - 2 * ButtonMargin, buttonRectangle.Height - 2 * ButtonMargin, 0, 360); return buttonPath; } public override int GetButtonWidth() { - int buttonWidth = ToggleSwitch.Height - (2 * BorderWidth); + int buttonWidth = ToggleSwitch.Height - 2 * BorderWidth; return buttonWidth > 0 ? buttonWidth : 0; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchAndroidRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchAndroidRenderer.cs index e946acd83..61f1b63f1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchAndroidRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchAndroidRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -212,7 +212,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) if (buttonImage != null || !string.IsNullOrEmpty(buttonText)) { - ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment); + ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment; if (buttonImage != null) { @@ -221,7 +221,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) int imageXPos = (int)adjustedButtonRect.X; - bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit); + bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit; if (scaleImage) { @@ -230,14 +230,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)adjustedButtonRect.X + (((float)adjustedButtonRect.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)adjustedButtonRect.X + ((float)adjustedButtonRect.Width - (float)resizedImageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)adjustedButtonRect.X + (float)adjustedButtonRect.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)adjustedButtonRect.Y + (((float)adjustedButtonRect.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)adjustedButtonRect.Y + ((float)adjustedButtonRect.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -252,14 +252,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)adjustedButtonRect.X + (((float)adjustedButtonRect.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)adjustedButtonRect.X + ((float)adjustedButtonRect.Width - (float)imageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)adjustedButtonRect.X + (float)adjustedButtonRect.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)adjustedButtonRect.Y + (((float)adjustedButtonRect.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)adjustedButtonRect.Y + ((float)adjustedButtonRect.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -287,14 +287,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) if (alignment == ToggleSwitchButtonAlignment.Center) { - textXPos = (float)adjustedButtonRect.X + (((float)adjustedButtonRect.Width - (float)textSize.Width) / 2); + textXPos = (float)adjustedButtonRect.X + ((float)adjustedButtonRect.Width - (float)textSize.Width) / 2; } else if (alignment == ToggleSwitchButtonAlignment.Right) { textXPos = (float)adjustedButtonRect.X + (float)adjustedButtonRect.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)adjustedButtonRect.Y + (((float)adjustedButtonRect.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)adjustedButtonRect.Y + ((float)adjustedButtonRect.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); using (Brush textBrush = new SolidBrush(buttonForeColour)) { @@ -338,7 +338,7 @@ public int GetHalfCathetusLengthBasedOnAngle() double degrees = Math.Abs(SlantAngle); double radians = degrees * (Math.PI / 180); - double length = (Math.Tan(radians) * ToggleSwitch.Height) / 2; + double length = Math.Tan(radians) * ToggleSwitch.Height / 2; return (int)length; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchBrushedMetalRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchBrushedMetalRenderer.cs index 7c1f9b8ea..9c24992cb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchBrushedMetalRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchBrushedMetalRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -86,8 +86,8 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(outerControlPath); - Color borderColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? BorderColour1.ToGrayScale() : BorderColour1; - Color borderColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? BorderColour2.ToGrayScale() : BorderColour2; + Color borderColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? BorderColour1.ToGrayScale() : BorderColour1; + Color borderColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? BorderColour2.ToGrayScale() : BorderColour2; using (Brush borderBrush = new LinearGradientBrush(borderRectangle, borderColour1, borderColour2, LinearGradientMode.Vertical)) { @@ -104,8 +104,8 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(innerControlPath); - Color backColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? BackColour1.ToGrayScale() : BackColour1; - Color backColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? BackColour2.ToGrayScale() : BackColour2; + Color backColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? BackColour1.ToGrayScale() : BackColour1; + Color backColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? BackColour2.ToGrayScale() : BackColour2; using (Brush backgroundBrush = new LinearGradientBrush(borderRectangle, backColour1, backColour2, LinearGradientMode.Horizontal)) { @@ -159,14 +159,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -181,14 +181,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, { if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -208,14 +208,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OnForeColour; @@ -268,14 +268,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -290,14 +290,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle { if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -317,14 +317,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OffForeColour; @@ -375,7 +375,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) } //Draw "metal" surface - PointF centerPoint1 = new PointF(buttonRectangle.X + (buttonRectangle.Width / 2f), buttonRectangle.Y + 1.2f * (buttonRectangle.Height / 2f)); + PointF centerPoint1 = new PointF(buttonRectangle.X + buttonRectangle.Width / 2f, buttonRectangle.Y + 1.2f * (buttonRectangle.Height / 2f)); using (PathGradientBrush firstMetalBrush = GetBrush(new Color[] { @@ -387,7 +387,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) g.FillEllipse(firstMetalBrush, buttonRectangle); } - PointF centerPoint2 = new PointF(buttonRectangle.X + 0.8f * (buttonRectangle.Width / 2f), buttonRectangle.Y + (buttonRectangle.Height / 2f)); + PointF centerPoint2 = new PointF(buttonRectangle.X + 0.8f * (buttonRectangle.Width / 2f), buttonRectangle.Y + buttonRectangle.Height / 2f); using (PathGradientBrush secondMetalBrush = GetBrush(new Color[] { @@ -399,7 +399,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) g.FillEllipse(secondMetalBrush, buttonRectangle); } - PointF centerPoint3 = new PointF(buttonRectangle.X + 1.2f * (buttonRectangle.Width / 2f), buttonRectangle.Y + (buttonRectangle.Height / 2f)); + PointF centerPoint3 = new PointF(buttonRectangle.X + 1.2f * (buttonRectangle.Width / 2f), buttonRectangle.Y + buttonRectangle.Height / 2f); using (PathGradientBrush thirdMetalBrush = GetBrush(new Color[] { @@ -500,7 +500,7 @@ private PathGradientBrush GetBrush(Color[] Colors, RectangleF r, PointF centerPo float cx = r.Width / 2f; float cy = r.Height / 2f; - int w = (int)(Math.Floor((180.0 * (i - 2.0) / i) / 2.0)); + int w = (int)Math.Floor(180.0 * (i - 2.0) / i / 2.0); double wi = w * Math.PI / 180.0; double faktor = 1.0 / Math.Sin(wi); @@ -509,7 +509,7 @@ private PathGradientBrush GetBrush(Color[] Colors, RectangleF r, PointF centerPo while (a <= Math.PI * 2) { - points[n] = new PointF((float)((cx + (Math.Cos(a) * radx))) + r.Left, (float)((cy + (Math.Sin(a) * rady))) + r.Top); + points[n] = new PointF((float)(cx + Math.Cos(a) * radx) + r.Left, (float)(cy + Math.Sin(a) * rady) + r.Top); n += 1; a += (float)(Math.PI * 2 / i); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchCarbonRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchCarbonRenderer.cs index 7e71b95fc..1060b789f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchCarbonRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchCarbonRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -128,7 +128,7 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(outerBorderPath); - Color outerBorderColor = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? OuterBorderColour.ToGrayScale() : OuterBorderColour; + Color outerBorderColor = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? OuterBorderColour.ToGrayScale() : OuterBorderColour; using (Brush outerBorderBrush = new SolidBrush(outerBorderColor)) { @@ -145,8 +145,8 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(innerBorderPath); - Color borderColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; - Color borderColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; + Color borderColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; + Color borderColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; using (Brush borderBrush = new LinearGradientBrush(borderRectangle, borderColour1, borderColour2, LinearGradientMode.Vertical)) { @@ -172,8 +172,8 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, int gradientRectWidth = leftRectangle.Width + buttonWidth / 2; Rectangle gradientRectangle = new Rectangle(leftRectangle.X, leftRectangle.Y, gradientRectWidth, leftRectangle.Height); - Color leftSideBackColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideBackColour1.ToGrayScale() : LeftSideBackColour1; - Color leftSideBackColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideBackColour2.ToGrayScale() : LeftSideBackColour2; + Color leftSideBackColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideBackColour1.ToGrayScale() : LeftSideBackColour1; + Color leftSideBackColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideBackColour2.ToGrayScale() : LeftSideBackColour2; if (_innerControlPath != null) { @@ -244,14 +244,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -266,14 +266,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, { if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -293,14 +293,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColor = ToggleSwitch.OnForeColour; @@ -331,8 +331,8 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle int gradientRectWidth = rightRectangle.Width + buttonWidth / 2; Rectangle gradientRectangle = new Rectangle(rightRectangle.X - buttonWidth / 2, rightRectangle.Y, gradientRectWidth, rightRectangle.Height); - Color rightSideBackColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideBackColour1.ToGrayScale() : RightSideBackColour1; - Color rightSideBackColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideBackColour2.ToGrayScale() : RightSideBackColour2; + Color rightSideBackColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideBackColour1.ToGrayScale() : RightSideBackColour1; + Color rightSideBackColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideBackColour2.ToGrayScale() : RightSideBackColour2; if (_innerControlPath != null) { @@ -403,14 +403,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -425,14 +425,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle { if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -452,14 +452,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColor = ToggleSwitch.OffForeColour; @@ -554,7 +554,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { g.SetClip(buttonPath); - ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment); + ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment; Size imageSize = buttonImage.Size; @@ -562,7 +562,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) int imageXPos = buttonRectangle.X; - bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit); + bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit; if (scaleImage) { @@ -571,14 +571,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -593,14 +593,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)imageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchFancyRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchFancyRenderer.cs index 181ff0a73..fe157b5ac 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchFancyRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchFancyRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -127,8 +127,8 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(outerBorderPath); - Color outerBorderColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? OuterBorderColour1.ToGrayScale() : OuterBorderColour1; - Color outerBorderColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? OuterBorderColour2.ToGrayScale() : OuterBorderColour2; + Color outerBorderColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? OuterBorderColour1.ToGrayScale() : OuterBorderColour1; + Color outerBorderColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? OuterBorderColour2.ToGrayScale() : OuterBorderColour2; using (Brush outerBorderBrush = new LinearGradientBrush(borderRectangle, outerBorderColour1, outerBorderColour2, LinearGradientMode.Vertical)) { @@ -145,8 +145,8 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(innerBorderPath); - Color innerBorderColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; - Color innerBorderColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; + Color innerBorderColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; + Color innerBorderColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; using (Brush borderBrush = new LinearGradientBrush(borderRectangle, innerBorderColour1, innerBorderColour2, LinearGradientMode.Vertical)) { @@ -172,8 +172,8 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, int gradientRectWidth = leftRectangle.Width + buttonWidth / 2; Rectangle gradientRectangle = new Rectangle(leftRectangle.X, leftRectangle.Y, gradientRectWidth, leftRectangle.Height); - Color leftSideBackColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideBackColour1.ToGrayScale() : LeftSideBackColour1; - Color leftSideBackColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideBackColour2.ToGrayScale() : LeftSideBackColour2; + Color leftSideBackColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideBackColour1.ToGrayScale() : LeftSideBackColour1; + Color leftSideBackColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideBackColour2.ToGrayScale() : LeftSideBackColour2; if (_innerControlPath != null) { @@ -244,14 +244,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -266,14 +266,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, { if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -293,14 +293,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OnForeColour; @@ -331,8 +331,8 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle int gradientRectWidth = rightRectangle.Width + buttonWidth / 2; Rectangle gradientRectangle = new Rectangle(rightRectangle.X - buttonWidth / 2, rightRectangle.Y, gradientRectWidth, rightRectangle.Height); - Color rightSideBackColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideBackColour1.ToGrayScale() : RightSideBackColour1; - Color rightSideBackColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideBackColour2.ToGrayScale() : RightSideBackColour2; + Color rightSideBackColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideBackColour1.ToGrayScale() : RightSideBackColour1; + Color rightSideBackColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideBackColour2.ToGrayScale() : RightSideBackColour2; if (_innerControlPath != null) { @@ -403,14 +403,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -425,14 +425,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle { if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -452,14 +452,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OffForeColour; @@ -584,7 +584,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { g.SetClip(buttonPath); - ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment); + ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment; Size imageSize = buttonImage.Size; @@ -592,7 +592,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) int imageXPos = buttonRectangle.X; - bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit); + bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit; if (scaleImage) { @@ -601,14 +601,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -623,14 +623,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)imageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchIOS5Renderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchIOS5Renderer.cs index 7bbb35713..cbb40f039 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchIOS5Renderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchIOS5Renderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -127,8 +127,8 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, upperGradientPath.AddLine(upperGradientRectangle.X + upperGradientRectangle.Width, upperGradientRectangle.Y, upperGradientRectangle.X + upperGradientRectangle.Width, upperGradientRectangle.Y + upperGradientRectangle.Height); upperGradientPath.AddLine(upperGradientRectangle.X, upperGradientRectangle.Y + upperGradientRectangle.Height, upperGradientRectangle.X + upperGradientRectangle.Width, upperGradientRectangle.Y + upperGradientRectangle.Height); - Color upperColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideUpperColour1.ToGrayScale() : LeftSideUpperColour1; - Color upperColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideUpperColour2.ToGrayScale() : LeftSideUpperColour2; + Color upperColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideUpperColour1.ToGrayScale() : LeftSideUpperColour1; + Color upperColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideUpperColour2.ToGrayScale() : LeftSideUpperColour2; using (Brush upperGradientBrush = new LinearGradientBrush(upperGradientRectangle, upperColour1, upperColour2, LinearGradientMode.Vertical)) { @@ -141,7 +141,7 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, //Draw lower gradient field int lowerGradientRectHeight = (int)Math.Ceiling((double)0.5 * (double)(leftRectangle.Height - 2)); - Rectangle lowerGradientRectangle = new Rectangle(leftRectangle.X, leftRectangle.Y + (leftRectangle.Height / 2), gradientRectWidth, lowerGradientRectHeight); + Rectangle lowerGradientRectangle = new Rectangle(leftRectangle.X, leftRectangle.Y + leftRectangle.Height / 2, gradientRectWidth, lowerGradientRectHeight); g.SetClip(controlClipPath); g.IntersectClip(lowerGradientRectangle); @@ -154,8 +154,8 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, lowerGradientPath.AddLine(lowerGradientRectangle.X + buttonWidth / 4, lowerGradientRectangle.Y + lowerGradientRectangle.Height, lowerGradientRectangle.X + lowerGradientRectangle.Width, lowerGradientRectangle.Y + lowerGradientRectangle.Height); lowerGradientPath.AddArc(1, 1, ToggleSwitch.Height - 1, ToggleSwitch.Height - 1, 90, 70); //Arc from side to bottom - Color lowerColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideLowerColour1.ToGrayScale() : LeftSideLowerColour1; - Color lowerColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideLowerColour2.ToGrayScale() : LeftSideLowerColour2; + Color lowerColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideLowerColour1.ToGrayScale() : LeftSideLowerColour1; + Color lowerColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideLowerColour2.ToGrayScale() : LeftSideLowerColour2; using (Brush lowerGradientBrush = new LinearGradientBrush(lowerGradientRectangle, lowerColour1, lowerColour2, LinearGradientMode.Vertical)) { @@ -180,7 +180,7 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, using (Pen upperBorderPen = new Pen(upperBordercolor)) { - g.DrawLine(upperBorderPen, leftRectangle.X, leftRectangle.Y + 1, leftRectangle.X + leftRectangle.Width + (buttonWidth / 2), leftRectangle.Y + 1); + g.DrawLine(upperBorderPen, leftRectangle.X, leftRectangle.Y + 1, leftRectangle.X + leftRectangle.Width + buttonWidth / 2, leftRectangle.Y + 1); } //Draw lower inside border @@ -193,7 +193,7 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, using (Pen lowerBorderPen = new Pen(lowerBordercolor)) { - g.DrawLine(lowerBorderPen, leftRectangle.X, leftRectangle.Y + leftRectangle.Height - 1, leftRectangle.X + leftRectangle.Width + (buttonWidth / 2), leftRectangle.Y + leftRectangle.Height - 1); + g.DrawLine(lowerBorderPen, leftRectangle.X, leftRectangle.Y + leftRectangle.Height - 1, leftRectangle.X + leftRectangle.Width + buttonWidth / 2, leftRectangle.Y + leftRectangle.Height - 1); } //Draw image or text @@ -217,14 +217,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -239,14 +239,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, { if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -266,14 +266,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OnForeColour; @@ -318,8 +318,8 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle upperGradientPath.AddLine(upperGradientRectangle.X + upperGradientRectangle.Width, upperGradientRectangle.Y + upperGradientRectangle.Height, upperGradientRectangle.X, upperGradientRectangle.Y + upperGradientRectangle.Height); upperGradientPath.AddLine(upperGradientRectangle.X, upperGradientRectangle.Y + upperGradientRectangle.Height, upperGradientRectangle.X, upperGradientRectangle.Y); - Color upperColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideUpperColour1.ToGrayScale() : RightSideUpperColour1; - Color upperColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideUpperColour2.ToGrayScale() : RightSideUpperColour2; + Color upperColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideUpperColour1.ToGrayScale() : RightSideUpperColour1; + Color upperColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideUpperColour2.ToGrayScale() : RightSideUpperColour2; using (Brush upperGradientBrush = new LinearGradientBrush(upperGradientRectangle, upperColour1, upperColour2, LinearGradientMode.Vertical)) { @@ -332,7 +332,7 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle //Draw lower gradient field int lowerGradientRectHeight = (int)Math.Ceiling((double)0.5 * (double)(rightRectangle.Height - 2)); - Rectangle lowerGradientRectangle = new Rectangle(rightRectangle.X - buttonRectangle.Width / 2, rightRectangle.Y + (rightRectangle.Height / 2), gradientRectWidth - 1, lowerGradientRectHeight); + Rectangle lowerGradientRectangle = new Rectangle(rightRectangle.X - buttonRectangle.Width / 2, rightRectangle.Y + rightRectangle.Height / 2, gradientRectWidth - 1, lowerGradientRectHeight); g.SetClip(controlClipPath); g.IntersectClip(lowerGradientRectangle); @@ -345,8 +345,8 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle lowerGradientPath.AddLine(lowerGradientRectangle.X + lowerGradientRectangle.Width, lowerGradientRectangle.Y + lowerGradientRectangle.Height, lowerGradientRectangle.X, lowerGradientRectangle.Y + lowerGradientRectangle.Height); lowerGradientPath.AddLine(lowerGradientRectangle.X, lowerGradientRectangle.Y + lowerGradientRectangle.Height, lowerGradientRectangle.X, lowerGradientRectangle.Y); - Color lowerColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideLowerColour1.ToGrayScale() : RightSideLowerColour1; - Color lowerColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideLowerColour2.ToGrayScale() : RightSideLowerColour2; + Color lowerColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideLowerColour1.ToGrayScale() : RightSideLowerColour1; + Color lowerColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideLowerColour2.ToGrayScale() : RightSideLowerColour2; using (Brush lowerGradientBrush = new LinearGradientBrush(lowerGradientRectangle, lowerColour1, lowerColour2, LinearGradientMode.Vertical)) { @@ -371,7 +371,7 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle using (Pen upperBorderPen = new Pen(upperBordercolour)) { - g.DrawLine(upperBorderPen, rightRectangle.X - (buttonRectangle.Width / 2), rightRectangle.Y + 1, rightRectangle.X + rightRectangle.Width, rightRectangle.Y + 1); + g.DrawLine(upperBorderPen, rightRectangle.X - buttonRectangle.Width / 2, rightRectangle.Y + 1, rightRectangle.X + rightRectangle.Width, rightRectangle.Y + 1); } //Draw lower inside border @@ -384,7 +384,7 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle using (Pen lowerBorderPen = new Pen(lowerBordercolour)) { - g.DrawLine(lowerBorderPen, rightRectangle.X - (buttonRectangle.Width / 2), rightRectangle.Y + rightRectangle.Height - 1, rightRectangle.X + rightRectangle.Width, rightRectangle.Y + rightRectangle.Height - 1); + g.DrawLine(lowerBorderPen, rightRectangle.X - buttonRectangle.Width / 2, rightRectangle.Y + rightRectangle.Height - 1, rightRectangle.X + rightRectangle.Width, rightRectangle.Y + rightRectangle.Height - 1); } //Draw image or text @@ -408,14 +408,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -430,14 +430,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle { if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -457,14 +457,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OffForeColour; @@ -515,7 +515,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) g.SetClip(shadowClipRectangle); - Color buttonShadowColour = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? ButtonShadowColour.ToGrayScale() : ButtonShadowColour; + Color buttonShadowColour = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? ButtonShadowColour.ToGrayScale() : ButtonShadowColour; using (Pen buttonShadowPen = new Pen(buttonShadowColour)) { @@ -620,7 +620,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) using (GraphicsPath borderPath = GetControlClipPath(controlRectangle)) { - Color controlBorderColour = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? BorderColour.ToGrayScale() : BorderColour; + Color controlBorderColour = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? BorderColour.ToGrayScale() : BorderColour; using (Pen borderPen = new Pen(controlBorderColour)) { @@ -637,7 +637,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { g.SetClip(GetButtonClipPath()); - ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment); + ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment; Size imageSize = buttonImage.Size; @@ -645,7 +645,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) int imageXPos = buttonRectangle.X; - bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit); + bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit; if (scaleImage) { @@ -654,14 +654,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -676,14 +676,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)imageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchIphoneRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchIphoneRenderer.cs index 0bc8672a5..5d281a6dd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchIphoneRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchIphoneRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -117,7 +117,7 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(outerBorderPath); - Color outerBorderColor = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? OuterBorderColour.ToGrayScale() : OuterBorderColour; + Color outerBorderColor = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? OuterBorderColour.ToGrayScale() : OuterBorderColour; using (Brush outerBorderBrush = new SolidBrush(outerBorderColor)) { @@ -134,8 +134,8 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(innerBorderPath); - Color borderColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; - Color borderColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; + Color borderColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; + Color borderColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; using (Brush borderBrush = new LinearGradientBrush(borderRectangle, borderColour1, borderColour2, LinearGradientMode.Vertical)) { @@ -161,8 +161,8 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, int gradientRectWidth = leftRectangle.Width + buttonWidth / 2; Rectangle gradientRectangle = new Rectangle(leftRectangle.X, leftRectangle.Y, gradientRectWidth, leftRectangle.Height); - Color leftSideBackColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideBackColour1.ToGrayScale() : LeftSideBackColour1; - Color leftSideBackColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideBackColour2.ToGrayScale() : LeftSideBackColour2; + Color leftSideBackColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideBackColour1.ToGrayScale() : LeftSideBackColour1; + Color leftSideBackColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideBackColour2.ToGrayScale() : LeftSideBackColour2; if (_innerControlPath != null) { @@ -233,14 +233,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -255,14 +255,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, { if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -282,14 +282,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OnForeColour; @@ -320,8 +320,8 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle int gradientRectWidth = rightRectangle.Width + buttonWidth / 2; Rectangle gradientRectangle = new Rectangle(rightRectangle.X - buttonWidth / 2, rightRectangle.Y, gradientRectWidth, rightRectangle.Height); - Color rightSideBackColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideBackColour1.ToGrayScale() : RightSideBackColour1; - Color rightSideBackColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideBackColour2.ToGrayScale() : RightSideBackColour2; + Color rightSideBackColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideBackColour1.ToGrayScale() : RightSideBackColour1; + Color rightSideBackColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideBackColour2.ToGrayScale() : RightSideBackColour2; if (_innerControlPath != null) { @@ -392,14 +392,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -414,14 +414,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle { if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -441,14 +441,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OffForeColour; @@ -549,7 +549,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { g.SetClip(buttonPath); - ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment); + ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment; Size imageSize = buttonImage.Size; @@ -557,7 +557,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) int imageXPos = buttonRectangle.X; - bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit); + bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit; if (scaleImage) { @@ -566,14 +566,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -588,14 +588,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)imageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchMetroRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchMetroRenderer.cs index df812819c..e68c0cbfa 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchMetroRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchMetroRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -129,14 +129,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -151,14 +151,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, { if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -178,14 +178,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OnForeColour; @@ -254,14 +254,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -276,14 +276,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle { if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -303,14 +303,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OffForeColour; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchModernRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchModernRenderer.cs index cfd8fdffe..ede012f60 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchModernRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchModernRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -124,7 +124,7 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(outerBorderPath); - Color outerBorderColour = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? OuterBorderColour.ToGrayScale() : OuterBorderColour; + Color outerBorderColour = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? OuterBorderColour.ToGrayScale() : OuterBorderColour; using (Brush outerBorderBrush = new SolidBrush(outerBorderColour)) { @@ -141,8 +141,8 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(innerBorderPath); - Color borderColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; - Color borderColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; + Color borderColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; + Color borderColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; using (Brush borderBrush = new LinearGradientBrush(borderRectangle, borderColour1, borderColour2, LinearGradientMode.Vertical)) { @@ -168,8 +168,8 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, int gradientRectWidth = leftRectangle.Width + buttonWidth / 2; Rectangle gradientRectangle = new Rectangle(leftRectangle.X, leftRectangle.Y, gradientRectWidth, leftRectangle.Height); - Color leftSideBackColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideBackColour1.ToGrayScale() : LeftSideBackColour1; - Color leftSideBackColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? LeftSideBackColour2.ToGrayScale() : LeftSideBackColour2; + Color leftSideBackColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideBackColour1.ToGrayScale() : LeftSideBackColour1; + Color leftSideBackColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? LeftSideBackColour2.ToGrayScale() : LeftSideBackColour2; if (_innerControlPath != null) { @@ -240,14 +240,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -262,14 +262,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, { if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -289,14 +289,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OnForeColour; @@ -327,8 +327,8 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle int gradientRectWidth = rightRectangle.Width + buttonWidth / 2; Rectangle gradientRectangle = new Rectangle(rightRectangle.X - buttonWidth / 2, rightRectangle.Y, gradientRectWidth, rightRectangle.Height); - Color rightSideBackColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideBackColour1.ToGrayScale() : RightSideBackColour1; - Color rightSideBackColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? RightSideBackColour2.ToGrayScale() : RightSideBackColour2; + Color rightSideBackColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideBackColour1.ToGrayScale() : RightSideBackColour1; + Color rightSideBackColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? RightSideBackColour2.ToGrayScale() : RightSideBackColour2; if (_innerControlPath != null) { @@ -399,14 +399,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -421,14 +421,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle { if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -448,14 +448,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OffForeColour; @@ -621,7 +621,7 @@ public GraphicsPath GetArrowLeftPath(Rectangle arrowRectangle) Point top = new Point(arrowRectangle.X + 8, arrowRectangle.Y); Point bottom = new Point(arrowRectangle.X + 8, arrowRectangle.Y + arrowRectangle.Height); - Point tip = new Point(arrowRectangle.X, arrowRectangle.Y + (arrowRectangle.Height / 2)); + Point tip = new Point(arrowRectangle.X, arrowRectangle.Y + arrowRectangle.Height / 2); gp.AddLine(top, bottom); gp.AddLine(bottom, tip); @@ -636,7 +636,7 @@ public GraphicsPath GetArrowRightPath(Rectangle arrowRectangle) Point top = new Point(arrowRectangle.X + 14, arrowRectangle.Y); Point bottom = new Point(arrowRectangle.X + 14, arrowRectangle.Y + arrowRectangle.Height); - Point tip = new Point(arrowRectangle.X + arrowRectangle.Width, arrowRectangle.Y + (arrowRectangle.Height / 2)); + Point tip = new Point(arrowRectangle.X + arrowRectangle.Width, arrowRectangle.Y + arrowRectangle.Height / 2); gp.AddLine(top, bottom); gp.AddLine(bottom, tip); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchOSXRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchOSXRenderer.cs index bef6419d5..771883a57 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchOSXRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchOSXRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -112,7 +112,7 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(outerBorderPath); - Color outerBorderColour = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? OuterBorderColour.ToGrayScale() : OuterBorderColour; + Color outerBorderColour = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? OuterBorderColour.ToGrayScale() : OuterBorderColour; using (Brush outerBorderBrush = new SolidBrush(outerBorderColour)) { @@ -129,8 +129,8 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) { g.SetClip(innerBorderPath); - Color borderColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; - Color borderColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; + Color borderColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour1.ToGrayScale() : InnerBorderColour1; + Color borderColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? InnerBorderColour2.ToGrayScale() : InnerBorderColour2; using (Brush borderBrush = new LinearGradientBrush(borderRectangle, borderColour1, borderColour2, LinearGradientMode.Vertical)) { @@ -147,8 +147,8 @@ public override void RenderBorder(Graphics g, Rectangle borderRectangle) g.SetClip(_innerControlPath); - Color backColour1 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? BackColour1.ToGrayScale() : BackColour1; - Color backColour2 = (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) ? BackColour2.ToGrayScale() : BackColour2; + Color backColour1 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? BackColour1.ToGrayScale() : BackColour1; + Color backColour2 = !ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled ? BackColour2.ToGrayScale() : BackColour2; using (Brush backgroundBrush = new LinearGradientBrush(borderRectangle, backColour1, backColour2, LinearGradientMode.Vertical)) { @@ -216,14 +216,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -238,14 +238,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, { if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -265,14 +265,14 @@ public override void RenderLeftToggleField(Graphics g, Rectangle leftRectangle, if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OnSideAlignment == ToggleSwitchAlignment.Near) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OnForeColour; @@ -349,14 +349,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -371,14 +371,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle { if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - imageXPos = (int)((float)fullRectangle.X + (((float)fullRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)fullRectangle.X + ((float)fullRectangle.Width - (float)imageSize.Width) / 2); } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { imageXPos = (int)((float)fullRectangle.X + (float)fullRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + (((float)fullRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)fullRectangle.Y + ((float)fullRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -398,14 +398,14 @@ public override void RenderRightToggleField(Graphics g, Rectangle rightRectangle if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Center) { - textXPos = (float)fullRectangle.X + (((float)fullRectangle.Width - (float)textSize.Width) / 2); + textXPos = (float)fullRectangle.X + ((float)fullRectangle.Width - (float)textSize.Width) / 2; } else if (ToggleSwitch.OffSideAlignment == ToggleSwitchAlignment.Far) { textXPos = (float)fullRectangle.X + (float)fullRectangle.Width - (float)textSize.Width; } - RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + (((float)fullRectangle.Height - (float)textSize.Height) / 2), textSize.Width, textSize.Height); + RectangleF textRectangle = new RectangleF(textXPos, (float)fullRectangle.Y + ((float)fullRectangle.Height - (float)textSize.Height) / 2, textSize.Width, textSize.Height); Color textForeColour = ToggleSwitch.OffForeColour; @@ -500,7 +500,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { g.SetClip(buttonPath); - ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment); + ToggleSwitchButtonAlignment alignment = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonAlignment : ToggleSwitch.Checked ? ToggleSwitch.OnButtonAlignment : ToggleSwitch.OffButtonAlignment; Size imageSize = buttonImage.Size; @@ -508,7 +508,7 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) int imageXPos = buttonRectangle.X; - bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : (ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit); + bool scaleImage = ToggleSwitch.ButtonImage != null ? ToggleSwitch.ButtonScaleImageToFit : ToggleSwitch.Checked ? ToggleSwitch.OnButtonScaleImageToFit : ToggleSwitch.OffButtonScaleImageToFit; if (scaleImage) { @@ -517,14 +517,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)resizedImageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)resizedImageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2)), resizedImageSize.Width, resizedImageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)resizedImageSize.Height) / 2), resizedImageSize.Width, resizedImageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { @@ -539,14 +539,14 @@ public override void RenderButton(Graphics g, Rectangle buttonRectangle) { if (alignment == ToggleSwitchButtonAlignment.Center) { - imageXPos = (int)((float)buttonRectangle.X + (((float)buttonRectangle.Width - (float)imageSize.Width) / 2)); + imageXPos = (int)((float)buttonRectangle.X + ((float)buttonRectangle.Width - (float)imageSize.Width) / 2); } else if (alignment == ToggleSwitchButtonAlignment.Right) { imageXPos = (int)((float)buttonRectangle.X + (float)buttonRectangle.Width - (float)imageSize.Width); } - imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + (((float)buttonRectangle.Height - (float)imageSize.Height) / 2)), imageSize.Width, imageSize.Height); + imageRectangle = new Rectangle(imageXPos, (int)((float)buttonRectangle.Y + ((float)buttonRectangle.Height - (float)imageSize.Height) / 2), imageSize.Width, imageSize.Height); if (!ToggleSwitch.Enabled && ToggleSwitch.GrayWhenDisabled) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchPlainAndSimpleRenderer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchPlainAndSimpleRenderer.cs index a28e13574..ce8365f95 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchPlainAndSimpleRenderer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Classes/Renderer/Types/Vanilla/ToggleSwitchPlainAndSimpleRenderer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -174,8 +174,8 @@ public GraphicsPath GetInnerBorderClipPath(Rectangle controlRectangle) { Rectangle innerBorderRectangle = new Rectangle(controlRectangle.X + BorderWidth, controlRectangle.Y + BorderWidth, - controlRectangle.Width - (2 * BorderWidth), - controlRectangle.Height - (2 * BorderWidth)); + controlRectangle.Width - 2 * BorderWidth, + controlRectangle.Height - 2 * BorderWidth); GraphicsPath borderPath = new GraphicsPath(); borderPath.AddArc(innerBorderRectangle.X, innerBorderRectangle.Y, innerBorderRectangle.Height, innerBorderRectangle.Height, 90, 180); @@ -191,14 +191,14 @@ public GraphicsPath GetButtonClipPath() GraphicsPath buttonPath = new GraphicsPath(); - buttonPath.AddArc(buttonRectangle.X + ButtonMargin, buttonRectangle.Y + ButtonMargin, buttonRectangle.Height - (2 * ButtonMargin), buttonRectangle.Height - (2 * ButtonMargin), 0, 360); + buttonPath.AddArc(buttonRectangle.X + ButtonMargin, buttonRectangle.Y + ButtonMargin, buttonRectangle.Height - 2 * ButtonMargin, buttonRectangle.Height - 2 * ButtonMargin, 0, 360); return buttonPath; } public override int GetButtonWidth() { - int buttonWidth = ToggleSwitch.Height - (2 * BorderWidth); + int buttonWidth = ToggleSwitch.Height - 2 * BorderWidth; return buttonWidth > 0 ? buttonWidth : 0; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Controls/KryptonToggleSwitchVersion1.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Controls/KryptonToggleSwitchVersion1.cs index 306500b8c..2d13108fe 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Controls/KryptonToggleSwitchVersion1.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Controls/KryptonToggleSwitchVersion1.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -410,7 +410,7 @@ public bool AllowUserChange [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public string CheckedString => Checked ? (string.IsNullOrEmpty(OnText) ? "ON" : OnText) : (string.IsNullOrEmpty(OffText) ? "OFF" : OffText); + public string CheckedString => Checked ? string.IsNullOrEmpty(OnText) ? "ON" : OnText : string.IsNullOrEmpty(OffText) ? "OFF" : OffText; [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] @@ -960,19 +960,19 @@ internal int ButtonValue [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - internal bool IsButtonOnLeftSide => (ButtonValue <= 0); + internal bool IsButtonOnLeftSide => ButtonValue <= 0; [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - internal bool IsButtonOnRightSide => (ButtonValue >= (Width - _renderer.GetButtonWidth())); + internal bool IsButtonOnRightSide => ButtonValue >= Width - _renderer.GetButtonWidth(); [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - internal bool IsButtonMovingLeft => (_animating && !IsButtonOnLeftSide && _animationResult == false); + internal bool IsButtonMovingLeft => _animating && !IsButtonOnLeftSide && _animationResult == false; [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - internal bool IsButtonMovingRight => (_animating && !IsButtonOnRightSide && _animationResult == true); + internal bool IsButtonMovingRight => _animating && !IsButtonOnRightSide && _animationResult == true; [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] @@ -1123,11 +1123,11 @@ protected override void OnMouseUp(MouseEventArgs e) if (_moving) { - int percentage = (int)((100 * (double)ButtonValue) / ((double)Width - (double)buttonWidth)); + int percentage = (int)(100 * (double)ButtonValue / ((double)Width - (double)buttonWidth)); if (_checked) { - if (percentage <= (100 - _thresholdPercentage)) + if (percentage <= 100 - _thresholdPercentage) { _animationTarget = 0; BeginAnimation(false); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Controls/KryptonToggleSwitchVersion2.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Controls/KryptonToggleSwitchVersion2.cs index 2a1800aaf..c9299049b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Controls/KryptonToggleSwitchVersion2.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Controls/KryptonToggleSwitchVersion2.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Enumerations/ToggleSwitchAlignment.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Enumerations/ToggleSwitchAlignment.cs index 2b6d64ec1..c58a2e4bd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Enumerations/ToggleSwitchAlignment.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Enumerations/ToggleSwitchAlignment.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Enumerations/ToggleSwitchButtonAlignment.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Enumerations/ToggleSwitchButtonAlignment.cs index 3123ce737..c066f5b45 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Enumerations/ToggleSwitchButtonAlignment.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Enumerations/ToggleSwitchButtonAlignment.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Enumerations/ToggleSwitchStyle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Enumerations/ToggleSwitchStyle.cs index c66395787..5f11ebe1c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Enumerations/ToggleSwitchStyle.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Enumerations/ToggleSwitchStyle.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Enumerations/ToggleValueState.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Enumerations/ToggleValueState.cs index b3ca7176e..be4a2b0ac 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Enumerations/ToggleValueState.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Enumerations/ToggleValueState.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Events/BeforeRenderingEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Events/BeforeRenderingEventArgs.cs index dc61b69b7..6f708953f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Events/BeforeRenderingEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Events/BeforeRenderingEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Events/SliderValueChangedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Events/SliderValueChangedEventArgs.cs index 0d01a7f5a..017cf7b5d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Events/SliderValueChangedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Events/SliderValueChangedEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Globals/GlobalDeclarations.cs index e07e1fd6c..b4bb568ca 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Interfaces/IValues.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Interfaces/IValues.cs index 59a3b595e..e15fda35c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Interfaces/IValues.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Interfaces/IValues.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Krypton.Toolkit.Suite.Extended.Toggle.Switch 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Krypton.Toolkit.Suite.Extended.Toggle.Switch 2022.csproj index 312586de9..5441ea711 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Krypton.Toolkit.Suite.Extended.Toggle.Switch 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Krypton.Toolkit.Suite.Extended.Toggle.Switch 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - + - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements toggle switch controls. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements toggle switch controls. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -87,7 +75,7 @@ - + @@ -97,7 +85,7 @@ - + @@ -107,7 +95,7 @@ - + @@ -117,7 +105,7 @@ - + @@ -148,7 +136,7 @@ - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Krypton.Toolkit.Suite.Extended.Toggle.Switch.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Krypton.Toolkit.Suite.Extended.Toggle.Switch.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Krypton.Toolkit.Suite.Extended.Toggle.Switch.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Krypton.Toolkit.Suite.Extended.Toggle.Switch.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolBoxItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolBoxItem.cs index 23c3d94b7..2ae6d9ed1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolBoxItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolBoxItem.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -291,7 +291,7 @@ public virtual bool HitTest(int x, int y) if (rcTemp.Bottom >= parentTab.ItemArea.Bottom - 0) { - rcTemp.Height = (parentTab.ItemArea.Bottom - 0) - rcTemp.Top; + rcTemp.Height = parentTab.ItemArea.Bottom - 0 - rcTemp.Top; } bHit = rcTemp.Contains(x, y); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolBoxItemCollection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolBoxItemCollection.cs index 07c3d03ea..fecf933c4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolBoxItemCollection.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolBoxItemCollection.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolBoxTab.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolBoxTab.cs index e6478c5c4..8a3afa57c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolBoxTab.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolBoxTab.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -748,7 +748,7 @@ private void CheckMouseMoveForItems(MouseEventArgs e) // any item lies in the mouse coords. index = HitTestItem(e.X, e.Y); - bFound = (-1 != index); + bFound = -1 != index; if (bFound) { @@ -770,7 +770,7 @@ private void CheckMouseMoveForItems(MouseEventArgs e) _parent.UpdateToolTip(""); } - //System.Diagnostics.Debug.WriteLine("ItemArea HitTest : Found " + index.ToString()); + //DebugUtilities.WriteLine("ItemArea HitTest : Found " + index.ToString()); } else { @@ -900,7 +900,7 @@ public bool HandleKeyDown(KeyEventArgs e) { bool handled = false; - if (Keys.Enter == e.KeyCode || Keys.Space == e.KeyCode) + if (e.KeyCode is Keys.Enter or Keys.Space) { HandleAmbientKey(false); handled = true; @@ -924,7 +924,7 @@ public bool HandleKeyUp(KeyEventArgs e) { bool handled = false; - if (Keys.Enter == e.KeyCode || Keys.Space == e.KeyCode) + if (e.KeyCode is Keys.Enter or Keys.Space) { HandleAmbientKey(true); handled = true; @@ -1007,7 +1007,7 @@ private void DoPainting(PaintEventArgs e) { txBrush = SystemBrushes.ControlText; - //System.Diagnostics.Debug.WriteLine(Environment.TickCount + " Drawing tab MouseHover " + _mouseHover + " Selected " + _selected); + //DebugUtilities.WriteLine(Environment.TickCount + " Drawing tab MouseHover " + _mouseHover + " Selected " + _selected); if (_mouseHover) { @@ -1206,7 +1206,7 @@ private void PaintItems(Graphics g, Rectangle clipRect, StringFormat strFormat) rect.Y += _itemArea.Y; - //System.Diagnostics.Debug.WriteLine("Checking Painting item " + iLoop); + //DebugUtilities.WriteLine("Checking Painting item " + iLoop); if (rect.Bottom <= _itemArea.Top) { @@ -1219,11 +1219,11 @@ private void PaintItems(Graphics g, Rectangle clipRect, StringFormat strFormat) if (!rect.IntersectsWith(clipRect)) { - //System.Diagnostics.Debug.WriteLine("ItemRect not in ClipRect " + iLoop + " @ " + System.Environment.TickCount ); + //DebugUtilities.WriteLine("ItemRect not in ClipRect " + iLoop + " @ " + System.Environment.TickCount ); continue; } - //System.Diagnostics.Debug.WriteLine("Painting item " + iLoop); + //DebugUtilities.WriteLine("Painting item " + iLoop); // Draw background. // Thanks to Neal Stublen for the suggestions to make the @@ -1255,7 +1255,7 @@ private void PaintItems(Graphics g, Rectangle clipRect, StringFormat strFormat) } // Draw border - if ((item.MouseDown || item.Selected)) + if (item.MouseDown || item.Selected) { KryptonToolBox.DrawBorders(g, rect, true, _itemBorderColour.IsEmpty ? _parent.ItemBorderColour : _itemBorderColour); } @@ -1309,7 +1309,7 @@ private void PaintItems(Graphics g, Rectangle clipRect, StringFormat strFormat) if (rImageEx.Bottom > _itemArea.Bottom) { - rImageEx.Height = (_itemArea.Bottom - rImageEx.Top); + rImageEx.Height = _itemArea.Bottom - rImageEx.Top; DrawImage(g, imgList, imageIndex, rImageEx, Enabled && item.Enabled && _parent.Enabled, true); } else @@ -1344,8 +1344,8 @@ private void PaintItems(Graphics g, Rectangle clipRect, StringFormat strFormat) { if (drewImage) { - rect.Y += (rImage.Height + 1); - rect.Height = (item.Height - rImage.Height) - 4; + rect.Y += rImage.Height + 1; + rect.Height = item.Height - rImage.Height - 4; } else { @@ -1478,7 +1478,7 @@ private void On_Paint(object sender, PaintEventArgs e) } catch (Exception ex) { - ExceptionCapture.CaptureException(ex); + DebugUtilities.NotImplemented(e.ToString()); } } @@ -1613,8 +1613,8 @@ public bool DeleteItem(int index) else { - index = (index >= _toolItems.Count) ? index - 1 : index; - index = (-1 > index) ? (index + 1) : index; + index = index >= _toolItems.Count ? index - 1 : index; + index = -1 > index ? index + 1 : index; if (0 <= index && index < _toolItems.Count) { @@ -1890,7 +1890,7 @@ public bool CanScroll(ToolBoxScrollDirection scrollDir) if (null != _toolItems && 0 < _toolItems.Count) { if (_toolItems[0].Top - this.ItemSpacingEx >= _itemArea.Top && - (_toolItems[_toolItems.Count - 1].Bottom + this.ItemSpacingEx) <= _itemArea.Bottom) + _toolItems[_toolItems.Count - 1].Bottom + this.ItemSpacingEx <= _itemArea.Bottom) { bCanScroll = false; } @@ -1898,11 +1898,11 @@ public bool CanScroll(ToolBoxScrollDirection scrollDir) { if (ToolBoxScrollDirection.Up == scrollDir) { - bCanScroll = (_toolItems[0].Top + _itemArea.Top + this.ItemSpacingEx) < _itemArea.Top; + bCanScroll = _toolItems[0].Top + _itemArea.Top + this.ItemSpacingEx < _itemArea.Top; } else if (ToolBoxScrollDirection.Down == scrollDir) { - bCanScroll = (_toolItems[_toolItems.Count - 1].Bottom + _itemArea.Top + this.ItemSpacingEx) > _itemArea.Bottom; + bCanScroll = _toolItems[_toolItems.Count - 1].Bottom + _itemArea.Top + this.ItemSpacingEx > _itemArea.Bottom; } } } @@ -2077,7 +2077,7 @@ private void Initialize() _delegates[4] = new PaintEventHandler(On_Paint); //Create redirection object to the base palette - if (((_palette != null))) + if (_palette != null) { _palette.PalettePaint += new EventHandler(OnPalettePaint); } @@ -2112,7 +2112,7 @@ private Size GetCurrentItemSize(ref int maxWidth) { Size itemSize = Size.Empty; - maxWidth = _parent.DisplayRectangle.Width - (2); + maxWidth = _parent.DisplayRectangle.Width - 2; switch (this._viewMode) { @@ -2146,7 +2146,7 @@ private Point GetItemLocation(int index, int itemWidth, int itemHeight, int maxW itemLoc.X = ToolBoxViewMode.List == _viewMode ? 0 : 4; itemLoc.Y = ToolBoxViewMode.List == _viewMode ? 1 : 2; } - else if ((index - 1) < _toolItems.Count && 0 < index) + else if (index - 1 < _toolItems.Count && 0 < index) { itemLoc = _toolItems[index - 1].Location; @@ -2157,7 +2157,7 @@ private Point GetItemLocation(int index, int itemWidth, int itemHeight, int maxW itemLoc.X += itemWidth + this.ItemSpacingEx; - if (_onlyOneItemPerRow || _parent.ShowOnlyOneItemPerRow || (itemLoc.X + itemWidth) > maxWidth) + if (_onlyOneItemPerRow || _parent.ShowOnlyOneItemPerRow || itemLoc.X + itemWidth > maxWidth) { itemLoc.X = 4; itemLoc.Y += itemHeight + this.ItemSpacingEx; @@ -2331,7 +2331,7 @@ private bool HandleListViewKeyDown(KeyEventArgs e) newIndex = _toolItems.Count - 1; break; case Keys.Tab: - if ((Keys.Shift == (e.Modifiers & Keys.Shift))) + if (Keys.Shift == (e.Modifiers & Keys.Shift)) { newIndex--; } @@ -2463,7 +2463,7 @@ private bool HandleIconViewKeyDown(KeyEventArgs e) break; case Keys.Tab: - if ((Keys.Shift == (e.Modifiers & Keys.Shift))) + if (Keys.Shift == (e.Modifiers & Keys.Shift)) { newIndex--; } @@ -2725,7 +2725,7 @@ private void ScrollItems(int offset, bool bRedraw) _parent.Invalidate(_itemArea); - //System.Diagnostics.Debug.WriteLine("ScrollItems : Invalidated " + rInv); + //DebugUtilities.WriteLine("ScrollItems : Invalidated " + rInv); } } @@ -2742,13 +2742,13 @@ private void OnPalettePaint(object sender, PaletteLayoutEventArgs e) private void OnGlobalPaletteChanged(object sender, EventArgs e) { - if (((_palette != null))) + if (_palette != null) { _palette.PalettePaint -= new EventHandler(OnPalettePaint); } _palette = KryptonManager.CurrentGlobalPalette; _paletteRedirect.Target = _palette; - if (((_palette != null))) + if (_palette != null) { _palette.PalettePaint += new EventHandler(OnPalettePaint); InitColours(); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolBoxTabCollection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolBoxTabCollection.cs index 6b2628065..d29e997a8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolBoxTabCollection.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolBoxTabCollection.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolObject.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolObject.cs index 0de89788b..490a46f0b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolObject.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolObject.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolScrollButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolScrollButton.cs index 2bf7c6ed5..4eefc50b5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolScrollButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Classes/ToolScrollButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -76,7 +76,7 @@ public ToolScrollButton(ToolBoxScrollDirection direction, int width, int height) { _rectangle = new Rectangle(0, 0, width, height); _direction = direction; - _toolTip = (ToolBoxScrollDirection.Up == direction) ? "Scroll Up" : "Scroll Down"; + _toolTip = ToolBoxScrollDirection.Up == direction ? "Scroll Up" : "Scroll Down"; } #endregion //Construction @@ -92,7 +92,7 @@ public void Paint(Graphics g, Rectangle clipRect, bool ctrlEnabled) if (_rectangle.IntersectsWith(clipRect)) { - pen = (!_enabled || !ctrlEnabled) ? SystemPens.GrayText : Pens.Black; + pen = !_enabled || !ctrlEnabled ? SystemPens.GrayText : Pens.Black; rect = _rectangle; KryptonToolBox.DrawBorders(g, rect, _mouseDown); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Controls Toolkit/KryptonToolBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Controls Toolkit/KryptonToolBox.cs index 61ce854ab..12827ddfb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Controls Toolkit/KryptonToolBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Controls Toolkit/KryptonToolBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -379,7 +379,7 @@ private void Initialize() _dnScroll.Enabled = false; //Create redirection object to the base palette - if (((_palette != null))) + if (_palette != null) { _palette.PalettePaint += new EventHandler(OnPalettePaint); } @@ -1525,7 +1525,7 @@ public bool SetImageList(Image image, Size size, Color transparentColor, bool sm _smallImageList = CreateImageListFromImage(image, size, transparentColor); } - bOk = (_smallImageList.Images.Count > 0); + bOk = _smallImageList.Images.Count > 0; } else { @@ -1536,7 +1536,7 @@ public bool SetImageList(Image image, Size size, Color transparentColor, bool sm _largeImageList = CreateImageListFromImage(image, size, transparentColor); } - bOk = (_largeImageList.Images.Count > 0); + bOk = _largeImageList.Images.Count > 0; } @@ -1951,17 +1951,17 @@ private bool DoTimedLayout(ToolBoxTab oldSelectedTab) if (null != _selectedTab.Control) { - System.Diagnostics.Debug.WriteLine( + DebugUtilities.WriteLine( $"Control Location {_selectedTab.Control.Location} Item Area {_selectedTab.ItemArea}"); } if (null != _oldselectedTab) { - inc = (_tabHeight / 2 >= inc) ? (oldItemArea.Height / 6) - 2 : inc; - inc = (_tabHeight / 2 >= inc) ? (oldItemArea.Height / 3) - 2 : inc; - inc = (_tabHeight / 2 >= inc) ? (oldItemArea.Height / 2) - 2 : inc; - inc = (_tabHeight / 2 >= inc) ? _tabHeight / 2 : inc; + inc = _tabHeight / 2 >= inc ? oldItemArea.Height / 6 - 2 : inc; + inc = _tabHeight / 2 >= inc ? oldItemArea.Height / 3 - 2 : inc; + inc = _tabHeight / 2 >= inc ? oldItemArea.Height / 2 - 2 : inc; + inc = _tabHeight / 2 >= inc ? _tabHeight / 2 : inc; if (oldTabIndex < selTabIndex) { @@ -1970,7 +1970,7 @@ private bool DoTimedLayout(ToolBoxTab oldSelectedTab) maxY = _oldselectedTab.Bottom + _tabSpacing; - if ((tab.Y - inc) <= maxY) + if (tab.Y - inc <= maxY) { inc = tab.Y - maxY; } @@ -1985,13 +1985,13 @@ private bool DoTimedLayout(ToolBoxTab oldSelectedTab) tab = this[oldTabIndex + 1]; tab.Width = DisplayRectangle.Width - 2; - oldItemArea.Height = (tab.Top - 1) - (_oldselectedTab.Bottom - 1); - _selectedTab.Width = (DisplayRectangle.Width - 2) - (_upScroll.Width + 1); + oldItemArea.Height = tab.Top - 1 - (_oldselectedTab.Bottom - 1); + _selectedTab.Width = DisplayRectangle.Width - 2 - (_upScroll.Width + 1); _oldselectedTab.Width = DisplayRectangle.Width - 2; tab = this[selTabIndex + 1]; if (null != tab) { - tab.Width = (DisplayRectangle.Width - 2) - (_upScroll.Width + 1); + tab.Width = DisplayRectangle.Width - 2 - (_upScroll.Width + 1); _dnScroll.Y = tab.Y; paintRect.Height = _dnScroll.Bottom - paintRect.Y; } @@ -2013,14 +2013,14 @@ private bool DoTimedLayout(ToolBoxTab oldSelectedTab) } else { - maxY = DisplayRectangle.Bottom - ((_tabHeight + _tabSpacing) * (_toolBoxTabs.Count - (selTabIndex + 1))); + maxY = DisplayRectangle.Bottom - (_tabHeight + _tabSpacing) * (_toolBoxTabs.Count - (selTabIndex + 1)); //maxY = (maxY <= _selectedTab.Y + (_itemHeight + _itemSpacing) ) ? _selectedTab.Y + (2*_itemHeight) + 2*_itemSpacing : maxY; - maxY = (maxY <= _selectedTab.Y + (_itemHeight + _itemSpacing)) ? _selectedTab.Bottom + (_itemHeight + _itemSpacing + _tabSpacing) : maxY; + maxY = maxY <= _selectedTab.Y + _itemHeight + _itemSpacing ? _selectedTab.Bottom + _itemHeight + _itemSpacing + _tabSpacing : maxY; paintRect.Y = _selectedTab.Top; tab = this[selTabIndex + 1]; - if ((tab.Y + inc) >= maxY) + if (tab.Y + inc >= maxY) { inc = maxY - tab.Y; } @@ -2032,7 +2032,7 @@ private bool DoTimedLayout(ToolBoxTab oldSelectedTab) tab = this[selTabIndex + 1]; - _selectedTab.Width = (DisplayRectangle.Width - 2) - (_upScroll.Width + 1); + _selectedTab.Width = DisplayRectangle.Width - 2 - (_upScroll.Width + 1); tab.Width = _selectedTab.Width; _upScroll.Y = _selectedTab.Y; _dnScroll.Y = tab.Y; @@ -2048,12 +2048,12 @@ private bool DoTimedLayout(ToolBoxTab oldSelectedTab) { tab.Width = DisplayRectangle.Width - 2; paintRect.Height = tab.Bottom - paintRect.Y; - oldItemArea.Height = (tab.Top - 1) - (_oldselectedTab.Bottom + 1); + oldItemArea.Height = tab.Top - 1 - (_oldselectedTab.Bottom + 1); } else { - oldItemArea.Height = (DisplayRectangle.Bottom) - ((_oldselectedTab.Bottom - 1) + _itemHeight); + oldItemArea.Height = DisplayRectangle.Bottom - (_oldselectedTab.Bottom - 1 + _itemHeight); } tab = this[selTabIndex + 1]; @@ -2074,7 +2074,7 @@ private bool DoTimedLayout(ToolBoxTab oldSelectedTab) oldItemArea.Y = _oldselectedTab.Bottom; oldItemArea.Width = DisplayRectangle.Width - 2; - selItemArea.Height = (_dnScroll.Y - _selectedTab.Bottom) + 0; + selItemArea.Height = _dnScroll.Y - _selectedTab.Bottom + 0; _oldselectedTab.ItemArea = oldItemArea; _selectedTab.ItemArea = selItemArea; @@ -2144,7 +2144,7 @@ private void DoLayout(bool bInitial, bool bUpdateItems, bool bRepaint) return; } - System.Diagnostics.Debug.WriteLine("ToolBox DoLayout called..."); + DebugUtilities.WriteLine("ToolBox DoLayout called..."); rect.Height = _tabHeight; rect.Width = DisplayRectangle.Width - 2; @@ -2166,7 +2166,7 @@ private void DoLayout(bool bInitial, bool bUpdateItems, bool bRepaint) for (iLoop = 0; bOK && iLoop < _toolBoxTabs.Count; iLoop++) { - if (!bInitial && (_tabHeight + (_toolBoxTabs.Count * rect.Height)) > DisplayRectangle.Height) + if (!bInitial && _tabHeight + _toolBoxTabs.Count * rect.Height > DisplayRectangle.Height) { bOK = false; bScrollUpSet = true; @@ -2199,13 +2199,13 @@ private void DoLayout(bool bInitial, bool bUpdateItems, bool bRepaint) if (null != tab2) { - newY = (DisplayRectangle.Bottom - ((_tabHeight + _tabSpacing) * (_toolBoxTabs.Count - (iLoop)))); - newY = (newY <= rect.Y + (_itemHeight + _itemSpacing)) ? rect.Y + (_itemHeight + _itemSpacing) : newY; + newY = DisplayRectangle.Bottom - (_tabHeight + _tabSpacing) * (_toolBoxTabs.Count - iLoop); + newY = newY <= rect.Y + _itemHeight + _itemSpacing ? rect.Y + _itemHeight + _itemSpacing : newY; rect.Y = newY; } else { - rect.Y += (_tabHeight + _tabSpacing + _itemSpacing); + rect.Y += _tabHeight + _tabSpacing + _itemSpacing; } } rect.Y += _tabHeight + _tabSpacing; @@ -2234,7 +2234,7 @@ private void DoLayout(bool bInitial, bool bUpdateItems, bool bRepaint) rcItem.X = _selectedTab.X; rcItem.Y = _selectedTab.Bottom; rcItem.Width = DisplayRectangle.Width - 2; - rcItem.Height = (_dnScroll.Y - rcItem.Y) + 0; + rcItem.Height = _dnScroll.Y - rcItem.Y + 0; _selectedTab.ItemArea = rcItem; } @@ -2308,7 +2308,7 @@ private void PaintScrollButtons(Graphics g, Rectangle clipRect) private bool IsHeightValid(int height, bool forLargeIcons) { - return (height >= GetMinimumHeight(forLargeIcons)); + return height >= GetMinimumHeight(forLargeIcons); } private int GetMinimumHeight(bool forLargeIcons) @@ -2490,7 +2490,7 @@ private Color ColorFromHtmlString(string color, Color defColor) color = color.Remove(0, 1); rgb = Convert.ToInt32(color, 16); rgb = (int)(rgb & 0x00ffffff); - c = Color.FromArgb(0xff, ((rgb & 0xff0000) >> 16), ((rgb & 0x00ff00) >> 8), (rgb & 0x0000ff)); + c = Color.FromArgb(0xff, (rgb & 0xff0000) >> 16, (rgb & 0x00ff00) >> 8, rgb & 0x0000ff); } else { @@ -2620,7 +2620,7 @@ private void HandleToolBoxItemDragOver(DragEventArgs e) e.Effect = null != dragItem ? DragDropEffects.Move : DragDropEffects.None; - //System.Diagnostics.Debug.WriteLine(Environment.TickCount + " Drag item index " + index + " Item " + dragItem + " in " + ptPos); + //DebugUtilities.WriteLine(Environment.TickCount + " Drag item index " + index + " Item " + dragItem + " in " + ptPos); if (null != dragItem && _patBltItem != dragItem) { @@ -2868,7 +2868,7 @@ protected override void OnKeyDown(KeyEventArgs e) } else { - moveMsgLocked = Keys.Enter == e.KeyCode || Keys.Space == e.KeyCode; + moveMsgLocked = e.KeyCode is Keys.Enter or Keys.Space; _selectedTab.HandleKeyDown(e); } try @@ -3011,7 +3011,7 @@ protected override void OnPaint(PaintEventArgs e) PaintBackground(g, r); - //System.Diagnostics.Debug.WriteLine("Paint clip rect " + r); + //DebugUtilities.WriteLine("Paint clip rect " + r); //g.FillRectangle(new SolidBrush(GetRandomColor()),r); PaintScrollButtons(g, r); @@ -3136,7 +3136,7 @@ protected override void OnMouseDown(MouseEventArgs e) Focus(); } - System.Diagnostics.Debug.WriteLine($"Control is Focused ? {Focused}"); + DebugUtilities.WriteLine($"Control is Focused ? {Focused}"); if (_upScroll.HitTest(e.X, e.Y)) { @@ -3338,7 +3338,7 @@ private void OnTimer_LayoutElapsed(object sender, EventArgs e) private void OnTextBox_KeyDown(object sender, KeyEventArgs e) { - if (Keys.Enter == e.KeyCode || Keys.Escape == e.KeyCode) + if (e.KeyCode is Keys.Enter or Keys.Escape) { EndRenameItem(false, Keys.Escape == e.KeyCode); } @@ -4063,13 +4063,13 @@ private void OnPalettePaint(object sender, PaletteLayoutEventArgs e) private void OnGlobalPaletteChanged(object sender, EventArgs e) { - if (((_palette != null))) + if (_palette != null) { _palette.PalettePaint -= new EventHandler(OnPalettePaint); } _palette = KryptonManager.CurrentGlobalPalette; _paletteRedirect.Target = _palette; - if (((_palette != null))) + if (_palette != null) { _palette.PalettePaint += new EventHandler(OnPalettePaint); InitColours(); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Delegates/ToolBoxDelegates.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Delegates/ToolBoxDelegates.cs index 56af65631..aef7da6ff 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Delegates/ToolBoxDelegates.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Delegates/ToolBoxDelegates.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Enumerations/ToolBoxScrollDirection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Enumerations/ToolBoxScrollDirection.cs index 395c4baa6..7561a365a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Enumerations/ToolBoxScrollDirection.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Enumerations/ToolBoxScrollDirection.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Enumerations/ToolBoxTextPosition.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Enumerations/ToolBoxTextPosition.cs index 8d78f435a..aa3448b7e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Enumerations/ToolBoxTextPosition.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Enumerations/ToolBoxTextPosition.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Enumerations/ToolBoxViewMode.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Enumerations/ToolBoxViewMode.cs index f69ebdcdb..fb803da5a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Enumerations/ToolBoxViewMode.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Enumerations/ToolBoxViewMode.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Events/ToolBoxPreDragDropEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Events/ToolBoxPreDragDropEventArgs.cs index 08763f01a..515b6fec6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Events/ToolBoxPreDragDropEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Events/ToolBoxPreDragDropEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Events/ToolBoxRenameFinishedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Events/ToolBoxRenameFinishedEventArgs.cs index 0fcaea6b8..aacf91e20 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Events/ToolBoxRenameFinishedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Events/ToolBoxRenameFinishedEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Events/ToolBoxXmlSerializationEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Events/ToolBoxXmlSerializationEventArgs.cs index 1797bc916..8c4a7a8bf 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Events/ToolBoxXmlSerializationEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Events/ToolBoxXmlSerializationEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Globals/GlobalDeclarations.cs index 126034804..48b3fe65b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -34,4 +34,4 @@ global using System.Xml; global using System.Xml.Serialization; -global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; \ No newline at end of file +global using Krypton.Toolkit.Suite.Extended.Debug.Tools; \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Krypton.Toolkit.Suite.Extended.Tool.Box 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Krypton.Toolkit.Suite.Extended.Tool.Box 2022.csproj index 4d803b30f..39e52588f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Krypton.Toolkit.Suite.Extended.Tool.Box 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Krypton.Toolkit.Suite.Extended.Tool.Box 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - + - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements a Visual Studio toolbox control. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements a Visual Studio toolbox control. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -87,7 +75,7 @@ - + @@ -97,7 +85,7 @@ - + @@ -107,7 +95,7 @@ - + @@ -117,7 +105,7 @@ - + @@ -148,12 +136,13 @@ - + + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Krypton.Toolkit.Suite.Extended.Tool.Box.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Krypton.Toolkit.Suite.Extended.Tool.Box.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Krypton.Toolkit.Suite.Extended.Tool.Box.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Krypton.Toolkit.Suite.Extended.Tool.Box.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Classes/IO/MostRecentlyUsedFileManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Classes/IO/MostRecentlyUsedFileManager.cs index f1b058ba0..09b47133e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Classes/IO/MostRecentlyUsedFileManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Classes/IO/MostRecentlyUsedFileManager.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,35 +25,37 @@ */ #endregion +// ReSharper disable InconsistentNaming namespace Krypton.Toolkit.Suite.Extended.Tool.Strip.Items { /// /// Deals with the back-end logic of a most recently used file . /// Adapted from (https://www.codeproject.com/Articles/407513/Add-Most-Recently-Used-Files-MRU-List-to-Windows). /// - internal class MostRecentlyUsedFileManager + public class MostRecentlyUsedFileManager { #region Instance Fields private bool _useConfirmClearListDialogue; - private string _applicationName, _subKeyName, _filePath; + private string? _applicationName; + private readonly string _subKeyName; + private string _filePath; + private readonly MRUMenuItem? _parentMenuItem; - private MRUMenuItem _parentMenuItem; - - private ToolStripMenuItemUACSheld _clearListItem; + private readonly ToolStripMenuItemUACSheld _clearListItem; private UtilityMethods _utilityMethods = new UtilityMethods(); - private GlobalMethods _globalMethods = new GlobalMethods(); + private readonly GlobalMethods _globalMethods = new GlobalMethods(); #endregion #region Events - private Action OnRecentFileClick; + private Action? OnRecentFileClick; - private Action OnClearRecentFilesClick; + private Action? OnClearRecentFilesClick; #endregion @@ -61,7 +63,7 @@ internal class MostRecentlyUsedFileManager public bool UseConfirmClearListDialogue { get => _useConfirmClearListDialogue; set => _useConfirmClearListDialogue = value; } - public string ApplicationName { get => _applicationName; set => _applicationName = value; } + public string? ApplicationName { get => _applicationName; set => _applicationName = value; } public string FilePath { get => _filePath; set => _filePath = value; } @@ -76,7 +78,7 @@ internal class MostRecentlyUsedFileManager /// The on clear recent files click. /// if set to true [use confirm clear list dialogue]. /// Bad argument. - public MostRecentlyUsedFileManager(MRUMenuItem parentMenuItem, string applicationName, Action onRecentFileClick, Action onClearRecentFilesClick = null, bool useConfirmClearListDialogue = false) + public MostRecentlyUsedFileManager(MRUMenuItem? parentMenuItem, string? applicationName, Action? onRecentFileClick, Action? onClearRecentFilesClick = null, bool useConfirmClearListDialogue = false) { if (parentMenuItem == null || onRecentFileClick == null || applicationName == null || applicationName.Length == 0 || applicationName.Contains("\\")) { @@ -138,10 +140,7 @@ private void OnClearRecentFiles_Click(object obj, EventArgs evt) Console.WriteLine(ex.ToString()); } - if (OnClearRecentFilesClick != null) - { - OnClearRecentFilesClick(obj, evt); - } + OnClearRecentFilesClick?.Invoke(obj, evt); } /// @@ -151,7 +150,7 @@ private void ClearRecentFiles() { try { - RegistryKey rK = Registry.CurrentUser.OpenSubKey(_subKeyName, true); + RegistryKey? rK = Registry.CurrentUser.OpenSubKey(_subKeyName, true); if (rK == null) { @@ -167,13 +166,13 @@ private void ClearRecentFiles() rK.Close(); - _parentMenuItem.DropDownItems.Clear(); + _parentMenuItem!.DropDownItems.Clear(); _parentMenuItem.Enabled = false; } catch (Exception ex) { - ExceptionCapture.CaptureException(ex); + DebugUtilities.NotImplemented(ex.ToString()); } } @@ -182,9 +181,9 @@ private void ClearRecentFiles() /// private void RefreshRecentFilesMenu() { - RegistryKey rK; + RegistryKey? rK; - string s; + string? s; ToolStripItem tSI; @@ -194,7 +193,7 @@ private void RefreshRecentFilesMenu() if (rK == null) { - _parentMenuItem.Enabled = false; + _parentMenuItem!.Enabled = false; return; } @@ -203,12 +202,12 @@ private void RefreshRecentFilesMenu() { //ExceptionCapture.CaptureException($"Cannot open recent files registry key:\n{ex.Message}"); - ExceptionCapture.CaptureException(ex); + DebugUtilities.NotImplemented(ex.ToString()); return; } - _parentMenuItem.DropDownItems.Clear(); + _parentMenuItem!.DropDownItems.Clear(); string[] valueNames = rK.GetValueNames(); @@ -223,7 +222,7 @@ private void RefreshRecentFilesMenu() tSI = _parentMenuItem.DropDownItems.Add(s); - tSI.Click += new EventHandler(OnRecentFileClick); + tSI.Click += new EventHandler(OnRecentFileClick!); } if (_parentMenuItem.DropDownItems.Count == 0) @@ -237,7 +236,7 @@ private void RefreshRecentFilesMenu() tSI = _parentMenuItem.DropDownItems.Add("&Clear list"); - tSI.Click += new EventHandler(OnClearRecentFiles_Click); + tSI.Click += OnClearRecentFiles_Click; _parentMenuItem.Enabled = true; } @@ -248,29 +247,29 @@ private void RefreshRecentFilesMenu() /// Adds the recent file. ///
/// The file name with full path. - public void AddRecentFile(string fileNameWithFullPath) + public void AddRecentFile(string? fileNameWithFullPath) { - string s; + string? s; try { - RegistryKey rK = Registry.CurrentUser.CreateSubKey(_subKeyName, RegistryKeyPermissionCheck.ReadWriteSubTree); + RegistryKey? rK = Registry.CurrentUser.CreateSubKey(_subKeyName, RegistryKeyPermissionCheck.ReadWriteSubTree); - for (int i = 0; true; i++) + for (int i = 0; ; i++) { - s = rK.GetValue(i.ToString(), null) as string; + s = rK?.GetValue(i.ToString(), null) as string; if (s == null) { - rK.SetValue(i.ToString(), fileNameWithFullPath); + rK?.SetValue(i.ToString(), fileNameWithFullPath!); - rK.Close(); + rK?.Close(); break; } else if (s == fileNameWithFullPath) { - rK.Close(); + rK?.Close(); break; } @@ -278,7 +277,7 @@ public void AddRecentFile(string fileNameWithFullPath) } catch (Exception ex) { - ExceptionCapture.CaptureException(ex); + DebugUtilities.NotImplemented(ex.ToString()); } RefreshRecentFilesMenu(); @@ -289,17 +288,17 @@ public void AddRecentFile(string fileNameWithFullPath) /// Removes the recent file. ///
/// The file name with full path. - public void RemoveRecentFile(string fileNameWithFullPath) + public void RemoveRecentFile(string? fileNameWithFullPath) { try { - RegistryKey rK = Registry.CurrentUser.OpenSubKey(_subKeyName, true); + RegistryKey? rK = Registry.CurrentUser.OpenSubKey(_subKeyName, true); - string[] valuesNames = rK.GetValueNames(); + string[] valuesNames = rK!.GetValueNames(); foreach (string valueName in valuesNames) { - if ((rK.GetValue(valueName, null) as string) == fileNameWithFullPath) + if (rK.GetValue(valueName, null) as string == fileNameWithFullPath) { rK.DeleteValue(valueName, true); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Classes/Internal/NativeConstants.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Classes/Internal/NativeConstants.cs index d209030e6..93ba5fc3f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Classes/Internal/NativeConstants.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Classes/Internal/NativeConstants.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Advanced/ExpandedItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Advanced/ExpandedItem.cs index 48592eeaf..adff45e12 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Advanced/ExpandedItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Advanced/ExpandedItem.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Advanced/ExpandingMenuItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Advanced/ExpandingMenuItem.cs index 872c252cd..cfe457b5a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Advanced/ExpandingMenuItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Advanced/ExpandingMenuItem.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ClearClipboard.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ClearClipboard.cs index fb09ec1a6..832dede86 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ClearClipboard.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ClearClipboard.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/EnhancedToolStripMenuItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/EnhancedToolStripMenuItem.cs index 3a6d50b70..cc6e604b8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/EnhancedToolStripMenuItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/EnhancedToolStripMenuItem.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -52,7 +52,7 @@ public class EnhancedToolStripMenuItem : ToolStripMenuItem /// Switches between CheckkBox or RadioButton style. ///
[RefreshProperties(RefreshProperties.Repaint), NotifyParentProperty(true), DefaultValue(CheckMarkDisplayStyle.RadioButton)] - public CheckMarkDisplayStyle DisplayStyle + public new CheckMarkDisplayStyle DisplayStyle { set { @@ -86,17 +86,17 @@ public EnhancedToolStripMenuItem() #region Overrides protected override void OnClick(EventArgs e) { - if ((DisplayStyle == CheckMarkDisplayStyle.RadioButton) && (CheckOnClick)) + if (DisplayStyle == CheckMarkDisplayStyle.RadioButton && CheckOnClick) { - ToolStrip toolStrip = GetCurrentParent(); + ToolStrip? toolStrip = GetCurrentParent(); - foreach (ToolStripItem items in toolStrip.Items) + foreach (ToolStripItem items in toolStrip!.Items) { if (items is EnhancedToolStripMenuItem) { EnhancedToolStripMenuItem menuItem = (EnhancedToolStripMenuItem)items; - if ((menuItem.DisplayStyle == CheckMarkDisplayStyle.RadioButton) && (menuItem.CheckOnClick) && (menuItem.RadioButtonGroupName == RadioButtonGroupName)) + if (menuItem.DisplayStyle == CheckMarkDisplayStyle.RadioButton && menuItem.CheckOnClick && menuItem.RadioButtonGroupName == RadioButtonGroupName) { menuItem.Checked = false; } @@ -112,7 +112,7 @@ protected override void OnPaint(PaintEventArgs e) base.OnPaint(e); //if CheckMarkDisplayStyle is equal RadioButton additional paining or radio button is needed - if ((DisplayStyle == CheckMarkDisplayStyle.RadioButton)) + if (DisplayStyle == CheckMarkDisplayStyle.RadioButton) { //Find location of radio button Size radioButtonSize = RadioButtonRenderer.GetGlyphSize(e.Graphics, RadioButtonState.CheckedNormal); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/EnhancedToolStripSeparator.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/EnhancedToolStripSeparator.cs index 5d9961647..ffd191944 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/EnhancedToolStripSeparator.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/EnhancedToolStripSeparator.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -91,8 +91,8 @@ public partial class EnhancedToolStripSeparator : ToolStripMenuItem /// /// Separator is not selectable, therefore CanSelect always returns false. - [EditorBrowsable(EditorBrowsableState.Never)] /// + [EditorBrowsable(EditorBrowsableState.Never)] [Browsable(false)] public override bool CanSelect => false; @@ -122,8 +122,8 @@ public override Size GetPreferredSize(Size constrainingSize) protected override void OnPaint(PaintEventArgs e) { - ToolStrip ts = Owner ?? GetCurrentParent(); - int textLeft = ts.Padding.Horizontal; + ToolStrip? ts = Owner ?? GetCurrentParent(); + int textLeft = ts!.Padding.Horizontal; if (ts.BackColor != BackColor) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonColourButtonToolStripMenuItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonColourButtonToolStripMenuItem.cs index fa2ec390a..a701ff917 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonColourButtonToolStripMenuItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonColourButtonToolStripMenuItem.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -71,19 +71,19 @@ public class KryptonColourButtonToolStripMenuItem : ToolStripControlHostFixed /// The KryptonColorButton control. [RefreshProperties(RefreshProperties.All), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] - public KryptonColorButton KryptonColourButtonControl => Control as KryptonColorButton; + public KryptonColorButton? KryptonColourButtonControl => Control as KryptonColorButton; #endregion #region Public - [DefaultValue(typeof(Color), "Red")] + [DefaultValue(typeof(Color), "Empty")] public Color SelectedColor { - get => KryptonColourButtonControl.SelectedColor; + get => KryptonColourButtonControl!.SelectedColor; set { - if (value != KryptonColourButtonControl.SelectedColor) + if (value != KryptonColourButtonControl!.SelectedColor) { KryptonColourButtonControl.SelectedColor = value; @@ -95,33 +95,34 @@ public Color SelectedColor [DefaultValue(typeof(Color), "DarkGray")] public Color EmptyBorderColor { - get => KryptonColourButtonControl.EmptyBorderColor; + get => KryptonColourButtonControl!.EmptyBorderColor; set { if (value != _emptyBorderColor) { - KryptonColourButtonControl.EmptyBorderColor = value; + KryptonColourButtonControl!.EmptyBorderColor = value; } } } - public new string Text { get => KryptonColourButtonControl.Text; set => KryptonColourButtonControl.Text = value; } + public new string Text { get => KryptonColourButtonControl!.Text; set => KryptonColourButtonControl!.Text = value; } - public Rectangle SelectedRect { get => KryptonColourButtonControl.SelectedRect; set => KryptonColourButtonControl.SelectedRect = value; } + public Rectangle SelectedRect { get => KryptonColourButtonControl!.SelectedRect; set => KryptonColourButtonControl!.SelectedRect = value; } #endregion #region Identity - /// Initializes a new instance of the class. + /// + /// Initializes a new instance of the class. /// public KryptonColourButtonToolStripMenuItem() : base(new KryptonColorButton()) { AutoSize = false; - SelectedColor = KryptonColourButtonControl.SelectedColor; + SelectedColor = KryptonColourButtonControl!.SelectedColor; EmptyBorderColor = KryptonColourButtonControl.EmptyBorderColor; } @@ -151,14 +152,14 @@ public KryptonColourButtonToolStripMenuItem() public override Size GetPreferredSize(Size constrainingSize) { //return base.GetPreferredSize(constrainingSize); - return KryptonColourButtonControl.GetPreferredSize(constrainingSize); + return KryptonColourButtonControl!.GetPreferredSize(constrainingSize); } /// /// Subscribes events from the hosted control. /// /// The control from which to subscribe events. - protected override void OnSubscribeControlEvents(Control control) + protected override void OnSubscribeControlEvents(Control? control) { base.OnSubscribeControlEvents(control); @@ -169,7 +170,7 @@ protected override void OnSubscribeControlEvents(Control control) /// Unsubscribes events from the hosted control. ///
/// The control from which to unsubscribe events. - protected override void OnUnsubscribeControlEvents(Control control) + protected override void OnUnsubscribeControlEvents(Control? control) { base.OnUnsubscribeControlEvents(control); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonDateTimePickerToolStripItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonDateTimePickerToolStripItem.cs index de1fce928..0629c6feb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonDateTimePickerToolStripItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonDateTimePickerToolStripItem.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -32,7 +32,7 @@ public class KryptonDateTimePickerToolStripItem : ToolStripControlHostFixed #region Public [RefreshProperties(RefreshProperties.All), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] - public KryptonDateTimePicker DateTimePickerControl => Control as KryptonDateTimePicker; + public KryptonDateTimePicker? DateTimePickerControl => Control as KryptonDateTimePicker; #endregion @@ -40,284 +40,281 @@ public class KryptonDateTimePickerToolStripItem : ToolStripControlHostFixed public bool AlwaysActive { - get => ((KryptonDateTimePicker) Control).AlwaysActive; + get => ((KryptonDateTimePicker)Control).AlwaysActive; - set => ((KryptonDateTimePicker) Control).AlwaysActive = value; + set => ((KryptonDateTimePicker)Control).AlwaysActive = value; } public bool AllowButtonSpecToolTips { - get => ((KryptonDateTimePicker) Control).AllowButtonSpecToolTips; + get => ((KryptonDateTimePicker)Control).AllowButtonSpecToolTips; set => ((KryptonDateTimePicker)Control).AllowButtonSpecToolTips = value; } public bool AllowButtonSpecToolTipPrioity { - get => ((KryptonDateTimePicker) Control).AllowButtonSpecToolTipPriority; + get => ((KryptonDateTimePicker)Control).AllowButtonSpecToolTipPriority; - set => ((KryptonDateTimePicker) Control).AllowButtonSpecToolTipPriority = value; + set => ((KryptonDateTimePicker)Control).AllowButtonSpecToolTipPriority = value; } public bool AutoShift { - get => ((KryptonDateTimePicker) Control).AutoShift; + get => ((KryptonDateTimePicker)Control).AutoShift; - set => ((KryptonDateTimePicker) Control).AutoShift = value; + set => ((KryptonDateTimePicker)Control).AutoShift = value; } public bool Checked { - get => ((KryptonDateTimePicker) Control).Checked; + get => ((KryptonDateTimePicker)Control).Checked; - set => ((KryptonDateTimePicker) Control).Checked = value; + set => ((KryptonDateTimePicker)Control).Checked = value; } public bool ShowUpDown { - get => ((KryptonDateTimePicker) Control).ShowUpDown; + get => ((KryptonDateTimePicker)Control).ShowUpDown; - set => ((KryptonDateTimePicker) Control).ShowUpDown = value; + set => ((KryptonDateTimePicker)Control).ShowUpDown = value; } public bool ShowCheckBox { - get => ((KryptonDateTimePicker) Control).ShowCheckBox; + get => ((KryptonDateTimePicker)Control).ShowCheckBox; - set => ((KryptonDateTimePicker) Control).ShowCheckBox = value; + set => ((KryptonDateTimePicker)Control).ShowCheckBox = value; } public bool UseMnemonic { - get => ((KryptonDateTimePicker) Control).UseMnemonic; + get => ((KryptonDateTimePicker)Control).UseMnemonic; - set => ((KryptonDateTimePicker) Control).UseMnemonic = value; + set => ((KryptonDateTimePicker)Control).UseMnemonic = value; } public bool CalendarShowTodayCircle { - get => ((KryptonDateTimePicker) Control).CalendarShowTodayCircle; + get => ((KryptonDateTimePicker)Control).CalendarShowTodayCircle; - set => ((KryptonDateTimePicker) Control).CalendarShowTodayCircle = value; + set => ((KryptonDateTimePicker)Control).CalendarShowTodayCircle = value; } public bool CalendarShowWeekNumbers { - get => ((KryptonDateTimePicker) Control).CalendarShowWeekNumbers; + get => ((KryptonDateTimePicker)Control).CalendarShowWeekNumbers; - set => ((KryptonDateTimePicker) Control).CalendarShowWeekNumbers = value; + set => ((KryptonDateTimePicker)Control).CalendarShowWeekNumbers = value; } public bool CalendarCloseOnTodayClick { - get => ((KryptonDateTimePicker) Control).CalendarCloseOnTodayClick; + get => ((KryptonDateTimePicker)Control).CalendarCloseOnTodayClick; - set => ((KryptonDateTimePicker) Control).CalendarCloseOnTodayClick = value; + set => ((KryptonDateTimePicker)Control).CalendarCloseOnTodayClick = value; } public bool CalendarShowToday { - get => ((KryptonDateTimePicker) Control).CalendarShowToday; + get => ((KryptonDateTimePicker)Control).CalendarShowToday; - set => ((KryptonDateTimePicker) Control).CalendarShowToday = value; + set => ((KryptonDateTimePicker)Control).CalendarShowToday = value; } public bool RightToLeftLayout { - get => ((KryptonDateTimePicker) Control).RightToLeftLayout; + get => ((KryptonDateTimePicker)Control).RightToLeftLayout; - set => ((KryptonDateTimePicker) Control).RightToLeftLayout = value; + set => ((KryptonDateTimePicker)Control).RightToLeftLayout = value; } - public bool IsActive => ((KryptonDateTimePicker) Control).IsActive; + public bool IsActive => ((KryptonDateTimePicker)Control).IsActive; - public bool IsMouseOver => ((KryptonDateTimePicker) Control).IsMouseOver; + public bool IsMouseOver => ((KryptonDateTimePicker)Control).IsMouseOver; - public bool IsDropped => ((KryptonDateTimePicker) Control).IsDropped; + public bool IsDropped => ((KryptonDateTimePicker)Control).IsDropped; public bool ShowAdornments { - set => ((KryptonDateTimePicker) Control).ShowAdornments = value; + set => ((KryptonDateTimePicker)Control).ShowAdornments = value; } public bool ShowBorder { - set => ((KryptonDateTimePicker) Control).ShowBorder = value; + set => ((KryptonDateTimePicker)Control).ShowBorder = value; } - public CheckBoxImages Images => ((KryptonDateTimePicker) Control).Images; + public CheckBoxImages Images => ((KryptonDateTimePicker)Control).Images; - public DateTime CalendarTodayDate + public DateTime? CalendarTodayDate { - get => ((KryptonDateTimePicker) Control).CalendarTodayDate; + get => ((KryptonDateTimePicker)Control).CalendarTodayDate; - set => ((KryptonDateTimePicker) Control).CalendarTodayDate = value; + set => ((KryptonDateTimePicker)Control).CalendarTodayDate = (DateTime)value!; } - public DateTime[] CalendarAnnuallyBoldedDates + public DateTime[]? CalendarAnnuallyBoldedDates { - get => ((KryptonDateTimePicker) Control).CalendarAnnuallyBoldedDates; + get => ((KryptonDateTimePicker)Control).CalendarAnnuallyBoldedDates; - set => ((KryptonDateTimePicker) Control).CalendarAnnuallyBoldedDates = value; + set => ((KryptonDateTimePicker)Control).CalendarAnnuallyBoldedDates = value; } - public DateTime[] CalendarMonthlyBoldedDates + public DateTime[]? CalendarMonthlyBoldedDates { - get => ((KryptonDateTimePicker) Control).CalendarMonthlyBoldedDates; + get => ((KryptonDateTimePicker)Control).CalendarMonthlyBoldedDates; set => ((KryptonDateTimePicker)Control).CalendarMonthlyBoldedDates = value; } - public DateTime[] CalendarBoldedDates + public DateTime[]? CalendarBoldedDates { - get => ((KryptonDateTimePicker) Control).CalendarBoldedDates; + get => ((KryptonDateTimePicker)Control).CalendarBoldedDates; - set => ((KryptonDateTimePicker) Control).CalendarBoldedDates = value; + set => ((KryptonDateTimePicker)Control).CalendarBoldedDates = value; } public DateTime Value { - get => ((KryptonDateTimePicker) Control).Value; + get => ((KryptonDateTimePicker)Control).Value; set => ((KryptonDateTimePicker)Control).Value = value; } public DateTime MaxDate { - get => ((KryptonDateTimePicker) Control).MaxDate; + get => ((KryptonDateTimePicker)Control).MaxDate; - set => ((KryptonDateTimePicker) Control).MaxDate = value; + set => ((KryptonDateTimePicker)Control).MaxDate = value; } public DateTime MinDate { - get => ((KryptonDateTimePicker) Control).MinDate; + get => ((KryptonDateTimePicker)Control).MinDate; - set => ((KryptonDateTimePicker) Control).MinDate = value; + set => ((KryptonDateTimePicker)Control).MinDate = value; } public DateTimePickerFormat Format { - get => ((KryptonDateTimePicker) Control).Format; + get => ((KryptonDateTimePicker)Control).Format; - set => ((KryptonDateTimePicker) Control).Format = value; + set => ((KryptonDateTimePicker)Control).Format = value; } public Day CalendarFirstDayOfWeek { - get => ((KryptonDateTimePicker) Control).CalendarFirstDayOfWeek; + get => ((KryptonDateTimePicker)Control).CalendarFirstDayOfWeek; - set => ((KryptonDateTimePicker) Control).CalendarFirstDayOfWeek = value; + set => ((KryptonDateTimePicker)Control).CalendarFirstDayOfWeek = value; } public KryptonDateTimePicker.DateTimePickerButtonSpecCollection ButtonSpecs => - ((KryptonDateTimePicker) Control).ButtonSpecs; + ((KryptonDateTimePicker)Control).ButtonSpecs; public LeftRightAlignment DropDownAlign { - get => ((KryptonDateTimePicker) Control).DropDownAlign; + get => ((KryptonDateTimePicker)Control).DropDownAlign; - set => ((KryptonDateTimePicker) Control).DropDownAlign = value; + set => ((KryptonDateTimePicker)Control).DropDownAlign = value; } public InputControlStyle InputControlStyle { - get => ((KryptonDateTimePicker) Control).InputControlStyle; + get => ((KryptonDateTimePicker)Control).InputControlStyle; - set => ((KryptonDateTimePicker) Control).InputControlStyle = value; + set => ((KryptonDateTimePicker)Control).InputControlStyle = value; } - public object ValueNullable + public object? ValueNullable { - get => ((KryptonDateTimePicker) Control).ValueNullable; + get => ((KryptonDateTimePicker)Control).ValueNullable; set => ((KryptonDateTimePicker)Control).ValueNullable = value; } public string CalendarTodayText { - get => ((KryptonDateTimePicker) Control).CalendarTodayText; + get => ((KryptonDateTimePicker)Control).CalendarTodayText; - set => ((KryptonDateTimePicker) Control).CalendarTodayText = value; + set => ((KryptonDateTimePicker)Control).CalendarTodayText = value; } - public string CustomFormat + public string? CustomFormat { - get => ((KryptonDateTimePicker) Control).CustomFormat; + get => ((KryptonDateTimePicker)Control).CustomFormat; - set => ((KryptonDateTimePicker) Control).CustomFormat = value; + set => ((KryptonDateTimePicker)Control).CustomFormat = value; } public string CustomNullText { - get => ((KryptonDateTimePicker) Control).CustomNullText; + get => ((KryptonDateTimePicker)Control).CustomNullText; - set => ((KryptonDateTimePicker) Control).CustomNullText = value; + set => ((KryptonDateTimePicker)Control).CustomNullText = value; } public string CalendarTodayFormat { - get => ((KryptonDateTimePicker) Control).CalendarTodayFormat; + get => ((KryptonDateTimePicker)Control).CalendarTodayFormat; - set => ((KryptonDateTimePicker) Control).CalendarTodayFormat = value; + set => ((KryptonDateTimePicker)Control).CalendarTodayFormat = value; } public string ActiveFragment { - get => ((KryptonDateTimePicker) Control).ActiveFragment; + get => ((KryptonDateTimePicker)Control).ActiveFragment; - set => ((KryptonDateTimePicker) Control).ActiveFragment = value; + set => ((KryptonDateTimePicker)Control).ActiveFragment = value; } public HeaderStyle CalendarHeaderStyle { - get => ((KryptonDateTimePicker) Control).CalendarHeaderStyle; + get => ((KryptonDateTimePicker)Control).CalendarHeaderStyle; - set => ((KryptonDateTimePicker) Control).CalendarHeaderStyle = value; + set => ((KryptonDateTimePicker)Control).CalendarHeaderStyle = value; } public ButtonStyle CalendarDayStyle { - get => ((KryptonDateTimePicker) Control).CalendarDayStyle; + get => ((KryptonDateTimePicker)Control).CalendarDayStyle; - set => ((KryptonDateTimePicker) Control).CalendarDayStyle = value; + set => ((KryptonDateTimePicker)Control).CalendarDayStyle = value; } public ButtonStyle CalendarDayOfWeekStyle { - get => ((KryptonDateTimePicker) Control).CalendarDayOfWeekStyle; + get => ((KryptonDateTimePicker)Control).CalendarDayOfWeekStyle; - set => ((KryptonDateTimePicker) Control).CalendarDayOfWeekStyle = value; + set => ((KryptonDateTimePicker)Control).CalendarDayOfWeekStyle = value; } public ButtonStyle UpDownButtonStyle { - get => ((KryptonDateTimePicker) Control).UpDownButtonStyle; + get => ((KryptonDateTimePicker)Control).UpDownButtonStyle; - set => ((KryptonDateTimePicker) Control).UpDownButtonStyle = value; + set => ((KryptonDateTimePicker)Control).UpDownButtonStyle = value; } public ButtonStyle DropButtonStyle { - get => ((KryptonDateTimePicker) Control).DropButtonStyle; + get => ((KryptonDateTimePicker)Control).DropButtonStyle; - set => ((KryptonDateTimePicker) Control).DropButtonStyle = value; + set => ((KryptonDateTimePicker)Control).DropButtonStyle = value; } - public ToolTipManager ToolTipManager => ((KryptonDateTimePicker) Control).ToolTipManager; + public ToolTipManager ToolTipManager => ((KryptonDateTimePicker)Control).ToolTipManager; #endregion #region Exposed Events - public event EventHandler ValueChanged; + public event EventHandler? ValueChanged; protected void OnValueChanged(object sender, EventArgs e) { - if (ValueChanged != null) - { - ValueChanged(this, e); - } + ValueChanged?.Invoke(this, e); } #endregion @@ -330,20 +327,20 @@ protected void OnValueChanged(object sender, EventArgs e) #region Overrides - public override Size GetPreferredSize(Size constrainingSize) => DateTimePickerControl.GetPreferredSize(constrainingSize); + public override Size GetPreferredSize(Size constrainingSize) => DateTimePickerControl!.GetPreferredSize(constrainingSize); - protected override void OnSubscribeControlEvents(Control control) + protected override void OnSubscribeControlEvents(Control? control) { base.OnSubscribeControlEvents(control); - ((KryptonDateTimePicker) control).ValueChanged += OnValueChanged; + ((control as KryptonDateTimePicker)!).ValueChanged += OnValueChanged!; } - protected override void OnUnsubscribeControlEvents(Control control) + protected override void OnUnsubscribeControlEvents(Control? control) { base.OnUnsubscribeControlEvents(control); - - ((KryptonDateTimePicker) control).ValueChanged -= OnValueChanged; + + ((control as KryptonDateTimePicker)!).ValueChanged -= OnValueChanged!; } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonEnhancedToolStrip.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonEnhancedToolStrip.cs index 5cd8bbb63..c7f81347a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonEnhancedToolStrip.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonEnhancedToolStrip.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -27,12 +27,14 @@ namespace Krypton.Toolkit.Suite.Extended.Tool.Strip.Items { - [Description("A standard tool strip, with a few enhancements.")] /// A standard tool strip, with a few enhancements. + [Description("A standard tool strip, with a few enhancements.")] public class KryptonEnhancedToolStrip : ToolStrip { #region Variables - private bool _clickThrough = false, _useKryptonRender; + + private bool _clickThrough; + private readonly bool _useKryptonRender; #endregion #region Properties @@ -42,7 +44,13 @@ public class KryptonEnhancedToolStrip : ToolStrip #endregion #region Constructor - public KryptonEnhancedToolStrip() { RenderMode = ToolStripRenderMode.ManagerRenderMode; } + + public KryptonEnhancedToolStrip() + { + _useKryptonRender = true; + + RenderMode = ToolStripRenderMode.ManagerRenderMode; + } #endregion #region Overrides diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonEnhancedToolStripProgressBar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonEnhancedToolStripProgressBar.cs index 9d17997d1..a09034aa5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonEnhancedToolStripProgressBar.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonEnhancedToolStripProgressBar.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -39,7 +39,7 @@ public class KryptonEnhancedToolStripProgressBar : ToolStripProgressBar private Color _displayTextColour; - private PaletteBase _palette; + private readonly PaletteBase? _palette; #endregion #region Properties @@ -58,11 +58,13 @@ public class KryptonEnhancedToolStripProgressBar : ToolStripProgressBar /// Initializes a new instance of the class. public KryptonEnhancedToolStripProgressBar() : base() { - _displayTextColour = _palette.ColorTable.StatusStripText; + _palette = null; + + _displayTextColour = _palette!.ColorTable.StatusStripText; Font = _palette.ColorTable.StatusStripFont; - Control.HandleCreated += Control_HandleCreated; + Control.HandleCreated += Control_HandleCreated!; } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonLoadingCircleToolStripMenuItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonLoadingCircleToolStripMenuItem.cs index 8033a3db5..614918a4f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonLoadingCircleToolStripMenuItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonLoadingCircleToolStripMenuItem.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -41,11 +41,11 @@ public class KryptonLoadingCircleToolStripMenuItem : ToolStripControlHost /// The loading circle control. [RefreshProperties(RefreshProperties.All), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] - public KryptonLoadingCircle LoadingCircleControl => Control as KryptonLoadingCircle; + public KryptonLoadingCircle? LoadingCircleControl => Control as KryptonLoadingCircle; // Constructor ======================================================== /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// public KryptonLoadingCircleToolStripMenuItem() : base(new KryptonLoadingCircle()) @@ -64,7 +64,7 @@ public KryptonLoadingCircleToolStripMenuItem() public override Size GetPreferredSize(Size constrainingSize) { //return base.GetPreferredSize(constrainingSize); - return LoadingCircleControl.GetPreferredSize(constrainingSize); + return LoadingCircleControl!.GetPreferredSize(constrainingSize); } @@ -72,7 +72,7 @@ public override Size GetPreferredSize(Size constrainingSize) /// Subscribes events from the hosted control. ///
/// The control from which to subscribe events. - protected override void OnSubscribeControlEvents(Control control) + protected override void OnSubscribeControlEvents(Control? control) { base.OnSubscribeControlEvents(control); @@ -83,7 +83,7 @@ protected override void OnSubscribeControlEvents(Control control) /// Unsubscribes events from the hosted control. ///
/// The control from which to unsubscribe events. - protected override void OnUnsubscribeControlEvents(Control control) + protected override void OnUnsubscribeControlEvents(Control? control) { base.OnUnsubscribeControlEvents(control); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonNumericUpDownToolStripItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonNumericUpDownToolStripItem.cs index 354339e97..277b6ee70 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonNumericUpDownToolStripItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonNumericUpDownToolStripItem.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -45,7 +45,7 @@ public KryptonNumericUpDownToolStripItem() : base(new KryptonNumericUpDown()) /// /// The base control. /// - public KryptonNumericUpDown KryptonNumericUpDownControl => Control as KryptonNumericUpDown; + public KryptonNumericUpDown? KryptonNumericUpDownControl => Control as KryptonNumericUpDown; /// /// Gets or sets Value. @@ -55,10 +55,10 @@ public KryptonNumericUpDownToolStripItem() : base(new KryptonNumericUpDown()) /// public decimal Value { - get => KryptonNumericUpDownControl.Value; + get => KryptonNumericUpDownControl!.Value; - set => KryptonNumericUpDownControl.Value = value; + set => KryptonNumericUpDownControl!.Value = value; } #endregion } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonSlider.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonSlider.cs index 5670826cf..e2140102a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonSlider.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonSlider.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -40,49 +40,49 @@ public partial class KryptonSlider : ToolStripControlHostFixed #region Properties [Category("Control")] - public KryptonToolbarSlider Tracker => Control as KryptonToolbarSlider; + public KryptonToolbarSlider? Tracker => Control as KryptonToolbarSlider; [Category("Slider Values"), DefaultValue(typeof(bool), "false")] public bool SingleClick { - get => (Control as KryptonToolbarSlider).SingleClick; - set => (Control as KryptonToolbarSlider).SingleClick = value; + get => ((Control as KryptonToolbarSlider)!).SingleClick; + set => ((Control as KryptonToolbarSlider)!).SingleClick = value; } [Category("Slider Values"), DefaultValue(typeof(int), "200")] public int FireInterval { - get => (Control as KryptonToolbarSlider).FireInterval; - set => (Control as KryptonToolbarSlider).FireInterval = value; + get => ((Control as KryptonToolbarSlider)!).FireInterval; + set => ((Control as KryptonToolbarSlider)!).FireInterval = value; } [Category("Slider Values"), DefaultValue(typeof(Size), "140, 16")] public Size TrackerSize { - get => (Control as KryptonToolbarSlider).Size; - set => (Control as KryptonToolbarSlider).Size = value; + get => ((Control as KryptonToolbarSlider)!).Size; + set => ((Control as KryptonToolbarSlider)!).Size = value; } [Category("Slider Values"), DefaultValue(0)] public int Value { - get => (Control as KryptonToolbarSlider).Value; - set => (Control as KryptonToolbarSlider).Value = value; + get => ((Control as KryptonToolbarSlider)!).Value; + set => ((Control as KryptonToolbarSlider)!).Value = value; } [Category("Slider Values"), DefaultValue(100)] public int Range { - get => (Control as KryptonToolbarSlider).Range; - set => (Control as KryptonToolbarSlider).Range = value; + get => ((Control as KryptonToolbarSlider)!).Range; + set => ((Control as KryptonToolbarSlider)!).Range = value; } [Category("Slider Values"), DefaultValue(5)] public int Steps { - get => (Control as KryptonToolbarSlider).Steps; - set => (Control as KryptonToolbarSlider).Steps = value; + get => ((Control as KryptonToolbarSlider)!).Steps; + set => ((Control as KryptonToolbarSlider)!).Steps = value; } [Category("Slider Values")] - public int Maximum => (Control as KryptonToolbarSlider).Maximum; + public int Maximum => ((Control as KryptonToolbarSlider)!).Maximum; [Category("Slider Values")] - public int Minimum => (Control as KryptonToolbarSlider).Minimum; + public int Minimum => ((Control as KryptonToolbarSlider)!).Minimum; #endregion @@ -94,29 +94,29 @@ public KryptonSlider() : base(new KryptonToolbarSlider()) #endregion #region Overrides - protected override void OnSubscribeControlEvents(Control control) + protected override void OnSubscribeControlEvents(Control? control) { base.OnSubscribeControlEvents(control); - (Control as KryptonToolbarSlider).ValueChanged += OnValueChanged; + ((Control as KryptonToolbarSlider)!).ValueChanged += OnValueChanged; - //(Control as KryptonToolbarSlider).kminus.SliderButtonFire += kminus_SliderButtonFire; + //((Control as KryptonToolbarSlider)!).kminus.SliderButtonFire += kminus_SliderButtonFire; - //(Control as KryptonToolbarSlider).kplus.SliderButtonFire += kplus_SliderButtonFire; + //((Control as KryptonToolbarSlider)!).kplus.SliderButtonFire += kplus_SliderButtonFire; } - protected override void OnUnsubscribeControlEvents(Control control) + protected override void OnUnsubscribeControlEvents(Control? control) { base.OnUnsubscribeControlEvents(control); - (Control as KryptonToolbarSlider).ValueChanged -= OnValueChanged; + ((Control as KryptonToolbarSlider)!).ValueChanged -= OnValueChanged; //(this.Control as KryptonToolbarSlider).kminus.SliderButtonFire -= kminus_SliderButtonFire; //(this.Control as KryptonToolbarSlider).kplus.SliderButtonFire -= kplus_SliderButtonFire; } #endregion #region Event Handlers - private void OnValueChanged(KryptonToolbarSlider Sender, KryptonToolbarSlider.SliderEventArgs e) => ValueChanged?.Invoke(Sender, e); + private void OnValueChanged(KryptonToolbarSlider sender, KryptonToolbarSlider.SliderEventArgs e) => ValueChanged.Invoke(sender, e); private void kminus_SliderButtonFire(KryptonSliderButton sender, EventArgs e) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonStatusStrip.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonStatusStrip.cs index 67ffa8ea3..6e3e893c1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonStatusStrip.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonStatusStrip.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -141,7 +141,7 @@ protected override void OnRendererChanged(EventArgs e) } catch (Exception ex) { - ExceptionCapture.CaptureException(ex); + DebugUtilities.NotImplemented(ex.ToString()); } base.OnRendererChanged(e); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonThemeComboBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonThemeComboBox.cs index 4ea11a0ab..4b81b9958 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonThemeComboBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonThemeComboBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -32,7 +32,7 @@ public class KryptonThemeComboBox : ToolStripComboBox { #region Instances - private KryptonManager _manager = null; + private KryptonManager _manager; #endregion @@ -60,7 +60,7 @@ public KryptonThemeComboBox() AutoCompleteMode = AutoCompleteMode.SuggestAppend; - ThemeManager.PropagateThemeSelector(this); + //ThemeManager.PropagateThemeSelector(this); } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonToolStrip.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonToolStrip.cs index 7e9c4ebd3..093aed50a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonToolStrip.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonToolStrip.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonToolStripBrowseBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonToolStripBrowseBox.cs index d50b81c95..4a6932b3c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonToolStripBrowseBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonToolStripBrowseBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -33,7 +33,7 @@ public class KryptonToolStripBrowseBox : ToolStripControlHostFixed #region Public [Category("Control")] - public InternalBrowseBox KryptonBrowseBox => Control as InternalBrowseBox; + public InternalBrowseBox? KryptonBrowseBox => Control as InternalBrowseBox; #endregion @@ -66,7 +66,7 @@ public class InternalBrowseBox : KryptonTextBox private ButtonSpecAny _bsaReset; - private CommonFileDialogFilter _filter; + private CommonFileDialogFilter? _filter; private CommonFileDialogFilterCollection _filterCollection; @@ -128,7 +128,7 @@ public class InternalBrowseBox : KryptonTextBox /// Gets or sets the reset text. /// The reset text. [DefaultValue(@"&Reset"), Description(@"Gets or sets the reset text.")] - public string ResetText { get => _resetText; set { _resetText = value; Invalidate(); } } + public new string ResetText { get => _resetText; set { _resetText = value; Invalidate(); } } /// Gets or sets the reset text tool tip heading. /// The reset text tool tip heading. @@ -169,25 +169,25 @@ public InternalBrowseBox() _largeResetImage = Properties.Resources.Reset_32_x_32; - _bsaBrowse.Text = "..."; + _bsaBrowse.Text = @"..."; _bsaBrowse.KryptonCommand = _kcBrowse; - _kcBrowse.Text = "..."; + _kcBrowse.Text = @"..."; _bsaReset.ToolTipImage = _smallResetImage; - _bsaReset.ToolTipBody = _resetTextToolTipDescription; + _bsaReset.ToolTipBody = _resetTextToolTipDescription ?? @"Resets the textbox value."; - _bsaReset.ToolTipTitle = _resetTextToolTipHeading; + _bsaReset.ToolTipTitle = _resetTextToolTipHeading ?? @"Reset Text"; - _bsaReset.Text = _resetText; + _bsaReset.Text = _resetText ?? @"Reset Text"; _bsaReset.Image = _smallResetImage; _bsaReset.KryptonCommand = _kcReset; - _kcReset.Text = _resetText; + _kcReset.Text = _resetText ?? @"Reset Text"; _bsaReset.Enabled = ButtonEnabled.False; @@ -229,7 +229,7 @@ private void Browse_Execute(object sender, EventArgs e) if (saveFileDialog.ShowDialog() == CommonFileDialogResult.Ok) { - Text = Path.GetFullPath(saveFileDialog.FileName); + Text = Path.GetFullPath(saveFileDialog.FileName!); } } else @@ -250,7 +250,7 @@ private void Browse_Execute(object sender, EventArgs e) if (dialog.ShowDialog() == CommonFileDialogResult.Ok) { - Text = Path.GetFullPath(dialog.FileName); + Text = Path.GetFullPath(dialog.FileName!); } } } @@ -274,7 +274,7 @@ private void Reset_Execute(object sender, EventArgs e) /// Raises the Paint event. /// A PaintEventArgs containing the event data. - protected override void OnPaint(PaintEventArgs e) + protected override void OnPaint(PaintEventArgs? e) { _bsaReset.Visible = _showResetButton; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonToolStripTextBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonToolStripTextBox.cs index 36dae2d61..420d398cf 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonToolStripTextBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonToolStripTextBox.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,7 +31,7 @@ namespace Krypton.Toolkit.Suite.Extended.Tool.Strip.Items public class KryptonToolStripTextBox : ToolStripControlHost { #region Properties - public KryptonTextBox KryptonTextBox => Control as KryptonTextBox; + public KryptonTextBox? KryptonTextBox => Control as KryptonTextBox; #endregion @@ -45,26 +45,26 @@ public KryptonToolStripTextBox() : base(CreateControlInstance()) #region Overrides protected override void OnSubscribeControlEvents(Control control) { - KryptonTextBox kryptonTextBox = control as KryptonTextBox; + var kryptonTextBox = control as KryptonTextBox; - kryptonTextBox.TextAlignChanged += new EventHandler(TextAlignChanged); + kryptonTextBox!.TextAlignChanged += TextAlignChanged; - kryptonTextBox.TextChanged += new EventHandler(Text_Changed); + kryptonTextBox.TextChanged += Text_Changed; - kryptonTextBox.FontChanged += new EventHandler(FontChanged); + kryptonTextBox.FontChanged += FontChanged; base.OnSubscribeControlEvents(control); } protected override void OnUnsubscribeControlEvents(Control control) { - KryptonTextBox kryptonTextBox = control as KryptonTextBox; + var kryptonTextBox = control as KryptonTextBox; - kryptonTextBox.TextAlignChanged -= new EventHandler(TextAlignChanged); + kryptonTextBox!.TextAlignChanged -= TextAlignChanged; - kryptonTextBox.TextChanged -= new EventHandler(Text_Changed); + kryptonTextBox.TextChanged -= Text_Changed; - kryptonTextBox.FontChanged -= new EventHandler(FontChanged); + kryptonTextBox.FontChanged -= FontChanged; base.OnUnsubscribeControlEvents(control); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonTrackBarToolStripMenuItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonTrackBarToolStripMenuItem.cs index ed415f42a..ce8acaf2c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonTrackBarToolStripMenuItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/KryptonTrackBarToolStripMenuItem.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -39,7 +39,7 @@ public class KryptonTrackBarToolStripMenuItem : ToolStripControlHostFixed /// The KryptonTrackBar control. [RefreshProperties(RefreshProperties.All), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] - public KryptonTrackBar KryptonTrackBarControl => Control as KryptonTrackBar; + public KryptonTrackBar? KryptonTrackBarControl => Control as KryptonTrackBar; // Constructor ======================================================== /// @@ -59,11 +59,9 @@ public KryptonTrackBarToolStripMenuItem() /// An ordered pair of type representing the width and height of a rectangle. /// /// - public override Size GetPreferredSize(Size constrainingSize) - { + public override Size GetPreferredSize(Size constrainingSize) => //return base.GetPreferredSize(constrainingSize); - return KryptonTrackBarControl.GetPreferredSize(constrainingSize); - } + KryptonTrackBarControl!.GetPreferredSize(constrainingSize); /// /// Subscribes events from the hosted control. @@ -74,7 +72,7 @@ protected override void OnSubscribeControlEvents(Control control) base.OnSubscribeControlEvents(control); //Add your code here to subsribe to Control Events - ((KryptonTrackBar)control).ValueChanged += new EventHandler(OnValueChanged); + ((KryptonTrackBar)control).ValueChanged += OnValueChanged; } /// @@ -86,7 +84,7 @@ protected override void OnUnsubscribeControlEvents(Control control) base.OnUnsubscribeControlEvents(control); //Add your code here to unsubscribe from control events. - ((KryptonTrackBar)control).ValueChanged -= new EventHandler(OnValueChanged); + ((KryptonTrackBar)control).ValueChanged -= OnValueChanged; } #region ... exposed properties ... @@ -152,14 +150,8 @@ public Orientation Orientation #endregion #region ... exposed events ... - public event EventHandler ValueChanged; - protected void OnValueChanged(object sender, EventArgs e) - { - if (ValueChanged != null) - { - ValueChanged(this, e); - } - } + public event EventHandler? ValueChanged; + protected void OnValueChanged(object sender, EventArgs e) => ValueChanged?.Invoke(this, e); #endregion } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/MRUMenuItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/MRUMenuItem.cs index 0e0b95499..d3e4684b2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/MRUMenuItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/MRUMenuItem.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -34,9 +34,10 @@ public class MRUMenuItem : ToolStripMenuItem private Control _outputControl; - private string _applicationName, _defaultText = "Mo&st Recently Used..."; + private string? _applicationName; + private string _defaultText = @"Mo&st Recently Used..."; - private MostRecentlyUsedFileManager _recentlyUsedFileManager = null; + private readonly MostRecentlyUsedFileManager? _recentlyUsedFileManager; #endregion #region Public @@ -60,13 +61,13 @@ public MRUMenuItem(string defaultText) private void MyOwnRecentFileGotClicked_Handler(object sender, EventArgs e) { - string fileName = (sender as ToolStripItem).Text; + var fileName = (sender as ToolStripItem)?.Text; if (!File.Exists(fileName)) { if (KryptonMessageBox.Show($"{fileName} doesn't exist. Remove from recent workspaces?", "File not found", KryptonMessageBoxButtons.YesNo) == DialogResult.Yes) { - _recentlyUsedFileManager.RemoveRecentFile(fileName); + _recentlyUsedFileManager?.RemoveRecentFile(fileName); } else { @@ -82,7 +83,7 @@ private void MyOwnRecentFilesGotCleared_Handler(object sender, EventArgs e) } - private void OpenFile(string filePath, Control outputControl) + private void OpenFile(string? filePath, Control? outputControl) { try { @@ -90,7 +91,7 @@ private void OpenFile(string filePath, Control outputControl) { if (outputControl != null) { - StreamReader sr = new StreamReader(filePath); + StreamReader sr = new StreamReader(filePath!); outputControl.Text = sr.ReadToEnd(); @@ -99,7 +100,7 @@ private void OpenFile(string filePath, Control outputControl) sr.Dispose(); } - _recentlyUsedFileManager.AddRecentFile(filePath); + _recentlyUsedFileManager?.AddRecentFile(filePath); } else { @@ -108,7 +109,7 @@ private void OpenFile(string filePath, Control outputControl) } catch (IOException e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/MRUOpenFileMenuItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/MRUOpenFileMenuItem.cs index 883821c8d..2738b4995 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/MRUOpenFileMenuItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/MRUOpenFileMenuItem.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,6 +26,7 @@ #endregion using OpenFileDialog = System.Windows.Forms.OpenFileDialog; +// ReSharper disable InconsistentNaming namespace Krypton.Toolkit.Suite.Extended.Tool.Strip.Items { @@ -36,11 +37,11 @@ public class MRUOpenFileMenuItem : ToolStripMenuItem private bool _useSystemDialogs; - private Control _outputControl = null; + private Control? _outputControl; private string _defaultText = "O&pen"; - private string _applicationName; + private string? _applicationName; private string _openFileDialogTitle = "Open:"; @@ -52,9 +53,9 @@ public class MRUOpenFileMenuItem : ToolStripMenuItem private string _startingDirectory; - private MRUMenuItem _parentMruMenuItem; + private MRUMenuItem? _parentMruMenuItem; - private MostRecentlyUsedFileManager _recentlyUsedFileManager = null; + private MostRecentlyUsedFileManager? _recentlyUsedFileManager; #endregion @@ -67,7 +68,7 @@ public class MRUOpenFileMenuItem : ToolStripMenuItem /// Gets or sets the control to load the file content text into. /// The control to load the file content text into. [DefaultValue(null), Description("The control to load the file content text into.")] - public Control OutputControl { get => _outputControl; set => _outputControl = value; } + public Control? OutputControl { get => _outputControl; set => _outputControl = value; } /// Gets or sets the text displayed on the tool strip menu item. /// The text displayed on the tool strip menu item. @@ -77,7 +78,7 @@ public class MRUOpenFileMenuItem : ToolStripMenuItem /// Gets or sets the name of the name of your application. This is used to store the MRU list in the Windows registry. /// The name of the application. [DefaultValue(null), Description("The name of your application. This is used to store the MRU list in the Windows registry.")] - public string ApplicationName { get => _applicationName; set => _applicationName = value; } + public string? ApplicationName { get => _applicationName; set => _applicationName = value; } /// Gets or sets the open file dialog title. /// The open file dialog title. @@ -105,7 +106,7 @@ public class MRUOpenFileMenuItem : ToolStripMenuItem /// Gets or sets the parent MRU menu item. /// The parent MRU menu item. [DefaultValue(null), Description("The parent MRU menu item.")] - public MRUMenuItem ParentMRUMenuItem { get => _parentMruMenuItem; set => _parentMruMenuItem = value; } + public MRUMenuItem? ParentMRUMenuItem { get => _parentMruMenuItem; set => _parentMruMenuItem = value; } #endregion @@ -141,10 +142,10 @@ public MRUOpenFileMenuItem() ShortcutKeys = Keys.Control | Keys.O; - ShortcutKeyDisplayString = "Ctrl + O"; + ShortcutKeyDisplayString = @"Ctrl + O"; } - public MRUOpenFileMenuItem(string defaultText) + public MRUOpenFileMenuItem(string? defaultText) { } @@ -153,7 +154,7 @@ public MRUOpenFileMenuItem(string defaultText) #region Implementation - private void OpenFile(string filePath, Control outputControl) + private void OpenFile(string? filePath, Control? outputControl) { try { @@ -161,7 +162,7 @@ private void OpenFile(string filePath, Control outputControl) { if (outputControl != null) { - StreamReader sr = new StreamReader(filePath); + StreamReader sr = new StreamReader(filePath!); outputControl.Text = sr.ReadToEnd(); @@ -170,7 +171,7 @@ private void OpenFile(string filePath, Control outputControl) sr.Dispose(); } - _recentlyUsedFileManager.AddRecentFile(filePath); + _recentlyUsedFileManager?.AddRecentFile(filePath); } else { @@ -179,7 +180,7 @@ private void OpenFile(string filePath, Control outputControl) } catch (IOException e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } } @@ -213,7 +214,7 @@ protected override void OnClick(EventArgs e) return; } - string openedFile = ofd.FileName; + string? openedFile = ofd.FileName; OpenFile(openedFile, _outputControl); } @@ -239,14 +240,14 @@ protected override void OnClick(EventArgs e) return; } - string openedFile = ofd.FileName; + string? openedFile = ofd.FileName; OpenFile(openedFile, _outputControl); } } catch (Exception ex) { - ExceptionCapture.CaptureException(ex); + DebugUtilities.NotImplemented(ex.ToString()); } base.OnClick(e); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/MRUSaveAsFileMenuItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/MRUSaveAsFileMenuItem.cs index dcc355edb..00a87759b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/MRUSaveAsFileMenuItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/MRUSaveAsFileMenuItem.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -34,7 +34,7 @@ public class MRUSaveAsFileMenuItem : ToolStripMenuItem private bool _useSystemDialogs; - private Control _outputControl = null; + private Control? _outputControl; private string _defaultText = "Save &As"; @@ -52,7 +52,12 @@ public class MRUSaveAsFileMenuItem : ToolStripMenuItem private MRUMenuItem _parentMruMenuItem; - private MostRecentlyUsedFileManager _recentlyUsedFileManager = null; + private readonly MostRecentlyUsedFileManager? _recentlyUsedFileManager; + + public MRUSaveAsFileMenuItem(MostRecentlyUsedFileManager? recentlyUsedFileManager) + { + _recentlyUsedFileManager = recentlyUsedFileManager; + } #endregion @@ -65,7 +70,7 @@ public class MRUSaveAsFileMenuItem : ToolStripMenuItem /// Gets or sets the control to load the file content text into. /// The control to load the file content text into. [DefaultValue(null), Description("The control to load the file content text into.")] - public Control OutputControl { get => _outputControl; set => _outputControl = value; } + public Control? OutputControl { get => _outputControl; set => _outputControl = value; } /// Gets or sets the text displayed on the tool strip menu item. /// The text displayed on the tool strip menu item. diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/MRUSaveFileMenuItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/MRUSaveFileMenuItem.cs index e751bd7b2..6307b3afc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/MRUSaveFileMenuItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/MRUSaveFileMenuItem.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,6 +25,7 @@ */ #endregion +// ReSharper disable InconsistentNaming #pragma warning disable CS0414 namespace Krypton.Toolkit.Suite.Extended.Tool.Strip.Items { @@ -35,7 +36,7 @@ public class MRUSaveFileMenuItem : ToolStripMenuItem private bool _useSystemDialogs; - private Control _outputControl = null; + private Control? _outputControl; private string _defaultText = "Sa&ve"; @@ -53,7 +54,7 @@ public class MRUSaveFileMenuItem : ToolStripMenuItem private MRUMenuItem _parentMruMenuItem; - private MostRecentlyUsedFileManager _recentlyUsedFileManager = null; + private readonly MostRecentlyUsedFileManager? _recentlyUsedFileManager; #endregion @@ -66,7 +67,7 @@ public class MRUSaveFileMenuItem : ToolStripMenuItem /// Gets or sets the control to load the file content text into. /// The control to load the file content text into. [DefaultValue(null), Description("The control to load the file content text into.")] - public Control OutputControl { get => _outputControl; set => _outputControl = value; } + public Control? OutputControl { get => _outputControl; set => _outputControl = value; } /// Gets or sets the text displayed on the tool strip menu item. /// The text displayed on the tool strip menu item. diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripControlHostFixed.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripControlHostFixed.cs index 91279894e..b9b483392 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripControlHostFixed.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripControlHostFixed.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripLabelExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripLabelExtended.cs index 63f1e1012..00a47ec08 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripLabelExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripLabelExtended.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -34,7 +34,7 @@ public class ToolStripLabelExtended : ToolStripStatusLabel #region Krypton - private PaletteBase _palette; + private PaletteBase? _palette; private IRenderer _renderer; @@ -71,7 +71,7 @@ public class ToolStripLabelExtended : ToolStripStatusLabel #region Properties /// - /// Gets or sets a value indicating whether this is alert. + /// Gets or sets a value indicating whether this is alert. /// /// /// true if alert; otherwise, false. @@ -422,8 +422,6 @@ protected override void OnPaint(PaintEventArgs e) case BlinkState.SoftBlink: SoftBlink(AlertColourOne, AlertColourTwo, AlertTextColour, CycleInterval, BkClr, BlinkDuration); break; - default: - break; } } @@ -435,7 +433,7 @@ protected override void OnPaint(PaintEventArgs e) _fadeAnimationTimer.Enabled = true; - _fadeAnimationTimer.Tick += new EventHandler(FadeAnimationTimer_Tick); + _fadeAnimationTimer.Tick += FadeAnimationTimer_Tick; } } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripMarqueeMenuItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripMarqueeMenuItem.cs index 0b0a4b85b..63559d67c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripMarqueeMenuItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripMarqueeMenuItem.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -108,8 +108,7 @@ public int RefreshInterval /// Bigger value means faster moving text. /// Text scrolling speed in pixels per seconds can be expressed with the following formula: ///

- /// 1000 * ScrolStep/RefreshInterval - ///
+ /// 1000 * ScrollStep/RefreshInterval ///
[Browsable(true)] [DefaultValue(DEFAULT_SCROLL_STEP)] @@ -118,7 +117,7 @@ public int RefreshInterval /// /// When sets to 'true', every time mouse pointer moves over tool strip item, scrolling stops. - /// Otherwise scrolling never stops. + /// Otherwise, scrolling never stops. /// [Browsable(true)] [DefaultValue(DEFAULT_STOP_SCROLL_ON_MOUSE_OVER)] @@ -154,7 +153,7 @@ public ToolStripMarqueeMenuItem() MarqueeScrollDirection = DEFAULT_MARQUEE_SCROLL_DIRECTION; _timer = new Timer(); _timer.Interval = DEFAULT_REFRESH_INTERVAL; - _timer.Tick += new EventHandler(timer_Tick); + _timer.Tick += timer_Tick; _timer.Enabled = true; if (MarqueeScrollDirection == MarqueeScrollDirection.RightToLeft) @@ -188,7 +187,7 @@ public ToolStripMarqueeMenuItem() void timer_Tick(object sender, EventArgs e) { //Change offset only when menu item is visible, mouse is not hovering over or StopScrollOnMouseOver is not set to 'false' - if ((Visible) && ((!Selected) || (!StopScrollOnMouseOver))) + if (Visible && (!Selected || !StopScrollOnMouseOver)) { _pixelOffest = (_pixelOffest + ScrollStep + _textSize.Width) % (2 * _textSize.Width + 1) - _textSize.Width; Invalidate(); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripMenuItemUACSheld.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripMenuItemUACSheld.cs index 82b7ac6ab..7b79b34f2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripMenuItemUACSheld.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripMenuItemUACSheld.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -159,10 +159,7 @@ protected override void OnClick(EventArgs e) /// The instance containing the event data. protected virtual void OnExecuteProcessAsAdministrator(object sender, ExecuteProcessAsAdministratorEventArgs e) { - if (ExecuteProcessAsAdministrator != null) - { - ExecuteProcessAsAdministrator(sender, e); - } + ExecuteProcessAsAdministrator?.Invoke(sender, e); } } } \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripProgressBarWithValueText.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripProgressBarWithValueText.cs index 9df4a8e2a..e868944da 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripProgressBarWithValueText.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/General/ToolStripProgressBarWithValueText.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonLoadingCircle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonLoadingCircle.cs index 706d1f25a..1f2f1b0a0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonLoadingCircle.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonLoadingCircle.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -64,18 +64,18 @@ public enum StylePresets } // Attributes ======================================================== - private Timer m_Timer; - private bool m_IsTimerActive; - private int m_NumberOfSpoke; - private int m_SpokeThickness; - private int m_ProgressValue; - private int m_OuterCircleRadius; - private int m_InnerCircleRadius; - private PointF m_CenterPoint; - private Color m_Color; - private Color[] m_Colors; - private double[] m_Angles; - private StylePresets m_StylePreset; + private Timer _mTimer; + private bool _mIsTimerActive; + private int _mNumberOfSpoke; + private int _mSpokeThickness; + private int _mProgressValue; + private int _mOuterCircleRadius; + private int _mInnerCircleRadius; + private PointF _mCenterPoint; + private Color _mColor; + private Color[] _mColors; + private double[] _mAngles; + private StylePresets _mStylePreset; // Properties ======================================================== /// @@ -87,10 +87,10 @@ public enum StylePresets Description("Sets the color of spoke.")] public Color Color { - get => m_Color; + get => _mColor; set { - m_Color = value; + _mColor = value; GenerateColoursPallet(); Invalidate(); @@ -107,16 +107,16 @@ public int OuterCircleRadius { get { - if (m_OuterCircleRadius == 0) + if (_mOuterCircleRadius == 0) { - m_OuterCircleRadius = DefaultOuterCircleRadius; + _mOuterCircleRadius = DefaultOuterCircleRadius; } - return m_OuterCircleRadius; + return _mOuterCircleRadius; } set { - m_OuterCircleRadius = value; + _mOuterCircleRadius = value; Invalidate(); } } @@ -131,16 +131,16 @@ public int InnerCircleRadius { get { - if (m_InnerCircleRadius == 0) + if (_mInnerCircleRadius == 0) { - m_InnerCircleRadius = DefaultInnerCircleRadius; + _mInnerCircleRadius = DefaultInnerCircleRadius; } - return m_InnerCircleRadius; + return _mInnerCircleRadius; } set { - m_InnerCircleRadius = value; + _mInnerCircleRadius = value; Invalidate(); } } @@ -155,18 +155,18 @@ public int NumberSpoke { get { - if (m_NumberOfSpoke == 0) + if (_mNumberOfSpoke == 0) { - m_NumberOfSpoke = DefaultNumberOfSpoke; + _mNumberOfSpoke = DefaultNumberOfSpoke; } - return m_NumberOfSpoke; + return _mNumberOfSpoke; } set { - if (m_NumberOfSpoke != value && m_NumberOfSpoke > 0) + if (_mNumberOfSpoke != value && _mNumberOfSpoke > 0) { - m_NumberOfSpoke = value; + _mNumberOfSpoke = value; GenerateColoursPallet(); GetSpokesAngles(); @@ -183,10 +183,10 @@ public int NumberSpoke Category("LoadingCircle")] public bool Active { - get => m_IsTimerActive; + get => _mIsTimerActive; set { - m_IsTimerActive = value; + _mIsTimerActive = value; ActiveTimer(); } } @@ -201,16 +201,16 @@ public int SpokeThickness { get { - if (m_SpokeThickness <= 0) + if (_mSpokeThickness <= 0) { - m_SpokeThickness = DefaultSpokeThickness; + _mSpokeThickness = DefaultSpokeThickness; } - return m_SpokeThickness; + return _mSpokeThickness; } set { - m_SpokeThickness = value; + _mSpokeThickness = value; Invalidate(); } } @@ -223,12 +223,12 @@ public int SpokeThickness Category("LoadingCircle")] public int RotationSpeed { - get => m_Timer.Interval; + get => _mTimer.Interval; set { if (value > 0) { - m_Timer.Interval = value; + _mTimer.Interval = value; } } } @@ -242,12 +242,12 @@ public int RotationSpeed DefaultValue(typeof(StylePresets), "Custom")] public StylePresets StylePreset { - get => m_StylePreset; + get => _mStylePreset; set { - m_StylePreset = value; + _mStylePreset = value; - switch (m_StylePreset) + switch (_mStylePreset) { case StylePresets.MacOSX: SetCircleAppearance(MacOSXNumberOfSpoke, @@ -285,17 +285,17 @@ public KryptonLoadingCircle() SetStyle(ControlStyles.ResizeRedraw, true); SetStyle(ControlStyles.SupportsTransparentBackColor, true); - m_Color = DefaultColor; + _mColor = DefaultColor; GenerateColoursPallet(); GetSpokesAngles(); GetControlCenterPoint(); - m_Timer = new Timer(); - m_Timer.Tick += new EventHandler(aTimer_Tick); + _mTimer = new Timer(); + _mTimer.Tick += aTimer_Tick; ActiveTimer(); - Resize += new EventHandler(LoadingCircle_Resize); + Resize += LoadingCircle_Resize; } // Events ============================================================ @@ -316,7 +316,7 @@ private void LoadingCircle_Resize(object sender, EventArgs e) /// The instance containing the event data. private void aTimer_Tick(object sender, EventArgs e) { - m_ProgressValue = ++m_ProgressValue % m_NumberOfSpoke; + _mProgressValue = ++_mProgressValue % _mNumberOfSpoke; Invalidate(); } @@ -326,18 +326,18 @@ private void aTimer_Tick(object sender, EventArgs e) /// A that contains the event data. protected override void OnPaint(PaintEventArgs e) { - if (m_NumberOfSpoke > 0) + if (_mNumberOfSpoke > 0) { e.Graphics.SmoothingMode = SmoothingMode.HighQuality; - int intPosition = m_ProgressValue; - for (int intCounter = 0; intCounter < m_NumberOfSpoke; intCounter++) + int intPosition = _mProgressValue; + for (int intCounter = 0; intCounter < _mNumberOfSpoke; intCounter++) { - intPosition = intPosition % m_NumberOfSpoke; + intPosition = intPosition % _mNumberOfSpoke; DrawLine(e.Graphics, - GetCoordinate(m_CenterPoint, m_InnerCircleRadius, m_Angles[intPosition]), - GetCoordinate(m_CenterPoint, m_OuterCircleRadius, m_Angles[intPosition]), - m_Colors[intCounter], m_SpokeThickness); + GetCoordinate(_mCenterPoint, _mInnerCircleRadius, _mAngles[intPosition]), + GetCoordinate(_mCenterPoint, _mOuterCircleRadius, _mAngles[intPosition]), + _mColors[intCounter], _mSpokeThickness); intPosition++; } } @@ -356,7 +356,7 @@ protected override void OnPaint(PaintEventArgs e) public override Size GetPreferredSize(Size proposedSize) { proposedSize.Width = - (m_OuterCircleRadius + m_SpokeThickness) * 2; + (_mOuterCircleRadius + _mSpokeThickness) * 2; return proposedSize; } @@ -365,15 +365,15 @@ public override Size GetPreferredSize(Size proposedSize) /// /// Darkens a specified color. /// - /// Color to darken. - /// The percent of darken. + /// Color to darken. + /// The percent of darken. /// The new color generated. - private Color Darken(Color _objColor, int _intPercent) + private Color Darken(Color objColor, int intPercent) { - int intRed = _objColor.R; - int intGreen = _objColor.G; - int intBlue = _objColor.B; - return Color.FromArgb(_intPercent, Math.Min(intRed, byte.MaxValue), Math.Min(intGreen, byte.MaxValue), Math.Min(intBlue, byte.MaxValue)); + int intRed = objColor.R; + int intGreen = objColor.G; + int intBlue = objColor.B; + return Color.FromArgb(intPercent, Math.Min(intRed, byte.MaxValue), Math.Min(intGreen, byte.MaxValue), Math.Min(intBlue, byte.MaxValue)); } /// @@ -381,16 +381,16 @@ private Color Darken(Color _objColor, int _intPercent) /// private void GenerateColoursPallet() { - m_Colors = GenerateColoursPallet(m_Color, Active, m_NumberOfSpoke); + _mColors = GenerateColoursPallet(_mColor, Active, _mNumberOfSpoke); } /// /// Generates the colors pallet. /// - /// Color of the lightest spoke. - /// if set to true the color will be shaded on X spoke. + /// Color of the lightest spoke. + /// if set to true the color will be shaded on X spoke. /// An array of color used to draw the circle. - private Color[] GenerateColoursPallet(Color _objColor, bool _blnShadeColor, int _intNbSpoke) + private Color[] GenerateColoursPallet(Color objColor, bool blnShadeColor, int intNbSpoke) { Color[] objColors = new Color[NumberSpoke]; @@ -403,11 +403,11 @@ private Color[] GenerateColoursPallet(Color _objColor, bool _blnShadeColor, int for (int intCursor = 0; intCursor < NumberSpoke; intCursor++) { - if (_blnShadeColor) + if (blnShadeColor) { - if (intCursor == 0 || intCursor < NumberSpoke - _intNbSpoke) + if (intCursor == 0 || intCursor < NumberSpoke - intNbSpoke) { - objColors[intCursor] = _objColor; + objColors[intCursor] = objColor; } else { @@ -422,12 +422,12 @@ private Color[] GenerateColoursPallet(Color _objColor, bool _blnShadeColor, int } // Determine the spoke forecolor - objColors[intCursor] = Darken(_objColor, PERCENTAGE_OF_DARKEN); + objColors[intCursor] = Darken(objColor, PERCENTAGE_OF_DARKEN); } } else { - objColors[intCursor] = _objColor; + objColors[intCursor] = objColor; } } @@ -439,50 +439,47 @@ private Color[] GenerateColoursPallet(Color _objColor, bool _blnShadeColor, int /// private void GetControlCenterPoint() { - m_CenterPoint = GetControlCenterPoint(this); + _mCenterPoint = GetControlCenterPoint(this); } /// /// Gets the control center point. /// /// PointF object - private PointF GetControlCenterPoint(Control _objControl) - { - return new PointF(_objControl.Width / 2, _objControl.Height / 2 - 1); - } + private PointF GetControlCenterPoint(Control objControl) => new(objControl.Width / 2, objControl.Height / 2 - 1); /// /// Draws the line with GDI+. /// - /// The Graphics object. - /// The point one. - /// The point two. - /// Color of the spoke. - /// The thickness of spoke. - private void DrawLine(Graphics _objGraphics, PointF _objPointOne, PointF _objPointTwo, - Color _objColor, int _intLineThickness) + /// The Graphics object. + /// The point one. + /// The point two. + /// Color of the spoke. + /// The thickness of spoke. + private void DrawLine(Graphics objGraphics, PointF objPointOne, PointF objPointTwo, + Color objColor, int intLineThickness) { - using (Pen objPen = new Pen(new SolidBrush(_objColor), _intLineThickness)) + using (Pen objPen = new Pen(new SolidBrush(objColor), intLineThickness)) { objPen.StartCap = LineCap.Round; objPen.EndCap = LineCap.Round; - _objGraphics.DrawLine(objPen, _objPointOne, _objPointTwo); + objGraphics.DrawLine(objPen, objPointOne, objPointTwo); } } /// /// Gets the coordinate. /// - /// The Circle center. - /// The radius. - /// The angle. + /// The Circle center. + /// The radius. + /// The angle. /// - private PointF GetCoordinate(PointF _objCircleCenter, int _intRadius, double _dblAngle) + private PointF GetCoordinate(PointF objCircleCenter, int intRadius, double dblAngle) { - double dblAngle = Math.PI * _dblAngle / NumberOfDegreesInHalfCircle; + double angle = Math.PI * dblAngle / NumberOfDegreesInHalfCircle; - return new PointF(_objCircleCenter.X + _intRadius * (float)Math.Cos(dblAngle), - _objCircleCenter.Y + _intRadius * (float)Math.Sin(dblAngle)); + return new PointF(objCircleCenter.X + intRadius * (float)Math.Cos(angle), + objCircleCenter.Y + intRadius * (float)Math.Sin(angle)); } /// @@ -490,23 +487,23 @@ private PointF GetCoordinate(PointF _objCircleCenter, int _intRadius, double _db /// private void GetSpokesAngles() { - m_Angles = GetSpokesAngles(NumberSpoke); + _mAngles = GetSpokesAngles(NumberSpoke); } /// /// Gets the spoke angles. /// - /// The number spoke. + /// The number spoke. /// An array of angle. - private double[] GetSpokesAngles(int _intNumberSpoke) + private double[] GetSpokesAngles(int intNumberSpoke) { - double[] Angles = new double[_intNumberSpoke]; - double dblAngle = (double)NumberOfDegreesInCircle / _intNumberSpoke; + double[] angles = new double[intNumberSpoke]; + double dblAngle = NumberOfDegreesInCircle / intNumberSpoke; - for (int shtCounter = 0; shtCounter < _intNumberSpoke; shtCounter++) - Angles[shtCounter] = (shtCounter == 0 ? dblAngle : Angles[shtCounter - 1] + dblAngle); + for (int shtCounter = 0; shtCounter < intNumberSpoke; shtCounter++) + angles[shtCounter] = shtCounter == 0 ? dblAngle : angles[shtCounter - 1] + dblAngle; - return Angles; + return angles; } /// @@ -514,14 +511,14 @@ private double[] GetSpokesAngles(int _intNumberSpoke) /// private void ActiveTimer() { - if (m_IsTimerActive) + if (_mIsTimerActive) { - m_Timer.Start(); + _mTimer.Start(); } else { - m_Timer.Stop(); - m_ProgressValue = 0; + _mTimer.Stop(); + _mProgressValue = 0; } GenerateColoursPallet(); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonSliderButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonSliderButton.cs index 8f71d6b78..f0ed58f69 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonSliderButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonSliderButton.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -34,7 +34,7 @@ public partial class KryptonSliderButton : UserControl, IContentValues /// /// Required designer variable. /// - private IContainer components = null; + private IContainer? components; #region Component Designer generated code @@ -93,18 +93,18 @@ public KryptonSliderButton() SetStyle(ControlStyles.UserPaint, true); //(5) Create redirection object to the base palette - if (((_palette != null))) + if (_palette != null) { - _palette.PalettePaint += new EventHandler(OnPalettePaint); + _palette.PalettePaint += OnPalettePaint; } - KryptonManager.GlobalPaletteChanged += new EventHandler(OnGlobalPaletteChanged); + KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged; _palette = KryptonManager.CurrentGlobalPalette; _paletteRedirect = new PaletteRedirect(_palette); //(6) Create accessor objects for the back, border and content - m_paletteBack = new PaletteBackInheritRedirect(_paletteRedirect); - m_paletteBorder = new PaletteBorderInheritRedirect(_paletteRedirect); - m_paletteContent = new PaletteContentInheritRedirect(_paletteRedirect); + _mPaletteBack = new PaletteBackInheritRedirect(_paletteRedirect); + _mPaletteBorder = new PaletteBorderInheritRedirect(_paletteRedirect); + _mPaletteContent = new PaletteContentInheritRedirect(_paletteRedirect); //Set Properties BackColor = Color.Transparent; @@ -115,51 +115,51 @@ public KryptonSliderButton() } //Palette State - private KryptonManager k_manager = new KryptonManager(); - private PaletteBackInheritRedirect m_paletteBack; - private PaletteBorderInheritRedirect m_paletteBorder; - private PaletteContentInheritRedirect m_paletteContent; - private IDisposable m_mementoContent; - private IDisposable m_mementoBack1; - private IDisposable m_mementoBack2; + private KryptonManager _kManager = new KryptonManager(); + private PaletteBackInheritRedirect _mPaletteBack; + private PaletteBorderInheritRedirect _mPaletteBorder; + private PaletteContentInheritRedirect _mPaletteContent; + private IDisposable _mMementoContent; + private IDisposable _mMementoBack1; + private IDisposable _mMementoBack2; private PaletteBase _palette; private PaletteRedirect _paletteRedirect; //Colors - private Color m_innerColor = Color.FromArgb(99, 106, 116); - private Color m_outerColor = Color.FromArgb(236, 236, 236); + private Color _mInnerColor = Color.FromArgb(99, 106, 116); + private Color _mOuterColor = Color.FromArgb(236, 236, 236); //Declares - private bool m_highlight = false; - private bool m_down = false; - private VisualOrientation m_orientation = VisualOrientation.Top; - private ButtonStyles m_buttonstyle = ButtonStyles.MinusButton; - private PaletteBackStyle m_visuallook = PaletteBackStyle.ButtonStandalone; - private bool m_singleClick = false; + private bool _mHighlight; + private bool _mDown; + private VisualOrientation _mOrientation = VisualOrientation.Top; + private ButtonStyles _mButtonstyle = ButtonStyles.MinusButton; + private PaletteBackStyle _mVisuallook = PaletteBackStyle.ButtonStandalone; + private bool _mSingleClick; //Events public event SliderButtonFireEventHandler SliderButtonFire; - public delegate void SliderButtonFireEventHandler(KryptonSliderButton Sender, EventArgs e); + public delegate void SliderButtonFireEventHandler(KryptonSliderButton sender, EventArgs e); //Properties public bool SingleClick { - get => m_singleClick; + get => _mSingleClick; set { - m_singleClick = value; + _mSingleClick = value; Invalidate(); } } public VisualOrientation Orientation { - get => m_orientation; + get => _mOrientation; set { - if (m_orientation != value) + if (_mOrientation != value) { - m_orientation = value; + _mOrientation = value; PerformLayout(); Invalidate(); } @@ -167,21 +167,21 @@ public VisualOrientation Orientation } public ButtonStyles ButtonStyle { - get => m_buttonstyle; + get => _mButtonstyle; set { - m_buttonstyle = value; + _mButtonstyle = value; Invalidate(); } } public PaletteBackStyle VisualLook { - get => m_visuallook; + get => _mVisuallook; set { - if (m_visuallook != value) + if (_mVisuallook != value) { - m_visuallook = value; + _mVisuallook = value; Invalidate(); } } @@ -191,7 +191,7 @@ public int EventFireRate get => FireTimer.Interval; set { - if (FireTimer.Interval != value & !m_down) + if (FireTimer.Interval != value & !_mDown) { FireTimer.Interval = value; } @@ -203,8 +203,8 @@ protected override void OnPaint(PaintEventArgs e) { //Define Bounds - Rectangle ButtonBounds = new Rectangle(0, 0, 16, 16); - RectangleF ButtonCircleBounds = new RectangleF((float)0, (float)0, (float)15.1, (float)15.1); + Rectangle buttonBounds = new Rectangle(0, 0, 16, 16); + RectangleF buttonCircleBounds = new RectangleF(0, 0, (float)15.1, (float)15.1); //Smoothing Mode e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; @@ -217,66 +217,66 @@ protected override void OnPaint(PaintEventArgs e) { //Get the renderer associated with this palette - IRenderer Renderer = _palette.GetRenderer(); + IRenderer renderer = _palette.GetRenderer(); //Create the rendering context that is passed into all renderer calls - using (RenderContext RenderContext = new RenderContext(this, e.Graphics, ButtonBounds, Renderer)) + using (RenderContext renderContext = new RenderContext(this, e.Graphics, buttonBounds, renderer)) { // Set the style we want picked up from the base palette - m_paletteBack.Style = PaletteBackStyle.HeaderPrimary; + _mPaletteBack.Style = PaletteBackStyle.HeaderPrimary; //Fill The Space - using (GraphicsPath Path = GetButtonPath(ButtonBounds)) + using (GraphicsPath path = GetButtonPath(buttonBounds)) { // Ask renderer to draw the background - m_mementoBack1 = Renderer.RenderStandardBack.DrawBack(RenderContext, ButtonBounds, Path, m_paletteBack, m_orientation, (Enabled ? PaletteState.Normal : PaletteState.Disabled), m_mementoBack1); + _mMementoBack1 = renderer.RenderStandardBack.DrawBack(renderContext, buttonBounds, path, _mPaletteBack, _mOrientation, Enabled ? PaletteState.Normal : PaletteState.Disabled, _mMementoBack1); } // We want the inner part of the control to act like a button, so // we need to find the correct palette state based on if the mouse // is over the control if the mouse button is pressed down or not. - PaletteState ButtonState = GetButtonState(); + PaletteState buttonState = GetButtonState(); // Set the style of button we want to draw - m_paletteBack.Style = m_visuallook; - m_paletteBorder.Style = (PaletteBorderStyle)m_visuallook; - m_paletteContent.Style = (PaletteContentStyle)m_visuallook; + _mPaletteBack.Style = _mVisuallook; + _mPaletteBorder.Style = (PaletteBorderStyle)_mVisuallook; + _mPaletteContent.Style = (PaletteContentStyle)_mVisuallook; // Do we need to draw the background? - if (m_paletteBack.GetBackDraw(ButtonState) == InheritBool.True) + if (_mPaletteBack.GetBackDraw(buttonState) == InheritBool.True) { - using (GraphicsPath Path = GetRoundedSquarePath(ButtonCircleBounds)) + using (GraphicsPath path = GetRoundedSquarePath(buttonCircleBounds)) { // Ask renderer to draw the background - m_mementoBack2 = Renderer.RenderStandardBack.DrawBack(RenderContext, ButtonBounds, Path, m_paletteBack, m_orientation, ButtonState, m_mementoBack2); + _mMementoBack2 = renderer.RenderStandardBack.DrawBack(renderContext, buttonBounds, path, _mPaletteBack, _mOrientation, buttonState, _mMementoBack2); } } // Do we need to draw the border? - if (m_paletteBorder.GetBorderDraw(ButtonState) == InheritBool.True) + if (_mPaletteBorder.GetBorderDraw(buttonState) == InheritBool.True) { // Now we draw the border of the inner area, also in ButtonStandalone style - e.Graphics.DrawEllipse(new Pen(m_paletteBorder.GetBorderColor2(ButtonState)), ButtonCircleBounds); + e.Graphics.DrawEllipse(new Pen(_mPaletteBorder.GetBorderColor2(buttonState)), buttonCircleBounds); } e.Graphics.SmoothingMode = SmoothingMode.None; //Draw Magnifying Sign - switch (m_buttonstyle) + switch (_mButtonstyle) { case ButtonStyles.MinusButton: - Rectangle MinusOuterBounds = new Rectangle(3, (Height / 2) - 2, 10, 4); - Rectangle MinusInnerBounds = new Rectangle(4, (Height / 2) - 1, 8, 2); + Rectangle minusOuterBounds = new Rectangle(3, Height / 2 - 2, 10, 4); + Rectangle minusInnerBounds = new Rectangle(4, Height / 2 - 1, 8, 2); - e.Graphics.FillRectangle(new SolidBrush(m_outerColor), MinusOuterBounds); - e.Graphics.FillRectangle(new SolidBrush(m_innerColor), MinusInnerBounds); + e.Graphics.FillRectangle(new SolidBrush(_mOuterColor), minusOuterBounds); + e.Graphics.FillRectangle(new SolidBrush(_mInnerColor), minusInnerBounds); break; case ButtonStyles.PlusButton: - DrawPlusOuter(e.Graphics, m_outerColor); - DrawPlusInner(e.Graphics, m_innerColor); + DrawPlusOuter(e.Graphics, _mOuterColor); + DrawPlusInner(e.Graphics, _mInnerColor); break; } @@ -298,27 +298,24 @@ protected override void OnLayout(LayoutEventArgs e) PaletteState buttonState = GetButtonState(); // Create a rectangle inset, this is where we will draw a button - Rectangle ButtonBounds = new Rectangle(0, 0, 16, 16); + Rectangle buttonBounds = new Rectangle(0, 0, 16, 16); // 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 (ViewLayoutContext ViewContext = new ViewLayoutContext(this, Renderer)) + using (ViewLayoutContext viewContext = new ViewLayoutContext(this, renderer)) { // Setup the appropriate style for the content - m_paletteContent.Style = (PaletteContentStyle)m_visuallook; + _mPaletteContent.Style = (PaletteContentStyle)_mVisuallook; // Cleaup resources by disposing of old memento instance - if (m_mementoContent != null) - { - m_mementoContent.Dispose(); - } + _mMementoContent?.Dispose(); // Ask the renderer to work out how the Content values will be layed out and // return a memento object that we cache for use when actually performing painting - m_mementoContent = Renderer.RenderStandardContent.LayoutContent(ViewContext, ButtonBounds, m_paletteContent, this, m_orientation, buttonState, false, false); + _mMementoContent = renderer.RenderStandardContent.LayoutContent(viewContext, buttonBounds, _mPaletteContent, this, _mOrientation, buttonState); //m_mementoContent = Renderer.RenderStandardContent.LayoutContent(ViewContext, ButtonBounds, m_paletteContent, this, m_orientation, false, buttonState, false); } @@ -338,38 +335,35 @@ protected override void Dispose(bool disposing) if (_palette != null) { - _palette.PalettePaint -= new EventHandler(OnPalettePaint); + _palette.PalettePaint -= OnPalettePaint; _palette = null; } - KryptonManager.GlobalPaletteChanged -= new EventHandler(OnGlobalPaletteChanged); + KryptonManager.GlobalPaletteChanged -= OnGlobalPaletteChanged; //Dispose Memento Content - if (m_mementoContent != null) + if (_mMementoContent != null) { - m_mementoContent.Dispose(); - m_mementoContent = null; + _mMementoContent.Dispose(); + _mMementoContent = null; } //Dispose Memento BackGround One - if (m_mementoBack1 != null) + if (_mMementoBack1 != null) { - m_mementoBack1.Dispose(); - m_mementoBack1 = null; + _mMementoBack1.Dispose(); + _mMementoBack1 = null; } //Dispose Memento BackGround Two - if (m_mementoBack2 != null) + if (_mMementoBack2 != null) { - m_mementoBack2.Dispose(); - m_mementoBack2 = null; + _mMementoBack2.Dispose(); + _mMementoBack2 = null; } - if (components != null) - { - components.Dispose(); - } + components?.Dispose(); } @@ -385,9 +379,9 @@ private PaletteState GetButtonState() } else { - if (m_down) + if (_mDown) { - if (m_highlight) + if (_mHighlight) { return PaletteState.CheckedPressed; } @@ -398,7 +392,7 @@ private PaletteState GetButtonState() } else { - if (m_highlight) + if (_mHighlight) { return PaletteState.Tracking; } @@ -416,49 +410,49 @@ public GraphicsPath GetRoundedSquarePath(RectangleF bounds) path.CloseFigure(); return path; } - private GraphicsPath GetButtonPath(RectangleF Bounds) + private GraphicsPath GetButtonPath(RectangleF bounds) { - GraphicsPath Path = new GraphicsPath(); - Path.AddEllipse(Bounds); - return Path; + GraphicsPath path = new GraphicsPath(); + path.AddEllipse(bounds); + return path; } - private void DrawPlusOuter(Graphics Gfx, Color Fill) + private void DrawPlusOuter(Graphics gfx, Color fill) { - Gfx.FillRectangle(new SolidBrush(Fill), new Rectangle(3, (Height / 2) - 2, 10, 4)); - Gfx.FillRectangle(new SolidBrush(Fill), new Rectangle((Width / 2) - 2, 3, 4, 10)); + gfx.FillRectangle(new SolidBrush(fill), new Rectangle(3, Height / 2 - 2, 10, 4)); + gfx.FillRectangle(new SolidBrush(fill), new Rectangle(Width / 2 - 2, 3, 4, 10)); } - private void DrawPlusInner(Graphics Gfx, Color Fill) + private void DrawPlusInner(Graphics gfx, Color fill) { - Gfx.FillRectangle(new SolidBrush(Fill), new Rectangle(4, (Height / 2) - 1, 8, 2)); - Gfx.FillRectangle(new SolidBrush(Fill), new Rectangle((Width / 2) - 1, 4, 2, 8)); + gfx.FillRectangle(new SolidBrush(fill), new Rectangle(4, Height / 2 - 1, 8, 2)); + gfx.FillRectangle(new SolidBrush(fill), new Rectangle(Width / 2 - 1, 4, 2, 8)); } //Key Mouse Events private void KryptonSliderButton_MouseDown(object sender, MouseEventArgs e) { - m_down = true; + _mDown = true; //Single click? - if (!m_singleClick) + if (!_mSingleClick) { FireTimer.Start(); } Invalidate(); } private void KryptonSliderButton_MouseEnter(object sender, EventArgs e) { - m_highlight = true; + _mHighlight = true; Invalidate(); } private void KryptonSliderButton_MouseLeave(object sender, EventArgs e) { - m_highlight = false; + _mHighlight = false; Invalidate(); } private void KryptonSliderButton_MouseUp(object sender, MouseEventArgs e) { - m_down = false; + _mDown = false; //Single click? - if (!m_singleClick) + if (!_mSingleClick) { FireTimer.Stop(); } else { SliderButtonFire(this, new EventArgs()); } @@ -501,10 +495,7 @@ private void k_palette_PalettePaint(object sender, PaletteLayoutEventArgs e) //Fire Machine Gun private void FireTimer_Tick(object sender, EventArgs e) { - if (SliderButtonFire != null) - { - SliderButtonFire(this, new EventArgs()); - } + SliderButtonFire?.Invoke(this, new EventArgs()); } @@ -516,15 +507,15 @@ private void OnPalettePaint(object sender, PaletteLayoutEventArgs e) private void OnGlobalPaletteChanged(object sender, EventArgs e) { - if (((_palette != null))) + if (_palette != null) { - _palette.PalettePaint -= new EventHandler(OnPalettePaint); + _palette.PalettePaint -= OnPalettePaint; } _palette = KryptonManager.CurrentGlobalPalette; _paletteRedirect.Target = _palette; - if (((_palette != null))) + if (_palette != null) { - _palette.PalettePaint += new EventHandler(OnPalettePaint); + _palette.PalettePaint += OnPalettePaint; InitColors(); } Invalidate(); @@ -534,16 +525,16 @@ private void OnGlobalPaletteChanged(object sender, EventArgs e) private void InitColors() { //Colors - m_innerColor = _palette.ColorTable.GripDark; + _mInnerColor = _palette.ColorTable.GripDark; // Ignore this color if the palette uses an Office2010-Renderer if (_palette.GetRenderer() is RenderOffice2010 or RenderOffice2013 or RenderMicrosoft365) { - m_outerColor = Color.Transparent; + _mOuterColor = Color.Transparent; } else { - m_outerColor = _palette.ColorTable.GripLight; + _mOuterColor = _palette.ColorTable.GripLight; } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonToolbarSlider.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonToolbarSlider.cs index 95f4f229d..32e2ae665 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonToolbarSlider.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonToolbarSlider.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -125,10 +125,10 @@ public KryptonToolbarSlider() // add Palette Handler if (_palette != null) { - _palette.PalettePaint += new EventHandler(OnPalettePaint); + _palette.PalettePaint += OnPalettePaint; } - KryptonManager.GlobalPaletteChanged += new EventHandler(OnGlobalPaletteChanged); + KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged; _palette = KryptonManager.CurrentGlobalPalette; _paletteRedirect = new PaletteRedirect(_palette); @@ -226,20 +226,17 @@ protected override void Dispose(bool disposing) m_mementoBack2 = null; } - if (components != null) - { - components.Dispose(); - } + components?.Dispose(); if (_palette != null) { - _palette.PalettePaint -= new EventHandler(OnPalettePaint); + _palette.PalettePaint -= OnPalettePaint; _palette = null; } - KryptonManager.GlobalPaletteChanged -= new EventHandler(OnGlobalPaletteChanged); + KryptonManager.GlobalPaletteChanged -= OnGlobalPaletteChanged; } @@ -273,14 +270,11 @@ protected override void OnLayout(LayoutEventArgs e) m_paletteContent.Style = PaletteContentStyle.ButtonStandalone; // Cleaup resources by disposing of old memento instance - if (m_mementoContent != null) - { - m_mementoContent.Dispose(); - } + m_mementoContent?.Dispose(); // Ask the renderer to work out how the Content values will be layed out and // return a memento object that we cache for use when actually performing painting - m_mementoContent = Renderer.RenderStandardContent.LayoutContent(ViewContext, ButtonBounds, m_paletteContent, this, VisualOrientation.Top, buttonState, false, glowing); + m_mementoContent = Renderer.RenderStandardContent.LayoutContent(ViewContext, ButtonBounds, m_paletteContent, this, VisualOrientation.Top, buttonState); } } @@ -338,7 +332,7 @@ private void DrawSlider(Graphics Gfx) m_paletteBack.Style = PaletteBackStyle.HeaderPrimary; // Ask renderer to draw the background - m_mementoBack1 = Renderer.RenderStandardBack.DrawBack(RenderContext, SliderBounds, Path, m_paletteBack, VisualOrientation.Top, (Enabled ? PaletteState.Normal : PaletteState.Disabled), m_mementoBack1); + m_mementoBack1 = Renderer.RenderStandardBack.DrawBack(RenderContext, SliderBounds, Path, m_paletteBack, VisualOrientation.Top, Enabled ? PaletteState.Normal : PaletteState.Disabled, m_mementoBack1); } @@ -363,7 +357,7 @@ private void DrawSlider(Graphics Gfx) // Ask renderer to draw the background m_mementoBack2 = Renderer.RenderStandardBack.DrawBack(RenderContext, SliderBounds, Path, m_paletteBack, VisualOrientation.Top, ButtonState, m_mementoBack2); Gfx.DrawPath(new Pen(m_paletteBorder.GetBorderColor2(ButtonState)), Path); - Gfx.DrawLine(new Pen(m_paletteBorder.GetBorderColor2(ButtonState)), (int)SliderBounds.X + (SliderBounds.Width / 2) + 1, SliderBounds.Y + 4, (int)SliderBounds.X + (SliderBounds.Width / 2) + 1, SliderBounds.Y + 8); + Gfx.DrawLine(new Pen(m_paletteBorder.GetBorderColor2(ButtonState)), (int)SliderBounds.X + SliderBounds.Width / 2 + 1, SliderBounds.Y + 4, (int)SliderBounds.X + SliderBounds.Width / 2 + 1, SliderBounds.Y + 8); } @@ -384,10 +378,10 @@ private Point GetPointFromValue(int Value) { if (Value == 0) { - return new Point((int)Math.Round((double)(((double)Width) / 2.0)), (int)Math.Round((double)((((double)Height) / 2.0) - 6.5))); + return new Point((int)Math.Round((double)((double)Width / 2.0)), (int)Math.Round((double)((double)Height / 2.0 - 6.5))); } - Point Result = new Point((int)Math.Round((double)((((double)Width) / 2.0) + (((((double)Width) / 2.0) - 20.0) * (((double)Value) / (((double)m_range) / 2.0))))), (int)Math.Round((double)((((double)Height) / 2.0) - 6.5))); - if (Result.X > (Width - 0x16)) + Point Result = new Point((int)Math.Round((double)((double)Width / 2.0 + ((double)Width / 2.0 - 20.0) * ((double)Value / ((double)m_range / 2.0)))), (int)Math.Round((double)((double)Height / 2.0 - 6.5))); + if (Result.X > Width - 0x16) { Result.X = Width - 0x16; } @@ -400,14 +394,14 @@ private Point GetPointFromValue(int Value) } private int GetValueFromPoint(Point Value) { - int Result = (int)Math.Round((double)((((Value.X - (((double)Width) / 2.0)) / ((((double)Width) / 2.0) - 20.0)) * m_range) / 2.0)); - if (Result > (((double)m_range) / 2.0)) + int Result = (int)Math.Round((double)((Value.X - (double)Width / 2.0) / ((double)Width / 2.0 - 20.0) * m_range / 2.0)); + if (Result > (double)m_range / 2.0) { - Result = (int)Math.Round((double)(((double)m_range) / 2.0)); + Result = (int)Math.Round((double)((double)m_range / 2.0)); } - if (Result < ((((double)m_range) / 2.0) * -1.0)) + if (Result < (double)m_range / 2.0 * -1.0) { - Result = (int)Math.Round((double)((((double)m_range) / 2.0) * -1.0)); + Result = (int)Math.Round((double)((double)m_range / 2.0 * -1.0)); } return Result; @@ -430,7 +424,7 @@ private Rectangle GetSliderBounds(Point Location) } private Point GetSliderPosition() { - return new Point((int)Math.Round((double)(GetPointFromValue(m_value).X - 4.5)), (int)Math.Round((double)((((double)Height) / 2.0) - 6.5))); + return new Point((int)Math.Round((double)(GetPointFromValue(m_value).X - 4.5)), (int)Math.Round((double)((double)Height / 2.0 - 6.5))); } private PaletteState GetSliderState() @@ -467,13 +461,13 @@ private PaletteState GetSliderState() } private RangeTests GetSliderRangeTest(Point Location) { - if ((Location.X > 20) & (Location.X < (Width - 20))) + if ((Location.X > 20) & (Location.X < Width - 20)) { - if ((Location.X >= ((((double)Width) / 2.0) - 5.0)) & (Location.X <= ((((double)Width) / 2.0) + 5.0))) + if ((Location.X >= (double)Width / 2.0 - 5.0) & (Location.X <= (double)Width / 2.0 + 5.0)) { return RangeTests.MiddleDomain; } - if (Location.X < (((double)Width) / 2.0)) + if (Location.X < (double)Width / 2.0) { return RangeTests.LeftDomain; } @@ -483,7 +477,7 @@ private RangeTests GetSliderRangeTest(Point Location) { return RangeTests.MinusDomain; } - if (Location.X >= (Width - 20)) + if (Location.X >= Width - 20) { return RangeTests.PlusDomain; } @@ -496,23 +490,20 @@ private void ChangeValue(int NewValue) { if (Enabled) { - if (ValueChanged != null) - { - ValueChanged(this, new SliderEventArgs(NewValue, m_value, m_range, m_step)); - } + ValueChanged?.Invoke(this, new SliderEventArgs(NewValue, m_value, m_range, m_step)); m_value = NewValue; } } private void SliderIncrement() { - if ((m_value + m_step) <= (m_range / 2)) + if (m_value + m_step <= m_range / 2) { ChangeValue(m_value + m_step); } } private void SliderDecrement() { - if ((m_value - m_step) >= ((m_range / 2) * -1)) + if (m_value - m_step >= m_range / 2 * -1) { ChangeValue(m_value - m_step); } @@ -791,7 +782,7 @@ private void OnGlobalPaletteChanged(object sender, EventArgs e) { if (_palette != null) { - _palette.PalettePaint -= new EventHandler(OnPalettePaint); + _palette.PalettePaint -= OnPalettePaint; } _palette = KryptonManager.CurrentGlobalPalette; @@ -799,7 +790,7 @@ private void OnGlobalPaletteChanged(object sender, EventArgs e) if (_palette != null) { - _palette.PalettePaint += new EventHandler(OnPalettePaint); + _palette.PalettePaint += OnPalettePaint; //repaint with new values //set colors diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Enumerations/BlinkState.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Enumerations/BlinkState.cs index e55a27a0b..6d9b18273 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Enumerations/BlinkState.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Enumerations/BlinkState.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Enumerations/CheckMarkDisplayStyle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Enumerations/CheckMarkDisplayStyle.cs index 9f84a9c6c..38ad50dc2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Enumerations/CheckMarkDisplayStyle.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Enumerations/CheckMarkDisplayStyle.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Enumerations/MarqueeScrollDirection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Enumerations/MarqueeScrollDirection.cs index 8d32e5202..36c2a46be 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Enumerations/MarqueeScrollDirection.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Enumerations/MarqueeScrollDirection.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Events/ExecuteProcessAsAdministratorEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Events/ExecuteProcessAsAdministratorEventArgs.cs index 5b9d05463..962d60558 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Events/ExecuteProcessAsAdministratorEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Events/ExecuteProcessAsAdministratorEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -70,7 +70,7 @@ private void ElevateProcessWithAdministrativeRights(string processName) } catch (Win32Exception e) { - ExceptionCapture.CaptureException(e); + DebugUtilities.NotImplemented(e.ToString()); } return; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Globals/GlobalDeclarations.cs index dad53b564..d159b4047 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -40,7 +40,7 @@ global using System.Windows.Forms.Design; global using System.Windows.Forms.VisualStyles; -global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; +global using Krypton.Toolkit.Suite.Extended.Debug.Tools; global using Krypton.Toolkit.Suite.Extended.Global.Utilities; global using Krypton.Toolkit.Suite.Extended.Tool.Strip.Items.Resources; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items 2022.csproj index f47d80d14..1cf136fad 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - + - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements additional tool strip items. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements additional tool strip items. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -87,7 +75,7 @@ - + @@ -97,7 +85,7 @@ - + @@ -107,7 +95,7 @@ - + @@ -117,7 +105,7 @@ - + @@ -148,12 +136,13 @@ - + + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tools/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tools/Globals/GlobalDeclarations.cs index 15c288950..012e9f9f2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tools/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tools/Globals/GlobalDeclarations.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tools/Krypton.Toolkit.Suite.Extended.Tools 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tools/Krypton.Toolkit.Suite.Extended.Tools 2022.csproj index 676aeb1c4..7a6f82246 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tools/Krypton.Toolkit.Suite.Extended.Tools 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tools/Krypton.Toolkit.Suite.Extended.Tools 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -37,6 +25,7 @@ true Debug;Release;Nightly;Canary true + preview @@ -67,9 +56,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements global tools used by the extended toolkit. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements global tools used by the extended toolkit. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -77,74 +66,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tools/Krypton.Toolkit.Suite.Extended.Tools.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tools/Krypton.Toolkit.Suite.Extended.Tools.licenseheader index c890e86c0..a0e5e0a62 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tools/Krypton.Toolkit.Suite.Extended.Tools.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tools/Krypton.Toolkit.Suite.Extended.Tools.licenseheader @@ -4,7 +4,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Components/KryptonTreeGridCell.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Components/KryptonTreeGridCell.cs index da0e363db..649786b5f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Components/KryptonTreeGridCell.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Components/KryptonTreeGridCell.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -122,19 +122,19 @@ inside which are not working well and cause huuuuge overhead. var oStyle = Style.Clone(); if (preferredSize.Height < _imageHeight) { - oStyle.Padding = new Padding(p.Left + (level * INDENT_WIDTH) + _imageWidth + INDENT_MARGIN, - p.Top + (_imageHeight / 2), p.Right, p.Bottom + (_imageHeight / 2)); + oStyle.Padding = new Padding(p.Left + level * INDENT_WIDTH + _imageWidth + INDENT_MARGIN, + p.Top + _imageHeight / 2, p.Right, p.Bottom + _imageHeight / 2); _imageHeightOffset = 2;// (_imageHeight - preferredSize.Height) / 2; } else { - oStyle.Padding = new Padding(p.Left + (level * INDENT_WIDTH) + _imageWidth + INDENT_MARGIN, + oStyle.Padding = new Padding(p.Left + level * INDENT_WIDTH + _imageWidth + INDENT_MARGIN, p.Top, p.Right, p.Bottom); } Style = oStyle; - _calculatedLeftPadding = ((level - 1) * _glyphWidth) + _imageWidth + INDENT_MARGIN; + _calculatedLeftPadding = (level - 1) * _glyphWidth + _imageWidth + INDENT_MARGIN; } public int Level @@ -146,9 +146,9 @@ public int Level } } - protected virtual int GlyphMargin => ((Level - 1) * INDENT_WIDTH) + INDENT_MARGIN; + protected virtual int GlyphMargin => (Level - 1) * INDENT_WIDTH + INDENT_MARGIN; - protected virtual int GlyphOffset => ((Level - 1) * INDENT_WIDTH); + protected virtual int GlyphOffset => (Level - 1) * INDENT_WIDTH; 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) { @@ -180,7 +180,7 @@ protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle { Point pp = _imageHeight > cellBounds.Height ? new Point(glyphRect.X + _glyphWidth, cellBounds.Y + _imageHeightOffset) - : new Point(glyphRect.X + _glyphWidth, (cellBounds.Height / 2 - _imageHeight / 2) + cellBounds.Y); + : new Point(glyphRect.X + _glyphWidth, cellBounds.Height / 2 - _imageHeight / 2 + cellBounds.Y); // Graphics container to push/pop changes. This enables us to set clipping when painting // the cell's image -- keeps it from bleeding outsize of cells. @@ -243,7 +243,7 @@ protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle // paint lines of previous levels to the root KryptonTreeGridNodeRow? previousNode = node.Parent; - var horizontalStop = (glyphRect.X + 4) - INDENT_WIDTH; + var horizontalStop = glyphRect.X + 4 - INDENT_WIDTH; while (!previousNode.IsRoot) { @@ -265,11 +265,11 @@ protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle // Paint node glyphs if (node.IsExpanded) { - node.Grid.ROpen.DrawBackground(graphics, new Rectangle(glyphRect.X, glyphRect.Y + (glyphRect.Height / 2) - 4, 10, 10)); + node.Grid.ROpen.DrawBackground(graphics, new Rectangle(glyphRect.X, glyphRect.Y + glyphRect.Height / 2 - 4, 10, 10)); } else { - node.Grid.RClosed.DrawBackground(graphics, new Rectangle(glyphRect.X, glyphRect.Y + (glyphRect.Height / 2) - 4, 10, 10)); + node.Grid.RClosed.DrawBackground(graphics, new Rectangle(glyphRect.X, glyphRect.Y + glyphRect.Height / 2 - 4, 10, 10)); } } catch diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Components/KryptonTreeGridColumn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Components/KryptonTreeGridColumn.cs index 8bb0609af..52049f24a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Components/KryptonTreeGridColumn.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Components/KryptonTreeGridColumn.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/CollapsedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/CollapsedEventArgs.cs index 28ea7f692..0fa30b627 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/CollapsedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/CollapsedEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/CollapsedEventHandler.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/CollapsedEventHandler.cs index 69bd06d17..580ace086 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/CollapsedEventHandler.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/CollapsedEventHandler.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/CollapsingEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/CollapsingEventArgs.cs index 914c29b8e..6181c1e91 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/CollapsingEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/CollapsingEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/CollapsingEventHandler.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/CollapsingEventHandler.cs index 2159d8044..75e8553a0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/CollapsingEventHandler.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/CollapsingEventHandler.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/ExpandedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/ExpandedEventArgs.cs index f560f2653..b5195bb1c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/ExpandedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/ExpandedEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/ExpandedEventHandler.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/ExpandedEventHandler.cs index 55e0f50a6..0a848205f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/ExpandedEventHandler.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/ExpandedEventHandler.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/ExpandingEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/ExpandingEventArgs.cs index a58fa47f6..8962851d7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/ExpandingEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/ExpandingEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/ExpandingEventHandler.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/ExpandingEventHandler.cs index 9fa9c3792..8c4163faa 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/ExpandingEventHandler.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/ExpandingEventHandler.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/TreeGridNodeEventBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/TreeGridNodeEventBase.cs index 43c09b29e..43e4ce657 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/TreeGridNodeEventBase.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Events/TreeGridNodeEventBase.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Globals/GlobalDeclarations.cs index 6b62500b1..815ed546d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Krypton.Toolkit.Suite.Extended.TreeGridView 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Krypton.Toolkit.Suite.Extended.TreeGridView 2022.csproj index e61d65c63..8e68cba73 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Krypton.Toolkit.Suite.Extended.TreeGridView 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Krypton.Toolkit.Suite.Extended.TreeGridView 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - + - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -74,9 +62,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements items to create tree grid views for your applications. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements items to create tree grid views for your applications. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -90,7 +78,7 @@ - + @@ -100,7 +88,7 @@ - + @@ -110,7 +98,7 @@ - + @@ -120,7 +108,7 @@ - + @@ -151,7 +139,7 @@ - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Krypton.Toolkit.Suite.Extended.TreeGridView.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Krypton.Toolkit.Suite.Extended.TreeGridView.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Krypton.Toolkit.Suite.Extended.TreeGridView.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Krypton.Toolkit.Suite.Extended.TreeGridView.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/KryptonTreeGridNodeRow.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/KryptonTreeGridNodeRow.cs index 1c02c7724..c29ea84f1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/KryptonTreeGridNodeRow.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/KryptonTreeGridNodeRow.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -175,7 +175,7 @@ public bool Checked private bool ShouldSerializeImageIndex() { - return (_imageIndex != -1 && _image == null); + return _imageIndex != -1 && _image == null; } [Category("Appearance"), @@ -205,7 +205,7 @@ public int ImageIndex } } - private bool ShouldSerializeImage() => (_imageIndex == -1 && _image != null); + private bool ShouldSerializeImage() => _imageIndex == -1 && _image != null; public Image? Image { @@ -356,13 +356,13 @@ public int Level [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public virtual bool HasChildren => (_childrenNodes != null && Nodes.Count != 0); + public virtual bool HasChildren => _childrenNodes != null && Nodes.Count != 0; [Browsable(false)] public bool IsSited => _isSited; [Browsable(false)] - public bool IsFirstSibling => (Index == 0); + public bool IsFirstSibling => Index == 0; [Browsable(false)] public bool IsLastSibling diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/KryptonTreeGridView.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/KryptonTreeGridView.cs index 576e5db20..0db2a3856 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/KryptonTreeGridView.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/KryptonTreeGridView.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/TreeGridNodeCollection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/TreeGridNodeCollection.cs index c240339c3..ee9a6c190 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/TreeGridNodeCollection.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/TreeGridNodeCollection.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Audio Format/AudioBitsPerSample.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Audio Format/AudioBitsPerSample.cs index b11e123c0..31348ea7b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Audio Format/AudioBitsPerSample.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Audio Format/AudioBitsPerSample.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Audio Format/AudioChannel.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Audio Format/AudioChannel.cs index dc05a6e14..8cf3d9e1d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Audio Format/AudioChannel.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Audio Format/AudioChannel.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Audio Format/EncodingFormat.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Audio Format/EncodingFormat.cs index a5340e1ea..d7cfd2033 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Audio Format/EncodingFormat.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Audio Format/EncodingFormat.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Audio Format/SpeechAudioFormatInfo.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Audio Format/SpeechAudioFormatInfo.cs index 784935738..657ce80e7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Audio Format/SpeechAudioFormatInfo.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Audio Format/SpeechAudioFormatInfo.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/BuilderElements.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/BuilderElements.cs index a43be2eb2..ee6d4559f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/BuilderElements.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/BuilderElements.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderBase.cs index 3d912dc7e..fad8090ab 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderBase.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderBase.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderDictation.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderDictation.cs index 82baaa3a6..7819c26ac 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderDictation.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderDictation.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -36,7 +36,7 @@ internal override string DebugSummary { get { - string str = (_category != null) ? (":" + _category) : string.Empty; + string str = _category != null ? ":" + _category : string.Empty; return $"dictation{str}"; } } @@ -82,7 +82,7 @@ internal override IElement CreateElement(IElementFactory elementFactory, IElemen private IRuleRef CreateRuleRefToDictation(IElementFactory elementFactory, IElement parent) { - Uri srgsUri = (string.IsNullOrEmpty(_category) || !(_category == "spelling")) ? new Uri("grammar:dictation", UriKind.RelativeOrAbsolute) : new Uri("grammar:dictation#spelling", UriKind.RelativeOrAbsolute); + Uri srgsUri = string.IsNullOrEmpty(_category) || !(_category == "spelling") ? new Uri("grammar:dictation", UriKind.RelativeOrAbsolute) : new Uri("grammar:dictation#spelling", UriKind.RelativeOrAbsolute); return elementFactory.CreateRuleRef(parent, srgsUri, null, null); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderPhrase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderPhrase.cs index aa6b90c0b..019a81ecd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderPhrase.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderPhrase.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderRuleRef.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderRuleRef.cs index 647df18da..354f59970 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderRuleRef.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderRuleRef.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -36,7 +36,7 @@ internal sealed class GrammarBuilderRuleRef : GrammarBuilderBase internal GrammarBuilderRuleRef(Uri uri, string rule) { - _uri = uri.OriginalString + ((rule != null) ? ("#" + rule) : ""); + _uri = uri.OriginalString + (rule != null ? "#" + rule : ""); } private GrammarBuilderRuleRef(string sgrsUri) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderWildcard.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderWildcard.cs index a526f76b5..7769b2564 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderWildcard.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/GrammarBuilderWildcard.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/IdentifierCollection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/IdentifierCollection.cs index 2cd12fb73..8b35dd0bf 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/IdentifierCollection.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/IdentifierCollection.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/ItemElement.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/ItemElement.cs index 9b35d8799..f920d4c63 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/ItemElement.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/ItemElement.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/OneOfElement.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/OneOfElement.cs index 6ec25d339..588af5f98 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/OneOfElement.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/OneOfElement.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/RuleElement.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/RuleElement.cs index 6b57cee0f..e886ee92a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/RuleElement.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/RuleElement.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/RuleRefElement.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/RuleRefElement.cs index 78a75f068..7936d3c98 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/RuleRefElement.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/RuleRefElement.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -37,7 +37,7 @@ internal sealed class RuleRefElement : GrammarBuilderBase internal RuleElement Rule => _rule; - internal override string DebugSummary => $"#{Rule.Name}{((_semanticKey != null) ? (":" + _semanticKey) : "")}"; + internal override string DebugSummary => $"#{Rule.Name}{(_semanticKey != null ? ":" + _semanticKey : "")}"; internal RuleRefElement(RuleElement rule) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/SemanticKeyElement.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/SemanticKeyElement.cs index 1f03d8bce..338d9dfaf 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/SemanticKeyElement.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/SemanticKeyElement.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/TagElement.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/TagElement.cs index f0293d1ea..3a4dad51c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/TagElement.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Grammar Building/TagElement.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/IO/FileHelper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/IO/FileHelper.cs index 417d97d9c..54afdc313 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/IO/FileHelper.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/IO/FileHelper.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -73,7 +73,7 @@ internal static FileStream CreateAndOpenTemporaryFile(out string filePath, FileA fileStream = new FileStream(text3, FileMode.CreateNew, fileAccess, FileShare.None, 4096, fileOptions); filePath = text3; } - catch (Exception ex) when (num > 0 && (ex is IOException || ex is UnauthorizedAccessException)) + catch (Exception ex) when (num > 0 && ex is IOException or UnauthorizedAccessException) { } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AlphabetConverter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AlphabetConverter.cs index 309b93e72..e8bf3518b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AlphabetConverter.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AlphabetConverter.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -58,7 +58,7 @@ internal PhoneMapData(Stream input) convertTable[i] = new ConversionUnit(); convertTable[i].sapi = ReadPhoneString(binaryReader); convertTable[i].ups = ReadPhoneString(binaryReader); - convertTable[i].isDefault = ((binaryReader.ReadInt32() != 0) ? true : false); + convertTable[i].isDefault = binaryReader.ReadInt32() != 0 ? true : false; } prefixSapiTable = InitializePrefix(true); prefixUpsTable = InitializePrefix(false); @@ -76,7 +76,7 @@ internal bool IsPrefix(string prefix, bool isSapi) internal string ConvertPhoneme(string phoneme, bool isSapi) { - ConversionUnit conversionUnit = (!isSapi) ? ((ConversionUnit)prefixUpsTable[phoneme]) : ((ConversionUnit)prefixSapiTable[phoneme]); + ConversionUnit conversionUnit = !isSapi ? (ConversionUnit)prefixUpsTable[phoneme] : (ConversionUnit)prefixSapiTable[phoneme]; if (conversionUnit == null) { return null; @@ -93,7 +93,7 @@ private Hashtable InitializePrefix(bool isSapi) Hashtable hashtable = Hashtable.Synchronized(new Hashtable()); for (int i = 0; i < convertTable.Length; i++) { - string text = (!isSapi) ? convertTable[i].ups : convertTable[i].sapi; + string text = !isSapi ? convertTable[i].ups : convertTable[i].sapi; for (int j = 0; j + 1 < text.Length; j++) { string key = text.Substring(0, j + 1); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AlphabetType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AlphabetType.cs index e72f389de..0b00ae6be 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AlphabetType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AlphabetType.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AsyncSerializedWorker.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AsyncSerializedWorker.cs index eee5c7ed1..aabad2a59 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AsyncSerializedWorker.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AsyncSerializedWorker.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AsyncWorkItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AsyncWorkItem.cs index 92e672c12..e99382f9d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AsyncWorkItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AsyncWorkItem.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AudioFormatConverter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AudioFormatConverter.cs index f109d8b81..0b7e74caa 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AudioFormatConverter.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/AudioFormatConverter.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -178,7 +178,7 @@ private static SpeechAudioFormatInfo ConvertFormat(StreamFormat eFormat) 48000u }; waveFormatEx.wFormatTag = 1; - waveFormatEx.nChannels = (waveFormatEx.nBlockAlign = (ushort)((!flag) ? 1 : 2)); + waveFormatEx.nChannels = waveFormatEx.nBlockAlign = (ushort)(!flag ? 1 : 2); waveFormatEx.nSamplesPerSec = array2[num2]; waveFormatEx.wBitsPerSample = 8; if (flag2) @@ -224,7 +224,7 @@ private static SpeechAudioFormatInfo ConvertFormat(StreamFormat eFormat) }; bool flag5 = (num8 & 1) != 0; waveFormatEx.wFormatTag = 6; - waveFormatEx.nChannels = (waveFormatEx.nBlockAlign = (ushort)((!flag5) ? 1 : 2)); + waveFormatEx.nChannels = waveFormatEx.nBlockAlign = (ushort)(!flag5 ? 1 : 2); waveFormatEx.nSamplesPerSec = array13[num9]; waveFormatEx.wBitsPerSample = 8; waveFormatEx.nAvgBytesPerSec = waveFormatEx.nSamplesPerSec * waveFormatEx.nBlockAlign; @@ -244,7 +244,7 @@ private static SpeechAudioFormatInfo ConvertFormat(StreamFormat eFormat) }; bool flag3 = (num3 & 1) != 0; waveFormatEx.wFormatTag = 7; - waveFormatEx.nChannels = (waveFormatEx.nBlockAlign = (ushort)((!flag3) ? 1 : 2)); + waveFormatEx.nChannels = waveFormatEx.nBlockAlign = (ushort)(!flag3 ? 1 : 2); waveFormatEx.nSamplesPerSec = array3[num4]; waveFormatEx.wBitsPerSample = 8; waveFormatEx.nAvgBytesPerSec = waveFormatEx.nSamplesPerSec * waveFormatEx.nBlockAlign; @@ -392,7 +392,7 @@ private static SpeechAudioFormatInfo ConvertFormat(StreamFormat eFormat) uint num6 = num5 / 2u; bool flag4 = (num5 & 1) != 0; waveFormatEx.wFormatTag = 2; - waveFormatEx.nChannels = (ushort)((!flag4) ? 1 : 2); + waveFormatEx.nChannels = (ushort)(!flag4 ? 1 : 2); waveFormatEx.nSamplesPerSec = array4[num6]; waveFormatEx.nAvgBytesPerSec = array5[num5]; waveFormatEx.nBlockAlign = (ushort)(array6[num6] * waveFormatEx.nChannels); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/HGlobalSafeHandle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/HGlobalSafeHandle.cs index b3142391c..9d26bdc70 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/HGlobalSafeHandle.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/HGlobalSafeHandle.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/Helpers.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/Helpers.cs index 92f10b7fc..45e040c53 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/Helpers.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/Helpers.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -79,7 +79,7 @@ internal static bool CompareInvariantCulture(CultureInfo culture1, CultureInfo c internal static void CopyStream(Stream inputStream, Stream outputStream, int bytesToCopy) { - int num = (bytesToCopy > 4096) ? 4096 : bytesToCopy; + int num = bytesToCopy > 4096 ? 4096 : bytesToCopy; byte[] buffer = new byte[num]; while (true) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/IAsyncDispatch.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/IAsyncDispatch.cs index e9d32757d..17c7efc14 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/IAsyncDispatch.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/IAsyncDispatch.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/PhonemeConverter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/PhonemeConverter.cs index 04680f2cc..5b2cc9c87 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/PhonemeConverter.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/PhonemeConverter.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/RedBackList.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/RedBackList.cs index 3d9c422ed..078172b67 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/RedBackList.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/RedBackList.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -59,12 +59,12 @@ public bool MoveNext() { if (!_moved) { - _node = ((_root != null) ? FindMinSubTree(_root) : null); + _node = _root != null ? FindMinSubTree(_root) : null; _moved = true; } else { - _node = ((_node != null) ? FindSuccessor(_node) : null); + _node = _node != null ? FindSuccessor(_node) : null; } return _node != null; } @@ -274,7 +274,7 @@ private static void SetColor(TreeNode node, NodeColor color) { if (node != null) { - node.IsRed = (color == NodeColor.RED); + node.IsRed = color == NodeColor.RED; } } @@ -475,7 +475,7 @@ private void FixInsertCase4(TreeNode node) private static void FixUpRemoval(TreeNode node) { - TreeNode node2 = (node.Left == null) ? node.Right : node.Left; + TreeNode node2 = node.Left == null ? node.Right : node.Left; if (GetColor(node) == NodeColor.BLACK) { if (GetColor(node2) == NodeColor.RED) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/ResourceLoader.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/ResourceLoader.cs index 897f54967..982e1f5e0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/ResourceLoader.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/ResourceLoader.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/SapiAttributeParser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/SapiAttributeParser.cs index 219648183..b9be38f2b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/SapiAttributeParser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/SapiAttributeParser.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/SeekableReadStream.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/SeekableReadStream.cs index d1f72ed6c..087d94e8b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/SeekableReadStream.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/SeekableReadStream.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/StreamMarshaler.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/StreamMarshaler.cs index f8bd78b6f..5c372440a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/StreamMarshaler.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/StreamMarshaler.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/StringBlob.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/StringBlob.cs index 7da44a18e..c5e1219d0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/StringBlob.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Internal/StringBlob.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/ObjectToken.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/ObjectToken.cs index 75229c4af..0cf4560bc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/ObjectToken.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/ObjectToken.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -264,7 +264,7 @@ internal bool MatchesAttributes(string[] sAttributes) bool flag = true; foreach (string valueName in sAttributes) { - flag &= (HasValue(valueName) || (Attributes != null && Attributes.HasValue(valueName))); + flag &= HasValue(valueName) || (Attributes != null && Attributes.HasValue(valueName)); if (!flag) { break; @@ -299,7 +299,7 @@ internal T CreateObjectFromToken(string name) } catch (Exception ex) { - if (ex is MissingMethodException || ex is TypeLoadException || ex is FileLoadException || ex is FileNotFoundException || ex is MethodAccessException || ex is MemberAccessException || ex is TargetInvocationException || ex is InvalidComObjectException || ex is NotSupportedException || ex is FormatException) + if (ex is MissingMethodException or TypeLoadException or FileLoadException or FileNotFoundException or MethodAccessException or MemberAccessException or TargetInvocationException or InvalidComObjectException or NotSupportedException or FormatException) { throw new ArgumentException(SR.Get(SRID.TokenCannotCreateInstance)); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/ObjectTokenCategory.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/ObjectTokenCategory.cs index 0077ed623..6bbc986d0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/ObjectTokenCategory.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/ObjectTokenCategory.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/RegistryDataKey.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/RegistryDataKey.cs index 13deaeee2..f7f01c2da 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/RegistryDataKey.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/RegistryDataKey.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/SAPICategories.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/SAPICategories.cs index 34a73cadf..c4edcac84 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/SAPICategories.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/SAPICategories.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -237,8 +237,8 @@ private static bool ParseVersion(string s, ushort[] Version) { bool flag = true; ushort num; - Version[2] = (num = (Version[3] = 0)); - Version[1] = (num = num); + Version[2] = num = Version[3] = 0; + Version[1] = num = num; Version[0] = num; if (string.IsNullOrEmpty(s)) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/VoiceCategory.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/VoiceCategory.cs index b3688e8ad..9cb140423 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/VoiceCategory.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Object Tokens/VoiceCategory.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioLevelUpdatedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioLevelUpdatedEventArgs.cs index 6f4469449..093ee4859 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioLevelUpdatedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioLevelUpdatedEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioSignalProblem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioSignalProblem.cs index 5353cad52..71b48a331 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioSignalProblem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioSignalProblem.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioSignalProblemOccurredEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioSignalProblemOccurredEventArgs.cs index 4d7461bfd..e129c98b3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioSignalProblemOccurredEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioSignalProblemOccurredEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioState.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioState.cs index 49a38f30d..682d95689 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioState.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioState.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioStateChangedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioStateChangedEventArgs.cs index 3e13ff693..861bcadbb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioStateChangedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/AudioStateChangedEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/Choices.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/Choices.cs index ad06e18ee..543404f3d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/Choices.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/Choices.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/DictationGrammar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/DictationGrammar.cs index 3e3b23084..33b724f38 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/DictationGrammar.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/DictationGrammar.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/DisplayAttributes.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/DisplayAttributes.cs index c315e5b0d..b516bd386 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/DisplayAttributes.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/DisplayAttributes.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/EmulateRecognizeCompletedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/EmulateRecognizeCompletedEventArgs.cs index c60a4230a..756a5a3cc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/EmulateRecognizeCompletedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/EmulateRecognizeCompletedEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/Grammar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/Grammar.cs index 5f5650977..f2701fce1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/Grammar.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/Grammar.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -129,7 +129,7 @@ public int Priority get => _priority; set { - if (value < -128 || value > 127) + if (value is < -128 or > 127) { throw new ArgumentOutOfRangeException("value", SR.Get(SRID.GrammarInvalidPriority)); } @@ -292,7 +292,7 @@ public Grammar(SrgsDocument srgsDocument, string ruleName, Uri baseUri, object[] { Helpers.ThrowIfNull(srgsDocument, "srgsDocument"); _srgsDocument = srgsDocument; - _isSrgsDocument = (srgsDocument != null); + _isSrgsDocument = srgsDocument != null; _baseUri = baseUri; InitialGrammarLoad(ruleName, parameters, false); } @@ -690,7 +690,7 @@ private static string FormatConstructorParameters(ConstructorInfo[] cis) StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < cis.Length; i++) { - stringBuilder.Append((i > 0) ? " or sapi:parms=\"" : "sapi:parms=\""); + stringBuilder.Append(i > 0 ? " or sapi:parms=\"" : "sapi:parms=\""); ParameterInfo[] parameters = cis[i].GetParameters(); for (int j = 0; j < parameters.Length; j++) { @@ -874,8 +874,8 @@ private static string CheckRuleName(Stream stream, string rulename, bool isImpor CfgGrammar.CfgSerializedHeader cfgSerializedHeader = null; CfgGrammar.CfgHeader cfgHeader = CfgGrammar.ConvertCfgHeader(streamHelper, false, true, out cfgSerializedHeader); StringBlob pszSymbols = cfgHeader.pszSymbols; - string text = (cfgHeader.ulRootRuleIndex != uint.MaxValue && cfgHeader.ulRootRuleIndex < cfgHeader.rules.Length) ? pszSymbols.FromOffset(cfgHeader.rules[cfgHeader.ulRootRuleIndex]._nameOffset) : null; - sapi53Only = ((cfgHeader.GrammarOptions & (GrammarOptions.MssV1 | GrammarOptions.IpaPhoneme | GrammarOptions.W3cV1 | GrammarOptions.STG)) != 0); + string text = cfgHeader.ulRootRuleIndex != uint.MaxValue && cfgHeader.ulRootRuleIndex < cfgHeader.rules.Length ? pszSymbols.FromOffset(cfgHeader.rules[cfgHeader.ulRootRuleIndex]._nameOffset) : null; + sapi53Only = (cfgHeader.GrammarOptions & (GrammarOptions.MssV1 | GrammarOptions.IpaPhoneme | GrammarOptions.W3cV1 | GrammarOptions.STG)) != 0; if (text == null && string.IsNullOrEmpty(rulename)) { throw new ArgumentException(SR.Get(SRID.SapiErrorNoRulesToActivate)); @@ -889,7 +889,7 @@ private static string CheckRuleName(Stream stream, string rulename, bool isImpor CfgRule cfgRule = rules[i]; if (pszSymbols.FromOffset(cfgRule._nameOffset) == rulename) { - flag = (cfgRule.Export || stgInit || (!isImportedGrammar && (cfgRule.TopLevel || rulename == text))); + flag = cfgRule.Export || stgInit || (!isImportedGrammar && (cfgRule.TopLevel || rulename == text)); break; } } @@ -902,7 +902,7 @@ private static string CheckRuleName(Stream stream, string rulename, bool isImpor { rulename = text; } - grammarOptions = (cfgHeader.GrammarOptions & GrammarOptions.TagFormat); + grammarOptions = cfgHeader.GrammarOptions & GrammarOptions.TagFormat; } stream.Position = position; return rulename; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/GrammarBuilder.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/GrammarBuilder.cs index f8e32370a..a528141e7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/GrammarBuilder.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/GrammarBuilder.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -207,7 +207,7 @@ public void Append(GrammarBuilder builder) throw new ArgumentException(SR.Get(SRID.ArrayOfNullIllegal), "builder"); } } - List list = (builder == this) ? builder.Clone().InternalBuilder.Items : builder.InternalBuilder.Items; + List list = builder == this ? builder.Clone().InternalBuilder.Items : builder.InternalBuilder.Items; foreach (GrammarBuilderBase item2 in list) { AddItem(item2); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/GrammarState.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/GrammarState.cs index f4e7537d6..8174b9048 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/GrammarState.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/GrammarState.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/IEnumSpObjectTokens.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/IEnumSpObjectTokens.cs index 01798fe78..9dfb26dca 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/IEnumSpObjectTokens.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/IEnumSpObjectTokens.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/IRecognizerInternal.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/IRecognizerInternal.cs index 72f47e9f7..878478900 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/IRecognizerInternal.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/IRecognizerInternal.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/ISpObjectTokenCategory.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/ISpObjectTokenCategory.cs index 4c08845f7..9c70497f0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/ISpObjectTokenCategory.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/ISpObjectTokenCategory.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/InternalGrammarData.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/InternalGrammarData.cs index e421c5fe7..7baa7e242 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/InternalGrammarData.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/InternalGrammarData.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/LoadGrammarCompletedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/LoadGrammarCompletedEventArgs.cs index 8d4870568..131fc8f15 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/LoadGrammarCompletedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/LoadGrammarCompletedEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/OperationLock.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/OperationLock.cs index e0103e4bc..071fce796 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/OperationLock.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/OperationLock.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognitionEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognitionEventArgs.cs index 9bebd5d6c..1e117f68a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognitionEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognitionEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognitionResult.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognitionResult.cs index 5fc87f323..3fb716d52 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognitionResult.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognitionResult.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -83,7 +83,7 @@ public RecognizedAudio Audio Marshal.Copy(source2, array2, 0, sPWAVEFORMATEX.cbSize); } SpeechAudioFormatInfo audioFormat = new SpeechAudioFormatInfo((EncodingFormat)sPWAVEFORMATEX.wFormatTag, (int)sPWAVEFORMATEX.nSamplesPerSec, (short)sPWAVEFORMATEX.wBitsPerSample, (short)sPWAVEFORMATEX.nChannels, (int)sPWAVEFORMATEX.nAvgBytesPerSec, (short)sPWAVEFORMATEX.nBlockAlign, array2); - DateTime startTime = (_header.times.dwTickCount != 0) ? DateTime.FromFileTime((long)(((ulong)_header.times.ftStreamTime.dwHighDateTime << 32) + _header.times.ftStreamTime.dwLowDateTime)) : (_startTime - AudioDuration); + DateTime startTime = _header.times.dwTickCount != 0 ? DateTime.FromFileTime((long)(((ulong)_header.times.ftStreamTime.dwHighDateTime << 32) + _header.times.ftStreamTime.dwLowDateTime)) : _startTime - AudioDuration; _audio = new RecognizedAudio(array, audioFormat, startTime, AudioPosition, AudioDuration); } finally @@ -249,7 +249,7 @@ private void Initialize(IRecognizerInternal recognizer, ISpRecoResult recoResult _maxAlternates = maxAlternates; try { - _sapiRecoResult = (recoResult as ISpRecoResult2); + _sapiRecoResult = recoResult as ISpRecoResult2; } catch (COMException) { @@ -308,14 +308,14 @@ private Collection ExtractAlternates(int numberOfAlternates, b IntPtr ptr = new IntPtr((long)value + num2); SPSERIALIZEDPHRASEALT sPSERIALIZEDPHRASEALT = (SPSERIALIZEDPHRASEALT)Marshal.PtrToStructure(ptr, typeof(SPSERIALIZEDPHRASEALT)); num2 += num; - num2 = ((!isSapi53Header) ? (num2 + (int)sPSERIALIZEDPHRASEALT.cbAltExtra) : (num2 + (int)((sPSERIALIZEDPHRASEALT.cbAltExtra + 7) & -8))); + num2 = !isSapi53Header ? num2 + (int)sPSERIALIZEDPHRASEALT.cbAltExtra : num2 + (int)((sPSERIALIZEDPHRASEALT.cbAltExtra + 7) & -8); IntPtr phraseBuffer = new IntPtr((long)value + num2); SPSERIALIZEDPHRASE phraseHeader = RecognizedPhrase.GetPhraseHeader(phraseBuffer, (uint)((int)_header.ulPhraseAltDataSize - num2), _isSapi53Header); int ulSerializedSize = (int)phraseHeader.ulSerializedSize; RecognizedPhrase recognizedPhrase = new RecognizedPhrase(); bool hasIPAPronunciation = (_header.fAlphabet & 2) != 0; recognizedPhrase.InitializeFromSerializedBuffer(this, phraseHeader, phraseBuffer, ulSerializedSize, isSapi53Header, hasIPAPronunciation); - num2 = ((!isSapi53Header) ? (num2 + ulSerializedSize) : (num2 + ((ulSerializedSize + 7) & -8))); + num2 = !isSapi53Header ? num2 + ulSerializedSize : num2 + ((ulSerializedSize + 7) & -8); collection.Add(recognizedPhrase); } return collection; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizeCompletedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizeCompletedEventArgs.cs index 92353e9e7..4f5ec0c12 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizeCompletedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizeCompletedEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizeMode.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizeMode.cs index 8ec9a46ce..93a83a3d2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizeMode.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizeMode.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizedAudio.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizedAudio.cs index 0bfd4c8c2..6e7e55e3a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizedAudio.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizedAudio.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizedPhrase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizedPhrase.cs index 8e77bcbdd..cea7f7d91 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizedPhrase.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizedPhrase.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -54,7 +54,7 @@ private class RuleNode internal RuleNode(Grammar grammar, string rule, float confidence, uint first, uint count) { - _rule = (_name = rule); + _rule = _name = rule; _firstElement = first; _count = count; _confidence = confidence; @@ -79,7 +79,7 @@ internal RuleNode Find(uint firstElement, uint count) float num3; if (ruleNode._count == 0) { - num4 = (num3 = (float)ruleNode._firstElement - 0.5f); + num4 = num3 = (float)ruleNode._firstElement - 0.5f; } else { @@ -442,7 +442,7 @@ internal void InitializeFromSerializedBuffer(RecognitionResult recoResult, SPSER _hasIPAPronunciation = hasIPAPronunciation; _phraseBuffer = new byte[phraseLength]; Marshal.Copy(phraseBuffer, _phraseBuffer, 0, phraseLength); - _grammarOptions = ((recoResult.Grammar != null) ? recoResult.Grammar._semanticTag : GrammarOptions.KeyValuePairSrgs); + _grammarOptions = recoResult.Grammar != null ? recoResult.Grammar._semanticTag : GrammarOptions.KeyValuePairSrgs; CalcSemantics(recoResult.Grammar); } @@ -616,7 +616,7 @@ private void RecursivelyExtractSemanticValue(IntPtr phraseBuffer, int semanticsO private static void InsertSemanticValueToDictionary(SemanticValue semanticValue, string propertyName, SemanticValue thisSemanticValue, GrammarOptions semanticTag, ref Collection dupItems) { string text = propertyName; - if ((text == "$" && semanticTag == GrammarOptions.MssV1) || (text == "=" && (semanticTag == GrammarOptions.KeyValuePairSrgs || semanticTag == GrammarOptions.KeyValuePairs)) || (thisSemanticValue.Count == -1 && semanticTag == GrammarOptions.W3cV1)) + if ((text == "$" && semanticTag == GrammarOptions.MssV1) || (text == "=" && semanticTag is GrammarOptions.KeyValuePairSrgs or GrammarOptions.KeyValuePairs) || (thisSemanticValue.Count == -1 && semanticTag == GrammarOptions.W3cV1)) { if ((semanticTag & GrammarOptions.SemanticInterpretation) == 0 && semanticValue._valueFieldSet && !semanticValue.Value.Equals(thisSemanticValue.Value)) { @@ -701,7 +701,7 @@ private static SemanticValue ExtractSemanticValueInformation(int semanticsOffset obj = Marshal.PtrToStructure(ptr3, typeof(double)); break; case 11: - obj = (Marshal.ReadByte(ptr3) != 0); + obj = Marshal.ReadByte(ptr3) != 0; break; case 0: obj = null; @@ -929,12 +929,12 @@ private static void GetRuleInstance(Grammar grammar, string rule, string method, { Type type = grammar.GetType(); Assembly assembly = type.Assembly; - Type type2 = (rule == type.Name) ? type : GetTypeForRule(assembly, rule); + Type type2 = rule == type.Name ? type : GetTypeForRule(assembly, rule); if (type2 == null || !type2.IsSubclassOf(typeof(Grammar))) { throw new FormatException(SR.Get(SRID.RecognizerInvalidBinaryGrammar)); } - ruleInstance = ((type2 == type) ? grammar : ((Grammar)assembly.CreateInstance(type2.FullName))); + ruleInstance = type2 == type ? grammar : (Grammar)assembly.CreateInstance(type2.FullName); onParse = ruleInstance.MethodInfo(method); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizedWordUnit.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizedWordUnit.cs index cd5d87a59..896b4784d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizedWordUnit.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizedWordUnit.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -62,13 +62,13 @@ public RecognizedWordUnit(string text, float confidence, string pronunciation, s { throw new ArgumentNullException("lexicalForm"); } - if (confidence < 0f || confidence > 1f) + if (confidence is < 0f or > 1f) { throw new ArgumentOutOfRangeException(SR.Get(SRID.InvalidConfidence)); } - _text = ((text == null || text.Length == 0) ? null : text); + _text = text == null || text.Length == 0 ? null : text; _confidence = confidence; - _pronunciation = ((pronunciation == null || pronunciation.Length == 0) ? null : pronunciation); + _pronunciation = pronunciation == null || pronunciation.Length == 0 ? null : pronunciation; _lexicalForm = lexicalForm; _displayAttributes = displayAttributes; _audioPosition = audioPosition; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizerBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizerBase.cs index 76e6f936d..9e3e29ad4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizerBase.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizerBase.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -243,7 +243,7 @@ internal RecognizerState State try { SPRECOSTATE recoState = SapiRecognizer.GetRecoState(); - if (recoState == SPRECOSTATE.SPRST_ACTIVE || recoState == SPRECOSTATE.SPRST_ACTIVE_ALWAYS) + if (recoState is SPRECOSTATE.SPRST_ACTIVE or SPRECOSTATE.SPRST_ACTIVE_ALWAYS) { return RecognizerState.Listening; } @@ -361,7 +361,7 @@ internal TimeSpan AudioPosition lock (SapiRecognizer) { SpeechAudioFormatInfo audioFormat = AudioFormat; - return (audioFormat.AverageBytesPerSecond > 0) ? new TimeSpan((long)(status.AudioStatus.CurDevicePos * 10000000 / (ulong)audioFormat.AverageBytesPerSecond)) : TimeSpan.Zero; + return audioFormat.AverageBytesPerSecond > 0 ? new TimeSpan((long)(status.AudioStatus.CurDevicePos * 10000000 / (ulong)audioFormat.AverageBytesPerSecond)) : TimeSpan.Zero; } } catch (COMException e) @@ -750,7 +750,7 @@ internal void EmulateRecognizeAsync(string inputText) internal RecognitionResult EmulateRecognize(string inputText, CompareOptions compareOptions) { Helpers.ThrowIfEmptyOrNull(inputText, "inputText"); - bool flag = compareOptions == CompareOptions.IgnoreCase || compareOptions == CompareOptions.OrdinalIgnoreCase; + bool flag = compareOptions is CompareOptions.IgnoreCase or CompareOptions.OrdinalIgnoreCase; if (!_supportsSapi53 && !flag) { throw new NotSupportedException(SR.Get(SRID.NotSupportedWithThisVersionOfSAPICompareOption)); @@ -761,7 +761,7 @@ internal RecognitionResult EmulateRecognize(string inputText, CompareOptions com internal void EmulateRecognizeAsync(string inputText, CompareOptions compareOptions) { Helpers.ThrowIfEmptyOrNull(inputText, "inputText"); - bool flag = compareOptions == CompareOptions.IgnoreCase || compareOptions == CompareOptions.OrdinalIgnoreCase; + bool flag = compareOptions is CompareOptions.IgnoreCase or CompareOptions.OrdinalIgnoreCase; if (!_supportsSapi53 && !flag) { throw new NotSupportedException(SR.Get(SRID.NotSupportedWithThisVersionOfSAPICompareOption)); @@ -983,7 +983,7 @@ internal void RecognizeAsyncCancel() } else { - _isRecognizing = (_isEmulateRecognition = false); + _isRecognizing = _isEmulateRecognition = false; } } } @@ -1348,7 +1348,7 @@ private void LoadSapiGrammarFromCfg(SapiGrammar sapiGrammar, Grammar grammar, Ur { sapiGrammar.SetGrammarLoader(_recoThunk); } - sapiGrammar.LoadCmdFromMemory2(grammar2, SPLOADOPTIONS.SPLO_STATIC, null, (baseUri == null) ? null : baseUri.ToString()); + sapiGrammar.LoadCmdFromMemory2(grammar2, SPLOADOPTIONS.SPLO_STATIC, null, baseUri == null ? null : baseUri.ToString()); } else { @@ -1562,7 +1562,7 @@ private void InternalEmulateRecognizeAsync(string phrase, SpeechEmulationCompare GCHandle[] memHandles = null; ISpPhrase spPhrase = null; IntPtr coMem; - spPhrase = ((wordUnits != null) ? SPPHRASE.CreatePhraseFromWordUnits(wordUnits, RecognizerInfo.Culture, out memHandles, out coMem) : SPPHRASE.CreatePhraseFromText(phrase.Trim(), RecognizerInfo.Culture, out memHandles, out coMem)); + spPhrase = wordUnits != null ? SPPHRASE.CreatePhraseFromWordUnits(wordUnits, RecognizerInfo.Culture, out memHandles, out coMem) : SPPHRASE.CreatePhraseFromText(phrase.Trim(), RecognizerInfo.Culture, out memHandles, out coMem); try { SAPIErrorCodes sAPIErrorCodes = SapiRecognizer.EmulateRecognition(spPhrase, (uint)flag); @@ -1594,7 +1594,7 @@ private void InternalEmulateRecognizeAsync(string phrase, SpeechEmulationCompare private void EmulateRecognizedFailReportError(SAPIErrorCodes hr) { _lastException = ExceptionFromSapiCreateRecognizerError(hr); - if (hr < SAPIErrorCodes.S_OK || hr == SAPIErrorCodes.SP_NO_RULE_ACTIVE) + if (hr is < SAPIErrorCodes.S_OK or SAPIErrorCodes.SP_NO_RULE_ACTIVE) { FireEmulateRecognizeCompletedEvent(null, _lastException, true); } @@ -1602,9 +1602,9 @@ private void EmulateRecognizedFailReportError(SAPIErrorCodes hr) private void ActivateRule(SapiGrammar sapiGrammar, Uri uri, string ruleName) { - SPRULESTATE sPRULESTATE = (!_pauseRecognizerOnRecognition) ? SPRULESTATE.SPRS_ACTIVE : SPRULESTATE.SPRS_ACTIVE_WITH_AUTO_PAUSE; - SAPIErrorCodes sAPIErrorCodes = (!Grammar.IsDictationGrammar(uri)) ? sapiGrammar.SetRuleState(ruleName, sPRULESTATE) : sapiGrammar.SetDictationState(sPRULESTATE); - if (sAPIErrorCodes == SAPIErrorCodes.SPERR_NOT_TOPLEVEL_RULE || sAPIErrorCodes == SAPIErrorCodes.SP_NO_RULES_TO_ACTIVATE) + SPRULESTATE sPRULESTATE = !_pauseRecognizerOnRecognition ? SPRULESTATE.SPRS_ACTIVE : SPRULESTATE.SPRS_ACTIVE_WITH_AUTO_PAUSE; + SAPIErrorCodes sAPIErrorCodes = !Grammar.IsDictationGrammar(uri) ? sapiGrammar.SetRuleState(ruleName, sPRULESTATE) : sapiGrammar.SetDictationState(sPRULESTATE); + if (sAPIErrorCodes is SAPIErrorCodes.SPERR_NOT_TOPLEVEL_RULE or SAPIErrorCodes.SP_NO_RULES_TO_ACTIVATE) { if (uri == null) { @@ -1955,11 +1955,11 @@ private void ProcessEndStreamEvent(SpeechEvent speechEvent) FireAudioStateChangedEvent(_audioState); if (!_isEmulateRecognition) { - FireRecognizeCompletedEvent(lastResult, initialSilenceTimeoutReached, babbleTimeoutReached, isStreamReleased, speechEvent.AudioPosition, (speechEvent.LParam == 0L) ? null : ExceptionFromSapiStreamError((SAPIErrorCodes)speechEvent.LParam), isRecognizeCancelled); + FireRecognizeCompletedEvent(lastResult, initialSilenceTimeoutReached, babbleTimeoutReached, isStreamReleased, speechEvent.AudioPosition, speechEvent.LParam == 0L ? null : ExceptionFromSapiStreamError((SAPIErrorCodes)speechEvent.LParam), isRecognizeCancelled); } else { - FireEmulateRecognizeCompletedEvent(lastResult, (speechEvent.LParam == 0L) ? lastException : ExceptionFromSapiStreamError((SAPIErrorCodes)speechEvent.LParam), isRecognizeCancelled); + FireEmulateRecognizeCompletedEvent(lastResult, speechEvent.LParam == 0L ? lastException : ExceptionFromSapiStreamError((SAPIErrorCodes)speechEvent.LParam), isRecognizeCancelled); } FireStateChangedEvent(RecognizerState.Stopped); } @@ -2209,7 +2209,7 @@ private void FireSignalProblemOccurredEvent(AudioSignalProblem audioSignalProble lock (SapiRecognizer) { SpeechAudioFormatInfo audioFormat = AudioFormat; - audioPosition = ((audioFormat.AverageBytesPerSecond > 0) ? new TimeSpan((long)(status.AudioStatus.CurDevicePos * 10000000 / (ulong)audioFormat.AverageBytesPerSecond)) : TimeSpan.Zero); + audioPosition = audioFormat.AverageBytesPerSecond > 0 ? new TimeSpan((long)(status.AudioStatus.CurDevicePos * 10000000 / (ulong)audioFormat.AverageBytesPerSecond)) : TimeSpan.Zero; recognizerPosition = new TimeSpan((long)status.ullRecognitionStreamTime); } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizerInfo.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizerInfo.cs index 4fee860e4..2dcaae470 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizerInfo.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizerInfo.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizerState.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizerState.cs index 8860fb5e1..15745030f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizerState.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizerState.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizerUpdateReachedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizerUpdateReachedEventArgs.cs index 93d2960ea..c0dd50e84 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizerUpdateReachedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/RecognizerUpdateReachedEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/ReplacementText.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/ReplacementText.cs index f5ae9cb87..f1cd1caf5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/ReplacementText.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/ReplacementText.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SemanticResultKey.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SemanticResultKey.cs index 6111896dc..44227339c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SemanticResultKey.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SemanticResultKey.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SemanticResultValue.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SemanticResultValue.cs index 9acf3e8e6..73ee95bcc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SemanticResultValue.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SemanticResultValue.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SemanticValue.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SemanticValue.cs index c127ef4cd..4a13f7bc1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SemanticValue.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SemanticValue.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpObjectToken.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpObjectToken.cs index 0a4b5968d..2e8cb52c0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpObjectToken.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpObjectToken.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpObjectTokenCategory.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpObjectTokenCategory.cs index 78b9aad70..bee4f01d0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpObjectTokenCategory.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpObjectTokenCategory.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechDetectedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechDetectedEventArgs.cs index 4b2ff3064..34acf07cc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechDetectedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechDetectedEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechHypothesizedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechHypothesizedEventArgs.cs index fa7c6ee48..232c14286 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechHypothesizedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechHypothesizedEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechRecognitionEngine.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechRecognitionEngine.cs index 4abc05cf7..3f041361f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechRecognitionEngine.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechRecognitionEngine.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -67,7 +67,7 @@ public TimeSpan EndSilenceTimeout get => TimeSpan.FromMilliseconds(RecoBase.QueryRecognizerSettingAsInt("ResponseSpeed")); set { - if (value.TotalMilliseconds < 0.0 || value.TotalMilliseconds > 10000.0) + if (value.TotalMilliseconds is < 0.0 or > 10000.0) { throw new ArgumentOutOfRangeException("value", SR.Get(SRID.EndSilenceOutOfRange)); } @@ -82,7 +82,7 @@ public TimeSpan EndSilenceTimeoutAmbiguous get => TimeSpan.FromMilliseconds(RecoBase.QueryRecognizerSettingAsInt("ComplexResponseSpeed")); set { - if (value.TotalMilliseconds < 0.0 || value.TotalMilliseconds > 10000.0) + if (value.TotalMilliseconds is < 0.0 or > 10000.0) { throw new ArgumentOutOfRangeException("value", SR.Get(SRID.EndSilenceOutOfRange)); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechRecognitionRejectedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechRecognitionRejectedEventArgs.cs index 2cbadb55e..ad2398739 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechRecognitionRejectedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechRecognitionRejectedEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechRecognizedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechRecognizedEventArgs.cs index 1990922d0..e9c2481ad 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechRecognizedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechRecognizedEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechRecognizer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechRecognizer.cs index e3d3ab713..2bad1c291 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechRecognizer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechRecognizer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechUI.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechUI.cs index e9cd566c9..6aa999798 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechUI.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SpeechUI.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/StateChangedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/StateChangedEventArgs.cs index 0daa69424..aa1bbd200 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/StateChangedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/StateChangedEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SubsetMatchingMode.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SubsetMatchingMode.cs index 3111fd1eb..67b80953a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SubsetMatchingMode.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Recognition/SubsetMatchingMode.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Remoting.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Remoting.cs index 9db9e16d5..6e97bc96e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Remoting.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Remoting.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/EventNotify.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/EventNotify.cs index 8882ff930..88e030405 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/EventNotify.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/EventNotify.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SAPIGuids.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SAPIGuids.cs index c07d5400d..656c9b5de 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SAPIGuids.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SAPIGuids.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPPHRASE.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPPHRASE.cs index 13720b8f8..48aaa592b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPPHRASE.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPPHRASE.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -89,7 +89,7 @@ internal static ISpPhrase CreatePhraseFromWordUnits(RecognizedWordUnit[] words, { RecognizedWordUnit recognizedWordUnit = words[i]; array[i] = new SPPHRASEELEMENT(); - array[i].bDisplayAttributes = RecognizedWordUnit.DisplayAttributesToSapiAttributes((recognizedWordUnit.DisplayAttributes == DisplayAttributes.None) ? DisplayAttributes.OneTrailingSpace : recognizedWordUnit.DisplayAttributes); + array[i].bDisplayAttributes = RecognizedWordUnit.DisplayAttributesToSapiAttributes(recognizedWordUnit.DisplayAttributes == DisplayAttributes.None ? DisplayAttributes.OneTrailingSpace : recognizedWordUnit.DisplayAttributes); array[i].SREngineConfidence = recognizedWordUnit.Confidence; array[i].ulAudioTimeOffset = (uint)(recognizedWordUnit._audioPosition.Ticks * 10000 / 10000); array[i].ulAudioSizeTime = (uint)(recognizedWordUnit._audioDuration.Ticks * 10000 / 10000); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPPHRASEELEMENT.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPPHRASEELEMENT.cs index 1ef7c4cea..cb68064c0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPPHRASEELEMENT.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPPHRASEELEMENT.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPPHRASEREPLACEMENT.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPPHRASEREPLACEMENT.cs index 0f5d94597..6a70bf6b3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPPHRASEREPLACEMENT.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPPHRASEREPLACEMENT.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPPHRASERULE.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPPHRASERULE.cs index d42bb0307..2ab68a373 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPPHRASERULE.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPPHRASERULE.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPRESULTHEADER.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPRESULTHEADER.cs index 1af156040..e2a2bc120 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPRESULTHEADER.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPRESULTHEADER.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPRESULTHEADER_Sapi51.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPRESULTHEADER_Sapi51.cs index 22a77692c..dd094cca5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPRESULTHEADER_Sapi51.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPRESULTHEADER_Sapi51.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSEMANTICERRORINFO.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSEMANTICERRORINFO.cs index 8b7c58685..d7a9d6e30 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSEMANTICERRORINFO.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSEMANTICERRORINFO.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASE.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASE.cs index 6715922e7..37dc692d2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASE.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASE.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASEALT.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASEALT.cs index a945582bc..a85236beb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASEALT.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASEALT.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASEELEMENT.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASEELEMENT.cs index 0d4183ace..ed4e7f62e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASEELEMENT.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASEELEMENT.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASEPROPERTY.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASEPROPERTY.cs index 186afea51..966b6b351 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASEPROPERTY.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASEPROPERTY.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASERULE.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASERULE.cs index 33f056cf0..a20ad82c1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASERULE.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASERULE.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASE_Sapi51.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASE_Sapi51.cs index 82582bf40..1a47e9f2b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASE_Sapi51.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPSERIALIZEDPHRASE_Sapi51.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPWAVEFORMATEX.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPWAVEFORMATEX.cs index 3f6eb9958..6d6f13dc0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPWAVEFORMATEX.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SPWAVEFORMATEX.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiConstants.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiConstants.cs index 47d9526e6..25468bf0d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiConstants.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiConstants.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiGrammar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiGrammar.cs index 210848912..ae06dc877 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiGrammar.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiGrammar.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiProxy.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiProxy.cs index c2fd7fe73..412c4cabf 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiProxy.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiProxy.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiRecoContext.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiRecoContext.cs index e966db296..80d8b51a0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiRecoContext.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiRecoContext.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiRecognizer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiRecognizer.cs index 36d68aa2f..7e6c37d47 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiRecognizer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SapiRecognizer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -49,8 +49,8 @@ internal SapiRecognizer(RecognizerType type) ISpRecognizer spRecognizer; try { - spRecognizer = ((type != 0) ? ((ISpRecognizer)new SpSharedRecognizer()) : ((ISpRecognizer)new SpInprocRecognizer())); - _isSap53 = (spRecognizer is ISpRecognizer2); + spRecognizer = type != 0 ? (ISpRecognizer)new SpSharedRecognizer() : (ISpRecognizer)new SpInprocRecognizer(); + _isSap53 = spRecognizer is ISpRecognizer2; } catch (COMException e) { @@ -214,7 +214,7 @@ internal SAPIErrorCodes EmulateRecognition(ISpPhrase iSpPhrase, uint dwCompareFl private static void SetProperty(ISpRecognizer sapiRecognizer, string name, object value) { - SAPIErrorCodes sAPIErrorCodes = (SAPIErrorCodes)((!(value is int)) ? sapiRecognizer.SetPropertyString(name, (string)value) : sapiRecognizer.SetPropertyNum(name, (int)value)); + SAPIErrorCodes sAPIErrorCodes = (SAPIErrorCodes)(!(value is int) ? sapiRecognizer.SetPropertyString(name, (string)value) : sapiRecognizer.SetPropertyNum(name, (int)value)); if (sAPIErrorCodes == SAPIErrorCodes.S_FALSE) { throw new KeyNotFoundException(SR.Get(SRID.RecognizerSettingNotSupported)); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpAudioStreamWrapper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpAudioStreamWrapper.cs index 109640794..039410ac8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpAudioStreamWrapper.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpAudioStreamWrapper.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpDataKey.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpDataKey.cs index 65cd29852..64b465e04 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpDataKey.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpDataKey.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpInprocRecognizer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpInprocRecognizer.cs index 83709a46e..e5599074c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpInprocRecognizer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpInprocRecognizer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpNotifySink.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpNotifySink.cs index 9025999f7..38b44d206 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpNotifySink.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpNotifySink.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpObjectToken.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpObjectToken.cs index 6f0e15097..7af62c1c2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpObjectToken.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpObjectToken.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpObjectTokenCategory.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpObjectTokenCategory.cs index b16989372..d1e7174d1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpObjectTokenCategory.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpObjectTokenCategory.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpPhraseBuilder.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpPhraseBuilder.cs index 924151979..187f2ed37 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpPhraseBuilder.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpPhraseBuilder.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpSharedRecognizer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpSharedRecognizer.cs index 9bc695e5c..546bb8036 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpSharedRecognizer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpSharedRecognizer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpStreamWrapper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpStreamWrapper.cs index 9b67701b2..0022e910e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpStreamWrapper.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpStreamWrapper.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpeechEvent.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpeechEvent.cs index e5ea9bedd..f60c60dca 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpeechEvent.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Classes/SpeechEvent.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -61,7 +61,7 @@ private SpeechEvent(SPEVENTENUM eEventId, SPEVENTLPARAMTYPE elParamType, ulong u _audioStreamOffset = ullAudioStreamOffset; _wParam = (ulong)wParam.ToInt64(); _lParam = (ulong)(long)lParam; - if (_paramType == SPEVENTLPARAMTYPE.SPET_LPARAM_IS_POINTER || _paramType == SPEVENTLPARAMTYPE.SPET_LPARAM_IS_STRING) + if (_paramType is SPEVENTLPARAMTYPE.SPET_LPARAM_IS_POINTER or SPEVENTLPARAMTYPE.SPET_LPARAM_IS_STRING) { GC.AddMemoryPressure(_sizeMemoryPressure = Marshal.SizeOf((object)_lParam)); } @@ -76,7 +76,7 @@ private SpeechEvent(SPEVENT sapiEvent, SpeechAudioFormatInfo audioFormat) } else { - _audioPosition = ((audioFormat.AverageBytesPerSecond > 0) ? new TimeSpan((long)(sapiEvent.ullAudioStreamOffset * 10000000 / (ulong)audioFormat.AverageBytesPerSecond)) : TimeSpan.Zero); + _audioPosition = audioFormat.AverageBytesPerSecond > 0 ? new TimeSpan((long)(sapiEvent.ullAudioStreamOffset * 10000000 / (ulong)audioFormat.AverageBytesPerSecond)) : TimeSpan.Zero; } } @@ -95,11 +95,11 @@ public void Dispose() { if (_lParam != 0L) { - if (_paramType == SPEVENTLPARAMTYPE.SPET_LPARAM_IS_TOKEN || _paramType == SPEVENTLPARAMTYPE.SPET_LPARAM_IS_OBJECT) + if (_paramType is SPEVENTLPARAMTYPE.SPET_LPARAM_IS_TOKEN or SPEVENTLPARAMTYPE.SPET_LPARAM_IS_OBJECT) { Marshal.Release((IntPtr)(long)_lParam); } - else if (_paramType == SPEVENTLPARAMTYPE.SPET_LPARAM_IS_POINTER || _paramType == SPEVENTLPARAMTYPE.SPET_LPARAM_IS_STRING) + else if (_paramType is SPEVENTLPARAMTYPE.SPET_LPARAM_IS_POINTER or SPEVENTLPARAMTYPE.SPET_LPARAM_IS_STRING) { Marshal.FreeCoTaskMem((IntPtr)(long)_lParam); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Enumerations/Enumerations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Enumerations/Enumerations.cs index 0fa2e276e..46dba5455 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Enumerations/Enumerations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Enumerations/Enumerations.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/IEnumSpObjectTokens.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/IEnumSpObjectTokens.cs index 4eeb3cca7..0a40f8222 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/IEnumSpObjectTokens.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/IEnumSpObjectTokens.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpCategory.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpCategory.cs index 3a742a110..421bbc286 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpCategory.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpCategory.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpDataKey.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpDataKey.cs index d26bd5f5d..05f834abd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpDataKey.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpDataKey.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpDisplayAlternates.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpDisplayAlternates.cs index 1e32c0ec7..b5e1dd975 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpDisplayAlternates.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpDisplayAlternates.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpEventSource.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpEventSource.cs index 894c14f1a..8a82258c6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpEventSource.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpEventSource.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpEventSource2.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpEventSource2.cs index 17da961fc..382cd88ca 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpEventSource2.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpEventSource2.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpGrammarBuilder.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpGrammarBuilder.cs index 860f37376..ed3d6322b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpGrammarBuilder.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpGrammarBuilder.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpGrammarResourceLoader.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpGrammarResourceLoader.cs index 0839eddcf..6f9c71759 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpGrammarResourceLoader.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpGrammarResourceLoader.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpNotifySink.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpNotifySink.cs index 5e0a7b8de..0dfe4510c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpNotifySink.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpNotifySink.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpNotifySource.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpNotifySource.cs index f84e0f1cd..612e4284b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpNotifySource.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpNotifySource.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpObjectToken.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpObjectToken.cs index e14e89002..67177f37c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpObjectToken.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpObjectToken.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpObjectTokenCategory.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpObjectTokenCategory.cs index 4e17dd255..358edcf3e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpObjectTokenCategory.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpObjectTokenCategory.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpObjectWithToken.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpObjectWithToken.cs index e5ccdf61b..d5a85b2f9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpObjectWithToken.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpObjectWithToken.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhoneticAlphabetSelection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhoneticAlphabetSelection.cs index 5eb07fea0..0f73b458d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhoneticAlphabetSelection.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhoneticAlphabetSelection.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhrase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhrase.cs index 2e9179c18..1197fd660 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhrase.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhrase.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhraseAlt.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhraseAlt.cs index 933325746..5d14c34d5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhraseAlt.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhraseAlt.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhraseBuilder.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhraseBuilder.cs index 5accddda0..7f495f4c6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhraseBuilder.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhraseBuilder.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhraseEx.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhraseEx.cs index 77143ac4f..a97ac2e17 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhraseEx.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpPhraseEx.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpProperties.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpProperties.cs index 4bff5ea5d..0c36248e5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpProperties.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpProperties.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoContext.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoContext.cs index 61e377664..a6e389f18 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoContext.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoContext.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoContext2.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoContext2.cs index 041d2f504..d5abc69dd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoContext2.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoContext2.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoGrammar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoGrammar.cs index 3e4861cd8..9198e861a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoGrammar.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoGrammar.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoGrammar2.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoGrammar2.cs index 3714e36d1..e8b3ffcc6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoGrammar2.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoGrammar2.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoResult.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoResult.cs index 4b526d58c..d778000e6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoResult.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoResult.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoResult2.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoResult2.cs index e0bafe944..44e0bd579 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoResult2.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecoResult2.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecognizer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecognizer.cs index 6db318650..ff32a597f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecognizer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecognizer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecognizer2.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecognizer2.cs index 65b53ddf2..df0e2e50b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecognizer2.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRecognizer2.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRegDataKey.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRegDataKey.cs index 22ed35aac..10b97fd0b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRegDataKey.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpRegDataKey.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpStream.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpStream.cs index c82c2e4b4..8da0879ab 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpStream.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpStream.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpStreamFormat.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpStreamFormat.cs index bd7b98e03..670fb9391 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpStreamFormat.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpStreamFormat.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpXMLRecoResult.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpXMLRecoResult.cs index 5225f6d6e..6b485ccfd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpXMLRecoResult.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpXMLRecoResult.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpeechRecognizer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpeechRecognizer.cs index 57a9d800e..572895f97 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpeechRecognizer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Interfaces/ISpeechRecognizer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/FILETIME.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/FILETIME.cs index b3cba98e0..f5bef0b63 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/FILETIME.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/FILETIME.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPAUDIOSTATUS.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPAUDIOSTATUS.cs index ab92e61f8..95991221e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPAUDIOSTATUS.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPAUDIOSTATUS.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPEVENT.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPEVENT.cs index 18b73ae2b..cbe8c476e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPEVENT.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPEVENT.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPEVENTEX.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPEVENTEX.cs index a41dfbd06..a0a26e23c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPEVENTEX.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPEVENTEX.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPRECOCONTEXTSTATUS.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPRECOCONTEXTSTATUS.cs index c4374d937..9279af308 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPRECOCONTEXTSTATUS.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPRECOCONTEXTSTATUS.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPRECOGNIZERSTATUS.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPRECOGNIZERSTATUS.cs index 4f98ac626..4648c4867 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPRECOGNIZERSTATUS.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPRECOGNIZERSTATUS.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPRECORESULTTIMES.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPRECORESULTTIMES.cs index b09fac339..5325b17dd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPRECORESULTTIMES.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPRECORESULTTIMES.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPSERIALIZEDRESULT.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPSERIALIZEDRESULT.cs index bdde96c48..4765fe978 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPSERIALIZEDRESULT.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPSERIALIZEDRESULT.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPTEXTSELECTIONINFO.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPTEXTSELECTIONINFO.cs index b3436d71b..444682cfa 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPTEXTSELECTIONINFO.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPTEXTSELECTIONINFO.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPVOICESTATUS.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPVOICESTATUS.cs index a7450f43c..81612a242 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPVOICESTATUS.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SAPI Interop/Structs/SPVOICESTATUS.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Speech/SR.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Speech/SR.cs index 486e04a39..09b73882b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Speech/SR.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Speech/SR.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Speech/SRID.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Speech/SRID.cs index 17ab7fb23..a7ddaa15c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Speech/SRID.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Speech/SRID.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/AppDomainCompilerProxy.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/AppDomainCompilerProxy.cs index 10cff49d3..ef135430f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/AppDomainCompilerProxy.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/AppDomainCompilerProxy.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -57,7 +57,7 @@ internal Exception CheckAssembly(byte[] il, int iCfg, string language, string na string text = ruleNames[i]; string text2 = methodNames[i]; _constructors[i] = string.Empty; - string text3 = ((!string.IsNullOrEmpty(nameSpace)) ? (nameSpace + ".") : string.Empty) + text; + string text3 = (!string.IsNullOrEmpty(nameSpace) ? nameSpace + "." : string.Empty) + text; Type type = assembly.GetType(text3); if (type == null) { @@ -199,7 +199,7 @@ private static string WrapConstructorCSharp(int iCfg, ParameterInfo[] parameters } } stringBuilder.Append(" )\n {\n object [] onInitParams = new object ["); - stringBuilder.Append((parameters != null) ? parameters.Length : 0); + stringBuilder.Append(parameters != null ? parameters.Length : 0); stringBuilder.Append("];\n"); int num2 = 0; while (parameters != null && num2 < parameters.Length) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/AppDomainGrammarProxy.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/AppDomainGrammarProxy.cs index db4a5b12a..68ea3ab63 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/AppDomainGrammarProxy.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/AppDomainGrammarProxy.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -56,7 +56,7 @@ internal SrgsRule[] OnInit(string method, object[] parameters, string onInitPara { parameters = MatchInitParameters(method, onInitParameters, _rule, _rule); } - Type[] array = new Type[(parameters != null) ? parameters.Length : 0]; + Type[] array = new Type[parameters != null ? parameters.Length : 0]; if (parameters != null) { for (int i = 0; i < parameters.Length; i++) @@ -158,14 +158,14 @@ internal void Init(string rule, byte[] il, byte[] pdb) private void GetRuleInstance(string rule, string method, out MethodInfo onParse, out Grammar grammar) { - Type type = (rule == _rule) ? _grammarType : GetTypeForRule(_assembly, rule); + Type type = rule == _rule ? _grammarType : GetTypeForRule(_assembly, rule); if (type == null || !type.IsSubclassOf(typeof(Grammar))) { throw new FormatException(SR.Get(SRID.RecognizerInvalidBinaryGrammar)); } try { - grammar = ((type == _grammarType) ? _grammar : ((Grammar)_assembly.CreateInstance(type.FullName))); + grammar = type == _grammarType ? _grammar : (Grammar)_assembly.CreateInstance(type.FullName); } catch (MissingMemberException) { @@ -261,7 +261,7 @@ private static string FormatConstructorParameters(MethodInfo[] cis, string metho { continue; } - stringBuilder.Append((stringBuilder.Length > 0) ? " or sapi:parms=\"" : "sapi:parms=\""); + stringBuilder.Append(stringBuilder.Length > 0 ? " or sapi:parms=\"" : "sapi:parms=\""); ParameterInfo[] parameters = cis[i].GetParameters(); for (int j = 0; j < parameters.Length; j++) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Arc.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Arc.cs index ff8c406bb..49e52d771 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Arc.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Arc.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -198,7 +198,7 @@ private Arc(string sWord, Rule ruleRef, StringBlob words, float flWeight, int co { if (specialRule != null) { - _specialTransitionIndex = ((specialRule == CfgGrammar.SPRULETRANS_WILDCARD) ? 4194302 : ((specialRule == CfgGrammar.SPRULETRANS_DICTATION) ? 4194301 : 4194303)); + _specialTransitionIndex = specialRule == CfgGrammar.SPRULETRANS_WILDCARD ? 4194302 : specialRule == CfgGrammar.SPRULETRANS_DICTATION ? 4194301 : 4194303; } else { @@ -247,7 +247,7 @@ private int Compare(Arc obj1, Arc obj2) return 1; } int num = obj1.SortRank() - obj2.SortRank(); - return (num != 0) ? num : ((int)(obj1._iSerialize - obj2._iSerialize)); + return num != 0 ? num : (int)(obj1._iSerialize - obj2._iSerialize); } internal static int CompareContent(Arc arc1, Arc arc2) @@ -261,7 +261,7 @@ internal static int CompareContent(Arc arc1, Arc arc2) int num = 0; if (arc1._ruleRef != null || arc2._ruleRef != null) { - num = ((arc1._ruleRef != null && arc2._ruleRef == null) ? (-1) : ((arc1._ruleRef == null && arc2._ruleRef != null) ? 1 : string.Compare(arc1._ruleRef.Name, arc2._ruleRef.Name, StringComparison.CurrentCulture))); + num = arc1._ruleRef != null && arc2._ruleRef == null ? -1 : arc1._ruleRef == null && arc2._ruleRef != null ? 1 : string.Compare(arc1._ruleRef.Name, arc2._ruleRef.Name, StringComparison.CurrentCulture); } if (num != 0) { @@ -293,8 +293,8 @@ internal float Serialize(StreamMarshaler streamBuffer, bool isLast, uint arcInde { CfgArc cfgArc = default(CfgArc); cfgArc.LastArc = isLast; - cfgArc.HasSemanticTag = (SemanticTagCount > 0); - cfgArc.NextStartArcIndex = (uint)((_end != null) ? _end.SerializeId : 0); + cfgArc.HasSemanticTag = SemanticTagCount > 0; + cfgArc.NextStartArcIndex = (uint)(_end != null ? _end.SerializeId : 0); if (_ruleRef != null) { cfgArc.RuleRef = true; @@ -312,8 +312,8 @@ internal float Serialize(StreamMarshaler streamBuffer, bool isLast, uint arcInde cfgArc.TransitionIndex = (uint)_iWord; } } - cfgArc.LowConfRequired = (_confidence < 0); - cfgArc.HighConfRequired = (_confidence > 0); + cfgArc.LowConfRequired = _confidence < 0; + cfgArc.HighConfRequired = _confidence > 0; cfgArc.MatchMode = (uint)_matchMode; _iSerialize = arcIndex; streamBuffer.WriteStream(cfgArc); @@ -362,7 +362,7 @@ internal static int CompareForDuplicateInputTransitions(Arc arc1, Arc arc2) { return num; } - return (int)(((arc1._start != null) ? arc1._start.Id : 0) - ((arc2._start != null) ? arc2._start.Id : 0)); + return (int)((arc1._start != null ? arc1._start.Id : 0) - (arc2._start != null ? arc2._start.Id : 0)); } internal static int CompareForDuplicateOutputTransitions(Arc arc1, Arc arc2) @@ -372,15 +372,15 @@ internal static int CompareForDuplicateOutputTransitions(Arc arc1, Arc arc2) { return num; } - return (int)(((arc1._end != null) ? arc1._end.Id : 0) - ((arc2._end != null) ? arc2._end.Id : 0)); + return (int)((arc1._end != null ? arc1._end.Id : 0) - (arc2._end != null ? arc2._end.Id : 0)); } internal static int CompareIdenticalTransitions(Arc arc1, Arc arc2) { - int num = (int)(((arc1._start != null) ? arc1._start.Id : 0) - ((arc2._start != null) ? arc2._start.Id : 0)); - if (num == 0 && (num = (int)(((arc1._end != null) ? arc1._end.Id : 0) - ((arc2._end != null) ? arc2._end.Id : 0))) == 0) + int num = (int)((arc1._start != null ? arc1._start.Id : 0) - (arc2._start != null ? arc2._start.Id : 0)); + if (num == 0 && (num = (int)((arc1._end != null ? arc1._end.Id : 0) - (arc2._end != null ? arc2._end.Id : 0))) == 0) { - num = ((!arc1.SameTags(arc2)) ? 1 : 0); + num = !arc1.SameTags(arc2) ? 1 : 0; } return num; } @@ -453,7 +453,7 @@ internal static void CopyTags(Arc src, Arc dest, Direction move) } } } - src._startTags = (src._endTags = null); + src._startTags = src._endTags = null; } internal void CloneTags(Arc arc, List _tags, Dictionary endArcs, Backend be) @@ -504,18 +504,18 @@ internal bool SameTags(Arc arc) flag = true; for (int i = 0; i < _startTags.Count; i++) { - flag &= (_startTags[i] == arc._startTags[i]); + flag &= _startTags[i] == arc._startTags[i]; } } if (flag) { - flag = (_endTags == null && arc._endTags == null); + flag = _endTags == null && arc._endTags == null; if (!flag && _endTags != null && arc._endTags != null && _endTags.Count == arc._endTags.Count) { flag = true; for (int j = 0; j < _endTags.Count; j++) { - flag &= (_endTags[j] == arc._endTags[j]); + flag &= _endTags[j] == arc._endTags[j]; } } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/ArcList.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/ArcList.cs index 8c1f05c0c..292d8c745 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/ArcList.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/ArcList.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Backend.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Backend.cs index a38f5f345..1afa25711 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Backend.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Backend.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -153,7 +153,7 @@ internal void Commit(StreamMarshaler streamBuffer) list.Sort(); ValidateAndTagRules(); CheckLeftRecursion(list); - int num = (_basePath != null) ? (_basePath.Length + 1) : 0; + int num = _basePath != null ? _basePath.Length + 1 : 0; int idWord = 0; if (_globalTags.Count > 0) { @@ -331,7 +331,7 @@ internal Rule FindRule(string sRule) if (num > 0) { int num2 = _symbols.OffsetFromId(num); - rule = ((num2 > 0 && _nameOffsetRules.ContainsKey(num2)) ? _nameOffsetRules[num2] : null); + rule = num2 > 0 && _nameOffsetRules.ContainsKey(num2) ? _nameOffsetRules[num2] : null; } } if (rule != null) @@ -546,7 +546,7 @@ internal void DeleteSubGraph(State state) } foreach (Arc item in collection) { - State state4 = item.Start = (item.End = null); + State state4 = item.Start = item.End = null; } } foreach (State item2 in collection2) @@ -568,12 +568,12 @@ internal void SetRuleAttributes(Rule rule, SPCFGRULEATTRIBUTES dwAttributes) _rootRule = rule; } } - rule._cfgRule.TopLevel = ((dwAttributes & SPCFGRULEATTRIBUTES.SPRAF_TopLevel) != 0); - rule._cfgRule.DefaultActive = ((dwAttributes & SPCFGRULEATTRIBUTES.SPRAF_Active) != 0); - rule._cfgRule.PropRule = ((dwAttributes & SPCFGRULEATTRIBUTES.SPRAF_Interpreter) != 0); - rule._cfgRule.Export = ((dwAttributes & SPCFGRULEATTRIBUTES.SPRAF_Export) != 0); - rule._cfgRule.Dynamic = ((dwAttributes & SPCFGRULEATTRIBUTES.SPRAF_Dynamic) != 0); - rule._cfgRule.Import = ((dwAttributes & SPCFGRULEATTRIBUTES.SPRAF_Import) != 0); + rule._cfgRule.TopLevel = (dwAttributes & SPCFGRULEATTRIBUTES.SPRAF_TopLevel) != 0; + rule._cfgRule.DefaultActive = (dwAttributes & SPCFGRULEATTRIBUTES.SPRAF_Active) != 0; + rule._cfgRule.PropRule = (dwAttributes & SPCFGRULEATTRIBUTES.SPRAF_Interpreter) != 0; + rule._cfgRule.Export = (dwAttributes & SPCFGRULEATTRIBUTES.SPRAF_Export) != 0; + rule._cfgRule.Dynamic = (dwAttributes & SPCFGRULEATTRIBUTES.SPRAF_Dynamic) != 0; + rule._cfgRule.Import = (dwAttributes & SPCFGRULEATTRIBUTES.SPRAF_Import) != 0; } internal void SetBasePath(string sBasePath) @@ -674,7 +674,7 @@ internal void InitFromBinaryGrammar(StreamMarshaler streamHelper) } end = array[nextStartArcIndex]; } - float flWeight = (header.weights != null) ? header.weights[i] : 1f; + float flWeight = header.weights != null ? header.weights[i] : 1f; Arc arc; if (cfgArc2.RuleRef) { @@ -684,8 +684,8 @@ internal void InitFromBinaryGrammar(StreamMarshaler streamHelper) else { int transitionIndex = (int)cfgArc2.TransitionIndex; - int num = (transitionIndex == 4194302 || transitionIndex == 4194301 || transitionIndex == 4194303) ? transitionIndex : 0; - arc = new Arc((int)((num == 0) ? cfgArc2.TransitionIndex : 0), flWeight, cfgArc2.LowConfRequired ? (-1) : (cfgArc2.HighConfRequired ? 1 : 0), num, MatchMode.AllWords, ref _fNeedWeightTable); + int num = transitionIndex is 4194302 or 4194301 or 4194303 ? transitionIndex : 0; + arc = new Arc((int)(num == 0 ? cfgArc2.TransitionIndex : 0), flWeight, cfgArc2.LowConfRequired ? -1 : cfgArc2.HighConfRequired ? 1 : 0, num, MatchMode.AllWords, ref _fNeedWeightTable); } arc.Start = state; arc.End = end; @@ -734,7 +734,7 @@ internal void InitFromBinaryGrammar(StreamMarshaler streamHelper) private Arc CreateTransition(string sWord, float flWeight, int requiredConfidence) { - return AddSingleWordTransition((!string.IsNullOrEmpty(sWord)) ? sWord : null, flWeight, requiredConfidence); + return AddSingleWordTransition(!string.IsNullOrEmpty(sWord) ? sWord : null, flWeight, requiredConfidence); } private CfgGrammar.CfgSerializedHeader BuildHeader(List sortedStates, int cBasePath, ushort iSemanticGlobals, out int cArcs, out float[] pWeights) @@ -776,7 +776,7 @@ private CfgGrammar.CfgSerializedHeader BuildHeader(List sortedStates, int cfgSerializedHeader.cRules = _rules.Count; cfgSerializedHeader.pRules = num3; num3 = (uint)((int)num3 + _rules.Count * Marshal.SizeOf(typeof(CfgRule))); - cfgSerializedHeader.cBasePath = ((cBasePath > 0) ? num3 : 0u); + cfgSerializedHeader.cBasePath = cBasePath > 0 ? num3 : 0u; num3 = (uint)((int)num3 + ((cBasePath * 2 + 3) & -4)); cfgSerializedHeader.cArcs = cArcs; cfgSerializedHeader.pArcs = num3; @@ -801,21 +801,21 @@ private CfgGrammar.CfgSerializedHeader BuildHeader(List sortedStates, int { cfgSerializedHeader.ulRootRuleIndex = uint.MaxValue; } - cfgSerializedHeader.GrammarOptions = (GrammarOptions)((int)_grammarOptions | ((_alphabet != 0) ? 4 : 0)); - cfgSerializedHeader.GrammarOptions |= (GrammarOptions)((_scriptRefs.Count > 0) ? 18 : 0); + cfgSerializedHeader.GrammarOptions = (GrammarOptions)((int)_grammarOptions | (_alphabet != 0 ? 4 : 0)); + cfgSerializedHeader.GrammarOptions |= (GrammarOptions)(_scriptRefs.Count > 0 ? 18 : 0); cfgSerializedHeader.GrammarMode = (uint)_grammarMode; cfgSerializedHeader.cTags = num; cfgSerializedHeader.tags = num3; num3 = (uint)((int)num3 + num * Marshal.SizeOf(typeof(CfgSemanticTag))); cfgSerializedHeader.cScripts = _scriptRefs.Count; - cfgSerializedHeader.pScripts = ((cfgSerializedHeader.cScripts > 0) ? num3 : 0u); + cfgSerializedHeader.pScripts = cfgSerializedHeader.cScripts > 0 ? num3 : 0u; num3 = (uint)((int)num3 + _scriptRefs.Count * Marshal.SizeOf(typeof(CfgScriptRef))); - cfgSerializedHeader.cIL = ((_il != null) ? _il.Length : 0); - cfgSerializedHeader.pIL = ((cfgSerializedHeader.cIL > 0) ? num3 : 0u); + cfgSerializedHeader.cIL = _il != null ? _il.Length : 0; + cfgSerializedHeader.pIL = cfgSerializedHeader.cIL > 0 ? num3 : 0u; num3 = (uint)((int)num3 + cfgSerializedHeader.cIL * Marshal.SizeOf(typeof(byte))); - cfgSerializedHeader.cPDB = ((_pdb != null) ? _pdb.Length : 0); - cfgSerializedHeader.pPDB = ((cfgSerializedHeader.cPDB > 0) ? num3 : 0u); - num3 = (cfgSerializedHeader.ulTotalSerializedSize = (uint)((int)num3 + cfgSerializedHeader.cPDB * Marshal.SizeOf(typeof(byte)))); + cfgSerializedHeader.cPDB = _pdb != null ? _pdb.Length : 0; + cfgSerializedHeader.pPDB = cfgSerializedHeader.cPDB > 0 ? num3 : 0u; + num3 = cfgSerializedHeader.ulTotalSerializedSize = (uint)((int)num3 + cfgSerializedHeader.cPDB * Marshal.SizeOf(typeof(byte))); return cfgSerializedHeader; } @@ -833,9 +833,9 @@ private CfgGrammar.CfgHeader BuildRulesFromBinaryGrammar(CfgGrammar.CfgHeader he { ruleFirstArcs.Add((int)cfgRule.FirstArcIndex, rule); } - rule._fStaticRule = ((!cfgRule.Dynamic) ? true : false); + rule._fStaticRule = !cfgRule.Dynamic ? true : false; rule._cfgRule.DirtyRule = false; - rule._fHasExitPath = (rule._fStaticRule ? true : false); + rule._fHasExitPath = rule._fStaticRule ? true : false; if (firstArcIndex != 0) { rule._firstState.SerializeId = (int)cfgRule.FirstArcIndex; @@ -860,7 +860,7 @@ private CfgGrammar.CfgHeader BuildRulesFromBinaryGrammar(CfgGrammar.CfgHeader he private Rule CloneState(State srcToState, List CloneStack, Dictionary srcToDestHash) { bool flag = false; - string ruleName = (srcToState.Rule.Name.IndexOf("URL:DYNAMIC#", StringComparison.Ordinal) != 0) ? srcToState.Rule.Name : srcToState.Rule.Name.Substring(12); + string ruleName = srcToState.Rule.Name.IndexOf("URL:DYNAMIC#", StringComparison.Ordinal) != 0 ? srcToState.Rule.Name : srcToState.Rule.Name.Substring(12); Rule rule = FindInRules(ruleName); if (rule == null) { @@ -909,9 +909,9 @@ private void ValidateAndTagRules() int num = 0; foreach (Rule rule in _rules) { - rule._fHasExitPath |= ((byte)((rule._cfgRule.Dynamic | rule._cfgRule.Import) ? 1 : 0) != 0); + rule._fHasExitPath |= (byte)(rule._cfgRule.Dynamic | rule._cfgRule.Import ? 1 : 0) != 0; rule._iSerialize = num++; - flag |= (rule._cfgRule.Dynamic || rule._cfgRule.TopLevel || rule._cfgRule.Export); + flag |= rule._cfgRule.Dynamic || rule._cfgRule.TopLevel || rule._cfgRule.Export; rule.Validate(); } foreach (Rule rule2 in _rules) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgArc.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgArc.cs index 90423331b..74bb1a822 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgArc.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgArc.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgGrammar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgGrammar.cs index 1b4eb6509..63ee4bca3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgGrammar.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgGrammar.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -140,7 +140,7 @@ internal CfgSerializedHeader(Stream stream) { BinaryReader binaryReader = new BinaryReader(stream); ulTotalSerializedSize = binaryReader.ReadUInt32(); - if (ulTotalSerializedSize < 100 || ulTotalSerializedSize > int.MaxValue) + if (ulTotalSerializedSize is < 100 or > int.MaxValue) { XmlParser.ThrowSrgsException(SRID.UnsupportedFormat); } @@ -193,7 +193,7 @@ internal static bool IsCfg(Stream stream, out int cfgLength) cfgLength = 0; BinaryReader binaryReader = new BinaryReader(stream); uint num = binaryReader.ReadUInt32(); - if (num < 100 || num > int.MaxValue) + if (num is < 100 or > int.MaxValue) { return false; } @@ -340,7 +340,7 @@ internal static ScriptRef[] LoadIL(Stream stream) internal static bool LoadIL(Stream stream, out byte[] assemblyContent, out byte[] assemblyDebugSymbols, out ScriptRef[] scripts) { - assemblyContent = (assemblyDebugSymbols = null); + assemblyContent = assemblyDebugSymbols = null; scripts = null; using (StreamMarshaler streamMarshaler = new StreamMarshaler(stream)) { @@ -356,7 +356,7 @@ internal static bool LoadIL(Stream stream, out byte[] assemblyContent, out byte[ return false; } assemblyContent = Load(streamMarshaler, cfgSerializedHeader.pIL, cfgSerializedHeader.cIL); - assemblyDebugSymbols = ((cfgSerializedHeader.cPDB > 0) ? Load(streamMarshaler, cfgSerializedHeader.pPDB, cfgSerializedHeader.cPDB) : null); + assemblyDebugSymbols = cfgSerializedHeader.cPDB > 0 ? Load(streamMarshaler, cfgSerializedHeader.pPDB, cfgSerializedHeader.cPDB) : null; } return true; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgRule.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgRule.cs index d050b8deb..ceafa11cc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgRule.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgRule.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -189,12 +189,12 @@ internal CfgRule(int id, int nameOffset, SPCFGRULEATTRIBUTES attributes) _flag = 0u; _nameOffset = nameOffset; _id = id; - TopLevel = ((attributes & SPCFGRULEATTRIBUTES.SPRAF_TopLevel) != 0); - DefaultActive = ((attributes & SPCFGRULEATTRIBUTES.SPRAF_Active) != 0); - PropRule = ((attributes & SPCFGRULEATTRIBUTES.SPRAF_Interpreter) != 0); - Export = ((attributes & SPCFGRULEATTRIBUTES.SPRAF_Export) != 0); - Dynamic = ((attributes & SPCFGRULEATTRIBUTES.SPRAF_Dynamic) != 0); - Import = ((attributes & SPCFGRULEATTRIBUTES.SPRAF_Import) != 0); + TopLevel = (attributes & SPCFGRULEATTRIBUTES.SPRAF_TopLevel) != 0; + DefaultActive = (attributes & SPCFGRULEATTRIBUTES.SPRAF_Active) != 0; + PropRule = (attributes & SPCFGRULEATTRIBUTES.SPRAF_Interpreter) != 0; + Export = (attributes & SPCFGRULEATTRIBUTES.SPRAF_Export) != 0; + Dynamic = (attributes & SPCFGRULEATTRIBUTES.SPRAF_Dynamic) != 0; + Import = (attributes & SPCFGRULEATTRIBUTES.SPRAF_Import) != 0; } } } \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgScriptRef.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgScriptRef.cs index 031c1217b..6e23d8d4c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgScriptRef.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgScriptRef.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgSemanticTag.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgSemanticTag.cs index 4a9d8184b..1c192d102 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgSemanticTag.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CfgSemanticTag.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -158,7 +158,7 @@ internal CfgSemanticTag(CfgSemanticTag cfgTag) internal CfgSemanticTag(StringBlob symbols, CfgGrammar.CfgProperty property) { - _flag1 = (_flag2 = (_flag3 = 0u)); + _flag1 = _flag2 = _flag3 = 0u; _valueOffset = 0; _varInt = 0; _varDouble = 0.0; @@ -189,7 +189,7 @@ internal CfgSemanticTag(StringBlob symbols, CfgGrammar.CfgProperty property) _varInt = (int)property._comValue; break; case VarEnum.VT_BOOL: - _varInt = (((bool)property._comValue) ? 65535 : 0); + _varInt = (bool)property._comValue ? 65535 : 0; break; case VarEnum.VT_R8: _varDouble = (double)property._comValue; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CustomGrammar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CustomGrammar.cs index 734715a97..a16f338ac 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CustomGrammar.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/CustomGrammar.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -196,7 +196,7 @@ private void CreateAssembly(string outputFile, bool debug, List cfg { if (_codebehind.Count > 0) { - int num = _codebehind.Count + ((text != null) ? 1 : 0); + int num = _codebehind.Count + (text != null ? 1 : 0); array = new string[num]; for (int i = 0; i < _codebehind.Count; i++) { @@ -227,7 +227,7 @@ private void CompileScript(string outputFile, bool debug, string code, string[] using (CodeDomProvider codeDomProvider = CodeProvider()) { CompilerParameters compilerParameters = GetCompilerParameters(outputFile, cfgResouces, debug, _assemblyReferences, _keyFile); - CompilerResults compilerResults = (codeFiles == null) ? codeDomProvider.CompileAssemblyFromSource(compilerParameters, code) : codeDomProvider.CompileAssemblyFromFile(compilerParameters, codeFiles); + CompilerResults compilerResults = codeFiles == null ? codeDomProvider.CompileAssemblyFromSource(compilerParameters, code) : codeDomProvider.CompileAssemblyFromFile(compilerParameters, codeFiles); if (compilerResults.Errors.Count > 0) { ThrowCompilationErrors(compilerResults); @@ -383,7 +383,7 @@ private static void WrapClassCSharp(StringBuilder sb, string classname, string b sb.Append("public partial class "); sb.Append(classname); sb.Append(" : "); - sb.Append((!string.IsNullOrEmpty(baseclass)) ? baseclass : "Grammar"); + sb.Append(!string.IsNullOrEmpty(baseclass) ? baseclass : "Grammar"); sb.Append(" \n {\n"); if (culture != null) { @@ -448,7 +448,7 @@ private static void WrapClassVB(StringBuilder sb, string classname, string basec sb.Append("Public Partial class "); sb.Append(classname); sb.Append("\n Inherits "); - sb.Append((!string.IsNullOrEmpty(baseclass)) ? baseclass : "Grammar"); + sb.Append(!string.IsNullOrEmpty(baseclass) ? baseclass : "Grammar"); sb.Append(" \n"); if (culture != null) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Direction.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Direction.cs index 3cd56f588..e0da679bf 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Direction.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Direction.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/GrammarElement.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/GrammarElement.cs index d472bad7b..e2a84a785 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/GrammarElement.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/GrammarElement.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -143,12 +143,12 @@ IRule IGrammar.CreateRule(string id, RulePublic publicRule, RuleDynamic dynamic, SPCFGRULEATTRIBUTES sPCFGRULEATTRIBUTES = (SPCFGRULEATTRIBUTES)0; if (id == _sRoot) { - sPCFGRULEATTRIBUTES |= (SPCFGRULEATTRIBUTES.SPRAF_TopLevel | SPCFGRULEATTRIBUTES.SPRAF_Active | SPCFGRULEATTRIBUTES.SPRAF_Root); + sPCFGRULEATTRIBUTES |= SPCFGRULEATTRIBUTES.SPRAF_TopLevel | SPCFGRULEATTRIBUTES.SPRAF_Active | SPCFGRULEATTRIBUTES.SPRAF_Root; _hasRoot = true; } if (publicRule == RulePublic.True) { - sPCFGRULEATTRIBUTES |= (SPCFGRULEATTRIBUTES.SPRAF_TopLevel | SPCFGRULEATTRIBUTES.SPRAF_Export); + sPCFGRULEATTRIBUTES |= SPCFGRULEATTRIBUTES.SPRAF_TopLevel | SPCFGRULEATTRIBUTES.SPRAF_Export; } if (dynamic == RuleDynamic.True) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/GrammarOptions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/GrammarOptions.cs index 80f6a3859..3623d1d7d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/GrammarOptions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/GrammarOptions.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Graph.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Graph.cs index 4e090d42c..7a4693830 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Graph.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Graph.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -39,7 +39,7 @@ internal void Add(State state) state.Init(); if (_startState == null) { - _curState = (_startState = state); + _curState = _startState = state; } else { @@ -205,7 +205,7 @@ private void MergeDuplicateInputTransitions(ArcList arcs, Stack mergeStat } else { - arc = (flag2 ? null : arc5); + arc = flag2 ? null : arc5; flag = false; } } @@ -289,7 +289,7 @@ private void MergeDuplicateOutputTransitions(ArcList arcs, Stack mergeSta } else { - arc = (flag2 ? null : arc5); + arc = flag2 ? null : arc5; flag = false; } } @@ -391,7 +391,7 @@ internal static bool CanTagsBeMoved(Arc start, Arc end) private static void DeleteTransition(Arc arc) { - State state3 = arc.Start = (arc.End = null); + State state3 = arc.Start = arc.End = null; } private static void MergeIdenticalTransitions(ArcList arcs, List identicalWords) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Item.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Item.cs index 37c801327..e2d941488 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Item.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Item.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -60,7 +60,7 @@ void IElement.PostParse(IElement parentElement) _startArc.End = null; _backend.DeleteSubGraph(end); } - _startArc = (_endArc = _backend.EpsilonTransition(_repeatProbability)); + _startArc = _endArc = _backend.EpsilonTransition(_repeatProbability); } else if (_minRepeat != 1 || _maxRepeat != 1) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/OneOf.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/OneOf.cs index 3bc0d1c82..89d5a8fe9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/OneOf.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/OneOf.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -62,7 +62,7 @@ internal override void AddArc(Arc start, Arc end) end = ParseElementCollection.TrimEnd(end, _backend); State start2 = end.Start; State end2 = start.End; - if ((start.IsEpsilonTransition & start.IsPropertylessTransition) && end2 != null && end2.InArcs.IsEmpty) + if (start.IsEpsilonTransition & start.IsPropertylessTransition && end2 != null && end2.InArcs.IsEmpty) { start.End = null; _backend.MoveOutputTransitionsAndDeleteState(end2, _startState); @@ -71,7 +71,7 @@ internal override void AddArc(Arc start, Arc end) { start.Start = _startState; } - if ((end.IsEpsilonTransition & end.IsPropertylessTransition) && start2 != null && start2.OutArcs.IsEmpty) + if (end.IsEpsilonTransition & end.IsPropertylessTransition && start2 != null && start2.OutArcs.IsEmpty) { end.Start = null; _backend.MoveInputTransitionsAndDeleteState(start2, _endState); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/ParseElement.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/ParseElement.cs index fa239a09e..379706199 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/ParseElement.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/ParseElement.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/ParseElementCollection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/ParseElementCollection.cs index b54e88e38..b36a455e6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/ParseElementCollection.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/ParseElementCollection.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -62,7 +62,7 @@ internal void AddSemanticInterpretationTag(CfgGrammar.CfgProperty propertyInfo) { if (_startArc == null) { - _startArc = (_endArc = _backend.EpsilonTransition(1f)); + _startArc = _endArc = _backend.EpsilonTransition(1f); } _backend.AddSemanticInterpretationTag(_endArc, propertyInfo); } @@ -72,7 +72,7 @@ internal void AddSementicPropertyTag(CfgGrammar.CfgProperty propertyInfo) { if (_startArc == null) { - _startArc = (_endArc = _backend.EpsilonTransition(1f)); + _startArc = _endArc = _backend.EpsilonTransition(1f); } _backend.AddPropertyTag(_startArc, _endArc, propertyInfo); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/PropertyTag.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/PropertyTag.cs index d06bce315..49ae5e311 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/PropertyTag.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/PropertyTag.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Rule.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Rule.cs index fb6c43426..8cc2e1dbb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Rule.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Rule.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -161,7 +161,7 @@ internal Rule Clone(StringBlob symbol, string ruleName) internal void Serialize(StreamMarshaler streamBuffer) { - _cfgRule.FirstArcIndex = (uint)((_firstState != null && !_firstState.OutArcs.IsEmpty) ? _firstState.SerializeId : 0); + _cfgRule.FirstArcIndex = (uint)(_firstState != null && !_firstState.OutArcs.IsEmpty ? _firstState.SerializeId : 0); _cfgRule.DirtyRule = true; streamBuffer.WriteStream(_cfgRule); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/RuleRef.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/RuleRef.cs index 3556f0cdb..2c497e176 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/RuleRef.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/RuleRef.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -68,7 +68,7 @@ internal RuleRef(ParseElementCollection parent, Backend backend, Uri uri, List 0) ? originalString.Substring(0, num) : originalString); + stringBuilder.Append(num > 0 ? originalString.Substring(0, num) : originalString); stringBuilder.Append('>'); stringBuilder.Append(initParameters); if (num > 0) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/RuleScope.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/RuleScope.cs index f40939599..fac965346 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/RuleScope.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/RuleScope.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/SPCFGRULEATTRIBUTES.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/SPCFGRULEATTRIBUTES.cs index 50cd93489..b089ac60e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/SPCFGRULEATTRIBUTES.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/SPCFGRULEATTRIBUTES.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/ScriptRef.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/ScriptRef.cs index 08ba757c8..2dca35a9e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/ScriptRef.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/ScriptRef.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/SemanticTag.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/SemanticTag.cs index d23a90410..ca1d7b7d1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/SemanticTag.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/SemanticTag.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/SrgsCompiler.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/SrgsCompiler.cs index 1fc794d97..5708bdba6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/SrgsCompiler.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/SrgsCompiler.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -85,7 +85,7 @@ private static object CompileStream(int iCfg, ISrgsParser srgsParser, string srg SrgsElementCompilerFactory srgsElementCompilerFactory = (SrgsElementCompilerFactory)(srgsParser.ElementFactory = new SrgsElementCompilerFactory(backend, customGrammar)); srgsParser.Parse(); backend.Optimize(); - culture = ((backend.LangId == 21514) ? new CultureInfo("es-us") : new CultureInfo(backend.LangId)); + culture = backend.LangId == 21514 ? new CultureInfo("es-us") : new CultureInfo(backend.LangId); if (customGrammar._codebehind.Count > 0 && !string.IsNullOrEmpty(srgsPath)) { for (int i = 0; i < customGrammar._codebehind.Count; i++) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/SrgsElementCompilerFactory.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/SrgsElementCompilerFactory.cs index a4b12d4dc..4f49e4e59 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/SrgsElementCompilerFactory.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/SrgsElementCompilerFactory.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -186,7 +186,7 @@ private void ParseToken(ParseElementCollection parent, string sToken, string pro return; } parent._confidence = 0; - if (reqConfidence < 0f || reqConfidence.Equals(0.5f)) + if (reqConfidence is < 0f or 0.5f) { parent._confidence = 0; } @@ -201,10 +201,10 @@ private void ParseToken(ParseElementCollection parent, string sToken, string pro if (pronunciation != null || display != null) { string text = EscapeToken(sToken); - string text2 = (display == null) ? text : EscapeToken(display); + string text2 = display == null ? text : EscapeToken(display); if (pronunciation != null) { - OneOf oneOf = (pronunciation.IndexOf(';') >= 0) ? new OneOf(parent._rule, _backend) : null; + OneOf oneOf = pronunciation.IndexOf(';') >= 0 ? new OneOf(parent._rule, _backend) : null; int num = 0; int num2 = 0; while (num < pronunciation.Length) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/State.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/State.cs index 773628d98..f134b0749 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/State.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/State.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -127,7 +127,7 @@ internal void SerializeStateEntries(StreamMarshaler streamBuffer, bool tagsCanno { List list = _outArcs.ToList(); list.Sort(); - Arc arc = (list.Count > 0) ? list[list.Count - 1] : null; + Arc arc = list.Count > 0 ? list[list.Count - 1] : null; IEnumerator enumerator = ((IEnumerable)list).GetEnumerator(); enumerator.MoveNext(); uint num = (uint)(list.Count + (int)iArcOffset); @@ -201,7 +201,7 @@ internal void Remove() { _next._prev = _prev; } - _next = (_prev = null); + _next = _prev = null; } internal void CheckLeftRecursion(out bool fReachedEndState) @@ -209,7 +209,7 @@ internal void CheckLeftRecursion(out bool fReachedEndState) fReachedEndState = false; if ((_recurseFlag & RecurFlag.RF_IN_LEFT_RECUR_CHECK) != 0) { - XmlParser.ThrowSrgsException(SRID.CircularRuleRef, (_rule != null) ? _rule._rule.Name : string.Empty); + XmlParser.ThrowSrgsException(SRID.CircularRuleRef, _rule != null ? _rule._rule.Name : string.Empty); } else if ((_recurseFlag & RecurFlag.RF_CHECKED_LEFT_RECURSION) == 0) { @@ -255,16 +255,16 @@ private static int Compare(State state1, State state2) { return state1._rule._cfgRule._nameOffset - state2._rule._cfgRule._nameOffset; } - int num = (state1._rule._firstState == state1) ? (-1) : 0; - int num2 = (state2._rule._firstState == state2) ? (-1) : 0; + int num = state1._rule._firstState == state1 ? -1 : 0; + int num2 = state2._rule._firstState == state2 ? -1 : 0; if (num != num2) { return num - num2; } - Arc arc = (state1._outArcs != null && !state1._outArcs.IsEmpty) ? state1._outArcs.First : null; - Arc arc2 = (state2._outArcs != null && !state2._outArcs.IsEmpty) ? state2._outArcs.First : null; - int num3 = ((arc != null) ? (((arc.RuleRef != null) ? 16777216 : 0) + arc.WordId) : state1._iSerialize) - ((arc2 != null) ? (((arc2.RuleRef != null) ? 16777216 : 0) + arc2.WordId) : state2._iSerialize); - return (num3 != 0) ? num3 : (state1._iSerialize - state2._iSerialize); + Arc arc = state1._outArcs != null && !state1._outArcs.IsEmpty ? state1._outArcs.First : null; + Arc arc2 = state2._outArcs != null && !state2._outArcs.IsEmpty ? state2._outArcs.First : null; + int num3 = (arc != null ? (arc.RuleRef != null ? 16777216 : 0) + arc.WordId : state1._iSerialize) - (arc2 != null ? (arc2.RuleRef != null ? 16777216 : 0) + arc2.WordId : state2._iSerialize); + return num3 != 0 ? num3 : state1._iSerialize - state2._iSerialize; } } } \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Subset.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Subset.cs index 237b3fb1f..e1d6787d3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Subset.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Subset.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Tag.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Tag.cs index 716133964..2a4d15834 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Tag.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsCompiler/Tag.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsDocument.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsDocument.cs index ac04f897a..1dbaa29db 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsDocument.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsDocument.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -71,7 +71,7 @@ public SrgsGrammarMode Mode } return SrgsGrammarMode.Voice; } - set => _grammar.Mode = ((value != 0) ? GrammarType.DtmfGrammar : GrammarType.VoiceGrammar); + set => _grammar.Mode = value != 0 ? GrammarType.DtmfGrammar : GrammarType.VoiceGrammar; } public SrgsPhoneticAlphabet PhoneticAlphabet diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsElement.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsElement.cs index 26ed68a0b..af6bbd2d2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsElement.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsElement.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsElementFactory.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsElementFactory.cs index c27b6c45f..761391f65 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsElementFactory.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsElementFactory.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsElementList.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsElementList.cs index 48f5f62e0..5d319f697 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsElementList.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsElementList.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsGrammar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsGrammar.cs index c6d9e63ec..3d22ef3b2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsGrammar.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsGrammar.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -109,7 +109,7 @@ public GrammarType Mode } set { - _mode = ((value != 0) ? SrgsGrammarMode.Dtmf : SrgsGrammarMode.Voice); + _mode = value != 0 ? SrgsGrammarMode.Dtmf : SrgsGrammarMode.Voice; _isModeSet = true; } } @@ -248,7 +248,7 @@ internal void WriteSrgs(XmlWriter writer) } if (_hasPhoneticAlphabetBeenSet || (_phoneticAlphabet != 0 && HasPronunciation)) { - string value = (_phoneticAlphabet == SrgsPhoneticAlphabet.Ipa) ? "ipa" : ((_phoneticAlphabet == SrgsPhoneticAlphabet.Ups) ? "x-microsoft-ups" : "x-microsoft-sapi"); + string value = _phoneticAlphabet == SrgsPhoneticAlphabet.Ipa ? "ipa" : _phoneticAlphabet == SrgsPhoneticAlphabet.Ups ? "x-microsoft-ups" : "x-microsoft-sapi"; writer.WriteAttributeString("sapi", "alphabet", "http://schemas.microsoft.com/Speech/2002/06/SRGSExtensions", value); } if (_xmlBase != null) @@ -282,7 +282,7 @@ internal void Validate() rule.Validate(this); } _isSapiExtensionUsed |= HasPronunciation; - _fContainsCode |= (_language != null || _script.Length > 0 || _usings.Count > 0 || _assemblyReferences.Count > 0 || _codebehind.Count > 0 || _namespace != null || _fDebug); + _fContainsCode |= _language != null || _script.Length > 0 || _usings.Count > 0 || _assemblyReferences.Count > 0 || _codebehind.Count > 0 || _namespace != null || _fDebug; _isSapiExtensionUsed |= _fContainsCode; if (!HasPronunciation) { @@ -314,7 +314,7 @@ IRule IGrammar.CreateRule(string id, RulePublic publicRule, RuleDynamic dynamic, SrgsRule srgsRule = new SrgsRule(id); if (publicRule != RulePublic.NotSet) { - srgsRule.Scope = ((publicRule != 0) ? SrgsRuleScope.Private : SrgsRuleScope.Public); + srgsRule.Scope = publicRule != 0 ? SrgsRuleScope.Private : SrgsRuleScope.Public; } srgsRule.Dynamic = dynamic; return srgsRule; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsGrammarCompiler.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsGrammarCompiler.cs index 50ea6dfce..a6b1638c2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsGrammarCompiler.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsGrammarCompiler.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsGrammarMode.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsGrammarMode.cs index e62d37696..968553c62 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsGrammarMode.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsGrammarMode.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsItem.cs index 840b4d4f2..96eb02af5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsItem.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -98,7 +98,7 @@ public float RepeatProbability get => _repeatProbability; set { - if (value < 0f || value > 1f) + if (value is < 0f or > 1f) { throw new ArgumentOutOfRangeException("value", SR.Get(SRID.InvalidRepeatProbability, value)); } @@ -217,20 +217,20 @@ public SrgsItem(int min, int max, params SrgsElement[] elements) public void SetRepeat(int count) { - if (count < 0 || count > 255) + if (count is < 0 or > 255) { throw new ArgumentOutOfRangeException("count"); } - _minRepeat = (_maxRepeat = count); + _minRepeat = _maxRepeat = count; } public void SetRepeat(int minRepeat, int maxRepeat) { - if (minRepeat < 0 || minRepeat > 255) + if (minRepeat is < 0 or > 255) { throw new ArgumentOutOfRangeException("minRepeat", SR.Get(SRID.InvalidMinRepeat, minRepeat)); } - if (maxRepeat != int.MaxValue && (maxRepeat < 0 || maxRepeat > 255)) + if (maxRepeat != int.MaxValue && maxRepeat is < 0 or > 255) { throw new ArgumentOutOfRangeException("maxRepeat", SR.Get(SRID.InvalidMinRepeat, maxRepeat)); } @@ -269,7 +269,7 @@ internal override void WriteSrgs(XmlWriter writer) })); } } - else if (_maxRepeat == int.MaxValue || _maxRepeat == -1) + else if (_maxRepeat is int.MaxValue or -1) { writer.WriteAttributeString("repeat", string.Format(CultureInfo.InvariantCulture, "{0}-", new object[1] { @@ -278,7 +278,7 @@ internal override void WriteSrgs(XmlWriter writer) } else { - int num = (_minRepeat == -1) ? 1 : _minRepeat; + int num = _minRepeat == -1 ? 1 : _minRepeat; writer.WriteAttributeString("repeat", string.Format(CultureInfo.InvariantCulture, "{0}-{1}", new object[2] { num, @@ -316,7 +316,7 @@ internal override string DebuggerDisplayString() { stringBuilder.Append(_minRepeat.ToString(CultureInfo.InvariantCulture)); } - else if (_maxRepeat == int.MaxValue || _maxRepeat == -1) + else if (_maxRepeat is int.MaxValue or -1) { stringBuilder.Append(string.Format(CultureInfo.InvariantCulture, "{0},-", new object[1] { @@ -325,7 +325,7 @@ internal override string DebuggerDisplayString() } else { - int num = (_minRepeat == -1) ? 1 : _minRepeat; + int num = _minRepeat == -1 ? 1 : _minRepeat; stringBuilder.Append(string.Format(CultureInfo.InvariantCulture, "{0},{1}", new object[2] { num, diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsItemList.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsItemList.cs index c7f9da89f..b90dd3bde 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsItemList.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsItemList.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsNameValueTag.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsNameValueTag.cs index 6021fa018..d535ef2fd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsNameValueTag.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsNameValueTag.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -48,7 +48,7 @@ public object Value set { Helpers.ThrowIfNull(value, "value"); - if (value is string || value is bool || value is int || value is double) + if (value is string or bool or int or double) { _value = value; return; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsOneOf.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsOneOf.cs index 26b49b08c..8041b4c03 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsOneOf.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsOneOf.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsPhoneticAlphabet.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsPhoneticAlphabet.cs index 5f208b7cf..ce8ebb7fc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsPhoneticAlphabet.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsPhoneticAlphabet.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsRule.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsRule.cs index c6b333a37..28b8eb3ae 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsRule.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsRule.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -278,7 +278,7 @@ internal void WriteSrgs(XmlWriter writer) } if (_dynamic != RuleDynamic.NotSet) { - writer.WriteAttributeString("sapi", "dynamic", "http://schemas.microsoft.com/Speech/2002/06/SRGSExtensions", (_dynamic == RuleDynamic.True) ? "true" : "false"); + writer.WriteAttributeString("sapi", "dynamic", "http://schemas.microsoft.com/Speech/2002/06/SRGSExtensions", _dynamic == RuleDynamic.True ? "true" : "false"); } if (OnInit != null) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsRuleRef.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsRuleRef.cs index 55467d8ec..58984cfa6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsRuleRef.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsRuleRef.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsRuleScope.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsRuleScope.cs index f209e2cb1..0411e7914 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsRuleScope.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsRuleScope.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsRulesCollection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsRulesCollection.cs index 533aae741..e480654b4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsRulesCollection.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsRulesCollection.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsSemanticInterpretationTag.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsSemanticInterpretationTag.cs index 8faec99d2..c23cf334b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsSemanticInterpretationTag.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsSemanticInterpretationTag.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsSubset.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsSubset.cs index 44292618e..bca31dac6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsSubset.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsSubset.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsTagFormat.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsTagFormat.cs index f7861b7df..4a32a375b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsTagFormat.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsTagFormat.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsText.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsText.cs index 9fc9367dc..8fddcc285 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsText.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsText.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsToken.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsToken.cs index a99f08af5..f42902500 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsToken.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsGrammar/SrgsToken.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/CreateTokenCallback.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/CreateTokenCallback.cs index 03bc0cbae..3eee85aa9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/CreateTokenCallback.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/CreateTokenCallback.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/GrammarType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/GrammarType.cs index 83a9410ca..43ef99cc1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/GrammarType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/GrammarType.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IElement.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IElement.cs index 29b2eba84..f99a23a4e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IElement.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IElement.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IElementFactory.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IElementFactory.cs index 65dba73e3..169d68a90 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IElementFactory.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IElementFactory.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IElementText.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IElementText.cs index 505460611..198745bf7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IElementText.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IElementText.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IGrammar.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IGrammar.cs index 762a80363..9fc9c81c6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IGrammar.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IGrammar.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IItem.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IItem.cs index eaef0195a..d0d4217fa 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IItem.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IItem.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IOneOf.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IOneOf.cs index 22cc2e19c..88143de2b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IOneOf.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IOneOf.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IPropertyTag.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IPropertyTag.cs index 313a87c58..2954d9cb7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IPropertyTag.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IPropertyTag.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IRule.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IRule.cs index c74b3c88d..3c7eb283e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IRule.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IRule.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IRuleRef.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IRuleRef.cs index f8386def6..dc5ddf958 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IRuleRef.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IRuleRef.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IScript.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IScript.cs index 621c00386..bcb822c18 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IScript.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IScript.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/ISemanticTag.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/ISemanticTag.cs index 188cd23d4..caef66c19 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/ISemanticTag.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/ISemanticTag.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/ISrgsParser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/ISrgsParser.cs index 909248398..9db6b8abe 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/ISrgsParser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/ISrgsParser.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/ISubset.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/ISubset.cs index b74bc8af1..3f37b1c61 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/ISubset.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/ISubset.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IToken.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IToken.cs index 8ac7823dd..86ca7db03 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IToken.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/IToken.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/MatchMode.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/MatchMode.cs index 39f0f438b..993664297 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/MatchMode.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/MatchMode.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/RuleDynamic.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/RuleDynamic.cs index d0253f858..2ed5bb7e5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/RuleDynamic.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/RuleDynamic.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/RuleMethodScript.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/RuleMethodScript.cs index 56fbae3f9..3a0dc6df3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/RuleMethodScript.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/RuleMethodScript.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/RulePublic.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/RulePublic.cs index 9d16a4f28..4dee4c8fa 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/RulePublic.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/RulePublic.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/SrgsDocumentParser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/SrgsDocumentParser.cs index 0902c3752..490fa41be 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/SrgsDocumentParser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/SrgsDocumentParser.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -78,7 +78,7 @@ private void ProcessGrammarElement(SrgsGrammar.SrgsGrammar source, IGrammar gram grammar.CodeBehind = source.CodeBehind; grammar.Debug = source.Debug; grammar.ImportNamespaces = source.ImportNamespaces; - grammar.Language = ((source.Language == null) ? "C#" : source.Language); + grammar.Language = source.Language == null ? "C#" : source.Language; grammar.Namespace = source.Namespace; _parser.AddScript(grammar, source.Script, null, -1); grammar.PostParse(null); @@ -88,7 +88,7 @@ private IRule ParseRule(IGrammar grammar, SrgsRule srgsRule) { string id = srgsRule.Id; bool hasSCript = srgsRule.OnInit != null || srgsRule.OnParse != null || srgsRule.OnError != null || srgsRule.OnRecognition != null; - IRule rule = grammar.CreateRule(id, (srgsRule.Scope != 0) ? RulePublic.False : RulePublic.True, srgsRule.Dynamic, hasSCript); + IRule rule = grammar.CreateRule(id, srgsRule.Scope != 0 ? RulePublic.False : RulePublic.True, srgsRule.Dynamic, hasSCript); if (srgsRule.OnInit != null) { rule.CreateScript(grammar, id, srgsRule.OnInit, RuleMethodScript.onInit); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/XmlParser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/XmlParser.cs index b8f205b20..de0f343c8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/XmlParser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/SrgsParser/XmlParser.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -92,7 +92,7 @@ public IElementFactory ElementFactory internal XmlParser(XmlReader reader, Uri uri) { _reader = reader; - _xmlTextReader = (reader as XmlTextReader); + _xmlTextReader = reader as XmlTextReader; if (uri == null && _xmlTextReader != null && _xmlTextReader.BaseURI.Length > 0) { try @@ -105,9 +105,9 @@ internal XmlParser(XmlReader reader, Uri uri) } if (uri != null) { - _filename = ((!uri.IsAbsoluteUri || !uri.IsFile) ? uri.OriginalString : uri.LocalPath); + _filename = !uri.IsAbsoluteUri || !uri.IsFile ? uri.OriginalString : uri.LocalPath; int num = _filename.LastIndexOfAny(_SlashBackSlash); - _shortFilename = ((num >= 0) ? _filename.Substring(num + 1) : _filename); + _shortFilename = num >= 0 ? _filename.Substring(num + 1) : _filename; } } @@ -215,7 +215,7 @@ internal static void ThrowSrgsExceptionWithPosition(string filename, XmlReader x string text2 = SR.Get(SRID.Position); int lineNumber = xmlTextReader.LineNumber; int linePosition = xmlTextReader.LinePosition; - sError = ((filename != null) ? string.Format(CultureInfo.InvariantCulture, "{0}({1},{2}): error : {3}", filename, lineNumber, linePosition, sError) : (sError + string.Format(CultureInfo.InvariantCulture, " [{0}={1}, {2}={3}]", text, lineNumber, text2, linePosition))); + sError = filename != null ? string.Format(CultureInfo.InvariantCulture, "{0}({1},{2}): error : {3}", filename, lineNumber, linePosition, sError) : sError + string.Format(CultureInfo.InvariantCulture, " [{0}={1}, {2}={3}]", text, lineNumber, text2, linePosition); } throw new FormatException(sError, innerException); } @@ -263,7 +263,7 @@ private void ParseGrammar(XmlReader reader, IGrammar grammar) break; case "language": CheckForDuplicates(ref dest2, reader); - if (dest2 == "C#" || dest2 == "VB.Net") + if (dest2 is "C#" or "VB.Net") { grammar.Language = dest2; } @@ -317,7 +317,7 @@ private void ParseGrammar(XmlReader reader, IGrammar grammar) string value = reader.Value; try { - grammar.Culture = (_langId = new CultureInfo(value)); + grammar.Culture = _langId = new CultureInfo(value); } catch (ArgumentException) { @@ -326,7 +326,7 @@ private void ParseGrammar(XmlReader reader, IGrammar grammar) { throw; } - grammar.Culture = (_langId = new CultureInfo(reader.Value.Substring(0, num))); + grammar.Culture = _langId = new CultureInfo(reader.Value.Substring(0, num)); } } } @@ -1005,7 +1005,7 @@ private static void ParseMeta(XmlReader reader) private void ParseScript(XmlReader reader, IGrammar grammar) { - int line = (_filename != null) ? _xmlTextReader.LineNumber : (-1); + int line = _filename != null ? _xmlTextReader.LineNumber : -1; string text = null; while (reader.MoveToNextAttribute()) { @@ -1128,7 +1128,7 @@ private bool ProcessChildNodes(XmlReader reader, IElement parent, IRule rule, st namespaceURI = reader.LocalName; if (namespaceURI == "subset") { - if (parent is IRule || parent is IItem) + if (parent is IRule or IItem) { element = ParseSubset(parent, reader); } @@ -1193,7 +1193,7 @@ private bool ProcessChildNodes(XmlReader reader, IElement parent, IRule rule, st flag2 = ParseChildNodeElement(parent, flag2, element); flag = false; } - else if (reader.NodeType == XmlNodeType.Text || reader.NodeType == XmlNodeType.CDATA) + else if (reader.NodeType is XmlNodeType.Text or XmlNodeType.CDATA) { if (parent == null) { @@ -1415,7 +1415,7 @@ private static string GetStringContent(XmlReader reader) if (reader.NodeType == XmlNodeType.Element) { string namespaceURI = reader.NamespaceURI; - if (namespaceURI == "http://www.w3.org/2001/06/grammar" || namespaceURI == "http://schemas.microsoft.com/Speech/2002/06/SRGSExtensions") + if (namespaceURI is "http://www.w3.org/2001/06/grammar" or "http://schemas.microsoft.com/Speech/2002/06/SRGSExtensions") { flag = true; } @@ -1492,18 +1492,18 @@ private static void ParsePropertyTag(string sTag, out string name, out object va private static void SetRepeatValues(string repeat, out int minRepeat, out int maxRepeat) { - minRepeat = (maxRepeat = 1); + minRepeat = maxRepeat = 1; if (!string.IsNullOrEmpty(repeat)) { int num = repeat.IndexOf("-", StringComparison.Ordinal); if (num < 0) { int num2 = Convert.ToInt32(repeat, CultureInfo.InvariantCulture); - if (num2 < 0 || num2 > 255) + if (num2 is < 0 or > 255) { ThrowSrgsException(SRID.MinMaxOutOfRange, num2, num2); } - minRepeat = (maxRepeat = num2); + minRepeat = maxRepeat = num2; } else if (0 < num) { @@ -1516,7 +1516,7 @@ private static void SetRepeatValues(string repeat, out int minRepeat, out int ma { maxRepeat = int.MaxValue; } - if (minRepeat < 0 || minRepeat > 255 || (maxRepeat != int.MaxValue && (maxRepeat < 0 || maxRepeat > 255))) + if (minRepeat < 0 || minRepeat > 255 || (maxRepeat != int.MaxValue && maxRepeat is < 0 or > 255)) { ThrowSrgsException(SRID.MinMaxOutOfRange, minRepeat, maxRepeat); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/BookmarkReachedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/BookmarkReachedEventArgs.cs index df6cdfc0c..fe0945553 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/BookmarkReachedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/BookmarkReachedEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/FilePrompt.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/FilePrompt.cs index 187144334..150ae3b93 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/FilePrompt.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/FilePrompt.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/InstalledVoice.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/InstalledVoice.cs index 56c5a28c3..b8c4dfe27 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/InstalledVoice.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/InstalledVoice.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PhonemeReachedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PhonemeReachedEventArgs.cs index 7d1eee515..f3b68353a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PhonemeReachedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PhonemeReachedEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/Prompt.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/Prompt.cs index 4c854f963..563708a12 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/Prompt.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/Prompt.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptBreak.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptBreak.cs index 66c504b2f..d082971fa 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptBreak.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptBreak.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptBuilder.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptBuilder.cs index bc805fda4..9420657a4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptBuilder.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptBuilder.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -197,7 +197,7 @@ public void AppendText(string textToSpeak) public void AppendText(string textToSpeak, PromptRate rate) { Helpers.ThrowIfNull(textToSpeak, "textToSpeak"); - if (rate < PromptRate.NotSet || rate > PromptRate.ExtraSlow) + if (rate is < PromptRate.NotSet or > PromptRate.ExtraSlow) { throw new ArgumentOutOfRangeException("rate"); } @@ -229,7 +229,7 @@ public void AppendText(string textToSpeak, PromptRate rate) public void AppendText(string textToSpeak, PromptVolume volume) { Helpers.ThrowIfNull(textToSpeak, "textToSpeak"); - if (volume < PromptVolume.NotSet || volume > PromptVolume.Default) + if (volume is < PromptVolume.NotSet or > PromptVolume.Default) { throw new ArgumentOutOfRangeException("volume"); } @@ -261,7 +261,7 @@ public void AppendText(string textToSpeak, PromptVolume volume) public void AppendText(string textToSpeak, PromptEmphasis emphasis) { Helpers.ThrowIfNull(textToSpeak, "textToSpeak"); - if (emphasis < PromptEmphasis.NotSet || emphasis > PromptEmphasis.Reduced) + if (emphasis is < PromptEmphasis.NotSet or > PromptEmphasis.Reduced) { throw new ArgumentOutOfRangeException("emphasis"); } @@ -339,7 +339,7 @@ public void StartStyle(PromptStyle style) } element2._attributes.Add(new AttributeItem("volume", value2)); } - possibleChildren = (SsmlElement.Voice | SsmlElement.Audio | SsmlElement.Sentence | SsmlElement.Paragraph | SsmlElement.SayAs | SsmlElement.Phoneme | SsmlElement.Sub | SsmlElement.Emphasis | SsmlElement.Break | SsmlElement.Prosody | SsmlElement.Mark | SsmlElement.Text | SsmlElement.PromptEngineOutput); + possibleChildren = SsmlElement.Voice | SsmlElement.Audio | SsmlElement.Sentence | SsmlElement.Paragraph | SsmlElement.SayAs | SsmlElement.Phoneme | SsmlElement.Sub | SsmlElement.Emphasis | SsmlElement.Break | SsmlElement.Prosody | SsmlElement.Mark | SsmlElement.Text | SsmlElement.PromptEngineOutput; ssmlState |= SsmlState.StyleProsody; } _elementStack.Push(new StackElement(possibleChildren, ssmlState, stackElement._culture)); @@ -375,7 +375,7 @@ public void StartVoice(VoiceInfo voice) } StackElement stackElement = _elementStack.Peek(); ValidateElement(stackElement, SsmlElement.Voice); - CultureInfo culture = (voice.Culture == null) ? stackElement._culture : voice.Culture; + CultureInfo culture = voice.Culture == null ? stackElement._culture : voice.Culture; Element element = new Element(ElementType.StartVoice); element._attributes = new Collection(); _elements.Add(element); @@ -512,7 +512,7 @@ public void EndSentence() public void AppendTextWithHint(string textToSpeak, SayAs sayAs) { Helpers.ThrowIfNull(textToSpeak, "textToSpeak"); - if (sayAs < SayAs.SpellOut || sayAs > SayAs.Text) + if (sayAs is < SayAs.SpellOut or > SayAs.Text) { throw new ArgumentOutOfRangeException("sayAs"); } @@ -835,7 +835,7 @@ private void WriteXml(XmlTextWriter writer) bool flag = false; foreach (Element element in _elements) { - flag = (flag || element._type == ElementType.StartSentence || element._type == ElementType.StartParagraph || element._type == ElementType.StartStyle || element._type == ElementType.StartVoice); + flag = flag || element._type == ElementType.StartSentence || element._type == ElementType.StartParagraph || element._type == ElementType.StartStyle || element._type == ElementType.StartVoice; switch (element._type) { case ElementType.Text: diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptEmphasis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptEmphasis.cs index ed513fdf4..163f886ad 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptEmphasis.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptEmphasis.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptEventArgs.cs index 8160ab960..c0106095b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptPriority.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptPriority.cs index d1fbc02b7..fc4be21f2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptPriority.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptPriority.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptRate.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptRate.cs index cd9903c42..3025c45f3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptRate.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptRate.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptStyle.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptStyle.cs index 4a70e0d2e..771fd786e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptStyle.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptStyle.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptVolume.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptVolume.cs index 8648b797b..419871929 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptVolume.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/PromptVolume.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SayAs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SayAs.cs index 896ac731c..9e1ea8ec1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SayAs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SayAs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SpeakCompletedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SpeakCompletedEventArgs.cs index ddfbc1bf2..cd1b9685f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SpeakCompletedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SpeakCompletedEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SpeakProgressEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SpeakProgressEventArgs.cs index 973723473..ec613892f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SpeakProgressEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SpeakProgressEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SpeakStartedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SpeakStartedEventArgs.cs index 03ca389e2..9b91ed34a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SpeakStartedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SpeakStartedEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SpeechSynthesizer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SpeechSynthesizer.cs index 53a3e73c2..061cef578 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SpeechSynthesizer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SpeechSynthesizer.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -48,7 +48,7 @@ public int Rate get => VoiceSynthesizer.Rate; set { - if (value < -10 || value > 10) + if (value is < -10 or > 10) { throw new ArgumentOutOfRangeException("value", SR.Get(SRID.RateOutOfRange)); } @@ -62,7 +62,7 @@ public int Volume get => VoiceSynthesizer.Volume; set { - if (value < 0 || value > 100) + if (value is < 0 or > 100) { throw new ArgumentOutOfRangeException("value", SR.Get(SRID.ResourceUsageOutOfRange)); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/StateChangedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/StateChangedEventArgs.cs index 63bdc1adc..000353729 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/StateChangedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/StateChangedEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SynthesisMediaType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SynthesisMediaType.cs index 88329492c..178162b67 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SynthesisMediaType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SynthesisMediaType.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SynthesisTextFormat.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SynthesisTextFormat.cs index 23e0d09de..2115eb69f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SynthesisTextFormat.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SynthesisTextFormat.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SynthesizerEmphasis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SynthesizerEmphasis.cs index 70d3cc41b..68f090bbe 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SynthesizerEmphasis.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SynthesizerEmphasis.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SynthesizerState.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SynthesizerState.cs index bb7b934d3..85745e3be 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SynthesizerState.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/SynthesizerState.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VisemeReachedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VisemeReachedEventArgs.cs index a67800091..9c6cac7df 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VisemeReachedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VisemeReachedEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VoiceAge.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VoiceAge.cs index fab402a38..d5cb28ef1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VoiceAge.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VoiceAge.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VoiceChangeEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VoiceChangeEventArgs.cs index 5394b4d27..9f204162f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VoiceChangeEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VoiceChangeEventArgs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VoiceGender.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VoiceGender.cs index 9a63ddf7c..c3a7f7b85 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VoiceGender.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VoiceGender.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VoiceInfo.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VoiceInfo.cs index 2249bef10..297991e76 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VoiceInfo.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Common/VoiceInfo.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioBase.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioBase.cs index 7ab418531..7d07dab11 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioBase.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioBase.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioCodec.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioCodec.cs index 69f6184e9..908544672 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioCodec.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioCodec.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioData.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioData.cs index a250c0eee..1a0746122 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioData.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioData.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioDeviceOut.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioDeviceOut.cs index 47c1e7c09..a871e27d6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioDeviceOut.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioDeviceOut.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioException.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioException.cs index 8bcc7b7cb..7d232e632 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioException.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioException.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioFileOut.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioFileOut.cs index f7b4fba2e..fe2b371aa 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioFileOut.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioFileOut.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioFormatConverter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioFormatConverter.cs index d7da947b1..1eebb6ee8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioFormatConverter.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/AudioFormatConverter.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -1050,7 +1050,7 @@ internal static AudioCodec TypeOf(WAVEFORMATEX format) internal static byte[] ConvertLinear2ULaw(short[] data, int size) { byte[] array = new byte[size]; - _uLawCompTableCached = ((_uLawCompTableCached == null) ? CalcLinear2ULawTable() : _uLawCompTableCached); + _uLawCompTableCached = _uLawCompTableCached == null ? CalcLinear2ULawTable() : _uLawCompTableCached; for (int i = 0; i < size; i++) { array[i] = _uLawCompTableCached[(ushort)data[i] >> 2]; @@ -1089,7 +1089,7 @@ private static byte[] CalcLinear2ULawTable() num2 += 132; int num4 = exp_lut_linear2ulaw[(num2 >> 7) & 0xFF]; int num5 = (num2 >> num4 + 3) & 0xF; - byte b = (byte)(~(num3 | (num4 << 4) | num5)); + byte b = (byte)~(num3 | (num4 << 4) | num5); if (flag && b == 0) { b = 2; @@ -1102,7 +1102,7 @@ private static byte[] CalcLinear2ULawTable() internal static byte[] ConvertLinear2ALaw(short[] data, int size) { byte[] array = new byte[size]; - _aLawCompTableCached = ((_aLawCompTableCached == null) ? CalcLinear2ALawTable() : _aLawCompTableCached); + _aLawCompTableCached = _aLawCompTableCached == null ? CalcLinear2ALawTable() : _aLawCompTableCached; for (int i = 0; i < size; i++) { array[i] = _aLawCompTableCached[(ushort)data[i] >> 2]; @@ -1148,7 +1148,7 @@ private static byte[] CalcLinear2ALawTable() { b = (byte)(num2 >> 4); } - b = (array[i >> 2] = (byte)(b ^ (byte)(num3 ^ 0x55))); + b = array[i >> 2] = (byte)(b ^ (byte)(num3 ^ 0x55)); } return array; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ConvertTextFrag.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ConvertTextFrag.cs index e67da59bd..f8f50ae45 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ConvertTextFrag.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ConvertTextFrag.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -99,8 +99,8 @@ internal static bool ToSapi(List ssmlFrags, ref GCHandle sapiFragL if (textFragment.State.Action != TtsEngineAction.StartParagraph && textFragment.State.Action != TtsEngineAction.StartSentence) { SPVTEXTFRAG sPVTEXTFRAG = new SPVTEXTFRAG(); - sPVTEXTFRAG.gcNext = (flag ? default(GCHandle) : sapiFragLast); - sPVTEXTFRAG.pNext = (flag ? IntPtr.Zero : sapiFragLast.AddrOfPinnedObject()); + sPVTEXTFRAG.gcNext = flag ? default(GCHandle) : sapiFragLast; + sPVTEXTFRAG.pNext = flag ? IntPtr.Zero : sapiFragLast.AddrOfPinnedObject(); sPVTEXTFRAG.gcText = GCHandle.Alloc(textFragment.TextToSpeak, GCHandleType.Pinned); sPVTEXTFRAG.pTextStart = sPVTEXTFRAG.gcText.AddrOfPinnedObject(); sPVTEXTFRAG.ulTextSrcOffset = textFragment.TextOffset; @@ -109,7 +109,7 @@ internal static bool ToSapi(List ssmlFrags, ref GCHandle sapiFragL FragmentState state2 = textFragment.State; state.eAction = (SPVACTIONS)state2.Action; state.LangID = (short)state2.LangId; - state.EmphAdj = ((state2.Emphasis == 1) ? 1 : 0); + state.EmphAdj = state2.Emphasis == 1 ? 1 : 0; if (state2.Prosody != null) { state.RateAdj = SapiRate(state2.Prosody.Rate); @@ -172,7 +172,7 @@ internal static bool ToSapi(List ssmlFrags, ref GCHandle sapiFragL private static IntPtr SapiCategory(SPVTEXTFRAG sapiFrag, string interpretAs, string format) { int num = Array.BinarySearch(_asSayAsFormat, interpretAs); - string value = (num >= 0) ? _asContextFormat[num] : format; + string value = num >= 0 ? _asContextFormat[num] : format; sapiFrag.gcSayAsCategory = GCHandle.Alloc(value, GCHandleType.Pinned); return sapiFrag.gcSayAsCategory.AddrOfPinnedObject(); } @@ -222,7 +222,7 @@ private static int SapiVolume(ProsodyNumber volume) num = 0; break; } - num = (int)((double)(volume.IsNumberPercent ? ((float)num * volume.Number) : volume.Number) + 0.5); + num = (int)((double)(volume.IsNumberPercent ? (float)num * volume.Number : volume.Number) + 0.5); } else { @@ -270,7 +270,7 @@ private static int SapiSilence(int duration, EmphasisBreak emphasis) break; } } - if (num < 0 || num > 65535) + if (num is < 0 or > 65535) { num = 1000; } @@ -334,7 +334,7 @@ private static int SapiPitch(ProsodyNumber pitch) num = -9; break; } - num = (int)((double)(pitch.IsNumberPercent ? ((float)num * pitch.Number) : pitch.Number) + 0.5); + num = (int)((double)(pitch.IsNumberPercent ? (float)num * pitch.Number : pitch.Number) + 0.5); } if (num > 10) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/EngineSite.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/EngineSite.cs index c84244efa..cc35737ce 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/EngineSite.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/EngineSite.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -221,7 +221,7 @@ internal void InitRun(AudioBase audioDevice, int defaultRate, Prompt prompt) _audio = audioDevice; _prompt = prompt; _defaultRate = defaultRate; - _actions = (SPVESACTIONS.SPVES_RATE | SPVESACTIONS.SPVES_VOLUME); + _actions = SPVESACTIONS.SPVES_RATE | SPVESACTIONS.SPVES_VOLUME; } private TTSEvent CreateTtsEvent(SpeechEventInfo sapiEvent) diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/EngineSiteSapi.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/EngineSiteSapi.cs index 7b066d601..96f4076ac 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/EngineSiteSapi.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/EngineSiteSapi.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ISpEngineSite.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ISpEngineSite.cs index 8f669a172..31375afa5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ISpEngineSite.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ISpEngineSite.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ISsmlParser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ISsmlParser.cs index d4b2c64c1..df1fadce0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ISsmlParser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ISsmlParser.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ITtsEngineProxy.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ITtsEngineProxy.cs index 78648ece2..a9744b2e5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ITtsEngineProxy.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ITtsEngineProxy.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ITtsEventSink.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ITtsEventSink.cs index e9cf5bfd9..a670843bb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ITtsEventSink.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/ITtsEventSink.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/LexiconEntry.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/LexiconEntry.cs index c4e64e310..b5fdeb437 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/LexiconEntry.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/LexiconEntry.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/MMSYSERR.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/MMSYSERR.cs index a30fe5586..f042e00d0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/MMSYSERR.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/MMSYSERR.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/MM_MSG.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/MM_MSG.cs index f604b3785..ab3b2d632 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/MM_MSG.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/MM_MSG.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/PcmConverter.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/PcmConverter.cs index 8f50335e8..653e95503 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/PcmConverter.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/PcmConverter.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -261,7 +261,7 @@ private void CreateResamplingFilter(int inHz, int outHz) throw new ArgumentOutOfRangeException("outHz"); } FindResampleFactors(inHz, outHz); - int num = (_iUpFactor > _iDownFactor) ? _iUpFactor : _iDownFactor; + int num = _iUpFactor > _iDownFactor ? _iUpFactor : _iDownFactor; _iFilterHalf = (int)((float)(inHz * num) * 0.0005f); _iFilterLen = 2 * _iFilterHalf + 1; _filterCoeff = WindowedLowPass(0.5f / (float)num, _iUpFactor); @@ -376,7 +376,7 @@ private static float[] Blackman(int iLength, bool bSymmetric) { float[] array = new float[iLength]; double num = Math.PI * 2.0; - num = ((!bSymmetric) ? (num / (double)(float)iLength) : (num / (double)(float)(iLength - 1))); + num = !bSymmetric ? num / (double)(float)iLength : num / (double)(float)(iLength - 1); double num2 = 2.0 * num; for (int i = 0; i < iLength; i++) { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/PhonemeEventMapper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/PhonemeEventMapper.cs index 917ed03a2..b84f220f1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/PhonemeEventMapper.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/PhonemeEventMapper.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -132,7 +132,7 @@ private void ConvertCompleteUnit() char[] array = new char[_lastComplete]; _phonemes.CopyTo(0, array, 0, _lastComplete); _phonemes.Remove(0, _lastComplete); - char[] value = (_conversion != 0) ? _alphabetConverter.SapiToIpa(array) : _alphabetConverter.IpaToSapi(array); + char[] value = _conversion != 0 ? _alphabetConverter.SapiToIpa(array) : _alphabetConverter.IpaToSapi(array); TTSEvent tTSEvent = null; long num = 0L; tTSEvent = (TTSEvent)_phonemeQueue.Peek(); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SafeNativeMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SafeNativeMethods.cs index 424dffb55..6fb7c1c56 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SafeNativeMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SafeNativeMethods.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SpeakInfo.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SpeakInfo.cs index ff7f1b4bb..2f7235e1c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SpeakInfo.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SpeakInfo.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SpeechEventSapi.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SpeechEventSapi.cs index 7ba0bf47b..a1250012f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SpeechEventSapi.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SpeechEventSapi.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SpeechSeg.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SpeechSeg.cs index 33edca50b..6ab071ee8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SpeechSeg.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SpeechSeg.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SsmlElement.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SsmlElement.cs index 92a446c77..f1dee3aff 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SsmlElement.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SsmlElement.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SsmlParser.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SsmlParser.cs index 7115cdbe4..fa1f852dc 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SsmlParser.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SsmlParser.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -593,7 +593,7 @@ private static void ParseBreak(XmlReader reader, ISsmlParser engine, SsmlElement CheckForDuplicates(ref dest, reader); ssmlAttributes._fragmentState.Emphasis = -1; ssmlAttributes._fragmentState.Duration = ParseCSS2Time(dest); - flag = (ssmlAttributes._fragmentState.Duration < 0); + flag = ssmlAttributes._fragmentState.Duration < 0; } } if (flag && !ssmlAttributes.AddUnknowAttribute(reader, ref extraAttributes)) @@ -631,7 +631,7 @@ private static void ParseDesc(XmlReader reader, ISsmlParser engine, SsmlElement { flag = true; } - flag = (flag && cultureInfo != null); + flag = flag && cultureInfo != null; } else { @@ -743,7 +743,7 @@ private static void ParseMetaData(XmlReader reader, ISsmlParser engine, SsmlElem { num++; } - if (reader.NodeType == XmlNodeType.EndElement || reader.NodeType == XmlNodeType.None) + if (reader.NodeType is XmlNodeType.EndElement or XmlNodeType.None) { num--; } @@ -923,7 +923,7 @@ private static void ParseProsody(XmlReader reader, ISsmlParser engine, SsmlEleme string attribute3 = null; string dest2 = null; string attribute4 = null; - Prosody prosody = (ssmlAttributes._fragmentState.Prosody != null) ? ssmlAttributes._fragmentState.Prosody.Clone() : new Prosody(); + Prosody prosody = ssmlAttributes._fragmentState.Prosody != null ? ssmlAttributes._fragmentState.Prosody.Clone() : new Prosody(); while (reader.MoveToNextAttribute()) { bool flag = reader.NamespaceURI.Length != 0; @@ -1199,7 +1199,7 @@ private static void ParseVoice(XmlReader reader, ISsmlParser engine, SsmlElement { ThrowFormatException(SRID.MissingRequiredAttribute, "'xml:lang' or 'gender' or 'age' or 'variant' or 'name'", "voice"); } - cultureInfo = ((cultureInfo == null) ? new CultureInfo(ssmlAttributes._fragmentState.LangId) : cultureInfo); + cultureInfo = cultureInfo == null ? new CultureInfo(ssmlAttributes._fragmentState.LangId) : cultureInfo; bool fNewCulture = cultureInfo.LCID != ssmlAttributes._fragmentState.LangId; ssmlAttributes._voice = engine.ProcessVoice(dest4, cultureInfo, ssmlAttributes._gender, ssmlAttributes._age, result, fNewCulture, list2); ssmlAttributes._fragmentState.LangId = cultureInfo.LCID; @@ -1420,11 +1420,11 @@ private static int ParseCSS2Time(string time) float result2; if (num > 0 && time.Length == num + 2) { - result = (float.TryParse(time.Substring(0, num), out result2) ? ((int)((double)result2 + 0.5)) : (-1)); + result = float.TryParse(time.Substring(0, num), out result2) ? (int)((double)result2 + 0.5) : -1; } else if ((num = time.IndexOf('s')) > 0 && time.Length == num + 1) { - result = (float.TryParse(time.Substring(0, num), out result2) ? ((int)(result2 * 1000f)) : (-1)); + result = float.TryParse(time.Substring(0, num), out result2) ? (int)(result2 * 1000f) : -1; } return result; } @@ -1466,7 +1466,7 @@ private static ContourPoint[] ParseContour(string contour) } if (number.Number >= 0f && number.Number <= 1f) { - list.Add(new ContourPoint(number.Number, number2.Number, (!isHz) ? ContourPointChangeType.Percentage : ContourPointChangeType.Hz)); + list.Add(new ContourPoint(number.Number, number2.Number, !isHz ? ContourPointChangeType.Percentage : ContourPointChangeType.Hz)); } num = num3; } @@ -1495,7 +1495,7 @@ private static int NextChar(char[] ach, int start, char expected, bool skipDigit } if (skipDigit) { - while (start < ach.Length && ach[start] != expected && ((percent = (ach[start] == '%')) || char.IsDigit(ach[start]) || ach[start] == 'H' || ach[start] == 'z' || ach[start] == '.' || ach[start] == '+' || ach[start] == '-')) + while (start < ach.Length && ach[start] != expected && ((percent = ach[start] == '%') || char.IsDigit(ach[start]) || ach[start] == 'H' || ach[start] == 'z' || ach[start] == '.' || ach[start] == '+' || ach[start] == '-')) { start++; } @@ -1617,12 +1617,12 @@ private static bool TryParseHz(string sNumber, ref ProsodyNumber number, bool ac } if (prosodyUnit != 0) { - flag = (TryParseNumber(sNumber.Substring(0, sNumber.Length - 2), ref number) && (acceptHzRelative || number.SsmlAttributeId == int.MaxValue)); + flag = TryParseNumber(sNumber.Substring(0, sNumber.Length - 2), ref number) && (acceptHzRelative || number.SsmlAttributeId == int.MaxValue); isHz = true; } else { - flag = (TryParseNumber(sNumber, ref number) && number.SsmlAttributeId == int.MaxValue); + flag = TryParseNumber(sNumber, ref number) && number.SsmlAttributeId == int.MaxValue; } return flag; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SsmlParserHelpers.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SsmlParserHelpers.cs index 60217fc39..32185b124 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SsmlParserHelpers.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SsmlParserHelpers.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SsmlXmlAttribute.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SsmlXmlAttribute.cs index 64ab9ea04..f8ecbef82 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SsmlXmlAttribute.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/SsmlXmlAttribute.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TTSEvent.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TTSEvent.cs index 69b700231..7937d18f7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TTSEvent.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TTSEvent.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TTSVoice.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TTSVoice.cs index 7963fdf2f..54f51d294 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TTSVoice.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TTSVoice.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -104,7 +104,7 @@ internal byte[] WaveFormat(byte[] targetWaveFormat) } try { - intPtr = _engine.GetOutputFormat((targetWaveFormat != null) ? gCHandle.AddrOfPinnedObject() : IntPtr.Zero); + intPtr = _engine.GetOutputFormat(targetWaveFormat != null ? gCHandle.AddrOfPinnedObject() : IntPtr.Zero); } finally { diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TextFragmentEngine.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TextFragmentEngine.cs index fe75f0ea1..d41a9964f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TextFragmentEngine.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TextFragmentEngine.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TextWriterEngine.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TextWriterEngine.cs index 0e41b6da2..0b7f798a4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TextWriterEngine.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TextWriterEngine.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -57,7 +57,7 @@ public object ProcessSpeak(string sVersion, string baseUri, CultureInfo culture, if ((culture != null && !culture.Equals(_culture)) || !string.IsNullOrEmpty(_pexmlPrefix) || extraNamespace.Count > 0) { _writer.WriteStartElement("voice"); - _writer.WriteAttributeString("xml", "lang", null, (culture != null) ? culture.Name : _culture.Name); + _writer.WriteAttributeString("xml", "lang", null, culture != null ? culture.Name : _culture.Name); foreach (SsmlXmlAttribute item in extraNamespace) { _writer.WriteAttributeString("xmlns", item._name, item._ns, item._value); @@ -161,7 +161,7 @@ public void ProcessPhoneme(ref FragmentState fragmentState, AlphabetType alphabe _writer.WriteStartElement("phoneme"); if (alphabet != AlphabetType.Ipa) { - _writer.WriteAttributeString("alphabet", (alphabet == AlphabetType.Sapi) ? "x-microsoft-sapi" : "x-microsoft-ups"); + _writer.WriteAttributeString("alphabet", alphabet == AlphabetType.Sapi ? "x-microsoft-sapi" : "x-microsoft-ups"); } _writer.WriteAttributeString("ph", ph); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TtsEventMapper.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TtsEventMapper.cs index 1feb4affe..f974a75d1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TtsEventMapper.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TtsEventMapper.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TtsProxyCom.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TtsProxyCom.cs index 154921655..7f035ffd9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TtsProxyCom.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TtsProxyCom.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -46,7 +46,7 @@ internal TtsProxyCom(ITtsEngineSsml comEngine, IntPtr iSite, int lcid) internal override IntPtr GetOutputFormat(IntPtr targetFormat) { IntPtr waveHeader; - _comEngine.GetOutputFormat((!(targetFormat != IntPtr.Zero)) ? SpeakOutputFormat.Text : SpeakOutputFormat.WaveFormat, targetFormat, out waveHeader); + _comEngine.GetOutputFormat(!(targetFormat != IntPtr.Zero) ? SpeakOutputFormat.Text : SpeakOutputFormat.WaveFormat, targetFormat, out waveHeader); return waveHeader; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TtsProxySapi.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TtsProxySapi.cs index 02e5714c7..1f0b0746f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TtsProxySapi.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TtsProxySapi.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TtsProxySsml.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TtsProxySsml.cs index 01f819478..6837cae17 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TtsProxySsml.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/TtsProxySsml.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/VOICEACTIONS.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/VOICEACTIONS.cs index d6f8cfcb9..5d1d88110 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/VOICEACTIONS.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/VOICEACTIONS.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/VoiceSynthesis.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/VoiceSynthesis.cs index 9c7452839..af350898a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/VoiceSynthesis.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/VoiceSynthesis.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -192,7 +192,7 @@ internal Prompt Prompt internal int Rate { get => _site.VoiceRate; - set => _site.VoiceRate = (_defaultRate = value); + set => _site.VoiceRate = _defaultRate = value; } internal int Volume @@ -254,7 +254,7 @@ internal VoiceSynthesis(WeakReference speechSynthesizer) { _installedVoices.Add(new InstalledVoice(this, allVoice.VoiceInfo)); } - _site.VoiceRate = (_defaultRate = (int)GetDefaultRate()); + _site.VoiceRate = _defaultRate = (int)GetDefaultRate(); _workerThread = new Thread(ThreadProc); _workerThread.IsBackground = true; _workerThread.Start(); @@ -640,7 +640,7 @@ internal void RemoveLexicon(Uri uri) internal TTSVoice GetEngine(string name, CultureInfo culture, VoiceGender gender, VoiceAge age, int variant, bool switchContext) { - TTSVoice defaultVoice = (_currentVoice != null) ? _currentVoice : GetVoice(switchContext); + TTSVoice defaultVoice = _currentVoice != null ? _currentVoice : GetVoice(switchContext); return GetEngineWithVoice(defaultVoice, null, name, culture, gender, age, variant, switchContext); } @@ -736,7 +736,7 @@ private void ThreadProc() if (parametersSpeak2._prompt._exception == null) { List list = new List(); - TTSVoice ttsVoice = (_currentVoice != null) ? _currentVoice : GetVoice(false); + TTSVoice ttsVoice = _currentVoice != null ? _currentVoice : GetVoice(false); SpeakInfo speakInfo = new SpeakInfo(this, ttsVoice); if (parametersSpeak2._textToSpeak != null) { @@ -955,7 +955,7 @@ private TTSVoice GetVoice(VoiceInfo voiceInfo, bool switchContext) if (switchContext) { ExecuteOnBackgroundThread(Action.GetVoice, voiceInfo); - return (_pendingException == null) ? _pendingVoice : null; + return _pendingException == null ? _pendingVoice : null; } return GetProxyEngine(voiceInfo); } @@ -991,7 +991,7 @@ private TTSVoice GetEngineWithVoice(TTSVoice defaultVoice, VoiceInfo defaultVoic InstalledVoice viDefault = null; if (defaultVoice != null || defaultVoiceId != null) { - viDefault = InstalledVoice.Find(_installedVoices, (defaultVoice != null) ? defaultVoice.VoiceInfo : defaultVoiceId); + viDefault = InstalledVoice.Find(_installedVoices, defaultVoice != null ? defaultVoice.VoiceInfo : defaultVoiceId); if (viDefault != null && viDefault.Enabled && variant == 1) { VoiceInfo voiceInfo = viDefault.VoiceInfo; @@ -1213,7 +1213,7 @@ private ITtsEngineProxy GetSsmlEngine(VoiceInfo voiceInfo) { voiceInfo.Clsid }; - ttsEngineSsml = (assembly.CreateInstance(type.ToString(), false, BindingFlags.Default, null, args, CultureInfo.CurrentUICulture, null) as TtsEngineSsml); + ttsEngineSsml = assembly.CreateInstance(type.ToString(), false, BindingFlags.Default, null, args, CultureInfo.CurrentUICulture, null) as TtsEngineSsml; break; } } @@ -1308,7 +1308,7 @@ private TTSVoice GetVoice(bool switchContext) } if (_defaultVoice == null) { - VoiceInfo defaultVoiceId = (objectToken != null) ? new VoiceInfo(objectToken) : null; + VoiceInfo defaultVoiceId = objectToken != null ? new VoiceInfo(objectToken) : null; _defaultVoice = GetEngineWithVoice(null, defaultVoiceId, null, CultureInfo.CurrentUICulture, VoiceGender.NotSet, VoiceAge.NotSet, 1, switchContext); } _defaultVoiceInitialized = true; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/WAVEFORMATEX.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/WAVEFORMATEX.cs index dd4df0ccd..0944b1292 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/WAVEFORMATEX.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/WAVEFORMATEX.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/WAVEHDR.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/WAVEHDR.cs index dbf916d3d..e53f75b19 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/WAVEHDR.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/WAVEHDR.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/WaveHeader.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/WaveHeader.cs index ebf060204..e04e9765b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/WaveHeader.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/Synthesis/Internal/WaveHeader.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ContourPoint.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ContourPoint.cs index ad6eb1046..aa0a1e56f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ContourPoint.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ContourPoint.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ContourPointChangeType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ContourPointChangeType.cs index 2398709ca..ae33ed0f2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ContourPointChangeType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ContourPointChangeType.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/EmphasisBreak.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/EmphasisBreak.cs index 6823c4636..5122e33f6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/EmphasisBreak.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/EmphasisBreak.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/EmphasisWord.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/EmphasisWord.cs index 60ba5b837..f1b794f5f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/EmphasisWord.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/EmphasisWord.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/EventParameterType.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/EventParameterType.cs index d2bb90166..197cfbd76 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/EventParameterType.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/EventParameterType.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/FragmentState.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/FragmentState.cs index eddd26663..da7298960 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/FragmentState.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/FragmentState.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/FragmentStateInterop.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/FragmentStateInterop.cs index 0bfcd9cf8..bfaf205a7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/FragmentStateInterop.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/FragmentStateInterop.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ITtsEngine.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ITtsEngine.cs index 752c26a77..f54d99bf6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ITtsEngine.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ITtsEngine.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ITtsEngineSite.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ITtsEngineSite.cs index 266179134..be3024396 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ITtsEngineSite.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ITtsEngineSite.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ITtsEngineSsml.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ITtsEngineSsml.cs index 998d6ebce..5a8814b9f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ITtsEngineSsml.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ITtsEngineSsml.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/Prosody.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/Prosody.cs index c53e60fb2..1fc4d7c39 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/Prosody.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/Prosody.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyInterop.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyInterop.cs index 16c00e231..d9a91254f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyInterop.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyInterop.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyNumber.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyNumber.cs index e28a99f3c..601a29735 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyNumber.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyNumber.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyPitch.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyPitch.cs index 95c1276f4..cefd3492a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyPitch.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyPitch.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyRange.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyRange.cs index 8a973e20f..c226f440f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyRange.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyRange.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyRate.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyRate.cs index 286f1e3dd..a1b1d6441 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyRate.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyRate.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyUnit.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyUnit.cs index 223d03a7a..284e08264 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyUnit.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyUnit.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyVolume.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyVolume.cs index 553a7871b..b0650feb4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyVolume.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/ProsodyVolume.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SAPIGuids.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SAPIGuids.cs index 119ecaefe..7fa88ca4a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SAPIGuids.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SAPIGuids.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPEAKFLAGS.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPEAKFLAGS.cs index b441a9e07..b51dde2e0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPEAKFLAGS.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPEAKFLAGS.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPPARTOFSPEECH.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPPARTOFSPEECH.cs index 237721262..9925265ef 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPPARTOFSPEECH.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPPARTOFSPEECH.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVACTIONS.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVACTIONS.cs index 25052d31a..9761e7c93 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVACTIONS.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVACTIONS.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVCONTEXT.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVCONTEXT.cs index 22268979c..78f1fe8a1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVCONTEXT.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVCONTEXT.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVESACTIONS.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVESACTIONS.cs index f7cf385a6..fcb9af37b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVESACTIONS.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVESACTIONS.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVPITCH.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVPITCH.cs index 172369044..5ce3e00cf 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVPITCH.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVPITCH.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVSKIPTYPE.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVSKIPTYPE.cs index 4371e4152..cf39f8e11 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVSKIPTYPE.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVSKIPTYPE.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVSTATE.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVSTATE.cs index 60926ad06..1ab4a7d35 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVSTATE.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVSTATE.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVTEXTFRAG.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVTEXTFRAG.cs index 623b847e2..577a796f9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVTEXTFRAG.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SPVTEXTFRAG.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SayAs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SayAs.cs index 3bfd1f428..57e7144eb 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SayAs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SayAs.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SkipInfo.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SkipInfo.cs index 1d989af36..5130f4a54 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SkipInfo.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SkipInfo.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SpeakOutputFormat.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SpeakOutputFormat.cs index f7f23bd3b..6851807a0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SpeakOutputFormat.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SpeakOutputFormat.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SpeechEventInfo.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SpeechEventInfo.cs index 458c8ce96..10d464c73 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SpeechEventInfo.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/SpeechEventInfo.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TextFragment.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TextFragment.cs index 8e28a93f1..0aac66300 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TextFragment.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TextFragment.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -84,7 +84,7 @@ internal TextFragment(FragmentState fragState, string textToSpeak) internal TextFragment(FragmentState fragState, string textToSpeak, string textFrag, int offset, int length) { - if (fragState.Action == TtsEngineAction.Speak || fragState.Action == TtsEngineAction.Pronounce) + if (fragState.Action is TtsEngineAction.Speak or TtsEngineAction.Pronounce) { textFrag = textToSpeak; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TextFragmentInterop.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TextFragmentInterop.cs index 29ac786fe..06ab7f64c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TextFragmentInterop.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TextFragmentInterop.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TtsEngineAction.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TtsEngineAction.cs index dc6e64bb6..7b70a2b54 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TtsEngineAction.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TtsEngineAction.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TtsEngineSsml.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TtsEngineSsml.cs index c50003292..fa02eb978 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TtsEngineSsml.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TtsEngineSsml.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TtsEventId.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TtsEventId.cs index 9796e2c7f..c2ed724af 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TtsEventId.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Classes/System/SAPI/TTSEngine/TtsEventId.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Globals/GlobalDeclarations.cs index 387902007..ee39cd4d2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Globals/GlobalDeclarations.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Krypton.Toolkit.Suite.Extended.Utilities 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Krypton.Toolkit.Suite.Extended.Utilities 2022.csproj index 33da7749a..0a40109de 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Krypton.Toolkit.Suite.Extended.Utilities 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Krypton.Toolkit.Suite.Extended.Utilities 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -70,9 +58,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements global utilities used by the extended toolkit. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements global utilities used by the extended toolkit. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -80,74 +68,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Krypton.Toolkit.Suite.Extended.Utilities.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Krypton.Toolkit.Suite.Extended.Utilities.licenseheader index c890e86c0..a0e5e0a62 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Krypton.Toolkit.Suite.Extended.Utilities.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Krypton.Toolkit.Suite.Extended.Utilities.licenseheader @@ -4,7 +4,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/KryptonVirtualTreeColumnView.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/KryptonVirtualTreeColumnView.cs index b4e4bce56..b99cd87d4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/KryptonVirtualTreeColumnView.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/KryptonVirtualTreeColumnView.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -727,7 +727,7 @@ public PaletteBackStyle BackStyle } } - private bool ShouldSerializeBackStyle() => (BackStyle != PaletteBackStyle.PanelClient); + private bool ShouldSerializeBackStyle() => BackStyle != PaletteBackStyle.PanelClient; private void ResetBackStyle() => BackStyle = PaletteBackStyle.PanelClient; @@ -1241,7 +1241,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 && _treeView != null)) { Rectangle fillRect = _layoutFill.FillRect; _treeView.SetBounds(fillRect.X, fillRect.Y, fillRect.Width, fillRect.Height); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/NodeAttachPlacement.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/NodeAttachPlacement.cs index 8ca55e11e..906b1367c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/NodeAttachPlacement.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/NodeAttachPlacement.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/RowNodeState.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/RowNodeState.cs index 25977f8f9..a009bcb5a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/RowNodeState.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/RowNodeState.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/VirtualTreeColumn.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/VirtualTreeColumn.cs index 8e65b009f..e459b48b3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/VirtualTreeColumn.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/VirtualTreeColumn.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/VirtualTreeHeader.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/VirtualTreeHeader.cs index 8cb173bbe..61b2fd31e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/VirtualTreeHeader.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/VirtualTreeHeader.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/VirtualTreeRowNode.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/VirtualTreeRowNode.cs index 704175248..11696c8ce 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/VirtualTreeRowNode.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Classes/VirtualTreeRowNode.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Control/InternalTreeColumnView.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Control/InternalTreeColumnView.Designer.cs index 340b0d0bd..fbfc2ec2d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Control/InternalTreeColumnView.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Control/InternalTreeColumnView.Designer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Control/InternalTreeColumnView.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Control/InternalTreeColumnView.cs index 5b372155c..577f4bbf4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Control/InternalTreeColumnView.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Control/InternalTreeColumnView.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -213,7 +213,7 @@ internal void DrawDesignMode(Graphics graphics) var useHeaderHeight = _kryptonVirtualTreeColumnView.Header.Visible ? Math.Max(_kryptonVirtualTreeColumnView.Header.MinHeight, ItemHeight) : 0; - var rows = ((int)(r.Height - useHeaderHeight) / ItemHeight); + var rows = (int)(r.Height - useHeaderHeight) / ItemHeight; var y = graphics.VisibleClipBounds.Y + useHeaderHeight; var totalColWidth = Math.Min(TotalWidth(), graphics.VisibleClipBounds.Right); @@ -534,7 +534,7 @@ internal VirtualTreeRowNode GetRowNodeAt(int x, int y) displayOffset -= _kryptonVirtualTreeColumnView._vScrollBar.ScrollPosition; } - bounds.Y = (displayOffset * ItemHeight) + hdrHeight; + bounds.Y = displayOffset * ItemHeight + hdrHeight; if (bounds.Contains(x, y)) { return visibleNodes[offset]; @@ -911,9 +911,8 @@ private static void SetTextRenderingHint(Graphics g, IPaletteContent paletteCont PaletteTextHint.ClearTypeGridFit => TextRenderingHint.ClearTypeGridFit, PaletteTextHint.SingleBitPerPixel => TextRenderingHint.SingleBitPerPixel, PaletteTextHint.SingleBitPerPixelGridFit => TextRenderingHint.SingleBitPerPixelGridFit, - PaletteTextHint.Inherit => TextRenderingHint.SystemDefault, - PaletteTextHint.SystemDefault => TextRenderingHint.SystemDefault, - _ => TextRenderingHint.SystemDefault + PaletteTextHint.Inherit => TextRenderingHint.ClearTypeGridFit, //SystemDefault, + _ => TextRenderingHint.ClearTypeGridFit }; } @@ -1000,7 +999,7 @@ private bool DrawRowNode(VirtualTreeRowNode visibleNode, int rowOffset, Graphics ViewDrawRowNode(visibleNode, graphics, bounds, rowOffset); - return (bounds.Bottom > graphics.VisibleClipBounds.Bottom); + return bounds.Bottom > graphics.VisibleClipBounds.Bottom; } private int NodeIndent(VirtualTreeRowNode node, bool ignoreImage) @@ -1063,7 +1062,7 @@ internal void ViewDrawRowNode(VirtualTreeRowNode? rowNode, Graphics graphics, Re else { // Check node values before tree level values - if ((rowNode.SelectedImageIndex >= 0) && (rowNode.SelectedImageIndex < StateImageList.Images.Count)) + if (rowNode.SelectedImageIndex >= 0 && rowNode.SelectedImageIndex < StateImageList.Images.Count) { drawStateImage = StateImageList.Images[rowNode.SelectedImageIndex]; } @@ -1075,12 +1074,12 @@ internal void ViewDrawRowNode(VirtualTreeRowNode? rowNode, Graphics graphics, Re } } - _kryptonVirtualTreeColumnView._layoutImageCenterState.Visible = (drawStateImage != null); + _kryptonVirtualTreeColumnView._layoutImageCenterState.Visible = drawStateImage != null; // Do we need the check box? - _kryptonVirtualTreeColumnView._layoutCheckBoxStack.Visible = (StateImageList == null) + _kryptonVirtualTreeColumnView._layoutCheckBoxStack.Visible = StateImageList == null && CheckBoxes - && (rowNode.IsCheckBoxVisible); + && rowNode.IsCheckBoxVisible; if (_kryptonVirtualTreeColumnView._layoutCheckBoxStack.Visible) { _kryptonVirtualTreeColumnView._drawCheckBox.CheckState = rowNode.RowNodeState.HasFlag(RowNodeState.Checked) ? CheckState.Checked : CheckState.Unchecked; @@ -1142,8 +1141,8 @@ internal void ViewDrawRowNode(VirtualTreeRowNode? rowNode, Graphics graphics, Re if (ShowLines) { // Find center points - var hCenter = (indentBounds.X + (indentBounds.Width - 16)) - 1; - var vCenter = indentBounds.Y + (indentBounds.Height / 2); + var hCenter = indentBounds.X + (indentBounds.Width - 16) - 1; + var vCenter = indentBounds.Y + indentBounds.Height / 2; vCenter -= vCenter % 2; // Default to showing full line height @@ -1152,7 +1151,7 @@ internal void ViewDrawRowNode(VirtualTreeRowNode? rowNode, Graphics graphics, Re var bottom = indentBounds.Bottom; // If the first root node then do not show top half of line - if ((rowNode.Parent == null) && (rowNode.PreviousSibling == null)) + if (rowNode.Parent == null && rowNode.PreviousSibling == null) { top = vCenter; } @@ -1188,15 +1187,15 @@ internal void ViewDrawRowNode(VirtualTreeRowNode? rowNode, Graphics graphics, Re } // Do we draw any plus/minus images in indent bounds? - if (ShowPlusMinus && (rowNode.Children.Count > 0)) + if (ShowPlusMinus && rowNode.Children.Count > 0) { Image drawImage = _kryptonVirtualTreeColumnView._redirectImages.GetTreeViewImage(rowNode.RowNodeState.HasFlag(RowNodeState.Expanded)); if (drawImage != null) { graphics.DrawImage(drawImage, new Rectangle( - (indentBounds.X + (indentBounds.Width - (16 * 2))), - indentBounds.Y + ((indentBounds.Height - drawImage.Height) / 2), + indentBounds.X + (indentBounds.Width - 16 * 2), + indentBounds.Y + (indentBounds.Height - drawImage.Height) / 2, drawImage.Width, drawImage.Height)); } } @@ -1211,7 +1210,7 @@ internal void ViewDrawRowNode(VirtualTreeRowNode? rowNode, Graphics graphics, Re try { // Check node values before tree level values - if ((rowNode.ImageIndex >= 0) && (rowNode.ImageIndex < imageCount)) + if (rowNode.ImageIndex >= 0 && rowNode.ImageIndex < imageCount) { drawImage = ImageList.Images[rowNode.ImageIndex]; } @@ -1219,7 +1218,7 @@ internal void ViewDrawRowNode(VirtualTreeRowNode? rowNode, Graphics graphics, Re { drawImage = ImageList.Images[ImageKey]; } - else if ((ImageIndex >= 0) && (ImageIndex < imageCount)) + else if (ImageIndex >= 0 && ImageIndex < imageCount) { drawImage = ImageList.Images[ImageIndex]; } @@ -1227,7 +1226,7 @@ internal void ViewDrawRowNode(VirtualTreeRowNode? rowNode, Graphics graphics, Re if (rowNode.RowNodeState.HasFlag(RowNodeState.Selected)) { // Check node values before tree level values - if ((rowNode.SelectedImageIndex >= 0) && (rowNode.SelectedImageIndex < imageCount)) + if (rowNode.SelectedImageIndex >= 0 && rowNode.SelectedImageIndex < imageCount) { drawImage = ImageList.Images[rowNode.SelectedImageIndex]; } @@ -1235,7 +1234,7 @@ internal void ViewDrawRowNode(VirtualTreeRowNode? rowNode, Graphics graphics, Re { drawImage = ImageList.Images[SelectedImageKey]; } - else if ((SelectedImageIndex >= 0) && (SelectedImageIndex < imageCount)) + else if (SelectedImageIndex >= 0 && SelectedImageIndex < imageCount) { drawImage = ImageList.Images[SelectedImageIndex]; } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Globals/GlobalDeclarations.cs index a8d897ed9..321917b20 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Globals/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView 2022.csproj index a89c85b05..43cb9d142 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - - - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -75,9 +63,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements items to create a 'virtual tree column view' for your applications. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements items to create a 'virtual tree column view' for your applications. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -85,74 +73,36 @@ - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView.licenseheader index 017566f45..3aaeb752a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/DesignTimeWizard.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/DesignTimeWizard.cs index 37ecce547..cddb9329c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/DesignTimeWizard.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/DesignTimeWizard.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/KryptonAdvancedWizardCollectionEditor.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/KryptonAdvancedWizardCollectionEditor.cs index 92b294080..2c6872e48 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/KryptonAdvancedWizardCollectionEditor.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/KryptonAdvancedWizardCollectionEditor.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/KryptonAdvancedWizardPageCollection.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/KryptonAdvancedWizardPageCollection.cs index b4f9d38d4..21a337d67 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/KryptonAdvancedWizardPageCollection.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/KryptonAdvancedWizardPageCollection.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/RuntimeWizard.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/RuntimeWizard.cs index 21e833b8e..9f96f633e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/RuntimeWizard.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/RuntimeWizard.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/WizardStrategy.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/WizardStrategy.cs index 84db9d06f..564639bf8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/WizardStrategy.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Classes/WizardStrategy.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Controls Toolkit/KryptonAdvancedWizard.Internal.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Controls Toolkit/KryptonAdvancedWizard.Internal.cs index adf27f66e..80c56e8b7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Controls Toolkit/KryptonAdvancedWizard.Internal.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Controls Toolkit/KryptonAdvancedWizard.Internal.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Controls Toolkit/KryptonAdvancedWizard.Private.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Controls Toolkit/KryptonAdvancedWizard.Private.cs index b2b8908aa..e9247438e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Controls Toolkit/KryptonAdvancedWizard.Private.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Controls Toolkit/KryptonAdvancedWizard.Private.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -51,9 +51,9 @@ private void InitializeComponent() this._kbtnHelp = new Krypton.Toolkit.KryptonButton(); this._kryptonBorderEdge1 = new Krypton.Toolkit.KryptonBorderEdge(); this._kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); - ((System.ComponentModel.ISupportInitialize)(this._kpnlButtons)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this._kpnlButtons).BeginInit(); this._kpnlButtons.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this._kryptonPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this._kryptonPanel1).BeginInit(); this.SuspendLayout(); // // kpnlButtons @@ -73,7 +73,7 @@ private void InitializeComponent() // // kbtnCancel // - this._kbtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this._kbtnCancel.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right); this._kbtnCancel.Location = new System.Drawing.Point(167, 9); this._kbtnCancel.Name = "_kbtnCancel"; this._kbtnCancel.Size = new System.Drawing.Size(90, 25); @@ -83,7 +83,7 @@ private void InitializeComponent() // // kbtnBack // - this._kbtnBack.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this._kbtnBack.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right); this._kbtnBack.Location = new System.Drawing.Point(263, 9); this._kbtnBack.Name = "_kbtnBack"; this._kbtnBack.Size = new System.Drawing.Size(90, 25); @@ -93,7 +93,7 @@ private void InitializeComponent() // // kbtnNext // - this._kbtnNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this._kbtnNext.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right); this._kbtnNext.Location = new System.Drawing.Point(359, 9); this._kbtnNext.Name = "_kbtnNext"; this._kbtnNext.Size = new System.Drawing.Size(90, 25); @@ -103,7 +103,7 @@ private void InitializeComponent() // // kbtnFinish // - this._kbtnFinish.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this._kbtnFinish.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right); this._kbtnFinish.Location = new System.Drawing.Point(455, 9); this._kbtnFinish.Name = "_kbtnFinish"; this._kbtnFinish.Size = new System.Drawing.Size(90, 25); @@ -144,10 +144,10 @@ private void InitializeComponent() this.Controls.Add(this._kpnlButtons); this.Name = "KryptonAdvancedWizard"; this.Size = new System.Drawing.Size(557, 327); - ((System.ComponentModel.ISupportInitialize)(this._kpnlButtons)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this._kpnlButtons).EndInit(); this._kpnlButtons.ResumeLayout(false); this._kpnlButtons.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this._kryptonPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)this._kryptonPanel1).EndInit(); this.ResumeLayout(false); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Controls Toolkit/KryptonAdvancedWizard.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Controls Toolkit/KryptonAdvancedWizard.cs index 70a798dfb..df9a22cf7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Controls Toolkit/KryptonAdvancedWizard.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Controls Toolkit/KryptonAdvancedWizard.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -218,12 +218,12 @@ public bool HelpButton { case true: _kbtnHelp.Visible = true; - _kbtnHelp.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left); + _kbtnHelp.Anchor = AnchorStyles.Bottom | AnchorStyles.Left; break; case false: _kbtnHelp.Visible = false; - _kbtnHelp.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left); + _kbtnHelp.Anchor = AnchorStyles.Bottom | AnchorStyles.Left; break; } break; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Controls Toolkit/KryptonAdvancedWizardPage.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Controls Toolkit/KryptonAdvancedWizardPage.cs index 8a620f2d5..b1cdef3d0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Controls Toolkit/KryptonAdvancedWizardPage.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Controls Toolkit/KryptonAdvancedWizardPage.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Designers/KryptonAdvancedWizardDesigner.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Designers/KryptonAdvancedWizardDesigner.cs index d7602afc5..5b2b22386 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Designers/KryptonAdvancedWizardDesigner.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Designers/KryptonAdvancedWizardDesigner.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,6 +29,8 @@ // ReSharper disable NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract // ReSharper disable ConvertToNullCoalescingCompoundAssignment +using DebugUtilities = Krypton.Toolkit.Suite.Extended.Debug.Tools.DebugUtilities; + namespace Krypton.Toolkit.Suite.Extended.Wizard { /// @@ -150,7 +152,7 @@ private void OnVerbNew(object sender, EventArgs e) } catch (Exception ex) { - ExceptionCapture.CaptureException(ex); + DebugUtilities.NotImplemented(ex.ToString()); } } @@ -158,7 +160,7 @@ private void OnVerbNew(object sender, EventArgs e) private void InitializeDesigner() => DrawGrid = false; - private void GetReferenceToWizardControl(IComponent c) => _wizard = ((Control)c as KryptonAdvancedWizard); + private void GetReferenceToWizardControl(IComponent c) => _wizard = (Control)c as KryptonAdvancedWizard; private void GetReferenceToIDesignerHost() => _designer = (IDesignerHost)GetService(typeof(IDesignerHost)); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Designers/KryptonAdvancedWizardPageDesigner.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Designers/KryptonAdvancedWizardPageDesigner.cs index 55125fe3f..088019194 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Designers/KryptonAdvancedWizardPageDesigner.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Designers/KryptonAdvancedWizardPageDesigner.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Enumerations/ButtonLayoutKind.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Enumerations/ButtonLayoutKind.cs index 0cf6c4ff6..d339c8eee 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Enumerations/ButtonLayoutKind.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Enumerations/ButtonLayoutKind.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Enumerations/Direction.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Enumerations/Direction.cs index 6e47cb14d..ed7ad2380 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Enumerations/Direction.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Enumerations/Direction.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Events/WizardEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Events/WizardEventArgs.cs index 29646405c..9f6cae98f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Events/WizardEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Events/WizardEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Events/WizardPageChangedEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Events/WizardPageChangedEventArgs.cs index 409e94525..749f7b009 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Events/WizardPageChangedEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Events/WizardPageChangedEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Events/WizardPageEventArgs.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Events/WizardPageEventArgs.cs index 7c4963eb3..475592610 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Events/WizardPageEventArgs.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Events/WizardPageEventArgs.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Global/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Global/GlobalDeclarations.cs index efc53575b..214ed107d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Global/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Global/GlobalDeclarations.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Krypton.Toolkit.Suite.Extended.Wizard 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Krypton.Toolkit.Suite.Extended.Wizard 2022.csproj index 35df9795a..303b139cd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Krypton.Toolkit.Suite.Extended.Wizard 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Krypton.Toolkit.Suite.Extended.Wizard 2022.csproj @@ -1,27 +1,15 @@  - - - 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 - - - - + - 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 + net462;net47;net471;net472;net48;net481;net8.0-windows;net9.0-windows @@ -71,9 +59,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements a wizard control. + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements a wizard control. - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -87,7 +75,7 @@ - + @@ -97,7 +85,7 @@ - + @@ -107,7 +95,7 @@ - + @@ -117,7 +105,7 @@ - + @@ -148,12 +136,13 @@ - + + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Krypton.Toolkit.Suite.Extended.Wizard.licenseheader b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Krypton.Toolkit.Suite.Extended.Wizard.licenseheader index 6933f72df..628cf5ca7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Krypton.Toolkit.Suite.Extended.Wizard.licenseheader +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Krypton.Toolkit.Suite.Extended.Wizard.licenseheader @@ -3,7 +3,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Properties/Resources.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Properties/Resources.Designer.cs index b16d25f63..d60f8c2a1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Properties/Resources.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Properties/Resources.Designer.cs @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/Source/Krypton Toolkit/ZipExtractor/Controls Visuals/ZipExtractorWindow.cs b/Source/Krypton Toolkit/ZipExtractor/Controls Visuals/ZipExtractorWindow.cs index c4467c624..aa1c897f6 100644 --- a/Source/Krypton Toolkit/ZipExtractor/Controls Visuals/ZipExtractorWindow.cs +++ b/Source/Krypton Toolkit/ZipExtractor/Controls Visuals/ZipExtractorWindow.cs @@ -1,4 +1,6 @@ -namespace ZipExtractor +using DebugUtilities = Krypton.Toolkit.Suite.Extended.Debug.Tools.DebugUtilities; + +namespace ZipExtractor { public partial class ZipExtractorWindow : KryptonForm { @@ -117,7 +119,7 @@ private void bgwLoadWorker_DoWork(object sender, DoWorkEventArgs e) } catch (Exception exception) { - ExceptionCapture.CaptureException(exception); + DebugUtilities.NotImplemented(exception.ToString()); } } @@ -227,7 +229,7 @@ private void bgwLoadWorker_DoWork(object sender, DoWorkEventArgs e) throw; } - List lockingProcesses = null; + List? lockingProcesses = null; if (Environment.OSVersion.Version.Major >= 6 && retries >= 2) { try @@ -332,7 +334,7 @@ private void bgwLoadWorker_RunWorkerCompleted(object sender, RunWorkerCompletedE _logBuilder.AppendLine(exception.ToString()); - ExceptionCapture.CaptureException(exception); + DebugUtilities.NotImplemented(exception.ToString()); } finally { diff --git a/Source/Krypton Toolkit/ZipExtractor/General/FileUtilities.cs b/Source/Krypton Toolkit/ZipExtractor/General/FileUtilities.cs index 7221cf5fe..5081eb046 100644 --- a/Source/Krypton Toolkit/ZipExtractor/General/FileUtilities.cs +++ b/Source/Krypton Toolkit/ZipExtractor/General/FileUtilities.cs @@ -13,9 +13,9 @@ private static extern int RmRegisterResources(uint pSessionHandle, uint nFiles, string[] rgsFilenames, uint nApplications, - [In] RM_UNIQUE_PROCESS[] rgApplications, + [In] RM_UNIQUE_PROCESS[]? rgApplications, uint nServices, - string[] rgsServiceNames); + string[]? rgsServiceNames); [DllImport("rstrtmgr.dll", CharSet = CharSet.Auto)] private static extern int RmStartSession(out uint pSessionHandle, int dwSessionFlags, string strSessionKey); @@ -27,7 +27,7 @@ private static extern int RmRegisterResources(uint pSessionHandle, private static extern int RmGetList(uint dwSessionHandle, out uint pnProcInfoNeeded, ref uint pnProcInfo, - [In][Out] RM_PROCESS_INFO[] rgAffectedApps, + [In][Out] RM_PROCESS_INFO[]? rgAffectedApps, ref uint lpdwRebootReasons); /// @@ -40,7 +40,7 @@ private static extern int RmGetList(uint dwSessionHandle, /// http://msdn.microsoft.com/en-us/library/windows/desktop/aa373661(v=vs.85).aspx /// http://wyupdate.googlecode.com/svn-history/r401/trunk/frmFilesInUse.cs (no copyright in code at time of viewing) /// - public static List WhoIsLocking(string path) + public static List? WhoIsLocking(string path) { var key = Guid.NewGuid().ToString(); var processes = new List(); diff --git a/Source/Krypton Toolkit/ZipExtractor/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/ZipExtractor/Globals/GlobalDeclarations.cs index d92c429b2..bdc3bbda3 100644 --- a/Source/Krypton Toolkit/ZipExtractor/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/ZipExtractor/Globals/GlobalDeclarations.cs @@ -3,7 +3,7 @@ * * MIT License * - * Copyright (c) 2017 - 2023 Krypton Suite + * Copyright (c) 2017 - 2024 Krypton Suite * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -38,5 +38,4 @@ global using System.Threading; global using System.Windows.Forms; -global using Krypton.Toolkit; -global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; \ No newline at end of file +global using Krypton.Toolkit; \ No newline at end of file diff --git a/Source/Krypton Toolkit/ZipExtractor/ZipExtractor.csproj b/Source/Krypton Toolkit/ZipExtractor/ZipExtractor.csproj index d6ed62f5f..8b8b86d40 100644 --- a/Source/Krypton Toolkit/ZipExtractor/ZipExtractor.csproj +++ b/Source/Krypton Toolkit/ZipExtractor/ZipExtractor.csproj @@ -15,74 +15,36 @@ - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - + @@ -100,8 +62,11 @@ + + + @@ -123,7 +88,7 @@ - 22.4.0 + 24.4.0 diff --git a/clean.cmd b/clean.cmd index 25b37e688..a3ec27d74 100644 --- a/clean.cmd +++ b/clean.cmd @@ -124,6 +124,20 @@ echo Deleting 'Krypton.Toolkit.Suite.Extended.Wizard\obj' rd /s /q "Source\Krypton Toolkit\Krypton.Toolkit.Suite.Extended.Wizard\obj echo Deleting 'Krypton.Toolkit.Suite.Extended.Shared\obj' rd /s /q "Source\Krypton Toolkit\Krypton.Toolkit.Suite.Extended.Shared\obj" +echo Deleting 'Source\Krypton Toolkit\Examples\obj' +rd /s /q "Source\Krypton Toolkit\Examples\obj" +echo Deleting 'Source\Krypton Toolkit\ZipExtractor\obj' +rd /s /q "Source\Krypton Toolkit\ZipExtractor\obj" +echo Deleting 'AutoUpdateCreator\obj' +rd /s /q "Source\Krypton Toolkit\AutoUpdateCreator\obj" +echo Deleting 'Source\Krypton Toolkit\Krypton.Toolkit.Suite.Extended.Software.Updater.Core\obj' +rd /s /q "Source\Krypton Toolkit\Krypton.Toolkit.Suite.Extended.Software.Updater.Core\obj" +echo Deleting 'Source\Krypton Toolkit\Krypton.Toolkit.Suite.Extended.AdvancedDataGridView\obj' +rd /s /q "Source\Krypton Toolkit\Krypton.Toolkit.Suite.Extended.AdvancedDataGridView\obj" +echo Deleting 'Source\Krypton Toolkit\Krypton.Toolkit.Suite.Extended.PDF\obj' +rd /s /q "Source\Krypton Toolkit\Krypton.Toolkit.Suite.Extended.PDF\obj" +echo Deleting 'Source\Krypton Toolkit\Krypton.Toolkit.Suite.Extended.Scintilla.NET\obj' +rd /s /q "Source\Krypton Toolkit\Krypton.Toolkit.Suite.Extended.Scintilla.NET\obj" rd /s /q "Source\Bin"