From bcac951ab4176c08c55056563e49b20fdcaf77ff Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 7 Jul 2026 15:08:09 +0100 Subject: [PATCH] Changed to upgrade nupkg --- source/BukkuBuddy.csproj | 7 +- source/Forms/AddMultiPageForm.cs | 12 ++-- source/Forms/ClearIconsForm.cs | 21 +++--- source/Forms/EditBookmarkForm.cs | 38 +++++------ source/Forms/FindForm.cs | 52 +++++++------- source/Forms/LoadingForm.cs | 30 ++++----- source/Forms/OptionsForm.cs | 33 +++++---- source/Forms/UpdateIconsForm.cs | 22 +++--- source/MainForm.Designer.cs | 67 +++++++++---------- source/MainForm.cs | 62 ++++++++--------- source/Resources/MainMenuResource.Designer.cs | 4 +- source/Resources/MainMenuResource.resx | 4 +- source/Windows/Forms/BookmarkTreeView.cs | 7 +- 13 files changed, 176 insertions(+), 183 deletions(-) diff --git a/source/BukkuBuddy.csproj b/source/BukkuBuddy.csproj index 35ef2d6..5654f18 100644 --- a/source/BukkuBuddy.csproj +++ b/source/BukkuBuddy.csproj @@ -14,7 +14,7 @@ Ray Lam 1.0.0.0 1.0.0.0 - 0.7.0.255 + 0.7.0.272 bukkubuddy True 8.0 @@ -149,8 +149,9 @@ - - + + + \ No newline at end of file diff --git a/source/Forms/AddMultiPageForm.cs b/source/Forms/AddMultiPageForm.cs index 0677c02..4dd30ce 100644 --- a/source/Forms/AddMultiPageForm.cs +++ b/source/Forms/AddMultiPageForm.cs @@ -14,8 +14,8 @@ namespace BukkuBuddy.Forms { private Label label1; private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1; - private ThToolbarMemoBox memoBox1; - private ThUserControl userControl1; + private RyzStudio.Windows.ThemedForms.T3MemoBox memoBox1; + private RyzStudio.Windows.ThemedForms.T3UserControl userControl1; private TProgressBar progressBar1; private readonly WebPageService _webPageService; @@ -29,7 +29,7 @@ namespace BukkuBuddy.Forms { InitializeComponent(); - UISetup.Dialog(this); + this.SetupDialog(); _webPageService = new WebPageService(options.AllowUnsafeSSL, options.Timeout, options.AllowCookies, options.AllowRedirects); _rootPath = rootPath; @@ -39,8 +39,8 @@ namespace BukkuBuddy.Forms { label1 = new Label(); dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter(); - memoBox1 = new ThToolbarMemoBox(); - userControl1 = new ThUserControl(); + memoBox1 = new T3MemoBox(); + userControl1 = new T3UserControl(); progressBar1 = new TProgressBar(); userControl1.SuspendLayout(); SuspendLayout(); @@ -171,7 +171,7 @@ namespace BukkuBuddy.Forms { isBusy = value; - UIControl.SetEnable(memoBox1, !isBusy); + UIControl.Invoke(memoBox1, (_) => memoBox1.Enabled = !isBusy); dialogFooter1.IsBusy = isBusy; } diff --git a/source/Forms/ClearIconsForm.cs b/source/Forms/ClearIconsForm.cs index e008e56..9d4147a 100644 --- a/source/Forms/ClearIconsForm.cs +++ b/source/Forms/ClearIconsForm.cs @@ -4,14 +4,13 @@ using System.Threading.Tasks; using System.Windows.Forms; using BukkuBuddy.DTOs.SaveFile; using RyzStudio.Windows.Forms; -using static System.Windows.Forms.VisualStyles.VisualStyleElement; namespace BukkuBuddy.Forms { public class ClearIconsForm : Form { private TProgressBar progressBar1; - private RyzStudio.Windows.ThemedForms.ThUserControl userControl1; + private RyzStudio.Windows.ThemedForms.T3UserControl userControl1; private Label label1; private Label label2; @@ -22,7 +21,7 @@ namespace BukkuBuddy.Forms { InitializeComponent(); - UISetup.Dialog(this, true); + this.SetupDialog(); this.Text = "Deleting Icons"; @@ -33,7 +32,7 @@ namespace BukkuBuddy.Forms private void InitializeComponent() { progressBar1 = new TProgressBar(); - userControl1 = new RyzStudio.Windows.ThemedForms.ThUserControl(); + userControl1 = new RyzStudio.Windows.ThemedForms.T3UserControl(); label1 = new Label(); label2 = new Label(); userControl1.SuspendLayout(); @@ -110,12 +109,12 @@ namespace BukkuBuddy.Forms progressBar1.Maximum = model.Count; progressBar1.Value = 0; - UIControl.SetText(label1, "Deleting..."); - UIControl.SetText(label2, ""); + UIControl.Invoke(label1, (_) => label1.Text = "Deleting..."); + UIControl.Invoke(label2, (_) => label2.Text = ""); foreach (var item in model) { - UIControl.SetText(label2, "... " + item.Value.Title); + UIControl.Invoke(label2, (_) => label2.Text = "... " + item.Value.Title); progressBar1.Value++; @@ -132,8 +131,8 @@ namespace BukkuBuddy.Forms _treeView.Clear(false, true); - UIControl.SetText(label1, ""); - UIControl.SetText(label2, "Done"); + UIControl.Invoke(label1, (_) => label1.Text = ""); + UIControl.Invoke(label2, (_) => label2.Text = "Done"); }); this.DialogResult = DialogResult.OK; @@ -151,8 +150,8 @@ namespace BukkuBuddy.Forms public void Clear() { - UIControl.SetText(label1, "Ready"); - UIControl.SetText(label2, ""); + UIControl.Invoke(label1, (_) => label1.Text = "Ready"); + UIControl.Invoke(label2, (_) => label2.Text = ""); progressBar1.Value = progressBar1.Maximum = 0; } diff --git a/source/Forms/EditBookmarkForm.cs b/source/Forms/EditBookmarkForm.cs index eae135a..32156cc 100644 --- a/source/Forms/EditBookmarkForm.cs +++ b/source/Forms/EditBookmarkForm.cs @@ -8,22 +8,21 @@ using BukkuBuddy.Services; using RyzStudio; using RyzStudio.Windows.Forms; using RyzStudio.Windows.ThemedForms; -using RyzStudio.Windows.ThemedForms.ButtonTextBox; namespace BukkuBuddy.Forms { public class EditBookmarkForm : Form { private Label label1; - private ThClearableTextBox textBox1; + private RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox textBox1; private Label label2; private Label label3; - private ThToolbarMemoBox memoBox1; + private RyzStudio.Windows.ThemedForms.T3MemoBox memoBox1; private Label label4; - private ThIconButtonTextBox textBox2; + private RyzStudio.Windows.ThemedForms.T4TextBox textBox2; private PictureBox pictureBox1; private System.ComponentModel.IContainer components; - private ThClearableTextBox textBox3; + private RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox textBox3; private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1; private THorizontalSeparator horizontalSeparator1; @@ -37,7 +36,7 @@ namespace BukkuBuddy.Forms { InitializeComponent(); - UISetup.Dialog(this); + this.SetupDialog(); this.Text = (result == null) ? "Add Bookmark" : "Edit Bookmark"; @@ -50,14 +49,14 @@ namespace BukkuBuddy.Forms { components = new Container(); label1 = new Label(); - textBox1 = new ThClearableTextBox(); + textBox1 = new RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox(); label2 = new Label(); label3 = new Label(); - memoBox1 = new ThToolbarMemoBox(); + memoBox1 = new T3MemoBox(); label4 = new Label(); - textBox2 = new ThIconButtonTextBox(); + textBox2 = new RyzStudio.Windows.ThemedForms.T4TextBox(); pictureBox1 = new PictureBox(); - textBox3 = new ThClearableTextBox(); + textBox3 = new RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox(); dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter(); horizontalSeparator1 = new THorizontalSeparator(); ((ISupportInitialize)pictureBox1).BeginInit(); @@ -161,7 +160,6 @@ namespace BukkuBuddy.Forms textBox2.Size = new Size(260, 32); textBox2.TabIndex = 1; textBox2.TabStop = false; - textBox2.UseSystemPasswordChar = false; textBox2.OnButtonClick += textBox2_OnButtonClick; // // pictureBox1 @@ -316,10 +314,12 @@ namespace BukkuBuddy.Forms { isBusy = value; - UIControl.SetEnable(textBox1, !isBusy); - UIControl.SetEnable(textBox2, !isBusy); - UIControl.SetEnable(textBox3, !isBusy); - UIControl.SetEnable(memoBox1, !isBusy); + + UIControl.Invoke(textBox1, (_) => textBox1.Enabled = !isBusy); + UIControl.Invoke(textBox2, (_) => textBox2.Enabled = !isBusy); + UIControl.Invoke(textBox3, (_) => textBox3.Enabled = !isBusy); + UIControl.Invoke(memoBox1, (_) => memoBox1.Enabled = !isBusy); + dialogFooter1.IsBusy = isBusy; } } @@ -359,7 +359,7 @@ namespace BukkuBuddy.Forms var image = await GetFavicon(textBox2.Text); - UIControl.SetImage(pictureBox1, image); + UIControl.Invoke(pictureBox1, (_) => pictureBox1.Image = image); this.IsBusy = false; }); @@ -487,8 +487,8 @@ namespace BukkuBuddy.Forms var title = _webPageService.ParseTitle(htmlDocument) ?? string.Empty; var description = _webPageService.ParseDescription(htmlDocument) ?? string.Empty; - UIControl.SetText(textBox1, title); - UIControl.SetText(textBox3, description); + UIControl.Invoke(textBox1, (_) => textBox1.Text = title); + UIControl.Invoke(textBox3, (_) => textBox3.Text = description); var faviconUrl = _webPageService.ParseFavicon(htmlDocument); if (!string.IsNullOrWhiteSpace(faviconUrl)) @@ -502,7 +502,7 @@ namespace BukkuBuddy.Forms } } - UIControl.SetImage(pictureBox1, favicon); + UIControl.Invoke(pictureBox1, (_) => pictureBox1.Image = favicon); } return MethodResult.Create(); diff --git a/source/Forms/FindForm.cs b/source/Forms/FindForm.cs index 5777258..04bdb22 100644 --- a/source/Forms/FindForm.cs +++ b/source/Forms/FindForm.cs @@ -5,17 +5,16 @@ using System.Windows.Forms; using BukkuBuddy.DTOs.SaveFile; using RyzStudio.Windows.Forms; using RyzStudio.Windows.ThemedForms; -using RyzStudio.Windows.ThemedForms.ButtonTextBox; namespace BukkuBuddy.Forms { public class FindForm : Form { private Label label1; - private ThButton button2; + private RyzStudio.Windows.ThemedForms.T3Button button2; private THorizontalSeparator horizontalSeparator1; - private ThButton button1; - private ThClearableTextBox textBox1; + private RyzStudio.Windows.ThemedForms.T3Button button1; + private RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox textBox1; private BookmarkTreeView treeView1 = null; @@ -39,14 +38,14 @@ namespace BukkuBuddy.Forms private void InitializeComponent() { label1 = new Label(); - button2 = new ThButton(); + button2 = new T3Button(); horizontalSeparator1 = new THorizontalSeparator(); - textBox1 = new ThClearableTextBox(); - button1 = new ThButton(); + textBox1 = new RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox(); + button1 = new T3Button(); SuspendLayout(); - // + // // label1 - // + // label1.AutoSize = true; label1.BackColor = System.Drawing.Color.Transparent; label1.ForeColor = System.Drawing.SystemColors.ControlText; @@ -58,19 +57,16 @@ namespace BukkuBuddy.Forms label1.TabIndex = 153; label1.Text = "Find"; label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // + // // button2 - // - button2.ActiveImage = null; + // button2.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; button2.BackColor = System.Drawing.Color.Transparent; button2.EnableMenuOnClick = false; button2.EnableMovable = false; - button2.HoverImage = null; - button2.IdleImage = null; - // - // - // + // + // + // button2.Label.BackColor = System.Drawing.Color.White; button2.Label.Dock = DockStyle.Fill; button2.Label.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold); @@ -90,17 +86,17 @@ namespace BukkuBuddy.Forms button2.TabStop = false; button2.MouseClick += button2_MouseClick; button2.MouseDoubleClick += button2_MouseClick; - // + // // horizontalSeparator1 - // + // horizontalSeparator1.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; horizontalSeparator1.Location = new System.Drawing.Point(5, 73); horizontalSeparator1.Name = "horizontalSeparator1"; horizontalSeparator1.Padding = new Padding(0, 10, 0, 10); horizontalSeparator1.Size = new System.Drawing.Size(375, 10); - // + // // textBox1 - // + // textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; textBox1.BackColor = System.Drawing.Color.Transparent; textBox1.ClearedValue = ""; @@ -113,9 +109,9 @@ namespace BukkuBuddy.Forms textBox1.TabIndex = 0; textBox1.TabStop = false; textBox1.UseSystemPasswordChar = false; - // + // // button1 - // + // button1.ActiveImage = null; button1.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; button1.BackColor = System.Drawing.Color.Transparent; @@ -123,9 +119,9 @@ namespace BukkuBuddy.Forms button1.EnableMovable = false; button1.HoverImage = null; button1.IdleImage = null; - // - // - // + // + // + // button1.Label.BackColor = System.Drawing.Color.White; button1.Label.Dock = DockStyle.Fill; button1.Label.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold); @@ -145,9 +141,9 @@ namespace BukkuBuddy.Forms button1.TabStop = false; button1.MouseClick += button1_MouseClick; button1.MouseDoubleClick += button1_MouseClick; - // + // // FindForm - // + // AutoScaleMode = AutoScaleMode.None; ClientSize = new System.Drawing.Size(384, 141); Controls.Add(button1); diff --git a/source/Forms/LoadingForm.cs b/source/Forms/LoadingForm.cs index 6c28c06..515f899 100644 --- a/source/Forms/LoadingForm.cs +++ b/source/Forms/LoadingForm.cs @@ -14,8 +14,8 @@ namespace BukkuBuddy.Forms public class LoadingForm : Form { private TProgressBar progressBar1; - private RyzStudio.Windows.ThemedForms.ThUserControl userControl1; - private RyzStudio.Windows.ThemedForms.ThUserControl userControl2; + private RyzStudio.Windows.ThemedForms.T3UserControl userControl1; + private RyzStudio.Windows.ThemedForms.T3UserControl userControl2; private TProgressBar progressBar2; private Label label1; private Label label2; @@ -30,7 +30,7 @@ namespace BukkuBuddy.Forms { InitializeComponent(); - UISetup.Dialog(this, true); + this.SetupDialog(); this.Text = "Loading"; } @@ -39,8 +39,8 @@ namespace BukkuBuddy.Forms private void InitializeComponent() { progressBar1 = new TProgressBar(); - userControl1 = new RyzStudio.Windows.ThemedForms.ThUserControl(); - userControl2 = new RyzStudio.Windows.ThemedForms.ThUserControl(); + userControl1 = new RyzStudio.Windows.ThemedForms.T3UserControl(); + userControl2 = new RyzStudio.Windows.ThemedForms.T3UserControl(); progressBar2 = new TProgressBar(); label1 = new Label(); label2 = new Label(); @@ -141,8 +141,8 @@ namespace BukkuBuddy.Forms { this.Clear(); - UIControl.SetText(label1, "Loading..."); - UIControl.SetText(label2, "... " + Path.GetFileName(loadFilename)); + UIControl.Invoke(label1, (_) => label1.Text = "Loading..."); + UIControl.Invoke(label2, (_) => label2.Text = "... " + Path.GetFileName(loadFilename)); var newSession = await LoadSaveSessionWithVersion(loadFilename); var isPack = Path.GetExtension(loadFilename).Equals(".jsnx", StringComparison.CurrentCultureIgnoreCase); @@ -153,8 +153,8 @@ namespace BukkuBuddy.Forms progressBar1.Value = 0; progressBar2.Value = 0; - UIControl.SetText(label1, "Loading..."); - UIControl.SetText(label2, ""); + UIControl.Invoke(label1, (_) => label1.Text = "Loading..."); + UIControl.Invoke(label2, (_) => label2.Text = ""); foreach (var item in newSession?.Directories ?? new List()) { @@ -163,7 +163,7 @@ namespace BukkuBuddy.Forms continue; } - UIControl.SetText(label2, "... " + Path.GetFileNameWithoutExtension(item)); + UIControl.Invoke(label2, (_) => label2.Text = "... " + Path.GetFileNameWithoutExtension(item)); progressBar1.Value++; @@ -172,7 +172,7 @@ namespace BukkuBuddy.Forms foreach (var item in newSession?.Items ?? new List()) { - UIControl.SetText(label2, "... " + item.Title); + UIControl.Invoke(label2, (_) => label2.Text = "... " + item.Title); progressBar2.Value++; @@ -197,8 +197,8 @@ namespace BukkuBuddy.Forms result = newSession; - UIControl.SetText(label1, ""); - UIControl.SetText(label2, "Done"); + UIControl.Invoke(label1, (_) => label1.Text = ""); + UIControl.Invoke(label2, (_) => label2.Text = "Done"); }); this.DialogResult = DialogResult.OK; @@ -230,8 +230,8 @@ namespace BukkuBuddy.Forms public void Clear() { - UIControl.SetText(label1, "Ready"); - UIControl.SetText(label2, ""); + UIControl.Invoke(label1, (_) => label1.Text = "Ready"); + UIControl.Invoke(label2, (_) => label2.Text = ""); progressBar1.Value = progressBar1.Maximum = 0; progressBar2.Value = progressBar2.Maximum = 0; diff --git a/source/Forms/OptionsForm.cs b/source/Forms/OptionsForm.cs index 2487f6e..4e8d4e7 100644 --- a/source/Forms/OptionsForm.cs +++ b/source/Forms/OptionsForm.cs @@ -2,31 +2,30 @@ using System.Windows.Forms; using BukkuBuddy.DTOs.SaveFile; using RyzStudio.Windows.Forms; -using RyzStudio.Windows.ThemedForms.PickerBox; namespace BukkuBuddy.Forms { public class OptionsForm : Form { - private ThYesNoPickerBox pickerBox1; + private RyzStudio.Windows.ThemedForms.T3YnPickerBox pickerBox1; private Label label2; private Label label1; - private ThYesNoPickerBox pickerBox2; + private RyzStudio.Windows.ThemedForms.T3YnPickerBox pickerBox2; private Label label3; - private RyzStudio.Windows.ThemedForms.ButtonTextBox.ThClearableTextBox textBox1; + private RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox textBox1; private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1; private FlowLayoutPanel flowLayoutPanel1; private TTogglePanel togglePanel1; private TTogglePanel togglePanel2; private Label label4; - private ThYesNoPickerBox pickerBox3; + private RyzStudio.Windows.ThemedForms.T3YnPickerBox pickerBox3; private TTogglePanel togglePanel3; private Label label5; - private RyzStudio.Windows.ThemedForms.ThNumericBox numericBox1; + private RyzStudio.Windows.ThemedForms.T4NumericBox numericBox1; private Label label6; - private ThYesNoPickerBox pickerBox4; + private RyzStudio.Windows.ThemedForms.T3YnPickerBox pickerBox4; private Label label7; - private ThYesNoPickerBox pickerBox5; + private RyzStudio.Windows.ThemedForms.T3YnPickerBox pickerBox5; private App6Options _appSession = null; @@ -34,8 +33,8 @@ namespace BukkuBuddy.Forms { InitializeComponent(); - UISetup.Dialog(this, true); - UISetup.AutoSizeChildren(flowLayoutPanel1); + this.SetupDialog(); + flowLayoutPanel1.AutoSizeChildren(); _appSession = appSession; } @@ -56,11 +55,11 @@ namespace BukkuBuddy.Forms private void InitializeComponent() { - pickerBox1 = new ThYesNoPickerBox(); + pickerBox1 = new RyzStudio.Windows.ThemedForms.T3YnPickerBox(); label2 = new Label(); - pickerBox2 = new ThYesNoPickerBox(); + pickerBox2 = new RyzStudio.Windows.ThemedForms.T3YnPickerBox(); label1 = new Label(); - textBox1 = new RyzStudio.Windows.ThemedForms.ButtonTextBox.ThClearableTextBox(); + textBox1 = new RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox(); label3 = new Label(); dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter(); flowLayoutPanel1 = new FlowLayoutPanel(); @@ -68,13 +67,13 @@ namespace BukkuBuddy.Forms togglePanel2 = new TTogglePanel(); togglePanel3 = new TTogglePanel(); label6 = new Label(); - pickerBox4 = new ThYesNoPickerBox(); - numericBox1 = new RyzStudio.Windows.ThemedForms.ThNumericBox(); + pickerBox4 = new RyzStudio.Windows.ThemedForms.T3YnPickerBox(); + numericBox1 = new RyzStudio.Windows.ThemedForms.T4NumericBox(); label4 = new Label(); label5 = new Label(); - pickerBox3 = new ThYesNoPickerBox(); + pickerBox3 = new RyzStudio.Windows.ThemedForms.T3YnPickerBox(); label7 = new Label(); - pickerBox5 = new ThYesNoPickerBox(); + pickerBox5 = new RyzStudio.Windows.ThemedForms.T3YnPickerBox(); flowLayoutPanel1.SuspendLayout(); togglePanel1.SuspendLayout(); togglePanel2.SuspendLayout(); diff --git a/source/Forms/UpdateIconsForm.cs b/source/Forms/UpdateIconsForm.cs index 5dd278a..163d1c6 100644 --- a/source/Forms/UpdateIconsForm.cs +++ b/source/Forms/UpdateIconsForm.cs @@ -13,7 +13,7 @@ namespace BukkuBuddy.Forms public class UpdateIconsForm : Form { private TProgressBar progressBar1; - private RyzStudio.Windows.ThemedForms.ThUserControl userControl1; + private RyzStudio.Windows.ThemedForms.T3UserControl userControl1; private Label label1; private Label label2; @@ -29,7 +29,7 @@ namespace BukkuBuddy.Forms { InitializeComponent(); - UISetup.Dialog(this, true); + this.SetupDialog(); this.Text = "Updating Icons"; @@ -43,7 +43,7 @@ namespace BukkuBuddy.Forms private void InitializeComponent() { progressBar1 = new TProgressBar(); - userControl1 = new RyzStudio.Windows.ThemedForms.ThUserControl(); + userControl1 = new RyzStudio.Windows.ThemedForms.T3UserControl(); label1 = new Label(); label2 = new Label(); userControl1.SuspendLayout(); @@ -126,8 +126,8 @@ namespace BukkuBuddy.Forms progressBar1.Maximum = model.Count; progressBar1.Value = 0; - UIControl.SetText(label1, "Updating..."); - UIControl.SetText(label2, ""); + UIControl.Invoke(label1, (_) => label1.Text = "Updating..."); + UIControl.Invoke(label2, (_) => label2.Text = ""); foreach (var item in model) { @@ -136,7 +136,7 @@ namespace BukkuBuddy.Forms break; } - UIControl.SetText(label2, "... " + item.Value.Title); + UIControl.Invoke(label2, (_) => label2.Text = "... " + item.Value.Title); progressBar1.Value++; @@ -190,8 +190,8 @@ namespace BukkuBuddy.Forms _treeView.UpdateNode(item.Key, newModel); } - UIControl.SetText(label1, ""); - UIControl.SetText(label2, "Done"); + UIControl.Invoke(label1, (_) => label1.Text = ""); + UIControl.Invoke(label2, (_) => label2.Text = "Done"); }); this.DialogResult = DialogResult.OK; @@ -207,7 +207,7 @@ namespace BukkuBuddy.Forms if (!cancelRequested) { - UIControl.SetText(label1, "Cancelling..."); + UIControl.Invoke(label1, (_) => label1.Text = "Cancelling..."); cancelRequested = true; } @@ -217,8 +217,8 @@ namespace BukkuBuddy.Forms public void Clear() { - UIControl.SetText(label1, "Ready"); - UIControl.SetText(label2, ""); + UIControl.Invoke(label1, (_) => label1.Text = "Ready"); + UIControl.Invoke(label2, (_) => label2.Text = ""); progressBar1.Value = progressBar1.Maximum = 0; } diff --git a/source/MainForm.Designer.cs b/source/MainForm.Designer.cs index 97a1dd6..8b5997c 100644 --- a/source/MainForm.Designer.cs +++ b/source/MainForm.Designer.cs @@ -56,7 +56,9 @@ namespace BukkuBuddy alwaysOnTopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); toolStripMenuItem12 = new System.Windows.Forms.ToolStripMenuItem(); + toolStripMenuItem9 = new System.Windows.Forms.ToolStripMenuItem(); updateAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -95,8 +97,6 @@ namespace BukkuBuddy moveUpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); moveDownToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); treeView1 = new RyzStudio.Windows.Forms.BookmarkTreeView(); - toolStripMenuItem9 = new System.Windows.Forms.ToolStripMenuItem(); - toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); menuStrip1.SuspendLayout(); rootContextMenu.SuspendLayout(); folderContextMenu.SuspendLayout(); @@ -129,7 +129,7 @@ namespace BukkuBuddy // newToolStripMenuItem.Name = "newToolStripMenuItem"; newToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N; - newToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + newToolStripMenuItem.Size = new System.Drawing.Size(180, 22); newToolStripMenuItem.Text = "&New"; newToolStripMenuItem.Click += newToolStripMenuItem_Click; // @@ -138,52 +138,52 @@ namespace BukkuBuddy openToolStripMenuItem.Image = MainMenuResource.folder_minus; openToolStripMenuItem.Name = "openToolStripMenuItem"; openToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O; - openToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - openToolStripMenuItem.Text = "&Open"; + openToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + openToolStripMenuItem.Text = "&Open..."; openToolStripMenuItem.Click += openToolStripMenuItem_Click; // // toolStripMenuItem13 // toolStripMenuItem13.Name = "toolStripMenuItem13"; - toolStripMenuItem13.Size = new System.Drawing.Size(143, 6); + toolStripMenuItem13.Size = new System.Drawing.Size(177, 6); // // closeToolStripMenuItem // closeToolStripMenuItem.Name = "closeToolStripMenuItem"; - closeToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + closeToolStripMenuItem.Size = new System.Drawing.Size(180, 22); closeToolStripMenuItem.Text = "&Close"; closeToolStripMenuItem.Click += closeToolStripMenuItem_Click; // // toolStripMenuItem14 // toolStripMenuItem14.Name = "toolStripMenuItem14"; - toolStripMenuItem14.Size = new System.Drawing.Size(143, 6); + toolStripMenuItem14.Size = new System.Drawing.Size(177, 6); // // saveToolStripMenuItem // saveToolStripMenuItem.Image = MainMenuResource.save; saveToolStripMenuItem.Name = "saveToolStripMenuItem"; saveToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S; - saveToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + saveToolStripMenuItem.Size = new System.Drawing.Size(180, 22); saveToolStripMenuItem.Text = "&Save"; saveToolStripMenuItem.Click += saveToolStripMenuItem_Click; // // saveAsToolStripMenuItem // saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; - saveAsToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + saveAsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); saveAsToolStripMenuItem.Text = "Save &As..."; saveAsToolStripMenuItem.Click += saveAsToolStripMenuItem_Click; // // toolStripMenuItem15 // toolStripMenuItem15.Name = "toolStripMenuItem15"; - toolStripMenuItem15.Size = new System.Drawing.Size(143, 6); + toolStripMenuItem15.Size = new System.Drawing.Size(177, 6); // // exitToolStripMenuItem2 // exitToolStripMenuItem2.Name = "exitToolStripMenuItem2"; - exitToolStripMenuItem2.Size = new System.Drawing.Size(146, 22); + exitToolStripMenuItem2.Size = new System.Drawing.Size(180, 22); exitToolStripMenuItem2.Text = "E&xit"; exitToolStripMenuItem2.Click += exitToolStripMenuItem_Click; // @@ -199,7 +199,7 @@ namespace BukkuBuddy findToolStripMenuItem.Image = MainMenuResource.search; findToolStripMenuItem.Name = "findToolStripMenuItem"; findToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F; - findToolStripMenuItem.Size = new System.Drawing.Size(137, 22); + findToolStripMenuItem.Size = new System.Drawing.Size(180, 22); findToolStripMenuItem.Text = "&Find"; findToolStripMenuItem.Click += findToolStripMenuItem_Click; // @@ -213,26 +213,26 @@ namespace BukkuBuddy // expandAllToolStripMenuItem // expandAllToolStripMenuItem.Name = "expandAllToolStripMenuItem"; - expandAllToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + expandAllToolStripMenuItem.Size = new System.Drawing.Size(180, 22); expandAllToolStripMenuItem.Text = "&Expand All"; expandAllToolStripMenuItem.Click += expandAllToolStripMenuItem_Click; // // collapseAllToolStripMenuItem // collapseAllToolStripMenuItem.Name = "collapseAllToolStripMenuItem"; - collapseAllToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + collapseAllToolStripMenuItem.Size = new System.Drawing.Size(180, 22); collapseAllToolStripMenuItem.Text = "&Collapse All"; collapseAllToolStripMenuItem.Click += collapseAllToolStripMenuItem_Click; // // toolStripSeparator1 // toolStripSeparator1.Name = "toolStripSeparator1"; - toolStripSeparator1.Size = new System.Drawing.Size(149, 6); + toolStripSeparator1.Size = new System.Drawing.Size(177, 6); // // alwaysOnTopToolStripMenuItem // alwaysOnTopToolStripMenuItem.Name = "alwaysOnTopToolStripMenuItem"; - alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(180, 22); alwaysOnTopToolStripMenuItem.Text = "Always On &Top"; alwaysOnTopToolStripMenuItem.Click += alwaysOnTopToolStripMenuItem_Click; // @@ -250,6 +250,13 @@ namespace BukkuBuddy toolStripMenuItem12.Size = new System.Drawing.Size(180, 22); toolStripMenuItem12.Text = "&Icons"; // + // toolStripMenuItem9 + // + toolStripMenuItem9.Name = "toolStripMenuItem9"; + toolStripMenuItem9.Size = new System.Drawing.Size(180, 22); + toolStripMenuItem9.Text = "&Update"; + toolStripMenuItem9.Click += toolStripMenuItem9_Click_1; + // // updateAllToolStripMenuItem // updateAllToolStripMenuItem.Name = "updateAllToolStripMenuItem"; @@ -257,6 +264,11 @@ namespace BukkuBuddy updateAllToolStripMenuItem.Text = "Update &All"; updateAllToolStripMenuItem.Click += updateAllToolStripMenuItem_Click; // + // toolStripSeparator3 + // + toolStripSeparator3.Name = "toolStripSeparator3"; + toolStripSeparator3.Size = new System.Drawing.Size(177, 6); + // // clearToolStripMenuItem // clearToolStripMenuItem.Name = "clearToolStripMenuItem"; @@ -275,7 +287,7 @@ namespace BukkuBuddy optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; optionsToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F12; optionsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - optionsToolStripMenuItem.Text = "&Options"; + optionsToolStripMenuItem.Text = "&Options..."; optionsToolStripMenuItem.Click += optionsToolStripMenuItem_Click; // // helpToolStripMenuItem1 @@ -290,19 +302,19 @@ namespace BukkuBuddy viewHelpToolStripMenuItem1.Image = MainMenuResource.help_circle; viewHelpToolStripMenuItem1.Name = "viewHelpToolStripMenuItem1"; viewHelpToolStripMenuItem1.ShortcutKeys = System.Windows.Forms.Keys.F1; - viewHelpToolStripMenuItem1.Size = new System.Drawing.Size(146, 22); + viewHelpToolStripMenuItem1.Size = new System.Drawing.Size(180, 22); viewHelpToolStripMenuItem1.Text = "&View Help"; viewHelpToolStripMenuItem1.Click += viewHelpToolStripMenuItem1_Click; // // toolStripMenuItem16 // toolStripMenuItem16.Name = "toolStripMenuItem16"; - toolStripMenuItem16.Size = new System.Drawing.Size(143, 6); + toolStripMenuItem16.Size = new System.Drawing.Size(177, 6); // // aboutToolStripMenuItem1 // aboutToolStripMenuItem1.Name = "aboutToolStripMenuItem1"; - aboutToolStripMenuItem1.Size = new System.Drawing.Size(146, 22); + aboutToolStripMenuItem1.Size = new System.Drawing.Size(180, 22); aboutToolStripMenuItem1.Text = "&About"; aboutToolStripMenuItem1.Click += aboutToolStripMenuItem1_Click; // @@ -514,22 +526,9 @@ namespace BukkuBuddy treeView1.Dock = System.Windows.Forms.DockStyle.Fill; treeView1.Location = new System.Drawing.Point(0, 24); treeView1.Name = "treeView1"; - treeView1.OnChanged = null; treeView1.Size = new System.Drawing.Size(300, 556); treeView1.TabIndex = 5; // - // toolStripMenuItem9 - // - toolStripMenuItem9.Name = "toolStripMenuItem9"; - toolStripMenuItem9.Size = new System.Drawing.Size(180, 22); - toolStripMenuItem9.Text = "&Update"; - toolStripMenuItem9.Click += toolStripMenuItem9_Click_1; - // - // toolStripSeparator3 - // - toolStripSeparator3.Name = "toolStripSeparator3"; - toolStripSeparator3.Size = new System.Drawing.Size(177, 6); - // // MainForm // AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); diff --git a/source/MainForm.cs b/source/MainForm.cs index f1650ee..545d79e 100644 --- a/source/MainForm.cs +++ b/source/MainForm.cs @@ -12,8 +12,8 @@ using BukkuBuddy.DTOs.SaveFile; using BukkuBuddy.Forms; using BukkuBuddy.Resources; using RyzStudio; +using RyzStudio.Services; using RyzStudio.Windows.Forms; -using RyzStudio.Windows.ThemedForms; using static RyzStudio.Windows.Forms.BookmarkTreeView; namespace BukkuBuddy @@ -56,7 +56,7 @@ namespace BukkuBuddy { base.OnShown(e); - var args = WinApplication.GetCommandLine(); + var args = this.GetCommandLine(); string jsonfigFilename = args.Where(x => (x.Key.Equals("o") || x.Key.Equals("open"))).Select(x => x.Value).FirstOrDefault(); //if (string.IsNullOrWhiteSpace(jsonfigFilename)) @@ -75,7 +75,7 @@ namespace BukkuBuddy //InvalidateOptions(); } - UIControl.SetFocus(this); + UIControl.Invoke(this, (_) => this.Focus()); } protected async override void OnFormClosing(FormClosingEventArgs e) @@ -108,30 +108,30 @@ namespace BukkuBuddy { isBusy = value; - UIControl.SetEnable(treeView1, !isBusy); + UIControl.Invoke(treeView1, (_) => treeView1.Enabled =!isBusy); } } private void InvalidateOptions(bool resize) { - UIControl.SetTopMost(this, this.CurrentSession.AlwaysOnTop); + UIControl.Invoke(this, (_) => this.TopMost = this.CurrentSession.AlwaysOnTop); if (resize) { if (!this.CurrentSession.StartPosition.IsEmpty) { - UIControl.SetLocation(this, this.CurrentSession.StartPosition); + UIControl.Invoke(this, (_) => this.Location = this.CurrentSession.StartPosition); } if (this.CurrentSession.Width > 0) { - UIControl.SetClientWidth(this, this.CurrentSession.Width); + UIControl.Invoke(this, (_) => this.ClientSize = new Size(this.CurrentSession.Width, this.ClientSize.Height)); } if (this.CurrentSession.Height > 0) { - UIControl.SetClientHeight(this, this.CurrentSession.Height); + UIControl.Invoke(this, (_) => this.ClientSize = new Size(this.ClientSize.Width, this.CurrentSession.Height)); } } } @@ -513,7 +513,7 @@ namespace BukkuBuddy /// private void aboutToolStripMenuItem1_Click(object sender, EventArgs e) { - var form = new RyzStudio.Windows.ThemedForms.AboutForm(); + var form = new RyzStudio.Forms.T3AboutForm(); form.ProductURL = MainMenuResource.AppProductURL; form.AuthorURL = MainMenuResource.AppAuthorURL; form.CompanyURL = MainMenuResource.AppCompanyURL; @@ -864,7 +864,7 @@ namespace BukkuBuddy } }); - UIControl.SetFocus(treeView1); + UIControl.Invoke(treeView1, (_) => treeView1.Focus()); sender.HasChanged = true; @@ -888,7 +888,7 @@ namespace BukkuBuddy this.InvalidateOptions(true); }); - UIControl.SetFocus(treeView1); + UIControl.Invoke(treeView1, (_) => treeView1.Focus()); sender.HasChanged = false; @@ -927,7 +927,7 @@ namespace BukkuBuddy this.CurrentSession.Directories = directoryList ?? new List(); this.CurrentSession.Items = bookmarkList.Select(x => x.Value)?.ToList() ?? new List(); - var result = GenericResult.Create(); + var result = MethodResult.Create(); switch (Path.GetExtension(filename?.ToLower()?.Trim() ?? string.Empty)) { @@ -938,54 +938,54 @@ namespace BukkuBuddy case ".jsnx": result = await RyzStudio.IO.Compression.ZFile.WriteFile(filename, "Document.json", this.CurrentSession); - if (result.IsSuccess) + if (result.Success) { // Add icons to save file var result2 = AddImagesToZipFile(filename, bookmarkList); - if (!result2.IsSuccess) + if (!result2.Success) { if (showNotices) { - ThMessageBox.Show(this, "Unable to save icons", "Save session", MessageBoxButtons.OK, MessageBoxIcon.Error); + RyzStudio.Forms.T3MessageBox.Show(this, "Unable to save icons", "Save session", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } break; default: - result = GenericResult.Fault("Format not supported"); + result = MethodResult.Error("Format not supported"); break; } - if (result.IsSuccess) + if (result.Success) { if (showNotices) { - ThMessageBox.Show(this, "Session saved!", "Save session", MessageBoxButtons.OK, MessageBoxIcon.Information); + RyzStudio.Forms.T3MessageBox.Show(this, "Session saved!", "Save session", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { if (showNotices) { - ThMessageBox.Show(this, result.Message, "Save session"); + RyzStudio.Forms.T3MessageBox.Show(this, result.Message, "Save session"); } } isBusy = false; - if (result.IsSuccess) + if (result.Success) { sender.HasChanged = false; } - return result.IsSuccess; + return result.Success; }); } private async Task fileSessionManager_OnClearSession(FileSessionManager sender) { - UIControl.Clear(treeView1); + UIControl.Invoke(treeView1, (_) => treeView1.Nodes.Clear()); sender.HasChanged = false; @@ -999,13 +999,13 @@ namespace BukkuBuddy switch (sender.SessionState) { case FileSessionManager.SessionStateEnum.New: - UIControl.SetText(this, "New Session - " + Application.ProductName); + UIControl.Invoke(this, (_) => this.Text = "New Session - " + Application.ProductName); break; case FileSessionManager.SessionStateEnum.Open: - UIControl.SetText(this, Path.GetFileNameWithoutExtension(filename) + " - " + Application.ProductName); + UIControl.Invoke(this, (_) => this.Text = Path.GetFileNameWithoutExtension(filename) + " - " + Application.ProductName); break; case FileSessionManager.SessionStateEnum.Close: - UIControl.SetText(this, Application.ProductName); + UIControl.Invoke(this, (_) => this.Text = Application.ProductName); break; default: break; @@ -1077,7 +1077,7 @@ namespace BukkuBuddy return; } - var model = UIControl.GetTag(node); + var model = node.GetTag(); if (model == null) { return; @@ -1094,11 +1094,11 @@ namespace BukkuBuddy }); } - private GenericResult AddImagesToZipFile(string zipFilename, List> items) + private MethodResult AddImagesToZipFile(string zipFilename, List> items) { if (string.IsNullOrWhiteSpace(zipFilename)) { - return GenericResult.Fault("Filename is blank"); + return MethodResult.Error("Filename is blank"); } var path = Path.GetDirectoryName(zipFilename); @@ -1110,7 +1110,7 @@ namespace BukkuBuddy } catch (Exception exc) { - return GenericResult.Fault(exc.Message); + return MethodResult.Error(exc.Message); } } @@ -1181,10 +1181,10 @@ namespace BukkuBuddy } catch (Exception exc) { - return GenericResult.Fault(exc.Message); + return MethodResult.Error(exc.Message); } - return GenericResult.Create(); + return MethodResult.Create(); } } diff --git a/source/Resources/MainMenuResource.Designer.cs b/source/Resources/MainMenuResource.Designer.cs index 92209da..5d828bb 100644 --- a/source/Resources/MainMenuResource.Designer.cs +++ b/source/Resources/MainMenuResource.Designer.cs @@ -79,7 +79,7 @@ namespace BukkuBuddy.Resources { } /// - /// Looks up a localized string similar to https://www.hiimray.co.uk/software-bookmark-manager. + /// Looks up a localized string similar to https://git.hiimray.co.uk/HiImRay_Public/bukkubuddy-bookmark-manager. /// internal static string AppHelpURL { get { @@ -88,7 +88,7 @@ namespace BukkuBuddy.Resources { } /// - /// Looks up a localized string similar to https://www.hiimray.co.uk/software-bookmark-manager. + /// Looks up a localized string similar to https://git.hiimray.co.uk/HiImRay_Public/bukkubuddy-bookmark-manager. /// internal static string AppProductURL { get { diff --git a/source/Resources/MainMenuResource.resx b/source/Resources/MainMenuResource.resx index ce50ede..8251936 100644 --- a/source/Resources/MainMenuResource.resx +++ b/source/Resources/MainMenuResource.resx @@ -124,10 +124,10 @@ https://www.hiimray.co.uk - https://www.hiimray.co.uk/software-bookmark-manager + https://git.hiimray.co.uk/HiImRay_Public/bukkubuddy-bookmark-manager - https://www.hiimray.co.uk/software-bookmark-manager + https://git.hiimray.co.uk/HiImRay_Public/bukkubuddy-bookmark-manager diff --git a/source/Windows/Forms/BookmarkTreeView.cs b/source/Windows/Forms/BookmarkTreeView.cs index 2c5a7ff..07c37c2 100644 --- a/source/Windows/Forms/BookmarkTreeView.cs +++ b/source/Windows/Forms/BookmarkTreeView.cs @@ -4,7 +4,6 @@ using System.ComponentModel; using System.Drawing; using System.Linq; using System.Windows.Forms; -using BukkuBuddy; using BukkuBuddy.DTOs.SaveFile; using BukkuBuddy.Resources; @@ -146,7 +145,7 @@ namespace RyzStudio.Windows.Forms break; case NodeType.Page: - var viewModel = UIControl.GetTag(this.SelectedNode); + var viewModel = this.SelectedNode.GetTag(); if (viewModel != null) { try @@ -320,7 +319,7 @@ namespace RyzStudio.Windows.Forms newNode.ImageKey = newNode.SelectedImageKey = model.Id.ToString(); } - UIControl.Add(parentNode, newNode); + UIControl.Invoke(parentNode.TreeView, (_) => parentNode.Nodes.Add(newNode)); this.HasChanged = true; @@ -374,7 +373,7 @@ namespace RyzStudio.Windows.Forms } else if (nodeType == NodeType.Page) { - var model = UIControl.GetTag(node); + var model = node.GetTag(); model.Path = GetNodePath(node); if (this.OnEditNode != null) this.OnEditNode(this, node, model);