diff --git a/AppResource.Designer.cs b/AppResource.Designer.cs index b11e4a2..38ef02f 100644 --- a/AppResource.Designer.cs +++ b/AppResource.Designer.cs @@ -19,7 +19,7 @@ namespace BookmarkManager { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class AppResource { @@ -61,20 +61,38 @@ namespace BookmarkManager { } /// - /// Looks up a localized string similar to Ray Lam. + /// Looks up a localized string similar to . /// - internal static string app_author { + internal static string AppAuthorURL { get { - return ResourceManager.GetString("app_author", resourceCulture); + return ResourceManager.GetString("AppAuthorURL", resourceCulture); } } /// - /// Looks up a localized string similar to Bookmark Manager. + /// Looks up a localized string similar to https://www.hiimray.co.uk. /// - internal static string app_name { + internal static string AppCompanyURL { get { - return ResourceManager.GetString("app_name", resourceCulture); + return ResourceManager.GetString("AppCompanyURL", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://www.hiimray.co.uk/software-bookmark-manager. + /// + internal static string AppHelpURL { + get { + return ResourceManager.GetString("AppHelpURL", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://www.hiimray.co.uk/software-bookmark-manager. + /// + internal static string AppProductURL { + get { + return ResourceManager.GetString("AppProductURL", resourceCulture); } } @@ -168,6 +186,16 @@ namespace BookmarkManager { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap icon_64 { + get { + object obj = ResourceManager.GetObject("icon_64", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -207,14 +235,5 @@ namespace BookmarkManager { return ((System.Drawing.Bitmap)(obj)); } } - - /// - /// Looks up a localized string similar to https://www.hiimray.co.uk/software-bookmark-manager. - /// - internal static string url_help { - get { - return ResourceManager.GetString("url_help", resourceCulture); - } - } } } diff --git a/AppResource.resx b/AppResource.resx index 64c474c..1626454 100644 --- a/AppResource.resx +++ b/AppResource.resx @@ -112,18 +112,24 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Ray Lam + + - - Bookmark Manager + + https://www.hiimray.co.uk - + + https://www.hiimray.co.uk/software-bookmark-manager + + + https://www.hiimray.co.uk/software-bookmark-manager + + Resources\arrow-down-circle.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -151,6 +157,9 @@ Resources\hexagon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Resources\icon-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\save.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -163,7 +172,4 @@ Resources\trash.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - https://www.hiimray.co.uk/software-bookmark-manager - \ No newline at end of file diff --git a/BookmarkForm.cs b/BookmarkForm.cs deleted file mode 100644 index 88cf262..0000000 --- a/BookmarkForm.cs +++ /dev/null @@ -1,395 +0,0 @@ -using BookmarkManager; -using bzit.bomg.Models; -using FizzyLauncher.Models; -using RyzStudio; -using RyzStudio.IO; -using RyzStudio.Windows.Forms; -using RyzStudio.Windows.ThemedForms; -using System; -using System.ComponentModel; -using System.Drawing; -using System.IO; -using System.Net; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace FizzyLauncher -{ - public class BookmarkForm : TDialogForm - { - private System.Windows.Forms.Label label1; - private TButton button1; - private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator1; - private TTextBox textBox1; - private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator2; - private Label label2; - private Label label3; - private TMemoBox memoBox1; - private TMemoBox memoBox2; - private Label label4; - private TButtonTextBox textBox2; - private PictureBox pictureBox1; - private PictureBox pictureBox2; - - private ToolTip toolTip1; - private System.ComponentModel.IContainer components; - - protected WebParser webParser = null; - protected WebClient webClient = null; - protected AppSession appSession = null; - - - public BookmarkForm(AppSession session, BookmarkItem model, Image icon) : base() - { - InitializeComponent(); - - appSession = session; - - textBox1.Text = model.SiteName?.Trim() ?? string.Empty; - textBox2.Text = model.SiteAddress?.Trim() ?? string.Empty; - textBox2.SetIcon("search"); - memoBox1.Text = model.SiteDescription?.Trim() ?? string.Empty; - memoBox2.Text = model.Notes?.Trim() ?? string.Empty; - pictureBox1.Image = icon; - - textBox2.SetTooltipText(toolTip1, "Retrieve web page information"); - } - - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.label1 = new System.Windows.Forms.Label(); - this.button1 = new RyzStudio.Windows.ThemedForms.TButton(); - this.tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - this.tHorizontalSeparator2 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - this.textBox1 = new RyzStudio.Windows.ThemedForms.TTextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.memoBox1 = new RyzStudio.Windows.ThemedForms.TMemoBox(); - this.memoBox2 = new RyzStudio.Windows.ThemedForms.TMemoBox(); - this.label4 = new System.Windows.Forms.Label(); - this.textBox2 = new RyzStudio.Windows.ThemedForms.TButtonTextBox(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.pictureBox2 = new System.Windows.Forms.PictureBox(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.ForeColor = System.Drawing.SystemColors.ControlText; - this.label1.Location = new System.Drawing.Point(10, 21); - this.label1.Margin = new System.Windows.Forms.Padding(0); - this.label1.Name = "label1"; - this.label1.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); - this.label1.Size = new System.Drawing.Size(29, 34); - this.label1.TabIndex = 153; - this.label1.Text = "Title"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // button1 - // - this.button1.AcceptButton = null; - this.button1.ActiveImage = null; - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.button1.BackColor = System.Drawing.Color.Transparent; - this.button1.HoverImage = null; - this.button1.IdleImage = null; - this.button1.LabelText = "&Save"; - this.button1.Location = new System.Drawing.Point(241, 469); - this.button1.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10); - this.button1.Name = "button1"; - this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.button1.Size = new System.Drawing.Size(128, 32); - this.button1.TabIndex = 4; - this.button1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.button1_MouseClick); - // - // tHorizontalSeparator1 - // - this.tHorizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tHorizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator1.BackColor = System.Drawing.Color.Transparent; - this.tHorizontalSeparator1.Location = new System.Drawing.Point(10, 437); - this.tHorizontalSeparator1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 10); - this.tHorizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2); - this.tHorizontalSeparator1.MinimumSize = new System.Drawing.Size(0, 22); - this.tHorizontalSeparator1.Name = "tHorizontalSeparator1"; - this.tHorizontalSeparator1.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); - this.tHorizontalSeparator1.Size = new System.Drawing.Size(364, 22); - this.tHorizontalSeparator1.TabIndex = 188; - this.tHorizontalSeparator1.TabStop = false; - // - // tHorizontalSeparator2 - // - this.tHorizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tHorizontalSeparator2.AutoScrollMargin = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator2.AutoScrollMinSize = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator2.BackColor = System.Drawing.Color.Transparent; - this.tHorizontalSeparator2.Location = new System.Drawing.Point(10, 223); - this.tHorizontalSeparator2.Margin = new System.Windows.Forms.Padding(5, 0, 5, 10); - this.tHorizontalSeparator2.MaximumSize = new System.Drawing.Size(4920, 2); - this.tHorizontalSeparator2.MinimumSize = new System.Drawing.Size(0, 22); - this.tHorizontalSeparator2.Name = "tHorizontalSeparator2"; - this.tHorizontalSeparator2.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); - this.tHorizontalSeparator2.Size = new System.Drawing.Size(364, 22); - this.tHorizontalSeparator2.TabIndex = 190; - this.tHorizontalSeparator2.TabStop = false; - // - // textBox1 - // - this.textBox1.AcceptButton = null; - this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox1.BackColor = System.Drawing.Color.Transparent; - this.textBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.textBox1.Location = new System.Drawing.Point(110, 20); - this.textBox1.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10); - this.textBox1.Name = "textBox1"; - this.textBox1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.textBox1.ReadOnly = false; - this.textBox1.Size = new System.Drawing.Size(222, 34); - this.textBox1.TabIndex = 0; - this.textBox1.UseSystemPasswordChar = false; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.BackColor = System.Drawing.Color.Transparent; - this.label2.ForeColor = System.Drawing.SystemColors.ControlText; - this.label2.Location = new System.Drawing.Point(10, 67); - this.label2.Margin = new System.Windows.Forms.Padding(0); - this.label2.Name = "label2"; - this.label2.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); - this.label2.Size = new System.Drawing.Size(49, 34); - this.label2.TabIndex = 193; - this.label2.Text = "Address"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.ForeColor = System.Drawing.SystemColors.ControlText; - this.label3.Location = new System.Drawing.Point(10, 113); - this.label3.Margin = new System.Windows.Forms.Padding(0); - this.label3.Name = "label3"; - this.label3.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); - this.label3.Size = new System.Drawing.Size(67, 34); - this.label3.TabIndex = 195; - this.label3.Text = "Description"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // memoBox1 - // - this.memoBox1.AcceptButton = null; - this.memoBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.memoBox1.BackColor = System.Drawing.Color.Transparent; - this.memoBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.memoBox1.Location = new System.Drawing.Point(110, 112); - this.memoBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); - this.memoBox1.Name = "memoBox1"; - this.memoBox1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.memoBox1.ReadOnly = false; - this.memoBox1.Size = new System.Drawing.Size(259, 105); - this.memoBox1.TabIndex = 2; - // - // memoBox2 - // - this.memoBox2.AcceptButton = null; - this.memoBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.memoBox2.BackColor = System.Drawing.Color.Transparent; - this.memoBox2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.memoBox2.Location = new System.Drawing.Point(110, 251); - this.memoBox2.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); - this.memoBox2.Name = "memoBox2"; - this.memoBox2.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.memoBox2.ReadOnly = false; - this.memoBox2.Size = new System.Drawing.Size(259, 180); - this.memoBox2.TabIndex = 3; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.BackColor = System.Drawing.Color.Transparent; - this.label4.ForeColor = System.Drawing.SystemColors.ControlText; - this.label4.Location = new System.Drawing.Point(10, 252); - this.label4.Margin = new System.Windows.Forms.Padding(0); - this.label4.Name = "label4"; - this.label4.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); - this.label4.Size = new System.Drawing.Size(38, 34); - this.label4.TabIndex = 198; - this.label4.Text = "Notes"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // textBox2 - // - this.textBox2.AcceptButton = null; - this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox2.BackColor = System.Drawing.Color.Transparent; - this.textBox2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.textBox2.HighlightImage = null; - this.textBox2.Location = new System.Drawing.Point(110, 66); - this.textBox2.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10); - this.textBox2.Name = "textBox2"; - this.textBox2.NormalImage = null; - this.textBox2.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.textBox2.Size = new System.Drawing.Size(259, 34); - this.textBox2.TabIndex = 1; - this.textBox2.UseSystemPasswordChar = false; - this.textBox2.OnButtonClick += new System.EventHandler(this.textBox2_OnButtonClick); - // - // pictureBox1 - // - this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pictureBox1.BackColor = System.Drawing.Color.Transparent; - this.pictureBox1.ErrorImage = null; - this.pictureBox1.InitialImage = null; - this.pictureBox1.Location = new System.Drawing.Point(337, 21); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(32, 34); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; - this.pictureBox1.TabIndex = 201; - this.pictureBox1.TabStop = false; - // - // pictureBox2 - // - this.pictureBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.pictureBox2.BackColor = System.Drawing.Color.Transparent; - this.pictureBox2.ErrorImage = null; - this.pictureBox2.InitialImage = null; - this.pictureBox2.Location = new System.Drawing.Point(196, 469); - this.pictureBox2.Name = "pictureBox2"; - this.pictureBox2.Size = new System.Drawing.Size(32, 32); - this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; - this.pictureBox2.TabIndex = 202; - this.pictureBox2.TabStop = false; - // - // BookmarkForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(384, 521); - this.Controls.Add(this.pictureBox2); - this.Controls.Add(this.pictureBox1); - this.Controls.Add(this.textBox2); - this.Controls.Add(this.memoBox2); - this.Controls.Add(this.label4); - this.Controls.Add(this.memoBox1); - this.Controls.Add(this.label3); - this.Controls.Add(this.label2); - this.Controls.Add(this.textBox1); - this.Controls.Add(this.tHorizontalSeparator2); - this.Controls.Add(this.tHorizontalSeparator1); - this.Controls.Add(this.button1); - this.Controls.Add(this.label1); - this.KeyPreview = true; - this.MinimumSize = new System.Drawing.Size(400, 560); - this.Name = "BookmarkForm"; - this.Text = "Edit Bookmark"; - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - protected override void OnShown(EventArgs e) - { - base.OnShown(e); - - textBox2.Focus(); - } - - - public BookmarkResult Model - { - get => new BookmarkResult() - { - Item = new BookmarkItem() - { - SiteName = textBox1.Text?.Trim() ?? string.Empty, - SiteAddress = textBox2.Text?.Trim() ?? string.Empty, - SiteDescription = memoBox1.Text?.Trim() ?? string.Empty, - Notes = memoBox2.Text?.Trim() ?? string.Empty - }, - Icon = pictureBox1.Image - }; - } - - protected new bool IsBusy - { - get => base.IsBusy; - set - { - base.IsBusy = value; - - UIControl.SetValue(pictureBox2, (this.IsBusy ? UIResource1.loading_block : null)); - - UIControl.SetEnable(textBox1, !this.IsBusy); - UIControl.SetEnable(textBox2, !this.IsBusy); - UIControl.SetEnable(memoBox1, !this.IsBusy); - UIControl.SetEnable(memoBox2, !this.IsBusy); - UIControl.SetEnable(button1, !this.IsBusy); - } - } - - - private void button1_MouseClick(object sender, MouseEventArgs e) - { - this.DialogResult = DialogResult.OK; - this.Close(); - } - - private async void textBox2_OnButtonClick(object sender, EventArgs e) - { - await Task.Run(() => - { - if (IsBusy) return; - - IsBusy = true; - - if (webParser == null) webParser = new WebParser(); - - if (string.IsNullOrWhiteSpace(textBox1.Text)) - { - IsBusy = false; - return; - } - - BookmarkResult rs = webParser.RetrieveDetails(textBox2.Text, appSession.IgnoreSSL); - if (rs == null) - { - IsBusy = false; - return; - } - - if (rs.Item == null) rs.Item = new BookmarkItem(); - - if (!string.IsNullOrWhiteSpace(rs.Item.SiteName)) UIControl.SetText(textBox1.TextBox, rs.Item.SiteName); - if (!string.IsNullOrWhiteSpace(rs.Item.SiteDescription)) UIControl.SetText(memoBox1.TextBox, rs.Item.SiteDescription); - - if (string.IsNullOrWhiteSpace(rs.IconURL)) - { - UIControl.Clear(pictureBox1); - } - else - { - UIControl.SetValue(pictureBox1, webParser.RetrieveImage(rs.IconURL)); - } - - IsBusy = false; - }); - } - - } -} \ No newline at end of file diff --git a/BookmarkManager.csproj b/BookmarkManager.csproj index 6d6b597..bba7952 100644 --- a/BookmarkManager.csproj +++ b/BookmarkManager.csproj @@ -2,21 +2,23 @@ WinExe - net6.0-windows + net8.0-windows8.0 true true favicon.ico false - bookmarkmanager + bukkubuddy Ray Lam Hi, I'm Ray - Bookmark Manager + BukkuBuddy Ray Lam 1.0.0.0 1.0.0.0 - 0.5.0.012 - bookmarkmanager + 0.6.0.972 + bukkubuddy True + 8.0 + BukkuBuddy Bookmark Manager @@ -32,19 +34,25 @@ + + + + + + @@ -56,6 +64,7 @@ + @@ -70,6 +79,7 @@ + @@ -87,8 +97,7 @@ - - + @@ -99,8 +108,7 @@ - - + @@ -111,19 +119,9 @@ - - - - - - - - - References\Ryz3core.dll - - - References\Ryz3ui.dll - + + + \ No newline at end of file diff --git a/Classes/BookmarkResult.cs b/Classes/BookmarkResult.cs deleted file mode 100644 index 3514f95..0000000 --- a/Classes/BookmarkResult.cs +++ /dev/null @@ -1,15 +0,0 @@ -using bzit.bomg.Models; -using System.Drawing; - -namespace BookmarkManager -{ - public class BookmarkResult - { - public BookmarkItem Item { get; set; } = null; - - public string IconURL { get; set; } = null; - - public Image Icon { get; set; } = null; - - } -} diff --git a/Classes/Crypto.cs b/Classes/Crypto.cs deleted file mode 100644 index 7146990..0000000 --- a/Classes/Crypto.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Security.Cryptography; -using System.Text; - -namespace BookmarkManager -{ - public class Crypto - { - public static string GetSHA256Hash(string text) - { - if (string.IsNullOrWhiteSpace(text)) return string.Empty; - - using (var sha = SHA256.Create()) - { - byte[] hash = sha.ComputeHash(Encoding.UTF8.GetBytes(text)); - - return BitConverter.ToString(hash).Replace("-", string.Empty) + "+" + text.Length.ToString(); - } - } - - } -} \ No newline at end of file diff --git a/Classes/IconDatabase.cs b/Classes/IconDatabase.cs deleted file mode 100644 index e3eb060..0000000 --- a/Classes/IconDatabase.cs +++ /dev/null @@ -1,220 +0,0 @@ -using Microsoft.Data.Sqlite; -using System; -using System.Drawing; -using System.IO; - -namespace BookmarkManager -{ - public class IconDatabase - { - protected string dbFilename = null; - protected SqliteConnection dbConnection = null; - - - public IconDatabase(string filename) - { - if (string.IsNullOrWhiteSpace(filename)) return; - - dbFilename = filename; - - bool isNew = !File.Exists(dbFilename); - - SqliteConnectionStringBuilder builder = new SqliteConnectionStringBuilder(); - builder.DataSource = dbFilename; - builder.Cache = SqliteCacheMode.Private; - builder.Mode = SqliteOpenMode.ReadWriteCreate; - - dbConnection = new SqliteConnection(builder.ToString()); - dbConnection.Open(); - - if (isNew) Initialise(); - - } - - public bool AddIcon(string id, Image image) - { - if (dbConnection == null) return false; - if (string.IsNullOrWhiteSpace(id)) return false; - - if (image == null) return DeleteIcon(id); - if (HasIcon(id)) return UpdateIcon(id, image); - - SqliteCommand command = new SqliteCommand(); - command.Connection = dbConnection; - command.CommandText = "INSERT INTO icons (id, content) VALUES (@id, @content)"; - command.Parameters.Add("@id", SqliteType.Text).Value = id; - command.Parameters.Add("@content", SqliteType.Blob).Value = ImageToBytes(image); - - try - { - command.ExecuteNonQuery(); - } - catch (Exception) - { - return false; - } - - return true; - } - - public void Close() - { - if (dbConnection == null) return; - - dbConnection.Close(); - dbConnection.Dispose(); - dbConnection = null; - } - - public bool DeleteIcon(string id) - { - if (dbConnection == null) return false; - if (string.IsNullOrWhiteSpace(id)) return false; - - SqliteCommand command = new SqliteCommand(); - command.Connection = dbConnection; - command.CommandText = "DELETE FROM icons WHERE id = @id"; - command.Parameters.Add("@id", SqliteType.Text).Value = id; - - try - { - command.ExecuteNonQuery(); - } - catch (Exception) - { - return false; - } - - return true; - } - - public Image FindIcon(string id) - { - if (dbConnection == null) return null; - if (string.IsNullOrWhiteSpace(id)) return null; - - if (!HasIcon(id)) return null; - - byte[] iconBytes = null; - - SqliteCommand command = new SqliteCommand(); - command.Connection = dbConnection; - command.CommandText = "SELECT content FROM icons WHERE id = @id"; - command.Parameters.Add("@id", SqliteType.Text).Value = id; - - try - { - var rs = command.ExecuteScalar(); - if (rs != null) - { - iconBytes = (byte[])rs; - } - - command.Dispose(); - } - catch (Exception) - { - return null; - } - - if (iconBytes == null) - { - return null; - } - - Image img = null; - - try - { - img = Image.FromStream(new MemoryStream(iconBytes)); - } - catch (Exception) - { - return null; - } - - return img; - } - - public bool HasIcon(string id) - { - if (dbConnection == null) return false; - if (string.IsNullOrWhiteSpace(id)) return false; - - string rs = string.Empty; - - SqliteCommand command = new SqliteCommand(); - command.Connection = dbConnection; - command.CommandText = "SELECT COUNT(1) AS count FROM icons WHERE id = @id"; - command.Parameters.Add("@id", SqliteType.Text).Value = id; - - try - { - rs = command.ExecuteScalar()?.ToString() ?? string.Empty; - - command.Dispose(); - } - catch (Exception) - { - return false; - } - - int rv; - if (!int.TryParse(rs, out rv)) rv = 0; - - return (rv > 0); - } - - public bool UpdateIcon(string id, Image image) - { - if (dbConnection == null) return false; - if (string.IsNullOrWhiteSpace(id)) return false; - - if (image == null) return DeleteIcon(id); - if (!HasIcon(id)) return AddIcon(id, image); - - SqliteCommand command = new SqliteCommand(); - command.Connection = dbConnection; - command.CommandText = "UPDATE icons SET content = @content WHERE id = @id"; - command.Parameters.Add("@id", SqliteType.Text).Value = id; - command.Parameters.Add("@content", SqliteType.Blob).Value = ImageToBytes(image); - - try - { - command.ExecuteNonQuery(); - } - catch (Exception) - { - return false; - } - - return true; - } - - - protected bool Initialise() - { - if (dbConnection == null) return false; - - try - { - SqliteCommand command = new SqliteCommand("CREATE TABLE icons (id TEXT PRIMARY KEY, content BLOB)", dbConnection); - command.ExecuteNonQuery(); - command.Dispose(); - } - catch (Exception) - { - return false; - } - - return true; - } - - protected byte[] ImageToBytes(Image image) - { - ImageConverter imageConverter = new ImageConverter(); - return (byte[])imageConverter.ConvertTo(image, typeof(byte[])); - } - - } -} \ No newline at end of file diff --git a/Classes/Result.cs b/Classes/Result.cs deleted file mode 100644 index 68533ea..0000000 --- a/Classes/Result.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace BookmarkManager -{ - public class Result - { - public static Result Create() => new Result() - { - IsSuccess = true, - Message = null - }; - - public static Result Create(bool isSuccess) => new Result() - { - IsSuccess = isSuccess, - Message = null - }; - - public static Result Create(bool isSuccess, string message) => new Result() - { - IsSuccess = isSuccess, - Message = message - }; - - - public bool IsSuccess { get; set; } = false; - - public string Message { get; set; } - - } -} diff --git a/Classes/SupportedFile/ISupportedFileBase.cs b/Classes/SupportedFile/ISupportedFileBase.cs deleted file mode 100644 index 424bde9..0000000 --- a/Classes/SupportedFile/ISupportedFileBase.cs +++ /dev/null @@ -1,23 +0,0 @@ -using RyzStudio.Windows.Forms; -using System.Collections.Generic; - -namespace BookmarkManager -{ - public interface ISupportedFile - { - - - bool IsEncryptionSupported { get; set; } - - List SupportedExtensions { get; } - - bool IsSupported(string filename); - - bool IsEncrypted(string filename); - - Result Load(BookmarkTreeView treeview, string filename, string password); - - Result Save(BookmarkTreeView treeview, string filename, string password); - - } -} diff --git a/Classes/SupportedFile/JSNXSupportedFile.cs b/Classes/SupportedFile/JSNXSupportedFile.cs deleted file mode 100644 index c57e926..0000000 --- a/Classes/SupportedFile/JSNXSupportedFile.cs +++ /dev/null @@ -1,83 +0,0 @@ -using bzit.bomg.Models; -using Newtonsoft.Json; -using RyzStudio.IO; -using RyzStudio.Windows.Forms; -using System.Collections.Generic; -using System.Windows.Forms; - -namespace BookmarkManager -{ - public class JSNXSupportedFile : SupportedFileBase - { - - - public JSNXSupportedFile() - { - supportedExtensions = new List() { ".jsnx" }; - } - - - public override bool IsEncryptionSupported { get; set; } = true; - - public override bool IsEncrypted(string filename) => SharpZipLib.IsZipEncrypted(filename); - - public override Result Load(BookmarkTreeView treeview, string filename, string password) - { - treeview.Clear(); - - if (!SharpZipLib.TestArchive(filename, password)) - { - return Result.Create(false, "Could not read file, is password correct?"); - } - - string sourceCode = SharpZipLib.ReadSingle(filename, password, "bookmarks.json"); - if (string.IsNullOrWhiteSpace(sourceCode)) - { - return Result.Create(false, "Could not read file, unexpected format"); - } - - List rs = JsonConvert.DeserializeObject>(sourceCode); - if (rs == null) - { - return Result.Create(false, "Could not read file, incorrect format"); - } - - //// load bookmark items - //ThreadControl.SetValue(progressBar1, 0, rs.Count); - - for (int i = 0; i < rs.Count; i++) - { - // ThreadControl.SetValue(progressBar1, (i + 1)); - - if (treeview.InvokeRequired) - { - treeview.Invoke(new MethodInvoker(() => { - treeview.AddItem(rs[i]); - })); - } - else - { - treeview.AddItem(rs[i]); - } - } - - //treeview.SetNoChanges(); - - return Result.Create(true); - } - - public override Result Save(BookmarkTreeView treeview, string filename, string password) - { - List rs = treeview.GetBookmarkList(); - if (rs.Count <= 0) - { - return Result.Create(false, "No bookmarks to save"); - } - - bool rv = SharpZipLib.CreateSingle(filename, password, "bookmarks.json", JsonConvert.SerializeObject(rs)); - - return Result.Create(rv); - } - - } -} diff --git a/Classes/SupportedFile/JSONSupportedFile.cs b/Classes/SupportedFile/JSONSupportedFile.cs deleted file mode 100644 index 487300a..0000000 --- a/Classes/SupportedFile/JSONSupportedFile.cs +++ /dev/null @@ -1,89 +0,0 @@ -using bzit.bomg.Models; -using Newtonsoft.Json; -using RyzStudio.IO; -using RyzStudio.Windows.Forms; -using System; -using System.Collections.Generic; -using System.Windows.Forms; - -namespace BookmarkManager -{ - public class JSONSupportedFile : SupportedFileBase - { - - - public JSONSupportedFile() - { - supportedExtensions = new List() { ".json" }; - } - - - public override bool IsEncryptionSupported { get; set; } = false; - - public override bool IsEncrypted(string filename) => false; - - public override Result Load(BookmarkTreeView treeview, string filename, string password) - { - treeview.Clear(); - - string sourceCode = null; - - try - { - sourceCode = System.IO.File.ReadAllText(filename); - } - catch (Exception exc) - { - return Result.Create(false, "Could not read file (" + exc.Message + ")"); - } - - if (string.IsNullOrWhiteSpace(sourceCode)) - { - return Result.Create(false, "Could not read file, unexpected format"); - } - - List rs = JsonConvert.DeserializeObject>(sourceCode); - if (rs == null) - { - return Result.Create(false, "Could not read file, incorrect format"); - } - - for (int i = 0; i < rs.Count; i++) - { - if (treeview.InvokeRequired) - { - treeview.Invoke(new MethodInvoker(() => { - treeview.AddItem(rs[i]); - })); - } - else - { - treeview.AddItem(rs[i]); - } - } - - return Result.Create(true); - } - - public override Result Save(BookmarkTreeView treeview, string filename, string password) - { - List rs = treeview.GetBookmarkList(); - if (rs.Count <= 0) - { - return Result.Create(false, "No bookmarks to save"); - } - - try - { - System.IO.File.WriteAllText(filename, JsonConvert.SerializeObject(rs)); - } - catch (Exception exc) - { - return Result.Create(false, "Could not write file (" + exc.Message + ")"); - } - - return Result.Create(true); - } - - } -} diff --git a/Classes/SupportedFile/RYZSupportedFile.cs b/Classes/SupportedFile/RYZSupportedFile.cs deleted file mode 100644 index 34dbbd2..0000000 --- a/Classes/SupportedFile/RYZSupportedFile.cs +++ /dev/null @@ -1,176 +0,0 @@ -using bzit.bomg.Models; -using RyzStudio.IO; -using RyzStudio.Windows.Forms; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Windows.Forms; -using System.Xml; - -namespace BookmarkManager -{ - public class RYZSupportedFile : SupportedFileBase - { - - - public RYZSupportedFile() - { - supportedExtensions = new List() { ".ryz" }; - } - - - public override bool IsEncryptionSupported { get; set; } = true; - - public override bool IsEncrypted(string filename) => SharpZipLib.IsZipEncrypted(filename); - - public override Result Load(BookmarkTreeView treeview, string filename, string password) - { - treeview.Clear(); - - if (!SharpZipLib.TestArchive(filename, password)) - { - return Result.Create(false, "Could not read file, is password correct?"); - } - - string sourceCode = SharpZipLib.ReadSingle(filename, password, "bookmarks.xml"); - if (string.IsNullOrWhiteSpace(sourceCode)) - { - return Result.Create(false, "Could not read file, unexpected format"); - } - - // load xml - XmlDocument xmlDocument = new XmlDocument(); - xmlDocument.LoadXml(sourceCode); - - // parse - XmlNode xnl = xmlDocument.SelectSingleNode("bomg/b/g"); - if (xnl == null) - { - return Result.Create(false, "Could not load file, unexpected format"); - } - - string rootName = (xnl.Attributes["name"] == null) ? "Bookmarks" : (string.IsNullOrWhiteSpace(xnl.Attributes["name"].InnerText) ? "Bookmarks" : xnl.Attributes["name"].InnerText.Trim()); - - foreach (XmlNode xn in xnl.ChildNodes) - { - BookmarkItem item = new BookmarkItem(); - - foreach (XmlNode xn2 in xn.ChildNodes) - { - switch (xn2.LocalName) - { - case "name": - item.SiteName = xn2.InnerText?.Trim(); - break; - case "address": - item.SiteAddress = xn2.InnerText?.Trim(); - break; - case "description": - item.SiteDescription = xn2.InnerText?.Trim(); - break; - case "notes": - item.Notes = xn2.InnerText?.Trim(); - break; - //case "created": - // bi.Created = xn2.InnerText?.Trim(); - // break; - default: - break; - } - } - - // fix fullpath and name - if (item.SiteName.Contains("|")) - { - StringBuilder sb = new StringBuilder(); - sb.Append("\\"); - sb.Append(System.Web.HttpUtility.UrlEncode(rootName)); - sb.Append("\\"); - - string[] pathParts = item.SiteName.Split('|'); - for (int i = 0; i < (pathParts.Length - 1); i++) - { - sb.Append(pathParts[i]); - //sb.Append(System.Web.HttpUtility.UrlDecode(pathParts[i])); - sb.Append("\\"); - } - - item.SiteName = System.Web.HttpUtility.UrlDecode(pathParts[(pathParts.Length - 1)] ?? string.Empty); - item.TreeviewPath = sb.ToString(); - } - else - { - item.SiteName = System.Web.HttpUtility.UrlDecode(item.SiteName); - item.TreeviewPath = string.Format("\\{0}\\", System.Web.HttpUtility.UrlEncode(rootName)); - } - - if (treeview.InvokeRequired) - { - treeview.Invoke(new MethodInvoker(() => - { - treeview.AddItem(item); - })); - } - else - { - treeview.AddItem(item); - } - } - - return Result.Create(true); - } - - public override Result Save(BookmarkTreeView treeview, string filename, string password) - { - List rs = treeview.GetBookmarkList(); - if (rs.Count <= 0) - { - return Result.Create(false, "No bookmarks to save"); - } - - return Result.Create(false, "Saving in this format is no longer supported"); - - //MemoryStream ms = new MemoryStream(); - //XmlTextWriter writer = new XmlTextWriter(ms, Encoding.UTF8); - - //writer.Formatting = Formatting.Indented; - //writer.WriteStartDocument(); - //writer.WriteStartElement("bomg"); - //writer.WriteStartElement("b"); - //writer.WriteStartElement("g"); - //writer.WriteAttributeString("name", treeview.Nodes[0].Text); - - //foreach (BookmarkItem item in rs) - //{ - // writer.WriteStartElement("m"); - // writer.WriteElementString("name", item.TreeviewPath); - // writer.WriteElementString("address", item.SiteAddress); - // writer.WriteElementString("description", item.SiteDescription); - // writer.WriteElementString("created", "200101010000"); - // writer.WriteEndElement(); - //} - - //writer.WriteEndElement(); - //writer.WriteEndElement(); - //writer.WriteEndElement(); - //writer.WriteEndDocument(); - //writer.Flush(); - - //ms.Position = 0; - //StreamReader sr = new StreamReader(ms); - - //string sourceCode = sr.ReadToEnd(); - - //sr.Close(); - //sr.Dispose(); - - //writer.Close(); - //writer.Dispose(); - - //bool rv = SharpZipLib.CreateSingle(filename, password, "bookmarks.xml", sourceCode); - - //return Result.Create(rv); - } - - } -} diff --git a/Classes/SupportedFile/SupportedFileBase.cs b/Classes/SupportedFile/SupportedFileBase.cs deleted file mode 100644 index 10f6a6f..0000000 --- a/Classes/SupportedFile/SupportedFileBase.cs +++ /dev/null @@ -1,49 +0,0 @@ -using RyzStudio.Windows.Forms; -using System.Collections.Generic; -using System.IO; - -namespace BookmarkManager -{ - public abstract class SupportedFileBase : ISupportedFile - { - protected List supportedExtensions = new List(); - - - public SupportedFileBase() - { - } - - - public virtual bool IsEncryptionSupported { get; set; } = false; - - public List SupportedExtensions { get => supportedExtensions; } - - - public virtual bool IsSupported(string filename) - { - if (string.IsNullOrWhiteSpace(filename)) - { - return false; - } - - if (supportedExtensions == null) - { - return false; - } - - if (supportedExtensions.Count <= 0) - { - return false; - } - - return supportedExtensions.Contains(Path.GetExtension(filename)?.Trim()?.ToLower()); - } - - public virtual bool IsEncrypted(string filename) => false; - - public virtual Result Load(BookmarkTreeView treeview, string filename, string password) => Result.Create(false); - - public virtual Result Save(BookmarkTreeView treeview, string filename, string password) => Result.Create(false); - - } -} diff --git a/EditBookmarkForm.cs b/EditBookmarkForm.cs new file mode 100644 index 0000000..b2becff --- /dev/null +++ b/EditBookmarkForm.cs @@ -0,0 +1,431 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +using BookmarkManager.Services; +using bzit.bomg.Models; +using RyzStudio.Windows.Forms; +using RyzStudio.Windows.ThemedForms; +using RyzStudio.Windows.ThemedForms.ButtonTextBox; + +namespace FizzyLauncher +{ + public class EditBookmarkForm : Form + { + private System.Windows.Forms.Label label1; + private ThClearableTextBox textBox1; + private Label label2; + private Label label3; + private ThToolbarMemoBox memoBox1; + private Label label4; + private ThHiButtonTextBox textBox2; + private PictureBox pictureBox1; + private PictureBox pictureBox2; + private ToolTip toolTip1; + private System.ComponentModel.IContainer components; + private ThClearableTextBox textBox3; + private ThUserControl thUserControl1; + private Label label5; + + + private readonly WebProvider _webProvider; + private BookmarkModel result = null; + private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1; + private bool _isBusy = false; + + + public EditBookmarkForm(BookmarkModel model = null) + { + InitializeComponent(); + + UISetup.Dialog(this); + + this.Text = (result == null) ? "Add Bookmark" : "Edit Bookmark"; + + result = model; + + _webProvider = new WebProvider(); + _webProvider.IgnoreSSL = true; + + if (result != null) + { + textBox1.Text = model.Title?.Trim() ?? string.Empty; + textBox2.Text = model.Address?.Trim() ?? string.Empty; + textBox3.Text = model.Description?.Trim() ?? string.Empty; + + try + { + pictureBox1.Image = model.Icon; + } + catch (Exception) + { + // do nothing + } + + memoBox1.Text = model.Notes?.Trim() ?? string.Empty; + } + } + + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + label1 = new Label(); + textBox1 = new ThClearableTextBox(); + label2 = new Label(); + label3 = new Label(); + memoBox1 = new ThToolbarMemoBox(); + label4 = new Label(); + textBox2 = new ThHiButtonTextBox(); + pictureBox1 = new PictureBox(); + toolTip1 = new ToolTip(components); + pictureBox2 = new PictureBox(); + textBox3 = new ThClearableTextBox(); + thUserControl1 = new ThUserControl(); + label5 = new Label(); + dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter(); + ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)pictureBox2).BeginInit(); + SuspendLayout(); + // + // label1 + // + label1.AutoSize = true; + label1.BackColor = Color.Transparent; + label1.ForeColor = SystemColors.ControlText; + label1.Location = new Point(10, 21); + label1.Margin = new Padding(0); + label1.Name = "label1"; + label1.Padding = new Padding(0, 8, 0, 0); + label1.Size = new Size(29, 23); + label1.TabIndex = 153; + label1.Text = "Title"; + label1.TextAlign = ContentAlignment.MiddleLeft; + // + // textBox1 + // + 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.Icon = "O"; + textBox1.IconSize = 13F; + textBox1.Location = new Point(109, 20); + textBox1.Name = "textBox1"; + textBox1.Size = new Size(260, 32); + textBox1.TabIndex = 0; + textBox1.TabStop = false; + textBox1.UseSystemPasswordChar = false; + // + // label2 + // + label2.AutoSize = true; + label2.BackColor = Color.Transparent; + label2.ForeColor = SystemColors.ControlText; + label2.Location = new Point(10, 61); + label2.Margin = new Padding(0); + label2.Name = "label2"; + label2.Padding = new Padding(0, 8, 0, 0); + label2.Size = new Size(49, 23); + label2.TabIndex = 193; + label2.Text = "Address"; + label2.TextAlign = ContentAlignment.MiddleLeft; + // + // label3 + // + label3.AutoSize = true; + label3.BackColor = Color.Transparent; + label3.ForeColor = SystemColors.ControlText; + label3.Location = new Point(10, 104); + label3.Margin = new Padding(0); + label3.Name = "label3"; + label3.Padding = new Padding(0, 8, 0, 0); + label3.Size = new Size(67, 23); + label3.TabIndex = 195; + label3.Text = "Description"; + label3.TextAlign = ContentAlignment.MiddleLeft; + // + // memoBox1 + // + memoBox1.AllowDrop = true; + memoBox1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + memoBox1.BackColor = Color.Transparent; + memoBox1.ClearedValue = ""; + memoBox1.EnableReactiveVisual = true; + memoBox1.Font = new Font("Segoe UI", 9F); + memoBox1.Location = new Point(110, 196); + memoBox1.Name = "memoBox1"; + memoBox1.ReadOnly = false; + memoBox1.ScrollBars = ScrollBars.Vertical; + memoBox1.Size = new Size(259, 232); + memoBox1.TabIndex = 3; + memoBox1.TabStop = false; + memoBox1.WordWrap = false; + // + // label4 + // + label4.AutoSize = true; + label4.BackColor = Color.Transparent; + label4.ForeColor = SystemColors.ControlText; + label4.Location = new Point(10, 196); + label4.Margin = new Padding(0); + label4.Name = "label4"; + label4.Padding = new Padding(0, 8, 0, 0); + label4.Size = new Size(38, 23); + label4.TabIndex = 198; + label4.Text = "Notes"; + label4.TextAlign = ContentAlignment.MiddleLeft; + // + // textBox2 + // + textBox2.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + textBox2.BackColor = Color.Transparent; + textBox2.EnableReactiveVisual = true; + textBox2.Font = new Font("Segoe UI", 9F); + textBox2.Icon = "M"; + textBox2.IconSize = 13F; + textBox2.Location = new Point(110, 62); + textBox2.Name = "textBox2"; + textBox2.Size = new Size(259, 32); + textBox2.TabIndex = 1; + textBox2.TabStop = false; + textBox2.UseSystemPasswordChar = false; + textBox2.OnButtonClick += textBox2_OnButtonClick; + // + // pictureBox1 + // + pictureBox1.BackColor = Color.White; + pictureBox1.ErrorImage = null; + pictureBox1.InitialImage = null; + pictureBox1.Location = new Point(113, 150); + pictureBox1.Name = "pictureBox1"; + pictureBox1.Size = new Size(32, 32); + pictureBox1.SizeMode = PictureBoxSizeMode.CenterImage; + pictureBox1.TabIndex = 201; + pictureBox1.TabStop = false; + pictureBox1.MouseDoubleClick += pictureBox1_MouseDoubleClick; + // + // pictureBox2 + // + pictureBox2.Anchor = AnchorStyles.Bottom | AnchorStyles.Left; + pictureBox2.BackColor = Color.Transparent; + pictureBox2.ErrorImage = null; + pictureBox2.InitialImage = null; + pictureBox2.Location = new Point(10, 396); + pictureBox2.Name = "pictureBox2"; + pictureBox2.Size = new Size(32, 32); + pictureBox2.SizeMode = PictureBoxSizeMode.CenterImage; + pictureBox2.TabIndex = 202; + pictureBox2.TabStop = false; + // + // textBox3 + // + 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.Icon = "O"; + textBox3.IconSize = 13F; + textBox3.Location = new Point(109, 104); + textBox3.Name = "textBox3"; + textBox3.Size = new Size(260, 32); + textBox3.TabIndex = 203; + textBox3.TabStop = false; + textBox3.UseSystemPasswordChar = false; + // + // thUserControl1 + // + thUserControl1.BackColor = Color.Transparent; + thUserControl1.EnableReactiveVisual = true; + thUserControl1.Location = new Point(109, 146); + thUserControl1.Name = "thUserControl1"; + thUserControl1.Size = new Size(40, 40); + thUserControl1.TabIndex = 204; + thUserControl1.TabStop = false; + // + // label5 + // + label5.AutoSize = true; + label5.BackColor = Color.Transparent; + label5.ForeColor = SystemColors.ControlText; + label5.Location = new Point(10, 146); + label5.Margin = new Padding(0); + label5.Name = "label5"; + label5.Padding = new Padding(0, 8, 0, 0); + label5.Size = new Size(30, 23); + label5.TabIndex = 195; + label5.Text = "Icon"; + label5.TextAlign = ContentAlignment.MiddleLeft; + // + // dialogFooter1 + // + dialogFooter1.BackColor = Color.FromArgb(240, 240, 240); + dialogFooter1.Button1Text = "&OK"; + dialogFooter1.Dialog = this; + dialogFooter1.Dock = DockStyle.Bottom; + dialogFooter1.Location = new Point(0, 437); + dialogFooter1.Name = "dialogFooter1"; + dialogFooter1.Size = new Size(384, 84); + // + // EditBookmarkForm + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + BackColor = Color.White; + ClientSize = new Size(384, 521); + Controls.Add(dialogFooter1); + Controls.Add(textBox3); + Controls.Add(pictureBox2); + Controls.Add(pictureBox1); + Controls.Add(textBox2); + Controls.Add(memoBox1); + Controls.Add(label4); + Controls.Add(label5); + Controls.Add(label3); + Controls.Add(label2); + Controls.Add(textBox1); + Controls.Add(label1); + Controls.Add(thUserControl1); + KeyPreview = true; + MinimumSize = new Size(400, 560); + Name = "EditBookmarkForm"; + Text = "Edit Bookmark"; + ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit(); + ((System.ComponentModel.ISupportInitialize)pictureBox2).EndInit(); + ResumeLayout(false); + PerformLayout(); + } + + protected override void OnShown(EventArgs e) + { + base.OnShown(e); + + textBox2.Focus(); + } + + protected override void OnClosing(CancelEventArgs e) + { + base.OnClosing(e); + + if (this.IsBusy) + { + e.Cancel = true; + } + } + + public BookmarkModel Result + { + get + { + if (result == null) + { + result = new BookmarkModel(); + } + + result.Title = textBox1.Text?.Trim() ?? string.Empty; + result.Address = textBox2.Text?.Trim() ?? string.Empty; + result.Description = textBox3.Text?.Trim() ?? string.Empty; + + try + { + result.Icon = pictureBox1.Image; + } + catch (Exception) + { + // do nothing + } + + result.Notes = memoBox1.Text?.Trim() ?? string.Empty; + + return result; + } + } + + protected bool IsBusy + { + get => _isBusy; + set + { + _isBusy = value; + + UIControl.SetEnable(textBox1, !this.IsBusy); + UIControl.SetEnable(textBox2, !this.IsBusy); + UIControl.SetEnable(textBox3, !this.IsBusy); + UIControl.SetValue(pictureBox2, (this.IsBusy ? RyzStudio.Windows.ThemedForms.Resource2.loading_block : null)); + UIControl.SetEnable(memoBox1, !this.IsBusy); + } + } + + + private async void textBox2_OnButtonClick(object sender, EventArgs e) + { + if (string.IsNullOrWhiteSpace(textBox2.Text)) + { + return; + } + + if (this.IsBusy) + { + return; + } + + this.IsBusy = true; + + if (!textBox2.Text.StartsWith("http://", StringComparison.CurrentCultureIgnoreCase) && !textBox2.Text.StartsWith("https://", StringComparison.CurrentCultureIgnoreCase)) + { + textBox2.Text = "http://" + textBox2.Text; + } + + var document = await _webProvider.RetrieveHtmlDocument(textBox2.Text); + if (document == null) + { + this.IsBusy = false; + return; + } + + textBox1.Text = _webProvider.ParseTitle(document); + textBox3.Text = _webProvider.ParseMetaDescription(document); + pictureBox1.Image = await _webProvider.RetrieveImage(document); + + this.IsBusy = false; + + textBox2.Focus(); + } + + private async void pictureBox1_MouseDoubleClick(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + if (string.IsNullOrWhiteSpace(textBox2.Text)) + { + return; + } + + if (this.IsBusy) + { + return; + } + + this.IsBusy = true; + + if (!textBox2.Text.StartsWith("http://", StringComparison.CurrentCultureIgnoreCase) && !textBox2.Text.StartsWith("https://", StringComparison.CurrentCultureIgnoreCase)) + { + textBox2.Text = "http://" + textBox2.Text; + } + + var document = await _webProvider.RetrieveHtmlDocument(textBox2.Text); + if (document == null) + { + this.IsBusy = false; + return; + } + + pictureBox1.Image = await _webProvider.RetrieveImage(document); + + this.IsBusy = false; + } + } + + } +} \ No newline at end of file diff --git a/BookmarkForm.resx b/EditBookmarkForm.resx similarity index 50% rename from BookmarkForm.resx rename to EditBookmarkForm.resx index 57523cc..2704a16 100644 --- a/BookmarkForm.resx +++ b/EditBookmarkForm.resx @@ -1,4 +1,64 @@ - + + + diff --git a/FindForm.cs b/FindForm.cs index 69865ba..ff00d2b 100644 --- a/FindForm.cs +++ b/FindForm.cs @@ -1,28 +1,36 @@ -using RyzStudio.Windows.Forms; -using RyzStudio.Windows.ThemedForms; -using System; -using System.ComponentModel; +using System; +using System.Collections.Generic; +using System.Linq; using System.Windows.Forms; +using bzit.bomg.Models; +using RyzStudio.Windows.Forms; +using RyzStudio.Windows.ThemedForms; +using RyzStudio.Windows.ThemedForms.ButtonTextBox; namespace FizzyLauncher { - public class FindForm : TDialogForm + public class FindForm : Form { private System.Windows.Forms.Label label1; - private TButton button2; + private ThButton button2; private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator1; - private TButton button1; - private TTextBox textBox1; + private ThButton button1; + private ThClearableTextBox textBox1; private BookmarkTreeView treeView1 = null; - private bool findNextNew = false; + private int findPosition = -1; public FindForm(BookmarkTreeView treeView) { InitializeComponent(); + this.MinimizeBox = false; + this.MaximizeBox = false; + this.ShowIcon = false; + this.ShowInTaskbar = true; + treeView1 = treeView; textBox1.PreviewKeyDown += textBox1_PreviewKeyDown; @@ -31,10 +39,10 @@ namespace FizzyLauncher private void InitializeComponent() { this.label1 = new System.Windows.Forms.Label(); - this.button2 = new RyzStudio.Windows.ThemedForms.TButton(); + this.button2 = new RyzStudio.Windows.ThemedForms.ThButton(); this.tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - this.textBox1 = new RyzStudio.Windows.ThemedForms.TTextBox(); - this.button1 = new RyzStudio.Windows.ThemedForms.TButton(); + this.textBox1 = new ThClearableTextBox(); + this.button1 = new RyzStudio.Windows.ThemedForms.ThButton(); this.SuspendLayout(); // // label1 @@ -92,10 +100,7 @@ namespace FizzyLauncher this.textBox1.BackColor = System.Drawing.Color.Transparent; this.textBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.textBox1.Location = new System.Drawing.Point(121, 20); - this.textBox1.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10); this.textBox1.Name = "textBox1"; - this.textBox1.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9); - this.textBox1.ReadOnly = false; this.textBox1.Size = new System.Drawing.Size(328, 35); this.textBox1.TabIndex = 0; this.textBox1.UseSystemPasswordChar = false; @@ -141,16 +146,12 @@ namespace FizzyLauncher } - [Browsable(false)] - public string Password => textBox1.Text; - - private void textBox1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { switch (e.KeyCode) { case Keys.Enter: - if (findNextNew) + if (findPosition < 0) { button1_MouseClick(sender, new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0)); } @@ -163,37 +164,91 @@ namespace FizzyLauncher case Keys.Escape: this.Close(); break; - default: break; + default: + break; } } + /// + /// Find first. + /// + /// + /// private void button1_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { - if (string.IsNullOrWhiteSpace(textBox1.Text)) return; - if (treeView1.Nodes.Count <= 0) return; + if (string.IsNullOrWhiteSpace(textBox1.Text)) + { + return; + } - findNextNew = false; - treeView1.FindTextNode(treeView1.Nodes[0], textBox1.Text?.Trim()); + if (treeView1.Nodes.Count <= 0) + { + return; + } + + findPosition = -1; + + var nodeList = treeView1.ToNodeList(); + + var node = nodeList.Where(x => x.Value.Title.Contains(textBox1.Text?.Trim())).Select(x => x.Key).FirstOrDefault(); + if (node != null) + { + findPosition = 0; + + treeView1.SelectedNode = node; + treeView1.SelectedNode.EnsureVisible(); + } } } + /// + /// Find next. + /// + /// + /// private void button2_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { - if (string.IsNullOrWhiteSpace(textBox1.Text)) return; - if (treeView1.Nodes.Count <= 0) return; - - if (treeView1.SelectedNode == null) treeView1.SelectedNode = treeView1.Nodes[0]; - - findNextNew = false; - - bool rv = treeView1.FindTextNode(treeView1.SelectedNode, textBox1.Text?.Trim()); - if (!rv) + if (string.IsNullOrWhiteSpace(textBox1.Text)) { - findNextNew = true; + return; + } + + if (treeView1.Nodes.Count <= 0) + { + return; + } + + if (treeView1.SelectedNode == null) + { + treeView1.SelectedNode = treeView1.Nodes[0]; + } + + var nodeList = treeView1.ToNodeList(); + + var node = nodeList.Where(x => x.Value.Title.Contains(textBox1.Text?.Trim())).Select(x => x.Key)?.ToList() ?? new List(); + if (node != null) + { + //var pos = nodeList.FindIndex(x => x.Key == treeView1.SelectedNode); + //if (pos < 0) + //{ + // findPosition = -1; + //} else { + // findPosition = pos; + //} + + findPosition++; + + if (findPosition >= node.Count) + { + findPosition = 0; + } + + treeView1.SelectedNode = node[findPosition]; + treeView1.SelectedNode.EnsureVisible(); } } } diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index 55c8220..f0c2781 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -32,604 +32,478 @@ namespace FizzyLauncher /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); + components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); - this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem13 = new System.Windows.Forms.ToolStripSeparator(); - this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem14 = new System.Windows.Forms.ToolStripSeparator(); - this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem15 = new System.Windows.Forms.ToolStripSeparator(); - this.exitToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.findToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.expandAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.collapseAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.alwaysOnTopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem9 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); - this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.viewHelpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem16 = new System.Windows.Forms.ToolStripSeparator(); - this.aboutToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); - this.rootContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); - this.addPageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.addFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); - this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator(); - this.sortToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.folderContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); - this.addPageToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.addFolderToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator(); - this.openAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.editToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripSeparator(); - this.sortToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripSeparator(); - this.moveUpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.moveDownToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.pageContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); - this.openToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem7 = new System.Windows.Forms.ToolStripSeparator(); - this.editToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); - this.deleteToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem8 = new System.Windows.Forms.ToolStripSeparator(); - this.moveUpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.moveDownToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStrip1 = new System.Windows.Forms.ToolStrip(); - this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton2 = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripButton3 = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripButton4 = new System.Windows.Forms.ToolStripButton(); - this.treeView1 = new RyzStudio.Windows.Forms.BookmarkTreeView(); - this.menuStrip1.SuspendLayout(); - this.rootContextMenu.SuspendLayout(); - this.folderContextMenu.SuspendLayout(); - this.pageContextMenu.SuspendLayout(); - this.toolStrip1.SuspendLayout(); - this.SuspendLayout(); + saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); + menuStrip1 = new System.Windows.Forms.MenuStrip(); + fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + toolStripMenuItem13 = new System.Windows.Forms.ToolStripSeparator(); + closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + toolStripMenuItem14 = new System.Windows.Forms.ToolStripSeparator(); + saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + toolStripMenuItem15 = new System.Windows.Forms.ToolStripSeparator(); + exitToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); + toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + findToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + expandAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + collapseAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + alwaysOnTopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + toolStripMenuItem9 = new System.Windows.Forms.ToolStripMenuItem(); + toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + helpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + viewHelpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + toolStripMenuItem16 = new System.Windows.Forms.ToolStripSeparator(); + aboutToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + rootContextMenu = new System.Windows.Forms.ContextMenuStrip(components); + addPageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + addFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); + editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator(); + sortToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + folderContextMenu = new System.Windows.Forms.ContextMenuStrip(components); + addPageToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + addFolderToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator(); + openAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + editToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + toolStripMenuItem5 = new System.Windows.Forms.ToolStripSeparator(); + sortToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + toolStripMenuItem6 = new System.Windows.Forms.ToolStripSeparator(); + moveUpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + moveDownToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + pageContextMenu = new System.Windows.Forms.ContextMenuStrip(components); + openToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + toolStripMenuItem7 = new System.Windows.Forms.ToolStripSeparator(); + editToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); + deleteToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + toolStripMenuItem8 = new System.Windows.Forms.ToolStripSeparator(); + moveUpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + moveDownToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + treeView1 = new RyzStudio.Windows.Forms.BookmarkTreeView(); + menuStrip1.SuspendLayout(); + rootContextMenu.SuspendLayout(); + folderContextMenu.SuspendLayout(); + pageContextMenu.SuspendLayout(); + SuspendLayout(); // // saveFileDialog1 // - this.saveFileDialog1.DefaultExt = "jsnx"; - this.saveFileDialog1.Filter = "Bookmarks files (*.jsnx)|*.jsnx|Bookmarks files (*.ryz)|*.ryz"; - this.saveFileDialog1.Title = "Save bookmarks file"; + saveFileDialog1.DefaultExt = "jsnx"; + saveFileDialog1.Filter = "Bookmark files (compressed)|*.jsnx|Bookmark files|*.json;*.jsonfig"; + saveFileDialog1.Title = "Save bookmarks file"; // // menuStrip1 // - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem, - this.toolStripMenuItem1, - this.viewToolStripMenuItem, - this.toolsToolStripMenuItem, - this.helpToolStripMenuItem1}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(300, 24); - this.menuStrip1.TabIndex = 2; + 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(300, 24); + menuStrip1.TabIndex = 2; + menuStrip1.MenuActivate += menuStrip1_MenuActivate; // // fileToolStripMenuItem // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.newToolStripMenuItem, - this.openToolStripMenuItem, - this.toolStripMenuItem13, - this.closeToolStripMenuItem, - this.toolStripMenuItem14, - this.saveToolStripMenuItem, - this.saveAsToolStripMenuItem, - this.toolStripMenuItem15, - this.exitToolStripMenuItem2}); - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); - this.fileToolStripMenuItem.Text = "&File"; + fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { newToolStripMenuItem, openToolStripMenuItem, toolStripMenuItem13, closeToolStripMenuItem, toolStripMenuItem14, saveToolStripMenuItem, saveAsToolStripMenuItem, toolStripMenuItem15, exitToolStripMenuItem2 }); + fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + fileToolStripMenuItem.Text = "&File"; // // newToolStripMenuItem // - this.newToolStripMenuItem.Image = global::BookmarkManager.AppResource.file; - this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); - this.newToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.newToolStripMenuItem.Text = "&New"; - this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); + newToolStripMenuItem.Image = BookmarkManager.AppResource.file; + newToolStripMenuItem.Name = "newToolStripMenuItem"; + 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; // // openToolStripMenuItem // - this.openToolStripMenuItem.Image = global::BookmarkManager.AppResource.folder; - this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); - this.openToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.openToolStripMenuItem.Text = "&Open"; - this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); + openToolStripMenuItem.Image = BookmarkManager.AppResource.folder; + 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.Click += openToolStripMenuItem_Click; // // toolStripMenuItem13 // - this.toolStripMenuItem13.Name = "toolStripMenuItem13"; - this.toolStripMenuItem13.Size = new System.Drawing.Size(143, 6); + toolStripMenuItem13.Name = "toolStripMenuItem13"; + toolStripMenuItem13.Size = new System.Drawing.Size(143, 6); // // closeToolStripMenuItem // - this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; - this.closeToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.closeToolStripMenuItem.Text = "&Close"; - this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click); + closeToolStripMenuItem.Name = "closeToolStripMenuItem"; + closeToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + closeToolStripMenuItem.Text = "&Close"; + closeToolStripMenuItem.Click += closeToolStripMenuItem_Click; // // toolStripMenuItem14 // - this.toolStripMenuItem14.Name = "toolStripMenuItem14"; - this.toolStripMenuItem14.Size = new System.Drawing.Size(143, 6); + toolStripMenuItem14.Name = "toolStripMenuItem14"; + toolStripMenuItem14.Size = new System.Drawing.Size(143, 6); // // saveToolStripMenuItem // - this.saveToolStripMenuItem.Image = global::BookmarkManager.AppResource.save; - this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); - this.saveToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.saveToolStripMenuItem.Text = "&Save"; - this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); + saveToolStripMenuItem.Image = BookmarkManager.AppResource.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.Text = "&Save"; + saveToolStripMenuItem.Click += saveToolStripMenuItem_Click; // // saveAsToolStripMenuItem // - this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; - this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.saveAsToolStripMenuItem.Text = "Save &As..."; - this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); + saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; + saveAsToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + saveAsToolStripMenuItem.Text = "Save &As..."; + saveAsToolStripMenuItem.Click += saveAsToolStripMenuItem_Click; // // toolStripMenuItem15 // - this.toolStripMenuItem15.Name = "toolStripMenuItem15"; - this.toolStripMenuItem15.Size = new System.Drawing.Size(143, 6); + toolStripMenuItem15.Name = "toolStripMenuItem15"; + toolStripMenuItem15.Size = new System.Drawing.Size(143, 6); // // exitToolStripMenuItem2 // - this.exitToolStripMenuItem2.Name = "exitToolStripMenuItem2"; - this.exitToolStripMenuItem2.Size = new System.Drawing.Size(146, 22); - this.exitToolStripMenuItem2.Text = "E&xit"; - this.exitToolStripMenuItem2.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); + exitToolStripMenuItem2.Name = "exitToolStripMenuItem2"; + exitToolStripMenuItem2.Size = new System.Drawing.Size(146, 22); + exitToolStripMenuItem2.Text = "E&xit"; + exitToolStripMenuItem2.Click += exitToolStripMenuItem_Click; // // toolStripMenuItem1 // - this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.findToolStripMenuItem}); - this.toolStripMenuItem1.Name = "toolStripMenuItem1"; - this.toolStripMenuItem1.Size = new System.Drawing.Size(39, 20); - this.toolStripMenuItem1.Text = "&Edit"; + toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { findToolStripMenuItem }); + toolStripMenuItem1.Name = "toolStripMenuItem1"; + toolStripMenuItem1.Size = new System.Drawing.Size(39, 20); + toolStripMenuItem1.Text = "&Edit"; // // findToolStripMenuItem // - this.findToolStripMenuItem.Image = global::BookmarkManager.AppResource.search; - this.findToolStripMenuItem.Name = "findToolStripMenuItem"; - this.findToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); - this.findToolStripMenuItem.Size = new System.Drawing.Size(137, 22); - this.findToolStripMenuItem.Text = "&Find"; - this.findToolStripMenuItem.Click += new System.EventHandler(this.findToolStripMenuItem_Click); + findToolStripMenuItem.Image = BookmarkManager.AppResource.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.Text = "&Find"; + findToolStripMenuItem.Click += findToolStripMenuItem_Click; // // viewToolStripMenuItem // - this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.expandAllToolStripMenuItem, - this.collapseAllToolStripMenuItem, - this.toolStripSeparator1, - this.alwaysOnTopToolStripMenuItem}); - this.viewToolStripMenuItem.Name = "viewToolStripMenuItem"; - this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20); - this.viewToolStripMenuItem.Text = "&View"; + viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { expandAllToolStripMenuItem, collapseAllToolStripMenuItem, toolStripSeparator1, alwaysOnTopToolStripMenuItem }); + viewToolStripMenuItem.Name = "viewToolStripMenuItem"; + viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20); + viewToolStripMenuItem.Text = "&View"; // // expandAllToolStripMenuItem // - this.expandAllToolStripMenuItem.Name = "expandAllToolStripMenuItem"; - this.expandAllToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.expandAllToolStripMenuItem.Text = "&Expand All"; - this.expandAllToolStripMenuItem.Click += new System.EventHandler(this.expandAllToolStripMenuItem_Click); + expandAllToolStripMenuItem.Name = "expandAllToolStripMenuItem"; + expandAllToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + expandAllToolStripMenuItem.Text = "&Expand All"; + expandAllToolStripMenuItem.Click += expandAllToolStripMenuItem_Click; // // collapseAllToolStripMenuItem // - this.collapseAllToolStripMenuItem.Name = "collapseAllToolStripMenuItem"; - this.collapseAllToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.collapseAllToolStripMenuItem.Text = "&Collapse All"; - this.collapseAllToolStripMenuItem.Click += new System.EventHandler(this.collapseAllToolStripMenuItem_Click); + collapseAllToolStripMenuItem.Name = "collapseAllToolStripMenuItem"; + collapseAllToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + collapseAllToolStripMenuItem.Text = "&Collapse All"; + collapseAllToolStripMenuItem.Click += collapseAllToolStripMenuItem_Click; // // toolStripSeparator1 // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6); + toolStripSeparator1.Name = "toolStripSeparator1"; + toolStripSeparator1.Size = new System.Drawing.Size(149, 6); // // alwaysOnTopToolStripMenuItem // - this.alwaysOnTopToolStripMenuItem.Name = "alwaysOnTopToolStripMenuItem"; - this.alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.alwaysOnTopToolStripMenuItem.Text = "Always On &Top"; - this.alwaysOnTopToolStripMenuItem.Click += new System.EventHandler(this.alwaysOnTopToolStripMenuItem_Click); + alwaysOnTopToolStripMenuItem.Name = "alwaysOnTopToolStripMenuItem"; + alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + alwaysOnTopToolStripMenuItem.Text = "Always On &Top"; + alwaysOnTopToolStripMenuItem.Click += alwaysOnTopToolStripMenuItem_Click; // // toolsToolStripMenuItem // - this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripMenuItem9, - this.toolStripSeparator2, - this.optionsToolStripMenuItem}); - this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; - this.toolsToolStripMenuItem.Size = new System.Drawing.Size(46, 20); - this.toolsToolStripMenuItem.Text = "&Tools"; + toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { toolStripMenuItem9, toolStripSeparator2, optionsToolStripMenuItem }); + toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; + toolsToolStripMenuItem.Size = new System.Drawing.Size(46, 20); + toolsToolStripMenuItem.Text = "&Tools"; // // toolStripMenuItem9 // - this.toolStripMenuItem9.Name = "toolStripMenuItem9"; - this.toolStripMenuItem9.Size = new System.Drawing.Size(168, 22); - this.toolStripMenuItem9.Text = "Update &Icons"; - this.toolStripMenuItem9.Click += new System.EventHandler(this.toolStripMenuItem9_Click); + toolStripMenuItem9.Name = "toolStripMenuItem9"; + toolStripMenuItem9.Size = new System.Drawing.Size(168, 22); + toolStripMenuItem9.Text = "Update &Icons"; + toolStripMenuItem9.Click += toolStripMenuItem9_Click; // // toolStripSeparator2 // - this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(165, 6); + toolStripSeparator2.Name = "toolStripSeparator2"; + toolStripSeparator2.Size = new System.Drawing.Size(165, 6); // // optionsToolStripMenuItem // - this.optionsToolStripMenuItem.Image = global::BookmarkManager.AppResource.settings; - this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; - this.optionsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F12))); - this.optionsToolStripMenuItem.Size = new System.Drawing.Size(168, 22); - this.optionsToolStripMenuItem.Text = "&Options"; - this.optionsToolStripMenuItem.Click += new System.EventHandler(this.optionsToolStripMenuItem_Click); + optionsToolStripMenuItem.Image = BookmarkManager.AppResource.settings; + optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; + 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; // // helpToolStripMenuItem1 // - this.helpToolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.viewHelpToolStripMenuItem1, - this.toolStripMenuItem16, - this.aboutToolStripMenuItem1}); - this.helpToolStripMenuItem1.Name = "helpToolStripMenuItem1"; - this.helpToolStripMenuItem1.Size = new System.Drawing.Size(44, 20); - this.helpToolStripMenuItem1.Text = "&Help"; + helpToolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { viewHelpToolStripMenuItem1, toolStripMenuItem16, aboutToolStripMenuItem1 }); + helpToolStripMenuItem1.Name = "helpToolStripMenuItem1"; + helpToolStripMenuItem1.Size = new System.Drawing.Size(44, 20); + helpToolStripMenuItem1.Text = "&Help"; // // viewHelpToolStripMenuItem1 // - this.viewHelpToolStripMenuItem1.Image = global::BookmarkManager.AppResource.help_circle; - this.viewHelpToolStripMenuItem1.Name = "viewHelpToolStripMenuItem1"; - this.viewHelpToolStripMenuItem1.ShortcutKeys = System.Windows.Forms.Keys.F1; - this.viewHelpToolStripMenuItem1.Size = new System.Drawing.Size(146, 22); - this.viewHelpToolStripMenuItem1.Text = "&View Help"; - this.viewHelpToolStripMenuItem1.Click += new System.EventHandler(this.viewHelpToolStripMenuItem1_Click); + viewHelpToolStripMenuItem1.Image = BookmarkManager.AppResource.help_circle; + viewHelpToolStripMenuItem1.Name = "viewHelpToolStripMenuItem1"; + viewHelpToolStripMenuItem1.ShortcutKeys = System.Windows.Forms.Keys.F1; + viewHelpToolStripMenuItem1.Size = new System.Drawing.Size(146, 22); + viewHelpToolStripMenuItem1.Text = "&View Help"; + viewHelpToolStripMenuItem1.Click += viewHelpToolStripMenuItem1_Click; // // toolStripMenuItem16 // - this.toolStripMenuItem16.Name = "toolStripMenuItem16"; - this.toolStripMenuItem16.Size = new System.Drawing.Size(143, 6); + toolStripMenuItem16.Name = "toolStripMenuItem16"; + toolStripMenuItem16.Size = new System.Drawing.Size(143, 6); // // aboutToolStripMenuItem1 // - this.aboutToolStripMenuItem1.Name = "aboutToolStripMenuItem1"; - this.aboutToolStripMenuItem1.Size = new System.Drawing.Size(146, 22); - this.aboutToolStripMenuItem1.Text = "&About"; - this.aboutToolStripMenuItem1.Click += new System.EventHandler(this.aboutToolStripMenuItem1_Click); + aboutToolStripMenuItem1.Name = "aboutToolStripMenuItem1"; + aboutToolStripMenuItem1.Size = new System.Drawing.Size(146, 22); + aboutToolStripMenuItem1.Text = "&About"; + aboutToolStripMenuItem1.Click += aboutToolStripMenuItem1_Click; // // openFileDialog1 // - this.openFileDialog1.DefaultExt = "jsnx"; - this.openFileDialog1.Filter = "All supported files (*.jsnx;*.ryz)|*.jsnx;*.ryz|Bookmarks files (*.jsnx)|*.jsnx|B" + - "ookmarks files (*.ryz)|*.ryz"; - this.openFileDialog1.Title = "Open bookmarks file"; + openFileDialog1.DefaultExt = "jsnx"; + openFileDialog1.Filter = "All supported files|*.json;*.jsonfig;*.jsnx|Bookmark files (compressed)|*.jsnx|Bookmark files|*.json;*.jsonfig"; + openFileDialog1.Title = "Open bookmarks file"; // // rootContextMenu // - this.rootContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.addPageToolStripMenuItem, - this.addFolderToolStripMenuItem, - this.toolStripMenuItem2, - this.editToolStripMenuItem, - this.toolStripMenuItem3, - this.sortToolStripMenuItem}); - this.rootContextMenu.Name = "rootContextMenu"; - this.rootContextMenu.Size = new System.Drawing.Size(133, 104); + rootContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { addPageToolStripMenuItem, addFolderToolStripMenuItem, toolStripMenuItem2, editToolStripMenuItem, toolStripMenuItem3, sortToolStripMenuItem }); + rootContextMenu.Name = "rootContextMenu"; + rootContextMenu.Size = new System.Drawing.Size(133, 104); // // addPageToolStripMenuItem // - this.addPageToolStripMenuItem.Name = "addPageToolStripMenuItem"; - this.addPageToolStripMenuItem.Size = new System.Drawing.Size(132, 22); - this.addPageToolStripMenuItem.Text = "Add &Page"; - this.addPageToolStripMenuItem.Click += new System.EventHandler(this.addPageToolStripMenuItem_Click); + addPageToolStripMenuItem.Name = "addPageToolStripMenuItem"; + addPageToolStripMenuItem.Size = new System.Drawing.Size(132, 22); + addPageToolStripMenuItem.Text = "Add &Page"; + addPageToolStripMenuItem.Click += addPageToolStripMenuItem_Click; // // addFolderToolStripMenuItem // - this.addFolderToolStripMenuItem.Name = "addFolderToolStripMenuItem"; - this.addFolderToolStripMenuItem.Size = new System.Drawing.Size(132, 22); - this.addFolderToolStripMenuItem.Text = "Add &Folder"; - this.addFolderToolStripMenuItem.Click += new System.EventHandler(this.addFolderToolStripMenuItem_Click); + addFolderToolStripMenuItem.Name = "addFolderToolStripMenuItem"; + addFolderToolStripMenuItem.Size = new System.Drawing.Size(132, 22); + addFolderToolStripMenuItem.Text = "Add &Folder"; + addFolderToolStripMenuItem.Click += addFolderToolStripMenuItem_Click; // // toolStripMenuItem2 // - this.toolStripMenuItem2.Name = "toolStripMenuItem2"; - this.toolStripMenuItem2.Size = new System.Drawing.Size(129, 6); + toolStripMenuItem2.Name = "toolStripMenuItem2"; + toolStripMenuItem2.Size = new System.Drawing.Size(129, 6); // // editToolStripMenuItem // - this.editToolStripMenuItem.Name = "editToolStripMenuItem"; - this.editToolStripMenuItem.Size = new System.Drawing.Size(132, 22); - this.editToolStripMenuItem.Text = "&Edit"; - this.editToolStripMenuItem.Click += new System.EventHandler(this.editToolStripMenuItem_Click); + editToolStripMenuItem.Name = "editToolStripMenuItem"; + editToolStripMenuItem.Size = new System.Drawing.Size(132, 22); + editToolStripMenuItem.Text = "&Edit"; + editToolStripMenuItem.Click += editToolStripMenuItem_Click; // // toolStripMenuItem3 // - this.toolStripMenuItem3.Name = "toolStripMenuItem3"; - this.toolStripMenuItem3.Size = new System.Drawing.Size(129, 6); + toolStripMenuItem3.Name = "toolStripMenuItem3"; + toolStripMenuItem3.Size = new System.Drawing.Size(129, 6); // // sortToolStripMenuItem // - this.sortToolStripMenuItem.Name = "sortToolStripMenuItem"; - this.sortToolStripMenuItem.Size = new System.Drawing.Size(132, 22); - this.sortToolStripMenuItem.Text = "&Sort"; - this.sortToolStripMenuItem.Click += new System.EventHandler(this.sortToolStripMenuItem_Click); + sortToolStripMenuItem.Name = "sortToolStripMenuItem"; + sortToolStripMenuItem.Size = new System.Drawing.Size(132, 22); + sortToolStripMenuItem.Text = "&Sort"; + sortToolStripMenuItem.Click += sortToolStripMenuItem_Click; // // folderContextMenu // - this.folderContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.addPageToolStripMenuItem1, - this.addFolderToolStripMenuItem1, - this.toolStripMenuItem4, - this.openAllToolStripMenuItem, - this.editToolStripMenuItem1, - this.deleteToolStripMenuItem, - this.toolStripMenuItem5, - this.sortToolStripMenuItem1, - this.toolStripMenuItem6, - this.moveUpToolStripMenuItem, - this.moveDownToolStripMenuItem}); - this.folderContextMenu.Name = "folderContextMenu"; - this.folderContextMenu.Size = new System.Drawing.Size(139, 198); + folderContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { addPageToolStripMenuItem1, addFolderToolStripMenuItem1, toolStripMenuItem4, openAllToolStripMenuItem, editToolStripMenuItem1, deleteToolStripMenuItem, toolStripMenuItem5, sortToolStripMenuItem1, toolStripMenuItem6, moveUpToolStripMenuItem, moveDownToolStripMenuItem }); + folderContextMenu.Name = "folderContextMenu"; + folderContextMenu.Size = new System.Drawing.Size(139, 198); // // addPageToolStripMenuItem1 // - this.addPageToolStripMenuItem1.Name = "addPageToolStripMenuItem1"; - this.addPageToolStripMenuItem1.Size = new System.Drawing.Size(138, 22); - this.addPageToolStripMenuItem1.Text = "Add &Page"; - this.addPageToolStripMenuItem1.Click += new System.EventHandler(this.addPageToolStripMenuItem1_Click); + addPageToolStripMenuItem1.Name = "addPageToolStripMenuItem1"; + addPageToolStripMenuItem1.Size = new System.Drawing.Size(138, 22); + addPageToolStripMenuItem1.Text = "Add &Page"; + addPageToolStripMenuItem1.Click += addPageToolStripMenuItem1_Click; // // addFolderToolStripMenuItem1 // - this.addFolderToolStripMenuItem1.Name = "addFolderToolStripMenuItem1"; - this.addFolderToolStripMenuItem1.Size = new System.Drawing.Size(138, 22); - this.addFolderToolStripMenuItem1.Text = "Add &Folder"; - this.addFolderToolStripMenuItem1.Click += new System.EventHandler(this.addFolderToolStripMenuItem1_Click); + addFolderToolStripMenuItem1.Name = "addFolderToolStripMenuItem1"; + addFolderToolStripMenuItem1.Size = new System.Drawing.Size(138, 22); + addFolderToolStripMenuItem1.Text = "Add &Folder"; + addFolderToolStripMenuItem1.Click += addFolderToolStripMenuItem1_Click; // // toolStripMenuItem4 // - this.toolStripMenuItem4.Name = "toolStripMenuItem4"; - this.toolStripMenuItem4.Size = new System.Drawing.Size(135, 6); + toolStripMenuItem4.Name = "toolStripMenuItem4"; + toolStripMenuItem4.Size = new System.Drawing.Size(135, 6); // // openAllToolStripMenuItem // - this.openAllToolStripMenuItem.Image = global::BookmarkManager.AppResource.bookmark; - this.openAllToolStripMenuItem.Name = "openAllToolStripMenuItem"; - this.openAllToolStripMenuItem.Size = new System.Drawing.Size(138, 22); - this.openAllToolStripMenuItem.Text = "&Open All"; - this.openAllToolStripMenuItem.Click += new System.EventHandler(this.openAllToolStripMenuItem_Click); + openAllToolStripMenuItem.Image = BookmarkManager.AppResource.bookmark; + openAllToolStripMenuItem.Name = "openAllToolStripMenuItem"; + openAllToolStripMenuItem.Size = new System.Drawing.Size(138, 22); + openAllToolStripMenuItem.Text = "&Open All"; + openAllToolStripMenuItem.Click += openAllToolStripMenuItem_Click; // // editToolStripMenuItem1 // - this.editToolStripMenuItem1.Name = "editToolStripMenuItem1"; - this.editToolStripMenuItem1.Size = new System.Drawing.Size(138, 22); - this.editToolStripMenuItem1.Text = "&Edit"; - this.editToolStripMenuItem1.Click += new System.EventHandler(this.editToolStripMenuItem1_Click); + editToolStripMenuItem1.Name = "editToolStripMenuItem1"; + editToolStripMenuItem1.Size = new System.Drawing.Size(138, 22); + editToolStripMenuItem1.Text = "&Edit"; + editToolStripMenuItem1.Click += editToolStripMenuItem1_Click; // // deleteToolStripMenuItem // - this.deleteToolStripMenuItem.Image = global::BookmarkManager.AppResource.trash; - this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; - this.deleteToolStripMenuItem.Size = new System.Drawing.Size(138, 22); - this.deleteToolStripMenuItem.Text = "&Delete"; - this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); + deleteToolStripMenuItem.Image = BookmarkManager.AppResource.trash; + deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; + deleteToolStripMenuItem.Size = new System.Drawing.Size(138, 22); + deleteToolStripMenuItem.Text = "&Delete"; + deleteToolStripMenuItem.Click += deleteToolStripMenuItem_Click; // // toolStripMenuItem5 // - this.toolStripMenuItem5.Name = "toolStripMenuItem5"; - this.toolStripMenuItem5.Size = new System.Drawing.Size(135, 6); + toolStripMenuItem5.Name = "toolStripMenuItem5"; + toolStripMenuItem5.Size = new System.Drawing.Size(135, 6); // // sortToolStripMenuItem1 // - this.sortToolStripMenuItem1.Name = "sortToolStripMenuItem1"; - this.sortToolStripMenuItem1.Size = new System.Drawing.Size(138, 22); - this.sortToolStripMenuItem1.Text = "&Sort"; - this.sortToolStripMenuItem1.Click += new System.EventHandler(this.sortToolStripMenuItem1_Click); + sortToolStripMenuItem1.Name = "sortToolStripMenuItem1"; + sortToolStripMenuItem1.Size = new System.Drawing.Size(138, 22); + sortToolStripMenuItem1.Text = "&Sort"; + sortToolStripMenuItem1.Click += sortToolStripMenuItem1_Click; // // toolStripMenuItem6 // - this.toolStripMenuItem6.Name = "toolStripMenuItem6"; - this.toolStripMenuItem6.Size = new System.Drawing.Size(135, 6); + toolStripMenuItem6.Name = "toolStripMenuItem6"; + toolStripMenuItem6.Size = new System.Drawing.Size(135, 6); // // moveUpToolStripMenuItem // - this.moveUpToolStripMenuItem.Image = global::BookmarkManager.AppResource.arrow_up_circle; - this.moveUpToolStripMenuItem.Name = "moveUpToolStripMenuItem"; - this.moveUpToolStripMenuItem.Size = new System.Drawing.Size(138, 22); - this.moveUpToolStripMenuItem.Text = "Move &Up"; - this.moveUpToolStripMenuItem.Click += new System.EventHandler(this.moveUpToolStripMenuItem_Click); + moveUpToolStripMenuItem.Image = BookmarkManager.AppResource.arrow_up_circle; + moveUpToolStripMenuItem.Name = "moveUpToolStripMenuItem"; + moveUpToolStripMenuItem.Size = new System.Drawing.Size(138, 22); + moveUpToolStripMenuItem.Text = "Move &Up"; + moveUpToolStripMenuItem.Click += moveUpToolStripMenuItem_Click; // // moveDownToolStripMenuItem // - this.moveDownToolStripMenuItem.Image = global::BookmarkManager.AppResource.arrow_down_circle; - this.moveDownToolStripMenuItem.Name = "moveDownToolStripMenuItem"; - this.moveDownToolStripMenuItem.Size = new System.Drawing.Size(138, 22); - this.moveDownToolStripMenuItem.Text = "Move &Down"; - this.moveDownToolStripMenuItem.Click += new System.EventHandler(this.moveDownToolStripMenuItem_Click); + moveDownToolStripMenuItem.Image = BookmarkManager.AppResource.arrow_down_circle; + moveDownToolStripMenuItem.Name = "moveDownToolStripMenuItem"; + moveDownToolStripMenuItem.Size = new System.Drawing.Size(138, 22); + moveDownToolStripMenuItem.Text = "Move &Down"; + moveDownToolStripMenuItem.Click += moveDownToolStripMenuItem_Click; // // pageContextMenu // - this.pageContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.openToolStripMenuItem1, - this.toolStripMenuItem7, - this.editToolStripMenuItem2, - this.deleteToolStripMenuItem1, - this.toolStripMenuItem8, - this.moveUpToolStripMenuItem1, - this.moveDownToolStripMenuItem1}); - this.pageContextMenu.Name = "pageContextMenu"; - this.pageContextMenu.Size = new System.Drawing.Size(139, 126); + pageContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { openToolStripMenuItem1, toolStripMenuItem7, editToolStripMenuItem2, deleteToolStripMenuItem1, toolStripMenuItem8, moveUpToolStripMenuItem1, moveDownToolStripMenuItem1 }); + pageContextMenu.Name = "pageContextMenu"; + pageContextMenu.Size = new System.Drawing.Size(139, 126); // // openToolStripMenuItem1 // - this.openToolStripMenuItem1.Image = global::BookmarkManager.AppResource.bookmark; - this.openToolStripMenuItem1.Name = "openToolStripMenuItem1"; - this.openToolStripMenuItem1.Size = new System.Drawing.Size(138, 22); - this.openToolStripMenuItem1.Text = "&Open"; - this.openToolStripMenuItem1.Click += new System.EventHandler(this.openToolStripMenuItem1_Click); + openToolStripMenuItem1.Image = BookmarkManager.AppResource.bookmark; + openToolStripMenuItem1.Name = "openToolStripMenuItem1"; + openToolStripMenuItem1.Size = new System.Drawing.Size(138, 22); + openToolStripMenuItem1.Text = "&Open"; + openToolStripMenuItem1.Click += openToolStripMenuItem1_Click; // // toolStripMenuItem7 // - this.toolStripMenuItem7.Name = "toolStripMenuItem7"; - this.toolStripMenuItem7.Size = new System.Drawing.Size(135, 6); + toolStripMenuItem7.Name = "toolStripMenuItem7"; + toolStripMenuItem7.Size = new System.Drawing.Size(135, 6); // // editToolStripMenuItem2 // - this.editToolStripMenuItem2.Name = "editToolStripMenuItem2"; - this.editToolStripMenuItem2.Size = new System.Drawing.Size(138, 22); - this.editToolStripMenuItem2.Text = "&Edit"; - this.editToolStripMenuItem2.Click += new System.EventHandler(this.editToolStripMenuItem2_Click); + editToolStripMenuItem2.Name = "editToolStripMenuItem2"; + editToolStripMenuItem2.Size = new System.Drawing.Size(138, 22); + editToolStripMenuItem2.Text = "&Edit"; + editToolStripMenuItem2.Click += editToolStripMenuItem2_Click; // // deleteToolStripMenuItem1 // - this.deleteToolStripMenuItem1.Image = global::BookmarkManager.AppResource.trash; - this.deleteToolStripMenuItem1.Name = "deleteToolStripMenuItem1"; - this.deleteToolStripMenuItem1.Size = new System.Drawing.Size(138, 22); - this.deleteToolStripMenuItem1.Text = "&Delete"; - this.deleteToolStripMenuItem1.Click += new System.EventHandler(this.deleteToolStripMenuItem1_Click); + deleteToolStripMenuItem1.Image = BookmarkManager.AppResource.trash; + deleteToolStripMenuItem1.Name = "deleteToolStripMenuItem1"; + deleteToolStripMenuItem1.Size = new System.Drawing.Size(138, 22); + deleteToolStripMenuItem1.Text = "&Delete"; + deleteToolStripMenuItem1.Click += deleteToolStripMenuItem1_Click; // // toolStripMenuItem8 // - this.toolStripMenuItem8.Name = "toolStripMenuItem8"; - this.toolStripMenuItem8.Size = new System.Drawing.Size(135, 6); + toolStripMenuItem8.Name = "toolStripMenuItem8"; + toolStripMenuItem8.Size = new System.Drawing.Size(135, 6); // // moveUpToolStripMenuItem1 // - this.moveUpToolStripMenuItem1.Image = global::BookmarkManager.AppResource.arrow_up_circle; - this.moveUpToolStripMenuItem1.Name = "moveUpToolStripMenuItem1"; - this.moveUpToolStripMenuItem1.Size = new System.Drawing.Size(138, 22); - this.moveUpToolStripMenuItem1.Text = "Move &Up"; - this.moveUpToolStripMenuItem1.Click += new System.EventHandler(this.moveUpToolStripMenuItem1_Click); + moveUpToolStripMenuItem1.Image = BookmarkManager.AppResource.arrow_up_circle; + moveUpToolStripMenuItem1.Name = "moveUpToolStripMenuItem1"; + moveUpToolStripMenuItem1.Size = new System.Drawing.Size(138, 22); + moveUpToolStripMenuItem1.Text = "Move &Up"; + moveUpToolStripMenuItem1.Click += moveUpToolStripMenuItem1_Click; // // moveDownToolStripMenuItem1 // - this.moveDownToolStripMenuItem1.Image = global::BookmarkManager.AppResource.arrow_down_circle; - this.moveDownToolStripMenuItem1.Name = "moveDownToolStripMenuItem1"; - this.moveDownToolStripMenuItem1.Size = new System.Drawing.Size(138, 22); - this.moveDownToolStripMenuItem1.Text = "Move &Down"; - this.moveDownToolStripMenuItem1.Click += new System.EventHandler(this.moveDownToolStripMenuItem1_Click); - // - // toolStrip1 - // - this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripButton1, - this.toolStripButton2, - this.toolStripSeparator3, - this.toolStripButton3, - this.toolStripSeparator4, - this.toolStripButton4}); - this.toolStrip1.Location = new System.Drawing.Point(0, 24); - this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(300, 25); - this.toolStrip1.TabIndex = 4; - this.toolStrip1.Text = "toolStrip1"; - // - // toolStripButton1 - // - this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton1.Image = global::BookmarkManager.AppResource.file; - this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton1.Name = "toolStripButton1"; - this.toolStripButton1.Size = new System.Drawing.Size(23, 22); - this.toolStripButton1.Text = "toolStripButton1"; - this.toolStripButton1.ToolTipText = "New"; - this.toolStripButton1.Click += new System.EventHandler(this.newToolStripMenuItem_Click); - // - // toolStripButton2 - // - this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton2.Image = global::BookmarkManager.AppResource.folder; - this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton2.Name = "toolStripButton2"; - this.toolStripButton2.Size = new System.Drawing.Size(23, 22); - this.toolStripButton2.Text = "Open"; - this.toolStripButton2.Click += new System.EventHandler(this.openToolStripMenuItem_Click); - // - // toolStripSeparator3 - // - this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25); - // - // toolStripButton3 - // - this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton3.Image = global::BookmarkManager.AppResource.save; - this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton3.Name = "toolStripButton3"; - this.toolStripButton3.Size = new System.Drawing.Size(23, 22); - this.toolStripButton3.Text = "Save"; - this.toolStripButton3.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); - // - // toolStripSeparator4 - // - this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(6, 25); - // - // toolStripButton4 - // - this.toolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton4.Image = global::BookmarkManager.AppResource.search; - this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton4.Name = "toolStripButton4"; - this.toolStripButton4.Size = new System.Drawing.Size(23, 22); - this.toolStripButton4.Text = "Find"; - this.toolStripButton4.Click += new System.EventHandler(this.findToolStripMenuItem_Click); + moveDownToolStripMenuItem1.Image = BookmarkManager.AppResource.arrow_down_circle; + moveDownToolStripMenuItem1.Name = "moveDownToolStripMenuItem1"; + moveDownToolStripMenuItem1.Size = new System.Drawing.Size(138, 22); + moveDownToolStripMenuItem1.Text = "Move &Down"; + moveDownToolStripMenuItem1.Click += moveDownToolStripMenuItem1_Click; // // treeView1 // - this.treeView1.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill; - this.treeView1.Location = new System.Drawing.Point(0, 49); - this.treeView1.Name = "treeView1"; - this.treeView1.Size = new System.Drawing.Size(300, 531); - this.treeView1.TabIndex = 5; + treeView1.BorderStyle = System.Windows.Forms.BorderStyle.None; + 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; // // MainForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(250)))), ((int)(((byte)(250))))); - this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.ClientSize = new System.Drawing.Size(300, 580); - this.Controls.Add(this.treeView1); - this.Controls.Add(this.toolStrip1); - this.Controls.Add(this.menuStrip1); - this.DoubleBuffered = true; - this.ForeColor = System.Drawing.SystemColors.ControlText; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MainMenuStrip = this.menuStrip1; - this.Name = "MainForm"; - this.Text = "Bookmark Manager"; - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); - this.rootContextMenu.ResumeLayout(false); - this.folderContextMenu.ResumeLayout(false); - this.pageContextMenu.ResumeLayout(false); - this.toolStrip1.ResumeLayout(false); - this.toolStrip1.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); - + AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + BackColor = System.Drawing.Color.FromArgb(250, 250, 250); + BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + ClientSize = new System.Drawing.Size(300, 580); + Controls.Add(treeView1); + Controls.Add(menuStrip1); + DoubleBuffered = true; + ForeColor = System.Drawing.SystemColors.ControlText; + Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon"); + MainMenuStrip = menuStrip1; + Name = "MainForm"; + Text = "BukkuBuddy"; + menuStrip1.ResumeLayout(false); + menuStrip1.PerformLayout(); + rootContextMenu.ResumeLayout(false); + folderContextMenu.ResumeLayout(false); + pageContextMenu.ResumeLayout(false); + ResumeLayout(false); + PerformLayout(); } #endregion @@ -688,13 +562,6 @@ namespace FizzyLauncher private System.Windows.Forms.ToolStripMenuItem moveDownToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem9; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; - private System.Windows.Forms.ToolStrip toolStrip1; - private System.Windows.Forms.ToolStripButton toolStripButton1; - private System.Windows.Forms.ToolStripButton toolStripButton2; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; - private System.Windows.Forms.ToolStripButton toolStripButton3; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; - private System.Windows.Forms.ToolStripButton toolStripButton4; private RyzStudio.Windows.Forms.BookmarkTreeView treeView1; } } diff --git a/MainForm.cs b/MainForm.cs index b3cc9b3..6bbcc14 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -1,186 +1,121 @@ -using BookmarkManager; -using bzit.bomg.Models; -using FizzyLauncher.Models; -using Newtonsoft.Json; -using RyzStudio.Drawing; -using RyzStudio.Windows.Forms; -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; +using System.Drawing.Imaging; using System.IO; +using System.IO.Compression; using System.Linq; -using System.Reflection; -using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using BookmarkManager; +using BookmarkManager.Models; +using bzit.bomg.Models; +using FizzyLauncher.Models; +using RyzStudio; +using RyzStudio.Windows.Forms; +using RyzStudio.Windows.ThemedForms; namespace FizzyLauncher { public partial class MainForm : Form { - public enum AppMode - { - Clear = 0, - Open, - New - } + private readonly FileSessionManager _fileSessionManager; - - protected IconDatabase iconDatabase = null; - protected UpdateIconsForm updateIconsForm = null; - protected OptionsForm optionsForm = null; - protected FindForm findForm = null; - - protected AppMode appMode = AppMode.Clear; - protected string sessionFilename = null; - protected string sessionPassword = null; - protected bool isBusy = false; - - protected readonly string jsonfigFilename; + private bool _isBusy = false; public MainForm() { InitializeComponent(); - jsonfigFilename = Path.ChangeExtension(Application.ExecutablePath, "jsonfig"); + this.Text = Application.ProductName; - if (iconDatabase == null) iconDatabase = new IconDatabase(Path.ChangeExtension(Application.ExecutablePath, "db")); + _fileSessionManager = new FileSessionManager(); + _fileSessionManager.OpenFileDialog = openFileDialog1; + _fileSessionManager.SaveFileDialog = saveFileDialog1; + _fileSessionManager.OnNewing += fileSessionManager_OnNewSession; + _fileSessionManager.OnLoading += fileSessionManager_OnLoadSession; + _fileSessionManager.OnSaving += fileSessionManager_OnSaveSession; + _fileSessionManager.OnClearing += fileSessionManager_OnClearSession; + _fileSessionManager.OnFilenameChanged += fileSessionManager_OnFilenameChanged; this.AutoScaleMode = AutoScaleMode.None; this.StartPosition = FormStartPosition.WindowsDefaultLocation; - this.ClientSize = new System.Drawing.Size(300, 580); - //this.Visible = false; - treeView1.IconDatabase = iconDatabase; treeView1.RootContextMenu = rootContextMenu; treeView1.FolderContextMenu = folderContextMenu; treeView1.PageContextMenu = pageContextMenu; treeView1.NodeMouseDoubleClick += treeView1_NodeMouseDoubleClick; - treeView1.OnNodeChanged += treeView1_OnNodeChanged; treeView1.PreviewKeyDown += treeView1_PreviewKeyDown; } - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - - //ThreadControl.SetVisible(this, false); - UIControl.SetSize(this, 300, 580); - - List supportedFileExtensions = GetSupportedFileTypes(); - - openFileDialog1.Filter = BuildOpenFileSupportedFiles(supportedFileExtensions); - saveFileDialog1.Filter = BuildSaveFileSupportedFiles(supportedFileExtensions); - - ApplicationMode = AppMode.Clear; - } - protected async override void OnShown(EventArgs e) { base.OnShown(e); - //ThreadControl.SetVisible(this, false); + var args = WinApplication.GetCommandLine(); - await LoadAppSession(jsonfigFilename); + string jsonfigFilename = args.Where(x => (x.Key.Equals("o") || x.Key.Equals("open"))).Select(x => x.Value).FirstOrDefault(); + //if (string.IsNullOrWhiteSpace(jsonfigFilename)) + //{ + // jsonfigFilename = Path.ChangeExtension(Application.ExecutablePath, "jsonfig"); + //} - InvalidateAppSession(); - - string[] commandLineArgs = Environment.GetCommandLineArgs(); - - bool hasCommands = await LoadCommandLine(commandLineArgs); - if (!hasCommands) + if (!string.IsNullOrWhiteSpace(jsonfigFilename) && File.Exists(jsonfigFilename)) { - newToolStripMenuItem_Click(null, null); + await _fileSessionManager.OpenSession(jsonfigFilename); + } + else + { + this.CurrentSession = new AppOptions(); + + InvalidateOptions(); } } protected async override void OnClosing(CancelEventArgs e) { - e.Cancel = true; + base.OnClosing(e); - if (this.IsBusy) - { - return; - } - - this.IsBusy = true; - - Result result = await CloseFile(); - if (!result.IsSuccess) - { - if (!string.IsNullOrWhiteSpace(result.Message)) - { - MessageBox.Show(result.Message, "Close", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - - this.IsBusy = false; - - e.Cancel = true; - - return; - } - - sessionFilename = null; - sessionPassword = null; - - treeView1.Clear(); - iconDatabase?.Close(); - - ApplicationMode = AppMode.Clear; - - this.IsBusy = false; - - Application.Exit(); + await _fileSessionManager.CloseSession(); } - public AppSession CurrentSession { get; set; } = null; + public AppOptions CurrentSession { get; set; } = null; public bool IsBusy { - get => isBusy; + get => _isBusy; set { treeView1.Enabled = !value; } } - protected AppMode ApplicationMode + + private void InvalidateOptions() { - get => appMode; - set - { - appMode = value; + UIControl.SetTopMost(this, this.CurrentSession.AlwaysOnTop); + } - switch (value) - { - case AppMode.Clear: - UIControl.SetText(this, AppResource.app_name); + private void menuStrip1_MenuActivate(object sender, EventArgs e) + { + closeToolStripMenuItem.Enabled = (_fileSessionManager.SessionState != FileSessionManager.SessionStateEnum.Close); - UIControl.SetEnable(false, closeToolStripMenuItem, saveToolStripMenuItem, saveAsToolStripMenuItem, findToolStripMenuItem, toolStripMenuItem9, expandAllToolStripMenuItem, collapseAllToolStripMenuItem); - UIControl.SetEnable(false, toolStripButton3, toolStripButton4); - break; - case AppMode.Open: - UIControl.SetEnable(true, closeToolStripMenuItem, saveToolStripMenuItem, saveAsToolStripMenuItem, findToolStripMenuItem, toolStripMenuItem9, expandAllToolStripMenuItem, collapseAllToolStripMenuItem); - UIControl.SetEnable(true, toolStripButton3, toolStripButton4); - break; - case AppMode.New: - UIControl.SetText(this, AppResource.app_name); + saveToolStripMenuItem.Enabled = (_fileSessionManager.SessionState == FileSessionManager.SessionStateEnum.Open) && treeView1.HasChanged; + saveAsToolStripMenuItem.Enabled = (_fileSessionManager.SessionState != FileSessionManager.SessionStateEnum.Close); - UIControl.SetEnable(true, closeToolStripMenuItem, saveAsToolStripMenuItem, findToolStripMenuItem, toolStripMenuItem9, expandAllToolStripMenuItem, collapseAllToolStripMenuItem); - UIControl.SetEnable(saveToolStripMenuItem, false); - UIControl.SetEnable(toolStripButton3, false); - UIControl.SetEnable(toolStripButton4, true); + findToolStripMenuItem.Enabled = (_fileSessionManager.SessionState != FileSessionManager.SessionStateEnum.Close); - break; - default: break; - } - } + collapseAllToolStripMenuItem.Enabled = (_fileSessionManager.SessionState != FileSessionManager.SessionStateEnum.Close); + expandAllToolStripMenuItem.Enabled = (_fileSessionManager.SessionState != FileSessionManager.SessionStateEnum.Close); + alwaysOnTopToolStripMenuItem.Checked = this.CurrentSession?.AlwaysOnTop ?? false; + + toolStripMenuItem9.Enabled = (_fileSessionManager.SessionState != FileSessionManager.SessionStateEnum.Close); } -#region main menu + #region Main Menu /// /// New @@ -194,28 +129,7 @@ namespace FizzyLauncher return; } - this.IsBusy = true; - - Result result = await CloseFile(); - if (!result.IsSuccess) - { - if (!string.IsNullOrWhiteSpace(result.Message)) - { - MessageBox.Show(result.Message, "New Session", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - - this.IsBusy = false; - return; - } - - sessionFilename = null; - sessionPassword = null; - - treeView1.Clear("Untitled"); - - ApplicationMode = AppMode.New; - - this.IsBusy = false; + await _fileSessionManager.NewSession(); } /// @@ -230,34 +144,7 @@ namespace FizzyLauncher return; } - this.IsBusy = true; - - Result result = await CloseFile(); - if (!result.IsSuccess) - { - if (!string.IsNullOrWhiteSpace(result.Message)) - { - MessageBox.Show(result.Message, "Open File", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - - this.IsBusy = false; - return; - } - - if (openFileDialog1.ShowDialog() == DialogResult.OK) - { - result = await LoadFile(openFileDialog1.FileName); - if (result.IsSuccess) - { - UIControl.SetText(this, Path.GetFileNameWithoutExtension(openFileDialog1.FileName) + " - " + AppResource.app_name); - } - else - { - MessageBox.Show(result.Message, "Open File", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - - this.IsBusy = false; + await _fileSessionManager.OpenSession(); } /// @@ -272,28 +159,7 @@ namespace FizzyLauncher return; } - this.IsBusy = true; - - Result result = await CloseFile(); - if (!result.IsSuccess) - { - if (!string.IsNullOrWhiteSpace(result.Message)) - { - MessageBox.Show(result.Message, "Close File", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - - this.IsBusy = false; - return; - } - - sessionFilename = null; - sessionPassword = null; - - treeView1.Clear(); - - ApplicationMode = AppMode.Clear; - - this.IsBusy = false; + await _fileSessionManager.CloseSession(); } /// @@ -308,24 +174,7 @@ namespace FizzyLauncher return; } - if (ApplicationMode == AppMode.Clear) - { - return; - } - - this.IsBusy = true; - - Result result = await SaveFile(sessionFilename, sessionPassword); - if (result.IsSuccess) - { - MessageBox.Show("File saved!", "Save File", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - MessageBox.Show(result.Message, "Save File", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - - this.IsBusy = false; + await _fileSessionManager.SaveSession(); } /// @@ -340,28 +189,7 @@ namespace FizzyLauncher return; } - if (ApplicationMode == AppMode.Clear) - { - return; - } - - this.IsBusy = true; - - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - Result result = await SaveAsFile(saveFileDialog1.FileName); - if (result.IsSuccess) - { - MessageBox.Show("File saved!", "Save As File", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - MessageBox.Show(result.Message, "Save As File", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - - } - - this.IsBusy = false; + await _fileSessionManager.SaveAsSession(); } /// @@ -379,6 +207,7 @@ namespace FizzyLauncher this.Close(); } + /// /// Find /// @@ -391,8 +220,8 @@ namespace FizzyLauncher return; } - if (findForm == null) findForm = new FindForm(treeView1); - findForm.Show(); + var form = new FindForm(treeView1); + form.ShowDialog(); } @@ -403,8 +232,15 @@ namespace FizzyLauncher /// private void expandAllToolStripMenuItem_Click(object sender, EventArgs e) { - if (this.IsBusy) return; - if (ApplicationMode == AppMode.Clear) return; + if (this.IsBusy) + { + return; + } + + if (_fileSessionManager.SessionState == FileSessionManager.SessionStateEnum.Close) + { + return; + } if (treeView1.SelectedNode == null) { @@ -423,8 +259,15 @@ namespace FizzyLauncher /// private void collapseAllToolStripMenuItem_Click(object sender, EventArgs e) { - if (this.IsBusy) return; - if (ApplicationMode == AppMode.Clear) return; + if (this.IsBusy) + { + return; + } + + if (_fileSessionManager.SessionState == FileSessionManager.SessionStateEnum.Close) + { + return; + } if (treeView1.SelectedNode == null) { @@ -443,9 +286,14 @@ namespace FizzyLauncher /// private void alwaysOnTopToolStripMenuItem_Click(object sender, EventArgs e) { - this.TopMost = !this.TopMost; + if (this.CurrentSession == null) + { + return; + } - alwaysOnTopToolStripMenuItem.Checked = this.TopMost; + this.CurrentSession.AlwaysOnTop = !this.CurrentSession.AlwaysOnTop; + + this.TopMost = this.CurrentSession.AlwaysOnTop; } @@ -461,8 +309,8 @@ namespace FizzyLauncher return; } - if (updateIconsForm == null) updateIconsForm = new UpdateIconsForm(this.CurrentSession, treeView1, iconDatabase); - updateIconsForm.ShowDialog(); + var form = new UpdateIconsForm(treeView1); + form.ShowDialog(); } /// @@ -470,20 +318,20 @@ namespace FizzyLauncher /// /// /// - private async void optionsToolStripMenuItem_Click(object sender, EventArgs e) + private void optionsToolStripMenuItem_Click(object sender, EventArgs e) { if (this.IsBusy) { return; } - if (optionsForm == null) optionsForm = new OptionsForm(this); - if (optionsForm.ShowDialog() == DialogResult.OK) + var form = new OptionsForm(this.CurrentSession); + if (form.ShowDialog() == DialogResult.OK) { - await SaveAppSession(jsonfigFilename); - } + this.CurrentSession = form.Result; - InvalidateAppSession(); + InvalidateOptions(); + } } @@ -494,14 +342,7 @@ namespace FizzyLauncher /// private void viewHelpToolStripMenuItem1_Click(object sender, EventArgs e) { - try - { - System.Diagnostics.Process.Start("https://www.hiimray.co.uk/software-bookmark-manager"); - } - catch - { - // do nothing - } + RyzStudio.Diagnostics.Process.Execute(AppResource.AppHelpURL); } /// @@ -511,12 +352,19 @@ namespace FizzyLauncher /// private void aboutToolStripMenuItem1_Click(object sender, EventArgs e) { - MessageBox.Show(Application.ProductName + " v" + Application.ProductVersion, "About", MessageBoxButtons.OK, MessageBoxIcon.Information); + var form = new RyzStudio.Windows.ThemedForms.AboutForm(); + form.ProductURL = AppResource.AppProductURL; + form.AuthorURL = AppResource.AppAuthorURL; + form.CompanyURL = AppResource.AppCompanyURL; + form.ProductCopyrightStartYear = 2012; + form.ProductLogo = AppResource.icon_64; + + form.ShowDialog(); } -#endregion + #endregion -#region context menu + #region Context Menu - Root /// /// Add page @@ -530,25 +378,11 @@ namespace FizzyLauncher return; } - if (treeView1.GetNodeType() == BookmarkTreeView.NodeType.Page) + var nodeType = treeView1.GetNodeType(); + if ((nodeType == BookmarkTreeView.NodeType.Root) || (nodeType == BookmarkTreeView.NodeType.Folder)) { - return; + treeView1.AddNode(); } - - if (treeView1.SelectedNode == null) - { - return; - } - - // add placeholder - TreeNode node = treeView1.AddItem(treeView1.SelectedNode, new BookmarkItem() - { - SiteName = "New Bookmark" - }); - node.EnsureVisible(); - treeView1.SelectedNode = node; - - UpdateBookmarkNode(true); } /// @@ -556,36 +390,73 @@ namespace FizzyLauncher /// /// /// - private void addFolderToolStripMenuItem_Click(object sender, EventArgs e) => treeView1.AddFolder(); + private void addFolderToolStripMenuItem_Click(object sender, EventArgs e) + { + if (this.IsBusy) + { + return; + } + + var nodeType = treeView1.GetNodeType(); + if ((nodeType == BookmarkTreeView.NodeType.Root) || (nodeType == BookmarkTreeView.NodeType.Folder)) + { + treeView1.AddFolder(); + } + } /// /// Edit root node /// /// /// - private void editToolStripMenuItem_Click(object sender, EventArgs e) => treeView1.EditNode(); + private void editToolStripMenuItem_Click(object sender, EventArgs e) + { + if (this.IsBusy) + { + return; + } + + treeView1.EditNode(); + } /// /// Sort /// /// /// - private void sortToolStripMenuItem_Click(object sender, EventArgs e) => treeView1.Sort(); + private void sortToolStripMenuItem_Click(object sender, EventArgs e) + { + if (this.IsBusy) + { + return; + } + treeView1.Sort(); + } + + #endregion + + #region Context Menu - Folder /// /// Add page /// /// /// - private void addPageToolStripMenuItem1_Click(object sender, EventArgs e) => addPageToolStripMenuItem_Click(sender, e); + private void addPageToolStripMenuItem1_Click(object sender, EventArgs e) + { + addPageToolStripMenuItem_Click(sender, e); + } /// /// Add folder /// /// /// - private void addFolderToolStripMenuItem1_Click(object sender, EventArgs e) => treeView1.AddFolder(); + private void addFolderToolStripMenuItem1_Click(object sender, EventArgs e) + { + addFolderToolStripMenuItem_Click(sender, e); + } /// /// Open all pages @@ -620,43 +491,82 @@ namespace FizzyLauncher /// /// /// - private void editToolStripMenuItem1_Click(object sender, EventArgs e) => treeView1.EditNode(); + private void editToolStripMenuItem1_Click(object sender, EventArgs e) + { + editToolStripMenuItem_Click(sender, e); + } /// - /// Delete folder and contents + /// Delete folder /// /// /// - private void deleteToolStripMenuItem_Click(object sender, EventArgs e) => treeView1.DeleteNode(); + private void deleteToolStripMenuItem_Click(object sender, EventArgs e) + { + if (this.IsBusy) + { + return; + } + + if (MessageBox.Show("Delete?", "Delete?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes) + { + treeView1.DeleteNode(); + } + } /// /// Sort children /// /// /// - private void sortToolStripMenuItem1_Click(object sender, EventArgs e) => treeView1.Sort(); + private void sortToolStripMenuItem1_Click(object sender, EventArgs e) + { + sortToolStripMenuItem_Click(sender, e); + } /// /// Move up /// /// /// - private void moveUpToolStripMenuItem_Click(object sender, EventArgs e) => treeView1.MoveUp(); + private void moveUpToolStripMenuItem_Click(object sender, EventArgs e) + { + if (this.IsBusy) + { + return; + } + + treeView1.MoveUp(); + } /// /// Move down /// /// /// - private void moveDownToolStripMenuItem_Click(object sender, EventArgs e) => treeView1.MoveDown(); + private void moveDownToolStripMenuItem_Click(object sender, EventArgs e) + { + if (this.IsBusy) + { + return; + } + treeView1.MoveDown(); + } + + #endregion + + #region Context Menu - Bookmark /// /// Open page /// /// /// - private async void openToolStripMenuItem1_Click(object sender, EventArgs e) => await OpenBookmark(treeView1.SelectedNode); + private async void openToolStripMenuItem1_Click(object sender, EventArgs e) + { + await OpenBookmark(treeView1.SelectedNode); + } /// /// Edit page @@ -665,16 +575,7 @@ namespace FizzyLauncher /// private void editToolStripMenuItem2_Click(object sender, EventArgs e) { - if (this.IsBusy) - { - return; - } - - BookmarkTreeView.NodeType nodeType = treeView1.GetNodeType(); - if (nodeType == BookmarkTreeView.NodeType.Page) - { - UpdateBookmarkNode(false); - } + editToolStripMenuItem_Click(sender, e); } /// @@ -682,29 +583,266 @@ namespace FizzyLauncher /// /// /// - private void deleteToolStripMenuItem1_Click(object sender, EventArgs e) => treeView1.DeleteNode(); + private void deleteToolStripMenuItem1_Click(object sender, EventArgs e) + { + deleteToolStripMenuItem_Click(sender, e); + } /// /// Move up /// /// /// - private void moveUpToolStripMenuItem1_Click(object sender, EventArgs e) => treeView1.MoveUp(); + private void moveUpToolStripMenuItem1_Click(object sender, EventArgs e) + { + moveUpToolStripMenuItem_Click(sender, e); + } /// /// Move down /// /// /// - private void moveDownToolStripMenuItem1_Click(object sender, EventArgs e) => treeView1.MoveDown(); + private void moveDownToolStripMenuItem1_Click(object sender, EventArgs e) + { + moveDownToolStripMenuItem_Click(sender, e); + } -#endregion + #endregion + #region File Session Manager + + private async Task fileSessionManager_OnNewSession(FileSessionManager sender) + { + return await Task.Run(() => + { + treeView1.Clear("New Session"); + + if (treeView1.Nodes.Count >= 0) + { + UIControl.Invoke(treeView1, (x) => + { + treeView1.Nodes[0].Expand(); + + treeView1.SelectedNode = treeView1.Nodes[0]; + }); + } + + UIControl.SetFocus(treeView1); + + return true; + }); + } + + private async Task fileSessionManager_OnLoadSession(FileSessionManager sender, string filename, int formatType) + { + return await Task.Run(async () => + { + var result = GenericResult.Create(); + + switch (Path.GetExtension(filename?.ToLower()?.Trim() ?? string.Empty)) + { + case ".json": + this.CurrentSession = RyzStudio.Text.Json.JsonSerialiser.DeserialiseFile(filename); + + if (this.CurrentSession == null) + { + this.CurrentSession = LoadR4SaveFile(filename); + } + + break; + case ".jsnx": + this.CurrentSession = await RyzStudio.IO.Compression.ZFile.ReadFile(filename, "Document.json"); + + if (this.CurrentSession == null) + { + this.CurrentSession = new AppOptions(); + } + + // Load icons + this.CurrentSession = await LoadIconsFromZipFile(filename, this.CurrentSession); + + break; + default: + this.CurrentSession = null; + break; + } + + if (this.CurrentSession == null) + { + ThMessageBox.Show(this, "Unable to read session", "Load session", MessageBoxButtons.OK, MessageBoxIcon.Error); + + return false; + } + + if (this.CurrentSession == null) + { + this.CurrentSession = new AppOptions(); + } + + // Reposition + resize + if (!this.CurrentSession.StartPosition.IsEmpty) + { + UIControl.SetLocation(this, this.CurrentSession.StartPosition); + } + + if (this.CurrentSession.Height > 0) + { + UIControl.SetHeight(this, this.CurrentSession.Height); + } + + if (this.CurrentSession.Width > 0) + { + UIControl.SetWidth(this, this.CurrentSession.Width); + } + + InvalidateOptions(); + + // Load items + treeView1.Clear("New Session"); + + foreach (var item in this.CurrentSession.Items ?? new List()) + { + treeView1.AddNode(item); + } + + if (treeView1.Nodes.Count >= 0) + { + UIControl.Invoke(treeView1, (x) => + { + treeView1.Nodes[0].Expand(); + + treeView1.SelectedNode = treeView1.Nodes[0]; + }); + } + + UIControl.SetFocus(treeView1); + + return true; + }); + } + + private async Task fileSessionManager_OnSaveSession(FileSessionManager sender, string filename, int formatType, bool showNotices) + { + if (string.IsNullOrWhiteSpace(filename)) + { + return false; + } + + return await Task.Run(async () => + { + if (_isBusy) + { + return false; + } + + _isBusy = true; + + // update session + if (this.CurrentSession == null) + { + this.CurrentSession = new AppOptions(); + } + + this.CurrentSession.StartPosition = this.Location; + this.CurrentSession.Width = this.Width; + this.CurrentSession.Height = this.Height; + + var nodeList = treeView1.ToNodeList() ?? new List>(); + + this.CurrentSession.Items = nodeList.Select(x => x.Value).ToList(); + + var result = GenericResult.Create(); + + switch (Path.GetExtension(filename?.ToLower()?.Trim() ?? string.Empty)) + { + case ".json": + case ".jsonfig": + result = RyzStudio.Text.Json.JsonSerialiser.SerialiseFile(filename, this.CurrentSession); + break; + case ".jsnx": + result = await RyzStudio.IO.Compression.ZFile.WriteFile(filename, "Document.json", this.CurrentSession); + + if (result.IsSuccess) + { + // Add icons to save file + var result2 = AddImagesToZipFile(filename, this.CurrentSession.Items); + if (!result2.IsSuccess) + { + if (showNotices) + { + ThMessageBox.Show(this, "Unable to save icons", "Save session", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + + break; + default: + result = GenericResult.Fault("Format not supported"); + break; + } + + if (result.IsSuccess) + { + if (showNotices) + { + ThMessageBox.Show(this, "Session saved!", "Save session", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } + else + { + if (showNotices) + { + ThMessageBox.Show(this, result.Message, "Save session"); + } + } + + _isBusy = false; + + return result.IsSuccess; + }); + } + + private async Task fileSessionManager_OnClearSession(FileSessionManager sender) + { + return await Task.Run(() => + { + UIControl.Clear(treeView1); + + return true; + }); + } + + private async Task fileSessionManager_OnFilenameChanged(FileSessionManager sender, string filename) + { + await Task.Run(() => + { + switch (sender.SessionState) + { + case FileSessionManager.SessionStateEnum.New: + UIControl.SetText(this, "New Session - " + Application.ProductName); + break; + case FileSessionManager.SessionStateEnum.Open: + UIControl.SetText(this, Path.GetFileNameWithoutExtension(filename) + " - " + Application.ProductName); + break; + case FileSessionManager.SessionStateEnum.Close: + UIControl.SetText(this, Application.ProductName); + break; + default: + break; + } + + treeView1.HasChanged = false; + }); + } + + #endregion + private async void treeView1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { - TreeNode tn = treeView1.SelectedNode; - if (tn == null) + TreeNode node = treeView1.SelectedNode; + if (node == null) { return; } @@ -714,495 +852,180 @@ namespace FizzyLauncher switch (e.KeyCode) { case Keys.Enter: - await OpenBookmark(tn); + await OpenBookmark(node); break; - case Keys.F2: - editToolStripMenuItem2_Click(sender, null); + default: break; - case Keys.Insert: - if (e.Modifiers != Keys.Shift) - { - if ((nodeType == BookmarkTreeView.NodeType.Root) || (nodeType == BookmarkTreeView.NodeType.Folder)) - { - // do nothing - } - else if (nodeType == BookmarkTreeView.NodeType.Page) - { - treeView1.SelectedNode = tn.Parent; - } - - addPageToolStripMenuItem_Click(sender, null); - } - - break; - default: break; } } - private async void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) => await OpenBookmark(e.Node); - - private void treeView1_OnNodeChanged(object sender, EventArgs e) + private async void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { - bool state = (treeView1.HasChanged && ApplicationMode == AppMode.Open); - - UIControl.SetEnable(saveToolStripMenuItem, state); - UIControl.SetEnable(toolStripButton3, state); + await OpenBookmark(e.Node); } - protected string BuildOpenFileSupportedFiles(List supportList) - { - StringBuilder rs = new StringBuilder(); - rs.Append("All supported files (*" + string.Join("; *", supportList) + ")"); - rs.Append("|*" + string.Join(";*", supportList)); - for (int i = 0; i < supportList.Count; i++) + private AppOptions LoadR4SaveFile(string filename) + { + var session = RyzStudio.Text.Json.JsonSerialiser.DeserialiseFile>(filename); + if (session == null) { - rs.Append("|" + supportList[i].TrimStart('.')?.ToUpper() + " Bookmark files"); - rs.Append("|*" + supportList[i]); + return null; } - return rs.ToString(); - } + var result = new AppOptions(); + result.Items = new List(); - protected string BuildSaveFileSupportedFiles(List supportList) - { - StringBuilder rs = new StringBuilder(); - - for (int i = 0; i < supportList.Count; i++) + foreach (var item in session) { - if (i > 0) rs.Append("|"); - - rs.Append(supportList[i].TrimStart('.')?.ToUpper() + " Bookmark file"); - rs.Append("|*" + supportList[i]); + result.Items.Add(new BookmarkModel() + { + Title = item.SiteName, + Address = item.SiteAddress, + Description = item.SiteDescription, + Notes = item.Notes, + Path = item.Path + }); } - return rs.ToString(); + return result; } - protected async Task CloseFile() + private async Task LoadIconsFromZipFile(string filename, AppOptions session) { - return await Task.Run(async () => + if (string.IsNullOrWhiteSpace(filename)) { - if (this.ApplicationMode == AppMode.Clear) - { - return Result.Create(true); - } - - if (!treeView1.HasChanged) - { - return Result.Create(true); - } - - if (this.ApplicationMode == AppMode.New) - { - DialogResult response = MessageBox.Show("Save bookmarks", "Save?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); - if (response == DialogResult.Yes) - { - Result result = await SaveAsFile(sessionFilename); - if (!result.IsSuccess) - { - return Result.Create(false, result.Message); - } - } - else if (response == DialogResult.Cancel) - { - return Result.Create(false, ""); - } - } - else if (this.ApplicationMode == AppMode.Open) - { - DialogResult response = MessageBox.Show("Save changes to open bookmarks", "Save?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); - if (response == DialogResult.Yes) - { - Result result = await SaveFile(sessionFilename, sessionPassword); - if (!result.IsSuccess) - { - return Result.Create(false, result.Message); - } - } - else if (response == DialogResult.Cancel) - { - return Result.Create(false, ""); - } - } - - return Result.Create(true); - }); - } - - protected SupportedFileBase GetSupportedFileHandler(string filename) - { - SupportedFileBase rs = null; - - List typeList = Assembly.GetExecutingAssembly().GetTypes().Where(x => x.IsSubclassOf(typeof(SupportedFileBase))).ToList(); - foreach (Type t in typeList) - { - rs = (SupportedFileBase)Activator.CreateInstance(t); - if (rs == null) - { - continue; - } - - if (rs.IsSupported(filename)) - { - break; - } - - rs = null; + return session; } - return rs; - } - - protected List GetSupportedFileTypes() - { - List rs = new List(); - - List typeList = Assembly.GetExecutingAssembly().GetTypes().Where(x => x.IsSubclassOf(typeof(SupportedFileBase))).ToList(); - foreach (Type t in typeList) - { - SupportedFileBase fileHandler = (SupportedFileBase)Activator.CreateInstance(t); - if (fileHandler == null) - { - continue; - } - - rs.AddRange(fileHandler.SupportedExtensions ?? new List()); - } - - return rs; - } - - protected void InvalidateAppSession() - { - if (CurrentSession == null) CurrentSession = new AppSession(); - - if (CurrentSession.EnableAutoPosition) - { - this.Height = Screen.PrimaryScreen.WorkingArea.Height; - this.Location = Screen.PrimaryScreen.WorkingArea.Location; - } - - toolStrip1.Visible = CurrentSession.ShowToolbar; - - this.TopMost = CurrentSession.AlwaysOnTop; - } - - protected async Task LoadAppSession(string filename) - { return await Task.Run(() => { - if (File.Exists(filename)) - { - string sourceCode = null; - - try - { - sourceCode = File.ReadAllText(filename); - } - catch (Exception) - { - // do nothing - } - - if (string.IsNullOrWhiteSpace(sourceCode)) - { - this.CurrentSession = new AppSession(); - return false; - } - - try - { - this.CurrentSession = JsonConvert.DeserializeObject(sourceCode); - } - catch (Exception) - { - this.CurrentSession = null; - } - - if (this.CurrentSession == null) - { - this.CurrentSession = new AppSession(); - return false; - } - } - else - { - this.CurrentSession = new AppSession(); - - try - { - File.WriteAllText(filename, JsonConvert.SerializeObject(this.CurrentSession)); - } - catch (Exception) - { - // do nothing - } - } - - return true; - }); - } - - protected async Task LoadCommandLine(string[] args) - { - bool rs = false; - - if (args.Length > 1) - { - int i = 1; - while (true) - { - if (i > (args.Length - 1)) - { - break; - } - - switch (args[i].Trim().ToLower()) - { - case "-o": - case "-open": - if ((i + 1) > (args.Length - 1)) break; - - string openFilename = args[(i + 1)]; - if (string.IsNullOrWhiteSpace(openFilename)) break; - if (!File.Exists(openFilename)) break; - - await LoadFile(openFilename); - - //LoadBookmarksForm loadFileForm = new LoadBookmarksForm(this, openFilename); - //loadFileForm.ShowDialog(); - - rs = true; - - i++; - break; - } - - i++; - } - } - - return rs; - } - - protected async Task LoadFile(string filename) - { - return await Task.Run(() => - { - sessionFilename = null; - sessionPassword = null; - ApplicationMode = AppMode.Clear; - - treeView1.Clear(); - - if (string.IsNullOrWhiteSpace(filename)) - { - return Result.Create(false, "Filename is empty"); - } - - if (!File.Exists(filename)) - { - return Result.Create(false, "File not found"); - } - - sessionFilename = filename; - - SupportedFileBase fileHandler = GetSupportedFileHandler(sessionFilename); - if (fileHandler == null) - { - return Result.Create(false, "Handler not found for this file type"); - } - - if (fileHandler.IsEncrypted(sessionFilename)) - { - PasswordForm passwordForm = new PasswordForm(); - if (passwordForm.ShowDialog() == DialogResult.OK) - { - sessionPassword = passwordForm.Password; - } - } - - Result result = fileHandler.Load(treeView1, sessionFilename, sessionPassword); - if (!result.IsSuccess) - { - return result; - } - - if (treeView1.Nodes.Count > 0) - { - UIControl.Expand(treeView1.Nodes[0]); - } - - ApplicationMode = AppMode.Open; - - if (result.IsSuccess) - { - treeView1.SetNoChanges(); - } - - UIControl.SetFocus(treeView1); - - return result; - }); - } - - protected async Task OpenBookmark(TreeNode node) - { - await Task.Run(() => - { - if (BookmarkTreeView.GetNodeType(node) != BookmarkTreeView.NodeType.Page) - { - return; - } - - BookmarkItem viewModel = (BookmarkItem)node.Tag; - if (viewModel == null) - { - return; - } - - if (string.IsNullOrWhiteSpace(viewModel.SiteAddress)) - { - return; - } - - string cmd = (string.IsNullOrWhiteSpace(CurrentSession.RunCommand) ? viewModel.SiteAddress : CurrentSession.RunCommand.Replace("{0}", viewModel.SiteAddress)); - try { - System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo + using (var archive = ZipFile.Open(filename, ZipArchiveMode.Read)) { - FileName = cmd, - UseShellExecute = true - }; - System.Diagnostics.Process.Start(psi); - } - catch (Exception exc) - { -#if DEBUG - MessageBox.Show(exc.Message); -#endif - } - }); - } + foreach (var item in session.Items) + { + if (item.Id == Guid.Empty) + { + continue; + } - protected async Task SaveFile(string filename, string password = null) - { - return await Task.Run(() => - { - if (string.IsNullOrWhiteSpace(filename)) - { - return Result.Create(false, "Filename is empty"); - } + var key = "icon\\" + item.Id.ToString() + ".png"; - SupportedFileBase fileHandler = GetSupportedFileHandler(filename); - if (fileHandler == null) - { - return Result.Create(false, "Handler not found for this file type"); - } + var zipEntry = archive.GetEntry(key); + if (zipEntry == null) + { + continue; + } - Result result = fileHandler.Save(treeView1, filename, password); - if (result.IsSuccess) - { - treeView1.SetNoChanges(); - } - - return result; - }); - } - - protected async Task SaveAppSession(string filename) - { - return await Task.Run(() => - { - if (this.CurrentSession == null) this.CurrentSession = new AppSession(); - - try - { - File.WriteAllText(filename, JsonConvert.SerializeObject(this.CurrentSession)); + using (Stream entryStream = zipEntry.Open()) + { + item.Icon = Image.FromStream(entryStream); + } + } + } } catch (Exception) { - return false; + // do nothing } - return true; + return session; }); } - protected async Task SaveAsFile(string filename) + private async Task OpenBookmark(TreeNode node) { - return await Task.Run(() => + await Task.Run(() => { - if (string.IsNullOrWhiteSpace(filename)) + if (treeView1.GetNodeType(node) != BookmarkTreeView.NodeType.Page) { - return Result.Create(false, "Filename is empty"); + return; } - SupportedFileBase fileHandler = GetSupportedFileHandler(filename); - if (fileHandler == null) + var model = UIControl.GetTag(node); + if (model == null) { - return Result.Create(false, "Handler not found for this file type"); + return; } - string password = null; - - if (fileHandler.IsEncryptionSupported) + if (string.IsNullOrWhiteSpace(model.Address)) { - PasswordForm passwordForm = new PasswordForm(); - if (passwordForm.ShowDialog() == DialogResult.OK) + return; + } + + string cmd = (string.IsNullOrWhiteSpace(CurrentSession.RunCommand) ? model.Address : CurrentSession.RunCommand.Replace("{0}", model.Address)); + + RyzStudio.Diagnostics.Process.Execute(cmd); + }); + } + + private GenericResult AddImagesToZipFile(string zipFilename, List items) + { + if (string.IsNullOrWhiteSpace(zipFilename)) + { + return GenericResult.Fault("Filename is blank"); + } + + var path = Path.GetDirectoryName(zipFilename); + if (!System.IO.Directory.Exists(path)) + { + try + { + System.IO.Directory.CreateDirectory(path); + } + catch (Exception exc) + { + return GenericResult.Fault(exc.Message); + } + } + + var options = RyzStudio.Text.Json.JsonSerialiser.GetPreferredOptions(); + + try + { + using (var archive = ZipFile.Open(zipFilename, ZipArchiveMode.Update)) + { + foreach (var item in items) { - if (!string.IsNullOrWhiteSpace(passwordForm.Password)) + var key = "icon\\" + item.Id.ToString() + ".png"; + var zipEntry = archive.GetEntry(key); + if (zipEntry != null) { - password = passwordForm.Password; + zipEntry.Delete(); + } + + if (item.Icon == null) + { + continue; + } + + zipEntry = archive.CreateEntry(key, CompressionLevel.SmallestSize); + + try + { + using (Stream entryStream = zipEntry.Open()) + { + using (Image image = item.Icon) + { + image.Save(entryStream, ImageFormat.Png); + } + } + } + catch (Exception) + { + continue; } } } - - Result result = fileHandler.Save(treeView1, filename, password); - if (result.IsSuccess) - { - this.ApplicationMode = AppMode.Open; - sessionFilename = filename; - sessionPassword = password; - - treeView1.SetNoChanges(); - } - - return result; - }); - } - - protected void UpdateBookmarkNode(bool deleteOnCancel) - { - BookmarkItem model = treeView1.GetNodeModel(); - Image icon = null; - - // retrieve icon from DB - string iconID = model?.ToHash(); - - icon = iconDatabase.FindIcon(iconID); - - BookmarkForm bookmarkForm = new BookmarkForm(this.CurrentSession, model, icon); - if (bookmarkForm.ShowDialog() == DialogResult.OK) - { - //string iconID = bookmarkForm.Model.Item?.ToHash(); - iconID = bookmarkForm.Model.Item?.ToHash(); - if (!string.IsNullOrWhiteSpace(iconID)) - { - iconDatabase.AddIcon(iconID, bookmarkForm.Model.Icon); - } - - treeView1.UpdateItem(treeView1.SelectedNode, bookmarkForm.Model.Item); } - else + catch (Exception exc) { - if (deleteOnCancel) - { - treeView1.SelectedNode.Remove(); - } + return GenericResult.Fault(exc.Message); } + + return GenericResult.Create(); } } diff --git a/MainForm.resx b/MainForm.resx index f254feb..845d051 100644 --- a/MainForm.resx +++ b/MainForm.resx @@ -1,4 +1,64 @@ - + + + @@ -75,305 +135,302 @@ 1137, 17 - - 1290, 17 - AAABAAQAMDAAAAEAIACoJQAARgAAACAgAAABACAAqBAAAO4lAAAYGAAAAQAgAIgJAACWNgAAEBAAAAEA IABoBAAAHkAAACgAAAAwAAAAYAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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ERH/qamp//////////////////////+qqqr/AAAA/xYZ - Gf/Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//m6+v/zMzM/8yMjJgAAAAAAAA - AAA5OTkJNDQ0+nR8fP/d8/T/3fPz/93z8//c8vP/3PLz/9zy8//c8vP/3PLz/9zy8//c8vP/0+/w/9Du - 7/8WGRn/AAAA/6qqqv////////////////////////////Ly8v/y8vL///////////////////////// - //+qqqr/AAAA/xYZGf/Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//wNvc/zMz - M/8zMzObAAAAAAAAAAAAAAAAMzMzyEZISP3d8vP/3fPz/93z8//c8vP/3PLz/9zy8//c8vP/3PLz/9zy - 8//c8vP/0u/w/9Du7/8WGRn/AAAA/6qqqv////////////////////////////////////////////// - //////////////////+qqqr/AAAA/xYZGf/Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//0O7v/9Du - 7//Q7u//0O7v/0ZKSv40NDTYAAAAAAAAAAAAAAAAMzMzjTMzM//K3N3/3fPz/93z8//c8vP/3PLz/9zy - 8//c8vP/3PLz/9zy8//c8vP/0e7v/9Du7/8WGRn/AAAA/6qqqv////////////////////////////// - //////////////////////////////////+qqqr/AAAA/xYZGf/Q7u//0O7v/9Du7//Q7u//0O7v/9Du - 7//Q7u//0O7v/9Du7//Q7u//0O7v/2x3d/8zMzP+Li4uFgAAAAAAAAAAMjIyUjMzM/+ntbX/3fPz/93z - 8//c8vP/3PLz/9zy8//c8vP/3PLz/9zy8//c8vP/0O7v/9Du7/8WGRn/AAAA/6qqqv////////////// - //////////////////////////////////////////////////+qqqr/AAAA/xYZGf/Q7u//0O7v/9Du - 7//Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//0O7v/5Gjo/8zMzP/MzMzUAAAAAAAAAAAMTExFTMz - M/5/iYn/3fPz/93z8//d8/P/3PLz/9zy8//c8vP/3PLz/9zy8//b8vP/0O7v/9Du7/8WGRn/AAAA/6qq - qv////////////////////////////////////////////////////////////////+qqqr/AAAA/xYZ - Gf/Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//0O7v/7bP0P8zMzP/MzMziwAA - AAAAAAAAAAAAADMzM9pRVVX+3fP0/93z8//d8/P/3PLz/9zy8//c8vP/3PLz/9zy8//c8vP/0O7v/9Du - 7/8WGRn/AAAA/6qqqv////////////////////////////////////////////////////////////// - //+qqqr/AAAA/xYZGf/Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//0O7v/8/t - 7v89Pj/+NDQ0xgAAAAAAAAAAAAAAADIyMp0zMzP/0eXm/93z8//d8/P/3PLz/9zy8//c8vP/3PLz/9zy - 8//c8vP/0e7v/9Du7/8WGRn/AAAA/6qqqv////////////////////////////////////////////// - //////////////////+qqqr/AAAA/xYZGf/Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//0O7v/9Du - 7//Q7u//0O7v/9Du7/9ia2v/NDQ0+zMzMwoAAAAAAAAAADQ0NGIzMzP/r8DA/93z8//d8/P/3PLz/9zy - 8//c8vP/3PLz/9zy8//c8vP/0e7v/9Du7/8WGRn/AAAA/6qqqv////////////////////////////// - //////////////////////////////////+qqqr/AAAA/xYZGf/Q7u//0O7v/9Du7//Q7u//0O7v/9Du - 7//Q7u//0O7v/9Du7//Q7u//0O7v/9Du7/+Glpf/MzMz/zU1NT8AAAAAAAAAADQ0NCczMzP/iZWV/93z - 8//d8/P/3PLz/9zy8//c8vP/3PLz/9zy8//c8vP/0+/w/9Du7/8WGRn/AAAA/6qqqv////////////// - //////////////////////////////////////////////////+qqqr/AAAA/xYZGf/Q7u//0O7v/9Du - 7//Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//0O7v/9Du7/+rwsP/MzMz/zQ0NHsAAAAAAAAAAAAA - AAE0NDTqW2Fh/93z8//d8/P/3PLz/9zy8//c8vP/3PLz/9zy8//c8vP/1fDx/9Du7/8WGRn/AAAA/6qq - qv////////////////////////////////////////////////////////////////+qqqr/AAAA/xYZ - Gf/Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//L6On/Nzc3/jQ0 - NLcAAAAAAAAAAAAAAAA0NDStNjY2/tbs7f/d8/P/3PLz/9zy8//c8vP/3PLz/9zy8//c8vP/1/Dx/9Du - 7/8WGRn/AAAA/6qqqv////////////////////////////////////////////////////////////// - //+qqqr/AAAA/xYZGf/Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//0O7v/9Du - 7/+dsrL/Njc3/jMzM+QAAAAAAAAAAAAAAAAzMzNzMzMz/7jKyv/d8/P/3PLz/9zy8//c8vP/3PLz/9zy - 8//c8vP/2vLy/9Du7/8gJCX/AAAA/5ubm/////////////////////////////////////////////// - //////////////////+ampr/AAAA/yElJf/Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//0O7v/9Du - 7//Q7u//0O7v/4ydnv80NDT/NTU16TIyMjMAAAAAAAAAAAAAAAAzMzM3MzMz/5Gen//d8/P/3PLz/9zy - 8//c8vP/3PLz/9zy8//c8vP/3PLz/9Lv8P9OWlr/AAAA/xQUFP9jY2P/ZmZm/2ZmZv9mZmb/ZmZm/2Zm - Zv9mZmb/ZmZm/2ZmZv9mZmb/ZmZm/2NjY/8TExP/AAAA/1BbXP/Q7u//0O7v/9Du7//Q7u//0O7v/9Du - 7//Q7u//0O7v/9Du7//P7e7/gpGR/zMzM/80NDTcMjIyJAAAAAAAAAAAAAAAAAAAAAAzMzMFNDQ09mZt - bv/d8/P/3PLz/9zy8//c8vP/3PLz/9zy8//c8vP/3PLz/9bw8f+71tf/GBsb/wAAAP8AAAD/AAAA/wAA - AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/GBsb/7zX2P/Q7u//0O7v/9Du - 7//Q7u//0O7v/9Du7//Q7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//f39///r6+v///////////3Jycv8PERH/0O7v/9Du7//Q7u//0O7v/9Du - 7//Q7u//0O7v/0ZKSvQyMjJMAAAAADIyMjhDRET43fLz/93z8//c8vP/3PLz/9zy8//c8vP/2fHy/9Du - 7/8PERH/cnJy////////////////////////////////////////////cnJy/w8REf/Q7u//0O7v/9Du - 7//Q7u//0O7v/9Du7//Q7u//bnp6+jU1NYcAAAAAMzMzBTU2NvnL3d7/3fPz/9zy8//c8vP/3PLz/9zy - 8//Y8fL/0O7v/w8REf9ycnL///////////////////////////////////////////9ycnL/DxER/9Du - 7//Q7u//0O7v/9Du7//Q7u//0O7v/9Du7/+Upqf/PD09zAAAAAAAAAAAPT4+zqq4uf/d8/P/3PLz/9zy - 8//c8vP/3PLz/9jx8v/Q7u//DxER/3Jycv///////////////////////////////////////////3Jy - cv8PERH/0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//0O7v/7jS0v81NTX6KysrBgAAAAA0NDSJgouM+93z - 8//c8vP/3PLz/9zy8//c8vP/2PHy/9Du7/8PERH/cnJy//////////////////////////////////// - ////////cnJy/w8REf/Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//z+3u/zw+Pvg0NDQ2AAAAADQ0 - NE5RVFT13fPz/93z8//c8vP/3PLz/9zy8//Y8fL/0O7v/w8REf9ycnL///////////////////////// - //////////////////9ycnL/DxER/9Du7//Q7u//0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//X2dn9TQ0 - NHEAAAAAMzMzFDU1Nf7U6er/3fPz/9zy8//c8vP/3PLz/9ry8v/Q7u//DxER/3Jycv////////////// - /////////////////////////////3Jycv8PERH/0O7v/9Du7//Q7u//0O7v/9Du7//Q7u//0O7v/9Du - 7/+Hl5f/PD09tAAAAAAAAAAAOzw84rTFxv/d8/P/3PLz/9zy8//c8vP/2/Lz/9Du7/8PERH/cnJy//// - ////////////////////////////////////////cnJy/w8REf/Q7u//0O7v/9Du7//Q7u//0O7v/9Du - 7//Q7u//0O7v/5KkpP84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/9zy8//c8vP/3PLz/9vy8/9zhIT/S0tL/2Zn - Z/8NDg7/iJyd/4icnf8NDg7/Zmdn/0tLS/9zhIT/0O7v/9Du7//Q7u//0O7v/36NjfY1NTVcAAAAAENG - RtDN4eH/3fPz/9zy8//c8vP/3PLz/9rx8v9zhIT/VFVV//////+rq6v/DxAQ/w8QEP+rq6v//////1RV - Vf9zhIT/0O7v/9Du7//Q7u//0O7v/6W7u/9CRkalAAAAAD5AQIutvL3+3fPz/9zy8//c8vP/3PLz/9jx - 8v9zhIT/VFVV////////////5eXl/+Xl5f///////////1RVVf9zhIT/0O7v/9Du7//Q7u//0O7v/8jk - 5f9BQ0PgAAAAADIyMkeDjY3x3fPz/9zy8//c8vP/3PLz/9bw8f9zhIT/VFVV//////////////////// - /////////////1RVVf9zhIT/0O7v/9Du7//Q7u//0O7v/9Du7/9GS0vsMzMzDzc3Nw5VWFnt3fPz/9zy - 8//c8vP/3PLz/9bw8f9zhIT/VFVV/////////////////////////////////1RVVf9zhIT/0O7v/9Du - 7//Q7u//0O7v/9Du7/9teXnvNDQ0RQAAAABARETi1+vs/9zy8//c8vP/3PLz/9bw8f9zhIT/VFVV//// - /////////////////////////////1RVVf9zhIT/0O7v/9Du7//Q7u//0O7v/9Du7/+Xqqv+P0FBigAA - AABBRESoucvL/9zy8//c8vP/3PLz/9fx8f9zhIT/VFVV/////////////////////////////////1RV - Vf9zhIT/0O7v/9Du7//Q7u//0O7v/9Du7/+81tf/Q0VFzwAAAAA1NTVckp6e993z8//c8vP/3PLz/9nx - 8v9zhIT/VFVV/////////////////////////////////1RVVf9zhIT/0O7v/9Du7//Q7u//0O7v/9Du - 7/+2z9D/Oz097AAAAAA1NTUiYWho7N3z8//c8vP/3PLz/9zy8/+OoaL/HR4e/4iIiP+IiIj/iIiI/4iI - iP+IiIj/iIiI/xwdHf+Po6T/0O7v/9Du7//Q7u//0O7v/67Fxv5CRUXpMzMzMgAAAAAAAAAAQUND69zx - 8v/c8vP/3PLz/9zy8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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEpRUXhaYWLXUFVVsEFERE9AQEAIAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFRaWo6jsLHw0O7v/8vo6f+mvLz4cHt721Va - W8FGSkp1NTU1GAAAAAAAAAAAAAAAAAAAAAAAAAAAVVVVA1VbW622xsf21vDx/9Du7//Q7u//0O7v/9Du - 7//O7O3/rMPE/XSAgeNXXV3INTU1IgAAAAAAAAAAJCQkB1leXru/0dH63PLz/9Pv8P/Q7u//0O7v/9Du - 7//Q7u//0O7v/9Du7//Q7u//ts/Q/0pQUHkAAAAALS0tEVthYcrJ3d793PLz/9vy8/9MVVX/tM7P/9Du - 7//Q7u//tM7P/0xVVf/Q7u//0O7v/8/t7v9VW1u3AAAAAFheXtDR5ub/3PLz/9zy8//Y8fL/KCoq/zg7 - O/+JnJz/iZyc/zc6Ov8oKir/0O7v/9Du7//Q7u//Y2tr0QAAAABocHHL3fPz/9zy8//c8vP/1vDx/z1A - QP/39/f/aWtr/2lra//39/f/PUBA/9Du7//Q7u//0O7v/3yKiuUzMzMZUVhYqdjt7v/c8vP/3PLz/9Tw - 8f89QED//////////////////////z1AQP/Q7u//0O7v/9Du7/+ovsD9QENDW0JFRV27zs/93PLz/9zy - 8//U8PD/PUBA//////////////////////89QED/0O7v/9Du7//Q7u//y+jp/1FYWKY1NTUYkp6f6tzy - 8//c8vP/1fDx/z1AQP//////////////////////PUBA/9Du7//Q7u//0O7v/9Du7/9eZ2fHAAAAAHN6 - etXc8vP/3PLz/9fx8f88Pz///////////////////////zw/P//Q7u//0O7v/9Du7//C3t7/UFdXzgAA - AABaYGC52/Ly/9zy8//a8vP/e4qL/zxAQP89QUH/PUFB/zxAQP98i4z/0O7v/9Du7/+81tf+U1pazTMz - MxQAAAAASlBQfMfb3P/c8vP/3PLz/9Xw8f/Q7u//0O7v/9Du7//Q7u//0O7v/9Du7/+vx8f6T1VVvjMz - MwoAA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+/yxyhP8scoT/LHKE/yxyhP8scoT/LHKE/yxyhP8scoT/HElU/wAA + AP8AAAAYAAAAAAAAAAAAAAAcAQMEuwEBAvoAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8BAgLtAAAACwAAAAAAAAAAAAOsQQADrEEAA6xBAAOsQQAArEEAAKxBAACsQQAArEEAAKxBAACsQQAA + rEEAAKxBAACsQQAArEEAA6xBAAOsQQ== \ No newline at end of file diff --git a/Models/AppOptions.cs b/Models/AppOptions.cs new file mode 100644 index 0000000..7483a9b --- /dev/null +++ b/Models/AppOptions.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; +using System.Drawing; +using bzit.bomg.Models; + +namespace FizzyLauncher.Models +{ + public class AppOptions + { + public bool RestorePosition { get; set; } = true; + + public bool AlwaysOnTop { get; set; } = false; + + public string RunCommand { get; set; } = "{0}"; + + //public bool IgnoreSSL { get; set; } = false; + + public Point StartPosition { get; set; } = Point.Empty; + + public int Width { get; set; } = 0; + + public int Height { get; set; } = 0; + + public List Items { get; set; } = new List(); + + } +} \ No newline at end of file diff --git a/Models/AppSession.cs b/Models/AppSession.cs deleted file mode 100644 index bc9b4a9..0000000 --- a/Models/AppSession.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace FizzyLauncher.Models -{ - public class AppSession - { - public enum AutoSaveOption - { - Prompt = 0, - Yes, - No - } - - - public bool EnableAutoPosition { get; set; } = true; - - public bool AlwaysOnTop { get; set; } = false; - - public AutoSaveOption AutoSave { get; set; } = AutoSaveOption.Prompt; - - public string RunCommand { get; set; } = "{0}"; - - public bool IgnoreSSL { get; set; } = false; - - public bool ShowToolbar { get; set; } = false; - - } -} \ No newline at end of file diff --git a/Models/BookmarkItem.cs b/Models/BookmarkItem.cs deleted file mode 100644 index 7778f78..0000000 --- a/Models/BookmarkItem.cs +++ /dev/null @@ -1,54 +0,0 @@ -using BookmarkManager; -using System; -using System.Text; - -namespace bzit.bomg.Models -{ - public class BookmarkItem - { - public string SiteName { get; set; } - - public string SiteAddress { get; set; } - - public string SiteDescription { get; set; } - - public string TreeviewPath { get; set; } - - public string Notes { get; set; } - - - public new string ToString() - { - StringBuilder sb = new StringBuilder(); - - if (!string.IsNullOrWhiteSpace(this.SiteName)) - { - sb.AppendLine("Name"); - sb.AppendLine(this.SiteName + Environment.NewLine); - } - - if (!string.IsNullOrWhiteSpace(this.SiteAddress)) - { - sb.AppendLine("Address"); - sb.AppendLine(this.SiteAddress + Environment.NewLine); - } - - if (!string.IsNullOrWhiteSpace(this.SiteDescription)) - { - sb.AppendLine("Description"); - sb.AppendLine(this.SiteDescription + Environment.NewLine); - } - - if (!string.IsNullOrWhiteSpace(this.Notes)) - { - sb.AppendLine("Notes"); - sb.AppendLine(this.Notes + Environment.NewLine); - } - - return sb.ToString(); - } - - public string ToHash() => Crypto.GetSHA256Hash(this.SiteAddress); - - } -} \ No newline at end of file diff --git a/Models/BookmarkModel.cs b/Models/BookmarkModel.cs new file mode 100644 index 0000000..e41f7f4 --- /dev/null +++ b/Models/BookmarkModel.cs @@ -0,0 +1,60 @@ +using System; +using System.Drawing; +using System.Text; +using System.Text.Json.Serialization; + +namespace bzit.bomg.Models +{ + public class BookmarkModel + { + public Guid Id { get; set; } = Guid.NewGuid(); + + public string Title { get; set; } + + public string Address { get; set; } + + public string Description { get; set; } + + public string IconId { get; set; } + + [JsonIgnore] + public Image Icon { get; set; } + + public string Path { get; set; } + + public string Notes { get; set; } + + + public new string ToString() + { + StringBuilder sb = new StringBuilder(); + + if (!string.IsNullOrWhiteSpace(this.Title)) + { + sb.AppendLine("Name"); + sb.AppendLine(this.Title + Environment.NewLine); + } + + if (!string.IsNullOrWhiteSpace(this.Address)) + { + sb.AppendLine("Address"); + sb.AppendLine(this.Address + Environment.NewLine); + } + + if (!string.IsNullOrWhiteSpace(this.Description)) + { + sb.AppendLine("Description"); + sb.AppendLine(this.Description + Environment.NewLine); + } + + if (!string.IsNullOrWhiteSpace(this.Notes)) + { + sb.AppendLine("Notes"); + sb.AppendLine(this.Notes + Environment.NewLine); + } + + return sb.ToString(); + } + + } +} \ No newline at end of file diff --git a/Models/R4SaveFileModel.cs b/Models/R4SaveFileModel.cs new file mode 100644 index 0000000..983d2e5 --- /dev/null +++ b/Models/R4SaveFileModel.cs @@ -0,0 +1,49 @@ +using System.Text; + +namespace BookmarkManager.Models +{ + public class R4SaveFileModel + { + public string SiteName { get; set; } + + public string SiteAddress { get; set; } + + public string SiteDescription { get; set; } + + public string TreeviewPath { get; set; } + + public string Notes { get; set; } + + + public string Path + { + get + { + if (string.IsNullOrWhiteSpace(TreeviewPath)) + { + return string.Empty; + } + + var path = this.TreeviewPath?.Trim('\\')?.Trim() ?? string.Empty; + if (!path.Contains("\\")) + { + return path?.Trim() ?? string.Empty; + } + + var sb = new StringBuilder(); + + var parts = path.Split("\\"); + for (var i = 1; i < parts.Length; i++) + { + var item = System.Web.HttpUtility.UrlDecode(parts[i]); + + sb.Append(item); + sb.Append("\n"); + } + + return sb.ToString()?.Trim() ?? string.Empty; + } + } + + } +} \ No newline at end of file diff --git a/Net/WebParser.cs b/Net/WebParser.cs deleted file mode 100644 index 6543390..0000000 --- a/Net/WebParser.cs +++ /dev/null @@ -1,283 +0,0 @@ -using bzit.bomg.Models; -using HtmlAgilityPack; -using RyzStudio.Net; -using System; -using System.Drawing; -using System.IO; -using System.Net; - -namespace BookmarkManager -{ - public class WebParser - { - protected HttpWeb webClient = null; - protected WebClient webClient2 = null; - - - public BookmarkResult RetrieveDetails(string url, bool ignoreSSL) - { - string sourceCode = retrieveSourceCode(url, ignoreSSL); - if (string.IsNullOrWhiteSpace(sourceCode)) - { - return null; - } - - BookmarkResult rs = new BookmarkResult(); - rs.Item = new BookmarkItem(); - - HtmlDocument document = new HtmlDocument(); - document.LoadHtml(sourceCode); - - rs.Item.SiteName = parseSiteTitle(document); - rs.Item.SiteAddress = url; - rs.Item.SiteDescription = parseSiteDescription(document); - rs.IconURL = parseSiteIcon(document); - - // resolve relative URL - if (!string.IsNullOrWhiteSpace(rs.IconURL)) - { - Uri iconAddressURI; - bool rv = Uri.TryCreate(new Uri(url), rs.IconURL, out iconAddressURI); - if (rv) - { - rs.IconURL = iconAddressURI.ToString(); - } - } - - return rs; - } - - public Bitmap RetrieveImage(string url) - { - if (string.IsNullOrWhiteSpace(url)) - { - return null; - } - - if (webClient2 == null) webClient2 = new WebClient(); - webClient2.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore); - - try - { - byte[] byteData = webClient2.DownloadData(url); - - if (!RyzStudio.IO.FileType.IsImage(byteData)) - { - throw new Exception("Not a supported image"); - } - - Image img = Image.FromStream(new MemoryStream(byteData)); - - return new Bitmap(img, 16, 16); - } - catch (Exception) - { - return null; - } - } - - - protected string retrieveSourceCode(string url, bool ignoreSSL) - { - if (webClient == null) webClient = new HttpWeb(); - webClient.IgnoreSSL = ignoreSSL; - - string sourceCode; - - try - { - int statusCode = webClient.GetResponse(out sourceCode, url); - if ((statusCode == 200) || (statusCode == 301) || (statusCode == 302)) - { - return sourceCode; - } - } - catch (Exception) - { - return null; - } - - return null; - } - - protected string parseSiteDescription(HtmlDocument doc) - { - string rs = null; - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//meta[@name='description']", "content", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//meta[@property='og:description']", "content", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//meta[@name='twitter:description']", "content", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//meta[@property='og:description']", "content", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//meta[@itemprop='description']", "content", string.Empty); - } - - return rs; - } - - protected string parseSiteIcon(HtmlDocument doc) - { - string rs = null; - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//link[translate(@rel, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'shortcut icon']", "href", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//link[translate(@rel, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'icon']", "href", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//link[translate(@rel, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'apple-touch-icon']", "href", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//link[translate(@rel, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'apple-touch-icon-precomposed']", "href", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//meta[translate(@property, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'og:image']", "content", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//meta[translate(@name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'twitter:image']", "content", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//meta[translate(@property, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'og:image']", "content", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//meta[translate(@itemprop, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'image']", "content", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = "/favicon.ico"; - } - - return rs; - } - - protected string parseSiteTitle(HtmlDocument doc) - { - string rs = null; - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue(doc, "//title", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//meta[@property='og:title']", "content", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//meta[@name='twitter:title']", "content", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//meta[@property='og:site_name']", "content", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//meta[@itemprop='name']", "content", string.Empty); - } - - return rs?.Trim() ?? string.Empty; - } - - protected string parseTagValue(HtmlDocument doc, string xpath, string defaultValue = "") - { - HtmlNodeCollection hnc = doc.DocumentNode.SelectNodes(xpath); - if (hnc == null) - { - return defaultValue; - } - - if (hnc.Count <= 0) - { - return defaultValue; - } - - foreach (HtmlNode hn in hnc) - { - if (string.IsNullOrWhiteSpace(hn.InnerHtml)) - { - continue; - } - - string rs = WebUtility.HtmlDecode(hn.InnerHtml)?.Replace("\r", "")?.Replace("\n", " ")?.Trim(); - if (string.IsNullOrWhiteSpace(rs)) - { - continue; - } - - return rs; - } - - return defaultValue; - } - - protected string parseTagValue_Attr(HtmlDocument doc, string xpath, string attr, string defaultValue = "") - { - HtmlNodeCollection hnc = doc.DocumentNode.SelectNodes(xpath); - if (hnc == null) - { - return defaultValue; - } - - if (hnc.Count <= 0) - { - return defaultValue; - } - - foreach (HtmlNode hn in hnc) - { - if (hn.Attributes[attr] == null) - { - continue; - } - - if (string.IsNullOrWhiteSpace(hn.Attributes[attr].Value)) - { - continue; - } - - return System.Web.HttpUtility.HtmlDecode(hn.Attributes[attr].Value?.Trim()); - } - - return defaultValue; - } - - } -} \ No newline at end of file diff --git a/OptionsForm.cs b/OptionsForm.cs index 4b84a1c..cbbeef2 100644 --- a/OptionsForm.cs +++ b/OptionsForm.cs @@ -1,379 +1,310 @@ using System; +using System.Linq; using System.Windows.Forms; using FizzyLauncher.Models; +using RyzStudio.Windows.Forms; using RyzStudio.Windows.ThemedForms; using RyzStudio.Windows.ThemedForms.PickerBox; namespace FizzyLauncher { - public class OptionsForm : TDialogForm + public class OptionsForm : Form { - private System.Windows.Forms.Label label1; - private TButton button1; - private TYesNoPickerBox pickerBox1; - private System.Windows.Forms.Label label6; - private TYesNoPickerBox pickerBox2; - private System.Windows.Forms.Label label7; - private System.Windows.Forms.Label label8; - private TPickerBox pickerBox3; - private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator1; - private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator3; - private TTextBox textBox1; - private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator2; - private TYesNoPickerBox pickerBox4; + private FlowLayoutPanel flowLayoutPanel1; + private TTogglePanel panel1; + private TTogglePanel panel3; + private ThYesNoPickerBox yesNoPickerBox1; private Label label2; - private TYesNoPickerBox pickerBox5; + private TTogglePanel panel2; + private ThYesNoPickerBox thYesNoPickerBox1; + private Label label1; + private ThYesNoPickerBox yesNoPickerBox2; private Label label3; - protected MainForm parentForm = null; + private RyzStudio.Windows.ThemedForms.ButtonTextBox.ThClearableTextBox textBox1; + private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1; + private AppOptions _appSession = null; - public OptionsForm(MainForm parent) : base() + public OptionsForm(AppOptions appSession) { InitializeComponent(); - parentForm = parent; + UISetup.Dialog(this); - pickerBox3.ComboBox.Items.Clear(); - foreach (string item in Enum.GetNames(typeof(AppSession.AutoSaveOption))) + _appSession = appSession; + + if (_appSession != null) { - pickerBox3.ComboBox.Items.Add(item); + yesNoPickerBox1.Value = _appSession.RestorePosition; + + yesNoPickerBox2.Value = _appSession.AlwaysOnTop; + + textBox1.Text = _appSession.RunCommand ?? string.Empty; } - - if (pickerBox3.ComboBox.Items.Count > 0) pickerBox3.ComboBox.SelectedIndex = 0; - } private void InitializeComponent() { - this.label1 = new System.Windows.Forms.Label(); - this.button1 = new RyzStudio.Windows.ThemedForms.TButton(); - this.pickerBox1 = new TYesNoPickerBox(); - this.label6 = new System.Windows.Forms.Label(); - this.pickerBox2 = new TYesNoPickerBox(); - this.label7 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.pickerBox3 = new RyzStudio.Windows.ThemedForms.TPickerBox(); - this.tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - this.tHorizontalSeparator2 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - this.tHorizontalSeparator3 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - this.textBox1 = new RyzStudio.Windows.ThemedForms.TTextBox(); - this.pickerBox4 = new TYesNoPickerBox(); - this.label2 = new System.Windows.Forms.Label(); - this.pickerBox5 = new TYesNoPickerBox(); - this.label3 = new System.Windows.Forms.Label(); - this.SuspendLayout(); + flowLayoutPanel1 = new FlowLayoutPanel(); + panel1 = new TTogglePanel(); + yesNoPickerBox1 = new ThYesNoPickerBox(); + label2 = new Label(); + panel2 = new TTogglePanel(); + yesNoPickerBox2 = new ThYesNoPickerBox(); + thYesNoPickerBox1 = new ThYesNoPickerBox(); + label1 = new Label(); + panel3 = new TTogglePanel(); + textBox1 = new RyzStudio.Windows.ThemedForms.ButtonTextBox.ThClearableTextBox(); + label3 = new Label(); + dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter(); + flowLayoutPanel1.SuspendLayout(); + panel1.SuspendLayout(); + panel2.SuspendLayout(); + panel3.SuspendLayout(); + SuspendLayout(); // - // label1 + // flowLayoutPanel1 // - this.label1.AutoSize = true; - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.ForeColor = System.Drawing.SystemColors.ControlText; - this.label1.Location = new System.Drawing.Point(10, 235); - this.label1.Margin = new System.Windows.Forms.Padding(0); - this.label1.Name = "label1"; - this.label1.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); - this.label1.Size = new System.Drawing.Size(109, 34); - this.label1.TabIndex = 153; - this.label1.Text = "Custom Command"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + flowLayoutPanel1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + flowLayoutPanel1.AutoScroll = true; + flowLayoutPanel1.BackColor = System.Drawing.Color.Transparent; + flowLayoutPanel1.Controls.Add(panel1); + flowLayoutPanel1.Controls.Add(panel2); + flowLayoutPanel1.Controls.Add(panel3); + flowLayoutPanel1.FlowDirection = FlowDirection.TopDown; + flowLayoutPanel1.Location = new System.Drawing.Point(8, 12); + flowLayoutPanel1.Name = "flowLayoutPanel1"; + flowLayoutPanel1.Size = new System.Drawing.Size(436, 412); + flowLayoutPanel1.TabIndex = 194; + flowLayoutPanel1.WrapContents = false; + flowLayoutPanel1.Resize += flowLayoutPanel1_Resize; // - // button1 + // panel1 // - this.button1.AcceptButton = null; - this.button1.ActiveImage = null; - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.button1.BackColor = System.Drawing.Color.Transparent; - this.button1.HoverImage = null; - this.button1.IdleImage = null; - this.button1.LabelText = "&Save"; - this.button1.Location = new System.Drawing.Point(241, 469); - this.button1.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10); - this.button1.Name = "button1"; - this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.button1.Size = new System.Drawing.Size(128, 32); - this.button1.TabIndex = 6; - this.button1.TabStop = false; - this.button1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.button1_MouseClick); + panel1.AutoScrollMargin = new System.Drawing.Size(0, 0); + panel1.AutoScrollMinSize = new System.Drawing.Size(0, 0); + panel1.Controls.Add(yesNoPickerBox1); + panel1.Controls.Add(label2); + panel1.ExpandedHeight = 100; + panel1.ForeColor = System.Drawing.Color.FromArgb(99, 105, 119); + panel1.IsOpen = true; + panel1.Location = new System.Drawing.Point(0, 0); + panel1.Margin = new Padding(0); + panel1.Name = "panel1"; + panel1.PaddingBottom = 0; + panel1.PaddingLeft = 4; + panel1.Size = new System.Drawing.Size(401, 77); + panel1.TabIndex = 0; + panel1.Title = "On Start-Up"; + panel1.TitleContextMenuStrip = null; + panel1.TitleCursor = Cursors.Default; // - // pickerBox1 + // yesNoPickerBox1 // - this.pickerBox1.AcceptButton = null; - this.pickerBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pickerBox1.BackColor = System.Drawing.Color.Transparent; - this.pickerBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.pickerBox1.Location = new System.Drawing.Point(285, 127); - this.pickerBox1.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4); - this.pickerBox1.Name = "pickerBox1"; - this.pickerBox1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.pickerBox1.Size = new System.Drawing.Size(84, 35); - this.pickerBox1.TabIndex = 2; - this.pickerBox1.TabStop = false; - this.pickerBox1.Value = true; - // - // label6 - // - this.label6.AutoSize = true; - this.label6.BackColor = System.Drawing.Color.Transparent; - this.label6.ForeColor = System.Drawing.SystemColors.ControlText; - this.label6.Location = new System.Drawing.Point(10, 127); - this.label6.Margin = new System.Windows.Forms.Padding(0); - this.label6.Name = "label6"; - this.label6.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); - this.label6.Size = new System.Drawing.Size(145, 34); - this.label6.TabIndex = 182; - this.label6.Text = "Auto Position On Start-Up"; - this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // pickerBox2 - // - this.pickerBox2.AcceptButton = null; - this.pickerBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pickerBox2.BackColor = System.Drawing.Color.Transparent; - this.pickerBox2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.pickerBox2.Location = new System.Drawing.Point(285, 168); - this.pickerBox2.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4); - this.pickerBox2.Name = "pickerBox2"; - this.pickerBox2.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.pickerBox2.Size = new System.Drawing.Size(84, 35); - this.pickerBox2.TabIndex = 3; - this.pickerBox2.TabStop = false; - this.pickerBox2.Value = true; - // - // label7 - // - this.label7.AutoSize = true; - this.label7.BackColor = System.Drawing.Color.Transparent; - this.label7.ForeColor = System.Drawing.SystemColors.ControlText; - this.label7.Location = new System.Drawing.Point(10, 168); - this.label7.Margin = new System.Windows.Forms.Padding(0); - this.label7.Name = "label7"; - this.label7.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); - this.label7.Size = new System.Drawing.Size(89, 34); - this.label7.TabIndex = 184; - this.label7.Text = "Always-On-Top"; - this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label8 - // - this.label8.AutoSize = true; - this.label8.BackColor = System.Drawing.Color.Transparent; - this.label8.ForeColor = System.Drawing.SystemColors.ControlText; - this.label8.Location = new System.Drawing.Point(10, 21); - this.label8.Margin = new System.Windows.Forms.Padding(0); - this.label8.Name = "label8"; - this.label8.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); - this.label8.Size = new System.Drawing.Size(60, 34); - this.label8.TabIndex = 186; - this.label8.Text = "Auto Save"; - this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // pickerBox3 - // - this.pickerBox3.AcceptButton = null; - this.pickerBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pickerBox3.BackColor = System.Drawing.Color.Transparent; - this.pickerBox3.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.pickerBox3.Location = new System.Drawing.Point(285, 21); - this.pickerBox3.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4); - this.pickerBox3.Name = "pickerBox3"; - this.pickerBox3.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.pickerBox3.Size = new System.Drawing.Size(84, 35); - this.pickerBox3.TabIndex = 0; - this.pickerBox3.TabStop = false; - // - // tHorizontalSeparator1 - // - this.tHorizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tHorizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator1.BackColor = System.Drawing.Color.Transparent; - this.tHorizontalSeparator1.Location = new System.Drawing.Point(10, 437); - this.tHorizontalSeparator1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 10); - this.tHorizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2); - this.tHorizontalSeparator1.MinimumSize = new System.Drawing.Size(0, 22); - this.tHorizontalSeparator1.Name = "tHorizontalSeparator1"; - this.tHorizontalSeparator1.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); - this.tHorizontalSeparator1.Size = new System.Drawing.Size(364, 22); - this.tHorizontalSeparator1.TabIndex = 188; - this.tHorizontalSeparator1.TabStop = false; - // - // tHorizontalSeparator2 - // - this.tHorizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tHorizontalSeparator2.AutoScrollMargin = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator2.AutoScrollMinSize = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator2.BackColor = System.Drawing.Color.Transparent; - this.tHorizontalSeparator2.Location = new System.Drawing.Point(10, 59); - this.tHorizontalSeparator2.Margin = new System.Windows.Forms.Padding(5, 0, 5, 10); - this.tHorizontalSeparator2.MaximumSize = new System.Drawing.Size(4920, 2); - this.tHorizontalSeparator2.MinimumSize = new System.Drawing.Size(0, 22); - this.tHorizontalSeparator2.Name = "tHorizontalSeparator2"; - this.tHorizontalSeparator2.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); - this.tHorizontalSeparator2.Size = new System.Drawing.Size(364, 22); - this.tHorizontalSeparator2.TabIndex = 190; - this.tHorizontalSeparator2.TabStop = false; - // - // tHorizontalSeparator3 - // - this.tHorizontalSeparator3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tHorizontalSeparator3.AutoScrollMargin = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator3.AutoScrollMinSize = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator3.BackColor = System.Drawing.Color.Transparent; - this.tHorizontalSeparator3.Location = new System.Drawing.Point(10, 206); - this.tHorizontalSeparator3.Margin = new System.Windows.Forms.Padding(5, 0, 5, 10); - this.tHorizontalSeparator3.MaximumSize = new System.Drawing.Size(4920, 2); - this.tHorizontalSeparator3.MinimumSize = new System.Drawing.Size(0, 22); - this.tHorizontalSeparator3.Name = "tHorizontalSeparator3"; - this.tHorizontalSeparator3.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); - this.tHorizontalSeparator3.Size = new System.Drawing.Size(364, 22); - this.tHorizontalSeparator3.TabIndex = 191; - this.tHorizontalSeparator3.TabStop = false; - // - // textBox1 - // - this.textBox1.AcceptButton = null; - this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox1.BackColor = System.Drawing.Color.Transparent; - this.textBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.textBox1.Location = new System.Drawing.Point(192, 234); - this.textBox1.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10); - this.textBox1.Name = "textBox1"; - this.textBox1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.textBox1.ReadOnly = false; - this.textBox1.Size = new System.Drawing.Size(177, 35); - this.textBox1.TabIndex = 4; - this.textBox1.TabStop = false; - this.textBox1.UseSystemPasswordChar = false; - // - // pickerBox4 - // - this.pickerBox4.AcceptButton = null; - this.pickerBox4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pickerBox4.BackColor = System.Drawing.Color.Transparent; - this.pickerBox4.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.pickerBox4.Location = new System.Drawing.Point(285, 279); - this.pickerBox4.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4); - this.pickerBox4.Name = "pickerBox4"; - this.pickerBox4.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.pickerBox4.Size = new System.Drawing.Size(84, 35); - this.pickerBox4.TabIndex = 5; - this.pickerBox4.TabStop = false; - this.pickerBox4.Value = true; + 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, 22); + yesNoPickerBox1.Name = "yesNoPickerBox1"; + yesNoPickerBox1.SelectedIndex = 1; + yesNoPickerBox1.Size = new System.Drawing.Size(84, 34); + yesNoPickerBox1.TabIndex = 197; + yesNoPickerBox1.TabStop = false; + yesNoPickerBox1.Value = true; // // label2 // - this.label2.AutoSize = true; - this.label2.BackColor = System.Drawing.Color.Transparent; - this.label2.ForeColor = System.Drawing.SystemColors.ControlText; - this.label2.Location = new System.Drawing.Point(10, 279); - this.label2.Margin = new System.Windows.Forms.Padding(0); - this.label2.Name = "label2"; - this.label2.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); - this.label2.Size = new System.Drawing.Size(95, 34); - this.label2.TabIndex = 193; - this.label2.Text = "Ignore SSL Errors"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + label2.AutoSize = true; + label2.BackColor = System.Drawing.Color.Transparent; + label2.ForeColor = System.Drawing.SystemColors.ControlText; + label2.Location = new System.Drawing.Point(1, 22); + label2.Margin = new Padding(0); + label2.Name = "label2"; + label2.Padding = new Padding(0, 8, 0, 0); + label2.Size = new System.Drawing.Size(92, 23); + label2.TabIndex = 196; + label2.Text = "Restore Position"; + label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // pickerBox5 + // panel2 // - this.pickerBox5.AcceptButton = null; - this.pickerBox5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pickerBox5.BackColor = System.Drawing.Color.Transparent; - this.pickerBox5.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.pickerBox5.Location = new System.Drawing.Point(285, 85); - this.pickerBox5.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4); - this.pickerBox5.Name = "pickerBox5"; - this.pickerBox5.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.pickerBox5.Size = new System.Drawing.Size(84, 35); - this.pickerBox5.TabIndex = 1; - this.pickerBox5.TabStop = false; - this.pickerBox5.Value = true; + panel2.AutoScrollMargin = new System.Drawing.Size(0, 0); + panel2.AutoScrollMinSize = new System.Drawing.Size(0, 0); + panel2.Controls.Add(yesNoPickerBox2); + panel2.Controls.Add(thYesNoPickerBox1); + panel2.Controls.Add(label1); + panel2.ExpandedHeight = 100; + panel2.ForeColor = System.Drawing.Color.FromArgb(99, 105, 119); + panel2.IsOpen = true; + panel2.Location = new System.Drawing.Point(0, 77); + panel2.Margin = new Padding(0); + panel2.Name = "panel2"; + panel2.PaddingBottom = 0; + panel2.PaddingLeft = 4; + panel2.Size = new System.Drawing.Size(401, 77); + panel2.TabIndex = 2; + panel2.Title = "Appearance"; + panel2.TitleContextMenuStrip = null; + panel2.TitleCursor = Cursors.Default; + // + // 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, 22); + yesNoPickerBox2.Name = "yesNoPickerBox2"; + yesNoPickerBox2.SelectedIndex = 1; + yesNoPickerBox2.Size = new System.Drawing.Size(84, 34); + yesNoPickerBox2.TabIndex = 198; + yesNoPickerBox2.TabStop = false; + yesNoPickerBox2.Value = true; + // + // thYesNoPickerBox1 + // + thYesNoPickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right; + thYesNoPickerBox1.BackColor = System.Drawing.Color.Transparent; + thYesNoPickerBox1.EnableReactiveVisual = true; + thYesNoPickerBox1.Font = new System.Drawing.Font("Segoe UI", 9F); + thYesNoPickerBox1.Location = new System.Drawing.Point(508, 22); + thYesNoPickerBox1.Name = "thYesNoPickerBox1"; + thYesNoPickerBox1.SelectedIndex = 1; + thYesNoPickerBox1.Size = new System.Drawing.Size(84, 34); + thYesNoPickerBox1.TabIndex = 197; + thYesNoPickerBox1.TabStop = false; + thYesNoPickerBox1.Value = true; + // + // label1 + // + 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(85, 23); + label1.TabIndex = 196; + label1.Text = "Always On Top"; + label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // panel3 + // + panel3.AutoScrollMargin = new System.Drawing.Size(0, 0); + panel3.AutoScrollMinSize = new System.Drawing.Size(0, 0); + panel3.Controls.Add(textBox1); + panel3.Controls.Add(label3); + panel3.ExpandedHeight = 100; + panel3.ForeColor = System.Drawing.Color.FromArgb(99, 105, 119); + panel3.IsOpen = true; + panel3.Location = new System.Drawing.Point(0, 154); + panel3.Margin = new Padding(0); + panel3.Name = "panel3"; + panel3.PaddingBottom = 0; + panel3.PaddingLeft = 4; + panel3.Size = new System.Drawing.Size(401, 77); + panel3.TabIndex = 1; + panel3.Title = "Behaviour"; + panel3.TitleContextMenuStrip = null; + panel3.TitleCursor = Cursors.Default; + // + // textBox1 + // + textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + textBox1.BackColor = System.Drawing.Color.Transparent; + textBox1.ClearedValue = "{0}"; + textBox1.EnableReactiveVisual = true; + textBox1.Font = new System.Drawing.Font("Segoe UI", 9F); + textBox1.Icon = "O"; + textBox1.IconSize = 13F; + textBox1.Location = new System.Drawing.Point(161, 21); + textBox1.Name = "textBox1"; + textBox1.Size = new System.Drawing.Size(230, 32); + textBox1.TabIndex = 203; + textBox1.TabStop = false; + textBox1.UseSystemPasswordChar = false; // // label3 // - this.label3.AutoSize = true; - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.ForeColor = System.Drawing.SystemColors.ControlText; - this.label3.Location = new System.Drawing.Point(10, 85); - this.label3.Margin = new System.Windows.Forms.Padding(0); - this.label3.Name = "label3"; - this.label3.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); - this.label3.Size = new System.Drawing.Size(112, 34); - this.label3.TabIndex = 195; - this.label3.Text = "Show Toolbar Menu"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + label3.AutoSize = true; + label3.BackColor = System.Drawing.Color.Transparent; + label3.ForeColor = System.Drawing.SystemColors.ControlText; + label3.Location = new System.Drawing.Point(1, 21); + label3.Margin = new Padding(0); + label3.Name = "label3"; + label3.Padding = new Padding(0, 8, 0, 0); + label3.Size = new System.Drawing.Size(88, 23); + label3.TabIndex = 199; + label3.Text = "Run Command"; + label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // dialogFooter1 + // + dialogFooter1.BackColor = System.Drawing.Color.FromArgb(240, 240, 240); + dialogFooter1.Button1Text = "&Save"; + dialogFooter1.Dialog = this; + dialogFooter1.Dock = DockStyle.Bottom; + dialogFooter1.Location = new System.Drawing.Point(0, 437); + dialogFooter1.Name = "dialogFooter1"; + dialogFooter1.Size = new System.Drawing.Size(444, 84); // // OptionsForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(384, 521); - this.Controls.Add(this.pickerBox5); - this.Controls.Add(this.label3); - this.Controls.Add(this.pickerBox4); - this.Controls.Add(this.label2); - this.Controls.Add(this.textBox1); - this.Controls.Add(this.tHorizontalSeparator3); - this.Controls.Add(this.tHorizontalSeparator2); - this.Controls.Add(this.tHorizontalSeparator1); - this.Controls.Add(this.pickerBox3); - this.Controls.Add(this.label8); - this.Controls.Add(this.pickerBox2); - this.Controls.Add(this.label7); - this.Controls.Add(this.pickerBox1); - this.Controls.Add(this.label6); - this.Controls.Add(this.button1); - this.Controls.Add(this.label1); - this.MinimumSize = new System.Drawing.Size(400, 560); - this.Name = "OptionsForm"; - this.Text = "Options"; - this.ResumeLayout(false); - this.PerformLayout(); - + AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + BackColor = System.Drawing.Color.White; + ClientSize = new System.Drawing.Size(444, 521); + Controls.Add(dialogFooter1); + Controls.Add(flowLayoutPanel1); + MinimumSize = new System.Drawing.Size(460, 560); + Name = "OptionsForm"; + Text = "Options"; + flowLayoutPanel1.ResumeLayout(false); + panel1.ResumeLayout(false); + panel1.PerformLayout(); + panel2.ResumeLayout(false); + panel2.PerformLayout(); + panel3.ResumeLayout(false); + panel3.PerformLayout(); + ResumeLayout(false); } - protected override void OnShown(EventArgs e) + protected override void OnLoad(EventArgs e) { - base.OnShown(e); + base.OnLoad(e); - if (parentForm == null) - { - return; - } - - if (parentForm.CurrentSession == null) - { - return; - } - - pickerBox3.ComboBox.SelectedIndex = (int)parentForm.CurrentSession.AutoSave; - pickerBox1.Value = parentForm.CurrentSession.EnableAutoPosition; - pickerBox2.Value = parentForm.CurrentSession.AlwaysOnTop; - textBox1.Text = parentForm.CurrentSession.RunCommand ?? string.Empty; - pickerBox4.Value = parentForm.CurrentSession.IgnoreSSL; - pickerBox5.Value = parentForm.CurrentSession.ShowToolbar; + flowLayoutPanel1_Resize(null, e); } - private void button1_MouseClick(object sender, MouseEventArgs e) + private void flowLayoutPanel1_Resize(object sender, EventArgs e) { - if (parentForm != null) + var width = flowLayoutPanel1.ClientRectangle.Width - SystemInformation.VerticalScrollBarWidth; + + foreach (var item in flowLayoutPanel1.Controls.OfType()) { - if (parentForm.CurrentSession == null) parentForm.CurrentSession = new AppSession(); - - parentForm.CurrentSession.AutoSave = (AppSession.AutoSaveOption)pickerBox3.ComboBox.SelectedIndex; - parentForm.CurrentSession.EnableAutoPosition = pickerBox1.Value; - parentForm.CurrentSession.AlwaysOnTop = pickerBox2.Value; - parentForm.CurrentSession.RunCommand = textBox1.Text?.Trim(); - parentForm.CurrentSession.IgnoreSSL = pickerBox4.Value; - parentForm.CurrentSession.ShowToolbar = pickerBox5.Value; + item.Width = width; } + } - this.DialogResult = DialogResult.OK; - this.Close(); + public AppOptions Result + { + get + { + if (_appSession == null) + { + _appSession = new AppOptions(); + } + + _appSession.RestorePosition = yesNoPickerBox1.Value; + + _appSession.AlwaysOnTop = yesNoPickerBox2.Value; + + _appSession.RunCommand = textBox1.Text ?? string.Empty; + + return _appSession; + } } } diff --git a/OptionsForm.resx b/OptionsForm.resx index f298a7b..af32865 100644 --- a/OptionsForm.resx +++ b/OptionsForm.resx @@ -1,4 +1,64 @@ - + + + diff --git a/PasswordForm.cs b/PasswordForm.cs deleted file mode 100644 index 6dfcdb3..0000000 --- a/PasswordForm.cs +++ /dev/null @@ -1,147 +0,0 @@ -using RyzStudio.Windows.ThemedForms; -using System; -using System.ComponentModel; -using System.Windows.Forms; - -namespace FizzyLauncher -{ - public class PasswordForm : TDialogForm - { - private System.Windows.Forms.Label label1; - private TButton button1; - private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator1; - private TTextBox textBox1; - - - public PasswordForm() - { - InitializeComponent(); - - textBox1.TextBox.MaxLength = 255; - textBox1.PreviewKeyDown += textBox1_PreviewKeyDown; - } - - private void InitializeComponent() - { - this.label1 = new System.Windows.Forms.Label(); - this.button1 = new RyzStudio.Windows.ThemedForms.TButton(); - this.tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - this.textBox1 = new RyzStudio.Windows.ThemedForms.TTextBox(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.ForeColor = System.Drawing.SystemColors.ControlText; - this.label1.Location = new System.Drawing.Point(10, 21); - this.label1.Margin = new System.Windows.Forms.Padding(0); - this.label1.Name = "label1"; - this.label1.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); - this.label1.Size = new System.Drawing.Size(57, 34); - this.label1.TabIndex = 153; - this.label1.Text = "Password"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // button1 - // - this.button1.ActiveImage = null; - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.button1.BackColor = System.Drawing.Color.Transparent; - this.button1.HoverImage = null; - this.button1.IdleImage = null; - this.button1.LabelText = "&OK"; - this.button1.Location = new System.Drawing.Point(321, 99); - this.button1.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10); - this.button1.Name = "button1"; - this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.button1.Size = new System.Drawing.Size(128, 32); - this.button1.TabIndex = 1; - this.button1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.button1_MouseClick); - // - // tHorizontalSeparator1 - // - this.tHorizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tHorizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator1.BackColor = System.Drawing.Color.Transparent; - this.tHorizontalSeparator1.Location = new System.Drawing.Point(10, 67); - this.tHorizontalSeparator1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 10); - this.tHorizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2); - this.tHorizontalSeparator1.MinimumSize = new System.Drawing.Size(0, 22); - this.tHorizontalSeparator1.Name = "tHorizontalSeparator1"; - this.tHorizontalSeparator1.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); - this.tHorizontalSeparator1.Size = new System.Drawing.Size(444, 22); - this.tHorizontalSeparator1.TabIndex = 188; - this.tHorizontalSeparator1.TabStop = false; - // - // textBox1 - // - this.textBox1.AcceptButton = this.button1; - this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox1.BackColor = System.Drawing.Color.Transparent; - this.textBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.textBox1.Location = new System.Drawing.Point(121, 20); - this.textBox1.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10); - this.textBox1.Name = "textBox1"; - this.textBox1.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9); - this.textBox1.ReadOnly = false; - this.textBox1.Size = new System.Drawing.Size(328, 35); - this.textBox1.TabIndex = 0; - this.textBox1.UseSystemPasswordChar = true; - // - // PasswordForm - // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; - this.ClientSize = new System.Drawing.Size(464, 151); - this.Controls.Add(this.textBox1); - this.Controls.Add(this.tHorizontalSeparator1); - this.Controls.Add(this.button1); - this.Controls.Add(this.label1); - this.MinimumSize = new System.Drawing.Size(480, 190); - this.Name = "PasswordForm"; - this.Text = "Password"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - protected override void OnShown(EventArgs e) - { - base.OnShown(e); - - textBox1.Focus(); - } - - - [Browsable(false)] - public string Password => textBox1.Text; - - - private void textBox1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) - { - switch (e.KeyCode) - { - case Keys.Enter: - button1_MouseClick(sender, new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0)); - break; - case Keys.Escape: - this.Close(); - break; - default: break; - } - } - - private void button1_MouseClick(object sender, MouseEventArgs e) - { - if (e.Button == MouseButtons.Left) - { - this.DialogResult = DialogResult.OK; - this.Close(); - } - } - - } -} \ No newline at end of file diff --git a/PasswordForm.resx b/PasswordForm.resx deleted file mode 100644 index f298a7b..0000000 --- a/PasswordForm.resx +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/References/HtmlAgilityPack.dll b/References/HtmlAgilityPack.dll deleted file mode 100644 index d817f94..0000000 Binary files a/References/HtmlAgilityPack.dll and /dev/null differ diff --git a/References/Ryz3core.deps.json b/References/Ryz3core.deps.json deleted file mode 100644 index 0866e06..0000000 --- a/References/Ryz3core.deps.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "runtimeTarget": { - "name": ".NETCoreApp,Version=v6.0/win-x64", - "signature": "" - }, - "compilationOptions": {}, - "targets": { - ".NETCoreApp,Version=v6.0": {}, - ".NETCoreApp,Version=v6.0/win-x64": { - "Ryz3core/0.1.5.035": { - "dependencies": { - "HtmlAgilityPack": "1.11.46", - "System.Data.SQLite.Core": "1.0.117" - }, - "runtime": { - "Ryz3core.dll": {} - } - }, - "HtmlAgilityPack/1.11.46": { - "runtime": { - "lib/netstandard2.0/HtmlAgilityPack.dll": { - "assemblyVersion": "1.11.46.0", - "fileVersion": "1.11.46.0" - } - } - }, - "Stub.System.Data.SQLite.Core.NetStandard/1.0.117": { - "runtime": { - "lib/netstandard2.1/System.Data.SQLite.dll": { - "assemblyVersion": "1.0.117.0", - "fileVersion": "1.0.117.0" - } - }, - "native": { - "runtimes/win-x64/native/SQLite.Interop.dll": { - "fileVersion": "1.0.117.0" - } - } - }, - "System.Data.SQLite.Core/1.0.117": { - "dependencies": { - "Stub.System.Data.SQLite.Core.NetStandard": "1.0.117" - } - } - } - }, - "libraries": { - "Ryz3core/0.1.5.035": { - "type": "project", - "serviceable": false, - "sha512": "" - }, - "HtmlAgilityPack/1.11.46": { - "type": "package", - "serviceable": true, - "sha512": "sha512-dLMn4EVfJBHWmWK4Uh0XGD76FPLHI0qr2Tm0s1m/xmgiHb1JUb9zB8AzO8HtrkBBlMN6JfCUBYddhqC0hZNR+g==", - "path": "htmlagilitypack/1.11.46", - "hashPath": "htmlagilitypack.1.11.46.nupkg.sha512" - }, - "Stub.System.Data.SQLite.Core.NetStandard/1.0.117": { - "type": "package", - "serviceable": true, - "sha512": "sha512-x1zzPC/A4MmiKGDLoxLE6O5KLu7Kz7dyzhPQzlqYFTFcXmXAtM7hNNWpGw5yLEz833AnGbd/kxoitXArgR4YyA==", - "path": "stub.system.data.sqlite.core.netstandard/1.0.117", - "hashPath": "stub.system.data.sqlite.core.netstandard.1.0.117.nupkg.sha512" - }, - "System.Data.SQLite.Core/1.0.117": { - "type": "package", - "serviceable": true, - "sha512": "sha512-lGfOhA3QQod9XhdWYqLgNgbgq5uZnVG6DtnhDAdPisbLpTTgZBNbeGnp+GWt8C+3EyaqBYTGJWXcxHlHKwo05A==", - "path": "system.data.sqlite.core/1.0.117", - "hashPath": "system.data.sqlite.core.1.0.117.nupkg.sha512" - } - } -} \ No newline at end of file diff --git a/References/Ryz3core.dll b/References/Ryz3core.dll deleted file mode 100644 index 2a0daf0..0000000 Binary files a/References/Ryz3core.dll and /dev/null differ diff --git a/References/Ryz3ui.dll b/References/Ryz3ui.dll deleted file mode 100644 index f77c4e4..0000000 Binary files a/References/Ryz3ui.dll and /dev/null differ diff --git a/References/RyzStudio3.dll b/References/RyzStudio3.dll deleted file mode 100644 index 9dd315b..0000000 Binary files a/References/RyzStudio3.dll and /dev/null differ diff --git a/References/SQLite.Interop.dll b/References/SQLite.Interop.dll deleted file mode 100644 index 0736a58..0000000 Binary files a/References/SQLite.Interop.dll and /dev/null differ diff --git a/References/System.Data.SQLite.dll b/References/System.Data.SQLite.dll deleted file mode 100644 index 58593e6..0000000 Binary files a/References/System.Data.SQLite.dll and /dev/null differ diff --git a/Resources/icon-64.png b/Resources/icon-64.png new file mode 100644 index 0000000..1ca9e0b Binary files /dev/null and b/Resources/icon-64.png differ diff --git a/RyzStudio/IO/FileType.cs b/RyzStudio/IO/FileType.cs deleted file mode 100644 index 3c8b616..0000000 --- a/RyzStudio/IO/FileType.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace RyzStudio.IO -{ - public class FileType - { - protected static readonly byte[] BMP = { 66, 77 }; - protected static readonly byte[] GIF = { 71, 73, 70, 56 }; - protected static readonly byte[] ICO = { 0, 0, 1, 0 }; - protected static readonly byte[] JPG = { 255, 216, 255 }; - protected static readonly byte[] PNG = { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82 }; - - public static bool IsImage(byte[] byteArray) - { - if (byteArray == null) - { - return false; - } - - if (byteArray.Length <= 0) - { - return false; - } - - if (byteArray.Take(2).SequenceEqual(BMP)) - { - return true; - } - - if (byteArray.Take(4).SequenceEqual(GIF)) - { - return true; - } - - if (byteArray.Take(4).SequenceEqual(ICO)) - { - return true; - } - - if (byteArray.Take(3).SequenceEqual(JPG)) - { - return true; - } - - if (byteArray.Take(16).SequenceEqual(PNG)) - { - return true; - } - - return false; - } - } -} diff --git a/RyzStudio/IO/SharpZipLib.cs b/RyzStudio/IO/SharpZipLib.cs deleted file mode 100644 index 33729b8..0000000 --- a/RyzStudio/IO/SharpZipLib.cs +++ /dev/null @@ -1,241 +0,0 @@ -using System; -using System.IO; -using ICSharpCode.SharpZipLib.Zip; - -namespace RyzStudio.IO -{ - public class SharpZipLib - { - - - public static bool IsZipEncrypted(string filename) - { - bool rv = false; - - try - { - ZipInputStream readStream = new ZipInputStream(System.IO.File.OpenRead(filename)); - - ZipEntry theEntry = null; - while ((theEntry = readStream.GetNextEntry()) != null) - { - if (theEntry.IsCrypted) - { - rv = true; - } - - break; - } - - readStream.Close(); - readStream.Dispose(); - readStream = null; - } - catch - { - // do nothing - } - - return rv; - } - - //public static void AddFile(ZipOutputStream zipStream, string filename, string prefixPath = null) - //{ - // byte[] buffer = new byte[4096]; - - // string f1 = ""; - // if (prefixPath != null) - // { - // f1 = Path.GetDirectoryName(filename).TrimEnd('\\') + "\\"; - // f1 = f1.Replace(prefixPath, "").TrimEnd('\\') + "\\"; - // f1 = f1 + Path.GetFileName(filename); - // f1 = f1.TrimStart('\\'); - // } - - // ZipEntry entry = new ZipEntry(f1); - // entry.DateTime = DateTime.Now; - - // zipStream.PutNextEntry(entry); - - // FileStream fs = File.OpenRead(filename); - - // int sourceBytes; - - // do - // { - // sourceBytes = fs.Read(buffer, 0, buffer.Length); - // zipStream.Write(buffer, 0, sourceBytes); - // } - // while (sourceBytes > 0); - //} - - //public static void AddFolder(ZipOutputStream zipstream, string folderpath, string prefixpath = null) - //{ - // foreach (string fn in Directory.GetFiles(folderpath, "*.*", System.IO.SearchOption.AllDirectories)) - // { - // AddFile(zipstream, fn, prefixpath); - // } - //} - - public static string ReadSingle(string filename, string password, string entryFilename) - { - string rv = null; - - int size = 2048; - byte[] buffer = new byte[size]; - int bufferSize = 0; - - ZipEntry readEntry = null; - - try - { - ZipInputStream readStream = new ZipInputStream(File.OpenRead(filename)); - readStream.Password = password; - - while (true) - { - readEntry = readStream.GetNextEntry(); - if (readEntry == null) - { - break; - } - - if (string.IsNullOrWhiteSpace(readEntry.Name)) - { - continue; - } - - if (!readEntry.IsFile) - { - continue; - } - - if (!readEntry.Name.Equals(entryFilename)) - { - continue; - } - - MemoryStream ms = new MemoryStream(); - buffer = new byte[size]; - bufferSize = 0; - - do - { - bufferSize = readStream.Read(buffer, 0, buffer.Length); - ms.Write(buffer, 0, bufferSize); - } - while (bufferSize > 0); - - ms.Position = 0; - - StreamReader sr = new StreamReader(ms); - rv = sr.ReadToEnd(); - - break; - } - - readStream.Flush(); - readStream.Close(); - readStream.Dispose(); - readStream = null; - } - catch (Exception) - { - return rv; - } - - return rv; - } - - public static bool TestArchive(string filename, string password = null) - { - if (string.IsNullOrWhiteSpace(filename)) - { - return false; - } - - if (!File.Exists(filename)) - { - return false; - } - - ZipEntry readEntry = null; - - try - { - ZipInputStream readStream = new ZipInputStream(System.IO.File.OpenRead(filename)); - readStream.Password = password; - - while (true) - { - readEntry = readStream.GetNextEntry(); - if (readEntry == null) - { - break; - } - - //break; - } - - readStream.Close(); - readStream.Dispose(); - readStream = null; - } - catch (Exception) - { - return false; - } - - return true; - } - - public static bool CreateSingle(string filename, string password, string entryFilename, string content) - { - int size = 2048; - byte[] buffer = new byte[size]; - int bufferSize = 0; - - try - { - ZipOutputStream zipStream = new ZipOutputStream(File.Create(filename)); - zipStream.SetLevel(9); - zipStream.Password = password; - - // stream - MemoryStream ms = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(content)); - ms.Position = 0; - - // write file entry - zipStream.PutNextEntry(new ZipEntry(entryFilename)); - - buffer = new byte[size]; - bufferSize = 0; - - do - { - bufferSize = ms.Read(buffer, 0, buffer.Length); - zipStream.Write(buffer, 0, bufferSize); - } - while (bufferSize > 0); - - ms.Flush(); - ms.Close(); - ms.Dispose(); - ms = null; - - zipStream.Finish(); - zipStream.Flush(); - zipStream.Close(); - zipStream.Dispose(); - zipStream = null; - } - catch (Exception) - { - return false; - } - - return true; - } - - } -} \ No newline at end of file diff --git a/Services/WebProvider.cs b/Services/WebProvider.cs new file mode 100644 index 0000000..c592dd3 --- /dev/null +++ b/Services/WebProvider.cs @@ -0,0 +1,355 @@ +using System; +using System.Drawing; +using System.Net; +using System.Threading.Tasks; +using HtmlAgilityPack; +using RyzStudio.Net; + +namespace BookmarkManager.Services +{ + public class WebProvider + { + private readonly WebClientProvider _webClientProvider; + + + public WebProvider() + { + _webClientProvider = new WebClientProvider(); + _webClientProvider.Timeout = 4; + } + + + public bool IgnoreSSL + { + get => _webClientProvider.IgnoreSSL; + set + { + _webClientProvider.IgnoreSSL = value; + } + } + + + public async Task RetrieveHtmlDocument(string url) + { + var sourceCode = await this.RetrieveSourceCode(url); + if (string.IsNullOrWhiteSpace(sourceCode)) + { + return null; + } + + var document = new HtmlAgilityPack.HtmlDocument(); + + try + { + document.LoadHtml(sourceCode); + } + catch (Exception) + { + return null; + } + + return document; + } + + public async Task RetrieveSourceCode(string url) + { + if (string.IsNullOrWhiteSpace(url)) + { + return null; + } + + if (!Uri.TryCreate(url, UriKind.Absolute, out Uri uri)) + { + return null; + } + + System.Net.Http.HttpResponseMessage response; + + try + { + response = await _webClientProvider.Get(url?.Trim()); + } + catch (Exception) + { + return null; + } + + if (response == null) + { + return null; + + } + + if (response.StatusCode != HttpStatusCode.OK) + { + return null; + } + + var sourceCode = ""; + + try + { + sourceCode = await response?.Content?.ReadAsStringAsync(); + } + catch (Exception) + { + // do nothing + } + + if (string.IsNullOrWhiteSpace(sourceCode)) + { + return null; + } + + return sourceCode; + } + + public async Task RetrieveImage(string url) + { + if (string.IsNullOrWhiteSpace(url)) + { + return null; + } + + if (!Uri.TryCreate(url, UriKind.Absolute, out Uri uri)) + { + return null; + } + + System.Net.Http.HttpResponseMessage response; + + try + { + response = await _webClientProvider.Get(url?.Trim()); + } + catch (Exception) + { + return null; + } + + if (response.StatusCode != HttpStatusCode.OK) + { + return null; + } + + var stream = await response?.Content?.ReadAsStreamAsync(); + + Image result = null; + + try + { + result = Image.FromStream(stream); + } + catch (Exception) + { + return null; + } + + return result; + } + + public async Task RetrieveImage(HtmlAgilityPack.HtmlDocument document) + { + var iconUrl = this.ParseFavicon(document); + if (string.IsNullOrWhiteSpace(iconUrl)) + { + return null; + } + + return await this.RetrieveImage(iconUrl); + } + + public string ParseTitle(HtmlAgilityPack.HtmlDocument document) + { + string result = null; + + result = ParseTagValue(document, "//title", string.Empty)?.Trim(); + if (!string.IsNullOrWhiteSpace(result)) + { + return result; + } + + result = ParseTagValue_Attr(document, "//meta[@property='og:title']", "content", string.Empty)?.Trim(); + if (!string.IsNullOrWhiteSpace(result)) + { + return result; + } + + result = ParseTagValue_Attr(document, "//meta[@name='twitter:title']", "content", string.Empty)?.Trim(); + if (!string.IsNullOrWhiteSpace(result)) + { + return result; + } + + result = ParseTagValue_Attr(document, "//meta[@property='og:site_name']", "content", string.Empty)?.Trim(); + if (!string.IsNullOrWhiteSpace(result)) + { + return result; + } + + result = ParseTagValue_Attr(document, "//meta[@itemprop='name']", "content", string.Empty)?.Trim(); + if (!string.IsNullOrWhiteSpace(result)) + { + return result; + } + + return string.Empty; + } + + public string ParseMetaDescription(HtmlAgilityPack.HtmlDocument document) + { + string result = null; + + result = ParseTagValue_Attr(document, "//meta[@name='description']", "content", string.Empty)?.Trim(); + if (!string.IsNullOrWhiteSpace(result)) + { + return result; + } + + result = ParseTagValue_Attr(document, "//meta[@property='og:description']", "content", string.Empty)?.Trim(); + if (!string.IsNullOrWhiteSpace(result)) + { + return result; + } + + result = ParseTagValue_Attr(document, "//meta[@name='twitter:description']", "content", string.Empty)?.Trim(); + if (!string.IsNullOrWhiteSpace(result)) + { + return result; + } + + result = ParseTagValue_Attr(document, "//meta[@property='og:description']", "content", string.Empty)?.Trim(); + if (!string.IsNullOrWhiteSpace(result)) + { + return result; + } + + result = ParseTagValue_Attr(document, "//meta[@itemprop='description']", "content", string.Empty)?.Trim(); + if (!string.IsNullOrWhiteSpace(result)) + { + return result; + } + + return result; + } + + public string ParseFavicon(HtmlAgilityPack.HtmlDocument document) + { + string result = null; + + result = ParseTagValue_Attr(document, "//link[translate(@rel, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'shortcut icon']", "href", string.Empty)?.Trim(); + if (!string.IsNullOrWhiteSpace(result)) + { + return result; + } + + result = ParseTagValue_Attr(document, "//link[translate(@rel, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'icon']", "href", string.Empty)?.Trim(); + if (!string.IsNullOrWhiteSpace(result)) + { + return result; + } + + result = ParseTagValue_Attr(document, "//link[translate(@rel, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'apple-touch-icon']", "href", string.Empty)?.Trim(); + if (!string.IsNullOrWhiteSpace(result)) + { + return result; + } + + result = ParseTagValue_Attr(document, "//link[translate(@rel, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'apple-touch-icon-precomposed']", "href", string.Empty)?.Trim(); + if (!string.IsNullOrWhiteSpace(result)) + { + return result; + } + + result = ParseTagValue_Attr(document, "//meta[translate(@property, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'og:image']", "content", string.Empty)?.Trim(); + if (!string.IsNullOrWhiteSpace(result)) + { + return result; + } + + result = ParseTagValue_Attr(document, "//meta[translate(@name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'twitter:image']", "content", string.Empty)?.Trim(); + if (!string.IsNullOrWhiteSpace(result)) + { + return result; + } + + result = ParseTagValue_Attr(document, "//meta[translate(@property, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'og:image']", "content", string.Empty)?.Trim(); + if (!string.IsNullOrWhiteSpace(result)) + { + return result; + } + + result = ParseTagValue_Attr(document, "//meta[translate(@itemprop, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'image']", "content", string.Empty)?.Trim(); + if (!string.IsNullOrWhiteSpace(result)) + { + return result; + } + + return "/favicon.ico"; + } + + private string ParseTagValue(HtmlAgilityPack.HtmlDocument document, string xPath, string defaultValue = "") + { + var hnc = document.DocumentNode.SelectNodes(xPath); + if (hnc == null) + { + return defaultValue; + } + + if (hnc.Count <= 0) + { + return defaultValue; + } + + foreach (HtmlNode hn in hnc) + { + if (string.IsNullOrWhiteSpace(hn.InnerHtml)) + { + continue; + } + + var result = WebUtility.HtmlDecode(hn.InnerHtml)?.Replace("\r", "")?.Replace("\n", " ")?.Trim(); + if (string.IsNullOrWhiteSpace(result)) + { + continue; + } + + return result; + } + + return defaultValue; + } + + private string ParseTagValue_Attr(HtmlAgilityPack.HtmlDocument document, string xPath, string attr, string defaultValue = "") + { + var hnc = document.DocumentNode.SelectNodes(xPath); + if (hnc == null) + { + return defaultValue; + } + + if (hnc.Count <= 0) + { + return defaultValue; + } + + foreach (HtmlNode hn in hnc) + { + if (hn.Attributes[attr] == null) + { + continue; + } + + if (string.IsNullOrWhiteSpace(hn.Attributes[attr].Value)) + { + continue; + } + + return System.Web.HttpUtility.HtmlDecode(hn.Attributes[attr].Value?.Trim()); + } + + return defaultValue; + } + + } +} \ No newline at end of file diff --git a/UpdateIconsForm.cs b/UpdateIconsForm.cs index 7a354be..606fd69 100644 --- a/UpdateIconsForm.cs +++ b/UpdateIconsForm.cs @@ -1,359 +1,438 @@ using System; using System.Collections.Generic; -using System.Drawing; -using System.Net; +using System.ComponentModel; +using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; -using BookmarkManager; +using BookmarkManager.Services; using bzit.bomg.Models; -using FizzyLauncher.Models; -using RyzStudio; -using RyzStudio.IO; using RyzStudio.Windows.Forms; using RyzStudio.Windows.ThemedForms; using RyzStudio.Windows.ThemedForms.PickerBox; namespace FizzyLauncher { - public class UpdateIconsForm : TDialogForm + public class UpdateIconsForm : Form { private System.Windows.Forms.Label label1; - private TButton button1; - private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator1; private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator2; private Label label2; private PictureBox pictureBox2; - - private ToolTip toolTip1; - private System.ComponentModel.IContainer components; - - protected BookmarkTreeView bookmarkTreeView = null; - protected IconDatabase iconDatabase = null; - protected AppSession appSession = null; - - protected WebParser webParser = null; - protected WebClient webClient = null; - private TYesNoPickerBox pickerBox1; - private TButton button2; + private ThYesNoPickerBox pickerBox1; + private ThButton button2; + private RyzStudio.Windows.ThemedForms.ThProgressBar progressBar1; - private RyzStudio.Windows.ThemedForms.TProgressBar progressBar1; - protected bool requestCancellation = false; + private readonly WebProvider _webProvider; + private BookmarkTreeView _treeView; + private bool _isBusy = false; + private Label label4; + private THorizontalSeparator tHorizontalSeparator3; + private ThButton button3; + private ThProgressBar progressBar2; + private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1; + private bool _requestCancel = false; - public UpdateIconsForm(AppSession session, BookmarkTreeView treeView, IconDatabase database) + public UpdateIconsForm(BookmarkTreeView treeView) { InitializeComponent(); - bookmarkTreeView = treeView; - iconDatabase = database; - appSession = session; + UISetup.Dialog(this); - pickerBox1.ComboBox.SelectedIndexChanged += comboBox1_SelectedIndexChanged; + _webProvider = new WebProvider(); + _webProvider.IgnoreSSL = true; + _treeView = treeView; } private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.label1 = new System.Windows.Forms.Label(); - this.button1 = new RyzStudio.Windows.ThemedForms.TButton(); - this.tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - this.tHorizontalSeparator2 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - this.label2 = new System.Windows.Forms.Label(); - this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.pictureBox2 = new System.Windows.Forms.PictureBox(); - this.pickerBox1 = new RyzStudio.Windows.ThemedForms.PickerBox.TYesNoPickerBox(); - this.button2 = new RyzStudio.Windows.ThemedForms.TButton(); - this.progressBar1 = new RyzStudio.Windows.ThemedForms.TProgressBar(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); - this.SuspendLayout(); - // + label1 = new Label(); + tHorizontalSeparator2 = new THorizontalSeparator(); + label2 = new Label(); + pictureBox2 = new PictureBox(); + pickerBox1 = new ThYesNoPickerBox(); + button2 = new ThButton(); + progressBar1 = new ThProgressBar(); + label4 = new Label(); + tHorizontalSeparator3 = new THorizontalSeparator(); + button3 = new ThButton(); + progressBar2 = new ThProgressBar(); + dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter(); + ((ISupportInitialize)pictureBox2).BeginInit(); + SuspendLayout(); + // // label1 - // - this.label1.AutoSize = true; - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.ForeColor = System.Drawing.SystemColors.ControlText; - this.label1.Location = new System.Drawing.Point(10, 21); - this.label1.Margin = new System.Windows.Forms.Padding(0); - this.label1.Name = "label1"; - this.label1.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); - this.label1.Size = new System.Drawing.Size(133, 34); - this.label1.TabIndex = 153; - this.label1.Text = "Find Missing Icons Only"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // button1 - // - this.button1.AcceptButton = null; - this.button1.ActiveImage = null; - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.button1.BackColor = System.Drawing.Color.Transparent; - this.button1.HoverImage = null; - this.button1.IdleImage = null; - this.button1.LabelText = "&Close"; - this.button1.Location = new System.Drawing.Point(241, 469); - this.button1.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10); - this.button1.Name = "button1"; - this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.button1.Size = new System.Drawing.Size(128, 32); - this.button1.TabIndex = 2; - this.button1.TabStop = false; - this.button1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.button1_MouseClick); - // - // tHorizontalSeparator1 - // - this.tHorizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tHorizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator1.BackColor = System.Drawing.Color.Transparent; - this.tHorizontalSeparator1.Location = new System.Drawing.Point(10, 437); - this.tHorizontalSeparator1.Margin = new System.Windows.Forms.Padding(0, 10, 0, 10); - this.tHorizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2); - this.tHorizontalSeparator1.MinimumSize = new System.Drawing.Size(0, 22); - this.tHorizontalSeparator1.Name = "tHorizontalSeparator1"; - this.tHorizontalSeparator1.Size = new System.Drawing.Size(364, 22); - this.tHorizontalSeparator1.TabIndex = 188; - this.tHorizontalSeparator1.TabStop = false; - // + // + label1.AutoSize = true; + label1.BackColor = System.Drawing.Color.Transparent; + label1.ForeColor = System.Drawing.SystemColors.ControlText; + label1.Location = new System.Drawing.Point(10, 20); + label1.Margin = new Padding(0); + label1.Name = "label1"; + label1.Padding = new Padding(0, 8, 0, 0); + label1.Size = new System.Drawing.Size(156, 23); + label1.TabIndex = 153; + label1.Text = "Update Missing Icons (Only)"; + label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // tHorizontalSeparator2 - // - this.tHorizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tHorizontalSeparator2.AutoScrollMargin = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator2.AutoScrollMinSize = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator2.BackColor = System.Drawing.Color.Transparent; - this.tHorizontalSeparator2.Location = new System.Drawing.Point(10, 59); - this.tHorizontalSeparator2.Margin = new System.Windows.Forms.Padding(0, 10, 0, 10); - this.tHorizontalSeparator2.MaximumSize = new System.Drawing.Size(4920, 2); - this.tHorizontalSeparator2.MinimumSize = new System.Drawing.Size(0, 22); - this.tHorizontalSeparator2.Name = "tHorizontalSeparator2"; - this.tHorizontalSeparator2.Size = new System.Drawing.Size(364, 22); - this.tHorizontalSeparator2.TabIndex = 190; - this.tHorizontalSeparator2.TabStop = false; - // + // + tHorizontalSeparator2.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + tHorizontalSeparator2.AutoScrollMargin = new System.Drawing.Size(0, 0); + tHorizontalSeparator2.AutoScrollMinSize = new System.Drawing.Size(0, 0); + tHorizontalSeparator2.BackColor = System.Drawing.Color.Transparent; + tHorizontalSeparator2.Location = new System.Drawing.Point(10, 64); + tHorizontalSeparator2.Margin = new Padding(0, 10, 0, 0); + tHorizontalSeparator2.MaximumSize = new System.Drawing.Size(4920, 2); + tHorizontalSeparator2.MinimumSize = new System.Drawing.Size(0, 22); + tHorizontalSeparator2.Name = "tHorizontalSeparator2"; + tHorizontalSeparator2.Size = new System.Drawing.Size(424, 22); + tHorizontalSeparator2.TabIndex = 190; + tHorizontalSeparator2.TabStop = false; + // // label2 - // - this.label2.AutoSize = true; - this.label2.BackColor = System.Drawing.Color.Transparent; - this.label2.ForeColor = System.Drawing.SystemColors.ControlText; - this.label2.Location = new System.Drawing.Point(10, 85); - this.label2.Margin = new System.Windows.Forms.Padding(0); - this.label2.Name = "label2"; - this.label2.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); - this.label2.Size = new System.Drawing.Size(52, 34); - this.label2.TabIndex = 195; - this.label2.Text = "Progress"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // + // + label2.AutoSize = true; + label2.BackColor = System.Drawing.Color.Transparent; + label2.ForeColor = System.Drawing.SystemColors.ControlText; + label2.Location = new System.Drawing.Point(10, 136); + label2.Margin = new Padding(0); + label2.Name = "label2"; + label2.Padding = new Padding(0, 8, 0, 0); + label2.Size = new System.Drawing.Size(231, 23); + label2.TabIndex = 195; + label2.Text = "Retrieve supported icons from bookmarks."; + label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // pictureBox2 - // - this.pictureBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.pictureBox2.BackColor = System.Drawing.Color.Transparent; - this.pictureBox2.ErrorImage = null; - this.pictureBox2.InitialImage = null; - this.pictureBox2.Location = new System.Drawing.Point(196, 469); - this.pictureBox2.Name = "pictureBox2"; - this.pictureBox2.Size = new System.Drawing.Size(32, 32); - this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; - this.pictureBox2.TabIndex = 202; - this.pictureBox2.TabStop = false; - // + // + pictureBox2.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; + pictureBox2.BackColor = System.Drawing.Color.Transparent; + pictureBox2.ErrorImage = null; + pictureBox2.InitialImage = null; + pictureBox2.Location = new System.Drawing.Point(402, 294); + pictureBox2.Name = "pictureBox2"; + pictureBox2.Size = new System.Drawing.Size(32, 32); + pictureBox2.SizeMode = PictureBoxSizeMode.CenterImage; + pictureBox2.TabIndex = 202; + pictureBox2.TabStop = false; + // // pickerBox1 - // - this.pickerBox1.AcceptButton = null; - this.pickerBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pickerBox1.BackColor = System.Drawing.Color.Transparent; - this.pickerBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.pickerBox1.Location = new System.Drawing.Point(285, 21); - this.pickerBox1.Margin = new System.Windows.Forms.Padding(10, 10, 10, 0); - this.pickerBox1.Name = "pickerBox1"; - this.pickerBox1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.pickerBox1.SelectedIndex = 1; - this.pickerBox1.Size = new System.Drawing.Size(84, 35); - this.pickerBox1.TabIndex = 0; - this.pickerBox1.TabStop = false; - this.pickerBox1.Value = true; - // + // + pickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right; + pickerBox1.BackColor = System.Drawing.Color.Transparent; + pickerBox1.EnableReactiveVisual = true; + pickerBox1.Font = new System.Drawing.Font("Segoe UI", 9F); + pickerBox1.Location = new System.Drawing.Point(350, 20); + pickerBox1.Name = "pickerBox1"; + pickerBox1.SelectedIndex = 1; + pickerBox1.Size = new System.Drawing.Size(84, 35); + pickerBox1.TabIndex = 0; + pickerBox1.TabStop = false; + pickerBox1.Value = true; + // // button2 - // - this.button2.AcceptButton = null; - this.button2.ActiveImage = null; - this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.button2.BackColor = System.Drawing.Color.Transparent; - this.button2.HoverImage = null; - this.button2.IdleImage = null; - this.button2.LabelText = "&Run"; - this.button2.Location = new System.Drawing.Point(241, 168); - this.button2.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10); - this.button2.Name = "button2"; - this.button2.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.button2.Size = new System.Drawing.Size(128, 32); - this.button2.TabIndex = 1; - this.button2.TabStop = false; - this.button2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.button2_MouseClick); - // + // + button2.ActiveImage = null; + button2.Anchor = AnchorStyles.Top | AnchorStyles.Right; + button2.BackColor = System.Drawing.Color.Transparent; + button2.EnableMenuOnClick = false; + button2.EnableReactiveVisual = true; + button2.HoverImage = null; + button2.IdleImage = null; + button2.LabelText = "&Run"; + button2.Location = new System.Drawing.Point(306, 136); + button2.Name = "button2"; + button2.Size = new System.Drawing.Size(128, 32); + button2.TabIndex = 1; + button2.TabStop = false; + button2.MouseClick += button2_MouseClick; + // // progressBar1 - // - this.progressBar1.AcceptButton = null; - this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.progressBar1.BackColor = System.Drawing.Color.Transparent; - this.progressBar1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.progressBar1.Location = new System.Drawing.Point(10, 119); - this.progressBar1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); - this.progressBar1.Name = "progressBar1"; - this.progressBar1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.progressBar1.Size = new System.Drawing.Size(359, 33); - this.progressBar1.TabIndex = 206; - this.progressBar1.TabStop = false; - // + // + progressBar1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + progressBar1.BackColor = System.Drawing.Color.Transparent; + progressBar1.BarColour = System.Drawing.Color.FromArgb(79, 202, 130); + progressBar1.BarTextColour = System.Drawing.Color.Black; + progressBar1.EnableReactiveVisual = false; + progressBar1.Font = new System.Drawing.Font("Segoe UI", 9F); + progressBar1.Location = new System.Drawing.Point(10, 96); + progressBar1.Maximum = 100; + progressBar1.Minimum = 0; + progressBar1.Name = "progressBar1"; + progressBar1.ProgressText = "50/100"; + progressBar1.ShowProgressText = true; + progressBar1.Size = new System.Drawing.Size(424, 20); + progressBar1.TabIndex = 206; + progressBar1.TabStop = false; + progressBar1.Value = 50; + // + // label4 + // + label4.AutoSize = true; + label4.BackColor = System.Drawing.Color.Transparent; + label4.ForeColor = System.Drawing.SystemColors.ControlText; + label4.Location = new System.Drawing.Point(10, 250); + label4.Margin = new Padding(0); + label4.Name = "label4"; + label4.Padding = new Padding(0, 8, 0, 0); + label4.Size = new System.Drawing.Size(83, 23); + label4.TabIndex = 208; + label4.Text = "Clear all icons."; + label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // tHorizontalSeparator3 + // + tHorizontalSeparator3.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + tHorizontalSeparator3.AutoScrollMargin = new System.Drawing.Size(0, 0); + tHorizontalSeparator3.AutoScrollMinSize = new System.Drawing.Size(0, 0); + tHorizontalSeparator3.BackColor = System.Drawing.Color.Transparent; + tHorizontalSeparator3.Location = new System.Drawing.Point(10, 178); + tHorizontalSeparator3.Margin = new Padding(0, 10, 0, 0); + tHorizontalSeparator3.MaximumSize = new System.Drawing.Size(4920, 2); + tHorizontalSeparator3.MinimumSize = new System.Drawing.Size(0, 22); + tHorizontalSeparator3.Name = "tHorizontalSeparator3"; + tHorizontalSeparator3.Size = new System.Drawing.Size(424, 22); + tHorizontalSeparator3.TabIndex = 207; + tHorizontalSeparator3.TabStop = false; + // + // button3 + // + button3.ActiveImage = null; + button3.BackColor = System.Drawing.Color.Transparent; + button3.EnableMenuOnClick = false; + button3.EnableReactiveVisual = true; + button3.HoverImage = null; + button3.IdleImage = null; + button3.LabelText = "Clear &All"; + button3.Location = new System.Drawing.Point(306, 250); + button3.Name = "button3"; + button3.Size = new System.Drawing.Size(128, 32); + button3.TabIndex = 209; + button3.TabStop = false; + button3.MouseClick += button3_MouseClick; + // + // progressBar2 + // + progressBar2.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + progressBar2.BackColor = System.Drawing.Color.Transparent; + progressBar2.BarColour = System.Drawing.Color.FromArgb(79, 193, 203); + progressBar2.BarTextColour = System.Drawing.Color.Black; + progressBar2.EnableReactiveVisual = false; + progressBar2.Font = new System.Drawing.Font("Segoe UI", 9F); + progressBar2.Location = new System.Drawing.Point(10, 210); + progressBar2.Maximum = 100; + progressBar2.Minimum = 0; + progressBar2.Name = "progressBar2"; + progressBar2.ProgressText = "50/100"; + progressBar2.ShowProgressText = true; + progressBar2.Size = new System.Drawing.Size(424, 20); + progressBar2.TabIndex = 210; + progressBar2.TabStop = false; + progressBar2.Value = 50; + // + // dialogFooter1 + // + dialogFooter1.BackColor = System.Drawing.Color.FromArgb(240, 240, 240); + dialogFooter1.Button1Text = "&Close"; + dialogFooter1.Dialog = null; + dialogFooter1.Dock = DockStyle.Bottom; + dialogFooter1.Location = new System.Drawing.Point(0, 437); + dialogFooter1.Name = "dialogFooter1"; + dialogFooter1.Size = new System.Drawing.Size(444, 84); + // // UpdateIconsForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(384, 521); - this.Controls.Add(this.progressBar1); - this.Controls.Add(this.button2); - this.Controls.Add(this.pickerBox1); - this.Controls.Add(this.pictureBox2); - this.Controls.Add(this.label2); - this.Controls.Add(this.tHorizontalSeparator2); - this.Controls.Add(this.tHorizontalSeparator1); - this.Controls.Add(this.button1); - this.Controls.Add(this.label1); - this.KeyPreview = true; - this.MinimumSize = new System.Drawing.Size(400, 560); - this.Name = "UpdateIconsForm"; - this.Text = "Update Icons"; - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - + // + AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + BackColor = System.Drawing.Color.White; + ClientSize = new System.Drawing.Size(444, 521); + Controls.Add(dialogFooter1); + Controls.Add(progressBar2); + Controls.Add(button3); + Controls.Add(label4); + Controls.Add(tHorizontalSeparator3); + Controls.Add(progressBar1); + Controls.Add(button2); + Controls.Add(pickerBox1); + Controls.Add(pictureBox2); + Controls.Add(label2); + Controls.Add(tHorizontalSeparator2); + Controls.Add(label1); + KeyPreview = true; + MinimumSize = new System.Drawing.Size(460, 560); + Name = "UpdateIconsForm"; + Text = "Update Icons"; + ((ISupportInitialize)pictureBox2).EndInit(); + ResumeLayout(false); + PerformLayout(); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); - comboBox1_SelectedIndexChanged(null, null); - } - - - protected new bool IsBusy - { - get => base.IsBusy; - set - { - base.IsBusy = value; - - UIControl.SetValue(pictureBox2, (this.IsBusy ? UIResource1.loading_block : null)); - - UIControl.SetEnable(pickerBox1, !this.IsBusy); - button2.LabelText = (this.IsBusy ? "&Stop" : "&Run"); - } - } - - - private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) - { - if (IsBusy) - { - return; - } - - List bookmarkList = GetBookmarkFilteredList(); - - progressBar1.ProgressBar.Reset(bookmarkList.Count); - } - - private async void button2_MouseClick(object sender, MouseEventArgs e) - { - await Task.Run(() => - { - if (IsBusy) - { - requestCancellation = true; - return; - } - - IsBusy = true; - - WebParser webParser = new WebParser(); - List bookmarkList = GetBookmarkFilteredList(); - - progressBar1.ProgressBar.Reset(bookmarkList.Count); - - for (int i=0; i GetBookmarkFilteredList() - { - List rs = bookmarkTreeView.GetBookmarkList(); - - // remove empty - for (int i = 0; i < rs.Count; i++) - { - if (string.IsNullOrWhiteSpace(rs[i].SiteAddress)) - { - rs.Remove(rs[i]); - } - } + var model = _treeView.ToNodeList(); if (pickerBox1.Value) { - for (int i = 0; i < rs.Count; i++) - { - if (iconDatabase.HasIcon(rs[i].ToHash())) - { - rs.Remove(rs[i]); - } - } + model = model.Where(x => x.Value.Icon == null)?.ToList() ?? new List>(); } - return rs; + progressBar1.Minimum = 0; + progressBar1.Value = 0; + progressBar1.Maximum = model.Count; + + progressBar2.Minimum = 0; + progressBar2.Value = 0; + progressBar2.Maximum = model.Count; + + pickerBox1.Focus(); + } + + protected override void OnClosing(CancelEventArgs e) + { + base.OnClosing(e); + + if (this.IsBusy) + { + e.Cancel = true; + } } + protected bool IsBusy + { + get => _isBusy; + set + { + _isBusy = value; + + UIControl.SetEnable(pickerBox1, !this.IsBusy); + UIControl.Invoke(button2, (x) => + { + button2.LabelText = (this.IsBusy ? "&Stop" : "&Run"); + }); + UIControl.Invoke(button3, (x) => + { + button3.LabelText = (this.IsBusy ? "&Stop" : "Clear &All"); + }); + UIControl.SetValue(pictureBox2, (this.IsBusy ? RyzStudio.Windows.ThemedForms.Resource2.loading_block : null)); + } + } + + + private async void button2_MouseClick(object sender, MouseEventArgs e) + { + await Task.Run(async () => + { + if (this.IsBusy) + { + _requestCancel = true; + return; + } + + this.IsBusy = true; + + var model = _treeView.ToNodeList(); + + if (pickerBox1.Value) + { + model = model.Where(x => x.Value.Icon == null)?.ToList() ?? new List>(); + } + + progressBar1.Minimum = 0; + progressBar1.Value = 0; + progressBar1.Maximum = model.Count; + + foreach (var item in model) + { + progressBar1.Value++; + + if (string.IsNullOrWhiteSpace(item.Value.Address)) + { + continue; + } + + if (_requestCancel) + { + break; + } + + var document = await _webProvider.RetrieveHtmlDocument(item.Value.Address); + if (document == null) + { + continue; + } + + if (_requestCancel) + { + break; + } + + var image = await _webProvider.RetrieveImage(document); + if (image == null) + { + continue; + } + + var newModel = item.Value; + newModel.Icon = image; + + _treeView.UpdateNode(item.Key, newModel); + } + + _requestCancel = false; + + this.IsBusy = false; + }); + } + + private async void button3_MouseClick(object sender, MouseEventArgs e) + { + await Task.Run(() => + { + if (this.IsBusy) + { + _requestCancel = true; + return; + } + + this.IsBusy = true; + + var model = _treeView.ToNodeList(); + + progressBar2.Minimum = 0; + progressBar2.Value = 0; + progressBar2.Maximum = model.Count; + + foreach (var item in model) + { + progressBar2.Value++; + + if (item.Value.Icon == null) + { + continue; + } + + if (_requestCancel) + { + break; + } + + var newModel = item.Value; + newModel.Icon = null; + + _treeView.UpdateNode(item.Key, newModel); + } + + _requestCancel = false; + + this.IsBusy = false; + }); + } + } } \ No newline at end of file diff --git a/UpdateIconsForm.resx b/UpdateIconsForm.resx index 57523cc..af32865 100644 --- a/UpdateIconsForm.resx +++ b/UpdateIconsForm.resx @@ -1,4 +1,64 @@ - + + + @@ -57,7 +117,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 17 - \ No newline at end of file diff --git a/Windows/Forms/BookmarkTreeView.cs b/Windows/Forms/BookmarkTreeView.cs index 9da5035..b9073e3 100644 --- a/Windows/Forms/BookmarkTreeView.cs +++ b/Windows/Forms/BookmarkTreeView.cs @@ -1,192 +1,15 @@ -using BookmarkManager; -using bzit.bomg.Models; -using System; -using System.Collections.Generic; -using System.ComponentModel; +using System.ComponentModel; using System.Drawing; -using System.Text; using System.Windows.Forms; +using bzit.bomg.Models; +using FizzyLauncher; using Resources = BookmarkManager.AppResource; namespace RyzStudio.Windows.Forms { - public partial class BookmarkTreeView : TreeView + public partial class BookmarkTreeView : TTreeView { - public static string DecodePath(string value) => System.Web.HttpUtility.UrlDecode(value); - - public static void DeleteNode(TreeNode node) - { - if (node == null) - { - return; - } - - if (node.TreeView.Nodes.Count <= 0) - { - return; - } - - if (node.Equals(node.TreeView.Nodes[0])) - { - return; - } - - node.Remove(); - } - - public static string EncodePath(string value) - { - return System.Web.HttpUtility.UrlEncode(value); - } - - public static BookmarkItem GetNodeModel(TreeNode node) - { - if (node == null) - { - return null; - } - - return (BookmarkItem)node.Tag; - } - - public static string GetNodePath(TreeNode node) - { - string[] folderList = node.FullPath.Split('\n'); - if (folderList.Length < 2) - { - return null; - } - - //if (folderList.Length < 2) - //{ - // return "/"; - //} - - StringBuilder sb = new StringBuilder(); - - for (int i = 0; i < (folderList.Length - 1); i++) - { - sb.Append("\\"); - sb.Append(EncodePath(folderList[i] ?? string.Empty)); - } - - sb.Append("\\"); - - return sb.ToString(); - } - - public static NodeType GetNodeType(TreeNode node) - { - if (node.Tag == null) - { - if (node.Equals(node.TreeView.Nodes[0])) - { - return NodeType.Root; - } - else - { - return NodeType.Folder; - } - } - else - { - if (node.Tag is BookmarkItem) - { - return NodeType.Page; - } - else - { - return NodeType.None; - } - } - } - - public static void MoveDown(TreeNode node) - { - if (node == null) - { - return; - } - - TreeNode tn = node; - if (tn.Parent == null) - { - return; - } - - TreeNode tn1 = tn.Parent; - - if (tn.Index >= (tn1.Nodes.Count - 1)) - { - return; - } - - int n = tn.Index + 1; - - tn1.Nodes.Remove(tn); - tn1.Nodes.Insert(n, tn); - - node.TreeView.SelectedNode = tn; - } - - public static void MoveUp(TreeNode node) - { - if (node == null) - { - return; - } - - TreeNode tn = node; - if (tn.Parent == null) - { - return; - } - - if (tn.Index <= 0) - { - return; - } - - int n = tn.Index - 1; - - TreeNode tn1 = tn.Parent; - tn1.Nodes.Remove(tn); - tn1.Nodes.Insert(n, tn); - - node.TreeView.SelectedNode = tn; - } - - public static void Sort(TreeNode node) - { - if (node == null) - { - return; - } - - string[] tnv = new string[0]; - TreeNode[] tna = new TreeNode[0]; - - foreach (TreeNode tn2 in node.Nodes) - { - Array.Resize(ref tna, (tna.Length + 1)); - tna[(tna.Length - 1)] = tn2; - - Array.Resize(ref tnv, (tnv.Length + 1)); - tnv[(tnv.Length - 1)] = tn2.Text; - } - - Array.Sort(tnv, tna); - - node.Nodes.Clear(); - - foreach (TreeNode tn2 in tna) - { - node.Nodes.Add(tn2); - } - } - - - public enum IconSet + public enum NodeIcon { Root = 0, Folder1, @@ -204,143 +27,36 @@ namespace RyzStudio.Windows.Forms protected const string DEFAULT_NEW_FOLDER_NAME = "New Folder"; - protected const string PATH_SEPARATOR = "\n"; - - public event EventHandler OnNodeChanged = null; - - protected TreeNode draggingNode = null; - protected bool hasChanged = false; public BookmarkTreeView() { - if (this.ImageList == null) this.ImageList = new ImageList(); - this.PathSeparator = PATH_SEPARATOR; + if (this.ImageList == null) + { + this.ImageList = new ImageList(); + } - this.AllowDrop = true; - this.HideSelection = false; - this.HotTracking = true; - this.ImageIndex = 0; - this.LabelEdit = true; - this.PathSeparator = "\n"; - this.SelectedImageIndex = 0; - this.ShowNodeToolTips = true; + //this.PathSeparator = PATH_SEPARATOR; + + //this.AllowDrop = true; + //this.HideSelection = false; + //this.HotTracking = true; + //this.ImageIndex = 0; + //this.LabelEdit = true; + //this.PathSeparator = "\n"; + //this.SelectedImageIndex = 0; + //this.ShowNodeToolTips = true; this.ImageList.ColorDepth = ColorDepth.Depth32Bit; this.ImageList.ImageSize = new Size(16, 16); this.ImageList.TransparentColor = Color.Transparent; - ResetImageList(); + ClearImageList(); } #region integrated behaviour - protected override void OnItemDrag(ItemDragEventArgs e) - { - base.OnItemDrag(e); - - draggingNode = (TreeNode)e.Item; - DoDragDrop(e.Item, DragDropEffects.Move); - } - - protected override void OnDragDrop(DragEventArgs e) - { - base.OnDragDrop(e); - - if (draggingNode.Level <= 0) - { - return; - } - - TreeNode node = this.GetNodeAt(this.PointToClient(new Point(e.X, e.Y))); - if (node == null) - { - return; - } - - if (UIControl.IsChild(draggingNode, node)) - { - return; - } - - TreeNode dn = draggingNode; - if (node.Tag == null) - { - dn.Parent.Nodes.Remove(dn); - node.Nodes.Insert(0, dn); - } - else - { - node.Parent.Nodes.Remove(dn); - node.Parent.Nodes.Insert(node.Index + 1, dn); - } - - this.HasChanged = true; - } - - protected override void OnDragEnter(DragEventArgs e) - { - base.OnDragEnter(e); - - e.Effect = DragDropEffects.Move; - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - - this.SelectedNode = this.GetNodeAt(e.Location); - } - - protected override void OnDragOver(DragEventArgs e) - { - base.OnDragOver(e); - - this.SelectedNode = this.GetNodeAt(this.PointToClient(new Point(e.X, e.Y))); - } - - protected override void OnBeforeLabelEdit(NodeLabelEditEventArgs e) - { - if (!AllowBeginEdit) - { - AllowBeginEdit = false; - - e.CancelEdit = true; - return; - } - - this.HasChanged = true; - - base.OnBeforeLabelEdit(e); - } - - protected override void OnAfterLabelEdit(NodeLabelEditEventArgs e) - { - base.OnAfterLabelEdit(e); - - //if (e.Node.Tag == null) - //{ - // if (e.Label == null) - // { - // e.CancelEdit = true; - // } - // else - // { - // if (e.Label.Trim().Length <= 0) - // { - // e.CancelEdit = true; - // } - // } - //} - //else - //{ - // e.CancelEdit = true; - //} - - AllowBeginEdit = false; - } - protected override void OnNodeMouseClick(TreeNodeMouseClickEventArgs e) { if (e.Button == MouseButtons.Right) @@ -389,22 +105,32 @@ namespace RyzStudio.Windows.Forms this.SelectedNode = this.AddFolder(); } } + else + { + if ((nodeType == NodeType.Root) || (nodeType == NodeType.Folder)) + { + this.SelectedNode = this.AddNode(); + } + else if (nodeType == NodeType.Page) + { + this.SelectedNode = tn.Parent; + this.SelectedNode = this.AddNode(); + } + } break; case Keys.Delete: if (!tn.IsEditing) { - this.DeleteNode(); + if (MessageBox.Show("Delete?", "Delete?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes) + { + this.DeleteNode(); + } } break; case Keys.F2: - if ((nodeType == NodeType.Root) || (nodeType == NodeType.Folder)) - { - this.AllowBeginEdit = true; - - this.EditNode(); - } + this.EditNode(); break; case Keys.F3: @@ -422,12 +148,12 @@ namespace RyzStudio.Windows.Forms break; case NodeType.Page: - BookmarkItem viewModel = this.GetNodeModel(); + var viewModel = UIControl.GetTag(this.SelectedNode); if (viewModel != null) { try { - Clipboard.SetText(viewModel.SiteAddress ?? string.Empty); + Clipboard.SetText(viewModel.Address ?? string.Empty); } catch { @@ -467,55 +193,6 @@ namespace RyzStudio.Windows.Forms #endregion -#region encapsulation - - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new ImageList ImageList { get => base.ImageList; set => base.ImageList = value; } - - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new bool AllowDrop { get => base.AllowDrop; set => base.AllowDrop = value; } - - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new bool HideSelection { get => base.HideSelection; set => base.HideSelection = value; } - - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new bool HotTracking { get => base.HotTracking; set => base.HotTracking = value; } - - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new int ImageIndex { get => base.ImageIndex; set => base.ImageIndex = value; } - - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new bool LabelEdit { get => base.LabelEdit; set => base.LabelEdit = value; } - - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new string PathSeparator { get => base.PathSeparator; set => base.PathSeparator = value; } - - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new int SelectedImageIndex { get => base.SelectedImageIndex; set => base.SelectedImageIndex = value; } - - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new bool ShowNodeToolTips { get => base.ShowNodeToolTips; set => base.ShowNodeToolTips = value; } - -#endregion - - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public bool AllowBeginEdit { get; set; } = false; - - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public bool HasChanged - { - get => hasChanged; - protected set - { - hasChanged = value; - - OnNodeChanged?.Invoke(null, null); - } - } - - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public IconDatabase IconDatabase { get; set; } = null; - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ContextMenuStrip RootContextMenu { get; set; } = null; @@ -525,61 +202,26 @@ namespace RyzStudio.Windows.Forms [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ContextMenuStrip PageContextMenu { get; set; } = null; - - public bool InitialiseIconDatabase(out string message, string filename) + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool HasChanged { - message = string.Empty; - - //if (string.IsNullOrWhiteSpace(filename)) - //{ - // return false; - //} - - //if (iconDatabase == null) - //{ - // iconDatabase = new IconDatabase(); - //} - - //bool rv = false; - //if (File.Exists(filename)) - //{ - // rv = iconDatabase.LoadFile(filename); - // if (!rv) - // { - // rv = iconDatabase.Create(filename, true, null, true); - // if (!rv) - // { - // message = iconDatabase.LastError; - // return false; - // } - // } - //} - //else - //{ - // rv = iconDatabase.Create(filename, true, null, true); - // if (!rv) - // { - // message = iconDatabase.LastError; - // return false; - // } - //} - - return true; + get => base.HasChanged; + set + { + base.HasChanged = value; + } } - public TreeNode AddFolder(string name = "") - { - return this.AddFolder(this.SelectedNode, name); - } - public TreeNode AddFolder(TreeNode node, string name = "") + public TreeNode AddFolder(TreeNode node = null, string name = "", bool quol = true) { if (node == null) { - return null; + node = this.SelectedNode; } - if (node.Tag != null) + var nodeType = GetNodeType(node); + if ((nodeType != NodeType.Root) && (nodeType != NodeType.Folder)) { return null; } @@ -589,331 +231,239 @@ namespace RyzStudio.Windows.Forms name = DEFAULT_NEW_FOLDER_NAME; } - return node.Nodes.Add(EncodePath(name), name, (int)IconSet.Folder1, (int)IconSet.Folder2); + var key = EncodeNodeName(name); + var treeNode = node.Nodes.Add(key, name, (int)NodeIcon.Folder1, (int)NodeIcon.Folder2); + + if (quol) + { + node.Expand(); + + this.SelectedNode = treeNode; + + this.EditNode(treeNode); + } + + return treeNode; } - public TreeNode AddItem(BookmarkItem item) - { - int iconIndex = FindIcon(item); - - TreeNode tn = new TreeNode(item.SiteName, iconIndex, iconIndex); - tn.Tag = item; - tn.ToolTipText = item.ToString(); - - TreeNode tn2 = AddFolderPath(item.TreeviewPath); - - UIControl.Add(tn2, tn); - - this.HasChanged = true; - - return tn; - } - - public TreeNode AddItem(TreeNode treeNode, BookmarkItem item) - { - if (treeNode == null) return null; - if (item == null) return null; - - int iconIndex = FindIcon(item); - - TreeNode tn = new TreeNode(item.SiteName, iconIndex, iconIndex); - tn.Tag = item; - tn.ToolTipText = item.ToString(); - - //treeNode.Nodes.Add(tn); - UIControl.Add(treeNode, tn); - - this.HasChanged = true; - - return tn; - } - - public void Clear() - { - ResetImageList(); - - UIControl.Clear(this); - - this.HasChanged = false; - } - - public void Clear(string name) - { - ResetImageList(); - - var tt1 = this.ImageList; - - - UIControl.Clear(this); - UIControl.Add(this, this.Nodes, "", name?.Trim(), (int)IconSet.Root, (int)IconSet.Root); - - this.HasChanged = true; - } - - public void CloseIconDatabase() - { - //iconDatabase.Close(); - } - - public void DeleteNode() => DeleteNode(this.SelectedNode); - - public void EditNode() - { - this.EditNode(this.SelectedNode); - } - - public void EditNode(TreeNode node) + public TreeNode AddNode(TreeNode node = null) { if (node == null) { - return; + node = this.SelectedNode; + } + + var nodeType = GetNodeType(node); + if ((nodeType != NodeType.Root) && (nodeType != NodeType.Folder)) + { + return null; + } + + var form = new EditBookmarkForm(); + if (form.ShowDialog() == DialogResult.OK) + { + var model = form.Result; + model.Path = GetNodePath(node); + + var newNode = this.AddNode(model); + if (newNode != null) + { + newNode.EnsureVisible(); + + this.SelectedNode = newNode; + + return newNode; + } + } + + return null; + } + + public TreeNode AddNode(BookmarkModel model) + { + var parentNode = this.CreateNodePath(model.Path, (int)NodeIcon.Folder1, (int)NodeIcon.Folder2); + int iconIndex = (int)NodeIcon.Default; + + // Add custom favicon + if (model.Icon != null) + { + var iconKey = model.Id.ToString(); + if (!string.IsNullOrWhiteSpace(iconKey)) + { + if (this.ImageList.Images.ContainsKey(iconKey)) + { + this.ImageList.Images.RemoveByKey(iconKey); + } + + UIControl.Invoke(this, (x) => + { + this.ImageList.Images.Add(iconKey, model.Icon); + }); + + iconIndex = this.ImageList.Images.IndexOfKey(iconKey); + } + } + + TreeNode newNode = new TreeNode(model.Title, iconIndex, iconIndex); + newNode.Tag = model; + newNode.ToolTipText = model.ToString(); + + UIControl.Add(parentNode, newNode); + + this.HasChanged = true; + + return newNode; + } + + public void Clear(string rootName) + { + ClearImageList(); + + UIControl.Clear(this); + + UIControl.Invoke(this, (x) => + { + this.Nodes.Add("", rootName?.Trim() ?? string.Empty, (int)NodeIcon.Root, (int)NodeIcon.Root); + }); + + this.HasChanged = true; + } + + public TreeNode EditNode(TreeNode node = null) + { + if (node == null) + { + node = this.SelectedNode; } if (node.IsEditing) { - return; + return null; } - switch (GetNodeType(node)) + var nodeType = GetNodeType(node); + if ((nodeType == NodeType.Root) || (nodeType == NodeType.Folder)) { - case BookmarkTreeView.NodeType.Root: - case BookmarkTreeView.NodeType.Folder: - this.AllowBeginEdit = true; - node.BeginEdit(); - break; - case BookmarkTreeView.NodeType.Page: - this.AllowBeginEdit = true; - node.BeginEdit(); - break; - default: break; + _allowBeginEdit = true; + + node.BeginEdit(); } + else if (nodeType == NodeType.Page) + { + var model = UIControl.GetTag(node); + model.Path = GetNodePath(node); + + var form = new EditBookmarkForm(model); + if (form.ShowDialog() == DialogResult.OK) + { + this.UpdateNode(node, form.Result); + } + } + + return node; } - public NodeType GetNodeType() => GetNodeType(this.SelectedNode); - - public string GetNodePath() => GetNodePath(this.SelectedNode); - - public BookmarkItem GetNodeModel() => GetNodeModel(this.SelectedNode); - - public List GetBookmarkList() - { - List rs = new List(); - - if (this.Nodes.Count <= 0) - { - return rs; - } - - foreach (TreeNode item in this.Nodes) - { - TraverseBookmarkList(rs, item); - } - - return rs; - } - - public bool FindTextNode(TreeNode node, string term) + public NodeType GetNodeType(TreeNode node = null) { if (node == null) { - return false; + node = this.SelectedNode; } - if (this.Nodes.Count <= 0) + if (node == null) { - return false; + return NodeType.None; } - bool rt = false; - bool inclusive = false; - TreeNode tn = node; - while (true) + if (node.Tag == null) { - if (tn == null) + if (node.Equals(node.TreeView.Nodes[0])) { - break; - } - - if (inclusive) - { - if (tn.Text.ToLower().Contains(term.ToLower())) - { - this.SelectedNode = tn; - this.SelectedNode.EnsureVisible(); - rt = true; - break; - } - } - - if (tn.Nodes.Count > 0) - { - tn = tn.Nodes[0]; - inclusive = true; + return NodeType.Root; } else { - if (tn.NextNode != null) - { - tn = tn.NextNode; - inclusive = true; - } - else - { - while (true) - { - tn = tn.Parent; - if (tn == null) - { - break; - } + return NodeType.Folder; + } + } + else + { + if (node.Tag is BookmarkModel) + { + return NodeType.Page; + } + else + { + return NodeType.None; + } + } + } - if (tn.NextNode != null) - { - tn = tn.NextNode; - break; - } - } + public void UpdateNode(TreeNode node, BookmarkModel model) + { + if (node == null) + { + node = this.SelectedNode; + } - inclusive = true; + if (node == null) + { + return; + } + + if (model == null) + { + return; + } + + var iconIndex = (int)NodeIcon.Default; + + // Update custom favicon + var iconKey = model.Id.ToString(); + if (!string.IsNullOrWhiteSpace(iconKey)) + { + UIControl.Invoke(this, (x) => + { + if (this.ImageList.Images.ContainsKey(iconKey)) + { + this.ImageList.Images.RemoveByKey(iconKey); } + }); + + if (model.Icon != null) + { + UIControl.Invoke(this, (x) => + { + this.ImageList.Images.Add(iconKey, model.Icon); + }); + + iconIndex = this.ImageList.Images.IndexOfKey(iconKey); } } - return rt; - } - - public void MoveDown() => MoveDown(this.SelectedNode); - - public void MoveUp() => MoveUp(this.SelectedNode); - - public void SetNoChanges() - { - this.HasChanged = false; - } - - public new void Sort() => Sort(this.SelectedNode); - - public void UpdateItem(TreeNode treeNode, BookmarkItem item) - { - if (treeNode == null) return; - if (item == null) return; - - int iconIndex = FindIcon(item); - - treeNode.Text = item.SiteName; - treeNode.ImageIndex = iconIndex; - treeNode.SelectedImageIndex = iconIndex; - treeNode.Tag = item; - treeNode.ToolTipText = item.ToString(); + UIControl.Invoke(this, (x) => + { + node.Text = model.Title; + node.ImageIndex = iconIndex; + node.SelectedImageIndex = iconIndex; + node.Tag = model; + node.ToolTipText = model.ToString(); + }); this.HasChanged = true; } - protected int FindIcon(BookmarkItem item) + private void ClearImageList() { - if (this.IconDatabase == null) return (int)IconSet.Default; - if (item == null) return (int)IconSet.Default; - if (string.IsNullOrWhiteSpace(item.SiteAddress)) return (int)IconSet.Default; - - string iconID = item?.ToHash(); - if (this.ImageList.Images.ContainsKey(iconID)) + UIControl.Invoke(this, (x) => { - return this.ImageList.Images.IndexOfKey(iconID); - } - - Image image = this.IconDatabase.FindIcon(iconID); - if (image == null) - { - return (int)IconSet.Default; - } - - UIControl.Add(this, this.ImageList, iconID, image); - - return this.ImageList.Images.IndexOfKey(iconID); - } - - protected TreeNode AddFolderPath(string path) - { - TreeNode tn = null; - //TreeNode tn = this.Nodes[0]; - //if (tn == null) - //{ - // return tn; - //} - - if (string.IsNullOrWhiteSpace(path)) - { - return tn; - } - - if (string.IsNullOrWhiteSpace(path.Trim('\\'))) - { - return tn; - } - - string[] folderList = path.Trim('\\').Split('\\'); - if (folderList.Length <= 0) - { - return tn; - } - - for (int i=0; i rs, TreeNode node) - { - foreach (TreeNode tn in node.Nodes) - { - NodeType nodeType = GetNodeType(tn); - if (nodeType == NodeType.Folder) - { - TraverseBookmarkList(rs, tn); - } - else if (nodeType == NodeType.Page) - { - BookmarkItem nodeTag = GetNodeModel(tn); - nodeTag.TreeviewPath = GetNodePath(tn); - - if (nodeTag != null) - { - rs.Add(nodeTag); - } - } - } + this.ImageList.Images.Clear(); + this.ImageList.Images.Add(Resources.hexagon); + this.ImageList.Images.Add(Resources.folder); + this.ImageList.Images.Add(Resources.folder_explore); + this.ImageList.Images.Add(Resources.file_text); + }); } } diff --git a/build-installer.iss b/build-installer.iss index 92ee27b..ce48110 100644 --- a/build-installer.iss +++ b/build-installer.iss @@ -1,15 +1,15 @@ ; Script generated by the Inno Setup Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! -#define MyAppName "Bookmark Manager" -#define MyAppVersion "0.5.0.012" +#define MyAppName "BukkuBuddy Bookmark Manager" +#define MyAppVersion "0.6.0.716" #define MyAppPublisher "Hi, I'm Ray" #define MyAppURL "https://www.hiimray.co.uk/software-bookmark-manager" -#define MyAppExeName "bookmarkmanager.exe" +#define MyAppExeName "bukkubuddy.exe" -#define AppSourcePath "L:\gitea-hiimray\bookmark-manager-r4\bin\Release\64" -#define AppReleasePath "L:\gitea-hiimray\bookmark-manager-r4\bin\Release" -#define AppReleaseName "bookmark-manager" +#define AppSourcePath "L:\gitea-hiimray\bookmark-manager-r4\bin" +#define AppReleasePath "L:\gitea-hiimray\bookmark-manager-r4\bin" +#define AppReleaseName "bukkubuddy-installer" [Setup] ; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. @@ -39,8 +39,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl" Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked [Files] -Source: "{#AppSourcePath}\bookmarkmanager.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#AppSourcePath}\e_sqlite3.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#AppSourcePath}\bukkubuddy.exe"; DestDir: "{app}"; Flags: ignoreversion ; NOTE: Don't use "Flags: ignoreversion" on any shared system files [Icons] diff --git a/build.bat b/build.bat index abe9789..f6cc459 100644 --- a/build.bat +++ b/build.bat @@ -1,7 +1,17 @@ -rmdir /s /q "bin\Release\" -dotnet publish skye.sln -r win-x64 -c Release /p:PublishSingleFile=true /p:SelfContained=false /p:PublishReadyToRunfalse=true /p:PublishDir="bin\Release\64\" +RMDIR /s /q "bin\" +RMDIR /s /q "obj\" + +MKDIR bin + +dotnet restore skye.sln +dotnet publish skye.sln -r win-x64 -c Release /p:PublishSingleFile=true /p:SelfContained=false /p:PublishReadyToRunfalse=true /p:PublishDir="bin\" "C:\B\Portable Files (dev)\Inno Setup\v6.0.4-2\app\ISCC.exe" "build-installer.iss" -cd "bin\Release\64\" -"C:\B\Portable Files\PeaZip (Portable)\v6.5.1\App\PeaZip\res\7z\7z.exe" a -t7z "..\bookmark-manager.7z" "*" -mx9 \ No newline at end of file +"C:\B\Portable Files\7-Zip (Portable)\23.01\App\7-Zip64\7z.exe" a -t7z "bin\bukkubuddy.7z" ".\bin\bukkubuddy.exe" -mx9 + +RMDIR /s /q "bin\debug" +RMDIR /s /q "bin\release" +RMDIR /s /q "obj\" + +PAUSE \ No newline at end of file diff --git a/favicon.ico b/favicon.ico index 9ca5d56..b1f729a 100644 Binary files a/favicon.ico and b/favicon.ico differ