From 7becf9b4ea93c123cd36f952576487a243c1b36e Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Mon, 20 May 2024 09:05:13 +0200 Subject: [PATCH] some more structure --- .../MainWindow/MainTabs/TabMyGroupsFeature.cs | 2 +- .../MainWindow/MainTabs/TabMyUserFeature.cs | 2 +- .../MainWindow/QuickAction/HomeFeature.cs | 3 +- .../MainWindow/QuickAction/SettingsFeature.cs | 3 +- ...st.Designer.cs => TabCharView.Designer.cs} | 2 +- .../{TabEditChar.cs => TabCharView.cs} | 4 +- .../{TabCharList.resx => TabCharView.resx} | 0 .../UI/MainTabs/TabGroupView.Designer.cs | 37 ++++++ .../UI/MainTabs/TabGroupView.cs | 22 ++++ .../UI/MainTabs/TabGroupsView.Designer.cs | 37 ++++++ .../UI/MainTabs/TabGroupsView.cs | 22 ++++ .../{TabEditChar.resx => TabGroupsView.resx} | 0 ...ar.Designer.cs => TabUserView.Designer.cs} | 2 +- .../{TabCharList.cs => TabUserView.cs} | 4 +- .../UI/MainTabs/TabUserView.resx | 120 ++++++++++++++++++ OwnChar.App.Desktop/UI/Windows/MainWindow.cs | 21 ++- .../UI/Windows/MainWindowApi.cs | 23 ---- 17 files changed, 269 insertions(+), 35 deletions(-) rename OwnChar.App.Desktop/UI/MainTabs/{TabCharList.Designer.cs => TabCharView.Designer.cs} (97%) rename OwnChar.App.Desktop/UI/MainTabs/{TabEditChar.cs => TabCharView.cs} (70%) rename OwnChar.App.Desktop/UI/MainTabs/{TabCharList.resx => TabCharView.resx} (100%) create mode 100644 OwnChar.App.Desktop/UI/MainTabs/TabGroupView.Designer.cs create mode 100644 OwnChar.App.Desktop/UI/MainTabs/TabGroupView.cs create mode 100644 OwnChar.App.Desktop/UI/MainTabs/TabGroupsView.Designer.cs create mode 100644 OwnChar.App.Desktop/UI/MainTabs/TabGroupsView.cs rename OwnChar.App.Desktop/UI/MainTabs/{TabEditChar.resx => TabGroupsView.resx} (100%) rename OwnChar.App.Desktop/UI/MainTabs/{TabEditChar.Designer.cs => TabUserView.Designer.cs} (97%) rename OwnChar.App.Desktop/UI/MainTabs/{TabCharList.cs => TabUserView.cs} (83%) create mode 100644 OwnChar.App.Desktop/UI/MainTabs/TabUserView.resx delete mode 100644 OwnChar.App.Desktop/UI/Windows/MainWindowApi.cs diff --git a/OwnChar.App.Desktop/Features/MainWindow/MainTabs/TabMyGroupsFeature.cs b/OwnChar.App.Desktop/Features/MainWindow/MainTabs/TabMyGroupsFeature.cs index 463f7fc..5347eb6 100644 --- a/OwnChar.App.Desktop/Features/MainWindow/MainTabs/TabMyGroupsFeature.cs +++ b/OwnChar.App.Desktop/Features/MainWindow/MainTabs/TabMyGroupsFeature.cs @@ -10,7 +10,7 @@ namespace OwnChar.App.Desktop.Features.MainWindow.MainTabs protected override PluginModuleUI CreateNewUI() { - return new TabCharList(); + return new TabGroupsView(); } } } diff --git a/OwnChar.App.Desktop/Features/MainWindow/MainTabs/TabMyUserFeature.cs b/OwnChar.App.Desktop/Features/MainWindow/MainTabs/TabMyUserFeature.cs index c439804..07c120e 100644 --- a/OwnChar.App.Desktop/Features/MainWindow/MainTabs/TabMyUserFeature.cs +++ b/OwnChar.App.Desktop/Features/MainWindow/MainTabs/TabMyUserFeature.cs @@ -10,7 +10,7 @@ namespace OwnChar.App.Desktop.Features.MainWindow.MainTabs protected override PluginModuleUI CreateNewUI() { - return new TabEditChar(); + return new TabUserView(); } } } diff --git a/OwnChar.App.Desktop/Features/MainWindow/QuickAction/HomeFeature.cs b/OwnChar.App.Desktop/Features/MainWindow/QuickAction/HomeFeature.cs index 4aa3c52..9b2c7e0 100644 --- a/OwnChar.App.Desktop/Features/MainWindow/QuickAction/HomeFeature.cs +++ b/OwnChar.App.Desktop/Features/MainWindow/QuickAction/HomeFeature.cs @@ -1,6 +1,7 @@ using OwnChar.App.Desktop.Features.MainWindow.MainTabs; using Pilz.Plugins.Advanced; using Pilz.Plugins.Advanced.UI.Telerik; +using System; namespace OwnChar.App.Desktop.Features.MainWindow.QuickAction { @@ -10,7 +11,7 @@ namespace OwnChar.App.Desktop.Features.MainWindow.QuickAction protected override PluginModuleUI CreateNewUI() { - return null; + throw new NotImplementedException(); //return new TabEditChar(); } } diff --git a/OwnChar.App.Desktop/Features/MainWindow/QuickAction/SettingsFeature.cs b/OwnChar.App.Desktop/Features/MainWindow/QuickAction/SettingsFeature.cs index 4f2f48f..bacf8ef 100644 --- a/OwnChar.App.Desktop/Features/MainWindow/QuickAction/SettingsFeature.cs +++ b/OwnChar.App.Desktop/Features/MainWindow/QuickAction/SettingsFeature.cs @@ -1,6 +1,7 @@ using OwnChar.App.Desktop.Features.MainWindow.MainTabs; using Pilz.Plugins.Advanced; using Pilz.Plugins.Advanced.UI.Telerik; +using System; namespace OwnChar.App.Desktop.Features.MainWindow.QuickAction { @@ -10,7 +11,7 @@ namespace OwnChar.App.Desktop.Features.MainWindow.QuickAction protected override PluginModuleUI CreateNewUI() { - return null; + throw new NotImplementedException(); //return new TabSettings(); } } diff --git a/OwnChar.App.Desktop/UI/MainTabs/TabCharList.Designer.cs b/OwnChar.App.Desktop/UI/MainTabs/TabCharView.Designer.cs similarity index 97% rename from OwnChar.App.Desktop/UI/MainTabs/TabCharList.Designer.cs rename to OwnChar.App.Desktop/UI/MainTabs/TabCharView.Designer.cs index 7633a25..c13ea5d 100644 --- a/OwnChar.App.Desktop/UI/MainTabs/TabCharList.Designer.cs +++ b/OwnChar.App.Desktop/UI/MainTabs/TabCharView.Designer.cs @@ -1,6 +1,6 @@ namespace OwnChar.App.Desktop.UI.MainTabs { - partial class TabCharList + partial class TabCharView { /// /// Erforderliche Designervariable. diff --git a/OwnChar.App.Desktop/UI/MainTabs/TabEditChar.cs b/OwnChar.App.Desktop/UI/MainTabs/TabCharView.cs similarity index 70% rename from OwnChar.App.Desktop/UI/MainTabs/TabEditChar.cs rename to OwnChar.App.Desktop/UI/MainTabs/TabCharView.cs index efdc203..59cbc0e 100644 --- a/OwnChar.App.Desktop/UI/MainTabs/TabEditChar.cs +++ b/OwnChar.App.Desktop/UI/MainTabs/TabCharView.cs @@ -2,9 +2,9 @@ namespace OwnChar.App.Desktop.UI.MainTabs { - public partial class TabEditChar : PluginModuleUI + public partial class TabCharView : PluginModuleUI { - public TabEditChar() + public TabCharView() { ActionPanelVisible = false; InitializeComponent(); diff --git a/OwnChar.App.Desktop/UI/MainTabs/TabCharList.resx b/OwnChar.App.Desktop/UI/MainTabs/TabCharView.resx similarity index 100% rename from OwnChar.App.Desktop/UI/MainTabs/TabCharList.resx rename to OwnChar.App.Desktop/UI/MainTabs/TabCharView.resx diff --git a/OwnChar.App.Desktop/UI/MainTabs/TabGroupView.Designer.cs b/OwnChar.App.Desktop/UI/MainTabs/TabGroupView.Designer.cs new file mode 100644 index 0000000..1a9ad05 --- /dev/null +++ b/OwnChar.App.Desktop/UI/MainTabs/TabGroupView.Designer.cs @@ -0,0 +1,37 @@ +namespace OwnChar.App.Desktop.UI.MainTabs +{ + partial class TabGroupView + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + } + + #endregion + } +} diff --git a/OwnChar.App.Desktop/UI/MainTabs/TabGroupView.cs b/OwnChar.App.Desktop/UI/MainTabs/TabGroupView.cs new file mode 100644 index 0000000..25d77e9 --- /dev/null +++ b/OwnChar.App.Desktop/UI/MainTabs/TabGroupView.cs @@ -0,0 +1,22 @@ +using Pilz.Plugins.Advanced.UI.Telerik; +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 OwnChar.App.Desktop.UI.MainTabs +{ + public partial class TabGroupView : PluginModuleUI + { + public TabGroupView() + { + ActionPanelVisible = false; + InitializeComponent(); + } + } +} diff --git a/OwnChar.App.Desktop/UI/MainTabs/TabGroupsView.Designer.cs b/OwnChar.App.Desktop/UI/MainTabs/TabGroupsView.Designer.cs new file mode 100644 index 0000000..f566db0 --- /dev/null +++ b/OwnChar.App.Desktop/UI/MainTabs/TabGroupsView.Designer.cs @@ -0,0 +1,37 @@ +namespace OwnChar.App.Desktop.UI.MainTabs +{ + partial class TabGroupsView + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + } + + #endregion + } +} diff --git a/OwnChar.App.Desktop/UI/MainTabs/TabGroupsView.cs b/OwnChar.App.Desktop/UI/MainTabs/TabGroupsView.cs new file mode 100644 index 0000000..cdec21c --- /dev/null +++ b/OwnChar.App.Desktop/UI/MainTabs/TabGroupsView.cs @@ -0,0 +1,22 @@ +using Pilz.Plugins.Advanced.UI.Telerik; +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 OwnChar.App.Desktop.UI.MainTabs +{ + public partial class TabGroupsView : PluginModuleUI + { + public TabGroupsView() + { + ActionPanelVisible = false; + InitializeComponent(); + } + } +} diff --git a/OwnChar.App.Desktop/UI/MainTabs/TabEditChar.resx b/OwnChar.App.Desktop/UI/MainTabs/TabGroupsView.resx similarity index 100% rename from OwnChar.App.Desktop/UI/MainTabs/TabEditChar.resx rename to OwnChar.App.Desktop/UI/MainTabs/TabGroupsView.resx diff --git a/OwnChar.App.Desktop/UI/MainTabs/TabEditChar.Designer.cs b/OwnChar.App.Desktop/UI/MainTabs/TabUserView.Designer.cs similarity index 97% rename from OwnChar.App.Desktop/UI/MainTabs/TabEditChar.Designer.cs rename to OwnChar.App.Desktop/UI/MainTabs/TabUserView.Designer.cs index c0a26c4..c198209 100644 --- a/OwnChar.App.Desktop/UI/MainTabs/TabEditChar.Designer.cs +++ b/OwnChar.App.Desktop/UI/MainTabs/TabUserView.Designer.cs @@ -1,6 +1,6 @@ namespace OwnChar.App.Desktop.UI.MainTabs { - partial class TabEditChar + partial class TabUserView { /// /// Erforderliche Designervariable. diff --git a/OwnChar.App.Desktop/UI/MainTabs/TabCharList.cs b/OwnChar.App.Desktop/UI/MainTabs/TabUserView.cs similarity index 83% rename from OwnChar.App.Desktop/UI/MainTabs/TabCharList.cs rename to OwnChar.App.Desktop/UI/MainTabs/TabUserView.cs index 53c94c1..ecdb2d0 100644 --- a/OwnChar.App.Desktop/UI/MainTabs/TabCharList.cs +++ b/OwnChar.App.Desktop/UI/MainTabs/TabUserView.cs @@ -11,9 +11,9 @@ using System.Windows.Forms; namespace OwnChar.App.Desktop.UI.MainTabs { - public partial class TabCharList : PluginModuleUI + public partial class TabUserView : PluginModuleUI { - public TabCharList() + public TabUserView() { ActionPanelVisible = false; InitializeComponent(); diff --git a/OwnChar.App.Desktop/UI/MainTabs/TabUserView.resx b/OwnChar.App.Desktop/UI/MainTabs/TabUserView.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/OwnChar.App.Desktop/UI/MainTabs/TabUserView.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/OwnChar.App.Desktop/UI/Windows/MainWindow.cs b/OwnChar.App.Desktop/UI/Windows/MainWindow.cs index bf0f54e..5cca06b 100644 --- a/OwnChar.App.Desktop/UI/Windows/MainWindow.cs +++ b/OwnChar.App.Desktop/UI/Windows/MainWindow.cs @@ -1,11 +1,13 @@ -using Pilz.Plugins.Advanced; +using OwnChar.App.Desktop.Api; +using Pilz.Plugins.Advanced; using Pilz.Plugins.Advanced.UI.Telerik; using System; +using System.Windows.Forms; using Telerik.WinControls.UI; namespace OwnChar.App.Desktop.UI.Windows { - public partial class MainWindow : RadForm + public partial class MainWindow : RadTabbedForm { public MainWindowApi Api { get; } @@ -16,6 +18,21 @@ namespace OwnChar.App.Desktop.UI.Windows PluginFeatureController.Instance.Features.Get(FeatureCodes.MainTab).InsertItemsTo(radMenuItem2.Items, customClickHandler: MainTabItem_Clicked); } + public class MainWindowApi(MainWindow mainWindow) : IMainWindowApi + { + public MainWindow MainWindow { get; } = mainWindow; + + public void CloseTab(Control content) + { + throw new NotImplementedException(); + } + + public void OpenTab(Control content) + { + throw new NotImplementedException(); + } + } + private void MainTabItem_Clicked(object? sender, EventArgs e) { //if (sender is RadMenuItem item && item.Tag is PluginModule module) diff --git a/OwnChar.App.Desktop/UI/Windows/MainWindowApi.cs b/OwnChar.App.Desktop/UI/Windows/MainWindowApi.cs deleted file mode 100644 index d5c32c4..0000000 --- a/OwnChar.App.Desktop/UI/Windows/MainWindowApi.cs +++ /dev/null @@ -1,23 +0,0 @@ -using OwnChar.App.Desktop.Api; -using System; -using System.Windows.Forms; - -namespace OwnChar.App.Desktop.UI.Windows; - -public partial class MainWindow -{ - public class MainWindowApi(MainWindow mainWindow) : IMainWindowApi - { - public MainWindow MainWindow { get; } = mainWindow; - - public void CloseTab(Control content) - { - throw new NotImplementedException(); - } - - public void OpenTab(Control content) - { - throw new NotImplementedException(); - } - } -}