From 81c97c1b93de97b2b784273d0789af154ff2ee99 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 8 May 2026 23:16:26 +0100 Subject: [PATCH] Changed to .NET 10 Changed to remove TileContainer Added loading progress dialog --- CopyToTileForm.cs | 105 ++ EditSectionForm.resx => CopyToTileForm.resx | 0 EditTileFolderForm.cs => EditFolderForm.cs | 104 +- ...TileFolderForm.resx => EditFolderForm.resx | 0 EditSectionForm.cs => EditGroupForm.cs | 94 +- EditGroupForm.resx | 120 +++ EditTileForm.cs | 135 ++- EditTileForm.resx | 4 +- LoadingForm.cs | 321 ++++++ LoadingForm.resx | 120 +++ MainForm.Designer.cs | 109 +- MainForm.cs | 994 +++++++++++++----- Models/SaveFile/App3Options.cs | 58 + Models/SaveFile/App4Options.cs | 352 +++++++ .../AppOptionsBase.cs} | 11 +- Models/TileGroupModel.cs | 19 - Models/TileModel.cs | 259 ----- OptionsForm.cs | 537 +++++----- Program.cs | 13 +- RokettoLaunch.csproj | 18 +- Windows/Forms/TilePanel.cs | 269 +---- skye.sln | 16 +- 22 files changed, 2315 insertions(+), 1343 deletions(-) create mode 100644 CopyToTileForm.cs rename EditSectionForm.resx => CopyToTileForm.resx (100%) rename EditTileFolderForm.cs => EditFolderForm.cs (66%) rename EditTileFolderForm.resx => EditFolderForm.resx (100%) rename EditSectionForm.cs => EditGroupForm.cs (67%) create mode 100644 EditGroupForm.resx create mode 100644 LoadingForm.cs create mode 100644 LoadingForm.resx create mode 100644 Models/SaveFile/App3Options.cs create mode 100644 Models/SaveFile/App4Options.cs rename Models/{AppOptions.cs => SaveFile/AppOptionsBase.cs} (72%) delete mode 100644 Models/TileGroupModel.cs delete mode 100644 Models/TileModel.cs diff --git a/CopyToTileForm.cs b/CopyToTileForm.cs new file mode 100644 index 0000000..6ef750f --- /dev/null +++ b/CopyToTileForm.cs @@ -0,0 +1,105 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; +using RyzStudio.Windows.Forms; +using RyzStudio.Windows.ThemedForms; + +namespace RokettoLaunch +{ + public class CopyToTileForm : Form + { + private Label label1; + private ThPickerBox pickerBox1; + private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1; + + + private List result = null; + + + public CopyToTileForm(List model = null) + { + InitializeComponent(); + + UISetup.Dialog(this, true); + + this.Text = "Copy To..."; + + result = model; + + pickerBox1.Setup(model, 0); + } + + protected override void OnShown(EventArgs e) + { + base.OnShown(e); + + pickerBox1.Value = 0; + } + + private void InitializeComponent() + { + label1 = new Label(); + pickerBox1 = new ThPickerBox(); + dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter(); + SuspendLayout(); + // + // label1 + // + label1.AutoSize = true; + label1.BackColor = Color.Transparent; + label1.ForeColor = SystemColors.ControlText; + label1.Location = new Point(10, 20); + label1.Margin = new Padding(0); + label1.Name = "label1"; + label1.Padding = new Padding(0, 9, 0, 0); + label1.Size = new Size(40, 24); + label1.TabIndex = 153; + label1.Text = "Group"; + label1.TextAlign = ContentAlignment.MiddleLeft; + // + // pickerBox1 + // + pickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + pickerBox1.BackColor = Color.Transparent; + pickerBox1.EnableMovable = false; + pickerBox1.Location = new Point(95, 20); + pickerBox1.Name = "pickerBox1"; + pickerBox1.SelectedIndex = -1; + pickerBox1.Size = new Size(280, 32); + pickerBox1.TabIndex = 174; + pickerBox1.TabStop = false; + // + // dialogFooter1 + // + dialogFooter1.BackColor = Color.FromArgb(240, 240, 240); + dialogFooter1.Dock = DockStyle.Bottom; + dialogFooter1.EnableMovable = false; + dialogFooter1.IsBusy = false; + dialogFooter1.Location = new Point(0, 451); + dialogFooter1.Name = "dialogFooter1"; + dialogFooter1.Size = new Size(384, 70); + dialogFooter1.TabIndex = 0; + dialogFooter1.TabStop = false; + // + // CopyToTileForm + // + BackColor = Color.White; + ClientSize = new Size(384, 521); + Controls.Add(dialogFooter1); + Controls.Add(pickerBox1); + Controls.Add(label1); + MinimumSize = new Size(400, 560); + Name = "CopyToTileForm"; + Text = "Copy To..."; + ResumeLayout(false); + PerformLayout(); + } + + public int Result + { + get => pickerBox1.Value; + } + + } +} \ No newline at end of file diff --git a/EditSectionForm.resx b/CopyToTileForm.resx similarity index 100% rename from EditSectionForm.resx rename to CopyToTileForm.resx diff --git a/EditTileFolderForm.cs b/EditFolderForm.cs similarity index 66% rename from EditTileFolderForm.cs rename to EditFolderForm.cs index fdfcf7b..045285d 100644 --- a/EditTileFolderForm.cs +++ b/EditFolderForm.cs @@ -5,14 +5,14 @@ using System.Drawing; using System.IO; using System.Linq; using System.Windows.Forms; -using RokettoLaunch.Models; +using RokettoLaunch.Models.SaveFile; using RyzStudio.Windows.Forms; using RyzStudio.Windows.ThemedForms; using RyzStudio.Windows.ThemedForms.ButtonTextBox; namespace RokettoLaunch { - public class EditTileFolderForm : Form + public class EditFolderForm : Form { private Label label1; private ThClearableTextBox textBox1; @@ -21,21 +21,27 @@ namespace RokettoLaunch private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1; - private TileModel result = null; + private App4Options.Item result = null; - public EditTileFolderForm(TileModel model = null) + public EditFolderForm(App4Options.Item model = null) { InitializeComponent(); - UISetup.Dialog(this); + UISetup.Dialog(this, true); this.Text = (result == null) ? "Add Folder" : "Edit Folder"; result = model; + } + + protected override void OnShown(EventArgs e) + { + base.OnShown(e); textBox1.Text = result?.Title ?? "New Folder"; - foreach (TileModel item in result?.Items ?? new List()) + + foreach (var item in result?.Items ?? new List()) { if (item.IsGroup) { @@ -60,13 +66,11 @@ namespace RokettoLaunch textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; textBox1.BackColor = Color.Transparent; textBox1.ClearedValue = ""; - textBox1.EnableReactiveVisual = true; - textBox1.Font = new Font("Microsoft Sans Serif", 8.25F); + textBox1.EnableMovable = false; textBox1.Icon = "O"; textBox1.IconSize = 13F; - textBox1.Location = new Point(109, 20); + textBox1.Location = new Point(115, 20); textBox1.Name = "textBox1"; - textBox1.Padding = new Padding(4, 4, 3, 3); textBox1.Size = new Size(260, 32); textBox1.TabIndex = 152; textBox1.TabStop = false; @@ -88,21 +92,18 @@ namespace RokettoLaunch // // listBox1 // - listBox1.AllowDrop = true; listBox1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; listBox1.BackColor = Color.Transparent; - listBox1.EnableReactiveVisual = true; - listBox1.Font = new Font("Microsoft Sans Serif", 8.25F); - listBox1.Location = new Point(109, 62); + listBox1.EnableMovable = false; + listBox1.Location = new Point(115, 62); listBox1.Name = "listBox1"; - listBox1.Padding = new Padding(4, 4, 3, 3); listBox1.Size = new Size(260, 366); listBox1.TabIndex = 180; - listBox1.OnAdd += listBox1_OnAdd; - listBox1.OnEdit += listBox1_OnEdit; - listBox1.OnCopy += listBox1_OnCopy; - listBox1.DragDrop += listBox1_DragDrop; - listBox1.DragOver += listBox1_DragOver; + listBox1.OnAdd += ListBox_OnAdd; + listBox1.OnEdit += ListBox_OnEdit; + listBox1.OnCopy += ListBox_OnCopy; + listBox1.DragDrop += ListBox_DragDrop; + listBox1.DragOver += ListBox_DragOver; // // label2 // @@ -113,21 +114,22 @@ namespace RokettoLaunch label2.Margin = new Padding(0); label2.Name = "label2"; label2.Padding = new Padding(0, 9, 0, 0); - label2.Size = new Size(82, 24); + label2.Size = new Size(30, 24); label2.TabIndex = 181; - label2.Text = "Tile Collection"; + label2.Text = "Tiles"; label2.TextAlign = ContentAlignment.MiddleLeft; // // dialogFooter1 // dialogFooter1.BackColor = Color.FromArgb(240, 240, 240); - dialogFooter1.Button1Text = "&Save"; - dialogFooter1.Dialog = this; dialogFooter1.Dock = DockStyle.Bottom; + dialogFooter1.EnableMovable = false; dialogFooter1.IsBusy = false; - dialogFooter1.Location = new Point(0, 437); + dialogFooter1.Location = new Point(0, 451); dialogFooter1.Name = "dialogFooter1"; - dialogFooter1.Size = new Size(384, 84); + dialogFooter1.Size = new Size(384, 70); + dialogFooter1.TabIndex = 0; + dialogFooter1.TabStop = false; // // EditFolderForm // @@ -145,20 +147,20 @@ namespace RokettoLaunch PerformLayout(); } - public TileModel Result + public App4Options.Item Result { get { if (result == null) { - result = new TileModel(); + result = new App4Options.Item(); } result.Title = textBox1.Text?.Trim() ?? string.Empty; result.IsGroup = true; - result.Items = new List(); + result.Items = new List(); - foreach (TileModel item in listBox1.ListBox.Items.OfType()) + foreach (var item in listBox1.ListBox.Items.OfType()) { if (item.IsGroup) { @@ -173,7 +175,7 @@ namespace RokettoLaunch } - private void listBox1_OnAdd(object sender, EventArgs e) + private void ListBox_OnAdd(object sender, EventArgs e) { var form = new EditTileForm(); if (form.ShowDialog() == DialogResult.OK) @@ -182,7 +184,7 @@ namespace RokettoLaunch }; } - private void listBox1_OnEdit(object sender, EventArgs e) + private void ListBox_OnEdit(object sender, EventArgs e) { if (listBox1.ListBox.Items.Count <= 0) { @@ -200,7 +202,7 @@ namespace RokettoLaunch return; } - var form = new EditTileForm((TileModel)listBox1.ListBox.SelectedItem); + var form = new EditTileForm((App4Options.Item)listBox1.ListBox.SelectedItem); if (form.ShowDialog() == DialogResult.OK) { listBox1.ListBox.Items.RemoveAt(n); @@ -208,12 +210,12 @@ namespace RokettoLaunch }; } - private void listBox1_OnCopy(object sender, EventArgs e) + private void ListBox_OnCopy(object sender, EventArgs e) { - listBox1.ListBox.CopyItem(); + listBox1.ListBox.CopyItem(); } - private void listBox1_DragOver(object sender, DragEventArgs e) + private void ListBox_DragOver(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { @@ -225,7 +227,7 @@ namespace RokettoLaunch } } - private void listBox1_DragDrop(object sender, DragEventArgs e) + private void ListBox_DragDrop(object sender, DragEventArgs e) { var fileList = e.Data.GetData(DataFormats.FileDrop) as string[]; if (fileList == null) @@ -245,34 +247,12 @@ namespace RokettoLaunch continue; } - var model = new TileModel() + var model = new App4Options.Item() { - ProcessFilename = item, - Title = Path.GetFileName(item) + TargetPath = item, + Title = RyzStudio.IO.File.GetName(item) }; - // exe - if (Path.GetExtension(item).Equals(".exe", StringComparison.CurrentCultureIgnoreCase)) - { - if (File.Exists(item)) - { - try - { - FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(item); - if (fvi != null) - { - model.Title = fvi.ProductName; - } - } - catch - { - // do nothing - } - } - - model.Title = (string.IsNullOrWhiteSpace(model.Title) ? "Untitled" : Path.GetFileNameWithoutExtension(item)); - } - listBox1.ListBox.Items.Add(model); } } diff --git a/EditTileFolderForm.resx b/EditFolderForm.resx similarity index 100% rename from EditTileFolderForm.resx rename to EditFolderForm.resx diff --git a/EditSectionForm.cs b/EditGroupForm.cs similarity index 67% rename from EditSectionForm.cs rename to EditGroupForm.cs index 5bcc2d8..5063b67 100644 --- a/EditSectionForm.cs +++ b/EditGroupForm.cs @@ -1,12 +1,13 @@ -using System.Windows.Forms; -using RokettoLaunch.Models; +using System; +using System.Windows.Forms; +using RokettoLaunch.Models.SaveFile; using RyzStudio.Windows.Forms; using RyzStudio.Windows.ThemedForms.ButtonTextBox; using RyzStudio.Windows.ThemedForms.PickerBox; namespace RokettoLaunch { - public class EditSectionForm : Form + public class EditGroupForm : Form { private Label label2; private Label label1; @@ -15,33 +16,31 @@ namespace RokettoLaunch private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1; - private TileGroupModel result = null; + private App4Options.Group result = null; - public EditSectionForm(TileGroupModel model = null) + public EditGroupForm(App4Options.Group model = null) { InitializeComponent(); - UISetup.Dialog(this); + UISetup.Dialog(this, true); this.Text = (result == null) ? "Add Group" : "Edit Group"; result = model; - pickerBox1.ComboBox.Items.Clear(); - pickerBox1.ComboBox.Items.AddRange(new string[] { "No", "Yes" }); - if (pickerBox1.ComboBox.Items.Count > 0) - { - pickerBox1.ComboBox.SelectedIndex = 0; - } - - if (result != null) - { - textBox1.Text = result.Title?.Trim() ?? string.Empty; - pickerBox1.Value = result.IsExpanded; - } + pickerBox1.Setup([ "No", "Yes" ], 0); } + protected override void OnShown(EventArgs e) + { + base.OnShown(e); + + textBox1.Text = result?.Title?.Trim() ?? "New Group"; + pickerBox1.Value = result?.IsOpen ?? true; + } + + private void InitializeComponent() { textBox1 = new ThClearableTextBox(); @@ -50,26 +49,24 @@ namespace RokettoLaunch pickerBox1 = new ThYesNoPickerBox(); dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter(); SuspendLayout(); - // + // // textBox1 - // + // textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; textBox1.BackColor = System.Drawing.Color.Transparent; textBox1.ClearedValue = ""; - textBox1.EnableReactiveVisual = true; - textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + textBox1.EnableMovable = false; textBox1.Icon = "O"; textBox1.IconSize = 13F; - textBox1.Location = new System.Drawing.Point(192, 20); + textBox1.Location = new System.Drawing.Point(115, 20); textBox1.Name = "textBox1"; - textBox1.Padding = new Padding(4, 4, 3, 3); - textBox1.Size = new System.Drawing.Size(177, 32); + textBox1.Size = new System.Drawing.Size(260, 32); textBox1.TabIndex = 152; textBox1.TabStop = false; textBox1.UseSystemPasswordChar = false; - // + // // label2 - // + // label2.AutoSize = true; label2.BackColor = System.Drawing.Color.Transparent; label2.ForeColor = System.Drawing.SystemColors.ControlText; @@ -81,9 +78,9 @@ namespace RokettoLaunch label2.TabIndex = 155; label2.Text = "Show Expanded"; label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // + // // label1 - // + // label1.AutoSize = true; label1.BackColor = System.Drawing.Color.Transparent; label1.ForeColor = System.Drawing.SystemColors.ControlText; @@ -95,35 +92,34 @@ namespace RokettoLaunch label1.TabIndex = 153; label1.Text = "Title"; label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // + // // pickerBox1 - // + // pickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right; pickerBox1.BackColor = System.Drawing.Color.Transparent; - pickerBox1.EnableReactiveVisual = true; - pickerBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - pickerBox1.Location = new System.Drawing.Point(285, 62); + pickerBox1.EnableMovable = false; + pickerBox1.Location = new System.Drawing.Point(295, 62); pickerBox1.Name = "pickerBox1"; - pickerBox1.Padding = new Padding(4, 4, 3, 3); pickerBox1.SelectedIndex = 0; - pickerBox1.Size = new System.Drawing.Size(84, 34); + pickerBox1.Size = new System.Drawing.Size(80, 32); pickerBox1.TabIndex = 174; pickerBox1.TabStop = false; pickerBox1.Value = false; - // + // // dialogFooter1 - // + // dialogFooter1.BackColor = System.Drawing.Color.FromArgb(240, 240, 240); - dialogFooter1.Button1Text = "&Save"; - dialogFooter1.Dialog = this; dialogFooter1.Dock = DockStyle.Bottom; + dialogFooter1.EnableMovable = false; dialogFooter1.IsBusy = false; - dialogFooter1.Location = new System.Drawing.Point(0, 437); + dialogFooter1.Location = new System.Drawing.Point(0, 451); dialogFooter1.Name = "dialogFooter1"; - dialogFooter1.Size = new System.Drawing.Size(384, 84); - // - // EditSectionForm - // + dialogFooter1.Size = new System.Drawing.Size(384, 70); + dialogFooter1.TabIndex = 0; + dialogFooter1.TabStop = false; + // + // EditGroupForm + // BackColor = System.Drawing.Color.White; ClientSize = new System.Drawing.Size(384, 521); Controls.Add(dialogFooter1); @@ -132,23 +128,23 @@ namespace RokettoLaunch Controls.Add(label1); Controls.Add(textBox1); MinimumSize = new System.Drawing.Size(400, 560); - Name = "EditSectionForm"; + Name = "EditGroupForm"; Text = "Edit Section"; ResumeLayout(false); PerformLayout(); } - public TileGroupModel Result + public App4Options.Group Result { get { if (result == null) { - result = new TileGroupModel(); + result = new App4Options.Group(); } result.Title = textBox1.Text?.Trim() ?? string.Empty; - result.IsExpanded = pickerBox1.Value; + result.IsOpen = pickerBox1.Value; return result; } diff --git a/EditGroupForm.resx b/EditGroupForm.resx new file mode 100644 index 0000000..8b2ff64 --- /dev/null +++ b/EditGroupForm.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/EditTileForm.cs b/EditTileForm.cs index 34fcf42..3b936f5 100644 --- a/EditTileForm.cs +++ b/EditTileForm.cs @@ -1,7 +1,8 @@ -using System.Diagnostics; +using System; +using System.Diagnostics; using System.Drawing; using System.Windows.Forms; -using RokettoLaunch.Models; +using RokettoLaunch.Models.SaveFile; using RyzStudio.Windows.Forms; using RyzStudio.Windows.ThemedForms; using RyzStudio.Windows.ThemedForms.ButtonTextBox; @@ -17,9 +18,9 @@ namespace RokettoLaunch private Label label3; private Label label2; private Label label1; - private ThPathDialogTextBox textBox2; + private ThPathTextBox textBox2; private ThClearableTextBox textBox3; - private ThPathDialogTextBox textBox4; + private ThPathTextBox textBox4; private ThPickerBox pickerBox1; private ThYesNoPickerBox pickerBox2; private THorizontalSeparator horizontalSeparator1; @@ -27,32 +28,32 @@ namespace RokettoLaunch private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1; - private TileModel result = null; + private App4Options.Item result = null; - public EditTileForm(TileModel model = null) + public EditTileForm(App4Options.Item model = null) { InitializeComponent(); - UISetup.Dialog(this); + UISetup.Dialog(this, true); this.Text = (result == null) ? "Add Tile" : "Edit Tile"; result = model; - pickerBox1.ComboBox.Items.Clear(); - pickerBox1.ComboBox.Items.AddRange(new string[] { "Normal", "Hidden", "Minimized", "Maximized" }); - if (pickerBox1.ComboBox.Items.Count > 0) - { - pickerBox1.ComboBox.SelectedIndex = 0; - } + pickerBox1.Setup([ "Normal", "Hidden", "Minimized", "Maximized" ], 0); + } + + protected override void OnShown(EventArgs e) + { + base.OnShown(e); textBox1.Text = result?.Title ?? "New Tile"; - textBox2.Text = result?.ProcessFilename ?? string.Empty; - textBox3.Text = result?.ProcessArgument ?? string.Empty; - textBox4.Text = result?.ProcessWorkingDirectory ?? string.Empty; - pickerBox1.ComboBox.SelectedIndex = (int)(result?.ProcessWindowStyle ?? ProcessWindowStyle.Normal); - pickerBox2.Value = result?.ProcessAsAdmin ?? false; + textBox2.Text = result?.TargetPath ?? string.Empty; + textBox3.Text = result?.Argument ?? string.Empty; + textBox4.Text = result?.ResolvedStartPath ?? string.Empty; + pickerBox1.Value = (int)(result?.WindowStyle ?? ProcessWindowStyle.Normal); + pickerBox2.Value = result?.RunAsAdmin ?? false; } private void InitializeComponent() @@ -64,9 +65,9 @@ namespace RokettoLaunch label3 = new Label(); label2 = new Label(); label1 = new Label(); - textBox2 = new ThPathDialogTextBox(); + textBox2 = new ThPathTextBox(); textBox3 = new ThClearableTextBox(); - textBox4 = new ThPathDialogTextBox(); + textBox4 = new ThPathTextBox(); pickerBox1 = new ThPickerBox(); pickerBox2 = new ThYesNoPickerBox(); horizontalSeparator1 = new THorizontalSeparator(); @@ -78,13 +79,12 @@ namespace RokettoLaunch textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; textBox1.BackColor = Color.Transparent; textBox1.ClearedValue = ""; - textBox1.EnableReactiveVisual = true; - textBox1.Font = new Font("Segoe UI", 9F); + textBox1.EnableMovable = false; textBox1.Icon = "O"; textBox1.IconSize = 13F; - textBox1.Location = new Point(109, 20); + textBox1.Location = new Point(95, 20); textBox1.Name = "textBox1"; - textBox1.Size = new Size(260, 32); + textBox1.Size = new Size(280, 32); textBox1.TabIndex = 152; textBox1.TabStop = false; textBox1.UseSystemPasswordChar = false; @@ -94,7 +94,7 @@ namespace RokettoLaunch label6.AutoSize = true; label6.BackColor = Color.Transparent; label6.ForeColor = SystemColors.ControlText; - label6.Location = new Point(10, 264); + label6.Location = new Point(10, 242); label6.Margin = new Padding(0); label6.Name = "label6"; label6.Padding = new Padding(0, 9, 0, 0); @@ -108,7 +108,7 @@ namespace RokettoLaunch label7.AutoSize = true; label7.BackColor = Color.Transparent; label7.ForeColor = SystemColors.ControlText; - label7.Location = new Point(10, 220); + label7.Location = new Point(10, 200); label7.Margin = new Padding(0); label7.Name = "label7"; label7.Padding = new Padding(0, 9, 0, 0); @@ -126,9 +126,9 @@ namespace RokettoLaunch label4.Margin = new Padding(0); label4.Name = "label4"; label4.Padding = new Padding(0, 9, 0, 0); - label4.Size = new Size(103, 24); + label4.Size = new Size(82, 24); label4.TabIndex = 159; - label4.Text = "Working Directory"; + label4.Text = "Start Directory"; label4.TextAlign = ContentAlignment.MiddleLeft; // // label3 @@ -177,16 +177,13 @@ namespace RokettoLaunch // textBox2.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; textBox2.BackColor = Color.Transparent; - textBox2.DialogMode = ThPathDialogTextBox.DialogType.OpenFile; - textBox2.EnableReactiveVisual = true; + textBox2.DialogMode = ThPathTextBox.DialogType.OpenFile; + textBox2.EnableMovable = false; textBox2.FolderBrowserDialog = null; - textBox2.Font = new Font("Segoe UI", 9F); - textBox2.Icon = "C"; + textBox2.Icon = "D"; textBox2.IconSize = 13F; - textBox2.Location = new Point(109, 62); + textBox2.Location = new Point(115, 62); textBox2.Name = "textBox2"; - textBox2.OpenFileDialog = null; - textBox2.SaveFileDialog = null; textBox2.Size = new Size(260, 32); textBox2.TabIndex = 170; textBox2.TabStop = false; @@ -197,13 +194,12 @@ namespace RokettoLaunch textBox3.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; textBox3.BackColor = Color.Transparent; textBox3.ClearedValue = ""; - textBox3.EnableReactiveVisual = true; - textBox3.Font = new Font("Segoe UI", 9F); + textBox3.EnableMovable = false; textBox3.Icon = "O"; textBox3.IconSize = 13F; - textBox3.Location = new Point(149, 104); + textBox3.Location = new Point(135, 104); textBox3.Name = "textBox3"; - textBox3.Size = new Size(220, 32); + textBox3.Size = new Size(240, 32); textBox3.TabIndex = 171; textBox3.TabStop = false; textBox3.UseSystemPasswordChar = false; @@ -212,17 +208,14 @@ namespace RokettoLaunch // textBox4.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; textBox4.BackColor = Color.Transparent; - textBox4.DialogMode = ThPathDialogTextBox.DialogType.FolderBrowser; - textBox4.EnableReactiveVisual = true; + textBox4.DialogMode = ThPathTextBox.DialogType.FolderBrowser; + textBox4.EnableMovable = false; textBox4.FolderBrowserDialog = null; - textBox4.Font = new Font("Segoe UI", 9F); textBox4.Icon = "D"; textBox4.IconSize = 13F; - textBox4.Location = new Point(149, 146); + textBox4.Location = new Point(135, 146); textBox4.Name = "textBox4"; - textBox4.OpenFileDialog = null; - textBox4.SaveFileDialog = null; - textBox4.Size = new Size(220, 32); + textBox4.Size = new Size(240, 32); textBox4.TabIndex = 172; textBox4.TabStop = false; textBox4.UseSystemPasswordChar = false; @@ -231,12 +224,11 @@ namespace RokettoLaunch // pickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right; pickerBox1.BackColor = Color.Transparent; - pickerBox1.EnableReactiveVisual = true; - pickerBox1.Font = new Font("Segoe UI", 9F); - pickerBox1.Location = new Point(249, 220); + pickerBox1.EnableMovable = false; + pickerBox1.Location = new Point(255, 200); pickerBox1.Name = "pickerBox1"; pickerBox1.SelectedIndex = -1; - pickerBox1.Size = new Size(120, 34); + pickerBox1.Size = new Size(120, 32); pickerBox1.TabIndex = 174; pickerBox1.TabStop = false; // @@ -244,12 +236,11 @@ namespace RokettoLaunch // pickerBox2.Anchor = AnchorStyles.Top | AnchorStyles.Right; pickerBox2.BackColor = Color.Transparent; - pickerBox2.EnableReactiveVisual = true; - pickerBox2.Font = new Font("Segoe UI", 9F); - pickerBox2.Location = new Point(289, 264); + pickerBox2.EnableMovable = false; + pickerBox2.Location = new Point(295, 242); pickerBox2.Name = "pickerBox2"; pickerBox2.SelectedIndex = 0; - pickerBox2.Size = new Size(80, 34); + pickerBox2.Size = new Size(80, 32); pickerBox2.TabIndex = 175; pickerBox2.TabStop = false; pickerBox2.Value = false; @@ -257,27 +248,21 @@ namespace RokettoLaunch // horizontalSeparator1 // horizontalSeparator1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; - horizontalSeparator1.AutoScrollMargin = new Size(0, 0); - horizontalSeparator1.AutoScrollMinSize = new Size(0, 0); - horizontalSeparator1.BackColor = Color.Transparent; - horizontalSeparator1.Location = new Point(10, 187); - horizontalSeparator1.Margin = new Padding(0, 10, 0, 0); - horizontalSeparator1.MaximumSize = new Size(4920, 2); - horizontalSeparator1.MinimumSize = new Size(0, 22); + horizontalSeparator1.Location = new Point(5, 183); horizontalSeparator1.Name = "horizontalSeparator1"; - horizontalSeparator1.Size = new Size(364, 22); - horizontalSeparator1.TabIndex = 176; - horizontalSeparator1.TabStop = false; + horizontalSeparator1.Size = new Size(375, 10); // // dialogFooter1 // dialogFooter1.BackColor = Color.FromArgb(240, 240, 240); - dialogFooter1.Button1Text = "&Save"; - dialogFooter1.Dialog = this; dialogFooter1.Dock = DockStyle.Bottom; - dialogFooter1.Location = new Point(0, 437); + dialogFooter1.EnableMovable = false; + dialogFooter1.IsBusy = false; + dialogFooter1.Location = new Point(0, 451); dialogFooter1.Name = "dialogFooter1"; - dialogFooter1.Size = new Size(384, 84); + dialogFooter1.Size = new Size(384, 70); + dialogFooter1.TabIndex = 0; + dialogFooter1.TabStop = false; // // EditTileForm // @@ -304,21 +289,21 @@ namespace RokettoLaunch PerformLayout(); } - public TileModel Result + public App4Options.Item Result { get { if (result == null) { - result = new TileModel(); + result = new App4Options.Item(); } result.Title = textBox1.Text?.Trim() ?? string.Empty; - result.ProcessFilename = textBox2.Text?.Trim() ?? string.Empty; - result.ProcessArgument = textBox3.Text?.Trim() ?? string.Empty; - result.ProcessWorkingDirectory = textBox4.Text?.Trim(); - result.ProcessWindowStyle = (System.Diagnostics.ProcessWindowStyle)pickerBox1.ComboBox.SelectedIndex; - result.ProcessAsAdmin = pickerBox2.Value; + result.TargetPath = textBox2.Text?.Trim() ?? string.Empty; + result.Argument = textBox3.Text?.Trim() ?? string.Empty; + result.StartPath = textBox4.Text?.Trim(); + result.WindowStyle = (ProcessWindowStyle)pickerBox1.ComboBox.SelectedIndex; + result.RunAsAdmin = pickerBox2.Value; return result; } diff --git a/EditTileForm.resx b/EditTileForm.resx index af32865..8b2ff64 100644 --- a/EditTileForm.resx +++ b/EditTileForm.resx @@ -1,7 +1,7 @@  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/MainForm.Designer.cs b/MainForm.Designer.cs index 983d534..ca14b99 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -102,7 +102,7 @@ namespace RokettoLaunch notifyIcon1.Icon = (System.Drawing.Icon)resources.GetObject("notifyIcon1.Icon"); notifyIcon1.Text = "notifyIcon1"; notifyIcon1.Visible = true; - notifyIcon1.MouseClick += notifyIcon1_MouseClick; + notifyIcon1.MouseClick += NotifyIcon_MouseClick; // // contextMenuStrip2 // @@ -115,16 +115,16 @@ namespace RokettoLaunch exitToolStripMenuItem1.Name = "exitToolStripMenuItem1"; exitToolStripMenuItem1.Size = new System.Drawing.Size(93, 22); exitToolStripMenuItem1.Text = "E&xit"; - exitToolStripMenuItem1.Click += exitToolStripMenuItem1_Click; + exitToolStripMenuItem1.Click += NotifyExitToolStripMenuItem_Click; // // menuStrip1 // menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { fileToolStripMenuItem, toolStripMenuItem1, viewToolStripMenuItem, toolsToolStripMenuItem, helpToolStripMenuItem1 }); menuStrip1.Location = new System.Drawing.Point(0, 0); menuStrip1.Name = "menuStrip1"; - menuStrip1.Size = new System.Drawing.Size(404, 24); + menuStrip1.Size = new System.Drawing.Size(642, 24); menuStrip1.TabIndex = 2; - menuStrip1.MenuActivate += menuStrip1_MenuActivate; + menuStrip1.MenuActivate += MainMenuStrip_MenuActivate; // // fileToolStripMenuItem // @@ -140,7 +140,7 @@ namespace RokettoLaunch newToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N; newToolStripMenuItem.Size = new System.Drawing.Size(146, 22); newToolStripMenuItem.Text = "&New"; - newToolStripMenuItem.Click += newToolStripMenuItem_Click; + newToolStripMenuItem.Click += NewToolStripMenuItem_Click; // // openToolStripMenuItem // @@ -149,7 +149,7 @@ namespace RokettoLaunch openToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O; openToolStripMenuItem.Size = new System.Drawing.Size(146, 22); openToolStripMenuItem.Text = "&Open"; - openToolStripMenuItem.Click += openToolStripMenuItem_Click; + openToolStripMenuItem.Click += OpenToolStripMenuItem_Click; // // toolStripMenuItem13 // @@ -161,7 +161,7 @@ namespace RokettoLaunch closeToolStripMenuItem.Name = "closeToolStripMenuItem"; closeToolStripMenuItem.Size = new System.Drawing.Size(146, 22); closeToolStripMenuItem.Text = "&Close"; - closeToolStripMenuItem.Click += closeToolStripMenuItem_Click; + closeToolStripMenuItem.Click += CloseToolStripMenuItem_Click; // // toolStripMenuItem14 // @@ -175,14 +175,14 @@ namespace RokettoLaunch saveToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S; saveToolStripMenuItem.Size = new System.Drawing.Size(146, 22); saveToolStripMenuItem.Text = "&Save"; - saveToolStripMenuItem.Click += saveToolStripMenuItem_Click; + saveToolStripMenuItem.Click += SaveToolStripMenuItem_Click; // // saveAsToolStripMenuItem // saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; saveAsToolStripMenuItem.Size = new System.Drawing.Size(146, 22); saveAsToolStripMenuItem.Text = "Save &As..."; - saveAsToolStripMenuItem.Click += saveAsToolStripMenuItem_Click; + saveAsToolStripMenuItem.Click += SaveAsToolStripMenuItem_Click; // // toolStripMenuItem15 // @@ -194,7 +194,7 @@ namespace RokettoLaunch exitToolStripMenuItem2.Name = "exitToolStripMenuItem2"; exitToolStripMenuItem2.Size = new System.Drawing.Size(146, 22); exitToolStripMenuItem2.Text = "E&xit"; - exitToolStripMenuItem2.Click += exitToolStripMenuItem2_Click; + exitToolStripMenuItem2.Click += ExitToolStripMenuItem_Click; // // toolStripMenuItem1 // @@ -206,9 +206,9 @@ namespace RokettoLaunch // addGroupToolStripMenuItem // addGroupToolStripMenuItem.Name = "addGroupToolStripMenuItem"; - addGroupToolStripMenuItem.Size = new System.Drawing.Size(138, 22); - addGroupToolStripMenuItem.Text = "&Add Section"; - addGroupToolStripMenuItem.Click += addGroupToolStripMenuItem_Click; + addGroupToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + addGroupToolStripMenuItem.Text = "&Add Group"; + addGroupToolStripMenuItem.Click += AddGroupToolStripMenuItem_Click; // // viewToolStripMenuItem // @@ -220,16 +220,16 @@ namespace RokettoLaunch // showBigIconsToolStripMenuItem // showBigIconsToolStripMenuItem.Name = "showBigIconsToolStripMenuItem"; - showBigIconsToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + showBigIconsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); showBigIconsToolStripMenuItem.Text = "Show &Big Icons"; - showBigIconsToolStripMenuItem.Click += showBigIconsToolStripMenuItem_Click; + showBigIconsToolStripMenuItem.Click += ShowBigIconsToolStripMenuItem_Click; // // alwaysOnTopToolStripMenuItem // alwaysOnTopToolStripMenuItem.Name = "alwaysOnTopToolStripMenuItem"; - alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(180, 22); alwaysOnTopToolStripMenuItem.Text = "Always On &Top"; - alwaysOnTopToolStripMenuItem.Click += alwaysOnTopToolStripMenuItem_Click; + alwaysOnTopToolStripMenuItem.Click += AlwaysOnTopToolStripMenuItem_Click; // // toolsToolStripMenuItem // @@ -245,7 +245,7 @@ namespace RokettoLaunch optionsToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F12; optionsToolStripMenuItem.Size = new System.Drawing.Size(168, 22); optionsToolStripMenuItem.Text = "&Options"; - optionsToolStripMenuItem.Click += optionsToolStripMenuItem_Click; + optionsToolStripMenuItem.Click += OptionsToolStripMenuItem_Click; // // helpToolStripMenuItem1 // @@ -261,7 +261,7 @@ namespace RokettoLaunch viewHelpToolStripMenuItem1.ShortcutKeys = System.Windows.Forms.Keys.F1; viewHelpToolStripMenuItem1.Size = new System.Drawing.Size(146, 22); viewHelpToolStripMenuItem1.Text = "&View Help"; - viewHelpToolStripMenuItem1.Click += viewHelpToolStripMenuItem1_Click; + viewHelpToolStripMenuItem1.Click += ViewHelpToolStripMenuItem_Click; // // toolStripMenuItem16 // @@ -273,93 +273,93 @@ namespace RokettoLaunch aboutToolStripMenuItem1.Name = "aboutToolStripMenuItem1"; aboutToolStripMenuItem1.Size = new System.Drawing.Size(146, 22); aboutToolStripMenuItem1.Text = "&About"; - aboutToolStripMenuItem1.Click += aboutToolStripMenuItem1_Click; + aboutToolStripMenuItem1.Click += AboutToolStripMenuItem_Click; // // tileContainerMenu1 // tileContainerMenu1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { addGroupToolStripMenuItem1, toolStripMenuItem4, editToolStripMenuItem, toolStripMenuItem5, toolStripSeparator1, toolStripMenuItem3, toolStripSeparator3, removeToolStripMenuItem }); tileContainerMenu1.Name = "tileContainerMenu1"; - tileContainerMenu1.Size = new System.Drawing.Size(181, 170); + tileContainerMenu1.Size = new System.Drawing.Size(133, 148); // // addGroupToolStripMenuItem1 // addGroupToolStripMenuItem1.Name = "addGroupToolStripMenuItem1"; - addGroupToolStripMenuItem1.Size = new System.Drawing.Size(180, 22); + addGroupToolStripMenuItem1.Size = new System.Drawing.Size(132, 22); addGroupToolStripMenuItem1.Text = "&Add Tile"; - addGroupToolStripMenuItem1.Click += addGroupToolStripMenuItem1_Click; + addGroupToolStripMenuItem1.Click += AddTileToolStripMenuItem_Click; // // toolStripMenuItem4 // toolStripMenuItem4.Name = "toolStripMenuItem4"; - toolStripMenuItem4.Size = new System.Drawing.Size(180, 22); + toolStripMenuItem4.Size = new System.Drawing.Size(132, 22); toolStripMenuItem4.Text = "Add &Folder"; - toolStripMenuItem4.Click += toolStripMenuItem4_Click; + toolStripMenuItem4.Click += AddFolderToolStripMenuItem_Click; // // editToolStripMenuItem // editToolStripMenuItem.Name = "editToolStripMenuItem"; - editToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + editToolStripMenuItem.Size = new System.Drawing.Size(132, 22); editToolStripMenuItem.Text = "&Edit"; - editToolStripMenuItem.Click += editToolStripMenuItem_Click; + editToolStripMenuItem.Click += EditGroupToolStripMenuItem_Click; // // toolStripMenuItem5 // toolStripMenuItem5.Name = "toolStripMenuItem5"; - toolStripMenuItem5.Size = new System.Drawing.Size(180, 22); + toolStripMenuItem5.Size = new System.Drawing.Size(132, 22); toolStripMenuItem5.Text = "&Duplicate"; toolStripMenuItem5.Click += toolStripMenuItem5_Click; // // toolStripSeparator1 // toolStripSeparator1.Name = "toolStripSeparator1"; - toolStripSeparator1.Size = new System.Drawing.Size(177, 6); + toolStripSeparator1.Size = new System.Drawing.Size(129, 6); // // toolStripMenuItem3 // toolStripMenuItem3.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { topToolStripMenuItem, upToolStripMenuItem, downToolStripMenuItem, bottomToolStripMenuItem }); toolStripMenuItem3.Name = "toolStripMenuItem3"; - toolStripMenuItem3.Size = new System.Drawing.Size(180, 22); + toolStripMenuItem3.Size = new System.Drawing.Size(132, 22); toolStripMenuItem3.Text = "&Move"; // // topToolStripMenuItem // topToolStripMenuItem.Name = "topToolStripMenuItem"; - topToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + topToolStripMenuItem.Size = new System.Drawing.Size(114, 22); topToolStripMenuItem.Text = "&Top"; - topToolStripMenuItem.Click += topToolStripMenuItem_Click; + topToolStripMenuItem.Click += MoveTopToolStripMenuItem_Click; // // upToolStripMenuItem // upToolStripMenuItem.Name = "upToolStripMenuItem"; - upToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + upToolStripMenuItem.Size = new System.Drawing.Size(114, 22); upToolStripMenuItem.Text = "&Up"; - upToolStripMenuItem.Click += upToolStripMenuItem_Click; + upToolStripMenuItem.Click += MoveUpToolStripMenuItem_Click; // // downToolStripMenuItem // downToolStripMenuItem.Name = "downToolStripMenuItem"; - downToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + downToolStripMenuItem.Size = new System.Drawing.Size(114, 22); downToolStripMenuItem.Text = "&Down"; - downToolStripMenuItem.Click += downToolStripMenuItem_Click; + downToolStripMenuItem.Click += MoveDownToolStripMenuItem_Click; // // bottomToolStripMenuItem // bottomToolStripMenuItem.Name = "bottomToolStripMenuItem"; - bottomToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + bottomToolStripMenuItem.Size = new System.Drawing.Size(114, 22); bottomToolStripMenuItem.Text = "&Bottom"; - bottomToolStripMenuItem.Click += bottomToolStripMenuItem_Click; + bottomToolStripMenuItem.Click += MoveBottomToolStripMenuItem_Click; // // toolStripSeparator3 // toolStripSeparator3.Name = "toolStripSeparator3"; - toolStripSeparator3.Size = new System.Drawing.Size(177, 6); + toolStripSeparator3.Size = new System.Drawing.Size(129, 6); // // removeToolStripMenuItem // removeToolStripMenuItem.Name = "removeToolStripMenuItem"; - removeToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + removeToolStripMenuItem.Size = new System.Drawing.Size(132, 22); removeToolStripMenuItem.Text = "&Remove"; - removeToolStripMenuItem.Click += removeToolStripMenuItem_Click; + removeToolStripMenuItem.Click += RemoveGroupToolStripMenuItem_Click; // // flowLayoutPanel1 // @@ -367,10 +367,10 @@ namespace RokettoLaunch flowLayoutPanel1.BackColor = System.Drawing.Color.Transparent; flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; - flowLayoutPanel1.Location = new System.Drawing.Point(0, 0); + flowLayoutPanel1.Location = new System.Drawing.Point(10, 0); flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); flowLayoutPanel1.Name = "flowLayoutPanel1"; - flowLayoutPanel1.Size = new System.Drawing.Size(404, 417); + flowLayoutPanel1.Size = new System.Drawing.Size(632, 540); flowLayoutPanel1.TabIndex = 8; flowLayoutPanel1.WrapContents = false; // @@ -382,47 +382,48 @@ namespace RokettoLaunch panel1.Location = new System.Drawing.Point(0, 24); panel1.Margin = new System.Windows.Forms.Padding(0); panel1.Name = "panel1"; - panel1.Size = new System.Drawing.Size(404, 417); + panel1.Padding = new System.Windows.Forms.Padding(10, 0, 0, 0); + panel1.Size = new System.Drawing.Size(642, 540); panel1.TabIndex = 9; // // tileMenu1 // tileMenu1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { editToolStripMenuItem1, toolStripMenuItem6, toolStripSeparator4, removeToolStripMenuItem1 }); tileMenu1.Name = "tileMenu1"; - tileMenu1.Size = new System.Drawing.Size(125, 76); + tileMenu1.Size = new System.Drawing.Size(127, 76); // // editToolStripMenuItem1 // editToolStripMenuItem1.Name = "editToolStripMenuItem1"; - editToolStripMenuItem1.Size = new System.Drawing.Size(124, 22); + editToolStripMenuItem1.Size = new System.Drawing.Size(126, 22); editToolStripMenuItem1.Text = "&Edit"; - editToolStripMenuItem1.Click += editToolStripMenuItem1_Click; + editToolStripMenuItem1.Click += EditTileToolStripMenuItem_Click; // // toolStripMenuItem6 // toolStripMenuItem6.Name = "toolStripMenuItem6"; - toolStripMenuItem6.Size = new System.Drawing.Size(124, 22); - toolStripMenuItem6.Text = "&Duplicate"; - toolStripMenuItem6.Click += toolStripMenuItem6_Click; + toolStripMenuItem6.Size = new System.Drawing.Size(126, 22); + toolStripMenuItem6.Text = "Copy To..."; + toolStripMenuItem6.Click += CopyToTileToolStripMenuItem_Click; // // toolStripSeparator4 // toolStripSeparator4.Name = "toolStripSeparator4"; - toolStripSeparator4.Size = new System.Drawing.Size(121, 6); + toolStripSeparator4.Size = new System.Drawing.Size(123, 6); // // removeToolStripMenuItem1 // removeToolStripMenuItem1.Name = "removeToolStripMenuItem1"; - removeToolStripMenuItem1.Size = new System.Drawing.Size(124, 22); + removeToolStripMenuItem1.Size = new System.Drawing.Size(126, 22); removeToolStripMenuItem1.Text = "&Remove"; - removeToolStripMenuItem1.Click += removeToolStripMenuItem1_Click; + removeToolStripMenuItem1.Click += RemoveTileToolStripMenuItem_Click; // // MainForm // AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; BackColor = System.Drawing.Color.White; BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - ClientSize = new System.Drawing.Size(404, 441); + ClientSize = new System.Drawing.Size(642, 564); Controls.Add(panel1); Controls.Add(menuStrip1); DoubleBuffered = true; diff --git a/MainForm.cs b/MainForm.cs index eb17fc8..1d9135c 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -4,24 +4,26 @@ using System.ComponentModel; using System.Drawing; using System.IO; using System.Linq; -using System.Text.Json; using System.Threading.Tasks; using System.Windows.Forms; -using RokettoLaunch.Models; +using Microsoft.Extensions.DependencyInjection; +using RokettoLaunch.Models.SaveFile; using RokettoLaunch.Windows.Forms; using RyzStudio; using RyzStudio.Windows.Forms; using RyzStudio.Windows.ThemedForms; using RyzStudio.Windows.ThemedForms.ButtonTextBox; -using RyzStudio.Windows.TileForms; namespace RokettoLaunch { public partial class MainForm : Form { - private const int MIN_ITEMS_PER_ROW = 4; + private const int MIN_COLUMNS = 4; + private const int TILE_SIZE = 70; + private const int TILE_PADDING = 3; - private readonly FileSessionManager _fileSessionManager; + private readonly IServiceProvider _provider; + private readonly IFileSessionManager _fileSessionManager; private bool _isBusy = false; private bool _requestExit = false; @@ -34,19 +36,26 @@ namespace RokettoLaunch this.AutoScaleMode = AutoScaleMode.None; this.Text = Application.ProductName; - this.CurrentSession = new AppOptions(); + this.CurrentSession = new App4Options(); -#if DEBUG - flowLayoutPanel1.BackColor = Color.LightGreen; -#endif +//#if DEBUG + //flowLayoutPanel1.BackColor = Color.LightGreen; +//#endif - newToolStripMenuItem.Image = RyzStudio.Windows.ThemedForms.DefaultVisualStyle.GetImage("a", Color.Black, 2); - openToolStripMenuItem.Image = RyzStudio.Windows.ThemedForms.DefaultVisualStyle.GetImage("b", Color.Black, 2); - saveToolStripMenuItem.Image = RyzStudio.Windows.ThemedForms.DefaultVisualStyle.GetImage("c", Color.Black, 2); - optionsToolStripMenuItem.Image = RyzStudio.Windows.ThemedForms.DefaultVisualStyle.GetImage("i", Color.Black, 2); - viewHelpToolStripMenuItem1.Image = RyzStudio.Windows.ThemedForms.DefaultVisualStyle.GetImage("j", Color.Black, 2); + newToolStripMenuItem.Image = RyzStudio.Windows.ThemedForms.DefaultVisualStyle.Icon.Small.GetImage("a"); + openToolStripMenuItem.Image = RyzStudio.Windows.ThemedForms.DefaultVisualStyle.Icon.Small.GetImage("b"); + saveToolStripMenuItem.Image = RyzStudio.Windows.ThemedForms.DefaultVisualStyle.Icon.Small.GetImage("c"); + optionsToolStripMenuItem.Image = RyzStudio.Windows.ThemedForms.DefaultVisualStyle.Icon.Small.GetImage("i"); + viewHelpToolStripMenuItem1.Image = RyzStudio.Windows.ThemedForms.DefaultVisualStyle.Icon.Small.GetImage("j"); + + notifyIcon1.Text = Application.ProductName; + } + + public MainForm(IServiceProvider provider, IFileSessionManager fileSessionManager) : this() + { + _provider = provider; + _fileSessionManager = fileSessionManager; - _fileSessionManager = new FileSessionManager(); _fileSessionManager.OpenFileDialog = openFileDialog1; _fileSessionManager.SaveFileDialog = saveFileDialog1; _fileSessionManager.OnNewing += fileSessionManager_OnNewSession; @@ -54,8 +63,6 @@ namespace RokettoLaunch _fileSessionManager.OnSaving += fileSessionManager_OnSaveSession; _fileSessionManager.OnClearing += fileSessionManager_OnClearSession; _fileSessionManager.OnFilenameChanged += fileSessionManager_OnFilenameChanged; - - notifyIcon1.Text = Application.ProductName; } protected async override void OnShown(EventArgs e) @@ -70,6 +77,8 @@ namespace RokettoLaunch jsonfigFilename = Path.ChangeExtension(Application.ExecutablePath, "jsonfig"); } + jsonfigFilename = @"L:\gitea-hiimray\2025-11-18-1429 - Copy.jsnx"; + if (!string.IsNullOrWhiteSpace(jsonfigFilename) && File.Exists(jsonfigFilename)) { await _fileSessionManager.OpenSession(jsonfigFilename); @@ -82,25 +91,29 @@ namespace RokettoLaunch UIControl.SetFocus(this); } - protected async override void OnClosing(CancelEventArgs e) + protected async override void OnFormClosing(FormClosingEventArgs e) { - base.OnClosing(e); + base.OnFormClosing(e); if (this.CurrentSession == null) { - this.CurrentSession = new AppOptions(); + this.CurrentSession = new App4Options(); } if (this.CurrentSession.HideOnClose && !_requestExit) { - this.Visible = !this.Visible; e.Cancel = true; return; } _requestExit = false; - await _fileSessionManager.CloseSession(); + var result = await _fileSessionManager.CloseSession(); + if (!result) + { + e.Cancel = true; + return; + } if ((this.CurrentSession?.ShowToggleHotkey ?? new ThKeyCodeTextBox.Results()).Key != Keys.None) { @@ -135,7 +148,8 @@ namespace RokettoLaunch } - public AppOptions CurrentSession { get; set; } = null; + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public App4Options CurrentSession { get; set; } = null; private void InvalidateOptions(bool resize) @@ -170,12 +184,12 @@ namespace RokettoLaunch } #endif - AutoResizeWidth(); + //AutoResizeWidth(); UIControl.SetTopMost(this, this.CurrentSession.AlwaysOnTop); } - private void menuStrip1_MenuActivate(object sender, EventArgs e) + private void MainMenuStrip_MenuActivate(object sender, EventArgs e) { closeToolStripMenuItem.Enabled = (_fileSessionManager.SessionState != FileSessionManager.SessionStateEnum.Close); @@ -188,42 +202,6 @@ namespace RokettoLaunch alwaysOnTopToolStripMenuItem.Checked = this.CurrentSession?.AlwaysOnTop ?? false; } - private void tileContainer_MouseClick(object sender, MouseEventArgs e) - { - if (e.Button != MouseButtons.Middle) - { - return; - } - - var control = (sender as Control); - if (control == null) - { - return; - } - - var container = UIControl.GetParentsUntil(sender as Control); - if (container == null) - { - return; - } - - var newCoord = container.GetNextCoord(); - - var tileModel = new TileModel() - { - Title = "New Tile", - IsGroup = false - }; - - var newTile = new RokettoLaunch.Windows.Forms.TilePanel(); - newTile.ContextMenuStrip = tileMenu1; - newTile.LoadInfo(tileModel); - - container.Add(newTile, newCoord.X, newCoord.Y); - - _fileSessionManager.HasChanged = true; - } - #region Main Menu @@ -232,7 +210,7 @@ namespace RokettoLaunch /// /// /// - private async void newToolStripMenuItem_Click(object sender, EventArgs e) + private async void NewToolStripMenuItem_Click(object sender, EventArgs e) { if (_isBusy) { @@ -247,7 +225,7 @@ namespace RokettoLaunch /// /// /// - private async void openToolStripMenuItem_Click(object sender, EventArgs e) + private async void OpenToolStripMenuItem_Click(object sender, EventArgs e) { if (_isBusy) { @@ -262,7 +240,7 @@ namespace RokettoLaunch /// /// /// - private async void closeToolStripMenuItem_Click(object sender, EventArgs e) + private async void CloseToolStripMenuItem_Click(object sender, EventArgs e) { if (_isBusy) { @@ -277,7 +255,7 @@ namespace RokettoLaunch /// /// /// - private async void saveToolStripMenuItem_Click(object sender, EventArgs e) + private async void SaveToolStripMenuItem_Click(object sender, EventArgs e) { if (_isBusy) { @@ -292,7 +270,7 @@ namespace RokettoLaunch /// /// /// - private async void saveAsToolStripMenuItem_Click(object sender, EventArgs e) + private async void SaveAsToolStripMenuItem_Click(object sender, EventArgs e) { if (_isBusy) { @@ -307,7 +285,7 @@ namespace RokettoLaunch /// /// /// - private void exitToolStripMenuItem2_Click(object sender, EventArgs e) + private void ExitToolStripMenuItem_Click(object sender, EventArgs e) { if (_isBusy) { @@ -325,9 +303,22 @@ namespace RokettoLaunch /// /// /// - private async void addGroupToolStripMenuItem_Click(object sender, EventArgs e) + private async void AddGroupToolStripMenuItem_Click(object sender, EventArgs e) { - await AddNewSection(); + var maxColumn = Math.Max(MIN_COLUMNS, this.CurrentSession.TilesPerRow); + + var group = new App4Options.Group() + { + Id = Guid.NewGuid(), + Title = "New Group", + IsOpen = true, + GridSize = new Size(maxColumn, 1) + }; + + this.CurrentSession.Groups.Add(group); + this.AddGroup(group); + + _fileSessionManager.HasChanged = true; } @@ -336,7 +327,7 @@ namespace RokettoLaunch /// /// /// - private void showBigIconsToolStripMenuItem_Click(object sender, EventArgs e) + private void ShowBigIconsToolStripMenuItem_Click(object sender, EventArgs e) { if (this.CurrentSession == null) { @@ -351,7 +342,7 @@ namespace RokettoLaunch /// /// /// - private void alwaysOnTopToolStripMenuItem_Click(object sender, EventArgs e) + private void AlwaysOnTopToolStripMenuItem_Click(object sender, EventArgs e) { if (this.CurrentSession == null) { @@ -369,7 +360,7 @@ namespace RokettoLaunch /// /// /// - private void optionsToolStripMenuItem_Click(object sender, EventArgs e) + private void OptionsToolStripMenuItem_Click(object sender, EventArgs e) { var form = new OptionsForm(this.CurrentSession); if (form.ShowDialog() == DialogResult.OK) @@ -386,7 +377,7 @@ namespace RokettoLaunch /// /// /// - private void viewHelpToolStripMenuItem1_Click(object sender, EventArgs e) + private void ViewHelpToolStripMenuItem_Click(object sender, EventArgs e) { RyzStudio.Diagnostics.Process.Execute(AppResource.AppHelpURL); } @@ -396,7 +387,7 @@ namespace RokettoLaunch /// /// /// - private void aboutToolStripMenuItem1_Click(object sender, EventArgs e) + private void AboutToolStripMenuItem_Click(object sender, EventArgs e) { var form = new RyzStudio.Windows.ThemedForms.AboutForm(); form.ProductURL = AppResource.AppProductURL; @@ -412,7 +403,7 @@ namespace RokettoLaunch #region Notification Icon - private void notifyIcon1_MouseClick(object sender, MouseEventArgs e) + private void NotifyIcon_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { @@ -420,8 +411,13 @@ namespace RokettoLaunch } } - private void exitToolStripMenuItem1_Click(object sender, EventArgs e) + private void NotifyExitToolStripMenuItem_Click(object sender, EventArgs e) { + if (_isBusy) + { + return; + } + _requestExit = true; this.Close(); @@ -435,11 +431,11 @@ namespace RokettoLaunch private async Task fileSessionManager_OnNewSession(FileSessionManager sender) { // Enforce minimum number of rows - this.CurrentSession.TilesPerRow = Math.Max(this.CurrentSession.TilesPerRow, MIN_ITEMS_PER_ROW); + this.CurrentSession.TilesPerRow = Math.Max(this.CurrentSession.TilesPerRow, MIN_COLUMNS); UIControl.Clear(flowLayoutPanel1); - await AddNewSection(); + AddGroupToolStripMenuItem_Click(null, null); InvalidateOptions(false); @@ -448,34 +444,31 @@ namespace RokettoLaunch private async Task fileSessionManager_OnLoadSession(FileSessionManager sender, string filename, int formatType) { - var newSession = new AppOptions(); - - switch (Path.GetExtension(filename?.ToLower()?.Trim() ?? string.Empty)) + // Progress indicator + var loadingForm = _provider.GetRequiredService(); + var result = await loadingForm.ShowDialog(filename); + if (result != DialogResult.OK) { - case ".json": - case ".jsonfig": - newSession = await RyzStudio.Text.Json.JsonSerialiser.DeserialiseFile(filename); - break; - case ".jsnx": - newSession = await RyzStudio.IO.Compression.ZFile.ReadFile(filename, "Document.json"); - break; - default: - break; + return false; } - if (newSession == null) newSession = new AppOptions(); - - // Load tiles - UIControl.Clear(flowLayoutPanel1); - - foreach (var item in newSession.Groups ?? new List()) + await Task.Run(() => { - await AddSection(item); - } + this.CurrentSession = loadingForm.Result; - this.CurrentSession = newSession; + InvalidateOptions(true); - InvalidateOptions(true); + foreach (var group in this.CurrentSession.Groups ?? new List()) + { + var gridSize = group.GetMaxGridSize(); + gridSize.Width = Math.Max(gridSize.Width, MIN_COLUMNS); + + group.GridSize = new Size(gridSize.Width, gridSize.Height); + + AddGroup(group); + } + + }); return true; } @@ -487,11 +480,6 @@ namespace RokettoLaunch return false; } - if (!flowLayoutPanel1.Controls.OfType().Any()) - { - return true; - } - return await Task.Run(async () => { if (_isBusy) @@ -504,21 +492,11 @@ namespace RokettoLaunch // update session if (this.CurrentSession == null) { - this.CurrentSession = new AppOptions(); + this.CurrentSession = new App4Options(); } this.CurrentSession.StartPosition = this.Location; - this.CurrentSession.Height = this.Height; - - this.CurrentSession.Groups = new List(); - foreach (var section in flowLayoutPanel1.Controls.OfType()) - { - var newTag = GetSectionTag(section); - - section.Tag = newTag; - - this.CurrentSession.Groups.Add(newTag); - } + this.CurrentSession.Height = this.DisplayRectangle.Height; var result = GenericResult.Create(); @@ -533,7 +511,7 @@ namespace RokettoLaunch { System.IO.File.Delete(filename); } - catch(Exception) + catch (Exception) { // do nothing } @@ -596,64 +574,80 @@ namespace RokettoLaunch #endregion - #region Tile Container + #region Group /// /// Add Tile /// /// /// - private void addGroupToolStripMenuItem1_Click(object sender, EventArgs e) + private void AddTileToolStripMenuItem_Click(object sender, EventArgs e) { - var section = UIControl.GetOwner((ToolStripMenuItem)sender); - if (section == null) + var panel = UIControl.GetOwner((ToolStripMenuItem)sender); + if (panel == null) { return; } - var form = new EditTileForm(); - if (form.ShowDialog() == DialogResult.OK) + if (panel.ToggleControlId == null) { - var result = form.Result; - var newCoord = section.GetNextCoord(); + return; + } - var newTile = new TilePanel(); - newTile.ContextMenuStrip = tileMenu1; - newTile.LoadInfo(result); + var groupInfo = this.CurrentSession.Groups.Where(x => x.Id == panel.ToggleControlId.Value).FirstOrDefault(); + if (groupInfo == null) + { + return; + } - section.Add(newTile, newCoord.X, newCoord.Y); - - _fileSessionManager.HasChanged = true; + var newTileInfo = new App4Options.Item() + { + Id = Guid.NewGuid(), + Title = "New Tile", + IsGroup = false, + Position = new Point(-1, -1) }; + + this.AddTile((TableLayoutPanel)panel.ToggleControl, groupInfo.Id, newTileInfo); + + _fileSessionManager.HasChanged = true; } /// - /// Add Tile Group + /// Add Folder /// /// /// - private void toolStripMenuItem4_Click(object sender, EventArgs e) + private void AddFolderToolStripMenuItem_Click(object sender, EventArgs e) { - var container = UIControl.GetOwner((ToolStripMenuItem)sender); - if (container == null) + var panel = UIControl.GetOwner((ToolStripMenuItem)sender); + if (panel == null) { return; } - var form = new EditTileFolderForm(); - if (form.ShowDialog() == DialogResult.OK) + if (panel.ToggleControlId == null) { - var result = form.Result; - var newCoord = container.GetNextCoord(); + return; + } - var newTile = new RokettoLaunch.Windows.Forms.TilePanel(); - newTile.ContextMenuStrip = tileMenu1; - newTile.LoadInfo(result); + var groupInfo = this.CurrentSession.Groups.Where(x => x.Id == panel.ToggleControlId.Value).FirstOrDefault(); + if (groupInfo == null) + { + return; + } - container.Add(newTile, newCoord.X, newCoord.Y); - - _fileSessionManager.HasChanged = true; + var newTileInfo = new App4Options.Item() + { + Id = Guid.NewGuid(), + Title = "New Folder", + IsGroup = true, + Position = new Point(-1, -1) }; + + this.AddTile((TableLayoutPanel)panel.ToggleControl, groupInfo.Id, newTileInfo); + + _fileSessionManager.HasChanged = true; } /// @@ -661,28 +655,38 @@ namespace RokettoLaunch /// /// /// - private void editToolStripMenuItem_Click(object sender, EventArgs e) + private void EditGroupToolStripMenuItem_Click(object sender, EventArgs e) { - var container = UIControl.GetOwner((ToolStripMenuItem)sender); - if (container == null) + var panel = UIControl.GetOwner((ToolStripMenuItem)sender); + if (panel == null) { return; } - var model = UIControl.GetTag(container); - - var form = new EditSectionForm(model); - if (form.ShowDialog() == DialogResult.OK) + if (panel.ToggleControlId == null) { - var result = form.Result; + return; + } - container.Title = result.Title; - container.Tag = result; + var groupInfo = this.CurrentSession.Groups.Where(x => x.Id == panel.ToggleControlId.Value).FirstOrDefault(); + if (groupInfo == null) + { + return; + } - container.Invalidate(); + var editGroupForm = new EditGroupForm(groupInfo); + if (editGroupForm.ShowDialog() == DialogResult.OK) + { + var newGroupInfo = editGroupForm.Result; + + groupInfo.Title = newGroupInfo.Title; + groupInfo.IsOpen = newGroupInfo.IsOpen; + + panel.Title = newGroupInfo.Title; + panel.Invalidate(); _fileSessionManager.HasChanged = true; - }; + } } /// @@ -692,29 +696,35 @@ namespace RokettoLaunch /// private async void toolStripMenuItem5_Click(object sender, EventArgs e) { - var section = UIControl.GetOwner((ToolStripMenuItem)sender); - if (section == null) + var panel = UIControl.GetOwner((ToolStripMenuItem)sender); + if (panel == null) { return; } - var newTag = GetSectionTag(section); - section.Tag = newTag; - - try - { - var newerTag = JsonSerializer.Deserialize(JsonSerializer.Serialize(newTag)); - newerTag.IsExpanded = true; - newerTag.Title = (string.IsNullOrWhiteSpace(newerTag.Title) ? "New Section" : newerTag.Title?.Trim()) + " (Copy)"; - - await AddSection(newerTag); - } - catch (Exception) + if (panel.ToggleControlId == null) { return; } + var groupInfo = this.CurrentSession.Groups.Where(x => x.Id == panel.ToggleControlId.Value).FirstOrDefault(); + if (groupInfo == null) + { + return; + } + + _isBusy = true; + + await Task.Run(() => + { + var newGroupInfo = groupInfo.CopyOf(); + + this.CurrentSession.Groups.Add(newGroupInfo); + this.AddGroup(newGroupInfo); + }); + _fileSessionManager.HasChanged = true; + _isBusy = false; } /// @@ -722,15 +732,32 @@ namespace RokettoLaunch /// /// /// - private void topToolStripMenuItem_Click(object sender, EventArgs e) + private void MoveTopToolStripMenuItem_Click(object sender, EventArgs e) { - var container = UIControl.GetOwner((ToolStripDropDownItem)sender); - if (container == null) + var panel = UIControl.GetOwner((ToolStripDropDownItem)sender); + if (panel == null) { return; } - UIControl.MoveTop(flowLayoutPanel1, container); + // Move header + UIControl.MoveTop(flowLayoutPanel1, panel); + + // Move sidecar + if (panel.ToggleControl != null) + { + UIControl.MoveNext(flowLayoutPanel1, panel, panel.ToggleControl); + } + + // Move group + var n = this.CurrentSession.Groups.FindIndex(x => x.Id == panel.ToggleControlId); + if (n >= 0) + { + var item = this.CurrentSession.Groups[n]; + + this.CurrentSession.Groups.RemoveAt(n); + this.CurrentSession.Groups.Insert(0, item); + } _fileSessionManager.HasChanged = true; } @@ -740,15 +767,32 @@ namespace RokettoLaunch /// /// /// - private void upToolStripMenuItem_Click(object sender, EventArgs e) + private void MoveUpToolStripMenuItem_Click(object sender, EventArgs e) { - var container = UIControl.GetOwner((ToolStripDropDownItem)sender); - if (container == null) + var panel = UIControl.GetOwner((ToolStripDropDownItem)sender); + if (panel == null) { return; } - UIControl.MoveUp(flowLayoutPanel1, container); + // Move header + UIControl.MovePos(flowLayoutPanel1, panel, -2); + + // Move sidecar + if (panel.ToggleControl != null) + { + UIControl.MoveNext(flowLayoutPanel1, panel, panel.ToggleControl); + } + + // Move group + var n = this.CurrentSession.Groups.FindIndex(x => x.Id == panel.ToggleControlId); + if (n > 0) + { + var item = this.CurrentSession.Groups[n]; + + this.CurrentSession.Groups.RemoveAt(n); + this.CurrentSession.Groups.Insert((n - 1), item); + } _fileSessionManager.HasChanged = true; } @@ -758,15 +802,32 @@ namespace RokettoLaunch /// /// /// - private void downToolStripMenuItem_Click(object sender, EventArgs e) + private void MoveDownToolStripMenuItem_Click(object sender, EventArgs e) { - var container = UIControl.GetOwner((ToolStripDropDownItem)sender); - if (container == null) + var panel = UIControl.GetOwner((ToolStripDropDownItem)sender); + if (panel == null) { return; } - UIControl.MoveDown(flowLayoutPanel1, container); + // Move header + UIControl.MovePos(flowLayoutPanel1, panel, 3); + + // Move sidecar + if (panel.ToggleControl != null) + { + UIControl.MovePos(flowLayoutPanel1, panel.ToggleControl, 3); + } + + // Move group + var n = this.CurrentSession.Groups.FindIndex(x => x.Id == panel.ToggleControlId); + if ((n >= 0) && (n < (this.CurrentSession.Groups.Count - 1))) + { + var item = this.CurrentSession.Groups[n]; + + this.CurrentSession.Groups.RemoveAt(n); + this.CurrentSession.Groups.Insert((n + 1), item); + } _fileSessionManager.HasChanged = true; } @@ -776,15 +837,33 @@ namespace RokettoLaunch /// /// /// - private void bottomToolStripMenuItem_Click(object sender, EventArgs e) + private void MoveBottomToolStripMenuItem_Click(object sender, EventArgs e) { - var container = UIControl.GetOwner((ToolStripDropDownItem)sender); - if (container == null) + var panel = UIControl.GetOwner((ToolStripDropDownItem)sender); + if (panel == null) { return; } - UIControl.MoveBottom(flowLayoutPanel1, container); + // Move header + UIControl.MoveBottom(flowLayoutPanel1, panel); + + // Move sidecar + if (panel.ToggleControl != null) + { + UIControl.MoveNext(flowLayoutPanel1, panel, panel.ToggleControl); + } + + // Move group + var lastPos = (this.CurrentSession.Groups.Count - 1); + var n = this.CurrentSession.Groups.FindIndex(x => x.Id == panel.ToggleControlId); + if ((n >= 0) && (n < lastPos)) + { + var item = this.CurrentSession.Groups[n]; + + this.CurrentSession.Groups.RemoveAt(n); + this.CurrentSession.Groups.Insert(lastPos, item); + } _fileSessionManager.HasChanged = true; } @@ -794,7 +873,7 @@ namespace RokettoLaunch /// /// /// - private void removeToolStripMenuItem_Click(object sender, EventArgs e) + private void RemoveGroupToolStripMenuItem_Click(object sender, EventArgs e) { var result = MessageBox.Show("Are you sure you want to remove section?", "Remove Section", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (result != DialogResult.Yes) @@ -802,13 +881,28 @@ namespace RokettoLaunch return; } - var container = UIControl.GetOwner((ToolStripMenuItem)sender); - if (container == null) + var panel = UIControl.GetOwner((ToolStripMenuItem)sender); + if (panel?.Parent == null) { return; } - container?.Parent.Controls?.Remove(container); + // Remove side-car + if (panel.ToggleControl != null) + { + if (panel.ToggleControl.Parent != null) + { + if (panel.ToggleControlId.HasValue) + { + this.CurrentSession.Remove(panel.ToggleControlId.Value); + } + + panel.ToggleControl.Parent.Controls.Remove(panel.ToggleControl); + } + } + + // Remove header + panel?.Parent.Controls?.Remove(panel); _fileSessionManager.HasChanged = true; } @@ -822,50 +916,110 @@ namespace RokettoLaunch /// /// /// - private void editToolStripMenuItem1_Click(object sender, EventArgs e) + private void EditTileToolStripMenuItem_Click(object sender, EventArgs e) { - var tile = UIControl.GetOwner((ToolStripMenuItem)sender); - if (tile == null) + var tilePanel = UIControl.GetOwner((ToolStripMenuItem)sender); + + var tileInfo = this.GetTileInfo(tilePanel); + if (tileInfo == null) { return; } - if (tile.ModelInfo.IsGroup) + if (tileInfo.IsGroup) { - var form = new EditTileFolderForm(tile.ModelInfo); - if (form.ShowDialog() == DialogResult.OK) + var editFolderForm = new EditFolderForm(tileInfo); + if (editFolderForm.ShowDialog() == DialogResult.OK) { - tile.LoadInfo(form.Result); + var newTileInfo = editFolderForm.Result; - _fileSessionManager.HasChanged = true; - }; + var result = this.CurrentSession.Update(newTileInfo); + if (result) + { + var updatedTileInfo = this.CurrentSession.FindById(tileInfo.Id); + + tilePanel.Title = updatedTileInfo.Title; + + if (tilePanel.TileContextMenu == null) + { + tilePanel.TileContextMenu = new ContextMenuStrip(); + } + + this.UpdateContextMenu(tilePanel.TileContextMenu, updatedTileInfo.Items); + + _fileSessionManager.HasChanged = true; + } + else + { + MessageBox.Show(this, "Unable to update tile", "Edit Tile", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } } else { - var form = new EditTileForm(tile.ModelInfo); - if (form.ShowDialog() == DialogResult.OK) + var editForm = new EditTileForm(tileInfo); + if (editForm.ShowDialog() == DialogResult.OK) { - tile.LoadInfo(form.Result); + var newTileInfo = editForm.Result; + newTileInfo.ResolvePaths(); - _fileSessionManager.HasChanged = true; - }; + var result = this.CurrentSession.Update(newTileInfo); + if (result) + { + var updatedTileInfo = this.CurrentSession.FindById(tileInfo.Id); + + tilePanel.Title = updatedTileInfo.Title; + tilePanel.LargeIcon = RyzStudio.IO.File.GetIcon(updatedTileInfo.ResolvedTargetPath); + + _fileSessionManager.HasChanged = true; + } + else + { + MessageBox.Show(this, "Unable to update tile", "Edit Tile", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } } } /// - /// Duplicate + /// Copy To /// /// /// - private void toolStripMenuItem6_Click(object sender, EventArgs e) + private async void CopyToTileToolStripMenuItem_Click(object sender, EventArgs e) { - var tile = UIControl.GetOwner((ToolStripMenuItem)sender); - if (tile == null) + var tilePanel = UIControl.GetOwner((ToolStripMenuItem)sender); + + var tileInfo = this.GetTileInfo(tilePanel); + if (tileInfo == null) { return; } - DuplicateTile(tile); + var groups = this.CurrentSession.Groups.Select(x => x.Title)?.ToList() ?? new List(); + + var copyToTileForm = new CopyToTileForm(groups); + if (copyToTileForm.ShowDialog() == DialogResult.OK) + { + var n = copyToTileForm.Result; + + await Task.Run(() => + { + var newTileInfo = tileInfo.CopyOf(); + + var headers = flowLayoutPanel1.Controls.OfType().ToList(); + if (headers != null) + { + if (n >= 0 && n <= (headers.Count - 1)) + { + this.AddTile((TableLayoutPanel)headers[n].ToggleControl, this.CurrentSession.Groups[n].Id, newTileInfo); + } + } + + }); + + _fileSessionManager.HasChanged = true; + } } /// @@ -873,141 +1027,399 @@ namespace RokettoLaunch /// /// /// - private void removeToolStripMenuItem1_Click(object sender, EventArgs e) + private void RemoveTileToolStripMenuItem_Click(object sender, EventArgs e) { - var result = MessageBox.Show("Are you sure you want to remove tile?", "Remove Tile", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); - if (result != DialogResult.Yes) + var tilePanel = UIControl.GetOwner((ToolStripMenuItem)sender); + + var tileInfo = this.GetTileInfo(tilePanel); + if (tileInfo == null) { return; } - var tile = UIControl.GetOwner((ToolStripMenuItem)sender); - if (tile == null) + var dialogResult = MessageBox.Show(this, "Are you sure you want to remove tile?", "Remove Tile", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if (dialogResult != DialogResult.Yes) { return; } - var container = UIControl.GetParentsUntil(tile); - if (container == null) + var result = this.CurrentSession.Remove(tileInfo.Id); + if (result) { - return; + tilePanel.Parent.Controls.Remove(tilePanel); + + _fileSessionManager.HasChanged = true; + } + else + { + MessageBox.Show(this, "Unable to remove tile", "Remove Tile", MessageBoxButtons.OK, MessageBoxIcon.Error); } - - container.Controls?.Remove(tile); - - _fileSessionManager.HasChanged = true; } #endregion - private async Task AddNewSection() + private void AddGroup(App4Options.Group group) { - var group = new TileGroupModel(); - group.Title = "New Section"; - group.IsExpanded = true; - group.GridSize = new System.Drawing.Size(this.CurrentSession.TilesPerRow, 1); + var table = CreateTable(group.GridSize); - await AddSection(group); + var header = CreateHeader(group); + header.ToggleControlId = group.Id; + header.ToggleControl = table; - _fileSessionManager.HasChanged = true; - } + UIControl.Add(flowLayoutPanel1, header); + UIControl.Add(flowLayoutPanel1, table); - private async Task AddSection(TileGroupModel model) - { - var panel = new RyzStudio.Windows.TileForms.TileContainer(); - panel.Title = model.Title; - panel.IsOpen = model.IsExpanded; - panel.TitleContextMenuStrip = tileContainerMenu1; - panel.AutoSizeHeight = true; - panel.Tag = model; - panel.AutoSize(model.GridSize.Width, model.GridSize.Height); - -#if DEBUG - panel.BackColor = Color.LightSteelBlue; -#endif - - panel.MouseClick += tileContainer_MouseClick; - - UIControl.Add(flowLayoutPanel1, panel); - - // Load tiles - foreach (var item2 in model.Items ?? new List()) + foreach (var item in group.Items ?? new List()) { - var newTile = new RokettoLaunch.Windows.Forms.TilePanel(); - newTile.ContextMenuStrip = tileMenu1; - newTile.LoadInfo(item2); - - panel.Add(newTile, item2.Position.X, item2.Position.Y); + AddTile(table, item); } } - private void AutoResizeWidth() + private void AddTile(TableLayoutPanel table, App4Options.Item item) { - if (flowLayoutPanel1.Controls.Count <= 0) + var icon = (item.IsGroup ? null : RyzStudio.IO.File.GetIcon(item.ResolvedTargetPath)); + var tile = CreateTile(item.Id, item.Title, item.IsGroup, icon); + + if (item.IsGroup) + { + tile.TileContextMenu = new ContextMenuStrip(); + + this.UpdateContextMenu(tile.TileContextMenu, item.Items); + } + + UIControl.Add(table, tile, item.Position.X, item.Position.Y); + } + + private void AddTile(TableLayoutPanel table, Guid groupId, App4Options.Item item) + { + var groupInfo = this.CurrentSession.Groups.Where(x => x.Id == groupId).FirstOrDefault(); + if (groupInfo == null) { return; } - var width = MIN_ITEMS_PER_ROW; - foreach (var item in flowLayoutPanel1.Controls.OfType()) + var canPosition = groupInfo.CanPosition(item); + if (!canPosition) { - width = Math.Max(width, item.Width); + // Find next available position + item.Position = groupInfo.GetNextPosition(); } - var padding = panel1.Padding.Horizontal + this.Padding.Horizontal + SystemInformation.VerticalScrollBarWidth; + // Resize-expand table + if ((item.Position.Y + 1) > groupInfo.GridSize.Height) + { + groupInfo.GridSize = new Size(groupInfo.GridSize.Width, (item.Position.Y + 1)); - UIControl.SetClientWidth(this, width + padding); + this.UpdateTable(table, groupInfo.GridSize); + } + + // Add tile + groupInfo.Items.Add(item); + + this.AddTile(table, item); } - public void DuplicateTile(TilePanel tile) + private void AddToTile(App4Options.Item item, List paths, bool appendTo = true) { - var container = UIControl.GetParentsUntil(tile); - if (container == null) + item.IsGroup = true; + + if (!appendTo) + { + item.Items.Clear(); + } + + foreach (var path in paths) + { + var newTileInfo = new App4Options.Item() + { + Id = Guid.NewGuid(), + IsGroup = false, + TargetPath = path, + }; + + newTileInfo.ResolvePaths(); + newTileInfo.Title = RyzStudio.IO.File.GetName(newTileInfo.ResolvedTargetPath); + + item.Items.Add(newTileInfo); + } + } + + private TableLayoutPanel CreateTable(Size gridSize) + { + var result = new TableLayoutPanel(); + result.Margin = new Padding(0); + result.Padding = new Padding(0); + result.ColumnCount = 0; + result.RowCount = 0; + + return this.UpdateTable(result, gridSize); + } + + private TToggleHeaderPanel CreateHeader(App4Options.Group group) + { + var result = new TToggleHeaderPanel(); + result.ContextMenuStrip = tileContainerMenu1; + result.Height = 20; + result.Padding = new Padding(0, 0, 0, 0); + result.Title = group.Title; + result.IsOpen = group.IsOpen; + + return result; + } + + private TilePanel CreateTile(Guid id, string title, bool isGroup, Image icon = null) + { + var result = new TilePanel(); + result.ContextMenuStrip = tileMenu1; + result.Dock = DockStyle.Fill; + result.Margin = new Padding(0, 0, 3, 3); + result.Padding = new Padding(0); + + result.TileId = id; + result.Title = title; + result.IsGroup = isGroup; + result.LargeIcon = (isGroup ? AppResource.folder_32 : icon); + + result.MouseClick += TilePanel_MouseClick; + result.MouseDoubleClick += TilePanel_MouseClick; + result.OnFileDrop += TilePanel_OnFileDrop; + + return result; + } + + private App4Options.Item GetTileInfo(object sender) + { + App4Options.Item result = null; + + if (sender is TilePanel) + { + var panel = (sender as TilePanel); + result = this.CurrentSession.FindById(panel.TileId); + } + else if (sender is ToolStripMenuItem) + { + var menuItem = (sender as ToolStripMenuItem); + if (menuItem.Tag == null) + { + return null; + } + + if (string.IsNullOrWhiteSpace(menuItem.Tag.ToString())) + { + return null; + } + + if (!Guid.TryParse(menuItem.Tag.ToString(), out var tileId)) + { + return null; + } + + result = this.CurrentSession.FindById(tileId); + } + + return result; + } + + private ContextMenuStrip UpdateContextMenu(ContextMenuStrip contextMenu, List items) + { + var iconSize = this.CurrentSession.ShowBigIcons ? 24 : 16; + + contextMenu.ImageScalingSize = new Size(iconSize, iconSize); + contextMenu.Items.Clear(); + + foreach (var item in items ?? new List()) + { + var subItemMenuItem = new ToolStripMenuItem() + { + Text = item.Title, + Image = RyzStudio.IO.File.GetIcon(item.ResolvedTargetPath), + Tag = item.Id + }; + subItemMenuItem.Click += TileMenuItem_MouseClick; + + contextMenu.Items.Add(subItemMenuItem); + } + + return contextMenu; + } + + private TableLayoutPanel UpdateTable(TableLayoutPanel result, Size gridSize) + { + var addColumns = gridSize.Width - result.ColumnCount; + var addRows = gridSize.Height - result.RowCount; + var width = (TILE_SIZE + TILE_PADDING); + + UIControl.Invoke(result, (x) => + { + result.ColumnCount = gridSize.Width; + result.RowCount = gridSize.Height; + result.Height = (gridSize.Height * width) + TILE_PADDING; + result.Width = (gridSize.Width * width); + + foreach (ColumnStyle column in result.ColumnStyles) + { + column.SizeType = SizeType.Absolute; + column.Width = width; + } + + foreach (RowStyle row in result.RowStyles) + { + row.SizeType = SizeType.Absolute; + row.Height = width; + } + + for (var i = 0; i < addColumns; i++) + { + result.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, width)); + } + + for (var i = 0; i < addRows; i++) + { + result.RowStyles.Add(new RowStyle(SizeType.Absolute, width)); + } + }); + + return result; + } + + private void TilePanel_MouseClick(object sender, MouseEventArgs e) + { + var tilePanel = (sender as TilePanel); + + var tileInfo = this.GetTileInfo(sender); + if (tileInfo == null) { return; } - var newModel = new TileModel(); - - try + if (e.Button == MouseButtons.Left) { - newModel = JsonSerializer.Deserialize(JsonSerializer.Serialize(tile.ModelInfo)); - newModel.Title = (string.IsNullOrWhiteSpace(newModel.Title) ? "New Tile" : newModel.Title?.Trim()) + " (Copy)"; + if (tilePanel.IsGroup) + { + tilePanel.TileContextMenu?.Show(tilePanel, e.Location); + } + else + { + Execute(tileInfo); + } } - catch (Exception) + else + { + + } + } + + private void TileMenuItem_MouseClick(object sender, EventArgs e) + { + var tileInfo = this.GetTileInfo(sender); + if (tileInfo == null) { return; } - var newCoord = container.GetNextCoord(); - - var newTile = new RokettoLaunch.Windows.Forms.TilePanel(); - newTile.ContextMenuStrip = tileMenu1; - newTile.LoadInfo(newModel); - - container.Add(newTile, newCoord.X, newCoord.Y); - - _fileSessionManager.HasChanged = true; + Execute(tileInfo); } - private TileGroupModel GetSectionTag(TileContainer section) + private async Task TilePanel_OnFileDrop(TilePanel sender, Keys keys, List paths) { - var newTag = new TileGroupModel(); - newTag.Title = section.Title ?? "New Section"; - newTag.IsExpanded = section.IsOpen; - newTag.GridSize = section.GridSize; - newTag.Items = new List(); + var tileInfo = this.CurrentSession.FindById(sender.TileId); - foreach (var tile in section?.Controls?.OfType() ?? new List()) + // Append + if (keys.HasFlag(Keys.Shift)) { - tile.ModelInfo.Position = section.GetCoord(tile); + if (tileInfo.IsGroup) + { + this.AddToTile(tileInfo, paths, true); + } + else + { + var newTileInfo = tileInfo.CopyOf(); - newTag.Items.Add(tile.ModelInfo); + tileInfo.Title = "New Folder"; + tileInfo.IsGroup = true; + tileInfo.TargetPath = string.Empty; + tileInfo.StartPath = string.Empty; + tileInfo.Argument = string.Empty; + tileInfo.RunAsAdmin = false; + + tileInfo.Items.Clear(); + tileInfo.Items.Add(newTileInfo); + + this.AddToTile(tileInfo, paths, true); + + tileInfo.ResolvePaths(); + } + } + else + { + if (paths.Count <= 1) + { + tileInfo.IsGroup = false; + tileInfo.TargetPath = paths[0]; + tileInfo.StartPath = string.Empty; + tileInfo.Argument = string.Empty; + tileInfo.RunAsAdmin = false; + + tileInfo.Items.Clear(); + tileInfo.ResolvePaths(); + + tileInfo.Title = RyzStudio.IO.File.GetName(tileInfo.ResolvedTargetPath); + } + else + { + tileInfo.Title = "New Folder"; + tileInfo.IsGroup = true; + tileInfo.TargetPath = string.Empty; + tileInfo.StartPath = string.Empty; + tileInfo.Argument = string.Empty; + tileInfo.RunAsAdmin = false; + + tileInfo.Items.Clear(); + + this.AddToTile(tileInfo, paths, false); + + tileInfo.ResolvePaths(); + } } - return newTag; + sender.Title = tileInfo.Title; + sender.IsGroup = tileInfo.IsGroup; + + if (tileInfo.IsGroup) + { + sender.LargeIcon = AppResource.folder_32; + sender.TileContextMenu = new ContextMenuStrip(); + + this.UpdateContextMenu(sender.TileContextMenu, tileInfo.Items); + } + else + { + sender.LargeIcon = RyzStudio.IO.File.GetIcon(tileInfo.ResolvedTargetPath); + sender.TileContextMenu = null; + } } + private void Execute(App4Options.Item model) + { + if (model == null) + { + return; + } + + if (model.IsGroup) + { + return; + } + + if (this.CurrentSession.HideOnExecute) + { + this.Visible = false; + } + + RyzStudio.Diagnostics.Process.Execute(model.ResolvedTargetPath, model.ResolvedStartPath, model.ResolvedArgument, model.WindowStyle, model.RunAsAdmin); + } + + } } \ No newline at end of file diff --git a/Models/SaveFile/App3Options.cs b/Models/SaveFile/App3Options.cs new file mode 100644 index 0000000..d77d22c --- /dev/null +++ b/Models/SaveFile/App3Options.cs @@ -0,0 +1,58 @@ +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing; +using System.Text.Json.Serialization; + +namespace RokettoLaunch.Models.SaveFile +{ + public class App3Options : AppOptionsBase + { + public class Group + { + public string Title { get; set; } + + public bool IsExpanded { get; set; } = false; + + public List Items { get; set; } = new List(); + + [JsonConverter(typeof(RyzStudio.Text.Json.JsonSizeConverter))] + public Size GridSize { get; set; } = new Size(0, 0); + + } + + public class Item + { + public string Title { get; set; } + + public string ProcessFilename { get; set; } + + public string ProcessArgument { get; set; } + + public string ProcessWorkingDirectory { get; set; } + + public ProcessWindowStyle ProcessWindowStyle { get; set; } = ProcessWindowStyle.Normal; + + public bool ProcessAsAdmin { get; set; } = false; + + [JsonConverter(typeof(RyzStudio.Text.Json.JsonPointConverter))] + public Point Position { get; set; } + + public bool IsGroup { get; set; } = false; + + public List Items { get; set; } = new List(); + + + public override string ToString() + { + return this.Title?.Trim() ?? string.Empty; + } + + } + + + public new int FileVersion { get; set; } = 3; + + public List Groups { get; set; } = new List(); + + } +} \ No newline at end of file diff --git a/Models/SaveFile/App4Options.cs b/Models/SaveFile/App4Options.cs new file mode 100644 index 0000000..dc7fdcf --- /dev/null +++ b/Models/SaveFile/App4Options.cs @@ -0,0 +1,352 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace RokettoLaunch.Models.SaveFile +{ + public class App4Options : AppOptionsBase + { + public class Group + { + public Guid Id { get; set; } = Guid.NewGuid(); + + public string Title { get; set; } + + public bool IsOpen { get; set; } = false; + + public List Items { get; set; } = new List(); + + [JsonConverter(typeof(RyzStudio.Text.Json.JsonSizeConverter))] + public Size GridSize { get; set; } = new Size(0, 0); + + + public Group CopyOf() + { + var json = JsonSerializer.Serialize(this); + + var newGroupInfo = JsonSerializer.Deserialize(json); + newGroupInfo.Id = Guid.NewGuid(); + newGroupInfo.Title = "Copy of " + newGroupInfo.Title; + + // Resolve paths + foreach (var item in newGroupInfo.Items ?? new List()) + { + item.Id = Guid.NewGuid(); + + if (item.IsGroup) + { + foreach (var subItem in item.Items ?? new List()) + { + subItem.Id = Guid.NewGuid(); + + subItem.ResolvePaths(); + } + } + else + { + item.ResolvePaths(); + } + } + + return newGroupInfo; + } + + public Size GetMaxGridSize() + { + var result = this.GridSize; + var maxPosition = this.GetMaxPosition(); + + result.Width = Math.Max(result.Width, (maxPosition.X + 1)); + result.Height = Math.Max(result.Height, (maxPosition.Y + 1)); + + return result; + } + + public Point GetMaxPosition() + { + if (this.Items.Count <= 0) + { + return new Point(0, 0); + } + + var result = new Point(0, 0); + result.Y = this.Items.Select(x => x.Position.Y).Max(); + result.X = this.Items.Where(x => x.Position.Y == result.Y)?.Select(x => x.Position.X)?.Max() ?? 0; + + return result; + } + + public Point GetNextPosition() + { + if (this.Items.Count <= 0) + { + return new Point(0, 0); + } + + var pos = this.GetMaxPosition(); + pos.X++; + + if (pos.X > (this.GridSize.Width - 1)) + { + pos.X = 0; + pos.Y++; + } + + return pos; + } + + public bool CanPosition(Item tile) + { + if (tile.Position == new Point(-1, -1)) + { + return false; + } + + if (Items.Count <= 0) + { + return true; + } + + return !Items.Where(x => x.Id != tile.Id && x.Position == tile.Position).Any(); + } + + } + + public class Item + { + public static Item Create(App3Options.Item model) + { + var result = new Item(); + result.Load(model); + + return result; + } + + + public Guid Id { get; set; } = Guid.NewGuid(); + + public string Title { get; set; } + + public string TargetPath { get; set; } + + public string Argument { get; set; } + + public string StartPath { get; set; } + + public ProcessWindowStyle WindowStyle { get; set; } = ProcessWindowStyle.Normal; + + public bool RunAsAdmin { get; set; } = false; + + [JsonConverter(typeof(RyzStudio.Text.Json.JsonPointConverter))] + public Point Position { get; set; } + + public bool IsGroup { get; set; } = false; + + public List Items { get; set; } = new List(); + + [JsonIgnore] + public string ResolvedTargetPath { get; private set; } + + [JsonIgnore] + public string ResolvedArgument { get; private set; } + + [JsonIgnore] + public string ResolvedStartPath { get; private set; } + + + public Item CopyOf() + { + var json = JsonSerializer.Serialize(this); + + var newTileInfo = JsonSerializer.Deserialize(json); + newTileInfo.Id = Guid.NewGuid(); + newTileInfo.Title = "Copy of " + newTileInfo.Title; + newTileInfo.Position = new Point(-1, -1); + + if (newTileInfo.IsGroup) + { + foreach (var subItem in newTileInfo.Items ?? new List()) + { + subItem.Id = Guid.NewGuid(); + + subItem.ResolvePaths(); + } + } + else + { + newTileInfo.ResolvePaths(); + } + + return newTileInfo; + } + + public void Load(App3Options.Item model) + { + this.Title = model.Title; + this.TargetPath = model.ProcessFilename; + this.Argument = model.ProcessArgument; + this.StartPath = model.ProcessWorkingDirectory; + this.WindowStyle = model.ProcessWindowStyle; + this.RunAsAdmin = model.ProcessAsAdmin; + this.Position = model.Position; + this.IsGroup = model.IsGroup; + this.Items = model.Items.Select(x => Item.Create(x))?.ToList() ?? new List(); + } + + public void Load(Item model) + { + this.Title = model.Title; + this.TargetPath = model.TargetPath; + this.Argument = model.Argument; + this.StartPath = model.StartPath; + this.WindowStyle = model.WindowStyle; + this.RunAsAdmin = model.RunAsAdmin; + this.Position = model.Position; + this.IsGroup = model.IsGroup; + + this.Items = model.Items ?? new List(); + + this.ResolvedTargetPath = model.ResolvedTargetPath; + this.ResolvedStartPath = model.ResolvedStartPath; + this.ResolvedArgument = model.ResolvedArgument; + } + + public void ResolvePaths() + { + if (this.IsGroup) + { + foreach (var subItem in this.Items ?? new List()) + { + subItem.ResolvePaths(); + } + } + else + { + this.ResolvedTargetPath = RyzStudio.IO.File.ResolvePath(this.TargetPath); + this.ResolvedArgument = RyzStudio.IO.File.ResolvePath(this.Argument); + this.ResolvedStartPath = RyzStudio.IO.File.ResolvePath(this.StartPath); + } + } + + + public override string ToString() + { + return this.Title?.Trim() ?? string.Empty; + } + + } + + + public new int FileVersion { get; set; } = 4; + + public List Groups { get; set; } = new List(); + + public void Load(App3Options options) + { + this.TilesPerRow = options.TilesPerRow; + this.ShowBigIcons = options.ShowBigIcons; + this.ShowToggleHotkey = options.ShowToggleHotkey; + this.HideOnClose = options.HideOnClose; + this.HideOnExecute = options.HideOnExecute; + this.AlwaysOnTop = options.AlwaysOnTop; + this.StartPosition = options.StartPosition; + this.Height = options.Height; + + foreach (var group in options.Groups) + { + var newGroup = new Group() + { + Title = group.Title, + IsOpen = group.IsExpanded, + GridSize = group.GridSize + }; + + newGroup.Items = group.Items.Select(x => Item.Create(x))?.ToList() ?? new List(); + + this.Groups.Add(newGroup); + } + } + + public Item FindById(Guid id) + { + if (id == Guid.Empty) + { + return null; + } + + foreach (var group in this.Groups) + { + foreach (var item in group.Items) + { + if (item.Id == id) + { + return item; + } + + if (item.IsGroup) + { + foreach (var subItem in item.Items) + { + if (subItem.Id == id) + { + return subItem; + } + } + } + } + } + + return null; + } + + public bool Update(Item value) + { + var result = this.FindById(value.Id); + if (result == null) + { + return false; + } + + result.Load(value); + + return true; + } + + public bool Remove(Guid id) + { + if (id == Guid.Empty) + { + return false; + } + + foreach (var group in this.Groups) + { + foreach (var item in group.Items) + { + if (item.Id == id) + { + return group.Items.Remove(item); + } + + if (item.IsGroup) + { + foreach (var subItem in item.Items) + { + if (subItem.Id == id) + { + return item.Items.Remove(subItem); + } + } + } + } + } + + return false; + } + + } +} \ No newline at end of file diff --git a/Models/AppOptions.cs b/Models/SaveFile/AppOptionsBase.cs similarity index 72% rename from Models/AppOptions.cs rename to Models/SaveFile/AppOptionsBase.cs index afd46e7..c178f24 100644 --- a/Models/AppOptions.cs +++ b/Models/SaveFile/AppOptionsBase.cs @@ -1,10 +1,11 @@ -using System.Collections.Generic; -using System.Drawing; +using System.Drawing; -namespace RokettoLaunch.Models +namespace RokettoLaunch.Models.SaveFile { - public class AppOptions + public class AppOptionsBase { + public int FileVersion { get; set; } = 0; + public int TilesPerRow { get; set; } = 8; public bool ShowBigIcons { get; set; } = true; @@ -17,8 +18,6 @@ namespace RokettoLaunch.Models public bool AlwaysOnTop { get; set; } = false; - public List Groups { get; set; } = new List(); - public Point StartPosition { get; set; } = Point.Empty; public int Height { get; set; } = 280; diff --git a/Models/TileGroupModel.cs b/Models/TileGroupModel.cs deleted file mode 100644 index d5e25ef..0000000 --- a/Models/TileGroupModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Collections.Generic; -using System.Drawing; -using System.Text.Json.Serialization; - -namespace RokettoLaunch.Models -{ - public class TileGroupModel - { - public string Title { get; set; } - - public bool IsExpanded { get; set; } = false; - - public List Items { get; set; } = new List(); - - [JsonConverter(typeof(RyzStudio.Text.Json.JsonSizeConverter))] - public Size GridSize { get; set; } = new Size(0, 0); - - } -} \ No newline at end of file diff --git a/Models/TileModel.cs b/Models/TileModel.cs deleted file mode 100644 index b70d6a6..0000000 --- a/Models/TileModel.cs +++ /dev/null @@ -1,259 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Drawing; -using System.Text.Json.Serialization; - -namespace RokettoLaunch.Models -{ - public class TileModel - { - public string Title { get; set; } - - public string ProcessFilename { get; set; } - - public string ProcessArgument { get; set; } - - public string ProcessWorkingDirectory { get; set; } - - public ProcessWindowStyle ProcessWindowStyle { get; set; } = ProcessWindowStyle.Normal; - - public bool ProcessAsAdmin { get; set; } = false; - - [JsonConverter(typeof(RyzStudio.Text.Json.JsonPointConverter))] - public Point Position { get; set; } - - public bool IsGroup { get; set; } = false; - - public List Items { get; set; } = new List(); - - public string Version { get; set; } - - - public override string ToString() => this.Title ?? string.Empty; - - - [JsonIgnore] - public string CleanProcessFilename - { - get - { - return (string.IsNullOrWhiteSpace(this.ProcessFilename) ? string.Empty : ResolvePath(this.ProcessFilename)); - } - } - - [JsonIgnore] - public string CleanProcessArgument - { - get - { - return (string.IsNullOrWhiteSpace(this.ProcessArgument) ? string.Empty : ResolvePath(this.ProcessArgument)); - } - } - - [JsonIgnore] - public string CleanProcessWorkingDirectory - { - get - { - return (string.IsNullOrWhiteSpace(this.ProcessWorkingDirectory) ? string.Empty : ResolvePath(this.ProcessWorkingDirectory)); - } - } - - - private Tuple SplitPath(string path, string needle) - { - if (string.IsNullOrWhiteSpace(path)) - { - return null; - } - - if (string.IsNullOrWhiteSpace(needle)) - { - return null; - } - - if (!path.Contains(needle)) - { - return null; - } - - string head = path.Substring(0, path.IndexOf(needle)); - string tail = path.Substring(path.IndexOf(needle) + needle.Length); - - return new Tuple(head, tail); - } - - private string GetFirstPath(string value) - { - var parts = SplitPath(value, "%FIRST%"); - if (parts == null) - { - return null; - } - - string[] dirList = new string[0]; - - try - { - dirList = System.IO.Directory.GetDirectories(parts.Item1, "*", System.IO.SearchOption.TopDirectoryOnly); - } - catch - { - // do nothing - } - - if (dirList.Length <= 0) - { - return null; - } - - return System.IO.Path.GetFileName(dirList[0]); - } - - private string GetLastPath(string value) - { - var parts = SplitPath(value, "%LAST%"); - if (parts == null) - { - return null; - } - - string[] dirList = new string[0]; - - try - { - dirList = System.IO.Directory.GetDirectories(parts.Item1, "*", System.IO.SearchOption.TopDirectoryOnly); - } - catch - { - // do nothing - } - - if (dirList.Length <= 0) - { - return null; - } - - return System.IO.Path.GetFileName(dirList[(dirList.Length - 1)]); - } - - private string ResolvePath(string path) - { - var result = Environment.ExpandEnvironmentVariables(path); - - if (result.Contains("%FIRST%")) - { - result = ResolveFirstPath(result); - } - - if (result.Contains("%LAST%")) - { - result = ResolveLastPath(result); - } - - return result; - } - - private string ResolveFirstPath(string value) - { - var parts = SplitPath(value, "%FIRST%"); - if (parts == null) - { - return value; - } - - try - { - if (!System.IO.Directory.Exists(parts.Item1)) - { - return value; - } - } - catch (Exception) - { - return value; - } - - // Try cached version - if (!string.IsNullOrWhiteSpace(this.Version)) - { - var filename = parts.Item1 + this.Version + parts.Item2; - - try - { - if (System.IO.File.Exists(filename)) - { - return filename; - } - } - catch (Exception) - { - - } - } - - // Resolve version - var version = GetFirstPath(value); - if (version == null) - { - return value; - } - - this.Version = version; - - return parts.Item1 + version + parts.Item2; - } - - private string ResolveLastPath(string value) - { - var parts = SplitPath(value, "%LAST%"); - if (parts == null) - { - return value; - } - - try - { - if (!System.IO.Directory.Exists(parts.Item1)) - { - return value; - } - } - catch (Exception) - { - return value; - } - - // Try cached version - if (!string.IsNullOrWhiteSpace(this.Version)) - { - var filename = parts.Item1 + this.Version + parts.Item2; - - try - { - if (System.IO.File.Exists(filename)) - { - return filename; - } - } - catch (Exception) - { - - } - } - - // Resolve version - var version = GetLastPath(value); - if (version == null) - { - return value; - } - - this.Version = version; - - return parts.Item1 + version + parts.Item2; - } - - } -} \ No newline at end of file diff --git a/OptionsForm.cs b/OptionsForm.cs index 40f1bcf..38b71fc 100644 --- a/OptionsForm.cs +++ b/OptionsForm.cs @@ -1,7 +1,6 @@ using System; -using System.Linq; using System.Windows.Forms; -using RokettoLaunch.Models; +using RokettoLaunch.Models.SaveFile; using RyzStudio.Windows.Forms; using RyzStudio.Windows.ThemedForms; using RyzStudio.Windows.ThemedForms.ButtonTextBox; @@ -11,247 +10,153 @@ namespace RokettoLaunch { public class OptionsForm : Form { - private System.Windows.Forms.Label label1; - private ThYesNoPickerBox yesNoPickerBox2; - private System.Windows.Forms.Label label6; - private ThYesNoPickerBox yesNoPickerBox3; - private System.Windows.Forms.Label label7; - private ThKeyCodeTextBox textBox1; - private ThNumericBox numericBox1; - private Label label4; - private FlowLayoutPanel flowLayoutPanel1; - private TTogglePanel tTogglePanel1; - private TTogglePanel tTogglePanel2; - private ThYesNoPickerBox yesNoPickerBox1; - private Label label2; - private ThYesNoPickerBox yesNoPickerBox4; - private Label label3; private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1; + private FlowLayoutPanel flowLayoutPanel1; + private TTogglePanel togglePanel1; + private Label label2; + private Label label4; + private TTogglePanel togglePanel2; + private Label label3; + private Label label1; + private Label label6; + private Label label7; + private ThYesNoPickerBox yesNoPickerBox1; + private ThNumericBox numericBox1; + private ThYesNoPickerBox yesNoPickerBox4; + private ThKeyCodeTextBox textBox1; + private ThYesNoPickerBox yesNoPickerBox2; + private ThYesNoPickerBox yesNoPickerBox3; + private TTogglePanel togglePanel3; + + private App4Options _appSession = null; - private AppOptions _appSession = null; - - - public OptionsForm(AppOptions appSession) + public OptionsForm(App4Options appSession) { InitializeComponent(); - UISetup.Dialog(this); + UISetup.Dialog(this, true); + UISetup.AutoSizeChildren(flowLayoutPanel1); _appSession = appSession; numericBox1.Minimum = 4; numericBox1.Maximum = 24; + } - if (_appSession != null) - { - numericBox1.Value = _appSession.TilesPerRow; - yesNoPickerBox1.Value = _appSession.ShowBigIcons; - textBox1.UpdateKeyCode(_appSession?.ShowToggleHotkey ?? new ThKeyCodeTextBox.Results()); - yesNoPickerBox2.Value = _appSession.HideOnClose; - yesNoPickerBox3.Value = _appSession.HideOnExecute; - yesNoPickerBox4.Value = _appSession.AlwaysOnTop; - } + protected override void OnShown(EventArgs e) + { + base.OnShown(e); + + numericBox1.Value = _appSession?.TilesPerRow ?? 4; + yesNoPickerBox1.Value = _appSession?.ShowBigIcons ?? true; + textBox1.UpdateKeyCode(_appSession?.ShowToggleHotkey ?? new ThKeyCodeTextBox.Results()); + yesNoPickerBox4.Value = _appSession?.AlwaysOnTop ?? true; + yesNoPickerBox2.Value = _appSession?.HideOnClose ?? true; + yesNoPickerBox3.Value = _appSession?.HideOnExecute ?? true; } private void InitializeComponent() { ThKeyCodeTextBox.Results results1 = new ThKeyCodeTextBox.Results(); - label1 = new Label(); - yesNoPickerBox2 = new ThYesNoPickerBox(); - label6 = new Label(); - yesNoPickerBox3 = new ThYesNoPickerBox(); - label7 = new Label(); - textBox1 = new ThKeyCodeTextBox(); - numericBox1 = new ThNumericBox(); - label4 = new Label(); - flowLayoutPanel1 = new FlowLayoutPanel(); - tTogglePanel1 = new TTogglePanel(); - yesNoPickerBox1 = new ThYesNoPickerBox(); - label2 = new Label(); - tTogglePanel2 = new TTogglePanel(); - yesNoPickerBox4 = new ThYesNoPickerBox(); - label3 = new Label(); dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter(); + flowLayoutPanel1 = new FlowLayoutPanel(); + togglePanel1 = new TTogglePanel(); + yesNoPickerBox1 = new ThYesNoPickerBox(); + numericBox1 = new ThNumericBox(); + label2 = new Label(); + label4 = new Label(); + togglePanel2 = new TTogglePanel(); + label6 = new Label(); + yesNoPickerBox4 = new ThYesNoPickerBox(); + textBox1 = new ThKeyCodeTextBox(); + yesNoPickerBox2 = new ThYesNoPickerBox(); + label3 = new Label(); + label1 = new Label(); + togglePanel3 = new TTogglePanel(); + label7 = new Label(); + yesNoPickerBox3 = new ThYesNoPickerBox(); flowLayoutPanel1.SuspendLayout(); - tTogglePanel1.SuspendLayout(); - tTogglePanel2.SuspendLayout(); + togglePanel1.SuspendLayout(); + togglePanel2.SuspendLayout(); + togglePanel3.SuspendLayout(); SuspendLayout(); // - // label1 + // dialogFooter1 // - label1.AutoSize = true; - label1.BackColor = System.Drawing.Color.Transparent; - label1.ForeColor = System.Drawing.SystemColors.ControlText; - label1.Location = new System.Drawing.Point(1, 22); - label1.Margin = new Padding(0); - label1.Name = "label1"; - label1.Padding = new Padding(0, 8, 0, 0); - label1.Size = new System.Drawing.Size(115, 23); - label1.TabIndex = 153; - label1.Text = "Show Toggle Hotkey"; - label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // yesNoPickerBox2 - // - yesNoPickerBox2.Anchor = AnchorStyles.Top | AnchorStyles.Right; - yesNoPickerBox2.BackColor = System.Drawing.Color.Transparent; - yesNoPickerBox2.EnableReactiveVisual = true; - yesNoPickerBox2.Font = new System.Drawing.Font("Segoe UI", 9F); - yesNoPickerBox2.Location = new System.Drawing.Point(307, 63); - yesNoPickerBox2.Name = "yesNoPickerBox2"; - yesNoPickerBox2.Padding = new Padding(4, 4, 3, 3); - yesNoPickerBox2.SelectedIndex = 1; - yesNoPickerBox2.Size = new System.Drawing.Size(84, 34); - yesNoPickerBox2.TabIndex = 183; - yesNoPickerBox2.TabStop = false; - yesNoPickerBox2.Value = true; - // - // label6 - // - label6.AutoSize = true; - label6.BackColor = System.Drawing.Color.Transparent; - label6.ForeColor = System.Drawing.SystemColors.ControlText; - label6.Location = new System.Drawing.Point(1, 63); - label6.Margin = new Padding(0); - label6.Name = "label6"; - label6.Padding = new Padding(0, 8, 0, 0); - label6.Size = new System.Drawing.Size(83, 23); - label6.TabIndex = 182; - label6.Text = "Hide On Close"; - label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // yesNoPickerBox3 - // - yesNoPickerBox3.Anchor = AnchorStyles.Top | AnchorStyles.Right; - yesNoPickerBox3.BackColor = System.Drawing.Color.Transparent; - yesNoPickerBox3.EnableReactiveVisual = true; - yesNoPickerBox3.Font = new System.Drawing.Font("Segoe UI", 9F); - yesNoPickerBox3.Location = new System.Drawing.Point(307, 107); - yesNoPickerBox3.Name = "yesNoPickerBox3"; - yesNoPickerBox3.Padding = new Padding(4, 4, 3, 3); - yesNoPickerBox3.SelectedIndex = 1; - yesNoPickerBox3.Size = new System.Drawing.Size(84, 34); - yesNoPickerBox3.TabIndex = 185; - yesNoPickerBox3.TabStop = false; - yesNoPickerBox3.Value = true; - // - // label7 - // - label7.AutoSize = true; - label7.BackColor = System.Drawing.Color.Transparent; - label7.ForeColor = System.Drawing.SystemColors.ControlText; - label7.Location = new System.Drawing.Point(1, 107); - label7.Margin = new Padding(0); - label7.Name = "label7"; - label7.Padding = new Padding(0, 8, 0, 0); - label7.Size = new System.Drawing.Size(95, 23); - label7.TabIndex = 184; - label7.Text = "Hide On Execute"; - label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // textBox1 - // - textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; - textBox1.BackColor = System.Drawing.Color.Transparent; - textBox1.EnableReactiveVisual = true; - textBox1.Font = new System.Drawing.Font("Segoe UI", 9F); - textBox1.Icon = "O"; - textBox1.IconSize = 13F; - results1.IsAlt = false; - results1.IsCtrl = false; - results1.IsShift = false; - results1.Key = Keys.None; - textBox1.KeyCodeResults = results1; - textBox1.Location = new System.Drawing.Point(192, 21); - textBox1.Name = "textBox1"; - textBox1.Padding = new Padding(4, 4, 3, 3); - textBox1.Size = new System.Drawing.Size(199, 32); - textBox1.TabIndex = 189; - textBox1.TabStop = false; - textBox1.UseSystemPasswordChar = false; - // - // numericBox1 - // - numericBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right; - numericBox1.BackColor = System.Drawing.Color.Transparent; - numericBox1.EnableReactiveVisual = true; - numericBox1.Font = new System.Drawing.Font("Segoe UI", 9F); - numericBox1.Location = new System.Drawing.Point(252, 22); - numericBox1.Maximum = 100; - numericBox1.Minimum = 1; - numericBox1.Name = "numericBox1"; - numericBox1.Padding = new Padding(4, 4, 3, 3); - numericBox1.Size = new System.Drawing.Size(139, 32); - numericBox1.TabIndex = 192; - numericBox1.TabStop = false; - numericBox1.Value = 1; - // - // label4 - // - label4.AutoSize = true; - label4.BackColor = System.Drawing.Color.Transparent; - label4.ForeColor = System.Drawing.SystemColors.ControlText; - label4.Location = new System.Drawing.Point(1, 22); - label4.Margin = new Padding(0); - label4.Name = "label4"; - label4.Padding = new Padding(0, 8, 0, 0); - label4.Size = new System.Drawing.Size(76, 23); - label4.TabIndex = 193; - label4.Text = "Tiles Per Row"; - label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + dialogFooter1.BackColor = System.Drawing.Color.FromArgb(240, 240, 240); + dialogFooter1.Dock = DockStyle.Bottom; + dialogFooter1.EnableMovable = false; + dialogFooter1.IsBusy = false; + dialogFooter1.Location = new System.Drawing.Point(0, 451); + dialogFooter1.Name = "dialogFooter1"; + dialogFooter1.Size = new System.Drawing.Size(444, 70); + dialogFooter1.TabIndex = 0; + dialogFooter1.TabStop = false; // // flowLayoutPanel1 // - flowLayoutPanel1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; flowLayoutPanel1.AutoScroll = true; flowLayoutPanel1.BackColor = System.Drawing.Color.Transparent; - flowLayoutPanel1.Controls.Add(tTogglePanel1); - flowLayoutPanel1.Controls.Add(tTogglePanel2); + flowLayoutPanel1.Controls.Add(togglePanel1); + flowLayoutPanel1.Controls.Add(togglePanel2); + flowLayoutPanel1.Controls.Add(togglePanel3); + flowLayoutPanel1.Dock = DockStyle.Fill; flowLayoutPanel1.FlowDirection = FlowDirection.TopDown; - flowLayoutPanel1.Location = new System.Drawing.Point(8, 12); + flowLayoutPanel1.Location = new System.Drawing.Point(0, 0); flowLayoutPanel1.Name = "flowLayoutPanel1"; - flowLayoutPanel1.Size = new System.Drawing.Size(436, 412); - flowLayoutPanel1.TabIndex = 194; + flowLayoutPanel1.Padding = new Padding(10, 0, 0, 0); + flowLayoutPanel1.Size = new System.Drawing.Size(444, 451); + flowLayoutPanel1.TabIndex = 195; flowLayoutPanel1.WrapContents = false; - flowLayoutPanel1.Resize += flowLayoutPanel1_Resize; // - // tTogglePanel1 + // togglePanel1 // - tTogglePanel1.AutoScrollMargin = new System.Drawing.Size(0, 0); - tTogglePanel1.AutoScrollMinSize = new System.Drawing.Size(0, 0); - tTogglePanel1.Controls.Add(yesNoPickerBox1); - tTogglePanel1.Controls.Add(label2); - tTogglePanel1.Controls.Add(label4); - tTogglePanel1.Controls.Add(numericBox1); - tTogglePanel1.ExpandedHeight = 119; - tTogglePanel1.ForeColor = System.Drawing.Color.FromArgb(99, 105, 119); - tTogglePanel1.HeaderPadding = new Padding(4, 0, 0, 2); - tTogglePanel1.IsOpen = true; - tTogglePanel1.Location = new System.Drawing.Point(0, 0); - tTogglePanel1.Margin = new Padding(0); - tTogglePanel1.Name = "tTogglePanel1"; - tTogglePanel1.Padding = new Padding(0, 22, 0, 0); - tTogglePanel1.Size = new System.Drawing.Size(401, 119); - tTogglePanel1.TabIndex = 0; - tTogglePanel1.Title = "Appearance"; - tTogglePanel1.TitleContextMenuStrip = null; - tTogglePanel1.TitleCursor = Cursors.Default; + togglePanel1.BackColor = System.Drawing.Color.FromArgb(252, 252, 252); + togglePanel1.CloseIcon = "H"; + togglePanel1.Controls.Add(yesNoPickerBox1); + togglePanel1.Controls.Add(numericBox1); + togglePanel1.Controls.Add(label2); + togglePanel1.Controls.Add(label4); + togglePanel1.EnableMovable = false; + togglePanel1.ExpandedHeight = 103; + togglePanel1.HeaderPadding = new Padding(4, 0, 0, 2); + togglePanel1.IconWidth = 20; + togglePanel1.Location = new System.Drawing.Point(10, 0); + togglePanel1.Name = "togglePanel1"; + togglePanel1.OpenIcon = "G"; + togglePanel1.Size = new System.Drawing.Size(401, 103); + togglePanel1.TabIndex = 0; + togglePanel1.Title = "Appearance"; + togglePanel1.TitleContextMenuStrip = null; + togglePanel1.TitleCursor = Cursors.Default; // // yesNoPickerBox1 // yesNoPickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right; yesNoPickerBox1.BackColor = System.Drawing.Color.Transparent; - yesNoPickerBox1.EnableReactiveVisual = true; - yesNoPickerBox1.Font = new System.Drawing.Font("Segoe UI", 9F); - yesNoPickerBox1.Location = new System.Drawing.Point(307, 64); + yesNoPickerBox1.EnableMovable = false; + yesNoPickerBox1.Location = new System.Drawing.Point(311, 61); yesNoPickerBox1.Name = "yesNoPickerBox1"; - yesNoPickerBox1.Padding = new Padding(4, 4, 3, 3); - yesNoPickerBox1.SelectedIndex = 1; - yesNoPickerBox1.Size = new System.Drawing.Size(84, 34); - yesNoPickerBox1.TabIndex = 195; + yesNoPickerBox1.SelectedIndex = 0; + yesNoPickerBox1.Size = new System.Drawing.Size(80, 32); + yesNoPickerBox1.TabIndex = 197; yesNoPickerBox1.TabStop = false; - yesNoPickerBox1.Value = true; + yesNoPickerBox1.Value = false; + // + // numericBox1 + // + numericBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right; + numericBox1.BackColor = System.Drawing.Color.Transparent; + numericBox1.EnableMovable = false; + numericBox1.Location = new System.Drawing.Point(251, 19); + numericBox1.Maximum = 100; + numericBox1.Minimum = 1; + numericBox1.Name = "numericBox1"; + numericBox1.Size = new System.Drawing.Size(140, 32); + numericBox1.TabIndex = 196; + numericBox1.TabStop = false; + numericBox1.Value = 1; // // label2 // @@ -267,53 +172,108 @@ namespace RokettoLaunch label2.Text = "Show Big Icons"; label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // tTogglePanel2 + // label4 // - tTogglePanel2.AutoScrollMargin = new System.Drawing.Size(0, 0); - tTogglePanel2.AutoScrollMinSize = new System.Drawing.Size(0, 0); - tTogglePanel2.Controls.Add(yesNoPickerBox4); - tTogglePanel2.Controls.Add(label3); - tTogglePanel2.Controls.Add(label1); - tTogglePanel2.Controls.Add(textBox1); - tTogglePanel2.Controls.Add(yesNoPickerBox2); - tTogglePanel2.Controls.Add(yesNoPickerBox3); - tTogglePanel2.Controls.Add(label6); - tTogglePanel2.Controls.Add(label7); - tTogglePanel2.ExpandedHeight = 206; - tTogglePanel2.ForeColor = System.Drawing.Color.FromArgb(99, 105, 119); - tTogglePanel2.HeaderPadding = new Padding(4, 0, 0, 2); - tTogglePanel2.IsOpen = true; - tTogglePanel2.Location = new System.Drawing.Point(0, 119); - tTogglePanel2.Margin = new Padding(0); - tTogglePanel2.Name = "tTogglePanel2"; - tTogglePanel2.Padding = new Padding(0, 22, 0, 0); - tTogglePanel2.Size = new System.Drawing.Size(401, 206); - tTogglePanel2.TabIndex = 1; - tTogglePanel2.Title = "Behaviour"; - tTogglePanel2.TitleContextMenuStrip = null; - tTogglePanel2.TitleCursor = Cursors.Default; + label4.AutoSize = true; + label4.BackColor = System.Drawing.Color.Transparent; + label4.ForeColor = System.Drawing.SystemColors.ControlText; + label4.Location = new System.Drawing.Point(1, 22); + label4.Margin = new Padding(0); + label4.Name = "label4"; + label4.Padding = new Padding(0, 8, 0, 0); + label4.Size = new System.Drawing.Size(76, 23); + label4.TabIndex = 193; + label4.Text = "Tiles Per Row"; + label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // togglePanel2 + // + togglePanel2.BackColor = System.Drawing.Color.FromArgb(252, 252, 252); + togglePanel2.CloseIcon = "H"; + togglePanel2.Controls.Add(label6); + togglePanel2.Controls.Add(yesNoPickerBox4); + togglePanel2.Controls.Add(textBox1); + togglePanel2.Controls.Add(yesNoPickerBox2); + togglePanel2.Controls.Add(label3); + togglePanel2.Controls.Add(label1); + togglePanel2.EnableMovable = false; + togglePanel2.ExpandedHeight = 148; + togglePanel2.HeaderPadding = new Padding(4, 0, 0, 2); + togglePanel2.IconWidth = 20; + togglePanel2.Location = new System.Drawing.Point(10, 113); + togglePanel2.Name = "togglePanel2"; + togglePanel2.OpenIcon = "G"; + togglePanel2.Size = new System.Drawing.Size(401, 148); + togglePanel2.TabIndex = 1; + togglePanel2.Title = "Behaviour"; + togglePanel2.TitleContextMenuStrip = null; + togglePanel2.TitleCursor = Cursors.Default; + // + // label6 + // + label6.AutoSize = true; + label6.BackColor = System.Drawing.Color.Transparent; + label6.ForeColor = System.Drawing.SystemColors.ControlText; + label6.Location = new System.Drawing.Point(1, 106); + label6.Margin = new Padding(0); + label6.Name = "label6"; + label6.Padding = new Padding(0, 8, 0, 0); + label6.Size = new System.Drawing.Size(116, 23); + label6.TabIndex = 182; + label6.Text = "Close To System Tray"; + label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // yesNoPickerBox4 // yesNoPickerBox4.Anchor = AnchorStyles.Top | AnchorStyles.Right; yesNoPickerBox4.BackColor = System.Drawing.Color.Transparent; - yesNoPickerBox4.EnableReactiveVisual = true; - yesNoPickerBox4.Font = new System.Drawing.Font("Segoe UI", 9F); - yesNoPickerBox4.Location = new System.Drawing.Point(307, 151); + yesNoPickerBox4.EnableMovable = false; + yesNoPickerBox4.Location = new System.Drawing.Point(311, 64); yesNoPickerBox4.Name = "yesNoPickerBox4"; - yesNoPickerBox4.Padding = new Padding(4, 4, 3, 3); - yesNoPickerBox4.SelectedIndex = 1; - yesNoPickerBox4.Size = new System.Drawing.Size(84, 34); - yesNoPickerBox4.TabIndex = 191; + yesNoPickerBox4.SelectedIndex = 0; + yesNoPickerBox4.Size = new System.Drawing.Size(80, 32); + yesNoPickerBox4.TabIndex = 195; yesNoPickerBox4.TabStop = false; - yesNoPickerBox4.Value = true; + yesNoPickerBox4.Value = false; + // + // textBox1 + // + textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + textBox1.BackColor = System.Drawing.Color.Transparent; + textBox1.EnableMovable = false; + textBox1.Icon = "O"; + textBox1.IconSize = 13F; + results1.IsAlt = false; + results1.IsCtrl = false; + results1.IsShift = false; + results1.Key = Keys.None; + textBox1.KeyCodeResults = results1; + textBox1.Location = new System.Drawing.Point(211, 22); + textBox1.Name = "textBox1"; + textBox1.Size = new System.Drawing.Size(180, 32); + textBox1.TabIndex = 194; + textBox1.TabStop = false; + textBox1.UseSystemPasswordChar = false; + // + // yesNoPickerBox2 + // + yesNoPickerBox2.Anchor = AnchorStyles.Top | AnchorStyles.Right; + yesNoPickerBox2.BackColor = System.Drawing.Color.Transparent; + yesNoPickerBox2.EnableMovable = false; + yesNoPickerBox2.Location = new System.Drawing.Point(311, 106); + yesNoPickerBox2.Name = "yesNoPickerBox2"; + yesNoPickerBox2.SelectedIndex = 0; + yesNoPickerBox2.Size = new System.Drawing.Size(80, 32); + yesNoPickerBox2.TabIndex = 192; + yesNoPickerBox2.TabStop = false; + yesNoPickerBox2.Value = false; // // label3 // label3.AutoSize = true; label3.BackColor = System.Drawing.Color.Transparent; label3.ForeColor = System.Drawing.SystemColors.ControlText; - label3.Location = new System.Drawing.Point(1, 151); + label3.Location = new System.Drawing.Point(1, 64); label3.Margin = new Padding(0); label3.Name = "label3"; label3.Padding = new Padding(0, 8, 0, 0); @@ -322,16 +282,65 @@ namespace RokettoLaunch label3.Text = "Always On Top"; label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // dialogFooter1 + // label1 // - dialogFooter1.BackColor = System.Drawing.Color.FromArgb(240, 240, 240); - dialogFooter1.Button1Text = "&Save"; - dialogFooter1.Dialog = this; - dialogFooter1.Dock = DockStyle.Bottom; - dialogFooter1.IsBusy = false; - dialogFooter1.Location = new System.Drawing.Point(0, 437); - dialogFooter1.Name = "dialogFooter1"; - dialogFooter1.Size = new System.Drawing.Size(444, 84); + label1.AutoSize = true; + label1.BackColor = System.Drawing.Color.Transparent; + label1.ForeColor = System.Drawing.SystemColors.ControlText; + label1.Location = new System.Drawing.Point(1, 22); + label1.Margin = new Padding(0); + label1.Name = "label1"; + label1.Padding = new Padding(0, 8, 0, 0); + label1.Size = new System.Drawing.Size(115, 23); + label1.TabIndex = 153; + label1.Text = "Show Toggle Hotkey"; + label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // togglePanel3 + // + togglePanel3.BackColor = System.Drawing.Color.FromArgb(252, 252, 252); + togglePanel3.CloseIcon = "H"; + togglePanel3.Controls.Add(label7); + togglePanel3.Controls.Add(yesNoPickerBox3); + togglePanel3.EnableMovable = false; + togglePanel3.ExpandedHeight = 64; + togglePanel3.HeaderPadding = new Padding(4, 0, 0, 2); + togglePanel3.IconWidth = 20; + togglePanel3.Location = new System.Drawing.Point(10, 271); + togglePanel3.Name = "togglePanel3"; + togglePanel3.OpenIcon = "G"; + togglePanel3.Size = new System.Drawing.Size(401, 64); + togglePanel3.TabIndex = 2; + togglePanel3.Title = "Action"; + togglePanel3.TitleContextMenuStrip = null; + togglePanel3.TitleCursor = Cursors.Default; + // + // label7 + // + label7.AutoSize = true; + label7.BackColor = System.Drawing.Color.Transparent; + label7.ForeColor = System.Drawing.SystemColors.ControlText; + label7.Location = new System.Drawing.Point(1, 22); + label7.Margin = new Padding(0); + label7.Name = "label7"; + label7.Padding = new Padding(0, 8, 0, 0); + label7.Size = new System.Drawing.Size(95, 23); + label7.TabIndex = 184; + label7.Text = "Hide On Execute"; + label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // yesNoPickerBox3 + // + yesNoPickerBox3.Anchor = AnchorStyles.Top | AnchorStyles.Right; + yesNoPickerBox3.BackColor = System.Drawing.Color.Transparent; + yesNoPickerBox3.EnableMovable = false; + yesNoPickerBox3.Location = new System.Drawing.Point(311, 22); + yesNoPickerBox3.Name = "yesNoPickerBox3"; + yesNoPickerBox3.SelectedIndex = 0; + yesNoPickerBox3.Size = new System.Drawing.Size(80, 32); + yesNoPickerBox3.TabIndex = 193; + yesNoPickerBox3.TabStop = false; + yesNoPickerBox3.Value = false; // // OptionsForm // @@ -339,52 +348,36 @@ namespace RokettoLaunch AutoScaleMode = AutoScaleMode.Font; BackColor = System.Drawing.Color.White; ClientSize = new System.Drawing.Size(444, 521); - Controls.Add(dialogFooter1); Controls.Add(flowLayoutPanel1); + Controls.Add(dialogFooter1); MinimumSize = new System.Drawing.Size(460, 560); Name = "OptionsForm"; Text = "Options"; flowLayoutPanel1.ResumeLayout(false); - tTogglePanel1.ResumeLayout(false); - tTogglePanel1.PerformLayout(); - tTogglePanel2.ResumeLayout(false); - tTogglePanel2.PerformLayout(); + togglePanel1.ResumeLayout(false); + togglePanel1.PerformLayout(); + togglePanel2.ResumeLayout(false); + togglePanel2.PerformLayout(); + togglePanel3.ResumeLayout(false); + togglePanel3.PerformLayout(); ResumeLayout(false); } - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - - flowLayoutPanel1_Resize(null, e); - } - - private void flowLayoutPanel1_Resize(object sender, EventArgs e) - { - var width = flowLayoutPanel1.ClientRectangle.Width - SystemInformation.VerticalScrollBarWidth; - - foreach (var item in flowLayoutPanel1.Controls.OfType()) - { - item.Width = width; - } - } - - - public AppOptions Result + public App4Options Result { get { if (_appSession == null) { - _appSession = new AppOptions(); + _appSession = new App4Options(); } _appSession.TilesPerRow = numericBox1.Value; _appSession.ShowBigIcons = yesNoPickerBox1.Value; _appSession.ShowToggleHotkey = textBox1.KeyCodeResults; + _appSession.AlwaysOnTop = yesNoPickerBox4.Value; _appSession.HideOnClose = yesNoPickerBox2.Value; _appSession.HideOnExecute = yesNoPickerBox3.Value; - _appSession.AlwaysOnTop = yesNoPickerBox4.Value; return _appSession; } diff --git a/Program.cs b/Program.cs index 9470017..fbc2799 100644 --- a/Program.cs +++ b/Program.cs @@ -1,5 +1,7 @@ using System; using System.Windows.Forms; +using Microsoft.Extensions.DependencyInjection; +using RyzStudio.Windows.Forms; namespace RokettoLaunch { @@ -11,10 +13,19 @@ namespace RokettoLaunch [STAThread] static void Main() { + var services = new ServiceCollection(); + services.AddSingleton(); + services.AddTransient(); + services.AddTransient(); + + var provider = services.BuildServiceProvider(); + Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); + //Application.Run(new MainForm()); + + Application.Run(provider.GetRequiredService()); } } } diff --git a/RokettoLaunch.csproj b/RokettoLaunch.csproj index 167a76d..a195c2f 100644 --- a/RokettoLaunch.csproj +++ b/RokettoLaunch.csproj @@ -2,7 +2,7 @@ WinExe - net8.0-windows8.0 + net10.0-windows8.0 true true favicon.ico @@ -14,7 +14,7 @@ Ray Lam 1.0.0.0 1.0.0.0 - 0.3.6.0604 + 0.4.1.0202 False x64 icon-128.png @@ -79,8 +79,12 @@ - - + + + + + + @@ -89,6 +93,12 @@ True AppResource.resx + + Form + + + Form + diff --git a/Windows/Forms/TilePanel.cs b/Windows/Forms/TilePanel.cs index 460a428..969b5c7 100644 --- a/Windows/Forms/TilePanel.cs +++ b/Windows/Forms/TilePanel.cs @@ -1,16 +1,18 @@ using System; +using System.Collections.Generic; using System.ComponentModel; -using System.Diagnostics; using System.Drawing; -using System.IO; +using System.Linq; +using System.Threading.Tasks; using System.Windows.Forms; -using RokettoLaunch.Models; -using RyzStudio.Windows.Forms; namespace RokettoLaunch.Windows.Forms { public partial class TilePanel : RyzStudio.Windows.TileForms.Tile { + public delegate Task OnFileDropEvent(TilePanel sender, Keys keys, List paths); + + public TilePanel() { InitializeComponent(); @@ -20,16 +22,20 @@ namespace RokettoLaunch.Windows.Forms this.Size = new Size(70, 70); this.AutoScaleMode = AutoScaleMode.None; - this.EnableMovable = true; + this.EnableMovable = false; } + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public Guid TileId { get; set; } = Guid.Empty; - [Browsable(false)] - public TileModel ModelInfo { get; protected set; } = new TileModel(); + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public bool IsGroup { get; set; } = false; - public RyzStudio.Windows.TileForms.TileContainer TileContainer { get => UIControl.GetParentsUntil(this); } + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public ContextMenuStrip TileContextMenu { get; set; } - protected MainForm MainForm { get => UIControl.GetParentsUntil(this); } + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public OnFileDropEvent OnFileDrop { get; set; } protected override void OnDragOver(DragEventArgs e) @@ -41,252 +47,21 @@ namespace RokettoLaunch.Windows.Forms protected override void OnDragDrop(DragEventArgs e) { - string[] fileList = e.Data.GetData(DataFormats.FileDrop) as string[]; - fileList = fileList ?? new string[0]; + var fileList = e.Data.GetData(DataFormats.FileDrop) as string[]; + if (fileList == null) + { + return; + } if (fileList.Length <= 0) { return; } - if (this.ModelInfo.IsGroup) + if (this.OnFileDrop != null) { - foreach (var item in fileList) - { - var model = GetTileModel(item); - if (model == null) - { - continue; - } - - this.ModelInfo.Items.Add(model); - } - - InvalidateGroupMenu(); + this.OnFileDrop(this, Control.ModifierKeys, fileList.ToList()); } - else - { - if (fileList.Length > 1) - { - var result = MessageBox.Show("Do you want to add this as a folder ?", "Convert to Folder", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); - if (result == DialogResult.Yes) - { - this.ModelInfo.Title = "New Folder"; - this.ModelInfo.IsGroup = true; - - foreach (var item in fileList) - { - var model = GetTileModel(item); - if (model == null) - { - continue; - } - - this.ModelInfo.Items.Add(model); - } - - InvalidateGroupMenu(); - } - else if (result == DialogResult.No) - { - LoadInfo(fileList[0]); - } - } - else - { - LoadInfo(fileList[0]); - } - } - } - - protected override void OnMouseClick(MouseEventArgs e) - { - if (Control.ModifierKeys == Keys.Control) - { - return; - } - - if (this.ModelInfo == null) - { - return; - } - - if (e.Button == MouseButtons.Left) - { - if (this.ModelInfo.IsGroup) - { - var iconSize = ((this.MainForm?.CurrentSession?.ShowBigIcons ?? true) ? 24 : 16); - - this.LeftContextMenuStrip.ImageScalingSize = new Size(iconSize, iconSize); - - this.LeftContextMenuStrip?.Show(this, e.Location); - } - else - { - OnMouseDoubleClick(e); - } - } - else if (e.Button == MouseButtons.Middle) - { - var mainForm = UIControl.GetParentsUntil(this); - if (mainForm == null) - { - return; - } - - if (this.ModelInfo.IsGroup) - { - var result = MessageBox.Show("Are you sure you want to duplicate tile?", "Duplicate Tile", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); - if (result != DialogResult.Yes) - { - return; - } - } - - mainForm.DuplicateTile(this); - } - } - - protected override void OnMouseDoubleClick(MouseEventArgs e) - { - base.OnMouseDoubleClick(e); - - if (Control.ModifierKeys == Keys.Control) - { - return; - } - - if (e.Button == MouseButtons.Left) - { - Execute(this.ModelInfo); - } - } - - - public void LoadInfo(TileModel model) - { - this.ModelInfo = model; - - InvalidateGroupMenu(); - } - - public void LoadInfo(string filename) - { - var model = GetTileModel(filename); - if (model == null) - { - return; - } - - LoadInfo(model); - } - - private void Execute(TileModel model) - { - if (model == null) - { - return; - } - - if (model.IsGroup) - { - return; - } - - if (this.MainForm != null) - { - if (this.MainForm.CurrentSession?.HideOnExecute ?? true) - { - this.MainForm.Visible = false; - } - } - - RyzStudio.Diagnostics.Process.Execute(model.CleanProcessFilename, model.CleanProcessWorkingDirectory, model.CleanProcessArgument, model.ProcessWindowStyle, model.ProcessAsAdmin); - } - - private void InvalidateGroupMenu() - { - this.Title = this.ModelInfo.Title; - this.LargeIcon = (this.ModelInfo.IsGroup ? AppResource.folder_32 : RyzStudio.IO.File.GetIcon(this.ModelInfo.CleanProcessFilename)); - - if (this.ModelInfo.IsGroup) - { - this.ModelInfo.ProcessFilename = ""; - this.ModelInfo.ProcessArgument = ""; - this.ModelInfo.ProcessAsAdmin = false; - this.ModelInfo.ProcessWindowStyle = ProcessWindowStyle.Normal; - this.ModelInfo.ProcessWorkingDirectory = ""; - this.ModelInfo.Version = ""; - - if (this.LeftContextMenuStrip == null) this.LeftContextMenuStrip = new ContextMenuStrip(); - this.LeftContextMenuStrip.Items.Clear(); - - foreach (var item in this.ModelInfo?.Items ?? new System.Collections.Generic.List()) - { - ToolStripItem toolItem = this.LeftContextMenuStrip.Items.Add(item.Title); - toolItem.Image = RyzStudio.IO.File.GetIcon(item.CleanProcessFilename); - toolItem.Tag = item; - toolItem.Click += (object sender, EventArgs e) => - { - var menuItem = (System.Windows.Forms.ToolStripMenuItem)sender; - if (menuItem == null) - { - return; - } - - var model = (menuItem.Tag as TileModel); - if (model == null) - { - return; - } - - Execute(model); - }; - } - } - - toolTip1.SetToolTip(this, this.Title); - } - - private TileModel GetTileModel(string filename) - { - if (string.IsNullOrWhiteSpace(filename)) - { - return null; - } - - TileModel model = new TileModel() - { - ProcessFilename = filename, - Title = Path.GetFileName(filename) - }; - - // exe - if (Path.GetExtension(filename).Equals(".exe", StringComparison.CurrentCultureIgnoreCase)) - { - if (File.Exists(filename)) - { - try - { - FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(filename); - if (fvi != null) - { - model.Title = fvi.ProductName; - } - } - catch - { - // do nothing - } - } - - if (string.IsNullOrWhiteSpace(model.Title)) - { - model.Title = Path.GetFileNameWithoutExtension(filename); - } - } - - return model; } } diff --git a/skye.sln b/skye.sln index 4e11779..37aff7e 100644 --- a/skye.sln +++ b/skye.sln @@ -1,10 +1,14 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.4.33205.214 +# Visual Studio Version 18 +VisualStudioVersion = 18.5.11723.231 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RokettoLaunch", "RokettoLaunch.csproj", "{4833FB27-0817-4720-A54B-180369B0C374}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RyzStudio", "..\ryzstudio8\core\RyzStudio.csproj", "{BBB7657A-3CE7-4333-9DCE-3137973F538E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RyzStudio.Windows.Forms", "..\ryzstudio8\windows.forms\RyzStudio.Windows.Forms.csproj", "{EF73F363-4F93-5128-6F96-C797FA7CD94B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +19,14 @@ Global {4833FB27-0817-4720-A54B-180369B0C374}.Debug|Any CPU.Build.0 = Debug|Any CPU {4833FB27-0817-4720-A54B-180369B0C374}.Release|Any CPU.ActiveCfg = Release|Any CPU {4833FB27-0817-4720-A54B-180369B0C374}.Release|Any CPU.Build.0 = Release|Any CPU + {BBB7657A-3CE7-4333-9DCE-3137973F538E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BBB7657A-3CE7-4333-9DCE-3137973F538E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BBB7657A-3CE7-4333-9DCE-3137973F538E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BBB7657A-3CE7-4333-9DCE-3137973F538E}.Release|Any CPU.Build.0 = Release|Any CPU + {EF73F363-4F93-5128-6F96-C797FA7CD94B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EF73F363-4F93-5128-6F96-C797FA7CD94B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EF73F363-4F93-5128-6F96-C797FA7CD94B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EF73F363-4F93-5128-6F96-C797FA7CD94B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE