From 8f0d8886387dcf308bb6c6a6f0002f01072b8421 Mon Sep 17 00:00:00 2001
From: REghZy <32274404+AngryCarrot789@users.noreply.github.com>
Date: Mon, 18 Mar 2024 01:18:54 +0000
Subject: [PATCH] Removed unused classes and fixed a few other things
---
SharpPad.sln | 6 -
SharpPad/AdvancedMenuService/MenuService.cs | 2 +-
.../RegularMenuService/AdvancedMenuItem.cs | 2 +-
.../RegularMenuService/AdvancedRegularMenu.cs | 2 +-
SharpPad/App.config | 15 +
SharpPad/App.xaml | 7 +-
SharpPad/App.xaml.cs | 14 +-
SharpPad/ApplicationCore.cs | 21 +-
SharpPad/AsyncDemo.cs | 2 +-
.../AttachedInteractivity.cs | 96 --
.../AttachedProperties/MultiSelectorHelper.cs | 220 -----
.../ObservableSelectionHelper.cs | 504 -----------
SharpPad/Behaviours/Behaviour.cs | 2 +-
SharpPad/Behaviours/BehaviourBase.cs | 2 +-
SharpPad/Behaviours/BehaviourCollection.cs | 2 +-
SharpPad/Behaviours/IBehaviour.cs | 2 +-
.../Standard/KeyStrokeCommandBehaviour.cs | 2 +-
.../Behaviours/TestBlueBackgroundBehaviour.cs | 2 +-
SharpPad/CommandSystem/AsyncCommand.cs | 2 +-
SharpPad/CommandSystem/CommandGroup.cs | 2 +-
SharpPad/CommandSystem/Executability.cs | 2 +-
SharpPad/CommandSystem/SimpleCommandGroup.cs | 2 +-
.../Usages/BaseToggleButtonCommandUsage.cs | 2 +-
.../Usages/BasicButtonCommandUsage.cs | 2 +-
.../Usages/CommandSourceCommandUsage.cs | 2 +-
SharpPad/CommandSystem/Usages/CommandUsage.cs | 2 +-
.../Usages/CommandUsageManager.cs | 2 +-
.../Usages/CommandUsageModelHelper.cs | 2 +-
SharpPad/Controls/Bindings/Binders.cs | 2 +-
.../Dragger/EditCompletedEventHandler.cs | 22 -
.../Controls/Dragger/EditStartEventHandler.cs | 22 -
.../Controls/Dragger/HorizontalIncrement.cs | 32 -
SharpPad/Controls/Dragger/IChangeMapper.cs | 24 -
SharpPad/Controls/Dragger/IValueFormatter.cs | 24 -
.../Controls/Dragger/IValuePreProcessor.cs | 27 -
SharpPad/Controls/Dragger/NumberDragger.cs | 846 ------------------
.../Controls/Dragger/NumberDraggerStyles.xaml | 101 ---
.../Dragger/UnitToPercentFormatter.cs | 29 -
.../Controls/Dragger/ValueStringFormatter.cs | 28 -
.../Controls/Dragger/VerticalIncrement.cs | 32 -
.../MultiSelectTreeViewAutomationPeer.cs | 137 ---
.../MultiSelectTreeViewItemAutomationPeer.cs | 344 -------
...ltiSelectTreeViewItemDataAutomationPeer.cs | 202 -----
.../Controls/BorderSelectionLogic.cs | 277 ------
.../TreeViews/Controls/EditTextBox.cs | 81 --
.../TreeViews/Controls/FocusHelper.cs | 83 --
.../TreeViews/Controls/ISelectionStrategy.cs | 78 --
.../Controls/TreeViews/Controls/ListUtils.cs | 79 --
.../TreeViews/Controls/MultiSelectTreeView.cs | 565 ------------
.../Controls/MultiSelectTreeViewItem.cs | 500 -----------
.../TreeViews/Controls/SelectionMultiple.cs | 387 --------
SharpPad/Controls/TreeViews/SOURCECODE.txt | 8 -
.../TreeViews/Themes/EditTextBox.xaml | 39 -
.../Themes/MultiSelectTreeView.Aero2.xaml | 67 --
.../Themes/MultiSelectTreeViewItem.Aero2.xaml | 240 -----
SharpPad/Converters/BoolConverterAND.cs | 66 --
SharpPad/Converters/DbToVolumeConverter.cs | 62 --
SharpPad/Converters/VolumeToDbConverter.cs | 62 --
SharpPad/DispatcherDelegate.cs | 2 +-
SharpPad/History/ChildManagerHistoryAction.cs | 2 +-
SharpPad/History/HistoryAction.cs | 2 +-
SharpPad/History/HistoryManager.cs | 2 +-
SharpPad/History/IHistoryAction.cs | 2 +-
SharpPad/History/MergedHistoryAction.cs | 2 +-
SharpPad/IDispatcher.cs | 2 +-
.../Contexts/ContextDataHelper.cs | 2 +-
SharpPad/Keymap.xml | 8 +
.../Notepads/Commands/CloseDocumentCommand.cs | 13 +-
SharpPad/Notepads/Commands/DocumentCommand.cs | 2 +-
SharpPad/Notepads/Commands/EditorCommand.cs | 2 +-
.../Notepads/Commands/FindModelCommand.cs | 2 +-
.../Commands/FindModelCommandUsage.cs | 2 +-
.../Commands/NewFileCommand.cs} | 16 +-
SharpPad/Notepads/Commands/NotepadCommand.cs | 101 +--
.../Notepads/Commands/OpenFilesCommand.cs | 96 ++
.../Commands/SaveAllDocumentsCommand.cs} | 17 +-
.../Contexts/EditMenuContextGenerator.cs | 2 +-
.../Contexts/NotepadTabContextGenerator.cs | 2 +-
.../Controls/FindAndReplaceControl.cs | 2 +-
.../Notepads/Controls/INotepadEditorUI.cs | 2 +-
SharpPad/Notepads/Controls/INotepadTabUI.cs | 2 +-
.../Notepads/Controls/NotepadControls.xaml | 6 +-
.../Notepads/Controls/NotepadEditorControl.cs | 112 +--
.../Notepads/Controls/NotepadTabControl.cs | 2 +-
SharpPad/Notepads/Controls/NotepadTabItem.cs | 2 +-
.../SearchResultBackgroundRenderer.cs | 87 ++
.../SearchResultColorizingTransformer.cs | 65 ++
SharpPad/Notepads/FindAndReplaceModel.cs | 2 +-
SharpPad/Notepads/Notepad.cs | 58 +-
SharpPad/Notepads/NotepadDocument.cs | 2 +-
SharpPad/Notepads/NotepadDropRegistry.cs | 2 +-
SharpPad/Notepads/NotepadEditor.cs | 14 +-
.../Serialisation/SerialisationRegistry.cs | 292 ------
SharpPad/Notepads/Views/NotepadWindow.xaml.cs | 20 +-
SharpPad/Properties/Settings.Designer.cs | 34 +-
SharpPad/Properties/Settings.settings | 15 +-
SharpPad/RBC/BinaryUtils.cs | 213 -----
.../RBC/Events/ReadFromRBEEventHandler.cs | 22 -
SharpPad/RBC/Events/WriteToRBEEventHandler.cs | 22 -
SharpPad/RBC/RBEArray.cs | 425 ---------
SharpPad/RBC/RBEBase.cs | 210 -----
SharpPad/RBC/RBEDictionary.cs | 361 --------
SharpPad/RBC/RBEGuid.cs | 48 -
SharpPad/RBC/RBEList.cs | 313 -------
SharpPad/RBC/RBEPrimitive.cs | 256 ------
SharpPad/RBC/RBEStruct.cs | 110 ---
SharpPad/RBC/RBEType.cs | 48 -
SharpPad/RBC/RBEUtils.cs | 156 ----
SharpPad/SharpPad.csproj | 116 +--
.../Managing/ShortcutInputManager.cs | 5 +-
SharpPad/Shortcuts/WPF/ShortcutStyles.xaml | 36 +
.../WPF/ShortcutToolTip.cs} | 9 +-
.../Shortcuts/WPF/ShortcutTooltipService.cs | 61 ++
SharpPad/Tasks/ActivityDialog.xaml.cs | 2 +-
SharpPad/Tasks/ActivityTask.cs | 2 +-
SharpPad/Tasks/CompletionRange.cs | 2 +-
SharpPad/Tasks/DefaultProgressTracker.cs | 2 +-
SharpPad/Tasks/EmptyActivityProgress.cs | 2 +-
SharpPad/Tasks/IActivityProgress.cs | 2 +-
SharpPad/Tasks/StandardActivityControl.cs | 2 +-
SharpPad/Tasks/TaskManager.cs | 2 +-
SharpPad/Themes/ControlColours.xaml | 4 +-
SharpPad/Themes/Controls.xaml | 31 +-
SharpPad/Utils/Accessing/ValueAccessors.cs | 2 +-
SharpPad/Utils/AsyncLock.cs | 114 ---
SharpPad/Utils/AudioUtils.cs | 30 -
SharpPad/Utils/BinarySearch.cs | 2 +-
SharpPad/Utils/CASLock.cs | 91 --
SharpPad/Utils/CollectionUtils.cs | 22 +
.../AdvancedReadOnlyObservableCollection.cs | 92 --
SharpPad/Utils/Colour.cs | 39 -
SharpPad/Utils/CursorUtils.cs | 105 ---
SharpPad/Utils/DispatcherCallback.cs | 58 --
SharpPad/Utils/Disposable/DisposableRef.cs | 156 ----
SharpPad/Utils/DoubleUtils.cs | 6 +-
SharpPad/Utils/DynamicCodeConverter.cs | 111 ---
SharpPad/Utils/EventArgsCache.cs | 30 -
SharpPad/Utils/ExceptionEventHandler.cs | 2 +-
.../Expressions/BasicNumericExpression.cs | 109 ---
.../Expressions/ComplexNumericExpression.cs | 416 ---------
SharpPad/Utils/FFmpegError.cs | 43 -
SharpPad/Utils/FileUtils.cs | 78 --
SharpPad/Utils/HandlerList.cs | 68 --
SharpPad/Utils/Helper.cs | 57 --
SharpPad/Utils/IDisplayName.cs | 34 -
SharpPad/Utils/IRenameTarget.cs | 33 -
SharpPad/Utils/InheritedProperty.cs | 79 --
SharpPad/Utils/IntRect.cs | 42 -
SharpPad/Utils/ItemCacheStack.cs | 67 --
SharpPad/Utils/Lang.cs | 34 -
SharpPad/Utils/NumberAverager.cs | 49 -
SharpPad/Utils/Numerics/SizeI.cs | 57 --
SharpPad/Utils/Numerics/Vector2i.cs | 57 --
SharpPad/Utils/Periodic.cs | 32 -
SharpPad/Utils/PrecisionTimer.cs | 156 ----
SharpPad/Utils/RDA/IDispatchAction.cs | 2 +-
SharpPad/Utils/RandomUtils.cs | 123 ---
SharpPad/Utils/Rect2d.cs | 123 ---
SharpPad/Utils/Rect2i.cs | 119 ---
SharpPad/Utils/Reference.cs | 39 -
SharpPad/Utils/ReferenceEqualityComparer.cs | 34 -
.../ResourceDictionaryDataTemplateSelector.cs | 39 -
SharpPad/Utils/ScrollerUtils.cs | 55 --
SharpPad/Utils/SelectionType.cs | 29 -
SharpPad/Utils/ShellIconSize.cs | 26 -
SharpPad/Utils/ShellUtils.cs | 105 ---
SharpPad/Utils/TemplateUtils.cs | 2 +-
SharpPad/Utils/TextIncrement.cs | 208 -----
SharpPad/Utils/TextPointerUtils.cs | 40 -
SharpPad/Utils/TextUtils.cs | 50 --
SharpPad/Utils/UIUtils.cs | 98 --
SharpPad/Utils/Validate.cs | 2 +-
SharpPad/Utils/Vec2i.cs | 57 --
.../VisualAncestorChangedEventInterface.cs | 2 +-
SharpPad/Views/WindowEx.cs | 3 +-
SharpPad/packages.config | 1 -
176 files changed, 668 insertions(+), 11609 deletions(-)
delete mode 100644 SharpPad/AttachedProperties/AttachedInteractivity.cs
delete mode 100644 SharpPad/AttachedProperties/MultiSelectorHelper.cs
delete mode 100644 SharpPad/AttachedProperties/ObservableSelectionHelper.cs
delete mode 100644 SharpPad/Controls/Dragger/EditCompletedEventHandler.cs
delete mode 100644 SharpPad/Controls/Dragger/EditStartEventHandler.cs
delete mode 100644 SharpPad/Controls/Dragger/HorizontalIncrement.cs
delete mode 100644 SharpPad/Controls/Dragger/IChangeMapper.cs
delete mode 100644 SharpPad/Controls/Dragger/IValueFormatter.cs
delete mode 100644 SharpPad/Controls/Dragger/IValuePreProcessor.cs
delete mode 100644 SharpPad/Controls/Dragger/NumberDragger.cs
delete mode 100644 SharpPad/Controls/Dragger/NumberDraggerStyles.xaml
delete mode 100644 SharpPad/Controls/Dragger/UnitToPercentFormatter.cs
delete mode 100644 SharpPad/Controls/Dragger/ValueStringFormatter.cs
delete mode 100644 SharpPad/Controls/Dragger/VerticalIncrement.cs
delete mode 100644 SharpPad/Controls/TreeViews/Automation/Peers/MultiSelectTreeViewAutomationPeer.cs
delete mode 100644 SharpPad/Controls/TreeViews/Automation/Peers/MultiSelectTreeViewItemAutomationPeer.cs
delete mode 100644 SharpPad/Controls/TreeViews/Automation/Peers/MultiSelectTreeViewItemDataAutomationPeer.cs
delete mode 100644 SharpPad/Controls/TreeViews/Controls/BorderSelectionLogic.cs
delete mode 100644 SharpPad/Controls/TreeViews/Controls/EditTextBox.cs
delete mode 100644 SharpPad/Controls/TreeViews/Controls/FocusHelper.cs
delete mode 100644 SharpPad/Controls/TreeViews/Controls/ISelectionStrategy.cs
delete mode 100644 SharpPad/Controls/TreeViews/Controls/ListUtils.cs
delete mode 100644 SharpPad/Controls/TreeViews/Controls/MultiSelectTreeView.cs
delete mode 100644 SharpPad/Controls/TreeViews/Controls/MultiSelectTreeViewItem.cs
delete mode 100644 SharpPad/Controls/TreeViews/Controls/SelectionMultiple.cs
delete mode 100644 SharpPad/Controls/TreeViews/SOURCECODE.txt
delete mode 100644 SharpPad/Controls/TreeViews/Themes/EditTextBox.xaml
delete mode 100644 SharpPad/Controls/TreeViews/Themes/MultiSelectTreeView.Aero2.xaml
delete mode 100644 SharpPad/Controls/TreeViews/Themes/MultiSelectTreeViewItem.Aero2.xaml
delete mode 100644 SharpPad/Converters/BoolConverterAND.cs
delete mode 100644 SharpPad/Converters/DbToVolumeConverter.cs
delete mode 100644 SharpPad/Converters/VolumeToDbConverter.cs
rename SharpPad/{Controls/Dragger/EditCompletedEventArgs.cs => Notepads/Commands/NewFileCommand.cs} (60%)
create mode 100644 SharpPad/Notepads/Commands/OpenFilesCommand.cs
rename SharpPad/{Utils/KBUtils.cs => Notepads/Commands/SaveAllDocumentsCommand.cs} (55%)
create mode 100644 SharpPad/Notepads/Controls/SearchResultBackgroundRenderer.cs
create mode 100644 SharpPad/Notepads/Controls/SearchResultColorizingTransformer.cs
delete mode 100644 SharpPad/Notepads/Serialisation/SerialisationRegistry.cs
delete mode 100644 SharpPad/RBC/BinaryUtils.cs
delete mode 100644 SharpPad/RBC/Events/ReadFromRBEEventHandler.cs
delete mode 100644 SharpPad/RBC/Events/WriteToRBEEventHandler.cs
delete mode 100644 SharpPad/RBC/RBEArray.cs
delete mode 100644 SharpPad/RBC/RBEBase.cs
delete mode 100644 SharpPad/RBC/RBEDictionary.cs
delete mode 100644 SharpPad/RBC/RBEGuid.cs
delete mode 100644 SharpPad/RBC/RBEList.cs
delete mode 100644 SharpPad/RBC/RBEPrimitive.cs
delete mode 100644 SharpPad/RBC/RBEStruct.cs
delete mode 100644 SharpPad/RBC/RBEType.cs
delete mode 100644 SharpPad/RBC/RBEUtils.cs
create mode 100644 SharpPad/Shortcuts/WPF/ShortcutStyles.xaml
rename SharpPad/{Controls/Dragger/EditStartEventArgs.cs => Shortcuts/WPF/ShortcutToolTip.cs} (72%)
create mode 100644 SharpPad/Shortcuts/WPF/ShortcutTooltipService.cs
delete mode 100644 SharpPad/Utils/AsyncLock.cs
delete mode 100644 SharpPad/Utils/AudioUtils.cs
delete mode 100644 SharpPad/Utils/CASLock.cs
delete mode 100644 SharpPad/Utils/Collections/AdvancedReadOnlyObservableCollection.cs
delete mode 100644 SharpPad/Utils/Colour.cs
delete mode 100644 SharpPad/Utils/CursorUtils.cs
delete mode 100644 SharpPad/Utils/DispatcherCallback.cs
delete mode 100644 SharpPad/Utils/Disposable/DisposableRef.cs
delete mode 100644 SharpPad/Utils/DynamicCodeConverter.cs
delete mode 100644 SharpPad/Utils/EventArgsCache.cs
delete mode 100644 SharpPad/Utils/Expressions/BasicNumericExpression.cs
delete mode 100644 SharpPad/Utils/Expressions/ComplexNumericExpression.cs
delete mode 100644 SharpPad/Utils/FFmpegError.cs
delete mode 100644 SharpPad/Utils/FileUtils.cs
delete mode 100644 SharpPad/Utils/HandlerList.cs
delete mode 100644 SharpPad/Utils/Helper.cs
delete mode 100644 SharpPad/Utils/IDisplayName.cs
delete mode 100644 SharpPad/Utils/IRenameTarget.cs
delete mode 100644 SharpPad/Utils/InheritedProperty.cs
delete mode 100644 SharpPad/Utils/IntRect.cs
delete mode 100644 SharpPad/Utils/ItemCacheStack.cs
delete mode 100644 SharpPad/Utils/Lang.cs
delete mode 100644 SharpPad/Utils/NumberAverager.cs
delete mode 100644 SharpPad/Utils/Numerics/SizeI.cs
delete mode 100644 SharpPad/Utils/Numerics/Vector2i.cs
delete mode 100644 SharpPad/Utils/Periodic.cs
delete mode 100644 SharpPad/Utils/PrecisionTimer.cs
delete mode 100644 SharpPad/Utils/RandomUtils.cs
delete mode 100644 SharpPad/Utils/Rect2d.cs
delete mode 100644 SharpPad/Utils/Rect2i.cs
delete mode 100644 SharpPad/Utils/Reference.cs
delete mode 100644 SharpPad/Utils/ReferenceEqualityComparer.cs
delete mode 100644 SharpPad/Utils/ResourceDictionaryDataTemplateSelector.cs
delete mode 100644 SharpPad/Utils/ScrollerUtils.cs
delete mode 100644 SharpPad/Utils/SelectionType.cs
delete mode 100644 SharpPad/Utils/ShellIconSize.cs
delete mode 100644 SharpPad/Utils/ShellUtils.cs
delete mode 100644 SharpPad/Utils/TextIncrement.cs
delete mode 100644 SharpPad/Utils/TextPointerUtils.cs
delete mode 100644 SharpPad/Utils/TextUtils.cs
delete mode 100644 SharpPad/Utils/UIUtils.cs
delete mode 100644 SharpPad/Utils/Vec2i.cs
diff --git a/SharpPad.sln b/SharpPad.sln
index 12ac9ae..2bc2a4d 100644
--- a/SharpPad.sln
+++ b/SharpPad.sln
@@ -7,18 +7,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpPad", "SharpPad\SharpP
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
- Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {DCFF60C3-0984-4579-B730-217FB8AAFF78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DCFF60C3-0984-4579-B730-217FB8AAFF78}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DCFF60C3-0984-4579-B730-217FB8AAFF78}.Debug|x64.ActiveCfg = Debug|x64
{DCFF60C3-0984-4579-B730-217FB8AAFF78}.Debug|x64.Build.0 = Debug|x64
- {DCFF60C3-0984-4579-B730-217FB8AAFF78}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DCFF60C3-0984-4579-B730-217FB8AAFF78}.Release|Any CPU.Build.0 = Release|Any CPU
{DCFF60C3-0984-4579-B730-217FB8AAFF78}.Release|x64.ActiveCfg = Release|x64
{DCFF60C3-0984-4579-B730-217FB8AAFF78}.Release|x64.Build.0 = Release|x64
EndGlobalSection
diff --git a/SharpPad/AdvancedMenuService/MenuService.cs b/SharpPad/AdvancedMenuService/MenuService.cs
index e29beb0..7276a2f 100644
--- a/SharpPad/AdvancedMenuService/MenuService.cs
+++ b/SharpPad/AdvancedMenuService/MenuService.cs
@@ -10,7 +10,7 @@
//
// SharpPad is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
diff --git a/SharpPad/AdvancedMenuService/RegularMenuService/AdvancedMenuItem.cs b/SharpPad/AdvancedMenuService/RegularMenuService/AdvancedMenuItem.cs
index 1252017..1c9139e 100644
--- a/SharpPad/AdvancedMenuService/RegularMenuService/AdvancedMenuItem.cs
+++ b/SharpPad/AdvancedMenuService/RegularMenuService/AdvancedMenuItem.cs
@@ -10,7 +10,7 @@
//
// SharpPad is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
diff --git a/SharpPad/AdvancedMenuService/RegularMenuService/AdvancedRegularMenu.cs b/SharpPad/AdvancedMenuService/RegularMenuService/AdvancedRegularMenu.cs
index b907368..d075f06 100644
--- a/SharpPad/AdvancedMenuService/RegularMenuService/AdvancedRegularMenu.cs
+++ b/SharpPad/AdvancedMenuService/RegularMenuService/AdvancedRegularMenu.cs
@@ -10,7 +10,7 @@
//
// SharpPad is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
diff --git a/SharpPad/App.config b/SharpPad/App.config
index 193aecc..dbb0630 100644
--- a/SharpPad/App.config
+++ b/SharpPad/App.config
@@ -1,6 +1,21 @@
+
+
+
+
+
+
+
+
+ 600
+
+
+ 600
+
+
+
\ No newline at end of file
diff --git a/SharpPad/App.xaml b/SharpPad/App.xaml
index 44136ff..ff75e61 100644
--- a/SharpPad/App.xaml
+++ b/SharpPad/App.xaml
@@ -12,16 +12,11 @@
+
-
-
-
-
-
-
diff --git a/SharpPad/App.xaml.cs b/SharpPad/App.xaml.cs
index 644c7cc..df9afa9 100644
--- a/SharpPad/App.xaml.cs
+++ b/SharpPad/App.xaml.cs
@@ -8,6 +8,7 @@
using SharpPad.Logger;
using SharpPad.Notepads;
using SharpPad.Notepads.Views;
+using SharpPad.Properties;
using SharpPad.Services.Messages;
using SharpPad.Shortcuts.Managing;
using SharpPad.Shortcuts.WPF;
@@ -61,7 +62,18 @@ private void App_OnStartup(object sender, StartupEventArgs args) {
// Notepad init
Notepad notepad = new Notepad();
- NotepadWindow window = new NotepadWindow();
+ int prefWidth = Settings.Default.NotepadWindowWidth;
+ if (prefWidth < 20)
+ prefWidth = 600;
+
+ int prefHeight = Settings.Default.NotepadWindowHeight;
+ if (prefHeight < 20)
+ prefHeight = 600;
+
+ NotepadWindow window = new NotepadWindow() {
+ Width = prefWidth, Height = prefHeight
+ };
+
window.Show();
window.Notepad = notepad;
this.MainWindow = window;
diff --git a/SharpPad/ApplicationCore.cs b/SharpPad/ApplicationCore.cs
index 38ee29a..152bb81 100644
--- a/SharpPad/ApplicationCore.cs
+++ b/SharpPad/ApplicationCore.cs
@@ -19,6 +19,7 @@
using System;
using System.Collections.Generic;
+using System.Configuration;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
@@ -27,6 +28,7 @@
using SharpPad.Logger;
using SharpPad.Notepads;
using SharpPad.Notepads.Commands;
+using SharpPad.Properties;
using SharpPad.Services.Files;
using SharpPad.Services.Messages;
using SharpPad.Services.WPF.Files;
@@ -79,9 +81,11 @@ public void OnApplicationLoaded(Notepad notepad, string[] args) {
if (args.Length > 0 && File.Exists(args[0])) {
OpenFilesCommand.OpenFile(notepad, args[0]);
}
- else if (Debugger.IsAttached) {
- this.LoadDefaultNotepad();
-
+ else {
+#if DEBUG
+ this.Nodepad.AddNewEditorForDocument(new NotepadDocument() {DocumentName = "New Document 1", Document = {Text = ""}, IsModified = false});
+ this.Nodepad.AddNewEditorForDocument(new NotepadDocument() {DocumentName = "New Document 2", Document = {Text = "some text here"}, IsModified = false});
+ this.Nodepad.AddNewEditorForDocument(new NotepadDocument() {DocumentName = "New Document 3", Document = {Text = "some more text 111"}, IsModified = false});
TaskManager.Instance.RunTask(async () => {
IActivityProgress prog = TaskManager.Instance.CurrentTask.Progress;
prog.Text = "Dummy task";
@@ -96,15 +100,14 @@ public void OnApplicationLoaded(Notepad notepad, string[] args) {
prog.OnProgress(progressPerUpdate);
}
});
+#else
+ this.Nodepad.AddNewEditorForDocument(new NotepadDocument() {DocumentName = "Document 1", Document = {Text = ""}, IsModified = false});
+#endif
}
}
- public void OnApplicationExiting() { }
-
- private void LoadDefaultNotepad() {
- this.Nodepad.AddNewEditor(new NotepadDocument() {DocumentName = "New Document 1", Document = {Text = ""}, IsModified = false});
- this.Nodepad.AddNewEditor(new NotepadDocument() {DocumentName = "New Document 2", Document = {Text = "some text here"}, IsModified = false});
- this.Nodepad.AddNewEditor(new NotepadDocument() {DocumentName = "New Document 3", Document = {Text = "some more text 111"}, IsModified = false});
+ public void OnApplicationExiting() {
+ Settings.Default.Save();
}
public void RegisterActions(CommandManager manager) {
diff --git a/SharpPad/AsyncDemo.cs b/SharpPad/AsyncDemo.cs
index 48eb4d0..cb0e33d 100644
--- a/SharpPad/AsyncDemo.cs
+++ b/SharpPad/AsyncDemo.cs
@@ -10,7 +10,7 @@
//
// SharpPad is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
diff --git a/SharpPad/AttachedProperties/AttachedInteractivity.cs b/SharpPad/AttachedProperties/AttachedInteractivity.cs
deleted file mode 100644
index 14d78c9..0000000
--- a/SharpPad/AttachedProperties/AttachedInteractivity.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// Copyright (c) 2023-2024 REghZy
-//
-// This file is part of SharpPad.
-//
-// SharpPad is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either
-// version 3.0 of the License, or (at your option) any later version.
-//
-// SharpPad is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with SharpPad. If not, see .
-//
-
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Input;
-using SharpPad.Utils;
-
-namespace SharpPad.AttachedProperties {
- public static class AttachedInteractivity {
- public static readonly DependencyProperty DoubleClickCommandProperty = DependencyProperty.RegisterAttached("DoubleClickCommand", typeof(ICommand), typeof(AttachedInteractivity), new PropertyMetadata(null, OnDoubleClickCommandChanged));
- public static readonly DependencyProperty UseICGForParameterProperty = DependencyProperty.RegisterAttached("UseICGForParameter", typeof(bool), typeof(AttachedInteractivity), new PropertyMetadata(BoolBox.False));
- public static readonly DependencyProperty UseDataContextAsParameterProperty = DependencyProperty.RegisterAttached("UseDataContextAsParameter", typeof(bool), typeof(AttachedInteractivity), new PropertyMetadata(BoolBox.True));
-
- public static void SetDoubleClickCommand(DependencyObject element, ICommand value) => element.SetValue(DoubleClickCommandProperty, value);
- public static ICommand GetDoubleClickCommand(DependencyObject element) => (ICommand) element.GetValue(DoubleClickCommandProperty);
-
- public static void SetUseICGForParameter(DependencyObject element, bool value) => element.SetValue(UseICGForParameterProperty, value.Box());
- public static bool GetUseICGForParameter(DependencyObject element) => (bool) element.GetValue(UseICGForParameterProperty);
-
- public static void SetUseDataContextAsParameter(DependencyObject element, bool value) => element.SetValue(UseDataContextAsParameterProperty, value.Box());
- public static bool GetUseDataContextAsParameter(DependencyObject element) => (bool) element.GetValue(UseDataContextAsParameterProperty);
-
- private static readonly MouseButtonEventHandler Handler = ControlOnMouseDown;
-
- private static void OnDoubleClickCommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {
- if (d is UIElement control) {
- // if (e.OldValue != null) {
- // int index = 0;
- // foreach (InputBinding item in control.InputBindings) {
- // if (item.Command == e.OldValue) {
- // control.InputBindings.RemoveAt(index);
- // break;
- // }
- // index++;
- // }
- // }
- // control.InputBindings.Add(new MouseBinding((ICommand) e.NewValue, new MouseGesture(MouseAction.LeftDoubleClick)));
- control.PreviewMouseDown -= Handler;
- if (e.NewValue != null) {
- control.PreviewMouseDown += Handler;
- }
- }
- }
-
- private static void ControlOnMouseDown(object sender, MouseButtonEventArgs e) {
- if (e.ClickCount == 2 && sender is UIElement control) {
- object parameter;
- ICommand command = GetDoubleClickCommand(control);
- if (command != null && command.CanExecute(parameter = GetParamForCommand(control))) {
- command.Execute(parameter);
- e.Handled = true;
- }
- }
- }
-
- private static object GetParamForCommand(DependencyObject control) {
- FrameworkElement element = control as FrameworkElement;
- object result = null;
- if (element != null && GetUseICGForParameter(control)) {
- if (element.Parent is ItemsControl x1) {
- result = x1.ItemContainerGenerator.ItemFromContainer(control);
- }
- else if (element.TemplatedParent is ItemsControl x2) {
- result = x2.ItemContainerGenerator.ItemFromContainer(control);
- }
- }
-
- if (result == DependencyProperty.UnsetValue) {
- result = null;
- }
-
- if (result != null) {
- return result;
- }
-
- return GetUseDataContextAsParameter(control) ? element?.DataContext : null;
- }
- }
-}
\ No newline at end of file
diff --git a/SharpPad/AttachedProperties/MultiSelectorHelper.cs b/SharpPad/AttachedProperties/MultiSelectorHelper.cs
deleted file mode 100644
index 2db0244..0000000
--- a/SharpPad/AttachedProperties/MultiSelectorHelper.cs
+++ /dev/null
@@ -1,220 +0,0 @@
-//
-// Copyright (c) 2023-2024 REghZy
-//
-// This file is part of SharpPad.
-//
-// SharpPad is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either
-// version 3.0 of the License, or (at your option) any later version.
-//
-// SharpPad is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with SharpPad. If not, see .
-//
-
-using System.Collections;
-using System.Collections.Specialized;
-using System.Diagnostics;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Controls.Primitives;
-using SharpPad.Utils;
-
-namespace SharpPad.AttachedProperties {
- ///
- /// A helper class for binding selected item collections.
- ///
- /// When using observable collections, you just bind it directly and then handle the collection changed events in your code
- ///
- ///
- /// When using a normal list (that does not implement ), ensure the list is non-null at
- /// all times. This class will set the list property (when the selected items change) to the same instance,
- /// allowing you to handle the change in your property's setter
- ///
- ///
- public static class MultiSelectorHelper {
- public static readonly DependencyProperty SelectedItemsProperty =
- DependencyProperty.RegisterAttached(
- "SelectedItems",
- typeof(IList),
- typeof(MultiSelectorHelper),
- new FrameworkPropertyMetadata(null, OnSelectedItemsChanged));
-
- public static readonly DependencyProperty UpdatePropertyOnSelectionChangedProperty =
- DependencyProperty.RegisterAttached(
- "UpdatePropertyOnSelectionChanged",
- typeof(bool),
- typeof(MultiSelectorHelper),
- new PropertyMetadata(BoolBox.True, (d, e) => AutoRegisterSelectionChangedHandler(d)));
-
- private static readonly DependencyPropertyKey UpdatingSelectionProperty =
- DependencyProperty.RegisterAttachedReadOnly(
- "UpdatingSelection",
- typeof(bool),
- typeof(MultiSelectorHelper),
- new PropertyMetadata(BoolBox.False));
-
- private static readonly DependencyProperty IsSelectionChangedRegisteredProperty =
- DependencyProperty.RegisterAttached(
- "IsSelectionChangedRegistered",
- typeof(bool),
- typeof(MultiSelectorHelper),
- new PropertyMetadata(BoolBox.False));
-
- public static IList GetSelectedItems(DependencyObject obj) => (IList) obj.GetValue(SelectedItemsProperty);
-
- public static void SetSelectedItems(DependencyObject obj, IList value) => obj.SetValue(SelectedItemsProperty, value);
-
- public static bool GetUpdatePropertyOnSelectionChanged(DependencyObject obj) => (bool) obj.GetValue(UpdatePropertyOnSelectionChangedProperty);
-
- public static void SetUpdatePropertyOnSelectionChanged(DependencyObject obj, bool value) => obj.SetValue(UpdatePropertyOnSelectionChangedProperty, value.Box());
-
- private static void SetUpdatingSelection(DependencyObject element, bool value) => element.SetValue(UpdatingSelectionProperty, value.Box());
- private static bool IsUpdatingSelection(DependencyObject element) => (bool) element.GetValue(UpdatingSelectionProperty.DependencyProperty);
-
- private static void SetIsSelectionChangedRegistered(DependencyObject element, bool value) => element.SetValue(IsSelectionChangedRegisteredProperty, value);
-
- private static bool GetIsSelectionChangedRegistered(DependencyObject element) => (bool) element.GetValue(IsSelectionChangedRegisteredProperty);
-
- private static void OnSelectedItemsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {
- if (IsUpdatingSelection(d)) {
- return;
- }
-
- if (d is Selector) {
- IList newList = (IList) e.NewValue;
- SetUpdatingSelection(d, true);
- try {
- IList list = null;
- if (d is ListBox box) {
- if (box.SelectionMode != SelectionMode.Single)
- list = box.SelectedItems;
- }
- else if (d is MultiSelector ms) {
- list = ms.SelectedItems;
- }
-
- if (list != null) {
- list.Clear();
- if (newList != null && newList.Count > 0) {
- foreach (object item in newList) {
- list.Add(item);
- }
- }
- }
- }
- finally {
- SetUpdatingSelection(d, false);
- }
- }
-
- AutoRegisterSelectionChangedHandler(d);
- }
-
- private static void AutoRegisterSelectionChangedHandler(DependencyObject d) {
- if (d is Selector s) {
- if (GetIsSelectionChangedRegistered(d)) {
- if (!GetUpdatePropertyOnSelectionChanged(d)) {
- SetIsSelectionChangedRegistered(d, false);
- s.SelectionChanged -= OnUISelectionChanged;
- }
- }
- else if (GetUpdatePropertyOnSelectionChanged(d)) {
- SetIsSelectionChangedRegistered(d, true);
- s.SelectionChanged += OnUISelectionChanged;
- }
- }
- }
-
- private static bool ListEquals(IList a, IList b) {
- int cA = a.Count, cB = b.Count;
- if (cA != cB) {
- return false;
- }
-
- for (int i = 0; i < cA; i++) {
- if (!ReferenceEquals(a[i], b[i])) {
- return false;
- }
- }
-
- return true;
- }
-
- private static void OnUISelectionChanged(object sender, SelectionChangedEventArgs e) {
- if (sender is Selector selector) {
- if (IsUpdatingSelection(selector))
- return;
-
- IList dstList = GetSelectedItems(selector);
- if (dstList == null)
- return;
-
- bool update = false;
- try {
- IList srcList;
- switch (selector) {
- case ListBox lb when lb.SelectionMode != SelectionMode.Single:
- srcList = lb.SelectedItems;
- break;
- case MultiSelector ms:
- srcList = ms.SelectedItems;
- break;
- default:
- srcList = null;
- break;
- }
-
- if (srcList != null) {
- // Can massively improve performance for property pages
- if (ListEquals(srcList, dstList)) {
- return;
- }
-
- SetUpdatingSelection(selector, update = true);
- if (srcList.Count < 2) {
- // most likely more efficient to clear and add a possible single selection
- dstList.Clear();
- foreach (object item in srcList)
- dstList.Add(item);
- }
- else {
- int expected = dstList.Count - e.RemovedItems.Count + e.AddedItems.Count;
- if (expected == srcList.Count) {
- foreach (object o in e.RemovedItems)
- dstList.Remove(o);
- foreach (object o in e.AddedItems)
- dstList.Add(o);
- }
- else {
- Debug.WriteLine($"Selection discrepancy: Expected {expected} selected items in the source list, but got {srcList.Count}");
- dstList.Clear();
- foreach (object item in srcList)
- dstList.Add(item);
- }
- }
- }
- else {
- SetUpdatingSelection(selector, update = true);
- foreach (object o in e.RemovedItems)
- dstList.Remove(o);
- foreach (object o in e.AddedItems)
- dstList.Add(o);
- }
-
- if (!(dstList is INotifyCollectionChanged))
- SetSelectedItems(selector, dstList);
- }
- finally {
- if (update)
- SetUpdatingSelection(selector, false);
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/SharpPad/AttachedProperties/ObservableSelectionHelper.cs b/SharpPad/AttachedProperties/ObservableSelectionHelper.cs
deleted file mode 100644
index 4ce2cd7..0000000
--- a/SharpPad/AttachedProperties/ObservableSelectionHelper.cs
+++ /dev/null
@@ -1,504 +0,0 @@
-//
-// Copyright (c) 2023-2024 REghZy
-//
-// This file is part of SharpPad.
-//
-// SharpPad is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either
-// version 3.0 of the License, or (at your option) any later version.
-//
-// SharpPad is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with SharpPad. If not, see .
-//
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.Specialized;
-using System.Diagnostics;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Controls.Primitives;
-using SharpPad.Utils;
-
-namespace SharpPad.AttachedProperties {
- ///
- /// A helper class for binding a source collection (typically an observable collection) to a target's selected items,
- /// with support for two-way selection change. The source list must implement
- ///
- public static class ObservableSelectionHelper {
- private static readonly Dictionary