diff --git a/.gitignore b/.gitignore index be8a03f..8198594 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ -/skye.sln /bomg.csproj.user /bin /obj /packages -/.vs/skye/v14/*.suo +/.vs diff --git a/BookmarkEditForm.Designer.cs b/BookmarkEditForm.Designer.cs index 8ad9413..fb0db6d 100644 --- a/BookmarkEditForm.Designer.cs +++ b/BookmarkEditForm.Designer.cs @@ -28,197 +28,220 @@ namespace bzit.bomg /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BookmarkEditForm)); - this.label1 = new System.Windows.Forms.Label(); - this.tbxAddress = new System.Windows.Forms.TextBox(); - this.tbxName = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.tbxDescription = new System.Windows.Forms.TextBox(); - this.oToolTip = new System.Windows.Forms.ToolTip(this.components); - this.label3 = new System.Windows.Forms.Label(); - this.pbxIcon = new System.Windows.Forms.PictureBox(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.button1 = new RyzStudio.Windows.Forms.BigButton(); - this.btnSave = new RyzStudio.Windows.Forms.BigButton(); - ((System.ComponentModel.ISupportInitialize)(this.pbxIcon)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 12); - this.label1.Margin = new System.Windows.Forms.Padding(3); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(39, 13); - this.label1.TabIndex = 0; - this.label1.Text = "Name:"; - // - // tbxAddress - // - this.tbxAddress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.pictureBox2 = new System.Windows.Forms.PictureBox(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.label5 = new System.Windows.Forms.Label(); + this.memoBox1 = new RyzStudio.Windows.ThemedForms.MemoBox(); + this.textBox2 = new RyzStudio.Windows.ThemedForms.TextBox(); + this.button1 = new RyzStudio.Windows.ThemedForms.Button(); + this.textBox1 = new RyzStudio.Windows.ThemedForms.TextBox(); + this.button2 = new RyzStudio.Windows.ThemedForms.Button(); + this.horizontalSeparator1 = new RyzStudio.Windows.Forms.HorizontalSeparator(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 25); + this.label1.Margin = new System.Windows.Forms.Padding(3); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(29, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Title"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 69); + this.label2.Margin = new System.Windows.Forms.Padding(3); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(48, 13); + this.label2.TabIndex = 4; + this.label2.Text = "Address"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(12, 113); + this.label3.Margin = new System.Windows.Forms.Padding(3); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(66, 13); + this.label3.TabIndex = 55; + this.label3.Text = "Description"; + // + // pictureBox2 + // + this.pictureBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.pictureBox2.BackColor = System.Drawing.SystemColors.Window; + this.pictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; + this.pictureBox2.ErrorImage = null; + this.pictureBox2.InitialImage = null; + this.pictureBox2.Location = new System.Drawing.Point(348, 15); + this.pictureBox2.Name = "pictureBox2"; + this.pictureBox2.Size = new System.Drawing.Size(32, 32); + this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; + this.pictureBox2.TabIndex = 57; + this.pictureBox2.TabStop = false; + // + // pictureBox1 + // + this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.pictureBox1.BackColor = System.Drawing.Color.Transparent; + this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; + this.pictureBox1.ErrorImage = null; + this.pictureBox1.InitialImage = null; + this.pictureBox1.Location = new System.Drawing.Point(266, 217); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(32, 32); + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; + this.pictureBox1.TabIndex = 60; + this.pictureBox1.TabStop = false; + // + // label5 + // + this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.tbxAddress.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tbxAddress.Location = new System.Drawing.Point(12, 78); - this.tbxAddress.MaxLength = 4096; - this.tbxAddress.Name = "tbxAddress"; - this.tbxAddress.Size = new System.Drawing.Size(240, 22); - this.tbxAddress.TabIndex = 1; - this.tbxAddress.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.textBox_PreviewKeyDown); - // - // tbxName - // - this.tbxName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.label5.ForeColor = System.Drawing.Color.OrangeRed; + this.label5.Location = new System.Drawing.Point(9, 217); + this.label5.Margin = new System.Windows.Forms.Padding(3); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(251, 32); + this.label5.TabIndex = 64; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // memoBox1 + // + this.memoBox1.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.tbxName.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tbxName.Location = new System.Drawing.Point(12, 31); - this.tbxName.MaxLength = 4096; - this.tbxName.Name = "tbxName"; - this.tbxName.Size = new System.Drawing.Size(212, 22); - this.tbxName.TabIndex = 0; - this.tbxName.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.textBox_PreviewKeyDown); - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(12, 59); - this.label2.Margin = new System.Windows.Forms.Padding(3); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(51, 13); - this.label2.TabIndex = 4; - this.label2.Text = "Address:"; - // - // tbxDescription - // - this.tbxDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.memoBox1.BackColor = System.Drawing.Color.Transparent; + this.memoBox1.Location = new System.Drawing.Point(96, 103); + this.memoBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); + this.memoBox1.Name = "memoBox1"; + this.memoBox1.Padding = new System.Windows.Forms.Padding(10, 10, 3, 9); + this.memoBox1.Size = new System.Drawing.Size(316, 83); + this.memoBox1.TabIndex = 3; + // + // textBox2 + // + this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.tbxDescription.BackColor = System.Drawing.SystemColors.Window; - this.tbxDescription.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tbxDescription.Location = new System.Drawing.Point(12, 125); - this.tbxDescription.MaxLength = 4096; - this.tbxDescription.Multiline = true; - this.tbxDescription.Name = "tbxDescription"; - this.tbxDescription.Size = new System.Drawing.Size(240, 84); - this.tbxDescription.TabIndex = 2; - this.tbxDescription.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.textBox_PreviewKeyDown); - // - // oToolTip - // - this.oToolTip.Active = false; - this.oToolTip.BackColor = System.Drawing.Color.IndianRed; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(12, 106); - this.label3.Margin = new System.Windows.Forms.Padding(3); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(69, 13); - this.label3.TabIndex = 55; - this.label3.Text = "Description:"; - // - // pbxIcon - // - this.pbxIcon.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pbxIcon.BackColor = System.Drawing.SystemColors.Window; - this.pbxIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; - this.pbxIcon.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.pbxIcon.ErrorImage = null; - this.pbxIcon.InitialImage = null; - this.pbxIcon.Location = new System.Drawing.Point(230, 31); - this.pbxIcon.Name = "pbxIcon"; - this.pbxIcon.Size = new System.Drawing.Size(22, 22); - this.pbxIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; - this.pbxIcon.TabIndex = 57; - this.pbxIcon.TabStop = false; - // - // pictureBox1 - // - this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.pictureBox1.BackColor = System.Drawing.Color.Transparent; - this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; - this.pictureBox1.ErrorImage = null; - this.pictureBox1.InitialImage = null; - this.pictureBox1.Location = new System.Drawing.Point(12, 227); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(32, 32); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; - this.pictureBox1.TabIndex = 60; - this.pictureBox1.TabStop = false; - // - // button1 - // - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.button1.BackColor = System.Drawing.Color.WhiteSmoke; - this.button1.Location = new System.Drawing.Point(118, 227); - this.button1.MaximumSize = new System.Drawing.Size(120, 32); - this.button1.MinimumSize = new System.Drawing.Size(32, 32); - this.button1.Name = "button1"; - this.button1.Padding = new System.Windows.Forms.Padding(4); - this.button1.Size = new System.Drawing.Size(32, 32); - this.button1.TabIndex = 3; - this.button1.Value = ""; - this.button1.Click += new System.EventHandler(this.btnRetrievePage_Click); - // - // btnSave - // - this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnSave.BackColor = System.Drawing.Color.WhiteSmoke; - this.btnSave.Location = new System.Drawing.Point(156, 227); - this.btnSave.MaximumSize = new System.Drawing.Size(120, 32); - this.btnSave.MinimumSize = new System.Drawing.Size(32, 32); - this.btnSave.Name = "btnSave"; - this.btnSave.Padding = new System.Windows.Forms.Padding(4); - this.btnSave.Size = new System.Drawing.Size(96, 32); - this.btnSave.TabIndex = 4; - this.btnSave.Value = "&OK"; - this.btnSave.Click += new System.EventHandler(this.btnSave_Click); - // - // BookmarkEditForm - // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; - this.BackColor = System.Drawing.Color.White; - this.ClientSize = new System.Drawing.Size(264, 271); - this.Controls.Add(this.button1); - this.Controls.Add(this.pictureBox1); - this.Controls.Add(this.pbxIcon); - this.Controls.Add(this.tbxDescription); - this.Controls.Add(this.label3); - this.Controls.Add(this.tbxName); - this.Controls.Add(this.label1); - this.Controls.Add(this.tbxAddress); - this.Controls.Add(this.btnSave); - this.Controls.Add(this.label2); - this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "BookmarkEditForm"; - this.ShowInTaskbar = false; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Edit Bookmark"; - ((System.ComponentModel.ISupportInitialize)(this.pbxIcon)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); + this.textBox2.BackColor = System.Drawing.Color.Transparent; + this.textBox2.Location = new System.Drawing.Point(96, 59); + this.textBox2.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); + this.textBox2.Name = "textBox2"; + this.textBox2.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9); + this.textBox2.Size = new System.Drawing.Size(239, 34); + this.textBox2.SubmitButton = this.button1; + this.textBox2.TabIndex = 0; + this.textBox2.UseSystemPasswordChar = false; + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.button1.BackColor = System.Drawing.Color.Transparent; + this.button1.DefaultImage = null; + this.button1.DownImage = null; + this.button1.LabelText = "S&can"; + this.button1.Location = new System.Drawing.Point(348, 59); + this.button1.Name = "button1"; + this.button1.OverImage = null; + this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + this.button1.Size = new System.Drawing.Size(64, 32); + this.button1.TabIndex = 1; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // textBox1 + // + 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.Location = new System.Drawing.Point(96, 15); + this.textBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); + this.textBox1.Name = "textBox1"; + this.textBox1.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9); + this.textBox1.Size = new System.Drawing.Size(239, 34); + this.textBox1.SubmitButton = this.button2; + this.textBox1.TabIndex = 2; + this.textBox1.UseSystemPasswordChar = false; + // + // button2 + // + this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.button2.BackColor = System.Drawing.Color.Transparent; + this.button2.DefaultImage = null; + this.button2.DownImage = null; + this.button2.LabelText = "&Save"; + this.button2.Location = new System.Drawing.Point(304, 217); + this.button2.Name = "button2"; + this.button2.OverImage = null; + this.button2.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + this.button2.Size = new System.Drawing.Size(108, 32); + this.button2.TabIndex = 4; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // horizontalSeparator1 + // + this.horizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.horizontalSeparator1.Location = new System.Drawing.Point(12, 202); + this.horizontalSeparator1.Margin = new System.Windows.Forms.Padding(3, 10, 3, 10); + this.horizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2); + this.horizontalSeparator1.Name = "horizontalSeparator1"; + this.horizontalSeparator1.Size = new System.Drawing.Size(400, 2); + this.horizontalSeparator1.TabIndex = 65; + // + // BookmarkEditForm + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(424, 261); + this.Controls.Add(this.memoBox1); + this.Controls.Add(this.textBox2); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.horizontalSeparator1); + this.Controls.Add(this.label5); + this.Controls.Add(this.button1); + this.Controls.Add(this.button2); + this.Controls.Add(this.pictureBox1); + this.Controls.Add(this.pictureBox2); + this.Controls.Add(this.label3); + this.Controls.Add(this.label1); + this.Controls.Add(this.label2); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "BookmarkEditForm"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Edit Bookmark"; + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); } #endregion private System.Windows.Forms.Label label1; - private System.Windows.Forms.TextBox tbxAddress; - private System.Windows.Forms.TextBox tbxName; private System.Windows.Forms.Label label2; - private System.Windows.Forms.TextBox tbxDescription; - private System.Windows.Forms.ToolTip oToolTip; - private RyzStudio.Windows.Forms.BigButton btnSave; private System.Windows.Forms.Label label3; - private System.Windows.Forms.PictureBox pbxIcon; + private System.Windows.Forms.PictureBox pictureBox2; private System.Windows.Forms.PictureBox pictureBox1; - private RyzStudio.Windows.Forms.BigButton button1; + private RyzStudio.Windows.ThemedForms.Button button2; + private RyzStudio.Windows.ThemedForms.Button button1; + private System.Windows.Forms.Label label5; + private RyzStudio.Windows.Forms.HorizontalSeparator horizontalSeparator1; + private RyzStudio.Windows.ThemedForms.TextBox textBox1; + private RyzStudio.Windows.ThemedForms.TextBox textBox2; + private RyzStudio.Windows.ThemedForms.MemoBox memoBox1; } } \ No newline at end of file diff --git a/BookmarkEditForm.cs b/BookmarkEditForm.cs index a707cd9..c2ef952 100644 --- a/BookmarkEditForm.cs +++ b/BookmarkEditForm.cs @@ -1,55 +1,44 @@ +using bzit.bomg.Models; +using RyzStudio.Windows.Forms; using System; using System.ComponentModel; +using System.Threading.Tasks; using System.Windows.Forms; +using Form = System.Windows.Forms.Form; +using Resources = bzit.bomg.Properties.Resources; namespace bzit.bomg { public partial class BookmarkEditForm : Form { - private TreeNode parentNode = null; - private BookmarkItem bookmarkItem; - private bool isWorking = false; + protected bool isBusy = false; + protected BookmarkItemModel itemModel = null; + protected BookmarkTreeView treeView = null; - public BookmarkEditForm(ref TreeNode node) + public BookmarkEditForm(BookmarkTreeView treeview) : base() { InitializeComponent(); - parentNode = node; + treeView = treeview; this.StartPosition = FormStartPosition.WindowsDefaultLocation; } - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - - button1.Button.Image = Properties.Resources.magnifier; - } - protected override void OnShown(EventArgs e) { base.OnShown(e); - if (parentNode.Tag != null) + if (treeView.SNode.GetNodeType() == BookmarkTreeView.NodeType.Page) { - if (parentNode.Tag is BookmarkItem) + BookmarkItemViewModel bookmarkItem = (BookmarkItemViewModel)treeView.SelectedNode.Tag; + if (bookmarkItem != null) { - bookmarkItem = (BookmarkItem)parentNode.Tag; - tbxName.Text = bookmarkItem.GetName(); - tbxAddress.Text = bookmarkItem.SiteAddress; - tbxDescription.Text = bookmarkItem.Description; - - if (parentNode.TreeView.ImageList != null) + if (itemModel == null) { - if (parentNode.ImageIndex >= 0) - { - pbxIcon.Image = parentNode.TreeView.ImageList.Images[parentNode.ImageIndex]; - } - else - { - pbxIcon.Image = parentNode.TreeView.ImageList.Images[parentNode.ImageKey]; - } + itemModel = new BookmarkItemModel(); } + + updateViewModel(bookmarkItem); } } } @@ -58,135 +47,86 @@ namespace bzit.bomg { base.OnClosing(e); - if (this.IsWorking) + if (this.IsBusy) { e.Cancel = true; - } + } } - public bool IsWorking + protected bool IsBusy { - get { return isWorking; } + get => isBusy; set { - isWorking = value; + isBusy = value; + textBox1.Enabled = textBox2.Enabled = memoBox1.Enabled = !value; - tbxName.Enabled = tbxAddress.Enabled = tbxDescription.Enabled = !value; - btnSave.Enabled = !value; - button1.Enabled = !value; - - pictureBox1.Image = (value) ? Properties.Resources.aniZomq2x32 : null; + ThreadControl.SetImage(pictureBox1, (value) ? Resources.aniZomq2x32 : null); } } - private void textBox_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) + protected void updateViewModel(BookmarkItemViewModel viewModel) { - if (this.IsWorking) - { - return; - } + itemModel.SiteName = viewModel.SiteName?.Trim(); + itemModel.SiteAddress = viewModel.SiteAddress?.Trim(); + itemModel.SiteDescription = viewModel.SiteDescription?.Trim(); + itemModel.FaviconAddress = viewModel.FaviconAddress?.Trim(); - if (e.KeyCode == Keys.Escape) - { - this.Close(); - } + textBox1.Text = itemModel.SiteName; + textBox2.Text = itemModel.SiteAddress; + memoBox1.Text = itemModel.SiteDescription; + pictureBox2.Image = treeView.ImageList.Images[treeView.SelectedNode.ImageIndex]; } - private void btnRetrievePage_Click(object sender, EventArgs e) + private async void button1_Click(object sender, EventArgs e) { - if (this.IsWorking) + if (this.IsBusy) { return; } - if (string.IsNullOrWhiteSpace(tbxAddress.Text)) + if (string.IsNullOrWhiteSpace(textBox2.Text)) { return; } - this.IsWorking = true; - oToolTip.SetToolTip(pictureBox1, ""); + this.IsBusy = true; - BookmarkItem bi = new BookmarkItem(); - bi.OnRetrieveCompleted += bookmarkItem_OnRetrieveCompleted; - bi.RetrieveAsync(tbxAddress.Text.Trim()); + await Task.Run(() => + { + if (itemModel == null) itemModel = new BookmarkItemModel(); + + itemModel.SiteAddress = textBox2.Text; + + bool rv = itemModel.Update(); + if (rv) + { + ThreadControl.SetText(textBox1, itemModel.SiteName); + ThreadControl.SetText(textBox2, itemModel.SiteAddress); + ThreadControl.SetText(memoBox1, itemModel.SiteDescription); + ThreadControl.SetImage(pictureBox2, itemModel.RetrieveFavicon()); + } + }); + + this.IsBusy = false; } - private void btnSave_Click(object sender, EventArgs e) + private void button2_Click(object sender, EventArgs e) { - if (this.IsWorking) - { - return; - } + if (this.IsBusy) return; + if (string.IsNullOrWhiteSpace(textBox1.Text)) return; + if (string.IsNullOrWhiteSpace(textBox2.Text)) return; - if (bookmarkItem == null) - { - bookmarkItem = new BookmarkItem(); - } + if (itemModel == null) itemModel = new BookmarkItemModel(); - bookmarkItem.ChangeName(tbxName.Text.Trim()); - bookmarkItem.SiteAddress = tbxAddress.Text.Trim(); - bookmarkItem.Description = tbxDescription.Text.Trim(); + itemModel.SiteName = textBox1.Text?.Trim(); + itemModel.SiteAddress = textBox2.Text?.Trim(); + itemModel.SiteDescription = memoBox1.Text?.Trim(); - parentNode.Text = tbxName.Text.Trim(); -//// parentNode.ImageIndex = parentNode.SelectedImageIndex = 3; - parentNode.ToolTipText = string.Concat(bookmarkItem.SiteAddress, Environment.NewLine, bookmarkItem.Description).Trim(); - parentNode.Tag = bookmarkItem; - - BookmarkTreeView bookmarkTreeView = (BookmarkTreeView)parentNode.TreeView; - if (bookmarkTreeView != null) - { - parentNode.ImageIndex = parentNode.SelectedImageIndex = bookmarkTreeView.AddToIconList(bookmarkItem); - } + treeView?.SNode.AddOrUpdateItem(itemModel.ToViewModel()); this.Close(); } - protected void bookmarkItem_OnRetrieveCompleted(BookmarkItem sender, bool hasError, string message) - { - if (string.IsNullOrEmpty(sender.SiteName)) - { - if (MessageBox.Show("The page could not be retrieved or the title is blank. Do you want to keep your original title?", "Keep original?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) - { - bookmarkItem.SiteName = sender.SiteName; - - tbxName.Text = bookmarkItem.SiteName; - - // don't replace with blank - if (!string.IsNullOrEmpty(sender.Description)) - { - bookmarkItem.Description = sender.Description; - } - } - } - else - { - bookmarkItem.SiteName = sender.SiteName; - - tbxName.Text = bookmarkItem.SiteName; - - // don't replace with blank - if (!string.IsNullOrEmpty(sender.Description)) - { - bookmarkItem.Description = sender.Description; - } - } - - // don't replace with blank - if (sender.IconData != null) - { - bookmarkItem.IconData = sender.IconData; - } - - tbxDescription.Text = bookmarkItem.Description; - pbxIcon.Image = (bookmarkItem.Icon == null) ? parentNode.TreeView.ImageList.Images[3] : bookmarkItem.Icon; - - if (hasError) - { - oToolTip.SetToolTip(pictureBox1, message); - } - - this.IsWorking = false; - } } } \ No newline at end of file diff --git a/BookmarkEditForm.resx b/BookmarkEditForm.resx index 3b96111..d58980a 100644 --- a/BookmarkEditForm.resx +++ b/BookmarkEditForm.resx @@ -117,32 +117,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 17 - - - - - AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAHQAAADQAAAA2AAAANgAAADYAAAA2AAAANgAAADYAAAA2AAAANgAAADYAAAA2AAAAMwAA - AB0AAAAAAAAAAAAAADT5+fn1/Pz8/fz8/P/8/Pz//Pz8//z8/P/8/Pz//Pz8//z8/P/8/Pz//Pz8/fn5 - +fMAAAAzAAAAAAAAAAEAAAA2/Pz8/vz8/P/8/Pz//Pz8//z8/P/8/Pz//Pz8//z8/P/8/Pz//Pz8//z8 - /P/8/Pz9AAAANgAAAAAAAAABAAAANvz8/P/8/Pz/F0JZ/ypgiP9Lib3/bqfL/+Dp8f/7+/v/+/v7//v7 - +//7+/v//Pz8/wAAADYAAAABAAAAAQAAADb8/Pz//Pz8/y1mhP+Tx/n/kMn5/0CEyf8laq3/1OLu//r6 - +v/6+vr/+vr6//z8/P8AAAA2AAAAAQAAAAEAAAA2/Pz8//z8/P9CiKn/4PL//1OZ2P8Zeb3/SJfE/0eN - x//Y5vP/+Pj4//j4+P/8/Pz/AAAANgAAAAEAAAABAAAANvz8/P/8/Pz/pMLX/3m11f+PttH/VMnk/1rf - 9f930O3/UJzd/9/r9f/4+Pj//Pz8/wAAADYAAAABAAAAAQAAADb8/Pz//Pz8//z8/P+x1eX/dbnX/8H2 - /f9i3/f/XOL4/3jT8P9Il9z/3uny//z8/P8AAAA2AAAAAQAAAAEAAAA2/Pz8//z8/P/8/Pz//Pz8/67U - 5f92y+f/x/f9/13c9f9Z4ff/etTx/0qZ3f/U5fX/AAAANgAAAAEAAAABAAAANvz8/P/8/Pz//Pz8//z8 - /P/8/Pz/vOXy/3jT7v/H9/3/Xtz1/1ri9/951vL/UKHi/yJJalwAAAABAAAAAQAAADb8/Pz/+/v7//z8 - /P/8/Pz/+/v7//j4+P+54/D/fNTu/8P2/f9r3fb/bMrt/2Ki1/9bmM/wTo3DJwAAAAEAAAA2/Pz8//n5 - +f/5+fn/+fn5//f39//29vb/8vLy/6fZ6P+A1u7/seP5/4q/5/+t0/b/w+D8/2We0/cAAAABAAAANvz8 - /P/39/f/+fn5//f39//39/f/8/Pz//Dw8P/q6ur/ruTz/3a95/+z0vD/5fP//6vS7/9Hi8foAAAAAAAA - ADb7+/v99PT0//X19f/19fX/9fX1//Hx8f/v7+//6enp//z8/P+r1eT/V6TY/4Sw2/9FnND/KpTRXgAA - AAAAAAAz+Pj48Pv7+/38/Pz//Pz8//z8/P/8/Pz//Pz8//z8/P/4+Pj/k5OTkQAAACAAAAACAAAAAAAA - AAAAAAAAAAAAHAAAADMAAAA2AAAANgAAADYAAAA2AAAANgAAADYAAAA2AAAANgAAACAAAAACAAAAAAAA - AAAAAAAAgAGsQYABrEEAAaxBAACsQQAArEEAAKxBAACsQQAArEEAAKxBAACsQQAArEEAAKxBAACsQYAA - rEGAA6xBgAesQQ== - - \ No newline at end of file diff --git a/BookmarkItem.cs b/BookmarkItem.cs deleted file mode 100644 index dcd6993..0000000 --- a/BookmarkItem.cs +++ /dev/null @@ -1,524 +0,0 @@ -using HtmlAgilityPack; -using System; -using System.ComponentModel; -using System.Drawing; -using System.IO; -using System.Net; -using System.Windows.Forms; -using HtmlDocument = HtmlAgilityPack.HtmlDocument; - -namespace bzit.bomg -{ - public class BookmarkItem - { - public delegate void RetrieveCompleted(BookmarkItem sender, bool hasError, string message); - - public RetrieveCompleted OnRetrieveCompleted { get; set; } = null; - - public TreeNode TreeViewNode { get; protected set; } - - public byte[] IconData { get; set; } = null; - - public string SiteName { get; set; } = null; - public string SiteAddress { get; set; } - public string Description { get; set; } - public string IconAddress { get; protected set; } - public string Fullpath { get; set; } - public string Created { get; set; } - - protected const char pathSeparator = '|'; - - //protected TreeNode treeNode = null; - protected BackgroundWorker mainThread = null; - - protected bool hasRetrieveError = false; - protected string retrieveErrorMessage = null; - - public BookmarkItem() - { - this.Clear(); - } - - public new string ToString() - { - string rv = ""; - rv += "Name=" + this.Fullpath + Environment.NewLine; - rv += "Address=" + this.SiteAddress + Environment.NewLine; - rv += "Description=" + this.Description + Environment.NewLine; - rv += "Created=" + this.Created?.Trim(); - - return rv; - } - - #region public properties - - - //{ - // get - // { - // return this.treeNode; - // } - - // set - // { - // this.treeNode = value; - // } - //} - - public Bitmap Icon - { - get - { - if (this.IconData == null) - { - return null; - } - - try - { - Image img = Image.FromStream(new MemoryStream(this.IconData)); - return new Bitmap(img, 16, 16); - } - catch - { - return null; - } - } - } - - - - #endregion - - #region public methods - - public void Clear() - { - this.Fullpath = string.Empty; - this.SiteAddress = string.Empty; - this.Description = string.Empty; - this.Created = string.Empty; - - if (this.mainThread == null) - { - this.mainThread = new BackgroundWorker(); - this.mainThread.WorkerReportsProgress = this.mainThread.WorkerSupportsCancellation = true; - this.mainThread.DoWork += retrieveWorker_DoWork; - this.mainThread.RunWorkerCompleted += retrieveWorker_RunWorkerCompleted; - } - } - - public string GetName() - { - if (this.Fullpath.Contains(pathSeparator.ToString())) - { - return decodePath(this.Fullpath.Substring(this.Fullpath.LastIndexOf(pathSeparator) + 1)).Trim(); - } - - return decodePath(this.Fullpath).Trim(); - } - - public void ChangeName(string newName) - { - string prefix = (this.Fullpath.Contains(pathSeparator.ToString()) ? this.Fullpath.Substring(0, this.Fullpath.IndexOf(pathSeparator)).Trim() : string.Empty); - - this.Fullpath = string.Concat(prefix, pathSeparator, encodePath(newName.Trim())); - } - - public void GetFaviconAddress() - { - hasRetrieveError = false; - retrieveErrorMessage = string.Empty; - - this.IconData = null; - - WebClient webClient = new WebClient(); - webClient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore); - - string sourceCode = string.Empty; - - try - { - sourceCode = webClient.DownloadString(this.SiteAddress); - } - catch (Exception exc) - { - hasRetrieveError = true; - retrieveErrorMessage = exc.Message; - return; - } - - HtmlAgilityPack.HtmlDocument document = new HtmlAgilityPack.HtmlDocument(); - document.LoadHtml(sourceCode); - - // favicon - this.IconAddress = parseSiteIcon(document); - if (!string.IsNullOrWhiteSpace(this.IconAddress)) - { - Uri iconAddressURI; - bool rv = Uri.TryCreate(new Uri(this.SiteAddress), this.IconAddress, out iconAddressURI); - if (rv) - { - this.IconAddress = iconAddressURI.ToString(); - } - } - - // load favicon image - if (!string.IsNullOrEmpty(this.IconAddress)) - { - try - { - this.IconData = webClient.DownloadData(this.IconAddress); - - if (!RyzStudio.IO.FileType.IsImage(this.IconData)) - { - this.IconData = null; - } - } - catch - { - this.IconData = null; - this.IconAddress = null; - } - } - - //// parse icon - //HtmlAgilityPack.HtmlNodeCollection hnc = document.DocumentNode.SelectNodes("//link"); - // if (hnc != null) - // { - // foreach (HtmlAgilityPack.HtmlNode node in hnc) - // { - // if (node.Attributes["rel"] == null) - // { - // continue; - // } - - // string nodeAttr = node.Attributes["rel"].Value.Trim(); - // if (nodeAttr.ToLower().Contains("icon")) - // { - // if (!string.IsNullOrEmpty(this.IconAddress)) - // { - // continue; - // } - - // if (node.Attributes["href"] != null) - // { - // Uri iconPath; - // bool rv = Uri.TryCreate(new Uri(this.SiteAddress), WebUtility.HtmlDecode(node.Attributes["href"].Value).Trim(), out iconPath); - // if (rv) - // { - // this.IconAddress = iconPath.ToString(); - // } - - // break; - // } - // } - // } - // } - - // // default favicon - // if (string.IsNullOrEmpty(this.IconAddress)) - // { - // Uri iconPath; - // if (Uri.TryCreate(new Uri(this.SiteAddress), "/favicon.ico", out iconPath)) - // { - // this.IconAddress = iconPath.ToString(); - // } - // } - - // // load icon image - // if (!string.IsNullOrEmpty(this.IconAddress)) - // { - // try - // { - // this.IconData = webClient.DownloadData(this.IconAddress); - - // if (!RyzStudio.IO.FileType.IsImage(this.IconData)) - // { - // this.IconData = null; - // } - // } - // catch - // { - // // do nothing - // } - // } - } - - public void RetrieveAsync() - { - if (this.mainThread.IsBusy) - { - return; - } - - this.mainThread.RunWorkerAsync(); - } - - public void RetrieveAsync(string address) - { - if (this.mainThread.IsBusy) - { - return; - } - - this.SiteAddress = address; - this.mainThread.RunWorkerAsync(); - } - - #endregion - - - protected void retrieveWorker_DoWork(object sender, DoWorkEventArgs e) - { - hasRetrieveError = false; - retrieveErrorMessage = string.Empty; - - this.IconData = null; - this.Fullpath = string.Empty; - this.Description = string.Empty; - this.IconAddress = string.Empty; - - WebClient webClient = new WebClient(); - webClient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore); - - string sourceCode = string.Empty; - - try - { - sourceCode = webClient.DownloadString(this.SiteAddress); - } - catch (Exception exc) - { - hasRetrieveError = true; - retrieveErrorMessage = exc.Message; - return; - } - - HtmlDocument document = new HtmlDocument(); - document.LoadHtml(sourceCode); - - // title - this.SiteName = parseSiteTitle(document); - - // description - this.Description = parseSiteDescription(document); - - // favicon - this.IconAddress = parseSiteIcon(document); - if (!string.IsNullOrWhiteSpace(this.IconAddress)) - { - Uri iconAddressURI; - bool rv = Uri.TryCreate(new Uri(this.SiteAddress), this.IconAddress, out iconAddressURI); - if (rv) - { - this.IconAddress = iconAddressURI.ToString(); - } - } - - // load favicon image - if (!string.IsNullOrWhiteSpace(this.IconAddress)) - { - try - { - this.IconData = webClient.DownloadData(this.IconAddress); - - if (!RyzStudio.IO.FileType.IsImage(this.IconData)) - { - this.IconData = null; - } - } - catch - { - this.IconData = null; - this.IconAddress = null; - } - } - } - - protected void retrieveWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) - { - this.OnRetrieveCompleted?.Invoke(this, hasRetrieveError, retrieveErrorMessage); - } - - protected string encodePath(string text) => System.Web.HttpUtility.UrlEncode(text); - - protected string decodePath(string text) => System.Web.HttpUtility.UrlDecode(text); - - 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; - } - - 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; - } - - 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[@rel='shortcut icon']", "href", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//link[@rel='icon']", "href", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//link[@rel='apple-touch-icon']", "href", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//link[@rel='apple-touch-icon-precomposed']", "href", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//meta[@property='og:image']", "content", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//meta[@name='twitter:image']", "content", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//meta[@property='og:image']", "content", string.Empty); - } - - if (string.IsNullOrWhiteSpace(rs)) - { - rs = parseTagValue_Attr(doc, "//meta[@itemprop='image']", "content", string.Empty); - } - - return rs; - } - - - } -} \ No newline at end of file diff --git a/BookmarkTreeView.cs b/BookmarkTreeView.cs deleted file mode 100644 index 6847b7d..0000000 --- a/BookmarkTreeView.cs +++ /dev/null @@ -1,125 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; - -namespace bzit.bomg -{ - public partial class BookmarkTreeView : RyzStudio.Windows.Forms.MovableTreeView - { - protected ImageList iconList = null; - - public BookmarkTreeView() - { - InitializeComponent(); - - this.iconList = new ImageList(); - this.iconList.ColorDepth = ColorDepth.Depth16Bit; - this.iconList.ImageSize = new Size(16, 16); - this.iconList.TransparentColor = Color.Transparent; - - this.iconList.Images.Clear(); - this.iconList.Images.Add(Properties.Resources.transmit_blue); - this.iconList.Images.Add(Properties.Resources.folder); - this.iconList.Images.Add(Properties.Resources.folder_explore); -//// this.iconList.Images.Add(Properties.Resources.page_white_gray_green); - this.iconList.Images.Add(Properties.Resources.page_white_world_bw); - - this.ImageList = this.iconList; - } - - #region encapsulation - - [Browsable(false)] - public new ImageList ImageList - { - get { return base.ImageList; } - set { base.ImageList = value; } - } - - #endregion - - #region public properties - - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(null)] - public IconDatabase IconDatabase { get; set; } - - #endregion - - #region integrated behaviour - - protected override void OnAddItemNode(TreeNode node) - { - base.OnAddItemNode(node); - - BookmarkItem bi = new BookmarkItem(); - node.Tag = bi; - } - - #endregion - - public void AddBookmarkItem(string name, BookmarkItem tag) - { - if (this.Nodes.Count <= 0) - { - return; - } - - TreeNode tn = AddBookmarkPageFullPath(name.Trim(), 3); - tn.Tag = tag; - tn.ToolTipText = tag.SiteAddress + Environment.NewLine + tag.Description; - - // load icon - if (this.IconDatabase.HasIcon(tag.SiteAddress)) - { - try - { - Image icon = this.IconDatabase.GetIcon(tag.SiteAddress); - if (icon != null) - { - tn.TreeView.ImageList.Images.Add(tag.SiteAddress, icon); - tn.ImageKey = tn.SelectedImageKey = tag.SiteAddress; - } - } - catch - { - // do nothing - } - } - } - - public int AddToIconList(BookmarkItem sender) - { - Image rs = null; - if (this.IconDatabase.HasIcon(sender.SiteAddress)) - { - rs = this.IconDatabase.GetIcon(sender.SiteAddress); - } - else - { - if (this.IconDatabase.AddIcon(sender.SiteAddress, sender.IconData)) - { - rs = sender.Icon; - } - } - - if (rs != null) - { - this.ImageList.Images.Add(sender.SiteAddress, rs); - return this.ImageList.Images.IndexOfKey(sender.SiteAddress); - } - - return 3; - } - - public void AddIcon(BookmarkItem sender) - { - if (this.IconDatabase.HasIcon(sender.SiteAddress)) - { - return; - } - - this.IconDatabase.AddIcon(sender.SiteAddress, sender.IconData); - } - } -} \ No newline at end of file diff --git a/IconDatabase.cs b/Data/IconDatabase.cs similarity index 87% rename from IconDatabase.cs rename to Data/IconDatabase.cs index e1c7a63..c761ad4 100644 --- a/IconDatabase.cs +++ b/Data/IconDatabase.cs @@ -3,7 +3,7 @@ using System.Drawing; using System.IO; using RyzStudio.Data.SQLite; -namespace bzit.bomg +namespace bzit.bomg.Data { public class IconDatabase : SQLiteDatabase2 { @@ -18,19 +18,17 @@ namespace bzit.bomg { return false; } - - return this.DoNonQuery(@" - CREATE TABLE bzt_app_bomg_icons + + return this.DoNonQuery(@" + CREATE TABLE bzt_app_bomg_icons ( - ico_id INTEGER PRIMARY KEY, + ico_id INTEGER PRIMARY KEY, ico_key TEXT, ico_hash TEXT, ico_content BLOB - ) + ) ") >= 0; } - -#region public methods public bool HasIcon(string url) { @@ -48,7 +46,7 @@ namespace bzit.bomg { return false; } - + if (this.HasIcon(url)) { return this.DoNonQuery("UPDATE bzt_app_bomg_icons SET='" + imageToSQLString(image) + "' WHERE ico_key='" + SQLiteDatabase2.escapeValue(url) + "';") >= 0; @@ -70,7 +68,7 @@ namespace bzit.bomg { return false; } - + if (this.HasIcon(url)) { return this.DoNonQuery("UPDATE bzt_app_bomg_icons SET='" + bytesToSQLString(image) + "' WHERE ico_key='" + escapeValue(url) + "';") >= 0; @@ -87,7 +85,7 @@ namespace bzit.bomg { return null; } - + string rs = this.DoQuerySingle("SELECT ico_content FROM bzt_app_bomg_icons WHERE ico_key='" + escapeValue(url) + "'"); return sqlStringToImage(rs); } @@ -98,35 +96,30 @@ namespace bzit.bomg { return; } - + this.DoNonQuery("DELETE FROM bzt_app_bomg_icons WHERE ico_key='" + escapeValue(url) + "';"); } - -#endregion - + protected string imageToSQLString(Image image) { MemoryStream stream = new MemoryStream(); image.Save(stream, new System.Drawing.Imaging.ImageFormat(image.RawFormat.Guid)); stream.Close(); - + byte[] byteArray = stream.ToArray(); - + return bytesToSQLString(byteArray); } - protected string bytesToSQLString(byte[] image) - { - return Convert.ToBase64String(image); - } + protected string bytesToSQLString(byte[] image) => Convert.ToBase64String(image); protected Image sqlStringToImage(string base64_string) - { + { byte[] byteArray2 = Convert.FromBase64String(base64_string); MemoryStream stream2 = new MemoryStream(); stream2.Write(byteArray2, 0, byteArray2.Length); - + Image displayImage = Image.FromStream(stream2); return displayImage; } diff --git a/FindForm.Designer.cs b/FindForm.Designer.cs index e22a971..22f649f 100644 --- a/FindForm.Designer.cs +++ b/FindForm.Designer.cs @@ -28,77 +28,99 @@ namespace bzit.bomg /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FindForm)); - this.label1 = new System.Windows.Forms.Label(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.btnSave = new RyzStudio.Windows.Forms.BigButton(); - this.button3 = new RyzStudio.Windows.Forms.BigButton(); + this.label2 = new System.Windows.Forms.Label(); + this.button1 = new RyzStudio.Windows.ThemedForms.Button(); + this.button2 = new RyzStudio.Windows.ThemedForms.Button(); + this.horizontalSeparator1 = new RyzStudio.Windows.Forms.HorizontalSeparator(); + this.textBox1 = new RyzStudio.Windows.ThemedForms.TextBox(); this.SuspendLayout(); // - // label1 + // label2 // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 12); - this.label1.Margin = new System.Windows.Forms.Padding(3); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(96, 13); - this.label1.TabIndex = 0; - this.label1.Text = "Find a search term"; + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 25); + this.label2.Margin = new System.Windows.Forms.Padding(3); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(27, 13); + this.label2.TabIndex = 72; + this.label2.Text = "Find"; + // + // button1 + // + 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.DefaultImage = null; + this.button1.DownImage = null; + this.button1.LabelText = "&Find"; + this.button1.Location = new System.Drawing.Point(150, 77); + this.button1.Name = "button1"; + this.button1.OverImage = null; + this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + this.button1.Size = new System.Drawing.Size(108, 32); + this.button1.TabIndex = 1; + this.button1.Click += new System.EventHandler(this.button1_Click); + this.button1.DoubleClick += new System.EventHandler(this.button1_Click); + this.button1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.button1_Click); + this.button1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.button1_Click); + // + // button2 + // + this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.button2.BackColor = System.Drawing.Color.Transparent; + this.button2.DefaultImage = null; + this.button2.DownImage = null; + this.button2.LabelText = "&Next"; + this.button2.Location = new System.Drawing.Point(264, 77); + this.button2.Name = "button2"; + this.button2.OverImage = null; + this.button2.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + this.button2.Size = new System.Drawing.Size(108, 32); + this.button2.TabIndex = 2; + this.button2.Click += new System.EventHandler(this.button2_Click); + this.button2.DoubleClick += new System.EventHandler(this.button2_Click); + this.button2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.button2_Click); + this.button2.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.button2_Click); + // + // horizontalSeparator1 + // + this.horizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.horizontalSeparator1.Location = new System.Drawing.Point(12, 62); + this.horizontalSeparator1.Margin = new System.Windows.Forms.Padding(3, 10, 3, 10); + this.horizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2); + this.horizontalSeparator1.Name = "horizontalSeparator1"; + this.horizontalSeparator1.Size = new System.Drawing.Size(360, 2); + this.horizontalSeparator1.TabIndex = 73; // // textBox1 // this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.textBox1.Location = new System.Drawing.Point(12, 31); - this.textBox1.MaxLength = 128; + this.textBox1.BackColor = System.Drawing.Color.Transparent; + this.textBox1.Location = new System.Drawing.Point(96, 15); + this.textBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(280, 21); + this.textBox1.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9); + this.textBox1.Size = new System.Drawing.Size(276, 32); + this.textBox1.SubmitButton = this.button2; this.textBox1.TabIndex = 0; - this.textBox1.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.textBox1_PreviewKeyDown); - // - // btnSave - // - this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnSave.BackColor = System.Drawing.Color.WhiteSmoke; - this.btnSave.Location = new System.Drawing.Point(196, 67); - this.btnSave.MaximumSize = new System.Drawing.Size(120, 32); - this.btnSave.MinimumSize = new System.Drawing.Size(32, 32); - this.btnSave.Name = "btnSave"; - this.btnSave.Padding = new System.Windows.Forms.Padding(4); - this.btnSave.Size = new System.Drawing.Size(96, 32); - this.btnSave.TabIndex = 22; - this.btnSave.Value = "&Next"; - this.btnSave.Click += new System.EventHandler(this.button1_Click); - // - // button3 - // - this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.button3.BackColor = System.Drawing.Color.WhiteSmoke; - this.button3.Location = new System.Drawing.Point(94, 67); - this.button3.MaximumSize = new System.Drawing.Size(120, 32); - this.button3.MinimumSize = new System.Drawing.Size(32, 32); - this.button3.Name = "button3"; - this.button3.Padding = new System.Windows.Forms.Padding(4); - this.button3.Size = new System.Drawing.Size(96, 32); - this.button3.TabIndex = 23; - this.button3.Value = "&Find"; - this.button3.Click += new System.EventHandler(this.button2_Click); + this.textBox1.UseSystemPasswordChar = false; // // FindForm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.Color.White; - this.ClientSize = new System.Drawing.Size(304, 111); - this.Controls.Add(this.button3); - this.Controls.Add(this.btnSave); + this.ClientSize = new System.Drawing.Size(384, 121); + this.Controls.Add(this.button1); + this.Controls.Add(this.button2); + this.Controls.Add(this.horizontalSeparator1); this.Controls.Add(this.textBox1); - this.Controls.Add(this.label1); + this.Controls.Add(this.label2); this.Font = new System.Drawing.Font("Tahoma", 8.25F); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "FindForm"; + this.ShowIcon = false; this.ShowInTaskbar = false; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; @@ -109,10 +131,10 @@ namespace bzit.bomg } #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.TextBox textBox1; - private RyzStudio.Windows.Forms.BigButton btnSave; - private RyzStudio.Windows.Forms.BigButton button3; + private RyzStudio.Windows.ThemedForms.Button button2; + private RyzStudio.Windows.Forms.HorizontalSeparator horizontalSeparator1; + private RyzStudio.Windows.ThemedForms.TextBox textBox1; + private System.Windows.Forms.Label label2; + private RyzStudio.Windows.ThemedForms.Button button1; } } \ No newline at end of file diff --git a/FindForm.cs b/FindForm.cs index 896c607..78086ee 100644 --- a/FindForm.cs +++ b/FindForm.cs @@ -11,80 +11,24 @@ namespace bzit.bomg public FindForm(MainForm form) { InitializeComponent(); - + + textBox1.PreviewKeyDown += textBox1_PreviewKeyDown; + textBox1.InnerTextBox.PreviewKeyDown += textBox1_PreviewKeyDown; + parentForm = form; } - private void button2_Click(object sender, EventArgs e) - { - if (parentForm == null) - { - return; - } - - if (string.IsNullOrEmpty(textBox1.Text)) - { - return; - } - - if (parentForm.treeView1.Nodes.Count <= 0) - { - return; - } - - findNextNew = false; - parentForm.treeView1.FindTextNode(parentForm.treeView1.Nodes[0], textBox1.Text.Trim()); - } - - private void button1_Click(object sender, EventArgs e) - { - if (parentForm == null) - { - return; - } - - if (string.IsNullOrEmpty(textBox1.Text)) - { - return; - } - - if (parentForm.treeView1.Nodes.Count <= 0) - { - return; - } - - if (parentForm.treeView1.SelectedNode == null) - { - parentForm.treeView1.SelectedNode = parentForm.treeView1.Nodes[0]; - } - - findNextNew = false; - - bool rv = parentForm.treeView1.FindTextNode(parentForm.treeView1.SelectedNode, textBox1.Text.Trim()); - if (!rv) - { - findNextNew = true; - } - } - -#region behaviour - private void textBox1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { switch (e.KeyCode) { case Keys.Enter: - if (string.IsNullOrEmpty(textBox1.Text)) - { - return; - } - if (findNextNew) { button2_Click(sender, null); } else - { + { button1_Click(sender, null); } @@ -96,7 +40,57 @@ namespace bzit.bomg } } -#endregion - + private void button1_Click(object sender, EventArgs e) + { + if (parentForm == null) + { + return; + } + + if (string.IsNullOrWhiteSpace(textBox1.Text)) + { + return; + } + + if (parentForm.TreeView.Nodes.Count <= 0) + { + return; + } + + findNextNew = false; + parentForm.TreeView.FindTextNode(parentForm.TreeView.Nodes[0], textBox1.Text?.Trim()); + } + + private void button2_Click(object sender, EventArgs e) + { + if (parentForm == null) + { + return; + } + + if (string.IsNullOrWhiteSpace(textBox1.Text)) + { + return; + } + + if (parentForm.TreeView.Nodes.Count <= 0) + { + return; + } + + if (parentForm.TreeView.SelectedNode == null) + { + parentForm.TreeView.SelectedNode = parentForm.TreeView.Nodes[0]; + } + + findNextNew = false; + + bool rv = parentForm.TreeView.SNode.FindTextNode(textBox1.Text?.Trim()); + if (!rv) + { + findNextNew = true; + } + } + } } \ No newline at end of file diff --git a/FindForm.resx b/FindForm.resx index dbc6f20..d58980a 100644 --- a/FindForm.resx +++ b/FindForm.resx @@ -117,29 +117,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATXJQDEFmRGgAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAhZZ0GGmGZrSFm - nP8RWpKHAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAA - AAAAAAAA//+sQf/nrEH/w6xB/4OsQf8DrEHAA6xBgAesQYAPrEGAH6xBgB+sQYAfrEGAH6xBgB+sQYAf - rEHAP6xB//+sQQ== - - \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 9cecc1d..0000000 --- a/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {one line to give the program's name and a brief idea of what it does.} - Copyright (C) {year} {name of author} - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - {project} Copyright (C) {year} {fullname} - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/LoadBookmarksForm.Designer.cs b/LoadBookmarksForm.Designer.cs new file mode 100644 index 0000000..abf3896 --- /dev/null +++ b/LoadBookmarksForm.Designer.cs @@ -0,0 +1,156 @@ +namespace bzit.bomg +{ + partial class LoadBookmarksForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.label5 = new System.Windows.Forms.Label(); + this.progressBar1 = new RyzStudio.Windows.ThemedForms.ProgressBar(); + this.horizontalSeparator1 = new RyzStudio.Windows.Forms.HorizontalSeparator(); + this.button2 = new RyzStudio.Windows.ThemedForms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 25); + this.label1.Margin = new System.Windows.Forms.Padding(3); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(63, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Bookmarks"; + // + // pictureBox1 + // + this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.pictureBox1.BackColor = System.Drawing.Color.Transparent; + this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; + this.pictureBox1.ErrorImage = null; + this.pictureBox1.InitialImage = null; + this.pictureBox1.Location = new System.Drawing.Point(226, 77); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(32, 32); + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; + this.pictureBox1.TabIndex = 60; + this.pictureBox1.TabStop = false; + // + // label5 + // + this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label5.ForeColor = System.Drawing.Color.OrangeRed; + this.label5.Location = new System.Drawing.Point(9, 77); + this.label5.Margin = new System.Windows.Forms.Padding(3); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(211, 32); + this.label5.TabIndex = 64; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // progressBar1 + // + 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.BarColour = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(225)))), ((int)(((byte)(249))))); + this.progressBar1.BarTextColour = System.Drawing.SystemColors.ControlText; + this.progressBar1.Location = new System.Drawing.Point(96, 15); + this.progressBar1.Margin = new System.Windows.Forms.Padding(3, 10, 3, 10); + this.progressBar1.Maximum = 0; + this.progressBar1.Minimum = 0; + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + this.progressBar1.Size = new System.Drawing.Size(276, 32); + this.progressBar1.TabIndex = 66; + this.progressBar1.Value = 0; + // + // horizontalSeparator1 + // + this.horizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.horizontalSeparator1.Location = new System.Drawing.Point(12, 62); + this.horizontalSeparator1.Margin = new System.Windows.Forms.Padding(3, 10, 3, 10); + this.horizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2); + this.horizontalSeparator1.Name = "horizontalSeparator1"; + this.horizontalSeparator1.Size = new System.Drawing.Size(360, 2); + this.horizontalSeparator1.TabIndex = 65; + // + // button2 + // + this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.button2.BackColor = System.Drawing.Color.Transparent; + this.button2.DefaultImage = null; + this.button2.DownImage = null; + this.button2.LabelText = "&Close"; + this.button2.Location = new System.Drawing.Point(264, 77); + this.button2.Name = "button2"; + this.button2.OverImage = null; + this.button2.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + this.button2.Size = new System.Drawing.Size(108, 32); + this.button2.TabIndex = 4; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // LoadBookmarksForm + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(384, 121); + this.Controls.Add(this.progressBar1); + this.Controls.Add(this.horizontalSeparator1); + this.Controls.Add(this.label5); + this.Controls.Add(this.button2); + this.Controls.Add(this.pictureBox1); + this.Controls.Add(this.label1); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "LoadBookmarksForm"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Load Bookmarks"; + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.PictureBox pictureBox1; + private RyzStudio.Windows.ThemedForms.Button button2; + private System.Windows.Forms.Label label5; + private RyzStudio.Windows.Forms.HorizontalSeparator horizontalSeparator1; + private RyzStudio.Windows.ThemedForms.ProgressBar progressBar1; + } +} \ No newline at end of file diff --git a/LoadBookmarksForm.cs b/LoadBookmarksForm.cs new file mode 100644 index 0000000..242cd94 --- /dev/null +++ b/LoadBookmarksForm.cs @@ -0,0 +1,360 @@ +using bzit.bomg.Models; +using ICSharpCode.SharpZipLib.Zip; +using Newtonsoft.Json; +using RyzStudio.Windows.Forms; +using RyzStudio.Windows.ThemedForms; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Xml; +using AppMode = bzit.bomg.MainForm.AppMode; +using Form = System.Windows.Forms.Form; + +namespace bzit.bomg +{ + public partial class LoadBookmarksForm : Form + { + protected bool isBusy = false; + protected bool requestCancel = false; + + protected MainForm parentForm = null; + protected string sessionFilename = null; + + public LoadBookmarksForm(MainForm mainForm, string filename) : base() + { + InitializeComponent(); + + parentForm = mainForm; + sessionFilename = filename; + + this.StartPosition = FormStartPosition.WindowsDefaultLocation; + } + + protected override void OnClosing(CancelEventArgs e) + { + base.OnClosing(e); + + if (this.IsBusy) + { + e.Cancel = true; + } + } + + protected async override void OnShown(EventArgs e) + { + base.OnShown(e); + + await loadFile(sessionFilename); + + this.Close(); + } + + protected bool IsBusy + { + get => isBusy; + set + { + isBusy = value; + parentForm.IsBusy = value; + + ThreadControl.SetImage(pictureBox1, (value) ? Properties.Resources.aniZomq2x32 : null); + //ThreadControl.SetEnable(button2, !value); + } + } + + private void button2_Click(object sender, EventArgs e) + { + if (this.IsBusy) + { + return; + } + + this.Close(); + } + + protected async Task loadFile(string filename) + { + parentForm.ClearSession(); + parentForm.TreeView.Clear(); + parentForm.TreeView.HasChanged = false; + + if (string.IsNullOrWhiteSpace(filename)) + { + return; + } + + ThreadControl.SetValue(progressBar1, 0, 0); + + string password = string.Empty; + + if (RyzStudio.IO.SharpZipLib.IsZipEncrypted(filename)) + { + TextBoxForm passwordForm = new TextBoxForm("Password", "Password", true); + + while (true) + { + password = passwordForm.ShowDialog(); + if (string.IsNullOrWhiteSpace(password)) + { + break; + } + + if (RyzStudio.IO.SharpZipLib.TestZipEncrypted(filename, password)) + { + parentForm.SetSessionFile(filename, password); + break; + } + } + + if (string.IsNullOrWhiteSpace(password)) + { + return; + } + } + + this.IsBusy = true; + + string ext = Path.GetExtension(filename).Trim('.').ToLower(); + if (ext.Equals("jsnx")) + { + await loadJSNXBookmarkFile(filename, password); + } + else if (ext.Equals("ryz")) + { + await loadRYZBookmarkFile(filename, password); + } + else + { + // do nothing + } + + this.IsBusy = false; + parentForm.AllowSave = false; + parentForm.TreeView.HasChanged = false; + + if (parentForm.TreeView.Nodes.Count > 0) parentForm.TreeView.Nodes[0].Expand(); + } + + protected async Task loadJSNXBookmarkFile(string filename, string password) + { + await Task.Run(() => + { + int size = 2048; + byte[] buffer = new byte[size]; + int bufferSize = 0; + + List rs = null; + + ZipEntry readEntry = null; + 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("bookmarks.json")) + { + 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); + rs = JsonConvert.DeserializeObject>(sr.ReadToEnd()); + + break; + } + + readStream.Flush(); + readStream.Close(); + readStream.Dispose(); + readStream = null; + + // load bookmark items + ThreadControl.SetValue(progressBar1, 0, rs.Count); + + for (int i=0; i + { + int size = 2048; + byte[] buffer = new byte[size]; + int bufferSize = 0; + + List rs = new List(); + + ZipEntry readEntry = null; + 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("bookmarks.xml")) + { + 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; + + // read stream + StreamReader sr = new StreamReader(ms); + + // load xml + XmlDocument xmlDocument = new XmlDocument(); + xmlDocument.LoadXml(sr.ReadToEnd()); + + // parse + XmlNode xnl = xmlDocument.SelectSingleNode("bomg/b/g"); + if (xnl == null) + { + break; + } + + 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) + { + BookmarkItemViewModel viewModel = new BookmarkItemViewModel(); + + foreach (XmlNode xn2 in xn.ChildNodes) + { + switch (xn2.LocalName) + { + case "name": + viewModel.SiteName = xn2.InnerText?.Trim(); + break; + case "address": + viewModel.SiteAddress = xn2.InnerText?.Trim(); + break; + case "description": + viewModel.SiteDescription = xn2.InnerText?.Trim(); + break; + //case "created": + // bi.Created = xn2.InnerText?.Trim(); + // break; + default: + break; + } + } + + // fix fullpath and name + if (viewModel.SiteName.Contains("|")) + { + StringBuilder sb = new StringBuilder(); + sb.Append("\\"); + sb.Append(System.Web.HttpUtility.UrlEncode(rootName)); + sb.Append("\\"); + + string[] pathParts = viewModel.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("\\"); + } + + viewModel.SiteName = System.Web.HttpUtility.UrlDecode(pathParts[(pathParts.Length - 1)] ?? string.Empty); + viewModel.TreeviewPath = sb.ToString(); + } + else + { + viewModel.SiteName = System.Web.HttpUtility.UrlDecode(viewModel.SiteName); + viewModel.TreeviewPath = string.Format("\\{0}\\", System.Web.HttpUtility.UrlEncode(rootName)); + } + + rs.Add(viewModel); + } + + break; + } + + readStream.Flush(); + readStream.Close(); + readStream.Dispose(); + readStream = null; + + // load bookmark items + ThreadControl.SetValue(progressBar1, 0, rs.Count); + + for (int i = 0; i < rs.Count; i++) + { + ThreadControl.SetValue(progressBar1, (i + 1)); + + parentForm.TreeView.AddItem(rs[i]); + } + + parentForm.ClearSession(); + parentForm.ApplicationMode = AppMode.Open; + }); + } + + } +} \ No newline at end of file diff --git a/PasswordForm.resx b/LoadBookmarksForm.resx similarity index 73% rename from PasswordForm.resx rename to LoadBookmarksForm.resx index de6f015..d58980a 100644 --- a/PasswordForm.resx +++ b/LoadBookmarksForm.resx @@ -117,29 +117,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAzjMmFRJ7V6TmMy+AkZqRWAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR63jyYXp+f9M2fX/OZHM8yNgnF0AAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEeq4c+g5vj/N9Ly/0bW9v86k831IlqYYhlS - tw0cXb8NAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvl9pcOZ3dzpji9v9S3PX/Rdn2/zaP - zPQ0gs/oNYPS6B9dplMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACyU2TRFqeHKT7fl3l3Z - 8v9N2/b/Wt33/1TY9f8tf833H1ehWQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADOY - 2oaI3fT/aeD2/3Li9/9e3/b/VNr2/zd+zfMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAA6oN2vqO75/33m+P+Z6Pj/fdHw/3/i9v8+l9nwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAALZXZZlzA6v2i8Pv/f9Tw/33H7P9Pot31IG21WQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAokNhwbsns/8nz+/9WueftJITNSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAALJXaAjCY2olFquHLKpXaYwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAA//+sQf//rEH//6xB4f+sQeD/rEHgH6xB4A+sQfAHrEH8B6xB/AesQfwHrEH+D6xB/h+sQf// - rEH//6xB//+sQQ== - - \ No newline at end of file diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index aa7c313..af1ef74 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -1,3 +1,5 @@ +using RyzStudio.Windows.Forms; + namespace bzit.bomg { partial class MainForm @@ -28,88 +30,83 @@ namespace bzit.bomg /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); - this.treeMenuItem = new System.Windows.Forms.ContextMenuStrip(this.components); - this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripMenuItem8 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); - this.listViewMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.moveFileToToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.statusBar1 = new System.Windows.Forms.StatusBar(); - this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel(); - this.statusBarPanel2 = new System.Windows.Forms.StatusBarPanel(); - this.oToolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.imageList1 = new System.Windows.Forms.ImageList(this.components); - this.toolStrip1 = new System.Windows.Forms.ToolStrip(); - this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton(); - this.newFileMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openFileMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.closeFileMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); - this.saveFileMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveAsFileMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); - this.exportFileMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); - this.exitFileMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripDropDownButton2 = new System.Windows.Forms.ToolStripDropDownButton(); - this.findEditMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripDropDownButton3 = new System.Windows.Forms.ToolStripDropDownButton(); - this.expandAllViewMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.collapseAllViewMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripDropDownButton4 = new System.Windows.Forms.ToolStripDropDownButton(); - this.updateIconsToolMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator(); - this.optionsToolMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripDropDownButton5 = new System.Windows.Forms.ToolStripDropDownButton(); - this.viewHelpHelpMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator(); - this.aboutHelpMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripDropDownButton7 = new System.Windows.Forms.ToolStripDropDownButton(); - this.alwaysOnTopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); - this.treeMenuFolder = new System.Windows.Forms.ContextMenuStrip(this.components); - this.toolStripMenuItem15 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem16 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripMenuItem14 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem9 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem11 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); - this.sortToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripMenuItem12 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem13 = new System.Windows.Forms.ToolStripMenuItem(); - this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); - this.toolStrip2 = new System.Windows.Forms.ToolStrip(); - this.newMenuBarItem = new System.Windows.Forms.ToolStripButton(); - this.openMenuBarItem = new System.Windows.Forms.ToolStripButton(); - this.saveMenuBarItem = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); - this.treeMenuRoot = new System.Windows.Forms.ContextMenuStrip(this.components); - this.toolStripMenuItem17 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem18 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripMenuItem20 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripMenuItem22 = new System.Windows.Forms.ToolStripMenuItem(); - this.treeView1 = new bzit.bomg.BookmarkTreeView(); - this.treeMenuItem.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).BeginInit(); - this.toolStrip1.SuspendLayout(); - this.treeMenuFolder.SuspendLayout(); - this.toolStrip2.SuspendLayout(); - this.treeMenuRoot.SuspendLayout(); - this.SuspendLayout(); - // - // treeMenuItem - // - this.treeMenuItem.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); + this.pageTreeNodeMenu = new System.Windows.Forms.ContextMenuStrip(this.components); + this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripMenuItem8 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.listViewMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.moveFileToToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.statusBar1 = new System.Windows.Forms.StatusBar(); + this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel(); + this.statusBarPanel2 = new System.Windows.Forms.StatusBarPanel(); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.toolStrip1 = new System.Windows.Forms.ToolStrip(); + this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton(); + this.newFileMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openFileMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.closeFileMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); + this.saveFileMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveAsFileMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); + this.exitFileMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripDropDownButton2 = new System.Windows.Forms.ToolStripDropDownButton(); + this.findEditMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripDropDownButton3 = new System.Windows.Forms.ToolStripDropDownButton(); + this.expandAllViewMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.collapseAllViewMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); + this.alwaysOnTopToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripDropDownButton4 = new System.Windows.Forms.ToolStripDropDownButton(); + this.optionsToolMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripDropDownButton5 = new System.Windows.Forms.ToolStripDropDownButton(); + this.viewHelpHelpMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator(); + this.aboutHelpMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); + this.folderTreeNodeMenu = new System.Windows.Forms.ContextMenuStrip(this.components); + this.toolStripMenuItem15 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem16 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripMenuItem14 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem9 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem11 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); + this.sortToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripMenuItem12 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem13 = new System.Windows.Forms.ToolStripMenuItem(); + this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); + this.toolStrip2 = new System.Windows.Forms.ToolStrip(); + this.newMenuBarItem = new System.Windows.Forms.ToolStripButton(); + this.openMenuBarItem = new System.Windows.Forms.ToolStripButton(); + this.saveMenuBarItem = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); + this.rootTreeNodeMenu = new System.Windows.Forms.ContextMenuStrip(this.components); + this.toolStripMenuItem17 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem18 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripMenuItem20 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripMenuItem22 = new System.Windows.Forms.ToolStripMenuItem(); + this.treeView1 = new RyzStudio.Windows.Forms.BookmarkTreeView(); + this.pageTreeNodeMenu.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).BeginInit(); + this.toolStrip1.SuspendLayout(); + this.folderTreeNodeMenu.SuspendLayout(); + this.toolStrip2.SuspendLayout(); + this.rootTreeNodeMenu.SuspendLayout(); + this.SuspendLayout(); + // + // pageTreeNodeMenu + // + this.pageTreeNodeMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripMenuItem4, this.toolStripSeparator3, this.toolStripMenuItem8, @@ -117,113 +114,105 @@ namespace bzit.bomg this.toolStripSeparator2, this.listViewMenuItem1, this.moveFileToToolStripMenuItem}); - this.treeMenuItem.Name = "listViewMenu"; - this.treeMenuItem.Size = new System.Drawing.Size(139, 126); - // - // toolStripMenuItem4 - // - this.toolStripMenuItem4.Name = "toolStripMenuItem4"; - this.toolStripMenuItem4.Size = new System.Drawing.Size(138, 22); - this.toolStripMenuItem4.Text = "&Open"; - this.toolStripMenuItem4.Click += new System.EventHandler(this.toolStripMenuItem4_Click); - // - // toolStripSeparator3 - // - this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(135, 6); - // - // toolStripMenuItem8 - // - this.toolStripMenuItem8.Name = "toolStripMenuItem8"; - this.toolStripMenuItem8.Size = new System.Drawing.Size(138, 22); - this.toolStripMenuItem8.Text = "E&dit"; - this.toolStripMenuItem8.Click += new System.EventHandler(this.toolStripMenuItem8_Click); - // - // toolStripMenuItem6 - // - this.toolStripMenuItem6.Name = "toolStripMenuItem6"; - this.toolStripMenuItem6.Size = new System.Drawing.Size(138, 22); - this.toolStripMenuItem6.Text = "D&elete"; - this.toolStripMenuItem6.Click += new System.EventHandler(this.toolStripMenuItem6_Click); - // - // toolStripSeparator2 - // - this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(135, 6); - // - // listViewMenuItem1 - // - this.listViewMenuItem1.Name = "listViewMenuItem1"; - this.listViewMenuItem1.Size = new System.Drawing.Size(138, 22); - this.listViewMenuItem1.Text = "Move &Up"; - this.listViewMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem12_Click); - // - // moveFileToToolStripMenuItem - // - this.moveFileToToolStripMenuItem.Name = "moveFileToToolStripMenuItem"; - this.moveFileToToolStripMenuItem.Size = new System.Drawing.Size(138, 22); - this.moveFileToToolStripMenuItem.Text = "Move &Down"; - this.moveFileToToolStripMenuItem.Click += new System.EventHandler(this.toolStripMenuItem13_Click); - // - // statusBar1 - // - this.statusBar1.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.statusBar1.Location = new System.Drawing.Point(0, 634); - this.statusBar1.Name = "statusBar1"; - this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] { + this.pageTreeNodeMenu.Name = "listViewMenu"; + this.pageTreeNodeMenu.Size = new System.Drawing.Size(139, 126); + // + // toolStripMenuItem4 + // + this.toolStripMenuItem4.Image = global::bzit.bomg.Properties.Resources.bookmark; + this.toolStripMenuItem4.Name = "toolStripMenuItem4"; + this.toolStripMenuItem4.Size = new System.Drawing.Size(138, 22); + this.toolStripMenuItem4.Text = "&Open"; + this.toolStripMenuItem4.Click += new System.EventHandler(this.openContextMenu_Click); + // + // toolStripSeparator3 + // + this.toolStripSeparator3.Name = "toolStripSeparator3"; + this.toolStripSeparator3.Size = new System.Drawing.Size(135, 6); + // + // toolStripMenuItem8 + // + this.toolStripMenuItem8.Name = "toolStripMenuItem8"; + this.toolStripMenuItem8.Size = new System.Drawing.Size(138, 22); + this.toolStripMenuItem8.Text = "E&dit"; + this.toolStripMenuItem8.Click += new System.EventHandler(this.editContextMenu3_Click); + // + // toolStripMenuItem6 + // + this.toolStripMenuItem6.Image = global::bzit.bomg.Properties.Resources.trash_2; + this.toolStripMenuItem6.Name = "toolStripMenuItem6"; + this.toolStripMenuItem6.Size = new System.Drawing.Size(138, 22); + this.toolStripMenuItem6.Text = "D&elete"; + this.toolStripMenuItem6.Click += new System.EventHandler(this.deleteContextMenu2_Click); + // + // toolStripSeparator2 + // + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(135, 6); + // + // listViewMenuItem1 + // + this.listViewMenuItem1.Image = global::bzit.bomg.Properties.Resources.arrow_up_circle; + this.listViewMenuItem1.Name = "listViewMenuItem1"; + this.listViewMenuItem1.Size = new System.Drawing.Size(138, 22); + this.listViewMenuItem1.Text = "Move &Up"; + this.listViewMenuItem1.Click += new System.EventHandler(this.moveUpContextMenu2_Click); + // + // moveFileToToolStripMenuItem + // + this.moveFileToToolStripMenuItem.Image = global::bzit.bomg.Properties.Resources.arrow_down_circle; + this.moveFileToToolStripMenuItem.Name = "moveFileToToolStripMenuItem"; + this.moveFileToToolStripMenuItem.Size = new System.Drawing.Size(138, 22); + this.moveFileToToolStripMenuItem.Text = "Move &Down"; + this.moveFileToToolStripMenuItem.Click += new System.EventHandler(this.moveDownContextMenu2_Click); + // + // statusBar1 + // + this.statusBar1.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.statusBar1.Location = new System.Drawing.Point(0, 634); + this.statusBar1.Name = "statusBar1"; + this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] { this.statusBarPanel1, this.statusBarPanel2}); - this.statusBar1.ShowPanels = true; - this.statusBar1.Size = new System.Drawing.Size(304, 20); - this.statusBar1.SizingGrip = false; - this.statusBar1.TabIndex = 9; - // - // statusBarPanel1 - // - this.statusBarPanel1.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring; - this.statusBarPanel1.Name = "statusBarPanel1"; - this.statusBarPanel1.Width = 204; - // - // statusBarPanel2 - // - this.statusBarPanel2.Alignment = System.Windows.Forms.HorizontalAlignment.Center; - this.statusBarPanel2.Name = "statusBarPanel2"; - // - // imageList1 - // - this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); - this.imageList1.TransparentColor = System.Drawing.Color.Transparent; - this.imageList1.Images.SetKeyName(0, "transmit_blue.png"); - this.imageList1.Images.SetKeyName(1, "folder.png"); - this.imageList1.Images.SetKeyName(2, "folder_explore.png"); - this.imageList1.Images.SetKeyName(3, "page_blue.png"); - this.imageList1.Images.SetKeyName(4, "page.png"); - this.imageList1.Images.SetKeyName(5, "page_green.png"); - this.imageList1.Images.SetKeyName(6, "page_red.png"); - // - // toolStrip1 - // - this.toolStrip1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; - this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.statusBar1.ShowPanels = true; + this.statusBar1.Size = new System.Drawing.Size(304, 20); + this.statusBar1.SizingGrip = false; + this.statusBar1.TabIndex = 9; + // + // statusBarPanel1 + // + this.statusBarPanel1.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring; + this.statusBarPanel1.Name = "statusBarPanel1"; + this.statusBarPanel1.Width = 204; + // + // statusBarPanel2 + // + this.statusBarPanel2.Alignment = System.Windows.Forms.HorizontalAlignment.Center; + this.statusBarPanel2.Name = "statusBarPanel2"; + // + // toolStrip1 + // + this.toolStrip1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; + this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripDropDownButton1, this.toolStripDropDownButton2, this.toolStripDropDownButton3, this.toolStripDropDownButton4, - this.toolStripDropDownButton5, - this.toolStripDropDownButton7}); - this.toolStrip1.Location = new System.Drawing.Point(0, 0); - this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Padding = new System.Windows.Forms.Padding(5, 0, 1, 0); - this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; - this.toolStrip1.Size = new System.Drawing.Size(304, 25); - this.toolStrip1.TabIndex = 25; - this.toolStrip1.Text = "toolStrip1"; - // - // toolStripDropDownButton1 - // - this.toolStripDropDownButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripDropDownButton5}); + this.toolStrip1.Location = new System.Drawing.Point(0, 0); + this.toolStrip1.Name = "toolStrip1"; + this.toolStrip1.Padding = new System.Windows.Forms.Padding(5, 0, 1, 0); + this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; + this.toolStrip1.ShowItemToolTips = false; + this.toolStrip1.Size = new System.Drawing.Size(304, 25); + this.toolStrip1.TabIndex = 25; + this.toolStrip1.Text = "toolStrip1"; + // + // toolStripDropDownButton1 + // + this.toolStripDropDownButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.newFileMenuItem, this.openFileMenuItem, this.toolStripSeparator1, @@ -232,242 +221,201 @@ namespace bzit.bomg this.saveFileMenuItem, this.saveAsFileMenuItem, this.toolStripSeparator8, - this.exportFileMenuItem, - this.toolStripSeparator6, this.exitFileMenuItem}); - this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripDropDownButton1.Name = "toolStripDropDownButton1"; - this.toolStripDropDownButton1.ShowDropDownArrow = false; - this.toolStripDropDownButton1.Size = new System.Drawing.Size(29, 22); - this.toolStripDropDownButton1.Text = "&File"; - // - // newFileMenuItem - // - this.newFileMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("newFileMenuItem.Image"))); - this.newFileMenuItem.Name = "newFileMenuItem"; - this.newFileMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); - this.newFileMenuItem.Size = new System.Drawing.Size(186, 22); - this.newFileMenuItem.Text = "&New"; - this.newFileMenuItem.Click += new System.EventHandler(this.newSessionToolStripMenuItem_Click); - // - // openFileMenuItem - // - this.openFileMenuItem.Image = global::bzit.bomg.Properties.Resources.folder_page; - this.openFileMenuItem.Name = "openFileMenuItem"; - this.openFileMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); - this.openFileMenuItem.Size = new System.Drawing.Size(186, 22); - this.openFileMenuItem.Text = "&Open"; - this.openFileMenuItem.Click += new System.EventHandler(this.toolStripMenuItem2_Click); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(183, 6); - // - // closeFileMenuItem - // - this.closeFileMenuItem.Name = "closeFileMenuItem"; - this.closeFileMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.W))); - this.closeFileMenuItem.Size = new System.Drawing.Size(186, 22); - this.closeFileMenuItem.Text = "&Close"; - this.closeFileMenuItem.Click += new System.EventHandler(this.toolStripMenuItem3_Click); - // - // toolStripSeparator4 - // - this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(183, 6); - // - // saveFileMenuItem - // - this.saveFileMenuItem.Image = global::bzit.bomg.Properties.Resources.disk; - this.saveFileMenuItem.Name = "saveFileMenuItem"; - this.saveFileMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); - this.saveFileMenuItem.Size = new System.Drawing.Size(186, 22); - this.saveFileMenuItem.Text = "&Save"; - this.saveFileMenuItem.Click += new System.EventHandler(this.importSnapshotToolStripMenuItem_Click); - // - // saveAsFileMenuItem - // - this.saveAsFileMenuItem.Image = global::bzit.bomg.Properties.Resources.page_white_disk; - this.saveAsFileMenuItem.Name = "saveAsFileMenuItem"; - this.saveAsFileMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripDropDownButton1.Name = "toolStripDropDownButton1"; + this.toolStripDropDownButton1.ShowDropDownArrow = false; + this.toolStripDropDownButton1.Size = new System.Drawing.Size(29, 22); + this.toolStripDropDownButton1.Text = "&File"; + // + // newFileMenuItem + // + this.newFileMenuItem.Image = global::bzit.bomg.Properties.Resources.file; + this.newFileMenuItem.Name = "newFileMenuItem"; + this.newFileMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); + this.newFileMenuItem.Size = new System.Drawing.Size(186, 22); + this.newFileMenuItem.Text = "&New"; + this.newFileMenuItem.Click += new System.EventHandler(this.fileNewMenuItem_Click); + // + // openFileMenuItem + // + this.openFileMenuItem.Image = global::bzit.bomg.Properties.Resources.folder1; + this.openFileMenuItem.Name = "openFileMenuItem"; + this.openFileMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); + this.openFileMenuItem.Size = new System.Drawing.Size(186, 22); + this.openFileMenuItem.Text = "&Open"; + this.openFileMenuItem.Click += new System.EventHandler(this.fileOpenMenuItem_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(183, 6); + // + // closeFileMenuItem + // + this.closeFileMenuItem.Name = "closeFileMenuItem"; + this.closeFileMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.W))); + this.closeFileMenuItem.Size = new System.Drawing.Size(186, 22); + this.closeFileMenuItem.Text = "&Close"; + this.closeFileMenuItem.Click += new System.EventHandler(this.fileCloseMenuItem_Click); + // + // toolStripSeparator4 + // + this.toolStripSeparator4.Name = "toolStripSeparator4"; + this.toolStripSeparator4.Size = new System.Drawing.Size(183, 6); + // + // saveFileMenuItem + // + this.saveFileMenuItem.Image = global::bzit.bomg.Properties.Resources.save; + this.saveFileMenuItem.Name = "saveFileMenuItem"; + this.saveFileMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); + this.saveFileMenuItem.Size = new System.Drawing.Size(186, 22); + this.saveFileMenuItem.Text = "&Save"; + this.saveFileMenuItem.Click += new System.EventHandler(this.fileSaveMenuItem_Click); + // + // saveAsFileMenuItem + // + this.saveAsFileMenuItem.Name = "saveAsFileMenuItem"; + this.saveAsFileMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.S))); - this.saveAsFileMenuItem.Size = new System.Drawing.Size(186, 22); - this.saveAsFileMenuItem.Text = "Save &As"; - this.saveAsFileMenuItem.Click += new System.EventHandler(this.exportSnapshotToolStripMenuItem_Click); - // - // toolStripSeparator8 - // - this.toolStripSeparator8.Name = "toolStripSeparator8"; - this.toolStripSeparator8.Size = new System.Drawing.Size(183, 6); - // - // exportFileMenuItem - // - this.exportFileMenuItem.Enabled = false; - this.exportFileMenuItem.Name = "exportFileMenuItem"; - this.exportFileMenuItem.Size = new System.Drawing.Size(186, 22); - this.exportFileMenuItem.Text = "&Export"; - this.exportFileMenuItem.Click += new System.EventHandler(this.toolStripMenuItem7_Click); - // - // toolStripSeparator6 - // - this.toolStripSeparator6.Name = "toolStripSeparator6"; - this.toolStripSeparator6.Size = new System.Drawing.Size(183, 6); - // - // exitFileMenuItem - // - this.exitFileMenuItem.Name = "exitFileMenuItem"; - this.exitFileMenuItem.Size = new System.Drawing.Size(186, 22); - this.exitFileMenuItem.Text = "E&xit"; - this.exitFileMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem1_Click); - // - // toolStripDropDownButton2 - // - this.toolStripDropDownButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripDropDownButton2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.saveAsFileMenuItem.Size = new System.Drawing.Size(186, 22); + this.saveAsFileMenuItem.Text = "Save &As"; + this.saveAsFileMenuItem.Click += new System.EventHandler(this.fileSaveAsMenuItem_Click); + // + // toolStripSeparator8 + // + this.toolStripSeparator8.Name = "toolStripSeparator8"; + this.toolStripSeparator8.Size = new System.Drawing.Size(183, 6); + // + // exitFileMenuItem + // + this.exitFileMenuItem.Name = "exitFileMenuItem"; + this.exitFileMenuItem.Size = new System.Drawing.Size(186, 22); + this.exitFileMenuItem.Text = "E&xit"; + this.exitFileMenuItem.Click += new System.EventHandler(this.fileExitMenuItem_Click); + // + // toolStripDropDownButton2 + // + this.toolStripDropDownButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.toolStripDropDownButton2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.findEditMenuItem}); - this.toolStripDropDownButton2.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripDropDownButton2.Name = "toolStripDropDownButton2"; - this.toolStripDropDownButton2.ShowDropDownArrow = false; - this.toolStripDropDownButton2.Size = new System.Drawing.Size(31, 22); - this.toolStripDropDownButton2.Text = "&Edit"; - // - // findEditMenuItem - // - this.findEditMenuItem.Image = global::bzit.bomg.Properties.Resources.magnifier; - this.findEditMenuItem.Name = "findEditMenuItem"; - this.findEditMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); - this.findEditMenuItem.Size = new System.Drawing.Size(137, 22); - this.findEditMenuItem.Text = "&Find"; - this.findEditMenuItem.Click += new System.EventHandler(this.toolStripButton5_Click); - // - // toolStripDropDownButton3 - // - this.toolStripDropDownButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripDropDownButton3.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripDropDownButton2.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripDropDownButton2.Name = "toolStripDropDownButton2"; + this.toolStripDropDownButton2.ShowDropDownArrow = false; + this.toolStripDropDownButton2.Size = new System.Drawing.Size(31, 22); + this.toolStripDropDownButton2.Text = "&Edit"; + // + // findEditMenuItem + // + this.findEditMenuItem.Image = global::bzit.bomg.Properties.Resources.search; + this.findEditMenuItem.Name = "findEditMenuItem"; + this.findEditMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); + this.findEditMenuItem.Size = new System.Drawing.Size(137, 22); + this.findEditMenuItem.Text = "&Find"; + this.findEditMenuItem.Click += new System.EventHandler(this.editFindMenuItem_Click); + // + // toolStripDropDownButton3 + // + this.toolStripDropDownButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.toolStripDropDownButton3.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.expandAllViewMenuItem, - this.collapseAllViewMenuItem}); - this.toolStripDropDownButton3.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripDropDownButton3.Name = "toolStripDropDownButton3"; - this.toolStripDropDownButton3.ShowDropDownArrow = false; - this.toolStripDropDownButton3.Size = new System.Drawing.Size(36, 22); - this.toolStripDropDownButton3.Text = "&View"; - // - // expandAllViewMenuItem - // - this.expandAllViewMenuItem.Enabled = false; - this.expandAllViewMenuItem.Name = "expandAllViewMenuItem"; - this.expandAllViewMenuItem.Size = new System.Drawing.Size(136, 22); - this.expandAllViewMenuItem.Text = "&Expand All"; - this.expandAllViewMenuItem.Click += new System.EventHandler(this.expandAllToolStripMenuItem_Click); - // - // collapseAllViewMenuItem - // - this.collapseAllViewMenuItem.Enabled = false; - this.collapseAllViewMenuItem.Name = "collapseAllViewMenuItem"; - this.collapseAllViewMenuItem.Size = new System.Drawing.Size(136, 22); - this.collapseAllViewMenuItem.Text = "&Collapse All"; - this.collapseAllViewMenuItem.Click += new System.EventHandler(this.collapseAllToolStripMenuItem_Click); - // - // toolStripDropDownButton4 - // - this.toolStripDropDownButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripDropDownButton4.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.updateIconsToolMenuItem, - this.toolStripSeparator14, + this.collapseAllViewMenuItem, + this.toolStripMenuItem1, + this.alwaysOnTopToolStripMenuItem1}); + this.toolStripDropDownButton3.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripDropDownButton3.Name = "toolStripDropDownButton3"; + this.toolStripDropDownButton3.ShowDropDownArrow = false; + this.toolStripDropDownButton3.Size = new System.Drawing.Size(36, 22); + this.toolStripDropDownButton3.Text = "&View"; + // + // expandAllViewMenuItem + // + this.expandAllViewMenuItem.Name = "expandAllViewMenuItem"; + this.expandAllViewMenuItem.Size = new System.Drawing.Size(204, 22); + this.expandAllViewMenuItem.Text = "&Expand All"; + this.expandAllViewMenuItem.Click += new System.EventHandler(this.viewExpandAllMenuItem_Click); + // + // collapseAllViewMenuItem + // + this.collapseAllViewMenuItem.Name = "collapseAllViewMenuItem"; + this.collapseAllViewMenuItem.Size = new System.Drawing.Size(204, 22); + this.collapseAllViewMenuItem.Text = "&Collapse All"; + this.collapseAllViewMenuItem.Click += new System.EventHandler(this.viewCollapseAllMenuItem_Click); + // + // toolStripMenuItem1 + // + this.toolStripMenuItem1.Name = "toolStripMenuItem1"; + this.toolStripMenuItem1.Size = new System.Drawing.Size(201, 6); + // + // alwaysOnTopToolStripMenuItem1 + // + this.alwaysOnTopToolStripMenuItem1.Name = "alwaysOnTopToolStripMenuItem1"; + this.alwaysOnTopToolStripMenuItem1.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F11))); + this.alwaysOnTopToolStripMenuItem1.Size = new System.Drawing.Size(204, 22); + this.alwaysOnTopToolStripMenuItem1.Text = "Always On &Top"; + this.alwaysOnTopToolStripMenuItem1.Click += new System.EventHandler(this.viewAlwaysOnTopMenuItem_Click); + // + // toolStripDropDownButton4 + // + this.toolStripDropDownButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.toolStripDropDownButton4.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.optionsToolMenuItem}); - this.toolStripDropDownButton4.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripDropDownButton4.Name = "toolStripDropDownButton4"; - this.toolStripDropDownButton4.ShowDropDownArrow = false; - this.toolStripDropDownButton4.Size = new System.Drawing.Size(39, 22); - this.toolStripDropDownButton4.Text = "&Tools"; - // - // updateIconsToolMenuItem - // - this.updateIconsToolMenuItem.Name = "updateIconsToolMenuItem"; - this.updateIconsToolMenuItem.Size = new System.Drawing.Size(180, 22); - this.updateIconsToolMenuItem.Text = "&Update Icons"; - this.updateIconsToolMenuItem.Click += new System.EventHandler(this.toolStripMenuItem1_Click); - // - // toolStripSeparator14 - // - this.toolStripSeparator14.Name = "toolStripSeparator14"; - this.toolStripSeparator14.Size = new System.Drawing.Size(177, 6); - // - // optionsToolMenuItem - // - this.optionsToolMenuItem.Enabled = false; - this.optionsToolMenuItem.Image = global::bzit.bomg.Properties.Resources.cog; - this.optionsToolMenuItem.Name = "optionsToolMenuItem"; - this.optionsToolMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F12; - this.optionsToolMenuItem.Size = new System.Drawing.Size(180, 22); - this.optionsToolMenuItem.Text = "&Options"; - this.optionsToolMenuItem.Click += new System.EventHandler(this.optionsToolStripMenuItem1_Click); - // - // toolStripDropDownButton5 - // - this.toolStripDropDownButton5.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripDropDownButton5.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripDropDownButton4.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripDropDownButton4.Name = "toolStripDropDownButton4"; + this.toolStripDropDownButton4.ShowDropDownArrow = false; + this.toolStripDropDownButton4.Size = new System.Drawing.Size(38, 22); + this.toolStripDropDownButton4.Text = "&Tools"; + // + // optionsToolMenuItem + // + this.optionsToolMenuItem.Name = "optionsToolMenuItem"; + this.optionsToolMenuItem.Size = new System.Drawing.Size(161, 22); + this.optionsToolMenuItem.Text = "&Update Favicons"; + this.optionsToolMenuItem.Click += new System.EventHandler(this.toolsOptionsMenuItem_Click); + // + // toolStripDropDownButton5 + // + this.toolStripDropDownButton5.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.toolStripDropDownButton5.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.viewHelpHelpMenuItem, this.toolStripSeparator12, this.aboutHelpMenuItem}); - this.toolStripDropDownButton5.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripDropDownButton5.Name = "toolStripDropDownButton5"; - this.toolStripDropDownButton5.ShowDropDownArrow = false; - this.toolStripDropDownButton5.Size = new System.Drawing.Size(36, 22); - this.toolStripDropDownButton5.Text = "&Help"; - // - // viewHelpHelpMenuItem - // - this.viewHelpHelpMenuItem.Image = global::bzit.bomg.Properties.Resources.help; - this.viewHelpHelpMenuItem.Name = "viewHelpHelpMenuItem"; - this.viewHelpHelpMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F1; - this.viewHelpHelpMenuItem.Size = new System.Drawing.Size(146, 22); - this.viewHelpHelpMenuItem.Text = "View &Help"; - this.viewHelpHelpMenuItem.Click += new System.EventHandler(this.documentationToolStripMenuItem_Click); - // - // toolStripSeparator12 - // - this.toolStripSeparator12.Name = "toolStripSeparator12"; - this.toolStripSeparator12.Size = new System.Drawing.Size(143, 6); - // - // aboutHelpMenuItem - // - this.aboutHelpMenuItem.Image = global::bzit.bomg.Properties.Resources.comment; - this.aboutHelpMenuItem.Name = "aboutHelpMenuItem"; - this.aboutHelpMenuItem.Size = new System.Drawing.Size(146, 22); - this.aboutHelpMenuItem.Text = "&About"; - this.aboutHelpMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem1_Click); - // - // toolStripDropDownButton7 - // - this.toolStripDropDownButton7.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripDropDownButton7.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.alwaysOnTopToolStripMenuItem}); - this.toolStripDropDownButton7.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripDropDownButton7.Name = "toolStripDropDownButton7"; - this.toolStripDropDownButton7.ShowDropDownArrow = false; - this.toolStripDropDownButton7.Size = new System.Drawing.Size(16, 22); - this.toolStripDropDownButton7.Text = "&?"; - this.toolStripDropDownButton7.Visible = false; - // - // alwaysOnTopToolStripMenuItem - // - this.alwaysOnTopToolStripMenuItem.Name = "alwaysOnTopToolStripMenuItem"; - this.alwaysOnTopToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F11))); - this.alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(205, 22); - this.alwaysOnTopToolStripMenuItem.Text = "Always On Top"; - this.alwaysOnTopToolStripMenuItem.Click += new System.EventHandler(this.alwaysOnTopToolStripMenuItem_Click); - // - // openFileDialog - // - this.openFileDialog.DefaultExt = "ryz"; - this.openFileDialog.Filter = "Bookmarks files|*.ryz"; - this.openFileDialog.Title = "Open bookmarks file"; - // - // treeMenuFolder - // - this.treeMenuFolder.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripDropDownButton5.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripDropDownButton5.Name = "toolStripDropDownButton5"; + this.toolStripDropDownButton5.ShowDropDownArrow = false; + this.toolStripDropDownButton5.Size = new System.Drawing.Size(36, 22); + this.toolStripDropDownButton5.Text = "&Help"; + // + // viewHelpHelpMenuItem + // + this.viewHelpHelpMenuItem.Image = global::bzit.bomg.Properties.Resources.help_circle; + this.viewHelpHelpMenuItem.Name = "viewHelpHelpMenuItem"; + this.viewHelpHelpMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F1; + this.viewHelpHelpMenuItem.Size = new System.Drawing.Size(146, 22); + this.viewHelpHelpMenuItem.Text = "View &Help"; + this.viewHelpHelpMenuItem.Click += new System.EventHandler(this.helpViewHelpMenuItem_Click); + // + // toolStripSeparator12 + // + this.toolStripSeparator12.Name = "toolStripSeparator12"; + this.toolStripSeparator12.Size = new System.Drawing.Size(143, 6); + // + // aboutHelpMenuItem + // + this.aboutHelpMenuItem.Name = "aboutHelpMenuItem"; + this.aboutHelpMenuItem.Size = new System.Drawing.Size(146, 22); + this.aboutHelpMenuItem.Text = "&About"; + this.aboutHelpMenuItem.Click += new System.EventHandler(this.helpAboutMenuItem_Click); + // + // openFileDialog + // + this.openFileDialog.DefaultExt = "jsnx"; + this.openFileDialog.Filter = "Bookmarks files (*.jsnx)|*.jsnx|Bookmarks files (*.ryz)|*.ryz"; + this.openFileDialog.Title = "Open bookmarks file"; + // + // folderTreeNodeMenu + // + this.folderTreeNodeMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripMenuItem15, this.toolStripMenuItem16, this.toolStripSeparator5, @@ -479,236 +427,245 @@ namespace bzit.bomg this.toolStripSeparator11, this.toolStripMenuItem12, this.toolStripMenuItem13}); - this.treeMenuFolder.Name = "listViewMenu"; - this.treeMenuFolder.Size = new System.Drawing.Size(139, 198); - // - // toolStripMenuItem15 - // - this.toolStripMenuItem15.Name = "toolStripMenuItem15"; - this.toolStripMenuItem15.Size = new System.Drawing.Size(138, 22); - this.toolStripMenuItem15.Text = "Add &Page"; - this.toolStripMenuItem15.Click += new System.EventHandler(this.toolStripMenuItem15_Click); - // - // toolStripMenuItem16 - // - this.toolStripMenuItem16.Name = "toolStripMenuItem16"; - this.toolStripMenuItem16.Size = new System.Drawing.Size(138, 22); - this.toolStripMenuItem16.Text = "Add &Folder"; - this.toolStripMenuItem16.Click += new System.EventHandler(this.toolStripMenuItem16_Click); - // - // toolStripSeparator5 - // - this.toolStripSeparator5.Name = "toolStripSeparator5"; - this.toolStripSeparator5.Size = new System.Drawing.Size(135, 6); - // - // toolStripMenuItem14 - // - this.toolStripMenuItem14.Name = "toolStripMenuItem14"; - this.toolStripMenuItem14.Size = new System.Drawing.Size(138, 22); - this.toolStripMenuItem14.Text = "&Open All"; - this.toolStripMenuItem14.Click += new System.EventHandler(this.toolStripMenuItem14_Click); - // - // toolStripMenuItem9 - // - this.toolStripMenuItem9.Name = "toolStripMenuItem9"; - this.toolStripMenuItem9.Size = new System.Drawing.Size(138, 22); - this.toolStripMenuItem9.Text = "Edi&t"; - this.toolStripMenuItem9.Click += new System.EventHandler(this.toolStripMenuItem9_Click); - // - // toolStripMenuItem11 - // - this.toolStripMenuItem11.Name = "toolStripMenuItem11"; - this.toolStripMenuItem11.Size = new System.Drawing.Size(138, 22); - this.toolStripMenuItem11.Text = "D&elete"; - this.toolStripMenuItem11.Click += new System.EventHandler(this.toolStripMenuItem6_Click); - // - // toolStripSeparator7 - // - this.toolStripSeparator7.Name = "toolStripSeparator7"; - this.toolStripSeparator7.Size = new System.Drawing.Size(135, 6); - // - // sortToolStripMenuItem - // - this.sortToolStripMenuItem.Name = "sortToolStripMenuItem"; - this.sortToolStripMenuItem.Size = new System.Drawing.Size(138, 22); - this.sortToolStripMenuItem.Text = "&Sort"; - this.sortToolStripMenuItem.Click += new System.EventHandler(this.sortToolStripMenuItem_Click); - // - // toolStripSeparator11 - // - this.toolStripSeparator11.Name = "toolStripSeparator11"; - this.toolStripSeparator11.Size = new System.Drawing.Size(135, 6); - // - // toolStripMenuItem12 - // - this.toolStripMenuItem12.Name = "toolStripMenuItem12"; - this.toolStripMenuItem12.Size = new System.Drawing.Size(138, 22); - this.toolStripMenuItem12.Text = "Move &Up"; - this.toolStripMenuItem12.Click += new System.EventHandler(this.toolStripMenuItem12_Click); - // - // toolStripMenuItem13 - // - this.toolStripMenuItem13.Name = "toolStripMenuItem13"; - this.toolStripMenuItem13.Size = new System.Drawing.Size(138, 22); - this.toolStripMenuItem13.Text = "Move &Down"; - this.toolStripMenuItem13.Click += new System.EventHandler(this.toolStripMenuItem13_Click); - // - // saveFileDialog - // - this.saveFileDialog.DefaultExt = "ryz"; - this.saveFileDialog.Filter = "Bookmarks file|*.ryz|Bookmarks file (password protected)|*.ryz"; - this.saveFileDialog.Title = "Save bookmarks file"; - // - // toolStrip2 - // - this.toolStrip2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.toolStrip2.CanOverflow = false; - this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.folderTreeNodeMenu.Name = "listViewMenu"; + this.folderTreeNodeMenu.Size = new System.Drawing.Size(139, 198); + // + // toolStripMenuItem15 + // + this.toolStripMenuItem15.Image = global::bzit.bomg.Properties.Resources.file_plus; + this.toolStripMenuItem15.Name = "toolStripMenuItem15"; + this.toolStripMenuItem15.Size = new System.Drawing.Size(138, 22); + this.toolStripMenuItem15.Text = "Add &Page"; + this.toolStripMenuItem15.Click += new System.EventHandler(this.addPageContextMenu2_Click); + // + // toolStripMenuItem16 + // + this.toolStripMenuItem16.Image = global::bzit.bomg.Properties.Resources.folder_plus; + this.toolStripMenuItem16.Name = "toolStripMenuItem16"; + this.toolStripMenuItem16.Size = new System.Drawing.Size(138, 22); + this.toolStripMenuItem16.Text = "Add &Folder"; + this.toolStripMenuItem16.Click += new System.EventHandler(this.addFolderContextMenu2_Click); + // + // toolStripSeparator5 + // + this.toolStripSeparator5.Name = "toolStripSeparator5"; + this.toolStripSeparator5.Size = new System.Drawing.Size(135, 6); + // + // toolStripMenuItem14 + // + this.toolStripMenuItem14.Image = global::bzit.bomg.Properties.Resources.bookmark; + this.toolStripMenuItem14.Name = "toolStripMenuItem14"; + this.toolStripMenuItem14.Size = new System.Drawing.Size(138, 22); + this.toolStripMenuItem14.Text = "&Open All"; + this.toolStripMenuItem14.Click += new System.EventHandler(this.openAllContextMenu_Click); + // + // toolStripMenuItem9 + // + this.toolStripMenuItem9.Name = "toolStripMenuItem9"; + this.toolStripMenuItem9.Size = new System.Drawing.Size(138, 22); + this.toolStripMenuItem9.Text = "Edi&t"; + this.toolStripMenuItem9.Click += new System.EventHandler(this.editContextMenu2_Click); + // + // toolStripMenuItem11 + // + this.toolStripMenuItem11.Image = global::bzit.bomg.Properties.Resources.trash_2; + this.toolStripMenuItem11.Name = "toolStripMenuItem11"; + this.toolStripMenuItem11.Size = new System.Drawing.Size(138, 22); + this.toolStripMenuItem11.Text = "D&elete"; + this.toolStripMenuItem11.Click += new System.EventHandler(this.deleteContextMenu_Click); + // + // toolStripSeparator7 + // + this.toolStripSeparator7.Name = "toolStripSeparator7"; + this.toolStripSeparator7.Size = new System.Drawing.Size(135, 6); + // + // sortToolStripMenuItem + // + this.sortToolStripMenuItem.Name = "sortToolStripMenuItem"; + this.sortToolStripMenuItem.Size = new System.Drawing.Size(138, 22); + this.sortToolStripMenuItem.Text = "&Sort"; + this.sortToolStripMenuItem.Click += new System.EventHandler(this.sortContextMenu2_Click); + // + // toolStripSeparator11 + // + this.toolStripSeparator11.Name = "toolStripSeparator11"; + this.toolStripSeparator11.Size = new System.Drawing.Size(135, 6); + // + // toolStripMenuItem12 + // + this.toolStripMenuItem12.Image = global::bzit.bomg.Properties.Resources.arrow_up_circle; + this.toolStripMenuItem12.Name = "toolStripMenuItem12"; + this.toolStripMenuItem12.Size = new System.Drawing.Size(138, 22); + this.toolStripMenuItem12.Text = "Move &Up"; + this.toolStripMenuItem12.Click += new System.EventHandler(this.moveUpContextMenu_Click); + // + // toolStripMenuItem13 + // + this.toolStripMenuItem13.Image = global::bzit.bomg.Properties.Resources.arrow_down_circle; + this.toolStripMenuItem13.Name = "toolStripMenuItem13"; + this.toolStripMenuItem13.Size = new System.Drawing.Size(138, 22); + this.toolStripMenuItem13.Text = "Move &Down"; + this.toolStripMenuItem13.Click += new System.EventHandler(this.moveDownContextMenu_Click); + // + // saveFileDialog + // + this.saveFileDialog.DefaultExt = "jsnx"; + this.saveFileDialog.Filter = "Bookmarks files (*.jsnx)|*.jsnx|Protected bookmarks files (*.jsnx)|*.jsnx"; + this.saveFileDialog.Title = "Save bookmarks file"; + // + // toolStrip2 + // + this.toolStrip2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.toolStrip2.CanOverflow = false; + this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.newMenuBarItem, this.openMenuBarItem, this.saveMenuBarItem, this.toolStripSeparator9}); - this.toolStrip2.Location = new System.Drawing.Point(0, 25); - this.toolStrip2.Name = "toolStrip2"; - this.toolStrip2.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; - this.toolStrip2.Size = new System.Drawing.Size(304, 25); - this.toolStrip2.TabIndex = 26; - this.toolStrip2.Text = "toolStrip2"; - // - // newMenuBarItem - // - this.newMenuBarItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.newMenuBarItem.Image = ((System.Drawing.Image)(resources.GetObject("newMenuBarItem.Image"))); - this.newMenuBarItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.newMenuBarItem.Name = "newMenuBarItem"; - this.newMenuBarItem.Size = new System.Drawing.Size(23, 22); - this.newMenuBarItem.Text = "toolStripButton1"; - this.newMenuBarItem.ToolTipText = "New"; - this.newMenuBarItem.Click += new System.EventHandler(this.newSessionToolStripMenuItem_Click); - // - // openMenuBarItem - // - this.openMenuBarItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.openMenuBarItem.Image = global::bzit.bomg.Properties.Resources.folder_page; - this.openMenuBarItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.openMenuBarItem.Name = "openMenuBarItem"; - this.openMenuBarItem.Size = new System.Drawing.Size(23, 22); - this.openMenuBarItem.Text = "toolStripButton2"; - this.openMenuBarItem.ToolTipText = "Open"; - this.openMenuBarItem.Click += new System.EventHandler(this.toolStripMenuItem2_Click); - // - // saveMenuBarItem - // - this.saveMenuBarItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.saveMenuBarItem.Image = global::bzit.bomg.Properties.Resources.disk; - this.saveMenuBarItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.saveMenuBarItem.Name = "saveMenuBarItem"; - this.saveMenuBarItem.Size = new System.Drawing.Size(23, 22); - this.saveMenuBarItem.Text = "toolStripButton3"; - this.saveMenuBarItem.ToolTipText = "Save"; - this.saveMenuBarItem.Click += new System.EventHandler(this.importSnapshotToolStripMenuItem_Click); - // - // toolStripSeparator9 - // - this.toolStripSeparator9.Name = "toolStripSeparator9"; - this.toolStripSeparator9.Size = new System.Drawing.Size(6, 25); - // - // treeMenuRoot - // - this.treeMenuRoot.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStrip2.Location = new System.Drawing.Point(0, 25); + this.toolStrip2.Name = "toolStrip2"; + this.toolStrip2.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; + this.toolStrip2.Size = new System.Drawing.Size(304, 25); + this.toolStrip2.TabIndex = 26; + this.toolStrip2.Text = "toolStrip2"; + // + // newMenuBarItem + // + this.newMenuBarItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.newMenuBarItem.Image = global::bzit.bomg.Properties.Resources.file; + this.newMenuBarItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.newMenuBarItem.Name = "newMenuBarItem"; + this.newMenuBarItem.Size = new System.Drawing.Size(23, 22); + this.newMenuBarItem.Text = "toolStripButton1"; + this.newMenuBarItem.ToolTipText = "New"; + this.newMenuBarItem.Click += new System.EventHandler(this.fileNewMenuItem_Click); + // + // openMenuBarItem + // + this.openMenuBarItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.openMenuBarItem.Image = global::bzit.bomg.Properties.Resources.folder1; + this.openMenuBarItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.openMenuBarItem.Name = "openMenuBarItem"; + this.openMenuBarItem.Size = new System.Drawing.Size(23, 22); + this.openMenuBarItem.Text = "toolStripButton2"; + this.openMenuBarItem.ToolTipText = "Open"; + this.openMenuBarItem.Click += new System.EventHandler(this.fileOpenMenuItem_Click); + // + // saveMenuBarItem + // + this.saveMenuBarItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.saveMenuBarItem.Image = global::bzit.bomg.Properties.Resources.save; + this.saveMenuBarItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.saveMenuBarItem.Name = "saveMenuBarItem"; + this.saveMenuBarItem.Size = new System.Drawing.Size(23, 22); + this.saveMenuBarItem.Text = "toolStripButton3"; + this.saveMenuBarItem.ToolTipText = "Save"; + this.saveMenuBarItem.Click += new System.EventHandler(this.fileSaveMenuItem_Click); + // + // toolStripSeparator9 + // + this.toolStripSeparator9.Name = "toolStripSeparator9"; + this.toolStripSeparator9.Size = new System.Drawing.Size(6, 25); + // + // rootTreeNodeMenu + // + this.rootTreeNodeMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripMenuItem17, this.toolStripMenuItem18, this.toolStripSeparator10, this.toolStripMenuItem20, this.toolStripSeparator13, this.toolStripMenuItem22}); - this.treeMenuRoot.Name = "listViewMenu"; - this.treeMenuRoot.Size = new System.Drawing.Size(133, 104); - // - // toolStripMenuItem17 - // - this.toolStripMenuItem17.Name = "toolStripMenuItem17"; - this.toolStripMenuItem17.Size = new System.Drawing.Size(132, 22); - this.toolStripMenuItem17.Text = "Add &Page"; - this.toolStripMenuItem17.Click += new System.EventHandler(this.toolStripMenuItem15_Click); - // - // toolStripMenuItem18 - // - this.toolStripMenuItem18.Name = "toolStripMenuItem18"; - this.toolStripMenuItem18.Size = new System.Drawing.Size(132, 22); - this.toolStripMenuItem18.Text = "Add &Folder"; - this.toolStripMenuItem18.Click += new System.EventHandler(this.toolStripMenuItem16_Click); - // - // toolStripSeparator10 - // - this.toolStripSeparator10.Name = "toolStripSeparator10"; - this.toolStripSeparator10.Size = new System.Drawing.Size(129, 6); - // - // toolStripMenuItem20 - // - this.toolStripMenuItem20.Name = "toolStripMenuItem20"; - this.toolStripMenuItem20.Size = new System.Drawing.Size(132, 22); - this.toolStripMenuItem20.Text = "Edi&t"; - this.toolStripMenuItem20.Click += new System.EventHandler(this.toolStripMenuItem9_Click); - // - // toolStripSeparator13 - // - this.toolStripSeparator13.Name = "toolStripSeparator13"; - this.toolStripSeparator13.Size = new System.Drawing.Size(129, 6); - // - // toolStripMenuItem22 - // - this.toolStripMenuItem22.Name = "toolStripMenuItem22"; - this.toolStripMenuItem22.Size = new System.Drawing.Size(132, 22); - this.toolStripMenuItem22.Text = "&Sort"; - this.toolStripMenuItem22.Click += new System.EventHandler(this.sortToolStripMenuItem_Click); - // - // treeView1 - // - this.treeView1.AllowDrop = true; - this.treeView1.BackColor = System.Drawing.Color.White; - this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill; - this.treeView1.HasChanged = false; - this.treeView1.HideSelection = false; - this.treeView1.HotTracking = true; - this.treeView1.ImageIndex = 0; - this.treeView1.LabelEdit = true; - this.treeView1.Location = new System.Drawing.Point(0, 50); - this.treeView1.Name = "treeView1"; - this.treeView1.SelectedImageIndex = 0; - this.treeView1.ShowNodeToolTips = true; - this.treeView1.Size = new System.Drawing.Size(304, 584); - this.treeView1.TabIndex = 24; - this.treeView1.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseClick); - this.treeView1.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView2_NodeMouseDoubleClick); - this.treeView1.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.treeView1_PreviewKeyDown); - // - // MainForm - // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; - this.BackColor = System.Drawing.SystemColors.Control; - this.ClientSize = new System.Drawing.Size(304, 654); - this.Controls.Add(this.treeView1); - this.Controls.Add(this.toolStrip2); - this.Controls.Add(this.statusBar1); - this.Controls.Add(this.toolStrip1); - this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MinimumSize = new System.Drawing.Size(320, 600); - this.Name = "MainForm"; - this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; - this.Text = "Bookmark Manager"; - this.treeMenuItem.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).EndInit(); - this.toolStrip1.ResumeLayout(false); - this.toolStrip1.PerformLayout(); - this.treeMenuFolder.ResumeLayout(false); - this.toolStrip2.ResumeLayout(false); - this.toolStrip2.PerformLayout(); - this.treeMenuRoot.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); + this.rootTreeNodeMenu.Name = "listViewMenu"; + this.rootTreeNodeMenu.Size = new System.Drawing.Size(133, 104); + // + // toolStripMenuItem17 + // + this.toolStripMenuItem17.Image = global::bzit.bomg.Properties.Resources.file_plus; + this.toolStripMenuItem17.Name = "toolStripMenuItem17"; + this.toolStripMenuItem17.Size = new System.Drawing.Size(132, 22); + this.toolStripMenuItem17.Text = "Add &Page"; + this.toolStripMenuItem17.Click += new System.EventHandler(this.addPageContextMenu_Click); + // + // toolStripMenuItem18 + // + this.toolStripMenuItem18.Image = global::bzit.bomg.Properties.Resources.folder_plus; + this.toolStripMenuItem18.Name = "toolStripMenuItem18"; + this.toolStripMenuItem18.Size = new System.Drawing.Size(132, 22); + this.toolStripMenuItem18.Text = "Add &Folder"; + this.toolStripMenuItem18.Click += new System.EventHandler(this.addFolderContextMenu_Click); + // + // toolStripSeparator10 + // + this.toolStripSeparator10.Name = "toolStripSeparator10"; + this.toolStripSeparator10.Size = new System.Drawing.Size(129, 6); + // + // toolStripMenuItem20 + // + this.toolStripMenuItem20.Name = "toolStripMenuItem20"; + this.toolStripMenuItem20.Size = new System.Drawing.Size(132, 22); + this.toolStripMenuItem20.Text = "Edi&t"; + this.toolStripMenuItem20.Click += new System.EventHandler(this.editContextMenu_Click); + // + // toolStripSeparator13 + // + this.toolStripSeparator13.Name = "toolStripSeparator13"; + this.toolStripSeparator13.Size = new System.Drawing.Size(129, 6); + // + // toolStripMenuItem22 + // + this.toolStripMenuItem22.Name = "toolStripMenuItem22"; + this.toolStripMenuItem22.Size = new System.Drawing.Size(132, 22); + this.toolStripMenuItem22.Text = "&Sort"; + this.toolStripMenuItem22.Click += new System.EventHandler(this.sortContextMenu_Click); + // + // treeView1 + // + this.treeView1.AllowDrop = true; + this.treeView1.BackColor = System.Drawing.Color.White; + this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.treeView1.HideSelection = false; + this.treeView1.HotTracking = true; + this.treeView1.ImageIndex = 0; + this.treeView1.LabelEdit = true; + this.treeView1.Location = new System.Drawing.Point(0, 50); + this.treeView1.Name = "treeView1"; + this.treeView1.PathSeparator = "\n"; + this.treeView1.SelectedImageIndex = 0; + this.treeView1.ShowNodeToolTips = true; + this.treeView1.Size = new System.Drawing.Size(304, 584); + this.treeView1.TabIndex = 24; + this.treeView1.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseClick); + this.treeView1.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseDoubleClick); + this.treeView1.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.treeView1_PreviewKeyDown); + // + // MainForm + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.BackColor = System.Drawing.SystemColors.Control; + this.ClientSize = new System.Drawing.Size(304, 654); + this.Controls.Add(this.treeView1); + this.Controls.Add(this.toolStrip2); + this.Controls.Add(this.statusBar1); + this.Controls.Add(this.toolStrip1); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimumSize = new System.Drawing.Size(320, 600); + this.Name = "MainForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; + this.Text = "Bookmark Manager"; + this.pageTreeNodeMenu.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).EndInit(); + this.toolStrip1.ResumeLayout(false); + this.toolStrip1.PerformLayout(); + this.folderTreeNodeMenu.ResumeLayout(false); + this.toolStrip2.ResumeLayout(false); + this.toolStrip2.PerformLayout(); + this.rootTreeNodeMenu.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -717,10 +674,10 @@ namespace bzit.bomg private System.Windows.Forms.StatusBar statusBar1; private System.Windows.Forms.StatusBarPanel statusBarPanel1; private System.Windows.Forms.StatusBarPanel statusBarPanel2; - private System.Windows.Forms.ContextMenuStrip treeMenuItem; + private System.Windows.Forms.ContextMenuStrip pageTreeNodeMenu; private System.Windows.Forms.ToolStripMenuItem listViewMenuItem1; private System.Windows.Forms.ToolStripMenuItem moveFileToToolStripMenuItem; - private System.Windows.Forms.ToolTip oToolTip1; + private System.Windows.Forms.ToolTip toolTip1; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem8; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem6; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; @@ -731,7 +688,6 @@ namespace bzit.bomg private System.Windows.Forms.ToolStripMenuItem newFileMenuItem; private System.Windows.Forms.ToolStripMenuItem saveFileMenuItem; private System.Windows.Forms.ToolStripMenuItem saveAsFileMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator6; private System.Windows.Forms.ToolStripMenuItem exitFileMenuItem; private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton3; private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton4; @@ -740,17 +696,13 @@ namespace bzit.bomg private System.Windows.Forms.ToolStripMenuItem viewHelpHelpMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator12; private System.Windows.Forms.ToolStripMenuItem aboutHelpMenuItem; - private System.Windows.Forms.ImageList imageList1; - private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton7; - private System.Windows.Forms.ToolStripMenuItem alwaysOnTopToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem openFileMenuItem; private System.Windows.Forms.ToolStripMenuItem closeFileMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - public BookmarkTreeView treeView1; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem4; private System.Windows.Forms.OpenFileDialog openFileDialog; - private System.Windows.Forms.ContextMenuStrip treeMenuFolder; + private System.Windows.Forms.ContextMenuStrip folderTreeNodeMenu; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem9; private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem11; @@ -758,7 +710,6 @@ namespace bzit.bomg private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem12; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem13; private System.Windows.Forms.ToolStripSeparator toolStripSeparator8; - private System.Windows.Forms.ToolStripMenuItem exportFileMenuItem; private System.Windows.Forms.SaveFileDialog saveFileDialog; private System.Windows.Forms.ToolStrip toolStrip2; private System.Windows.Forms.ToolStripButton newMenuBarItem; @@ -770,7 +721,7 @@ namespace bzit.bomg private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem15; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem16; private System.Windows.Forms.ToolStripSeparator toolStripSeparator11; - private System.Windows.Forms.ContextMenuStrip treeMenuRoot; + private System.Windows.Forms.ContextMenuStrip rootTreeNodeMenu; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem17; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem18; private System.Windows.Forms.ToolStripSeparator toolStripSeparator10; @@ -780,8 +731,9 @@ namespace bzit.bomg private System.Windows.Forms.ToolStripMenuItem expandAllViewMenuItem; private System.Windows.Forms.ToolStripMenuItem collapseAllViewMenuItem; private System.Windows.Forms.ToolStripMenuItem findEditMenuItem; - private System.Windows.Forms.ToolStripMenuItem updateIconsToolMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator14; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem alwaysOnTopToolStripMenuItem1; + private BookmarkTreeView treeView1; } } diff --git a/MainForm.cs b/MainForm.cs index d650079..d768e26 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -1,7 +1,17 @@ +using bzit.bomg.Models; +using ICSharpCode.SharpZipLib.Zip; +using Newtonsoft.Json; using System; +using System.Collections.Generic; using System.ComponentModel; using System.IO; +using System.Text; using System.Windows.Forms; +using System.Xml; +using static RyzStudio.Windows.Forms.BookmarkTreeView; +using Resources = bzit.bomg.Properties.Resources; +using TextBoxForm = RyzStudio.Windows.ThemedForms.TextBoxForm; +using ThreadControl = RyzStudio.Windows.Forms.ThreadControl; namespace bzit.bomg { @@ -14,391 +24,571 @@ namespace bzit.bomg New } + public enum LoadFileType + { + None = 0, + Jsnx, + Ryz + } + + //protected BackgroundWorker loadFileThread = null; + protected bool isBusy = false; + protected LoadFileType loadFileType = LoadFileType.None; + protected AppMode appMode = AppMode.Clear; - protected SessionFileFormat sessionFileFormat = null; protected string sessionFilename = null; + protected string sessionPassword = null; + protected bool usePassword = false; public MainForm() { InitializeComponent(); + + //if (loadFileThread == null) + //{ + // loadFileThread = new BackgroundWorker(); + // loadFileThread.WorkerReportsProgress = loadFileThread.WorkerSupportsCancellation = true; + //} + + //loadFileThread.DoWork += loadFileThread_DoWork; + //loadFileThread.RunWorkerCompleted += loadFileThread_RunWorkerCompleted; + + treeView1.OnNodeChanged += treeView1_OnNodeChanged; } protected override void OnLoad(EventArgs e) { base.OnLoad(e); - this.IconDatabase = new IconDatabase(); + bool rv = false; + string iconDBFilename = Path.ChangeExtension(Application.ExecutablePath, ".db"); - // toolbar - viewHelpHelpMenuItem.Enabled = File.Exists(Path.ChangeExtension(Application.ExecutablePath, ".chm")); + string errorMessage; + rv = treeView1.InitialiseIconDatabase(out errorMessage, iconDBFilename); + if (!rv) + { + MessageBox.Show("Can not find icon database. [" + errorMessage + "]"); + this.Close(); + } - string iconDBPath = Path.ChangeExtension(Application.ExecutablePath, ".db"); - - bool rs = this.IconDatabase.Create(Path.ChangeExtension(Application.ExecutablePath, "db"), false, null, true); - if (!rs) - { - MessageBox.Show("Can not find icon database. [" + this.IconDatabase.LastError + "]"); - this.Close(); - } - - //bool rv = false; - // if (File.Exists(iconDBPath)) - // { - // rv = this.IconDatabase.LoadFile(iconDBPath); - // if (!rv) - // { - // rv = this.IconDatabase.CreateSpecial(iconDBPath, true); - // if (!rv) - // { - // MessageBox.Show("Can not find icon database. [" + this.IconDatabase.LastError + "]"); - // this.Close(); - // } - // } - // } - // else - // { - // rv = this.IconDatabase.CreateSpecial(iconDBPath, true); - // if (!rv) - // { - // MessageBox.Show("Can not find icon database. [" + this.IconDatabase.LastError + "]"); - // this.Close(); - // } - // } - - treeView1.IconDatabase = this.IconDatabase; - sessionFileFormat = new SessionFileFormat(this); this.ApplicationMode = AppMode.Clear; - - treeView1.OnNodeCountUpdate = delegate (ulong v) { - statusBarPanel2.Text = v.ToString(); - }; - treeView1.OnChanged = delegate (object sender, EventArgs ev) { - if (this.ApplicationMode == AppMode.New) - { - saveMenuBarItem.Enabled = saveFileMenuItem.Enabled = false; - } - else - { - saveMenuBarItem.Enabled = saveFileMenuItem.Enabled = treeView1.HasChanged; - } - - }; + this.ClearSession(); } protected override void OnShown(EventArgs e) { base.OnShown(e); - + this.Height = Screen.PrimaryScreen.WorkingArea.Height; this.Location = Screen.PrimaryScreen.WorkingArea.Location; // command line - string[] szr = Environment.GetCommandLineArgs(); - int i = 0; - while (true) + string[] args = Environment.GetCommandLineArgs(); + + if (args.Length > 1) { - if (i > (szr.Length - 1)) + int i = 1; + while (true) { - break; - } - - switch (szr[i].Trim().ToLower()) - { - case "-o": - case "-open": - if ((i + 1) > (szr.Length - 1)) - { - break; - } - - sessionFilename = szr[(i + 1)]; - - if (string.IsNullOrEmpty(sessionFilename)) - { - sessionFilename = null; - break; - } - - if (!File.Exists(sessionFilename)) - { - sessionFilename = null; - break; - } - - OpenBookmarkFile(sessionFilename); - - i++; + if (i > (args.Length - 1)) + { break; - } + } - i++; + 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; + + LoadBookmarksForm loadFileForm = new LoadBookmarksForm(this, openFilename); + loadFileForm.ShowDialog(); + + i++; + break; + } + + i++; + } } } protected override void OnFormClosing(FormClosingEventArgs e) { - this.IconDatabase?.Close(); + if (this.IsBusy) + { + e.Cancel = true; + return; + } if (this.ApplicationMode == AppMode.Clear) { - Application.Exit(); - return; + // do later } - - if (!treeView1.HasChanged) + else { - this.ApplicationMode = AppMode.Clear; - Application.Exit(); - return; - } - - if (this.ApplicationMode == AppMode.Open) - { - if (string.IsNullOrEmpty(sessionFilename)) + if (treeView1.HasChanged) { - this.ApplicationMode = AppMode.Clear; - Application.Exit(); - return; - } - - if (MessageBox.Show("Save changes to open bookmarks.", "Save?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) - { - this.ApplicationMode = AppMode.Clear; - Application.Exit(); - return; - } - - while (true) - { - bool rv = sessionFileFormat.saveToRyz(sessionFilename); - if (!rv) + if (this.ApplicationMode == AppMode.New) { - switch (MessageBox.Show("There was a problem saving bookmarks. Retry?", "Retry?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question)) + DialogResult response = MessageBox.Show("Save bookmarks", "Save?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if (response == DialogResult.Yes) { - case DialogResult.Yes: - break; - case DialogResult.No: - this.ApplicationMode = AppMode.Clear; - Application.Exit(); - break; - case DialogResult.Cancel: + bool hasSaved = saveAsBookmarkFile(); + if (!hasSaved) + { e.Cancel = true; - break; - default: break; + return; + } + } + else if (response == DialogResult.No) + { + // do later + } + else if (response == DialogResult.Cancel) + { + e.Cancel = true; + return; } } - else + else if (this.ApplicationMode == AppMode.Open) { - this.ApplicationMode = AppMode.Clear; - Application.Exit(); - break; - } - } - } - else if (this.ApplicationMode == AppMode.New) - { - if (MessageBox.Show("Save changes to open bookmarks.", "Save?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - bool rt = SaveBookmarkFile(); - if (rt) - { - this.ApplicationMode = AppMode.Clear; - Application.Exit(); - return; + DialogResult response = MessageBox.Show("Save changes to open bookmarks", "Save?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if (response == DialogResult.Yes) + { + if (usePassword) + { + if (string.IsNullOrWhiteSpace(sessionPassword)) + { + TextBoxForm passwordForm = new TextBoxForm("Password", "Password", true); + sessionPassword = passwordForm.ShowDialog(); + } + } + + saveBookmarkFile_ForJSNX(sessionFilename, sessionPassword ?? string.Empty); + } + else if (response == DialogResult.No) + { + // do later + } + else if (response == DialogResult.Cancel) + { + e.Cancel = true; + return; + } } } else { - this.ApplicationMode = AppMode.Clear; - Application.Exit(); - return; + // do later } } + + treeView1.CloseIconDatabase(); + + treeView1.Clear(); + + this.ApplicationMode = AppMode.Clear; + this.ClearSession(); + + Application.Exit(); + } + + public bool AllowSave + { + get => (saveMenuBarItem.Enabled || saveFileMenuItem.Enabled); + set + { + ThreadControl.SetEnable(toolStrip1, saveMenuBarItem, value); + ThreadControl.SetEnable(toolStrip1, saveFileMenuItem, value); + } } - - #region public properties public AppMode ApplicationMode { - get { return appMode; } + get => appMode; set { appMode = value; + switch (value) { case AppMode.Clear: - this.Text = Properties.Resources.app_name; - statusBarPanel2.Text = string.Empty; + ThreadControl.SetText(this, Resources.app_name); - treeView1.Clear(); - - sessionFilename = null; - - closeFileMenuItem.Enabled = false; - saveFileMenuItem.Enabled = saveMenuBarItem.Enabled = false; - saveAsFileMenuItem.Enabled = false; - updateIconsToolMenuItem.Enabled = false; + ThreadControl.SetEnable(toolStrip1, closeFileMenuItem, false); + this.AllowSave = false; + ThreadControl.SetEnable(toolStrip1, saveAsFileMenuItem, false); + ThreadControl.SetEnable(toolStrip1, findEditMenuItem, false); + ThreadControl.SetEnable(toolStrip1, expandAllViewMenuItem, false); + ThreadControl.SetEnable(toolStrip1, collapseAllViewMenuItem, false); + ThreadControl.SetEnable(toolStrip1, optionsToolMenuItem, false); break; case AppMode.Open: - closeFileMenuItem.Enabled = true; - saveFileMenuItem.Enabled = saveMenuBarItem.Enabled = false; - saveAsFileMenuItem.Enabled = true; - updateIconsToolMenuItem.Enabled = true; + ThreadControl.SetEnable(toolStrip1, closeFileMenuItem, true); + this.AllowSave = true; + ThreadControl.SetEnable(toolStrip1, saveAsFileMenuItem, true); + ThreadControl.SetEnable(toolStrip1, findEditMenuItem, true); + ThreadControl.SetEnable(toolStrip1, expandAllViewMenuItem, true); + ThreadControl.SetEnable(toolStrip1, collapseAllViewMenuItem, true); + ThreadControl.SetEnable(toolStrip1, optionsToolMenuItem, true); break; case AppMode.New: - this.Text = Properties.Resources.app_name; - statusBarPanel2.Text = string.Empty; + ThreadControl.SetText(this, Resources.app_name); - sessionFilename = null; - - closeFileMenuItem.Enabled = true; - saveFileMenuItem.Enabled = saveMenuBarItem.Enabled = false; - saveAsFileMenuItem.Enabled = true; - updateIconsToolMenuItem.Enabled = true; + ThreadControl.SetEnable(toolStrip1, closeFileMenuItem, true); + this.AllowSave = true; + ThreadControl.SetEnable(toolStrip1, saveAsFileMenuItem, true); + ThreadControl.SetEnable(toolStrip1, findEditMenuItem, true); + ThreadControl.SetEnable(toolStrip1, expandAllViewMenuItem, true); + ThreadControl.SetEnable(toolStrip1, collapseAllViewMenuItem, true); + ThreadControl.SetEnable(toolStrip1, optionsToolMenuItem, true); break; } } } - [DefaultValue(null)] - public IconDatabase IconDatabase { get; set; } - - #endregion - - #region Toolbar #1 - - /** - * File -> New - */ - private void newSessionToolStripMenuItem_Click(object sender, EventArgs e) + public bool IsBusy { - NewSessionForm oNewSession = new NewSessionForm(this); - oNewSession.ShowDialog(); + get => isBusy; + set + { + treeView1.Enabled = !value; + } } - /* - * File -> Open - */ - private void toolStripMenuItem2_Click(object sender, EventArgs e) + public RyzStudio.Windows.Forms.BookmarkTreeView TreeView { get => treeView1; set => treeView1 = value; } + + #region toolbar + + private void fileNewMenuItem_Click(object sender, EventArgs e) { + if (this.IsBusy) + { + return; + } + + if (this.ApplicationMode == AppMode.Clear) + { + // do later + } + else + { + if (treeView1.HasChanged) + { + if (this.ApplicationMode == AppMode.New) + { + DialogResult response = MessageBox.Show("Save bookmarks", "Save?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if (response == DialogResult.Yes) + { + bool hasSaved = saveAsBookmarkFile(); + if (!hasSaved) + { + return; + } + } + else if (response == DialogResult.No) + { + // do later + } + else if (response == DialogResult.Cancel) + { + return; + } + } + else if (this.ApplicationMode == AppMode.Open) + { + DialogResult response = MessageBox.Show("Save changes to open bookmarks", "Save?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if (response == DialogResult.Yes) + { + if (usePassword) + { + if (string.IsNullOrWhiteSpace(sessionPassword)) + { + TextBoxForm passwordForm = new TextBoxForm("Password", "Password", true); + sessionPassword = passwordForm.ShowDialog(); + } + } + + saveBookmarkFile_ForJSNX(sessionFilename, sessionPassword ?? string.Empty); + } + else if (response == DialogResult.No) + { + // do later + } + else if (response == DialogResult.Cancel) + { + return; + } + } + } + else + { + // do later + } + } + + TextBoxForm newSessionForm = new TextBoxForm("New Session", "Name"); + string rv = newSessionForm.ShowDialog(); + if (string.IsNullOrWhiteSpace(rv)) + { + return; + } + + treeView1.Clear(rv); + + this.ApplicationMode = AppMode.New; + this.ClearSession(); + } + + private void fileOpenMenuItem_Click(object sender, EventArgs e) + { + if (this.IsBusy) + { + return; + } + + if (this.ApplicationMode == AppMode.Clear) + { + // do later + } + else + { + if (treeView1.HasChanged) + { + if (this.ApplicationMode == AppMode.New) + { + DialogResult response = MessageBox.Show("Save bookmarks", "Save?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if (response == DialogResult.Yes) + { + bool hasSaved = saveAsBookmarkFile(); + if (!hasSaved) + { + return; + } + } + else if (response == DialogResult.No) + { + // do later + } + else if (response == DialogResult.Cancel) + { + return; + } + } + else if (this.ApplicationMode == AppMode.Open) + { + DialogResult response = MessageBox.Show("Save changes to open bookmarks", "Save?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if (response == DialogResult.Yes) + { + if (usePassword) + { + if (string.IsNullOrWhiteSpace(sessionPassword)) + { + TextBoxForm passwordForm = new TextBoxForm("Password", "Password", true); + sessionPassword = passwordForm.ShowDialog(); + } + } + + saveBookmarkFile_ForJSNX(sessionFilename, sessionPassword ?? string.Empty); + } + else if (response == DialogResult.No) + { + // do later + } + else if (response == DialogResult.Cancel) + { + return; + } + } + } + else + { + // do later + } + } + if (openFileDialog.ShowDialog() == DialogResult.OK) { - sessionFilename = openFileDialog.FileName; - - OpenBookmarkFile(sessionFilename); + LoadBookmarksForm loadFileForm = new LoadBookmarksForm(this, openFileDialog.FileName); + loadFileForm.ShowDialog(); } } - /** - * File -> Close - */ - private void toolStripMenuItem3_Click(object sender, EventArgs e) + private void fileCloseMenuItem_Click(object sender, EventArgs e) { - if (ApplicationMode == AppMode.Clear) + if (this.IsBusy) { return; } - if (!treeView1.HasChanged) + if (this.ApplicationMode == AppMode.Clear) { - ApplicationMode = AppMode.Clear; - return; + // do later } - - if (ApplicationMode == AppMode.Open) + else { - if (string.IsNullOrEmpty(sessionFilename)) + if (treeView1.HasChanged) { - ApplicationMode = AppMode.Clear; - return; - } + if (this.ApplicationMode == AppMode.New) + { + DialogResult response = MessageBox.Show("Save bookmarks", "Save?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if (response == DialogResult.Yes) + { + bool hasSaved = saveAsBookmarkFile(); + if (!hasSaved) + { + return; + } + } + else if (response == DialogResult.No) + { + // do later + } + else if (response == DialogResult.Cancel) + { + return; + } + } + else if (this.ApplicationMode == AppMode.Open) + { + DialogResult response = MessageBox.Show("Save changes to open bookmarks", "Save?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if (response == DialogResult.Yes) + { + if (usePassword) + { + if (string.IsNullOrWhiteSpace(sessionPassword)) + { + TextBoxForm passwordForm = new TextBoxForm("Password", "Password", true); + sessionPassword = passwordForm.ShowDialog(); + } + } - if (MessageBox.Show("Save changes to open bookmarks.", "Save?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) - { - ApplicationMode = AppMode.Clear; - return; + saveBookmarkFile_ForJSNX(sessionFilename, sessionPassword ?? string.Empty); + } + else if (response == DialogResult.No) + { + // do later + } + else if (response == DialogResult.Cancel) + { + return; + } + } } - - bool rv = sessionFileFormat.saveToRyz(sessionFilename); - if (!rv) + else { - if (MessageBox.Show("There was a problem saving bookmarks. Bookmarks are not saved", "Not Saved", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.Cancel) return; - } - - ApplicationMode = AppMode.Clear; - } - else if (ApplicationMode == AppMode.New) - { - if (MessageBox.Show("Save changes to open bookmarks.", "Save?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) - { - ApplicationMode = AppMode.Clear; - return; - } - - bool rt = SaveBookmarkFile(); - if (rt) - { - ApplicationMode = AppMode.Clear; + // do later } } + + treeView1.Clear(); + + this.ApplicationMode = AppMode.Clear; + this.ClearSession(); } - /** - * File -> Save - */ - private void importSnapshotToolStripMenuItem_Click(object sender, EventArgs e) + private void fileSaveMenuItem_Click(object sender, EventArgs e) { - if (string.IsNullOrEmpty(sessionFilename)) + if (this.IsBusy) { return; } - bool rv = sessionFileFormat.saveToRyz(sessionFilename); - if (rv) + if (this.ApplicationMode == AppMode.New) { - treeView1.HasChanged = false; + DialogResult response = MessageBox.Show("Save bookmarks", "Save?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if (response == DialogResult.Yes) + { + bool hasSaved = saveAsBookmarkFile(); + if (!hasSaved) + { + return; + } + } + else if (response == DialogResult.No) + { + return; + } + else if (response == DialogResult.Cancel) + { + return; + } + } + else if (this.ApplicationMode == AppMode.Open) + { + if (usePassword) + { + if (string.IsNullOrWhiteSpace(sessionPassword)) + { + TextBoxForm passwordForm = new TextBoxForm("Password", "Password", true); + sessionPassword = passwordForm.ShowDialog(); + } + } + + saveBookmarkFile_ForJSNX(sessionFilename, sessionPassword ?? string.Empty); } } - /** - * File -> Save As - */ - private void exportSnapshotToolStripMenuItem_Click(object sender, EventArgs e) + private void fileSaveAsMenuItem_Click(object sender, EventArgs e) { - if (SaveBookmarkFile()) + if (this.IsBusy) { - ApplicationMode = AppMode.Open; - treeView1.HasChanged = false; + return; + } + + if (this.ApplicationMode == AppMode.Clear) + { + return; + } + + bool hasSaved = saveAsBookmarkFile(); + if (!hasSaved) + { + return; } } - /** - * File -> Export - */ - private void toolStripMenuItem7_Click(object sender, EventArgs e) { } - - /** - * File -> Exit - */ - private void exitToolStripMenuItem1_Click(object sender, EventArgs e) { this.Close(); } - - /** - * Find - */ - private void toolStripButton5_Click(object sender, EventArgs e) + private void fileExitMenuItem_Click(object sender, EventArgs e) { - FindForm frm = new FindForm(this); - frm.Show(); + if (this.IsBusy) + { + return; + } + + this.Close(); } - /** - * View -> Expand All - */ - private void expandAllToolStripMenuItem_Click(object sender, EventArgs e) + private void editFindMenuItem_Click(object sender, EventArgs e) { + if (this.IsBusy) + { + return; + } + + FindForm findForm = new FindForm(this); + findForm.Show(); + } + + private void viewExpandAllMenuItem_Click(object sender, EventArgs e) + { + if (this.IsBusy) + { + return; + } + + if (this.ApplicationMode == AppMode.Clear) + { + return; + } + if (treeView1.SelectedNode == null) { treeView1.ExpandAll(); @@ -409,11 +599,18 @@ namespace bzit.bomg } } - /** - * View -> Collapse All - */ - private void collapseAllToolStripMenuItem_Click(object sender, EventArgs e) + private void viewCollapseAllMenuItem_Click(object sender, EventArgs e) { + if (this.IsBusy) + { + return; + } + + if (this.ApplicationMode == AppMode.Clear) + { + return; + } + if (treeView1.SelectedNode == null) { treeView1.CollapseAll(); @@ -424,48 +621,29 @@ namespace bzit.bomg } } - /** - * Tools -> Refresh Icons - */ - private void toolStripMenuItem1_Click(object sender, EventArgs e) + private void viewAlwaysOnTopMenuItem_Click(object sender, EventArgs e) { - if (string.IsNullOrEmpty(sessionFilename)) - { - return; - } + this.TopMost = !this.TopMost; - if (this.ApplicationMode == AppMode.Clear) - { - return; - } - - UpdateIconForm frm = new UpdateIconForm(this); - frm.ShowDialog(); + alwaysOnTopToolStripMenuItem1.Checked = this.TopMost; } - /** - * Tools -> Options - */ - private void optionsToolStripMenuItem1_Click(object sender, EventArgs e) + private void toolsOptionsMenuItem_Click(object sender, EventArgs e) { - //OptionsForm frm = new OptionsForm(this); - //frm.ShowDialog(); - } - - /** - * Help -> Documentation - */ - public void documentationToolStripMenuItem_Click(object sender, EventArgs e) - { - string chm = Path.ChangeExtension(Application.ExecutablePath, ".chm"); - if (!File.Exists(chm)) + if (this.IsBusy) { return; } + UpdateIconsForm optionForm = new UpdateIconsForm(this); + optionForm.ShowDialog(); + } + + private void helpViewHelpMenuItem_Click(object sender, EventArgs e) + { try { - System.Diagnostics.Process.Start(chm); + System.Diagnostics.Process.Start(Resources.url_help); } catch { @@ -473,376 +651,306 @@ namespace bzit.bomg } } - /** - * Help -> About - */ - private void aboutToolStripMenuItem1_Click(object sender, EventArgs e) + private void helpAboutMenuItem_Click(object sender, EventArgs e) { - MessageBox.Show("Name: " + Properties.Resources.app_name + Environment.NewLine + "Version: " + Properties.Resources.app_version + Environment.NewLine + "Author: " + Properties.Resources.app_author, "About", MessageBoxButtons.OK, MessageBoxIcon.Information); + try + { + System.Diagnostics.Process.Start(Resources.url_about); + } + catch + { + // do nothing + } } - /** - * ? -> Always-On-Top - */ - private void alwaysOnTopToolStripMenuItem_Click(object sender, EventArgs e) - { - this.TopMost = !this.TopMost; - } - #endregion - #region TreeView Menu - item - - /** - * Node -> Open - */ - private void toolStripMenuItem4_Click(object sender, EventArgs e) + protected void openBookmark(TreeNode node) { - openBookmark(treeView1.SelectedNode); - } - - /** - * Node -> Edit - */ - private void toolStripMenuItem8_Click(object sender, EventArgs e) - { - if (treeView1.SelectedNode == null) + if (treeView1.GetNodeType(node) != RyzStudio.Windows.Forms.BookmarkTreeView.NodeType.Page) { return; } - treeView1.HasChanged = true; - - TreeNode tn = treeView1.SelectedNode; - BookmarkEditForm oBookmarkEdit = new BookmarkEditForm(ref tn); - oBookmarkEdit.ShowDialog(); - } - - /** - * Node -> Delete - */ - private void toolStripMenuItem6_Click(object sender, EventArgs e) - { - treeView1.DeleteNode(); - } - - #endregion - - #region TreeView Menu - folder - - /** - * Add Page - */ - private void toolStripMenuItem15_Click(object sender, EventArgs e) { treeView1.AddBookmarkPage(); } - - /** - * Add Folder - */ - private void toolStripMenuItem16_Click(object sender, EventArgs e) { treeView1.AddFolder(); } - - /** - * Open All - */ - private void toolStripMenuItem14_Click(object sender, EventArgs e) - { - if (treeView1.SelectedNode == null) + BookmarkItemViewModel viewModel = (BookmarkItemViewModel)node.Tag; + if (viewModel == null) { return; } - - foreach (TreeNode tn in treeView1.SelectedNode.Nodes) + + if (string.IsNullOrWhiteSpace(viewModel.SiteAddress)) { - if (tn.Tag == null) - { - continue; - } - - openBookmark(tn); + return; + } + + try + { + System.Diagnostics.Process.Start(viewModel.SiteAddress); + } + catch + { + // do nothing } } - /** - * Edit - */ - private void toolStripMenuItem9_Click(object sender, EventArgs e) + protected bool saveAsBookmarkFile() { - treeView1.HasChanged = true; - treeView1.EditNode(); - } - - /** - * Move Up - */ - private void toolStripMenuItem12_Click(object sender, EventArgs e) { treeView1.MoveNodeUp(); } - - /** - * Move Down - */ - private void toolStripMenuItem13_Click(object sender, EventArgs e) { treeView1.MoveNodeDown(); } - - /** - * Sort - */ - private void sortToolStripMenuItem_Click(object sender, EventArgs e) { treeView1.SortNode(); } - - #endregion - - protected void OpenBookmarkFile(string filename) - { - treeView1.HasChanged = false; - if (RyzStudio.IO.SharpZipLib.IsZipEncrypted(filename)) - { - PasswordForm oPassword = new PasswordForm(this); - sessionFileFormat.passkey = oPassword.ShowDialog(); - - if (sessionFileFormat.passkey.Equals("")) - { - return; - } - } - else - { - sessionFileFormat.passkey = ""; - } - - bool rv = sessionFileFormat.loadFromRyz(filename); - if (rv) - { - this.Text = Path.GetFileNameWithoutExtension(filename) + " - " + Properties.Resources.app_name; - this.ApplicationMode = AppMode.Open; - - treeView1.HasChanged = false; - } - } - - protected bool SaveBookmarkFile() - { - bool rv = false; - if (saveFileDialog.ShowDialog() == DialogResult.OK) { switch (saveFileDialog.FilterIndex) { case 1: - sessionFileFormat.passkey = ""; + saveBookmarkFile_ForJSNX(saveFileDialog.FileName); - rv = sessionFileFormat.saveToRyz(saveFileDialog.FileName); + this.Text = Path.GetFileNameWithoutExtension(saveFileDialog.FileName) + " - " + Properties.Resources.app_name; + + sessionFilename = saveFileDialog.FileName; + usePassword = false; + this.ApplicationMode = AppMode.Open; + treeView1.HasChanged = false; break; case 2: - PasswordForm oPassword = new PasswordForm(this); - sessionFileFormat.passkey = oPassword.ShowDialog(); + TextBoxForm passwordForm = new TextBoxForm("Password", "Password", true); + string password = passwordForm.ShowDialog(); - rv = sessionFileFormat.saveToRyz(saveFileDialog.FileName); - if (rv) - { - treeView1.HasChanged = false; - } + saveBookmarkFile_ForJSNX(saveFileDialog.FileName, password ?? string.Empty); + this.Text = Path.GetFileNameWithoutExtension(saveFileDialog.FileName) + " - " + Properties.Resources.app_name; + + sessionFilename = saveFileDialog.FileName; + sessionPassword = password; + usePassword = true; + this.ApplicationMode = AppMode.Open; + treeView1.HasChanged = false; break; default: break; } - - } - - if (rv) - { - ApplicationMode = AppMode.Open; - sessionFilename = saveFileDialog.FileName; - this.Text = Path.GetFileNameWithoutExtension(saveFileDialog.FileName) + " - " + Properties.Resources.app_name; - } - return rv; + return true; + } + else + { + return false; + } } - private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) + protected void saveBookmarkFile_ForJSNX(string filename, string password = "") { - if (e.Node == null) + List rs = treeView1.GetBookmarkList(); + + int size = 2048; + byte[] buffer = new byte[size]; + int bufferSize = 0; + + ZipOutputStream zipStream = new ZipOutputStream(File.Create(filename)); + zipStream.SetLevel(9); + zipStream.Password = password; + + // stream + MemoryStream ms = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(rs))); + ms.Position = 0; + + // write file entry + zipStream.PutNextEntry(new ZipEntry("bookmarks.json")); + + 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; + + treeView1.HasChanged = false; + } + + protected void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) + { + if (e.Button != MouseButtons.Right) { return; } - if (e.Node.Text.Equals("")) + switch (treeView1.SNode.GetNodeType()) { - return; - } - - // view ui - expandAllViewMenuItem.Enabled = false; - collapseAllViewMenuItem.Enabled = false; - if (e.Node != null) - { - if (e.Node.Tag == null) - { - expandAllViewMenuItem.Enabled = true; - collapseAllViewMenuItem.Enabled = true; - } - } - - if (e.Button == MouseButtons.Right) - { - // folder - if (e.Node.Tag == null) - { - if (e.Node.Equals(e.Node.TreeView.Nodes[0])) - { - treeMenuRoot.Show(Cursor.Position); - } - else - { - treeMenuFolder.Show(Cursor.Position); - } - } - else - { - if (!(e.Node.Tag is BookmarkItem)) - { - return; - } - - BookmarkItem bi = (BookmarkItem)e.Node.Tag; - treeMenuItem.Show(Cursor.Position); - } + case RyzStudio.Windows.Forms.BookmarkTreeView.NodeType.Root: + rootTreeNodeMenu.Show(e.Node.TreeView, e.X, e.Y); + break; + case RyzStudio.Windows.Forms.BookmarkTreeView.NodeType.Folder: + folderTreeNodeMenu.Show(e.Node.TreeView, e.X, e.Y); + break; + case RyzStudio.Windows.Forms.BookmarkTreeView.NodeType.Page: + pageTreeNodeMenu.Show(e.Node.TreeView, e.X, e.Y); + break; + default: + break; } } - private void treeView2_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { openBookmark(e.Node); } + protected void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) => openBookmark(e.Node); - private void treeView1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) + protected void treeView1_OnNodeChanged(object sender, EventArgs e) + { + if (this.InvokeRequired) + { + this.Invoke(new MethodInvoker(() => { + this.AllowSave = treeView1.HasChanged; + })); + } + else + { + this.AllowSave = treeView1.HasChanged; + } + } + + protected void treeView1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { TreeNode tn = treeView1.SelectedNode; if (tn == null) { return; } - + + NodeType nodeType = treeView1.SNode.GetNodeType(); + switch (e.KeyCode) { case Keys.Apps: treeView1_NodeMouseClick(sender, new TreeNodeMouseClickEventArgs(tn, MouseButtons.Right, 1, tn.Bounds.X, tn.Bounds.Y)); return; - case Keys.F2: - if (tn.Tag == null) - { - return; - } - - if (!(tn.Tag is BookmarkItem)) - { - return; - } - - toolStripMenuItem8_Click(sender, null); - - break; - case Keys.F3: - if (tn.Tag == null) - { - return; - } - - if (!(tn.Tag is BookmarkItem)) - { - return; - } - - BookmarkItem bookmarkItem = (BookmarkItem)tn.Tag; - if (bookmarkItem == null) - { - return; - } - - if (string.IsNullOrEmpty(bookmarkItem.SiteAddress)) - { - return; - } - - try - { - Clipboard.SetText(bookmarkItem.SiteAddress.Trim()); - } - catch - { - // do nothing - } - - break; case Keys.Enter: openBookmark(tn); + break; + case Keys.F2: + if (nodeType == NodeType.Page) + { + (new BookmarkEditForm(treeView1)).ShowDialog(); + } + + break; + case Keys.Insert: + if (e.Modifiers != Keys.Shift) + { + if ((nodeType == NodeType.Root) || (nodeType == NodeType.Folder)) + { + (new BookmarkEditForm(treeView1)).ShowDialog(); + } + else if (nodeType == NodeType.Page) + { + treeView1.SelectedNode = tn.Parent; + + (new BookmarkEditForm(treeView1)).ShowDialog(); + } + } + break; default: break; } } - - protected void openBookmark(TreeNode node) + + #region root context menu + + private void addPageContextMenu_Click(object sender, EventArgs e) => (new BookmarkEditForm(treeView1)).ShowDialog(); + + private void addFolderContextMenu_Click(object sender, EventArgs e) => treeView1.SelectedNode = treeView1.SNode.AddFolder(); + + private void editContextMenu_Click(object sender, EventArgs e) => treeView1.SNode.Edit(); + + private void sortContextMenu_Click(object sender, EventArgs e) => treeView1.SNode.Sort(); + + #endregion + + #region folder context menu + + private void addPageContextMenu2_Click(object sender, EventArgs e) => (new BookmarkEditForm(treeView1)).ShowDialog(); + + private void addFolderContextMenu2_Click(object sender, EventArgs e) => treeView1.SelectedNode = treeView1.SNode.AddFolder(); + + private void openAllContextMenu_Click(object sender, EventArgs e) { - if (node == null) + if (treeView1.SelectedNode == null) { return; } - if (node.Tag == null) + if (treeView1.SelectedNode.Nodes.Count <= 0) { return; } - if (!(node.Tag is BookmarkItem)) + foreach (TreeNode item in treeView1.SelectedNode.Nodes) { - return; + openBookmark(item); } - - BookmarkItem item = (BookmarkItem)node.Tag; - if (item == null) + } + + private void editContextMenu2_Click(object sender, EventArgs e) => treeView1.SNode.Edit(); + + private void deleteContextMenu_Click(object sender, EventArgs e) => treeView1.SNode.Delete(); + + private void sortContextMenu2_Click(object sender, EventArgs e) => treeView1.SNode.Sort(); + + private void moveUpContextMenu_Click(object sender, EventArgs e) => treeView1.SNode.MoveUp(); + + private void moveDownContextMenu_Click(object sender, EventArgs e) => treeView1.SNode.MoveDown(); + + #endregion + + #region page context menu + + private void openContextMenu_Click(object sender, EventArgs e) => openBookmark(treeView1.SelectedNode); + + private void editContextMenu3_Click(object sender, EventArgs e) => (new BookmarkEditForm(treeView1)).ShowDialog(); + + private void deleteContextMenu2_Click(object sender, EventArgs e) => treeView1.SNode.Delete(); + + private void moveUpContextMenu2_Click(object sender, EventArgs e) => treeView1.SNode.MoveUp(); + + private void moveDownContextMenu2_Click(object sender, EventArgs e) => treeView1.SNode.MoveDown(); + + #endregion + + public void ClearSession() + { + sessionFilename = sessionPassword = null; + usePassword = false; + } + + public void SetSessionFile(string filename, string password) + { + sessionFilename = filename; + sessionPassword = password; + usePassword = !string.IsNullOrWhiteSpace(password); + + string ext = Path.GetExtension(filename).Trim('.').ToLower(); + if (ext.Equals("jsnx")) { - return; + loadFileType = LoadFileType.Jsnx; } - - if (string.IsNullOrEmpty(item.SiteAddress)) + else if (ext.Equals("ryz")) { - return; + loadFileType = LoadFileType.Ryz; + } + else + { + loadFileType = LoadFileType.None; } - int bookmarkAction; - if (!int.TryParse(this.IconDatabase.GetConfig("core.bookmark.action", string.Empty), out bookmarkAction)) - { - bookmarkAction = 0; - } + ThreadControl.SetText(this, Path.GetFileNameWithoutExtension(sessionFilename) + " - " + Resources.app_name); + } - string bookmarkCustom1 = this.IconDatabase.GetConfig("core.bookmark.customcommand1", string.Empty).Trim(); - string bookmarkCustom2 = this.IconDatabase.GetConfig("core.bookmark.customcommand2", string.Empty).Trim(); - - switch (bookmarkAction) - { - case 1: - if (string.IsNullOrEmpty(bookmarkCustom1)) - { - return; - } - - bookmarkCustom1 = bookmarkCustom1.Replace("%1", item.SiteAddress); - bookmarkCustom2 = bookmarkCustom2.Replace("%1", item.SiteAddress); - - try - { - System.Diagnostics.Process.Start(bookmarkCustom1, bookmarkCustom2); - } - catch - { - // do nothing - } - - break; - default: - try - { - System.Diagnostics.Process.Start(item.SiteAddress); - } - catch - { - // do nothing - } - - break; - } - } } -} \ No newline at end of file +} diff --git a/MainForm.resx b/MainForm.resx index 5efc7db..b299e1a 100644 --- a/MainForm.resx +++ b/MainForm.resx @@ -117,428 +117,168 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 412, 17 + + 1034, 17 - + 17, 17 - - 307, 17 - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 - ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADU - FwAAAk1TRnQBSQFMAgEBBwEAAWQBAgFkAQIBEAEAARABAAT/AREBAAj/AUIBTQE2BwABNgMAASgDAAFA - AwABIAMAAQEBAAEQBgABEBQAAZkBSgEYAS4BtwEdAbcBGQG3ARkBtwEZAbcBGQG3ARkBtwEZAbcBGQG3 - ARkBtwEdARcBLgGZAUoEAAGZAUoBGAEuAbcBHQG3ARkBtwEZAbcBGQG3ARkBtwEZAbcBGQG3ARkBtwEZ - AbcBHQEXAS4BmQFKBAABmQFKARgBLgG3AR0BtwEZAbcBGQG3ARkBtwEZAbcBGQG3ARkBtwEZAbcBGQG3 - AR0BFwEuAZkBSiQAAdcBIQHeAXcBvgFvAb4BbwG+AW8BvgFvAb4BbwHfAXcB3wF3Ad8BdwHfAXsB/wF7 - Af8BfwHXASEEAAHXASEB3gF3Ab4BbwG+AW8BvgFvAb4BbwG+AW8B3wF3Ad8BdwHfAXcB3wF7Af8BewH/ - AX8B1wEhBAAB1wEhAd4BdwG+AW8BvgFvAb4BbwG+AW8BvgFvAd8BdwHfAXcB3wF3Ad8BewH/AXsB/wF/ - AdcBISQAAdgBHQG+A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i5DPk - 9c+mcJSYgCr8kB4SnSIK3+OMTlP9/ZA87+6h4H9Q7y1ndPpfDdBuNt9oFYjCPdRrUob/3rC6iQGCrU+B - wm3dfwBRcqBbhKA6hAAAAABJRU5ErkJggg== - - - 779, 20 + 443, 17 - - 534, 17 + + 865, 17 - 903, 20 + 576, 17 - 208, 17 + 228, 17 - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHYSURBVDhPjZO7SxxRFMZNrPI/KKQShBDElS1FEAtBiwQt - QiCQFAnY+cAiZcRKm7AsS5qQLpAiYJ9GJEQiOoOKL1DEYtd9ubM7j3vvzOiXcy7OOONuSA782GLO99vv - 3p3tSkwPkSGy/+Ax8ZBom4zneZZhGNdhGKITUkrkcrmPtNtRkuWw4zhwXTem2Wyi0WigXC5rSalUQj6f - b5M8ILK8IISAUkp/MrZtw7IsVCoVLaCW4C8pFAqRRI8WBE0T8mpLCyIJB1qtFqrVauo4DGd0mkYLxPEc - xMG7eCEIAn3u6Ci1Wk03KRaLd4Kbi9lH9t7LkZ3vo5/l4VvI3ReQZyvw6z8R+k5Kwk34Pur1+p1AHr35 - pI5mIE/m4Z+vQJ1+gNh5BmdjEGJvMdWEj8N3wqJYAEx3e7vP1+TJAglWSbAEz5yCZ7xGGCi9yPi+r++F - JUws4LnannwqzAmosyWo4/dw1p/At/bjMMMtosvlNimB83tsXBiTcH8NwN7op/oZqMsfOhTBDRgOtws2 - h18ZX/u+hLKGgBCHy5AX39rCSVICmvhFuk+yRRJ+xhmdptEC0zRv7gv+Bu1ec0anb2eIfh6XH3QKJOEd - ep1tyvC/N55eYohg6/9A4a7eP4kvnS+BaQv8AAAAAElFTkSuQmCC - - - - 658, 20 + + 705, 17 108 + - AAABAAMAMDAAAAEAIACoJQAANgAAACAgAAABACAAqBAAAN4lAAAQEAAAAQAgAGgEAACGNg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utb3/1LV9v82PT/3MjIyOAAAAAAAAAAAAAAAATQ4 + OoRASEr3ecjb/37g+f994Pn/feD5/33g+f994Pn/bdz4/1LW9/9S1vf/SlVX////////////4eHh/1Nc + Xv9IhZX/SnR+/0dTVf9+h4r/zs7O/87Ozv9Lcnz/Utb3/1LW9/9S1vf/Utb3/zxkbfYzMzN0AAAAAAAA + AAA0Ojy0QFFV9nvR5v+A4fn/fuD5/33g+f994Pn/feD5/33g+f9i2vj/Utb3/1LW9/9KVVf///////// + ////////+fn5/6Smp//Ozs7//f39////////////foaJ/0qov/9S1vf/Utb3/1LW9/9S1vf/RY6h/zQ7 + PLsAAAAAAAAAADU8Pd1msML/g+L5/4Hh+f9/4fn/feD5/33g+f994Pn/feD5/1nY9/9S1vf/Utb3/0pV + V/////////////////////////////////////////////39/f9HU1X/UdLy/1LW9/9S1vf/Utb3/1LW + 9/9Mtc//Mzg58wAAAAEAAAAANDc5mViLmPyD4vn/geH5/3/h+f994Pn/feD5/33g+f984Pn/U9b3/1LW + 9/9Nu9b/SVJV////////////////////////////////////////////ycnJ/0t3gv9S1vf/Utb3/1LW + 9/9S1vf/Utb3/1LU9P80ODn6MTExKgAAAAA0NDRZR1xh9IPi+f+B4fn/f+H5/33g+f994Pn/feD5/3ff + +f9S1fb/SY+h/09aXP/a2tr///////////////////////////////////////////93gIP/SqzF/1LW + 9/9S1vf/Utb3/1LW9/9S1vf/Utb3/ztZYPQyMjJmAAAAAC8vLxs1Njb9gNvy/4Hh+f9/4fn/feD5/33g + +f994Pn/a8vi/0diaP+GjY//+fn5/////////////////////////////////////////////////4KK + jP9KkKH/Utb3/1LW9/9S1vf/Utb3/1LW9/9S1vf/Q4WW/jM5O6kAAAAAAAAAADU6O+lyvtD/geH5/3/h + +f994Pn/feD5/2aktP9NVlj/y8zM//////////////////////////////////////////////////// + ////////+fn5/1VdYP9Ms83/Utb3/1LW9/9S1vf/Utb3/1LW9/9Kq8P/NTo76QAAAAAAAAAANTk7qV+X + pf6B4fn/f+H5/33g+f930ej/Q05Q/19naP+wsbL/7+/v//////////////////////////////////// + ////////////////////////4+Pj/0dVWP9Qy+r/Utb3/1LW9/9S1vf/Utb3/1DP7v8zNDX9NTU1HQAA + AAA0NDRnSmdt9YHh+f+A4fn/fuD5/33g+f994Pn/ZsLZ/0iMnf9HXWP/VWFk/5ufoP/l5eX///////// + ////////////////////////////////////////vL2+/0lnb/9S1fb/Utb3/1LW9/9S1vf/Utb3/zhO + VPM0NDRYAAAAADU1NSs3Ozv7geD3/4Dh+f9+4Pn/feD5/33g+f9z3vn/Utb3/1LW9/9PyOb/SJis/0pT + Vf/+/v7/////////////////8PDw/8nJyf/Jycn/ycnJ/8nJyf/Nzc3/aW5v/0qNnf9S1vf/Utb3/1LW + 9/9S1vf/P3qI/TQ3OZgAAAAAAAAAATM4OfN0xtr/gOH5/37g+f994Pn/feD5/3rf+f9S1vf/Utb3/1LW + 9/9S1vf/S294/9XV1f////////////39/f9bZGb/S3yJ/0yBj/9MgY//TIGP/0x7hv9OeIP/S4mZ/1LW + 9/9S1vf/Utb3/1LW9/9IoLb/NTw93AAAAAAAAAAANDs8u2Gfr/+A4fn/f+H5/33g+f994Pn/feD5/1jX + 9/9S1vf/Utb3/1LW9/9InrT/jZOV////////////lZqb/0uDkv9S1vf/Utb3/1LW9/9S1vf/Utb3/1LW + 9/9S1vf/Utb3/1LW9/9S1vf/TsHe/zhKTvY0Ojy0AAAAAAAAAAAyMjJ1TXJ694Hh+f9/4fn/feD5/33g + +f994Pn/Ztv4/1LW9/9S1vf/Utb3/1DO7f9NWFr//////9XV1f9GW2D/UdLy/1LW9/9S1vf/Utb3/1LW + 9/9S1vf/Utb3/1LW9/9S1vf/Utb3/0y40v82QEP3NDk7l1VVVQMAAAAAAAAAADExMTk5QUL4gOD4/3/h + +f994Pn/feD5/33g+f933/n/U9b3/1LW9/9S1vf/Utb3/0plbP/W1tb/TFdZ/06+2v9S1vf/Utb3/1LW + 9/9S1vf/Utb3/1LW9/9S1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AAAAAAAAAAAAAAAAAAAADQ0NDZETVDpdcLV/n3g+f994Pn/cN34/1LW9/9TXV//WXF3/0/A + 3P9S1vf/Utb3/1LW9/9S1vf/UdT1/0y10P9S1fb/Utb3/07A3f83REfNAAAAAAAAAAAAAAAAMjg7VklX + W+95zuP/feD5/33g+f994Pn/Y9r4/1LW9/9rfID/8/Pz/29+gv9QnrH/UdT1/0yvyP9VgYv/ZnuA/0lV + WP9R1PX/Utb3/1LW9/82QkXsQEBABAAAAAA1P0F5S2Fo8X/X7v9+4Pn/feD5/33g+f994Pn/V9f3/1LW + 9/9rfID///////////+nr7D/ZXd8/6ivsP/w8PD/7Ozs/1OAi/9S1vf/Utb3/1LW9/88YmvrMjIyMwAA + AAA1PkDrfdvy/4Hh+f9+4Pn/feD5/33g+f963/n/Utb3/1LW9/9qfID///////////////////////// + ////////nqan/0yzzf9S1vf/Utb3/1LW9/9FkaX7Njo9dgAAAAA3RUe2c8TY/4Hh+f9/4fn/feD5/33g + +f9y3vj/Utb3/1CdsP+IlJf/////////////////////////////////YHV7/1LV9v9S1vf/Utb3/1LW + 9/9NudT/N0RIwgAAAAAzNjZoYp2r+YHh+f9/4fn/feD5/33g+f9mzuj/VHZ//6yztP////////////// + ///////////////////5+fn/UW1z/1LW9/9S1vf/Utb3/1LW9/9S1fb/NUBD6wAAAAEyMjIpT2tz7IHh + +f9/4fn/feD5/2yuvv9neHz/6enp////////////////////////////////////////////qLCx/1GZ + q/9S1vf/Utb3/1LW9/9S1vf/O1li6jMzMygAAAABO0VJ64Hg+P9/4fn/feD5/2eap/9geH7/foyQ/8rL + y//8/Pz//////////////////////////////////////3iFiP9PuNL/Utb3/1LW9/9S1vf/RIma+TQ2 + NmcAAAAAN0RIw3fK3/9/4fn/feD5/33g+f9q3Pj/UMno/0+br/9Uc3r/v8TF/////////////////+jo + 6P/k5OT/8fHx/+vr6/9YaW7/UMzq/1LW9/9S1vf/S7LM/zZERrUAAAAANjo9dmSjs/yA4fn/feD5/33g + +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AAC0tLRE0NDRYNkRItTU8Pu02Pj5eAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAD///9B/wf/Qf4Af0H4AA9B8AADQeAAA0HAAANBgAABQQAAAUEAAAFBAAABQQAAAEEAAABBAAAAQYAA + AEGAAABBgAAAQYAAAUHAAANBwAAHQcAAD0HwAB9B/wA/Qf/g/0EoAAAAEAAAACAAAAABACAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3TVF4O1tk1zlRWLA3RERPQEBACAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBVlyOZqW18FPW9/9R0PD/SqrC+D9y + fts5VlzBNkhKdTU1NRgAAAAAAAAAAAAAAAAAAAAAAAAAAFVVVQNCV12tcbrL9mnb+P9S1vf/Utb3/1LW + 9/9S1vf/UdT1/0uwyv0/doXjO1hgyDU1NSIAAAAAAAAAACQkJAdEWl+7dMLW+n3g+f9b2Pf/Um92/1DF + 4/9S1vf/Utb3/1LW9/9S1vf/Utb3/0y71v85TFB5AAAAAC0tLRFEXGLKds3j/X3g+f963/n/U9b3/5Sl + qf+Po6j/Va7E/1GwyP9ol6P/V250/1HU9f9S1fb/O1ZctwAAAABCWWDQfNbs/33g+f994Pn/b934/1LW + 9/+Vp6v//////8bNzv/T1tf//////2uYo/9S1vf/Utb3/z1kbtEAAAAASWpyy4Hh+f9+4Pn/feD5/2jb + +P9Tt9D/qba5/////////////////97g4f9UqsD/Utb3/1LW9/9Bf4/lMzMzGTlTWal/3PP/fuD5/3ze + 9/9lnaz/sr7A///////////////////////Hzs//Va/G/1LW9/9S1vf/S6zG/TVARls3QkddccDT/X/h + +f9tqrn/fI2R/9bY2f///////////////////////////4iepP9Ryun/Utb3/1HQ8P85U1mmNTU1GGCV + oup/4fn/feD5/2PY9v9SrsX/ZoeP//39/f//////xczN/6y4uv+ns7X/WHd//1LW9/9S1vf/PGBpxwAA + AABRdH3Vf+H5/33g+f9s3Pj/Utb3/1C40v/Izc//zdPV/1eluP9Qy+r/T8jn/0/E4v9S1vf/UMjm/zlS + WM4AAAAAP1tiuX/g+P994Pn/eN/5/1PW9/9S1fb/g5ug/2eVoP9S1vf/Utb3/1LW9/9S1vf/TsHe/jlV + W80zMzMUAAAAADhMUHx0y+H/feD5/33g+f9k2vj/Utb3/1WYqf9Qzez/Utb3/1LW9/9S1vf/S7TO+jhR + Vr4zMzMKAAAAAAAAAAA1NTUiQV1kyVmIluZvwdX9e973/1/Z+P9S1vf/Utb3/1LW9/9S1vf/SKW89DhO + VKpVVVUDAAAAAAAAAAAAAAAAAAAAAAAAAAA5OTkSN0lLYkBdZLpSeYLfVaS591TP7f9S1vf/RZas7zdL + T5oAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBACDdERE86U1qwO1tk1zdN + UXgAAAAAAAAAAAAAAAAAAAAAAAAAAPg/rEHwB6xBwAGsQYABrEEAAaxBAAGsQQAArEEAAKxBAACsQQAA + rEGAAKxBgACsQYABrEGAA6xB4A+sQfwfrEE= \ No newline at end of file diff --git a/Models/BookmarkItemModel.cs b/Models/BookmarkItemModel.cs new file mode 100644 index 0000000..1fca643 --- /dev/null +++ b/Models/BookmarkItemModel.cs @@ -0,0 +1,413 @@ +using bzit.bomg.Models; +using HtmlAgilityPack; +using RyzStudio.Net; +using System; +using System.Drawing; +using System.IO; +using System.Net; +using System.Text; +using HtmlDocument = HtmlAgilityPack.HtmlDocument; + +namespace bzit.bomg +{ + public class BookmarkItemModel : BookmarkItemViewModel + { + protected HttpWeb webClient = null; + + public BookmarkItemModel() + { + this.Clear(); + } + + public void Clear() + { + this.SiteName = string.Empty; + this.SiteAddress = string.Empty; + this.SiteDescription = string.Empty; + this.FaviconAddress = string.Empty; + this.TreeviewPath = string.Empty; + } + + public new string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("Name = "); + sb.Append(this.SiteName ?? string.Empty); + sb.Append(Environment.NewLine); + + sb.Append("Address = "); + sb.Append(this.SiteAddress ?? string.Empty); + sb.Append(Environment.NewLine); + + sb.Append("Description = "); + sb.Append(this.SiteDescription ?? string.Empty); + sb.Append(Environment.NewLine); + + return sb.ToString(); + } + + public BookmarkItemViewModel ToViewModel() + { + return new BookmarkItemViewModel() + { + SiteName = this.SiteName, + SiteAddress = this.SiteAddress, + SiteDescription = this.SiteDescription, + FaviconAddress = this.FaviconAddress, + TreeviewPath = this.TreeviewPath + }; + } + + public bool Update() + { + string sourceCode = retrieveSourceCode(); + if (string.IsNullOrWhiteSpace(sourceCode)) + { + return false; + } + + HtmlDocument document = new HtmlDocument(); + document.LoadHtml(sourceCode); + + // title + this.SiteName = parseSiteTitle(document); + + // description + this.SiteDescription = parseSiteDescription(document); + + // favicon + this.FaviconAddress = parseSiteIcon(document); + + // default infurred icon + if (string.IsNullOrWhiteSpace(this.FaviconAddress)) + { + this.FaviconAddress = "/favicon.ico"; + } + + if (!string.IsNullOrWhiteSpace(this.FaviconAddress)) + { + Uri iconAddressURI; + bool rv = Uri.TryCreate(new Uri(this.SiteAddress), this.FaviconAddress, out iconAddressURI); + if (rv) + { + this.FaviconAddress = iconAddressURI.ToString(); + } + } + + return true; + } + + public bool UpdateFavicon() + { + string sourceCode = retrieveSourceCode(); + if (string.IsNullOrWhiteSpace(sourceCode)) + { + return false; + } + + HtmlDocument document = new HtmlDocument(); + document.LoadHtml(sourceCode); + + // favicon + this.FaviconAddress = parseSiteIcon(document); + + // default infurred icon + if (string.IsNullOrWhiteSpace(this.FaviconAddress)) + { + this.FaviconAddress = "/favicon.ico"; + } + + if (!string.IsNullOrWhiteSpace(this.FaviconAddress)) + { + Uri iconAddressURI; + bool rv = Uri.TryCreate(new Uri(this.SiteAddress), this.FaviconAddress, out iconAddressURI); + if (rv) + { + this.FaviconAddress = iconAddressURI.ToString(); + } + } + + return true; + } + + public Bitmap RetrieveFavicon() + { + if (string.IsNullOrWhiteSpace(this.FaviconAddress)) + { + return null; + } + + byte[] iconData = null; + WebClient webClient = new WebClient(); + webClient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore); + + try + { + iconData = webClient.DownloadData(this.FaviconAddress); + + if (!RyzStudio.IO.FileType.IsImage(iconData)) + { + throw new Exception("Not a supported image"); + } + + Image img = Image.FromStream(new MemoryStream(iconData)); + return new Bitmap(img, 16, 16); + } + catch + { + iconData = null; + this.FaviconAddress = null; + + return null; + } + } + + public Bitmap RetrieveFavicon(out byte[] rawData) + { + rawData = null; + + if (string.IsNullOrWhiteSpace(this.FaviconAddress)) + { + return null; + } + + byte[] iconData = null; + WebClient webClient = new WebClient(); + webClient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore); + + try + { + iconData = webClient.DownloadData(this.FaviconAddress); + + if (!RyzStudio.IO.FileType.IsImage(iconData)) + { + throw new Exception("Not a supported image"); + } + + rawData = iconData; + + Image img = Image.FromStream(new MemoryStream(iconData)); + return new Bitmap(img, 16, 16); + } + catch + { + iconData = null; + this.FaviconAddress = null; + + return null; + } + } + + protected string retrieveSourceCode() + { + if (webClient == null) + { + webClient = new HttpWeb(); + } + + string sourceCode; + int statusCode = webClient.GetResponse(out sourceCode, this.SiteAddress); + if ((statusCode == 200) || (statusCode == 301) || (statusCode == 302)) + { + return sourceCode; + } + + return null; + + //WebClient webClient = new WebClient(); + //webClient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore); + + //try + //{ + // return webClient.DownloadString(this.SiteAddress); + //} + //catch (Exception exc) + //{ + // return null; + //} + } + + 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; + } + + 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(); + } + + 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[@rel='shortcut icon']", "href", string.Empty); + rs = parseTagValue_Attr(doc, "//link[translate(@rel, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'shortcut icon']", "href", string.Empty); + } + + if (string.IsNullOrWhiteSpace(rs)) + { + //rs = parseTagValue_Attr(doc, "//link[@rel='icon']", "href", string.Empty); + rs = parseTagValue_Attr(doc, "//link[translate(@rel, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'icon']", "href", string.Empty); + } + + if (string.IsNullOrWhiteSpace(rs)) + { + //rs = parseTagValue_Attr(doc, "//link[@rel='apple-touch-icon']", "href", string.Empty); + rs = parseTagValue_Attr(doc, "//link[translate(@rel, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'apple-touch-icon']", "href", string.Empty); + } + + if (string.IsNullOrWhiteSpace(rs)) + { + //rs = parseTagValue_Attr(doc, "//link[@rel='apple-touch-icon-precomposed']", "href", string.Empty); + 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[@property='og:image']", "content", string.Empty); + rs = parseTagValue_Attr(doc, "//meta[translate(@property, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'og:image']", "content", string.Empty); + } + + if (string.IsNullOrWhiteSpace(rs)) + { + //rs = parseTagValue_Attr(doc, "//meta[@name='twitter:image']", "content", string.Empty); + rs = parseTagValue_Attr(doc, "//meta[translate(@name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'twitter:image']", "content", string.Empty); + } + + if (string.IsNullOrWhiteSpace(rs)) + { + //rs = parseTagValue_Attr(doc, "//meta[@property='og:image']", "content", string.Empty); + rs = parseTagValue_Attr(doc, "//meta[translate(@property, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'og:image']", "content", string.Empty); + } + + if (string.IsNullOrWhiteSpace(rs)) + { + //rs = parseTagValue_Attr(doc, "//meta[@itemprop='image']", "content", string.Empty); + rs = parseTagValue_Attr(doc, "//meta[translate(@itemprop, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'image']", "content", string.Empty); + } + + return rs; + } + + } +} \ No newline at end of file diff --git a/Models/BookmarkItemViewModel.cs b/Models/BookmarkItemViewModel.cs new file mode 100644 index 0000000..f05f934 --- /dev/null +++ b/Models/BookmarkItemViewModel.cs @@ -0,0 +1,44 @@ +using System; +using System.Text; + +namespace bzit.bomg.Models +{ + public class BookmarkItemViewModel + { + public string SiteName { get; set; } + public string SiteAddress { get; set; } + public string SiteDescription { get; set; } + public string FaviconAddress { get; set; } + public string TreeviewPath { get; set; } + + public BookmarkItemModel ToModel() + { + return new BookmarkItemModel() + { + SiteName = this.SiteName, + SiteAddress = this.SiteAddress, + SiteDescription = this.SiteDescription, + FaviconAddress = this.FaviconAddress, + TreeviewPath = this.TreeviewPath + }; + } + + public new string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("Name = "); + sb.Append(this.SiteName ?? string.Empty); + sb.Append(Environment.NewLine); + + sb.Append("Address = "); + sb.Append(this.SiteAddress ?? string.Empty); + sb.Append(Environment.NewLine); + + sb.Append("Description = "); + sb.Append(this.SiteDescription ?? string.Empty); + sb.Append(Environment.NewLine); + + return sb.ToString(); + } + } +} \ No newline at end of file diff --git a/NewSessionForm.Designer.cs b/NewSessionForm.Designer.cs deleted file mode 100644 index 0a35947..0000000 --- a/NewSessionForm.Designer.cs +++ /dev/null @@ -1,101 +0,0 @@ -namespace bzit.bomg -{ - partial class NewSessionForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NewSessionForm)); - this.label1 = new System.Windows.Forms.Label(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.btnSave = new RyzStudio.Windows.Forms.BigButton(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 12); - this.label1.Margin = new System.Windows.Forms.Padding(3); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(132, 13); - this.label1.TabIndex = 0; - this.label1.Text = "Enter a new session name"; - // - // textBox1 - // - this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox1.Location = new System.Drawing.Point(12, 31); - this.textBox1.MaxLength = 128; - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(280, 21); - this.textBox1.TabIndex = 0; - this.textBox1.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.textBox1_PreviewKeyDown); - // - // btnSave - // - this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnSave.BackColor = System.Drawing.Color.WhiteSmoke; - this.btnSave.Location = new System.Drawing.Point(196, 67); - this.btnSave.MaximumSize = new System.Drawing.Size(120, 32); - this.btnSave.MinimumSize = new System.Drawing.Size(32, 32); - this.btnSave.Name = "btnSave"; - this.btnSave.Padding = new System.Windows.Forms.Padding(4); - this.btnSave.Size = new System.Drawing.Size(96, 32); - this.btnSave.TabIndex = 22; - this.btnSave.Value = "&OK"; - this.btnSave.Click += new System.EventHandler(this.button2_Click); - // - // NewSessionForm - // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; - this.BackColor = System.Drawing.Color.White; - this.ClientSize = new System.Drawing.Size(304, 111); - this.Controls.Add(this.btnSave); - this.Controls.Add(this.textBox1); - this.Controls.Add(this.label1); - this.Font = new System.Drawing.Font("Tahoma", 8.25F); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "NewSessionForm"; - this.ShowInTaskbar = false; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "New"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.TextBox textBox1; - private RyzStudio.Windows.Forms.BigButton btnSave; - } -} \ No newline at end of file diff --git a/NewSessionForm.cs b/NewSessionForm.cs deleted file mode 100644 index e7890ba..0000000 --- a/NewSessionForm.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Windows.Forms; - -namespace bzit.bomg -{ - public partial class NewSessionForm : Form - { - private MainForm parentForm = null; - - public NewSessionForm(MainForm form) - { - InitializeComponent(); - - parentForm = form; - } - - private void button2_Click(object sender, EventArgs e) - { - if (parentForm == null) - { - return; - } - - if (string.IsNullOrEmpty(textBox1.Text)) - { - return; - } - - parentForm.treeView1.Clear(); - parentForm.treeView1.Nodes.Add("", textBox1.Text.Trim(), 0, 0); - parentForm.ApplicationMode = MainForm.AppMode.New; - - this.Close(); - } - -#region behaviour - - private void textBox1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) - { - switch (e.KeyCode) - { - case Keys.Enter: - button2_Click(sender, null); - break; - case Keys.Escape: - this.Close(); - break; - default: break; - } - } - -#endregion - - } -} \ No newline at end of file diff --git a/OptionsForm.Designer.cs b/OptionsForm.Designer.cs deleted file mode 100644 index 749a7c5..0000000 --- a/OptionsForm.Designer.cs +++ /dev/null @@ -1,151 +0,0 @@ -namespace bzit.bomg -{ - partial class OptionsForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OptionsForm)); - this.label1 = new System.Windows.Forms.Label(); - this.tbxAddress = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.oToolTip = new System.Windows.Forms.ToolTip(this.components); - this.comboBox1 = new System.Windows.Forms.ComboBox(); - this.btnSave = new RyzStudio.Windows.Forms.BigButton(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 12); - this.label1.Margin = new System.Windows.Forms.Padding(3); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(94, 13); - this.label1.TabIndex = 0; - this.label1.Text = "Open Bookmark:"; - // - // tbxAddress - // - this.tbxAddress.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.tbxAddress.Location = new System.Drawing.Point(12, 78); - this.tbxAddress.MaxLength = 4096; - this.tbxAddress.Name = "tbxAddress"; - this.tbxAddress.Size = new System.Drawing.Size(178, 22); - this.tbxAddress.TabIndex = 0; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(12, 59); - this.label2.Margin = new System.Windows.Forms.Padding(3); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(104, 13); - this.label2.TabIndex = 4; - this.label2.Text = "Custom Command:"; - // - // oToolTip - // - this.oToolTip.Active = false; - this.oToolTip.BackColor = System.Drawing.Color.IndianRed; - // - // comboBox1 - // - this.comboBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBox1.FormattingEnabled = true; - this.comboBox1.Items.AddRange(new object[] { - "Default", - "Custom Command"}); - this.comboBox1.Location = new System.Drawing.Point(12, 31); - this.comboBox1.Name = "comboBox1"; - this.comboBox1.Size = new System.Drawing.Size(280, 21); - this.comboBox1.TabIndex = 61; - // - // btnSave - // - this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnSave.BackColor = System.Drawing.Color.WhiteSmoke; - this.btnSave.Location = new System.Drawing.Point(196, 227); - this.btnSave.MaximumSize = new System.Drawing.Size(120, 32); - this.btnSave.MinimumSize = new System.Drawing.Size(32, 32); - this.btnSave.Name = "btnSave"; - this.btnSave.Padding = new System.Windows.Forms.Padding(4); - this.btnSave.Size = new System.Drawing.Size(96, 32); - this.btnSave.TabIndex = 3; - this.btnSave.Value = "&Save"; - this.btnSave.Click += new System.EventHandler(this.btnSave_Click); - // - // textBox1 - // - this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.textBox1.Location = new System.Drawing.Point(196, 78); - this.textBox1.MaxLength = 4096; - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(96, 22); - this.textBox1.TabIndex = 62; - // - // OptionsForm - // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; - this.BackColor = System.Drawing.Color.White; - this.ClientSize = new System.Drawing.Size(304, 271); - this.Controls.Add(this.textBox1); - this.Controls.Add(this.comboBox1); - this.Controls.Add(this.label1); - this.Controls.Add(this.tbxAddress); - this.Controls.Add(this.btnSave); - this.Controls.Add(this.label2); - this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "OptionsForm"; - this.ShowInTaskbar = false; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Options"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.TextBox tbxAddress; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.ToolTip oToolTip; - private RyzStudio.Windows.Forms.BigButton btnSave; - private System.Windows.Forms.ComboBox comboBox1; - private System.Windows.Forms.TextBox textBox1; - } -} \ No newline at end of file diff --git a/OptionsForm.cs b/OptionsForm.cs deleted file mode 100644 index 7e50850..0000000 --- a/OptionsForm.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Windows.Forms; - -namespace bzit.bomg -{ - public partial class OptionsForm : Form - { - private MainForm parentForm = null; - - public OptionsForm(MainForm form) - { - InitializeComponent(); - - parentForm = form; - - this.StartPosition = FormStartPosition.WindowsDefaultLocation; - } - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - - comboBox1.SelectedIndex = 0; - - comboBox1.SelectedIndex = ((parentForm.IconDatabase.GetConfig("core.bookmark.action", string.Empty).Equals("1")) ? 1 : 0); - tbxAddress.Text = parentForm.IconDatabase.GetConfig("core.bookmark.customcommand1", string.Empty).Trim(); - textBox1.Text = parentForm.IconDatabase.GetConfig("core.bookmark.customcommand2", string.Empty).Trim(); - } - - protected override void OnShown(EventArgs e) - { - base.OnShown(e); - } - - private void btnSave_Click(object sender, EventArgs e) - { - parentForm.IconDatabase.SetConfig("core.bookmark.action", comboBox1.SelectedIndex.ToString()); - parentForm.IconDatabase.SetConfig("core.bookmark.customcommand1", tbxAddress.Text.Trim()); - parentForm.IconDatabase.SetConfig("core.bookmark.customcommand2", textBox1.Text.Trim()); - - this.Close(); - } - } -} \ No newline at end of file diff --git a/PasswordForm.Designer.cs b/PasswordForm.Designer.cs deleted file mode 100644 index deaee9c..0000000 --- a/PasswordForm.Designer.cs +++ /dev/null @@ -1,102 +0,0 @@ -namespace bzit.bomg -{ - partial class PasswordForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PasswordForm)); - this.label1 = new System.Windows.Forms.Label(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.btnSave = new RyzStudio.Windows.Forms.BigButton(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 12); - this.label1.Margin = new System.Windows.Forms.Padding(3); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(91, 13); - this.label1.TabIndex = 0; - this.label1.Text = "Enter a password"; - // - // textBox1 - // - this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox1.Location = new System.Drawing.Point(12, 31); - this.textBox1.Name = "textBox1"; - this.textBox1.PasswordChar = '*'; - this.textBox1.Size = new System.Drawing.Size(280, 21); - this.textBox1.TabIndex = 0; - this.textBox1.UseSystemPasswordChar = true; - this.textBox1.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.textBox1_PreviewKeyDown); - // - // btnSave - // - this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnSave.BackColor = System.Drawing.Color.WhiteSmoke; - this.btnSave.Location = new System.Drawing.Point(196, 67); - this.btnSave.MaximumSize = new System.Drawing.Size(120, 32); - this.btnSave.MinimumSize = new System.Drawing.Size(32, 32); - this.btnSave.Name = "btnSave"; - this.btnSave.Padding = new System.Windows.Forms.Padding(4); - this.btnSave.Size = new System.Drawing.Size(96, 32); - this.btnSave.TabIndex = 23; - this.btnSave.Value = "&OK"; - this.btnSave.Click += new System.EventHandler(this.button2_Click); - // - // PasswordForm - // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; - this.BackColor = System.Drawing.Color.White; - this.ClientSize = new System.Drawing.Size(304, 111); - this.Controls.Add(this.btnSave); - this.Controls.Add(this.textBox1); - this.Controls.Add(this.label1); - this.Font = new System.Drawing.Font("Tahoma", 8.25F); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "PasswordForm"; - this.ShowInTaskbar = false; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Password"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.TextBox textBox1; - private RyzStudio.Windows.Forms.BigButton btnSave; - } -} \ No newline at end of file diff --git a/PasswordForm.cs b/PasswordForm.cs deleted file mode 100644 index 5336a59..0000000 --- a/PasswordForm.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Windows.Forms; - -namespace bzit.bomg -{ - public partial class PasswordForm : Form - { - private MainForm parentForm = null; - - public PasswordForm(MainForm form) - { - InitializeComponent(); - - parentForm = form; - } - - private void button2_Click(object sender, EventArgs e) - { - if (parentForm == null) - { - return; - } - - if (string.IsNullOrEmpty(textBox1.Text)) - { - return; - } - - this.Close(); - } - - private void textBox1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) - { - switch (e.KeyCode) - { - case Keys.Enter: - button2_Click(sender, null); - break; - case Keys.Escape: - this.Close(); - break; - default: break; - } - } - - public new string ShowDialog() - { - base.ShowDialog(); - - return textBox1.Text; - } - } -} \ No newline at end of file diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 8bbc9a6..c7c1090 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -8,7 +8,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle("Bookmark Manager")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("Hi, I'm Ray")] [assembly: AssemblyProduct("Bookmark Manager")] [assembly: AssemblyCopyright("Copyright © Ray Lam 2012")] [assembly: AssemblyTrademark("")] @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.2.1.001")] +[assembly: AssemblyVersion("0.3.0.030")] [assembly: AssemblyFileVersion("0.1.0.0")] diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index fe32468..e2d9c84 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -89,7 +89,7 @@ namespace bzit.bomg.Properties { } /// - /// Looks up a localized string similar to 0.2.1.001 beta. + /// Looks up a localized string similar to 0.3.0.030 beta. /// internal static string app_version { get { @@ -100,9 +100,9 @@ namespace bzit.bomg.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap cog { + internal static System.Drawing.Bitmap arrow_down_circle { get { - object obj = ResourceManager.GetObject("cog", resourceCulture); + object obj = ResourceManager.GetObject("arrow_down_circle", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -110,9 +110,9 @@ namespace bzit.bomg.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap comment { + internal static System.Drawing.Bitmap arrow_up_circle { get { - object obj = ResourceManager.GetObject("comment", resourceCulture); + object obj = ResourceManager.GetObject("arrow_up_circle", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -120,9 +120,39 @@ namespace bzit.bomg.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap disk { + internal static System.Drawing.Bitmap bookmark { get { - object obj = ResourceManager.GetObject("disk", resourceCulture); + object obj = ResourceManager.GetObject("bookmark", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap file { + get { + object obj = ResourceManager.GetObject("file", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap file_plus { + get { + object obj = ResourceManager.GetObject("file_plus", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap file_text { + get { + object obj = ResourceManager.GetObject("file_text", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -150,9 +180,9 @@ namespace bzit.bomg.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap folder_page { + internal static System.Drawing.Bitmap folder_plus { get { - object obj = ResourceManager.GetObject("folder_page", resourceCulture); + object obj = ResourceManager.GetObject("folder_plus", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -160,9 +190,9 @@ namespace bzit.bomg.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap help { + internal static System.Drawing.Bitmap folder1 { get { - object obj = ResourceManager.GetObject("help", resourceCulture); + object obj = ResourceManager.GetObject("folder1", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -170,9 +200,9 @@ namespace bzit.bomg.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap magnifier { + internal static System.Drawing.Bitmap help_circle { get { - object obj = ResourceManager.GetObject("magnifier", resourceCulture); + object obj = ResourceManager.GetObject("help_circle", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -180,9 +210,9 @@ namespace bzit.bomg.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap page_white_disk { + internal static System.Drawing.Bitmap hexagon { get { - object obj = ResourceManager.GetObject("page_white_disk", resourceCulture); + object obj = ResourceManager.GetObject("hexagon", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -190,9 +220,9 @@ namespace bzit.bomg.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap page_white_gray_green { + internal static System.Drawing.Bitmap save { get { - object obj = ResourceManager.GetObject("page_white_gray_green", resourceCulture); + object obj = ResourceManager.GetObject("save", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -200,9 +230,9 @@ namespace bzit.bomg.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap page_white_star { + internal static System.Drawing.Bitmap search { get { - object obj = ResourceManager.GetObject("page_white_star", resourceCulture); + object obj = ResourceManager.GetObject("search", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -210,9 +240,9 @@ namespace bzit.bomg.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap page_white_world_bw { + internal static System.Drawing.Bitmap settings { get { - object obj = ResourceManager.GetObject("page_white_world_bw", resourceCulture); + object obj = ResourceManager.GetObject("settings", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -220,11 +250,29 @@ namespace bzit.bomg.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap transmit_blue { + internal static System.Drawing.Bitmap trash_2 { get { - object obj = ResourceManager.GetObject("transmit_blue", resourceCulture); + object obj = ResourceManager.GetObject("trash_2", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// Looks up a localized string similar to https://www.hiimray.co.uk/software-bookmark-manager. + /// + internal static string url_about { + get { + return ResourceManager.GetString("url_about", resourceCulture); + } + } + + /// + /// 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/Properties/Resources.resx b/Properties/Resources.resx index 8637a55..281006b 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -128,45 +128,60 @@ Bookmark Manager - 0.2.1.001 beta + 0.3.0.030 beta - - ..\Resources\cog.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\2\arrow-down-circle.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\comment.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\2\arrow-up-circle.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\disk.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\2\bookmark.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\2\file.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\2\file-plus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\2\file-text.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\folder.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\2\folder.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\folder_explore.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\folder_page.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\2\folder-plus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\help.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\2\help-circle.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\magnifier.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\2\hexagon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\page_white_disk.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\2\save.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\page_white_gray_green.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\2\search.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\page_white_star.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\2\settings.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\page_white_world_bw.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\2\trash-2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\transmit_blue.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + https://www.hiimray.co.uk/software-bookmark-manager + + + https://www.hiimray.co.uk/software-bookmark-manager \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 9706953..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# bookmark-manager -Bookmark Manager is a free utility for storing and organising your favourite Internet shortcuts - -http://www.hiimray.co.uk/software-bookmark-manager diff --git a/References/SQLiteWrapper.dll b/References/SQLiteWrapper.dll deleted file mode 100644 index ec9f1f8..0000000 Binary files a/References/SQLiteWrapper.dll and /dev/null differ diff --git a/References/sqlite3.dll b/References/sqlite3.dll deleted file mode 100644 index c823a4d..0000000 Binary files a/References/sqlite3.dll and /dev/null differ diff --git a/Resources/2/arrow-down-circle.png b/Resources/2/arrow-down-circle.png new file mode 100644 index 0000000..c89f58b Binary files /dev/null and b/Resources/2/arrow-down-circle.png differ diff --git a/Resources/2/arrow-up-circle.png b/Resources/2/arrow-up-circle.png new file mode 100644 index 0000000..c2f96cd Binary files /dev/null and b/Resources/2/arrow-up-circle.png differ diff --git a/Resources/2/bookmark.png b/Resources/2/bookmark.png new file mode 100644 index 0000000..786e869 Binary files /dev/null and b/Resources/2/bookmark.png differ diff --git a/Resources/2/file-plus.png b/Resources/2/file-plus.png new file mode 100644 index 0000000..b17222e Binary files /dev/null and b/Resources/2/file-plus.png differ diff --git a/Resources/2/file-text.png b/Resources/2/file-text.png new file mode 100644 index 0000000..4772be9 Binary files /dev/null and b/Resources/2/file-text.png differ diff --git a/Resources/2/file.png b/Resources/2/file.png new file mode 100644 index 0000000..ca50d97 Binary files /dev/null and b/Resources/2/file.png differ diff --git a/Resources/2/folder-plus.png b/Resources/2/folder-plus.png new file mode 100644 index 0000000..7af2ebb Binary files /dev/null and b/Resources/2/folder-plus.png differ diff --git a/Resources/2/folder.png b/Resources/2/folder.png new file mode 100644 index 0000000..e0efb07 Binary files /dev/null and b/Resources/2/folder.png differ diff --git a/Resources/2/help-circle.png b/Resources/2/help-circle.png new file mode 100644 index 0000000..9d6d673 Binary files /dev/null and b/Resources/2/help-circle.png differ diff --git a/Resources/2/hexagon.png b/Resources/2/hexagon.png new file mode 100644 index 0000000..01e6fdb Binary files /dev/null and b/Resources/2/hexagon.png differ diff --git a/Resources/2/save.png b/Resources/2/save.png new file mode 100644 index 0000000..b5669a1 Binary files /dev/null and b/Resources/2/save.png differ diff --git a/Resources/2/search.png b/Resources/2/search.png new file mode 100644 index 0000000..b1feec0 Binary files /dev/null and b/Resources/2/search.png differ diff --git a/Resources/2/settings.png b/Resources/2/settings.png new file mode 100644 index 0000000..d0643de Binary files /dev/null and b/Resources/2/settings.png differ diff --git a/Resources/2/svg/arrow-down-circle.svg b/Resources/2/svg/arrow-down-circle.svg new file mode 100644 index 0000000..3238091 --- /dev/null +++ b/Resources/2/svg/arrow-down-circle.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Resources/2/svg/arrow-up-circle.svg b/Resources/2/svg/arrow-up-circle.svg new file mode 100644 index 0000000..044a75d --- /dev/null +++ b/Resources/2/svg/arrow-up-circle.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Resources/2/svg/book-open.svg b/Resources/2/svg/book-open.svg new file mode 100644 index 0000000..5e0ca0a --- /dev/null +++ b/Resources/2/svg/book-open.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Resources/2/svg/bookmark.svg b/Resources/2/svg/bookmark.svg new file mode 100644 index 0000000..2239cc5 --- /dev/null +++ b/Resources/2/svg/bookmark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Resources/2/svg/circle.svg b/Resources/2/svg/circle.svg new file mode 100644 index 0000000..b009088 --- /dev/null +++ b/Resources/2/svg/circle.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Resources/2/svg/file-plus.svg b/Resources/2/svg/file-plus.svg new file mode 100644 index 0000000..eed1200 --- /dev/null +++ b/Resources/2/svg/file-plus.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Resources/2/svg/file-text.svg b/Resources/2/svg/file-text.svg new file mode 100644 index 0000000..4197ddd --- /dev/null +++ b/Resources/2/svg/file-text.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Resources/2/svg/file.svg b/Resources/2/svg/file.svg new file mode 100644 index 0000000..378519a --- /dev/null +++ b/Resources/2/svg/file.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Resources/2/svg/folder-plus.svg b/Resources/2/svg/folder-plus.svg new file mode 100644 index 0000000..898f2fc --- /dev/null +++ b/Resources/2/svg/folder-plus.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Resources/2/svg/folder.svg b/Resources/2/svg/folder.svg new file mode 100644 index 0000000..134458b --- /dev/null +++ b/Resources/2/svg/folder.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Resources/2/svg/globe.svg b/Resources/2/svg/globe.svg new file mode 100644 index 0000000..0a0586d --- /dev/null +++ b/Resources/2/svg/globe.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Resources/2/svg/help-circle.svg b/Resources/2/svg/help-circle.svg new file mode 100644 index 0000000..c9cd11a --- /dev/null +++ b/Resources/2/svg/help-circle.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Resources/2/svg/hexagon.svg b/Resources/2/svg/hexagon.svg new file mode 100644 index 0000000..eae7f25 --- /dev/null +++ b/Resources/2/svg/hexagon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Resources/2/svg/save.svg b/Resources/2/svg/save.svg new file mode 100644 index 0000000..46c7299 --- /dev/null +++ b/Resources/2/svg/save.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Resources/2/svg/search.svg b/Resources/2/svg/search.svg new file mode 100644 index 0000000..8710306 --- /dev/null +++ b/Resources/2/svg/search.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Resources/2/svg/settings.svg b/Resources/2/svg/settings.svg new file mode 100644 index 0000000..19c2726 --- /dev/null +++ b/Resources/2/svg/settings.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Resources/2/svg/trash-2.svg b/Resources/2/svg/trash-2.svg new file mode 100644 index 0000000..f24d55b --- /dev/null +++ b/Resources/2/svg/trash-2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Resources/2/trash-2.png b/Resources/2/trash-2.png new file mode 100644 index 0000000..f1fe113 Binary files /dev/null and b/Resources/2/trash-2.png differ diff --git a/Resources/bullet_key.ico b/Resources/bullet_key.ico deleted file mode 100644 index 88e2f20..0000000 Binary files a/Resources/bullet_key.ico and /dev/null differ diff --git a/Resources/cog.ico b/Resources/cog.ico deleted file mode 100644 index 737f1a8..0000000 Binary files a/Resources/cog.ico and /dev/null differ diff --git a/Resources/cog.png b/Resources/cog.png deleted file mode 100644 index 67de2c6..0000000 Binary files a/Resources/cog.png and /dev/null differ diff --git a/Resources/comment.png b/Resources/comment.png deleted file mode 100644 index 7bc9233..0000000 Binary files a/Resources/comment.png and /dev/null differ diff --git a/Resources/disk.png b/Resources/disk.png deleted file mode 100644 index 99d532e..0000000 Binary files a/Resources/disk.png and /dev/null differ diff --git a/Resources/folder.png b/Resources/folder.png index 784e8fa..d3ea8ab 100644 Binary files a/Resources/folder.png and b/Resources/folder.png differ diff --git a/Resources/folder_explore.png b/Resources/folder_explore.png index d263435..6fdc0bb 100644 Binary files a/Resources/folder_explore.png and b/Resources/folder_explore.png differ diff --git a/Resources/folder_page.png b/Resources/folder_page.png deleted file mode 100644 index 1ef6e11..0000000 Binary files a/Resources/folder_page.png and /dev/null differ diff --git a/Resources/help.png b/Resources/help.png deleted file mode 100644 index 5c87017..0000000 Binary files a/Resources/help.png and /dev/null differ diff --git a/Resources/magnifier.ico b/Resources/magnifier.ico deleted file mode 100644 index 26e6a2c..0000000 Binary files a/Resources/magnifier.ico and /dev/null differ diff --git a/Resources/magnifier.png b/Resources/magnifier.png deleted file mode 100644 index cf3d97f..0000000 Binary files a/Resources/magnifier.png and /dev/null differ diff --git a/Resources/package_green.ico b/Resources/package_green.ico deleted file mode 100644 index acc1ef0..0000000 Binary files a/Resources/package_green.ico and /dev/null differ diff --git a/Resources/page_white_disk.png b/Resources/page_white_disk.png deleted file mode 100644 index 1a80ac9..0000000 Binary files a/Resources/page_white_disk.png and /dev/null differ diff --git a/Resources/page_white_gray_green.png b/Resources/page_white_gray_green.png deleted file mode 100644 index eb1fadf..0000000 Binary files a/Resources/page_white_gray_green.png and /dev/null differ diff --git a/Resources/page_white_star.ico b/Resources/page_white_star.ico deleted file mode 100644 index d4e1e07..0000000 Binary files a/Resources/page_white_star.ico and /dev/null differ diff --git a/Resources/page_white_star.png b/Resources/page_white_star.png deleted file mode 100644 index 3a1441c..0000000 Binary files a/Resources/page_white_star.png and /dev/null differ diff --git a/Resources/page_white_world_bw.png b/Resources/page_white_world_bw.png deleted file mode 100644 index 2a2e8a9..0000000 Binary files a/Resources/page_white_world_bw.png and /dev/null differ diff --git a/Resources/transmit_blue.png b/Resources/transmit_blue.png deleted file mode 100644 index b9c8d01..0000000 Binary files a/Resources/transmit_blue.png and /dev/null differ diff --git a/RyzStudio/Data/SQLite/SQLiteDatabase.cs b/RyzStudio/Data/SQLite/SQLiteDatabase.cs deleted file mode 100644 index 2ebab58..0000000 --- a/RyzStudio/Data/SQLite/SQLiteDatabase.cs +++ /dev/null @@ -1,444 +0,0 @@ -using System; -using System.ComponentModel; -using System.Data; -using System.IO; - -namespace RyzStudio.Data.SQLite -{ - public class SQLiteDatabase - { - #region static methods - - public static string escapeSQL(string query) - { - return query.Replace("'", "''").Trim(); - } - - public static string escapeValue(string text) - { - return text.Replace("\"", "\\\"").Replace("\t", "\\t").Replace("\r", " \\r").Replace("\n", "\\n"); - } - - public static string PrepareQuery(string query, params string[] arguments) - { - string rv = query; - - if (string.IsNullOrEmpty(rv)) - { - return string.Empty; - } - - for (int i = 0; i < arguments.Length; i++) - { - rv = rv.Replace("[^" + (i + 1).ToString() + "]", escapeSQL(arguments[i])); - } - - return rv; - } - - #endregion - - protected SQLiteWrapper.SQLiteBase database = null; - protected string databaseLocation = ":memory:"; - protected string lastError = ""; - - protected string[] requiredTableList = new string[0]; - - protected const string tableNameConfig = "ryz_app_xxxx_config"; - - #region public properties - - [Browsable(false)] - public SQLiteWrapper.SQLiteBase Database - { - get { return database; } - set { database = value; } - } - - [Browsable(false)] - public string DatabaseLocation - { - get { return databaseLocation; } - set { databaseLocation = value; } - } - - [Browsable(false)] - public string LastError - { - get { return lastError; } - } - - [Browsable(false)] - public int LastInsertID - { - get - { - if (database == null) - { - return 0; - } - - DataTable dt = this.DoQuery("SELECT last_insert_rowid() AS ccc;"); - if (dt == null) - { - return 0; - } - - if (dt.Rows.Count <= 0) - { - return 0; - } - - return int.Parse(dt.Rows[0]["ccc"].ToString()); - } - } - - #endregion - - #region public methods - - public bool Create(bool use_memory = true) - { - lastError = string.Empty; - - if (string.IsNullOrEmpty(databaseLocation)) - { - return false; - } - - try - { - if (database != null) - { - database.CloseDatabase(); - } - - database = new SQLiteWrapper.SQLiteBase(((use_memory) ? ":memory:" : databaseLocation)); - } - catch (Exception exc) - { - lastError = exc.Message; - return false; - } - - bool rv = Prepare(); - if (!rv) - { - return false; - } - - return CheckRequiredTables(); - } - - public bool Create(string filename, bool override_file = false) - { - lastError = string.Empty; - databaseLocation = filename; - - if (string.IsNullOrEmpty(databaseLocation)) - { - return false; - } - - if (File.Exists(databaseLocation) && override_file) - { - try - { - File.Delete(databaseLocation); - } - catch (Exception xc) - { - lastError = xc.Message; - return false; - } - } - - try - { - if (database != null) - { - database.CloseDatabase(); - } - - database = new SQLiteWrapper.SQLiteBase(databaseLocation); - } - catch (Exception exc) - { - lastError = exc.Message; - return false; - } - - bool rv = CheckRequiredTables(); - if (!rv) - { - Prepare(); - } - - return CheckRequiredTables(); - } - - public bool Load(string filename) - { - if (!File.Exists(filename)) - { - return false; - } - - lastError = string.Empty; - databaseLocation = filename; - - try - { - if (database != null) - { - database.CloseDatabase(); - } - - database = new SQLiteWrapper.SQLiteBase(databaseLocation); - } - catch (Exception exc) - { - lastError = exc.Message; - return false; - } - - return CheckRequiredTables(); - } - - public void Close() - { - if (database != null) - { - database.CloseDatabase(); - } - } - - - public DataTable DoQuery(string query) - { - lastError = string.Empty; - if (database == null) - { - return null; - } - - try - { - return database.ExecuteQuery(query); - } - catch (Exception exc) - { - lastError = exc.Message; - return null; - } - } - - public DataTable DoQuery(string query, params string[] args) - { - string sql = SQLiteDatabase.PrepareQuery(query, args); - - return DoQuery(sql); - } - - public bool DoNonQuery(string query) - { - lastError = string.Empty; - if (database == null) - { - return false; - } - - try - { - database.ExecuteNonQuery(query); - return true; - } - catch (Exception exc) - { - lastError = exc.Message; - return false; - } - } - - public bool DoNonQuery(string query, params string[] args) - { - string sql = SQLiteDatabase.PrepareQuery(query, args); - - return DoNonQuery(sql); - } - - public string DoQuerySingle(string query) - { - lastError = string.Empty; - if (database == null) - { - return string.Empty; - } - - DataTable tbl = DoQuery(query); - - if (tbl == null) - { - return string.Empty; - } - - if (tbl.Columns.Count <= 0) - { - return string.Empty; - } - - if (tbl.Rows.Count <= 0) - { - return string.Empty; - } - - return tbl.Rows[0][0].ToString(); - } - - public string DoQuerySingle(string query, params string[] args) - { - string sql = SQLiteDatabase.PrepareQuery(query, args); - - return DoQuerySingle(sql); - } - - public int DoQueryCount(string query) - { - if (database == null) - { - return -1; - } - - DataTable tbl = DoQuery(query); - - if (tbl == null) - { - return -1; - } - - if (tbl.Rows.Count <= 0) - { - return 0; - } - - return tbl.Rows.Count; - } - - public int DoQueryCount(string query, params string[] args) - { - string sql = SQLiteDatabase.PrepareQuery(query, args); - - return DoQueryCount(sql); - } - - public bool DoQueryExist(string query) - { - int rv = DoQueryCount(query); - - return (rv > 0); - } - - public bool DoQueryExist(string query, params string[] args) - { - string sql = SQLiteDatabase.PrepareQuery(query, args); - - return DoQueryExist(sql); - } - - public bool HasTable(string table_name) - { - lastError = string.Empty; - if (database == null) - { - return false; - } - - int rv = this.DoQueryCount("SELECT 1 FROM sqlite_master WHERE type='table' AND name='" + escapeSQL(table_name) + "'"); - - return (rv > 0); - } - - public bool CheckRequiredTables() - { - bool rv = true; - foreach (string tbl in requiredTableList) - { - if (string.IsNullOrEmpty(tbl)) - { - continue; - } - - if (!this.HasTable(tbl)) - { - rv = false; - break; - } - } - - return rv; - } - - - protected bool PrepareConfig() - { - if (HasTable(tableNameConfig)) - { - return true; - } - - bool rv = this.DoNonQuery(@" - BEGIN TRANSACTION; - CREATE TABLE " + tableNameConfig + @" (cfg_name TEXT, cfg_value TEXT); - COMMIT; - "); - - return rv; - } - - public bool SetConfig(string name, string value) - { - if (!PrepareConfig()) - { - return false; - } - - string sql = string.Empty; - int rv = this.DoQueryCount("SELECT 1 FROM " + tableNameConfig + " WHERE cfg_name='" + escapeSQL(name) + "'"); - if (rv <= 0) - { - sql = "INSERT INTO " + tableNameConfig + " (cfg_name, cfg_value) VALUES ('[^1]', '[^2]');"; - } - else - { - sql = "UPDATE " + tableNameConfig + " SET cfg_value='[^2]' WHERE cfg_name='[^1]';"; - } - - sql = PrepareQuery(sql, new string[] { name, value }); - - return this.DoNonQuery(sql); - } - - public string GetConfig(string name, string default_value = "") - { - if (!PrepareConfig()) - { - return default_value; - } - - bool rv = this.DoQueryExist("SELECT 1 FROM " + tableNameConfig + " WHERE cfg_name='" + escapeSQL(name) + "'"); - if (!rv) - { - return default_value; - } - - return this.DoQuerySingle("SELECT cfg_value FROM " + tableNameConfig + " WHERE cfg_name='" + escapeSQL(name) + "'"); - } - - #endregion - - protected virtual bool Prepare() - { - return true; - } - } -} \ No newline at end of file diff --git a/RyzStudio/Drawing/Rectangoid.cs b/RyzStudio/Drawing/Rectangoid.cs index de846cb..59a24d8 100644 --- a/RyzStudio/Drawing/Rectangoid.cs +++ b/RyzStudio/Drawing/Rectangoid.cs @@ -3,82 +3,122 @@ using System.Drawing.Drawing2D; namespace RyzStudio.Drawing { - public struct Rectangoid - { - int X; - int Y; - int Width; - int Height; - int Radius; + public struct Rectangoid + { + private int X; + private int Y; + private int Width; + private int Height; + private int Radius; - public Rectangoid(int x, int y, int width, int height, int radius) - { - X = x; - Y = y; - Width = width; - Height = height; - Radius = radius; - } + public Rectangoid(Rectangle rect, int radius) + { + X = rect.X; + Y = rect.Y; + Width = rect.Width; + Height = rect.Height; + Radius = radius; + } - public Rectangoid(int x, int y, int width, int height) - { - X = x; - Y = y; - Width = width; - Height = height; - Radius = 0; - } + public Rectangoid(Rectangle rect, int radius, int borderWidth) + { + rect.Inflate((-1 * borderWidth), (-1 * borderWidth)); - public Rectangoid(int width, int height, int radius) - { - X = 0; - Y = 0; - Width = width; - Height = height; - Radius = radius; - } + X = rect.X; + Y = rect.Y; + Width = rect.Width; + Height = rect.Height; + Radius = radius; + } - public Rectangoid(int width, int height) - { - X = 0; - Y = 0; - Width = width; - Height = height; - Radius = 0; - } + public Rectangoid(int x, int y, int width, int height, int radius) + { + X = x; + Y = y; + Width = width; + Height = height; + Radius = radius; + } - public Rectangoid(int width) - { - X = 0; - Y = 0; - Width = width; - Height = width; - Radius = 0; - } - - public GraphicsPath ToGraphicsPath() - { - GraphicsPath rv = new GraphicsPath(); - rv.AddLine(X + Radius, Y, X + Width - (Radius * 2), Y); - rv.AddArc(X + Width - (Radius * 2), Y, Radius * 2, Radius * 2, 270, 90); - rv.AddLine(X + Width, Y + Radius, X + Width, Y + Height - (Radius * 2)); - rv.AddArc(X + Width - (Radius * 2), Y + Height - (Radius * 2), Radius * 2, Radius * 2, 0, 90); - rv.AddLine(X + Width - (Radius * 2), Y + Height, X + Radius, Y + Height); - rv.AddArc(X, Y + Height - (Radius * 2), Radius * 2, Radius * 2, 90, 90); - rv.AddLine(X, Y + Height - (Radius * 2), X, Y + Radius); - rv.AddArc(X, Y, Radius * 2, Radius * 2, 180, 90); - rv.CloseFigure(); - - return rv; - } + public Rectangoid(int x, int y, int width, int height) + { + X = x; + Y = y; + Width = width; + Height = height; + Radius = 0; + } - public PointF GetOrigin() - { - PointF retval = new PointF(); - retval.X = ((float)Width / 2) + X; - retval.Y = ((float)Height / 2) + Y; - - return retval; - } - } + public Rectangoid(int width, int height, int radius) + { + X = 0; + Y = 0; + Width = width; + Height = height; + Radius = radius; + } + + public Rectangoid(int width, int height) + { + X = 0; + Y = 0; + Width = width; + Height = height; + Radius = 0; + } + + public Rectangoid(int width) + { + X = 0; + Y = 0; + Width = width; + Height = width; + Radius = 0; + } + + public GraphicsPath ToGraphicsPath() + { + GraphicsPath rv = new GraphicsPath(); + rv.AddLine(X + this.Radius, Y, X + Width - (this.Radius * 2), Y); + + if (this.Radius > 0) + { + rv.AddArc(X + Width - (this.Radius * 2), Y, this.Radius * 2, this.Radius * 2, 270, 90); + } + + rv.AddLine(X + Width, Y + this.Radius, X + Width, Y + Height - (this.Radius * 2)); + + if (this.Radius > 0) + { + rv.AddArc(X + Width - (this.Radius * 2), Y + Height - (this.Radius * 2), this.Radius * 2, this.Radius * 2, 0, 90); + } + + rv.AddLine(X + Width - (this.Radius * 2), Y + Height, X + this.Radius, Y + Height); + + if (this.Radius > 0) + { + rv.AddArc(X, Y + Height - (this.Radius * 2), this.Radius * 2, this.Radius * 2, 90, 90); + } + + rv.AddLine(X, Y + Height - (this.Radius * 2), X, Y + this.Radius); + + if (this.Radius > 0) + { + rv.AddArc(X, Y, this.Radius * 2, this.Radius * 2, 180, 90); + } + + rv.CloseFigure(); + + return rv; + } + + public PointF GetOrigin() + { + PointF rv = new PointF(); + rv.X = ((float)Width / 2) + X; + rv.Y = ((float)Height / 2) + Y; + + return rv; + } + } } \ No newline at end of file diff --git a/RyzStudio/IO/SharpZipLib.cs b/RyzStudio/IO/SharpZipLib.cs index b162124..d1f7c77 100644 --- a/RyzStudio/IO/SharpZipLib.cs +++ b/RyzStudio/IO/SharpZipLib.cs @@ -1,75 +1,123 @@ -using System; -using System.IO; -using ICSharpCode.SharpZipLib.Zip; - -namespace RyzStudio.IO +namespace RyzStudio.IO { + using System; + using System.IO; + using ICSharpCode.SharpZipLib.Zip; + public class SharpZipLib { - /// - /// Is zip file encrypted - /// - /// Filename - /// Is encrypted - public static bool IsZipEncrypted(string fn) + public static bool IsZipEncrypted(string filename) { - bool ret_val = false; + bool rv = false; + try { - ZipInputStream zipIn = new ZipInputStream(System.IO.File.OpenRead(fn)); - ZipEntry theEntry = null; - while ((theEntry = zipIn.GetNextEntry()) != null) + ZipInputStream zipStream = new ZipInputStream(File.OpenRead(filename)); + + ZipEntry zipEntry = null; + while ((zipEntry = zipStream.GetNextEntry()) != null) { - if (theEntry.IsCrypted) + if (zipEntry.IsCrypted) { - ret_val = true; + rv = true; } break; } - zipIn.Close(); + zipStream.Close(); } catch - { + { // do nothing } - return ret_val; + return rv; } - public static void AddFile(ZipOutputStream zipstream, string filename, string prefixpath = null) + public static bool TestZipEncrypted(string filename, string password) + { + bool rv = false; + + int size = 2; + byte[] buffer = new byte[size]; + int bufferSize = 0; + + ZipEntry readEntry = null; + 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.Size <= 0) + { + continue; + } + + try + { + bufferSize = readStream.Read(buffer, 0, buffer.Length); + rv = true; + } + catch + { + break; + } + + break; + } + + return rv; + } + + public static void AddFile(ZipOutputStream zipStream, string filename, string prefixPath = null) { byte[] buffer = new byte[4096]; - + string f1 = ""; - if (prefixpath != null) + if (prefixPath != null) { f1 = Path.GetDirectoryName(filename).TrimEnd('\\') + "\\"; - f1 = f1.Replace(prefixpath, "").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); + ZipEntry zipEntry = new ZipEntry(f1); + zipEntry.DateTime = DateTime.Now; + zipStream.PutNextEntry(zipEntry); + + FileStream fileStream = File.OpenRead(filename); int sourceBytes; do { - sourceBytes = fs.Read(buffer, 0, buffer.Length); - zipstream.Write(buffer, 0, sourceBytes); + sourceBytes = fileStream.Read(buffer, 0, buffer.Length); + zipStream.Write(buffer, 0, sourceBytes); } while (sourceBytes > 0); } - public static void AddFolder(ZipOutputStream zipstream, string folderpath, string prefixpath = null) + public static void AddFolder(ZipOutputStream zipStream, string folderPath, string prefixPath = null) { - foreach (string fn in Directory.GetFiles(folderpath, "*.*", System.IO.SearchOption.AllDirectories)) + foreach (string fn in Directory.GetFiles(folderPath, "*.*", System.IO.SearchOption.AllDirectories)) { - AddFile(zipstream, fn, prefixpath); + AddFile(zipStream, fn, prefixPath); } } } diff --git a/RyzStudio/Net/HttpWeb.cs b/RyzStudio/Net/HttpWeb.cs new file mode 100644 index 0000000..70fe441 --- /dev/null +++ b/RyzStudio/Net/HttpWeb.cs @@ -0,0 +1,168 @@ +using System; +using System.IO; +using System.Net; +using System.Text; +using System.Windows.Forms; + +namespace RyzStudio.Net +{ + public class HttpWeb + { + public string defaultUserAgent = "Momozilla/5.0 (" + Environment.OSVersion.Platform.ToString() + " ; " + Environment.OSVersion.VersionString + "; " + Application.CurrentCulture.TwoLetterISOLanguageName + ")"; + public int defaultTimeout = 6000; + public int defaultMaxRedirect = 8; + public bool defaultAllowRedirect = true; + public CookieContainer defaultCookierContainer = null; + + public HttpWeb() + { + } + + public HttpWebRequest CreateRequest(string url) + { + return this.CreateRequest(url, url); + } + + public HttpWebRequest CreateRequest(string url, string referrerURL) + { + if (defaultCookierContainer == null) + { + defaultCookierContainer = new CookieContainer(); + } + + HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url); + webRequest.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore); + webRequest.MaximumAutomaticRedirections = defaultMaxRedirect; + webRequest.CookieContainer = defaultCookierContainer; + webRequest.UserAgent = defaultUserAgent; + webRequest.AllowAutoRedirect = defaultAllowRedirect; + webRequest.Timeout = defaultTimeout; + + return webRequest; + } + + public int GetResponse(out string sourceCode, string url, string referrerURL = "") + { + HttpWebRequest webRequest = this.CreateRequest(url, referrerURL); + + return GetResponse(out sourceCode, webRequest); + } + + public int GetResponse(out string sourceCode, HttpWebRequest webRequest) + { + sourceCode = string.Empty; + + int rv = 0; + + try + { + HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse(); + + rv = (int)webResponse.StatusCode; + + StreamReader readContent = new StreamReader(webResponse.GetResponseStream()); + sourceCode = readContent.ReadToEnd(); + + webResponse.Close(); + webResponse = null; + } + catch (WebException xc) + { + if (xc.Response is HttpWebResponse) + { + HttpWebResponse rs = xc.Response as HttpWebResponse; + StreamReader readContent = new StreamReader(rs.GetResponseStream()); + if (readContent != null) + { + sourceCode = readContent.ReadToEnd(); + } + + rv = (int)rs.StatusCode; + } + else + { + rv = (int)xc.Status; + sourceCode = xc.Message; + } + } + catch (Exception xc) + { + sourceCode = xc.Message; + } + + return rv; + } + + public static HttpWebRequest AddBasicAuthentication(HttpWebRequest webRequest, string username, string password) + { + webRequest.Headers["Authorization"] = "Basic " + Convert.ToBase64String(Encoding.Default.GetBytes(string.Concat(username, ":", password))); + webRequest.PreAuthenticate = true; + + return webRequest; + } + + + public int GetPOSTResponse(out string sourceCode, HttpWebRequest webRequest, string postData) + { + sourceCode = ""; + int rv = 0; + byte[] buffer = Encoding.UTF8.GetBytes(postData); + + webRequest.ContentLength = buffer.Length; + + try + { + Stream dataStream = webRequest.GetRequestStream(); + dataStream.Write(buffer, 0, buffer.Length); + dataStream.Close(); + } + catch (Exception xc) + { + sourceCode = xc.Message; + return rv; + } + + return this.GetResponse(out sourceCode, webRequest); + } + + public int GetHeader(out WebHeaderCollection headerCollection, string url, string referrerURL = "") + { + headerCollection = null; + + int rv = 0; + + HttpWebRequest webRequest = this.CreateRequest(url, referrerURL); + webRequest.Method = "HEAD"; + + try + { + HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse(); + headerCollection = webResponse.Headers; + + rv = (int)webResponse.StatusCode; + + webResponse.Close(); + webResponse = null; + } + catch (WebException xc) + { + if (xc.Response is HttpWebResponse) + { + HttpWebResponse rs = xc.Response as HttpWebResponse; + + rv = (int)rs.StatusCode; + } + else + { + rv = (int)xc.Status; + } + } + catch + { + // do nothing + } + + return rv; + } + } +} \ No newline at end of file diff --git a/RyzStudio/String.cs b/RyzStudio/String.cs deleted file mode 100644 index c6c4510..0000000 --- a/RyzStudio/String.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.IO; -using System.Security.Cryptography; -using System.Text; - -namespace RyzStudio -{ - public class String - { - public static string EncodeTo64(string value) - { - try - { - byte[] toEncodeAsBytes = System.Text.ASCIIEncoding.ASCII.GetBytes(value); - return System.Convert.ToBase64String(toEncodeAsBytes); - } - catch - { - return string.Empty; - } - } - - public static string DecodeFrom64(string value) - { - try - { - byte[] encodedDataAsBytes = System.Convert.FromBase64String(value); - return System.Text.ASCIIEncoding.ASCII.GetString(encodedDataAsBytes); - } - catch - { - return string.Empty; - } - } - } -} \ No newline at end of file diff --git a/RyzStudio/Windows/Forms/BigButton.Designer.cs b/RyzStudio/Windows/Forms/BigButton.Designer.cs deleted file mode 100644 index 6943f34..0000000 --- a/RyzStudio/Windows/Forms/BigButton.Designer.cs +++ /dev/null @@ -1,64 +0,0 @@ -namespace RyzStudio.Windows.Forms -{ - partial class BigButton - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.button1 = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // button1 - // - this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(177)))), ((int)(((byte)(12))))); - this.button1.Dock = System.Windows.Forms.DockStyle.Fill; - this.button1.FlatAppearance.BorderSize = 0; - this.button1.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(231)))), ((int)(((byte)(108)))), ((int)(((byte)(31))))); - this.button1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(76)))), ((int)(((byte)(0))))); - this.button1.Location = new System.Drawing.Point(6, 6); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(116, 20); - this.button1.TabIndex = 6; - this.button1.UseVisualStyleBackColor = false; - // - // BButton - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.button1); - this.Name = "BButton"; - this.Padding = new System.Windows.Forms.Padding(6); - this.Size = new System.Drawing.Size(128, 32); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Button button1; - - } -} diff --git a/RyzStudio/Windows/Forms/BigButton.cs b/RyzStudio/Windows/Forms/BigButton.cs deleted file mode 100644 index 5dd4ca2..0000000 --- a/RyzStudio/Windows/Forms/BigButton.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; - -namespace RyzStudio.Windows.Forms -{ - public partial class BigButton : BigUserControl - { - protected bool enableClick = false; - - public BigButton() - { - InitializeComponent(); - - this.Button.Click += delegate (object s, EventArgs a) { this.OnClick(a); }; - this.Button.MouseEnter += delegate (object s, EventArgs a) { enableClick = true; }; - this.Button.MouseLeave += delegate (object s, EventArgs a) { enableClick = false; }; - this.Button.KeyDown += delegate (object s, KeyEventArgs a) { enableClick = true; }; - this.Button.KeyUp += delegate (object s, KeyEventArgs a) { enableClick = false; }; - } - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - - int b4 = (borderWidth * 4); - - this.borderColor = Color.FromArgb(222, 222, 222); - this.borderPen = new Pen(this.borderColor); - - this.Button.FlatStyle = FlatStyle.Flat; - this.Button.FlatAppearance.MouseDownBackColor = Color.FromArgb(200, 202, 206); - this.Button.FlatAppearance.MouseOverBackColor = Color.FromArgb(238, 238, 238); - this.Button.Font = new Font("Segoe UI", 8.25F, FontStyle.Regular, GraphicsUnit.Point); - this.Button.BackColor = Color.Transparent; - this.Button.ForeColor = Color.FromArgb(51, 51, 51); - this.Padding = new Padding(b4); - this.MinimumSize = new Size(32, 32); - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - this.Height = this.button1.Height + (this.button1.Top * 2); - } - - protected override void OnClick(EventArgs e) - { - if (!enableClick) - { - return; - } - - base.OnClick(e); - } - - #region public properties - - [Category("Data")] - public Button Button - { - get - { - return this.button1; - } - - set - { - this.button1 = value; - } - } - - [Browsable(false)] - public string Value - { - get - { - return this.button1.Text; - } - - set - { - this.button1.Text = value; - } - } - - #endregion - } -} \ No newline at end of file diff --git a/RyzStudio/Windows/Forms/BigUserControl.Designer.cs b/RyzStudio/Windows/Forms/BigUserControl.Designer.cs deleted file mode 100644 index 218b152..0000000 --- a/RyzStudio/Windows/Forms/BigUserControl.Designer.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace RyzStudio.Windows.Forms -{ - partial class BigUserControl - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - } - - #endregion - } -} diff --git a/RyzStudio/Windows/Forms/BigUserControl.cs b/RyzStudio/Windows/Forms/BigUserControl.cs deleted file mode 100644 index 400e7b9..0000000 --- a/RyzStudio/Windows/Forms/BigUserControl.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Drawing; -using System.Windows.Forms; -using RyzStudio.Drawing; - -namespace RyzStudio.Windows.Forms -{ - public partial class BigUserControl : UserControl - { - protected int borderWidth = 1; - protected Pen borderPen = null; - protected Color borderColor = Color.FromArgb(112, 112, 112); - protected Brush backgroundBrush = null; - protected Color backgroundColor = Color.FromKnownColor(KnownColor.White); - - public BigUserControl() - { - InitializeComponent(); - - borderPen = new Pen(new SolidBrush(borderColor), borderWidth); - backgroundBrush = new SolidBrush(backgroundColor); - } - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - - int b4 = (borderWidth * 4); - int b6 = (borderWidth * 6); - - this.BackColor = Color.FromKnownColor(KnownColor.WhiteSmoke); - this.Padding = new Padding(b6, b4, b6, b4); - } - - protected override void OnPaintBackground(PaintEventArgs e) - { - base.OnPaintBackground(e); - - Graphics g = e.Graphics; - g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; -//// g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; -//// g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; - g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; - - int b3 = (borderWidth * 3); - - Rectangoid area = new Rectangoid(borderWidth, borderWidth, (this.ClientRectangle.Width - b3), (this.ClientRectangle.Height - b3), 3); - g.FillPath(backgroundBrush, area.ToGraphicsPath()); - g.DrawPath(borderPen, area.ToGraphicsPath()); - } - } -} \ No newline at end of file diff --git a/RyzStudio/Windows/Forms/HorizontalSeparator.Designer.cs b/RyzStudio/Windows/Forms/HorizontalSeparator.Designer.cs new file mode 100644 index 0000000..f2b384d --- /dev/null +++ b/RyzStudio/Windows/Forms/HorizontalSeparator.Designer.cs @@ -0,0 +1,37 @@ +namespace RyzStudio.Windows.Forms +{ + partial class HorizontalSeparator + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + } + + #endregion + } +} diff --git a/RyzStudio/Windows/Forms/HorizontalSeparator.cs b/RyzStudio/Windows/Forms/HorizontalSeparator.cs new file mode 100644 index 0000000..ace86f8 --- /dev/null +++ b/RyzStudio/Windows/Forms/HorizontalSeparator.cs @@ -0,0 +1,25 @@ +using System.Drawing; +using System.Windows.Forms; + +namespace RyzStudio.Windows.Forms +{ + public partial class HorizontalSeparator : UserControl + { + public HorizontalSeparator() : base() + { + //InitializeComponent(); + + this.MaximumSize = new Size(SystemInformation.VirtualScreen.Width, 2); + } + + + protected override void OnPaintBackground(PaintEventArgs e) + { + base.OnPaintBackground(e); + + Graphics g = e.Graphics; + g.FillRectangle(new SolidBrush(Color.FromArgb(213, 223, 229)), new Rectangle(this.DisplayRectangle.Left, 0, this.DisplayRectangle.Width, 1)); + g.FillRectangle(new SolidBrush(Color.FromArgb(249, 251, 253)), new Rectangle(this.DisplayRectangle.Left, 1, this.DisplayRectangle.Width, 1)); + } + } +} diff --git a/RyzStudio/Windows/Forms/MovableTreeView.cs b/RyzStudio/Windows/Forms/MovableTreeView.cs deleted file mode 100644 index 40d1c8d..0000000 --- a/RyzStudio/Windows/Forms/MovableTreeView.cs +++ /dev/null @@ -1,726 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; - -namespace RyzStudio.Windows.Forms -{ - public class MovableTreeView : System.Windows.Forms.TreeView - { - public delegate void NodeCountUpdated(ulong v); - - public EventHandler OnChanged = null; - public NodeCountUpdated OnNodeCountUpdate = null; - - protected const char pathSeparator = '|'; - protected const int folderImageIndex = 1; - protected const int folderSelectedImageIndex = 2; - - protected TreeNode draggingNode = null; - protected bool allowBeginEdit = false; -//// public int[] folderImageIndex = { 1, 2 }; - protected ulong nodeCount = 0; - protected bool hasChanged = false; - - public MovableTreeView() - { - } - - #region public properties - -/* [Category("Data")] - public char CustomPathSeparator - { - get { return customPathSeparator; } - set { customPathSeparator = value; } - }*/ - - [Browsable(false)] - public TreeNode[] NodeList - { - get - { - TreeNode[] rv = new TreeNode[0]; - if (this.Nodes.Count <= 0) - { - return rv; - } - - foreach (TreeNode tn in this.Nodes) - { - traverseNodeList(ref rv, tn); - } - - return rv; - } - } - - [Browsable(false)] - public string[] NodeNameList - { - get - { - string[] rv = new string[0]; - if (this.Nodes.Count <= 0) - { - return rv; - } - - foreach (TreeNode tn in this.Nodes) - { - traverseNodeNameList(ref rv, tn); - } - - return rv; - } - } - - [Browsable(false)] - public ulong NodeCount - { - get - { - return nodeCount; - } - } - - [Browsable(false)] - public ulong NodeCountCalc - { - get - { - ulong rv = 0; - if (this.Nodes.Count <= 0) - { - return rv; - } - - foreach (TreeNode tn in this.Nodes) - { - traverseNodeCount(ref rv, tn); - } - - return rv; - } - } - - [Browsable(false)] - public bool HasChanged - { - get { return hasChanged; } - set - { - hasChanged = value; - - OnChanged?.Invoke(null, null); - } - } - - #endregion - - #region public methods - - public TreeNode AddFolder() - { - return this.AddFolder("New Folder " + (new Random()).Next(10001, 99999).ToString()); - } - - public TreeNode AddFolder(string name) - { - if (this.SelectedNode == null) - { - return null; - } - - if (this.SelectedNode.Tag != null) - { - return null; - } - - this.HasChanged = true; - - TreeNode tn = this.SelectedNode.Nodes.Add(PathEncode(name), name, folderImageIndex, folderSelectedImageIndex); - this.SelectedNode = tn; - - OnAddFolderNode(tn); - - return tn; - } - - public TreeNode AddBookmarkPage() - { - return this.AddBookmarkPage("New Page " + (new Random()).Next(10001, 99999).ToString()); - } - - public TreeNode AddBookmarkPage(string name, int icon = 3) - { - if (this.SelectedNode == null) - { - return null; - } - - if (this.SelectedNode.Tag != null) - { - return null; - } - - this.HasChanged = true; - - TreeNode tn = this.SelectedNode.Nodes.Add(PathEncode(name), name, icon, icon); - tn.Tag = new object(); - tn.ToolTipText = name; - - nodeCount++; - NodeCountUpdate(nodeCount); - - this.SelectedNode = tn; - - OnAddItemNode(tn); - return tn; - } - - public TreeNode AddBookmarkPageFullPath(string name, int icon = 3) - { - if (this.Nodes.Count <= 0) - { - return null; - } - - this.HasChanged = true; - - TreeNode tn2; - if (!name.Contains(pathSeparator.ToString())) - { - tn2 = this.Nodes[0].Nodes.Add(name, PathDecode(name), icon, icon); - tn2.ToolTipText = name; - nodeCount++; - } - else - { - tn2 = this.Nodes[0]; - string[] folders = name.Split(pathSeparator); - for (int x = 0; x < (folders.Length - 1); x++) - { - string dr = folders[x].Trim(); - if (tn2.Nodes.ContainsKey(dr)) - { - tn2 = tn2.Nodes[dr]; - } - else - { - tn2 = tn2.Nodes.Add(dr, PathDecode(dr), folderImageIndex, folderSelectedImageIndex); - } - } - - string tm = folders[(folders.Length - 1)].Trim(); - tn2 = tn2.Nodes.Add(tm, PathDecode(tm), icon, icon); - tn2.Tag = new object(); - tn2.ToolTipText = tm; - - nodeCount++; - } - - NodeCountUpdate(nodeCount); - - return tn2; - } - - public void EditNode() - { - this.HasChanged = true; - - if (this.SelectedNode == null) - { - return; - } - - if (!this.SelectedNode.IsEditing) - { - allowBeginEdit = true; - this.SelectedNode.BeginEdit(); - } - } - - public void DeleteNode() - { - if (this.SelectedNode == null) - { - return; - } - - if (this.Nodes.Count <= 0) - { - return; - } - - if (this.SelectedNode.Equals(this.Nodes[0])) - { - return; - } - - this.HasChanged = true; - - this.SelectedNode.Remove(); - - if (this.SelectedNode.Tag == null) - { - nodeCount = this.NodeCountCalc; - } - else - { - nodeCount--; - } - - NodeCountUpdate(nodeCount); - } - - public void SortNode() - { - TreeNode tn = this.SelectedNode; - string[] tnv = new string[0]; - TreeNode[] tna = new TreeNode[0]; - - this.HasChanged = true; - - foreach (TreeNode tn2 in tn.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); - - tn.Nodes.Clear(); - foreach (TreeNode tn2 in tna) - { - tn.Nodes.Add(tn2); - } - } - - public void MoveNodeUp() - { - TreeNode tn = this.SelectedNode; - if (tn.Parent == null) - { - return; - } - - if (tn.Index == 0) - { - return; - } - - this.HasChanged = true; - - int n = tn.Index - 1; - - TreeNode tn1 = tn.Parent; - tn1.Nodes.Remove(tn); - tn1.Nodes.Insert(n, tn); - - this.SelectedNode = tn; - } - - public void MoveNodeDown() - { - TreeNode tn = this.SelectedNode; - if (tn.Parent == null) - { - return; - } - - TreeNode tn1 = tn.Parent; - - this.HasChanged = true; - - if (tn.Index >= (tn1.Nodes.Count - 1)) - { - return; - } - - int n = tn.Index + 1; - - tn1.Nodes.Remove(tn); - tn1.Nodes.Insert(n, tn); - - this.SelectedNode = tn; - } - - public string GetNodeFullPath(TreeNode node) - { - string rv = PathEncode(node.Text); - - TreeNode tn = node; - while (true) - { - tn = tn.Parent; - - if (tn == null) - { - break; - } - - if (tn.Level == 0) - { - break; - } - - rv = PathEncode(tn.Text) + pathSeparator.ToString() + rv; - } - - return rv; - } - - public bool FindTextNode(TreeNode node, string term) - { - if (node == null) - { - return false; - } - - if (this.Nodes.Count <= 0) - { - return false; - } - - bool rt = false; - bool inclusive = false; - TreeNode tn = node; - while (true) - { - if (tn == null) - { - 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; - } - else - { - if (tn.NextNode != null) - { - tn = tn.NextNode; - inclusive = true; - } - else - { - while (true) - { - tn = tn.Parent; - if (tn == null) - { - break; - } - - if (tn.NextNode != null) - { - tn = tn.NextNode; - break; - } - } - - inclusive = true; - } - } - } - - return rt; - } - - public void Clear() - { - nodeCount = 0; - NodeCountUpdate(nodeCount); - this.Nodes.Clear(); - - this.HasChanged = true; - } - - #endregion - - #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 en = this.GetNodeAt(this.PointToClient(new Point(e.X, e.Y))); - if (en == null) - { - return; - } - - if (IsNodeChild(draggingNode, en)) - { - return; - } - - TreeNode dn = draggingNode; - if (en.Tag == null) - { - dn.Parent.Nodes.Remove(dn); - en.Nodes.Insert(0, dn); - } - else - { - en.Parent.Nodes.Remove(dn); - en.Parent.Nodes.Insert(en.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) - { - e.CancelEdit = true; - return; - } - - this.HasChanged = true; - - base.OnBeforeLabelEdit(e); - - if (e.Node == null) - { - e.CancelEdit = true; - } - else - { - if (e.Node.Tag == null) - { - // do it - } - else - { - e.CancelEdit = true; - } - } - } - - 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 OnPreviewKeyDown(PreviewKeyDownEventArgs e) - { - TreeNode tn = this.SelectedNode; - if (tn == null) - { - return; - } - - switch (e.KeyCode) - { - case Keys.Insert: - if (e.Modifiers == Keys.Shift) - { - AddFolder(); - } - else - { - AddBookmarkPage(); - } - - break; - case Keys.Delete: - if (!tn.IsEditing) - { - this.DeleteNode(); - } - - break; - case Keys.F2: - if (tn.Tag == null) - { - this.EditNode(); - } - - break; - case Keys.Up: - if (e.Modifiers == Keys.Control) - { - this.MoveNodeUp(); - } - - break; - case Keys.Down: - if (e.Modifiers == Keys.Control) - { - this.MoveNodeDown(); - } - - break; - default: break; - } - - base.OnPreviewKeyDown(e); - } - - protected virtual void NodeCountUpdate(ulong v) - { - this.OnNodeCountUpdate?.Invoke(v); - } - - #endregion - - #region internals - - protected bool IsNodeChild(TreeNode drag_node, TreeNode drop_node) - { - TreeNode tn = drop_node; - while (true) - { - if (tn.Parent == null) - { - break; - } - - if (tn.Equals(drag_node)) - { - return true; - } - - tn = tn.Parent; - } - - return false; - } - - protected void traverseNodeList(ref TreeNode[] results, TreeNode node) - { - foreach (TreeNode tn in node.Nodes) - { - if (tn.Tag == null) - { - traverseNodeList(ref results, tn); - } - else - { - Array.Resize(ref results, (results.Length + 1)); - results[(results.Length - 1)] = tn; - } - } - } - - protected void traverseNodeNameList(ref string[] results, TreeNode node) - { - foreach (TreeNode tn in node.Nodes) - { - if (tn.Tag == null) - { - traverseNodeNameList(ref results, tn); - } - else - { - Array.Resize(ref results, (results.Length + 1)); - results[(results.Length - 1)] = this.GetNodeFullPath(tn); - } - } - } - - protected void traverseNodeCount(ref ulong results, TreeNode node) - { - foreach (TreeNode tn in node.Nodes) - { - if (tn.Tag == null) - { - traverseNodeCount(ref results, tn); - } - else - { - results++; - } - } - } - - #endregion - - #region public methods - - protected virtual void OnAddFolderNode(TreeNode node) { } - - protected virtual void OnAddItemNode(TreeNode node) { } - - #endregion - - ////protected string PathEncode(string text) { return RyzStudio.String.EncodeTo64(text); } - //protected string PathDecode(string text) { return RyzStudio.String.DecodeFrom64(text); } - protected string PathEncode(string text) { return System.Web.HttpUtility.UrlEncodeUnicode(text); } - protected string PathDecode(string text) { return System.Web.HttpUtility.UrlDecode(text); } - } -} \ No newline at end of file diff --git a/RyzStudio/Windows/Forms/ThreadControl.cs b/RyzStudio/Windows/Forms/ThreadControl.cs new file mode 100644 index 0000000..c7ef544 --- /dev/null +++ b/RyzStudio/Windows/Forms/ThreadControl.cs @@ -0,0 +1,650 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace RyzStudio.Windows.Forms +{ + public class ThreadControl + { + public static void Add(Control control, Control value) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => + { + control.Controls.Add(value); + })); + } + else + { + control.Controls.Add(value); + } + } + + public static void Add(ListBox control, string value) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + control.Items.Add(value); + })); + } + else + { + control.Items.Add(value); + } + } + + //public static void Add(FlowLayoutPanel control, Control value) + //{ + // if (control.InvokeRequired) + // { + // control.Invoke(new MethodInvoker(() => { + // control.Controls.Add(value); + // })); + // } + // else + // { + // control.Controls.Add(value); + // } + //} + + public static int Add(TreeView control, TreeNode value) + { + int n = -1; + + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + n = control.Nodes.Add(value); + })); + } + else + { + n = control.Nodes.Add(value); + } + + return n; + } + + public static TreeNode Add(TreeNode control, string key, string text, int imageIndex, int selectedImageIndex) + { + TreeNode rs = null; + + if (control.TreeView.InvokeRequired) + { + control.TreeView.Invoke(new MethodInvoker(() => { + rs = control.Nodes.Add(key, text, imageIndex, selectedImageIndex); + })); + } + else + { + rs = control.Nodes.Add(key, text, imageIndex, selectedImageIndex); + } + + return rs; + } + + public static TreeNode Add(TreeView control, string key, string text, int imageIndex, int selectedImageIndex) + { + TreeNode rs = null; + + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + rs = control.Nodes.Add(key, text, imageIndex, selectedImageIndex); + })); + } + else + { + rs = control.Nodes.Add(key, text, imageIndex, selectedImageIndex); + } + + return rs; + } + + public static void Add(Control parentControl, ImageList control, string key, Image value) + { + if (parentControl.InvokeRequired) + { + parentControl.Invoke(new MethodInvoker(() => { + control.Images.Add(key, value); + })); + } + else + { + control.Images.Add(key, value); + } + } + + public static int Add(TreeNode control, TreeNode value) + { + int n = -1; + + if (control.TreeView.InvokeRequired) + { + control.TreeView.Invoke(new MethodInvoker(() => { + n = control.Nodes.Add(value); + })); + } + else + { + n = control.Nodes.Add(value); + } + + return n; + } + + public static int Add(DataGridView control, object[] value) + { + int n = -1; + + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + n = control.Rows.Add(value); + })); + } + else + { + n = control.Rows.Add(value); + } + + return n; + } + + public static int Add(DataGridView control, object[] value, object tag) + { + int n = -1; + + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + n = control.Rows.Add(value); + control.Rows[n].Tag = tag; + })); + } + else + { + n = control.Rows.Add(value); + control.Rows[n].Tag = tag; + } + + return n; + } + + public static TreeNode Add(TreeView control, string key, string text) + { + TreeNode rv = null; + + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + rv = control.Nodes.Add(key, text); + })); + } + else + { + rv = control.Nodes.Add(key, text); + } + + return rv; + } + + public static TreeNode Add(TreeNode control, string key, string text) + { + TreeNode rv = null; + + if (control.TreeView.InvokeRequired) + { + control.TreeView.Invoke(new MethodInvoker(() => { + rv = control.Nodes.Add(key, text); + })); + } + else + { + rv = control.Nodes.Add(key, text); + } + + return rv; + } + + public static void AddLine(RichTextBox control, string text) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => + { + control.Text += text + Environment.NewLine; + })); + } + else + { + control.Text += text + Environment.NewLine; + } + } + + public static void Clear(ListBox control) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + control.Items.Clear(); + })); + } + else + { + control.Items.Clear(); + } + } + + public static void Clear(FlowLayoutPanel control) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + control.Controls.Clear(); + })); + } + else + { + control.Controls.Clear(); + } + } + + public static void Clear(TreeView control) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + control.Nodes.Clear(); + })); + } + else + { + control.Nodes.Clear(); + } + } + + public static void Clear(Label control) => SetText(control, string.Empty); + + public static void Clear(PictureBox control) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => + { + control.Image = null; + })); + } + else + { + control.Image = null; + } + } + + public static void Clear(DataGridView control) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => + { + control.Rows.Clear(); + })); + } + else + { + control.Rows.Clear(); + } + } + + public static List FindChildControl(Control control) where T : Control + { + List rs = new List(); + + foreach (Control item in control.Controls) + { + var ctr = item as T; + if (ctr == null) + { + rs.AddRange(FindChildControl(item)); + } + else + { + rs.Add(ctr); + } + } + + return rs; + } + + public static string GetText(Control control, bool doTrim = true) + { + string rv = string.Empty; + + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + rv = (doTrim ? control.Text?.Trim() : control.Text); + })); + } + else + { + rv = (doTrim ? control.Text?.Trim() : control.Text); + } + + return rv; + } + + public static void SetEnable(Control control, bool value) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => + { + control.Enabled = value; + })); + } + else + { + control.Enabled = value; + } + } + + public static void SetEnable(Control container, ToolStripMenuItem control, bool value) + { + if (container.InvokeRequired) + { + container.Invoke(new MethodInvoker(() => + { + control.Enabled = value; + })); + } + else + { + control.Enabled = value; + } + } + + public static void SetEnable(Control container, ToolStripItem control, bool value) + { + if (container.InvokeRequired) + { + container.Invoke(new MethodInvoker(() => + { + control.Enabled = value; + })); + } + else + { + control.Enabled = value; + } + } + + public static int GetValue(NumericUpDown sender) + { + int rv = 0; + + if (sender.InvokeRequired) + { + sender.Invoke(new MethodInvoker(() => { + rv = (int)sender.Value; + })); + } + else + { + rv = (int)sender.Value; + } + + return rv; + } + + public static string GetSelectedValue(ListBox sender) + { + string rv = string.Empty; + + if (sender.InvokeRequired) + { + sender.Invoke(new MethodInvoker(() => { + rv = (sender.SelectedItem == null) ? string.Empty : sender.SelectedItem.ToString(); + })); + } + else + { + rv = (sender.SelectedItem == null) ? string.Empty : sender.SelectedItem.ToString(); + } + + return rv; + } + + public static void SetHeight(Control control, int value) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + control.Height = value; + })); + } + else + { + control.Height = value; + } + } + + public static void SetImage(PictureBox control, Image image) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + control.Image = image; + })); + } + else + { + control.Image = image; + } + } + + public static void SetSize(Control control, int width, int height) => SetSize(control, new Size(width, height)); + + public static void SetSize(Control control, Size value) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + control.Size = value; + })); + } + else + { + control.Size = value; + } + } + + public static void SetText(Control control, string text) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => + { + control.Text = text; + })); + } + else + { + control.Text = text; + } + } + + public static void SetText(ThemedForms.MemoBox control, string text) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + control.Text = text; + })); + } + else + { + control.Text = text; + } + } + + public static void SetText(ThemedForms.Button control, string text) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + control.LabelText = text; + })); + } + else + { + control.LabelText = text; + } + } + + public static void SetTopMost(Form control, bool value) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + control.TopMost = value; + })); + } + else + { + control.TopMost = value; + } + } + + public static void SetValue(Control control, string value) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + control.Text = value; + })); + } + else + { + control.Text = value; + } + } + + public static void SetValue(PictureBox control, Image value) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => + { + control.Image = value; + })); + } + else + { + control.Image = value; + } + } + + public static void SetValue(ThemedForms.ProgressBar control, int value, int maximum) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + control.Maximum = maximum; + control.Value = value; + })); + } + else + { + control.Maximum = maximum; + control.Value = value; + } + } + + public static void SetValue(ThemedForms.ProgressBar control, int value) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + control.Value = value; + })); + } + else + { + control.Value = value; + } + } + + public static void SetVisible(Control control, bool value) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + control.Visible = value; + })); + } + else + { + control.Visible = value; + } + } + + public static void SetVisible(Form control, bool value) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + if (value) + { + control.ShowInTaskbar = value; + control.Opacity = 100; + control.Visible = value; + } + else + { + control.Visible = value; + control.ShowInTaskbar = value; + control.Opacity = 0; + } + })); + } + else + { + if (value) + { + control.ShowInTaskbar = value; + control.Opacity = 100; + control.Visible = value; + } + else + { + control.Visible = value; + control.ShowInTaskbar = value; + control.Opacity = 0; + } + } + } + + public static void SetWidth(Control control, int value) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + control.Width = value; + })); + } + else + { + control.Width = value; + } + } + + + } +} \ No newline at end of file diff --git a/RyzStudio/Windows/ThemedForms/Button.cs b/RyzStudio/Windows/ThemedForms/Button.cs new file mode 100644 index 0000000..4762b3c --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/Button.cs @@ -0,0 +1,106 @@ +namespace RyzStudio.Windows.ThemedForms +{ + using System; + using System.ComponentModel; + using System.Drawing; + + public partial class Button : RyzStudio.Windows.ThemedForms.UserControl + { + protected ButtonState buttonState = ButtonState.Normal; + + public Button() : base() + { + InitializeComponent(); + + label1.ImageAlign = ContentAlignment.MiddleCenter; + + label1.Click += delegate { this.OnClick(null); }; + label1.MouseEnter += delegate { this.VisualState = ButtonState.Hover; }; + label1.MouseLeave += delegate { this.VisualState = ButtonState.Normal; }; + label1.MouseDown += delegate { this.VisualState = ButtonState.Down; }; + label1.MouseUp += delegate { this.VisualState = ButtonState.Normal; }; + } + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + + this.StyleOver.ForeImage = this.OverImage; + this.StyleDown.ForeImage = this.DownImage; + this.StyleDefault.ForeImage = this.DefaultImage; + + this.VisualState = ButtonState.Normal; + } + + protected ButtonState VisualState + { + get { return buttonState; } + set + { + switch (value) + { + case ButtonState.Normal: + if (this.VisualState == ButtonState.Down) + { + updateButton(StyleOver); + } + else + { + updateButton(StyleDefault); + } + + break; + case ButtonState.Hover: + updateButton(StyleOver); + break; + case ButtonState.Down: + updateButton(StyleDown); + break; + default: + updateButton(StyleDefault); + break; + } + + buttonState = value; + } + } + + protected void updateButton(ButtonStyle style) + { + label1.ForeColor = style.PenColour; + label1.BackColor = style.BackColour; + label1.Image = style.ForeImage; + } + + [Browsable(true)] + [Category("Appearance")] + public string LabelText + { + get => label1.Text; + set => label1.Text = value; + } + + [Browsable(true)] + [Category("Appearance")] + public Image OverImage { get; set; } = null; + + [Browsable(true)] + [Category("Appearance")] + public Image DownImage { get; set; } = null; + + [Browsable(true)] + [Category("Appearance")] + public Image DefaultImage { get; set; } = null; + + [Browsable(false)] + public ButtonStyle StyleOver { get; set; } = new ButtonStyle(Color.FromArgb(71, 142, 203), Color.FromArgb(250, 250, 250)); + + [Browsable(false)] + public ButtonStyle StyleDown { get; set; } = new ButtonStyle(Color.FromArgb(61, 132, 193), Color.FromArgb(250, 250, 250)); + + [Browsable(false)] + public ButtonStyle StyleDefault { get; set; } = new ButtonStyle(Color.FromArgb(51, 122, 183), Color.FromArgb(250, 250, 250)); + + public void PerformClick() => this.OnClick(null); + } +} \ No newline at end of file diff --git a/RyzStudio/Windows/ThemedForms/Button.designer.cs b/RyzStudio/Windows/ThemedForms/Button.designer.cs new file mode 100644 index 0000000..8791a02 --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/Button.designer.cs @@ -0,0 +1,61 @@ +namespace RyzStudio.Windows.ThemedForms +{ + partial class Button + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // label1 + // + this.label1.Dock = System.Windows.Forms.DockStyle.Fill; + this.label1.Location = new System.Drawing.Point(3, 3); + this.label1.Margin = new System.Windows.Forms.Padding(0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(123, 27); + this.label1.TabIndex = 0; + this.label1.Text = "label1"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // Button + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.label1); + this.Name = "Button"; + this.Padding = new System.Windows.Forms.Padding(3, 3, 2, 2); + this.Size = new System.Drawing.Size(128, 32); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label label1; + } +} diff --git a/RyzStudio/Windows/Forms/BigButton.resx b/RyzStudio/Windows/ThemedForms/Button.resx similarity index 100% rename from RyzStudio/Windows/Forms/BigButton.resx rename to RyzStudio/Windows/ThemedForms/Button.resx diff --git a/RyzStudio/Windows/ThemedForms/ButtonState.cs b/RyzStudio/Windows/ThemedForms/ButtonState.cs new file mode 100644 index 0000000..9ca2060 --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/ButtonState.cs @@ -0,0 +1,9 @@ +namespace RyzStudio.Windows.ThemedForms +{ + public enum ButtonState + { + Normal = 0, + Hover, + Down + } +} diff --git a/RyzStudio/Windows/ThemedForms/ButtonStyle.cs b/RyzStudio/Windows/ThemedForms/ButtonStyle.cs new file mode 100644 index 0000000..57c7cb5 --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/ButtonStyle.cs @@ -0,0 +1,25 @@ +namespace RyzStudio.Windows.ThemedForms +{ + using System.Drawing; + + public class ButtonStyle + { + public Color BackColour { get; set; } + public Color PenColour { get; set; } + public Image ForeImage { get; set; } = null; + + public ButtonStyle(Color backColour, Color penColour) + { + this.BackColour = backColour; + this.PenColour = penColour; + this.ForeImage = null; + } + + public ButtonStyle(Color backColour, Color penColour, Image foreImage) + { + this.BackColour = backColour; + this.PenColour = penColour; + this.ForeImage = foreImage; + } + } +} diff --git a/RyzStudio/Windows/ThemedForms/Form.Designer.cs b/RyzStudio/Windows/ThemedForms/Form.Designer.cs new file mode 100644 index 0000000..a50fcc7 --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/Form.Designer.cs @@ -0,0 +1,52 @@ +namespace RyzStudio.Windows.ThemedForms +{ + partial class Form + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // Form + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.BackColor = System.Drawing.Color.WhiteSmoke; + this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.ClientSize = new System.Drawing.Size(584, 381); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ForeColor = System.Drawing.Color.Black; + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.MinimumSize = new System.Drawing.Size(600, 420); + this.Name = "Form"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.ResumeLayout(false); + + } + + #endregion + } +} \ No newline at end of file diff --git a/RyzStudio/Windows/ThemedForms/Form.cs b/RyzStudio/Windows/ThemedForms/Form.cs new file mode 100644 index 0000000..f4ed713 --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/Form.cs @@ -0,0 +1,83 @@ +namespace RyzStudio.Windows.ThemedForms +{ + using System; + using System.ComponentModel; + using System.Drawing; + using System.Windows.Forms; + + /// + /// Theme customised form + /// + public partial class Form : System.Windows.Forms.Form + { + protected Image topImage = null; + protected Color topFillColour = Color.FromArgb(15, 15, 15); + protected int topFillHeight = 52; + + protected Image bottomImage = null; + protected Color bottomFillColour = Color.FromArgb(15, 15, 15); + protected int bottomFillMargin = 19; + + /// + /// Initializes a new instance of the Form class + /// + public Form() + { + this.InitializeComponent(); + + this.BackColor = Color.FromArgb(246, 246, 246); + } + + /// + /// Onresize event + /// + /// Event argument + protected override void OnResize(EventArgs e) + { + base.OnResize(e); + + this.Invalidate(); + } + + /// + /// OnPaint event + /// + /// Event argument + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + + Graphics g = e.Graphics; + + Rectangle areaTop = new Rectangle(this.DisplayRectangle.Left, 0, this.DisplayRectangle.Width, topFillHeight); + Rectangle areaBottom = new Rectangle(this.DisplayRectangle.Left, (this.DisplayRectangle.Height - bottomFillMargin), this.DisplayRectangle.Width, bottomFillMargin); + + // draw header + if (topFillHeight > 0) + { + g.FillRectangle(new SolidBrush(topFillColour), areaTop); + } + + // draw footer + if (bottomFillMargin > 0) + { + g.FillRectangle(new SolidBrush(bottomFillColour), areaBottom); + } + + // draw logo + if (topImage != null) + { + g.DrawImageUnscaled(topImage, 0, 0); + } + + if (bottomImage != null) + { + g.DrawImageUnscaled(bottomImage, 0, (this.DisplayRectangle.Height - bottomImage.Height - bottomFillMargin), this.DisplayRectangle.Width, bottomImage.Height); + } + } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new Color BackColor { get => base.BackColor; set => base.BackColor = value; } + + } +} \ No newline at end of file diff --git a/OptionsForm.resx b/RyzStudio/Windows/ThemedForms/Form.resx similarity index 71% rename from OptionsForm.resx rename to RyzStudio/Windows/ThemedForms/Form.resx index 9941254..1af7de1 100644 --- a/OptionsForm.resx +++ b/RyzStudio/Windows/ThemedForms/Form.resx @@ -1,4 +1,4 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/RyzStudio/Windows/ThemedForms/ProgressBar.Designer.cs b/RyzStudio/Windows/ThemedForms/ProgressBar.Designer.cs new file mode 100644 index 0000000..032705b --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/ProgressBar.Designer.cs @@ -0,0 +1,72 @@ +namespace RyzStudio.Windows.ThemedForms +{ + partial class ProgressBar + { + private System.ComponentModel.IContainer components = null; + + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label3 = new System.Windows.Forms.Label(); + this.userControl1 = new RyzStudio.Windows.ThemedForms.ProgressBarInner(); + this.SuspendLayout(); + // + // label3 + // + this.label3.BackColor = System.Drawing.Color.Transparent; + this.label3.Dock = System.Windows.Forms.DockStyle.Fill; + this.label3.Font = new System.Drawing.Font("Segoe UI", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label3.Location = new System.Drawing.Point(4, 4); + this.label3.Margin = new System.Windows.Forms.Padding(0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(803, 47); + this.label3.TabIndex = 144; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // userControl1 + // + this.userControl1.BarColour = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(225)))), ((int)(((byte)(249))))); + this.userControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.userControl1.Location = new System.Drawing.Point(4, 4); + this.userControl1.Margin = new System.Windows.Forms.Padding(0); + this.userControl1.Maximum = 100; + this.userControl1.Minimum = 0; + this.userControl1.Name = "userControl1"; + this.userControl1.Size = new System.Drawing.Size(803, 47); + this.userControl1.TabIndex = 145; + this.userControl1.Value = 50; + // + // ProgressBar + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.userControl1); + this.Controls.Add(this.label3); + this.Margin = new System.Windows.Forms.Padding(0); + this.Name = "ProgressBar"; + this.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + this.Size = new System.Drawing.Size(810, 54); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label label3; + private ProgressBarInner userControl1; + } +} diff --git a/RyzStudio/Windows/ThemedForms/ProgressBar.cs b/RyzStudio/Windows/ThemedForms/ProgressBar.cs new file mode 100644 index 0000000..ba55446 --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/ProgressBar.cs @@ -0,0 +1,33 @@ +using System; +using System.Drawing; + +namespace RyzStudio.Windows.ThemedForms +{ + public partial class ProgressBar : RyzStudio.Windows.ThemedForms.UserControl + { + public ProgressBar() : base() + { + InitializeComponent(); + + styleActive = new ThemeStyle(1, 3, 2, Color.FromArgb(212, 212, 212), Color.White); + } + + public int Minimum { get => userControl1.Minimum; set => userControl1.Minimum = value; } + + public int Maximum { get => userControl1.Maximum; set => userControl1.Maximum = value; } + + public int Value { get => userControl1.Value; set => userControl1.Value = value; } + + public Color BarColour { get => userControl1.BarColour; set => userControl1.BarColour = value; } + + public Color BarTextColour { get => userControl1.BarTextColour; set => userControl1.BarTextColour = value; } + + protected override void OnSizeChanged(EventArgs e) + { + base.OnSizeChanged(e); + + this.Invalidate(); + } + + } +} diff --git a/RyzStudio/Windows/ThemedForms/ProgressBar.resx b/RyzStudio/Windows/ThemedForms/ProgressBar.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/ProgressBar.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/RyzStudio/Windows/ThemedForms/ProgressBarInner.Designer.cs b/RyzStudio/Windows/ThemedForms/ProgressBarInner.Designer.cs new file mode 100644 index 0000000..8a0fc5c --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/ProgressBarInner.Designer.cs @@ -0,0 +1,63 @@ +namespace RyzStudio.Windows.ThemedForms +{ + partial class ProgressBarInner + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label3 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // label3 + // + this.label3.BackColor = System.Drawing.Color.Transparent; + this.label3.Dock = System.Windows.Forms.DockStyle.Fill; + this.label3.Font = new System.Drawing.Font("Segoe UI", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label3.Location = new System.Drawing.Point(4, 4); + this.label3.Margin = new System.Windows.Forms.Padding(0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(803, 47); + this.label3.TabIndex = 144; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // ProgressBarInner + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.label3); + this.Margin = new System.Windows.Forms.Padding(0); + this.Name = "ProgressBarInner"; + this.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + this.Size = new System.Drawing.Size(810, 54); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label label3; + } +} diff --git a/RyzStudio/Windows/ThemedForms/ProgressBarInner.cs b/RyzStudio/Windows/ThemedForms/ProgressBarInner.cs new file mode 100644 index 0000000..974a7d2 --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/ProgressBarInner.cs @@ -0,0 +1,185 @@ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace RyzStudio.Windows.ThemedForms +{ + public partial class ProgressBarInner : System.Windows.Forms.UserControl + { + protected int minimum = 0; + protected int maximum = 100; + protected int value = 0; + + public ProgressBarInner() : base() + { + InitializeComponent(); + + this.Padding = new Padding(0); + } + + public int Minimum + { + get + { + return minimum; + } + set + { + if (this.InvokeRequired) + { + this.Invoke(new MethodInvoker(() => { + setMinimum(value); + })); + } + else + { + setMinimum(value); + } + } + } + + public int Maximum + { + get + { + return maximum; + } + set + { + if (this.InvokeRequired) + { + this.Invoke(new MethodInvoker(() => { + setMaximum(value); + })); + } + else + { + setMaximum(value); + } + } + } + + public int Value + { + get + { + return value; + } + set + { + if (this.InvokeRequired) + { + this.Invoke(new MethodInvoker(() => { + setValue(value); + })); + } + else + { + setValue(value); + } + } + } + + public Color BarColour { get; set; } = Color.FromArgb(158, 225, 249); + + public Color BarTextColour + { + get => label3.ForeColor; + set => label3.ForeColor = value; + } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + + Rectangle canvas = this.DisplayRectangle; + Graphics g = e.Graphics; + + if (this.Value > 0) + { + decimal result = decimal.Divide(canvas.Width, this.Maximum) * this.Value; + + canvas.Width = (int)Math.Round(result); + + g.FillRectangle(new SolidBrush(this.BarColour), canvas); + } + } + + protected void updateText() => RyzStudio.Windows.Forms.ThreadControl.SetText(label3, string.Format("{0}/{1}", this.Value.ToString(), this.Maximum.ToString())); + + protected void setMinimum(int value) + { + int m = value; + if (m < 0) + { + m = 0; + } + + if (m > this.Maximum) + { + m = this.Maximum; + } + + if (this.Value < m) + { + this.Value = m; + } + + if (this.value > this.Maximum) + { + this.value = this.Maximum; + } + + minimum = m; + updateText(); + this.Invalidate(); + } + + protected void setMaximum(int value) + { + int m = value; + if (m < 0) + { + m = 0; + } + + if (m < this.Minimum) + { + m = this.Minimum; + } + + if (this.Value > m) + { + this.Value = m; + } + + if (this.value < this.Minimum) + { + this.value = this.Minimum; + } + + maximum = m; + updateText(); + this.Invalidate(); + } + + protected void setValue(int value) + { + int m = value; + if (m < this.Minimum) + { + m = this.Minimum; + } + + if (m > this.Maximum) + { + m = this.Maximum; + } + + this.value = m; + updateText(); + this.Invalidate(); + } + + } +} diff --git a/RyzStudio/Windows/ThemedForms/ProgressBarInner.resx b/RyzStudio/Windows/ThemedForms/ProgressBarInner.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/ProgressBarInner.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/RyzStudio/Windows/ThemedForms/TextBox.cs b/RyzStudio/Windows/ThemedForms/TextBox.cs new file mode 100644 index 0000000..676b6d5 --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/TextBox.cs @@ -0,0 +1,85 @@ +namespace RyzStudio.Windows.ThemedForms +{ + using RyzStudio.Drawing; + using System; + using System.ComponentModel; + using System.Drawing; + using System.Windows.Forms; + + public partial class TextBox : RyzStudio.Windows.ThemedForms.UserControl + { + protected readonly Padding textboxPadding = new Padding(6, 6, 6, 6); + + public TextBox() : base() + { + InitializeComponent(); + + this.Margin = new Padding(10, 6, 10, 6); + textBox1.PreviewKeyDown += textBox_PreviewKeyDown; + } + + protected override void OnResize(EventArgs e) + { + base.OnResize(e); + + int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding; + + this.Height = textBox1.Height + (b + textboxPadding.Top) + ((b - 1) + textboxPadding.Bottom); + } + + protected override void OnGotFocus(EventArgs e) + { + base.OnGotFocus(e); + + textBox1.Focus(); + } + + protected void textBox_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) + { + switch (e.KeyCode) + { + case Keys.Enter: + if (this.SubmitButton != null) + { + this.SubmitButton.PerformClick(); + } + + break; + //case Keys.Escape: + // this.Close(); + // break; + default: break; + } + } + + [Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)] + [Category("Appearance")] + public System.Windows.Forms.TextBox InnerTextBox { get => textBox1; set => textBox1 = value; } + + [Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)] + [Category("Appearance")] + public new string Text { get => textBox1.Text; set => textBox1.Text = value; } + + [Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)] + [Category("Appearance")] + public bool UseSystemPasswordChar { get => textBox1.UseSystemPasswordChar; set => textBox1.UseSystemPasswordChar = value; } + + [Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)] + [Category("Appearance")] + public Button SubmitButton { get; set; } = null; + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new Padding Margin { get { return base.Margin; } set { base.Margin = value; } } + + protected override void updateBackground(Graphics g, ThemeStyle style) + { + int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding; + + this.Padding = new Padding((b + textboxPadding.Left), (b + textboxPadding.Top), ((b - 1) + textboxPadding.Right), ((b - 1) + textboxPadding.Bottom)); + + Rectangoid area = new Rectangoid(this.ClientRectangle, style.BorderRadius, style.BorderWidth); + g.FillPath(new SolidBrush(style.BackColour), area.ToGraphicsPath()); + g.DrawPath(new Pen(new SolidBrush(style.BorderColour), style.BorderWidth), area.ToGraphicsPath()); + } + } +} \ No newline at end of file diff --git a/RyzStudio/Windows/ThemedForms/TextBox.designer.cs b/RyzStudio/Windows/ThemedForms/TextBox.designer.cs new file mode 100644 index 0000000..29231b0 --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/TextBox.designer.cs @@ -0,0 +1,60 @@ +namespace RyzStudio.Windows.ThemedForms +{ + partial class TextBox + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.textBox1 = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // textBox1 + // + this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBox1.HideSelection = false; + this.textBox1.Location = new System.Drawing.Point(4, 4); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(121, 13); + this.textBox1.TabIndex = 0; + // + // TextBox + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.Controls.Add(this.textBox1); + this.Name = "TextBox"; + this.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + this.Size = new System.Drawing.Size(128, 32); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox textBox1; + } +} diff --git a/RyzStudio/Windows/ThemedForms/TextBox.resx b/RyzStudio/Windows/ThemedForms/TextBox.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/TextBox.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/RyzStudio/Windows/ThemedForms/TextBoxForm.Designer.cs b/RyzStudio/Windows/ThemedForms/TextBoxForm.Designer.cs new file mode 100644 index 0000000..d6b58a9 --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/TextBoxForm.Designer.cs @@ -0,0 +1,117 @@ +namespace RyzStudio.Windows.ThemedForms +{ + partial class TextBoxForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.textBox1 = new RyzStudio.Windows.ThemedForms.TextBox(); + this.button2 = new RyzStudio.Windows.ThemedForms.Button(); + this.label2 = new System.Windows.Forms.Label(); + this.horizontalSeparator1 = new RyzStudio.Windows.Forms.HorizontalSeparator(); + this.SuspendLayout(); + // + // textBox1 + // + 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.Location = new System.Drawing.Point(96, 15); + this.textBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); + this.textBox1.Name = "textBox1"; + this.textBox1.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9); + this.textBox1.Size = new System.Drawing.Size(276, 32); + this.textBox1.SubmitButton = this.button2; + this.textBox1.TabIndex = 0; + this.textBox1.UseSystemPasswordChar = false; + this.textBox1.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.textBox1_PreviewKeyDown); + // + // button2 + // + this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.button2.BackColor = System.Drawing.Color.Transparent; + this.button2.DefaultImage = null; + this.button2.DownImage = null; + this.button2.LabelText = "&OK"; + this.button2.Location = new System.Drawing.Point(264, 77); + this.button2.Name = "button2"; + this.button2.OverImage = null; + this.button2.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + this.button2.Size = new System.Drawing.Size(108, 32); + this.button2.TabIndex = 1; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 25); + this.label2.Margin = new System.Windows.Forms.Padding(3); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(34, 13); + this.label2.TabIndex = 67; + this.label2.Text = "Name"; + // + // horizontalSeparator1 + // + this.horizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.horizontalSeparator1.Location = new System.Drawing.Point(12, 62); + this.horizontalSeparator1.Margin = new System.Windows.Forms.Padding(3, 10, 3, 10); + this.horizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2); + this.horizontalSeparator1.Name = "horizontalSeparator1"; + this.horizontalSeparator1.Size = new System.Drawing.Size(360, 2); + this.horizontalSeparator1.TabIndex = 69; + // + // TextBoxForm + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(384, 121); + this.Controls.Add(this.button2); + this.Controls.Add(this.horizontalSeparator1); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.label2); + this.Font = new System.Drawing.Font("Tahoma", 8.25F); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(400, 160); + this.Name = "TextBoxForm"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Text = "New Session"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private RyzStudio.Windows.ThemedForms.TextBox textBox1; + private System.Windows.Forms.Label label2; + private RyzStudio.Windows.Forms.HorizontalSeparator horizontalSeparator1; + private RyzStudio.Windows.ThemedForms.Button button2; + } +} \ No newline at end of file diff --git a/RyzStudio/Windows/ThemedForms/TextBoxForm.cs b/RyzStudio/Windows/ThemedForms/TextBoxForm.cs new file mode 100644 index 0000000..f72c5da --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/TextBoxForm.cs @@ -0,0 +1,99 @@ +using System; +using System.ComponentModel; +using System.Windows.Forms; + +namespace RyzStudio.Windows.ThemedForms +{ + public partial class TextBoxForm : System.Windows.Forms.Form + { + protected bool returnValue = false; + + public TextBoxForm(string title, string labelText, string defaultValue) + { + InitializeComponent(); + + textBox1.PreviewKeyDown += textBox1_PreviewKeyDown; + textBox1.InnerTextBox.PreviewKeyDown += textBox1_PreviewKeyDown; + + this.Text = title; + label2.Text = labelText; + textBox1.Text = defaultValue; + } + + public TextBoxForm(string title, string labelText, string defaultValue, bool password) + { + InitializeComponent(); + + textBox1.PreviewKeyDown += textBox1_PreviewKeyDown; + textBox1.InnerTextBox.PreviewKeyDown += textBox1_PreviewKeyDown; + + this.Text = title; + label2.Text = labelText; + textBox1.Text = defaultValue; + textBox1.UseSystemPasswordChar = password; + + } + + public TextBoxForm(string title, string labelText) + { + InitializeComponent(); + + textBox1.PreviewKeyDown += textBox1_PreviewKeyDown; + textBox1.InnerTextBox.PreviewKeyDown += textBox1_PreviewKeyDown; + + this.Text = title; + label2.Text = labelText; + } + + public TextBoxForm(string title, string labelText, bool password) + { + InitializeComponent(); + + textBox1.PreviewKeyDown += textBox1_PreviewKeyDown; + textBox1.InnerTextBox.PreviewKeyDown += textBox1_PreviewKeyDown; + + this.Text = title; + label2.Text = labelText; + textBox1.UseSystemPasswordChar = password; + } + + protected override void OnClosing(CancelEventArgs e) + { + base.OnClosing(e); + + if (!returnValue) + { + textBox1.Text = string.Empty; + } + } + + private void button2_Click(object sender, EventArgs e) + { + returnValue = true; + + this.Close(); + } + + private void textBox1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) + { + switch (e.KeyCode) + { + case Keys.Escape: + textBox1.Text = string.Empty; + this.Close(); + break; + default: break; + } + } + + public new string ShowDialog() + { + returnValue = false; + + base.ShowDialog(); + + return textBox1.Text; + } + + } +} \ No newline at end of file diff --git a/NewSessionForm.resx b/RyzStudio/Windows/ThemedForms/TextBoxForm.resx similarity index 73% rename from NewSessionForm.resx rename to RyzStudio/Windows/ThemedForms/TextBoxForm.resx index f427d71..d58980a 100644 --- a/NewSessionForm.resx +++ b/RyzStudio/Windows/ThemedForms/TextBoxForm.resx @@ -117,29 +117,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAB0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3//Pz8//w8PD/6urq//z8/P/29vb/9PT0/5iYmJEAAAAgAAAAAAAA - AAAAAAA2+/v7/fT09P/19fX/9fX1//X19f/x8fH/7+/v/+np6f/8/Pz/5+fn/5SUlJEAAAAgAAAAAgAA - AAAAAAAAAAAAM/j4+PD7+/v9/Pz8//z8/P/8/Pz//Pz8//z8/P/8/Pz/+Pj4/5OTk5EAAAAgAAAAAgAA - AAAAAAAAAAAAAAAAABwAAAAzAAAANgAAADYAAAA2AAAANgAAADYAAAA2AAAANgAAADYAAAAgAAAAAgAA - AAAAAAAAwACsQcAArEGAAKxBgACsQYAArEGAAKxBgACsQQAArEEAAKxBAACsQYAArEGAAKxBgACsQcAA - rEHAAaxBwAOsQQ== - - \ No newline at end of file diff --git a/RyzStudio/Windows/ThemedForms/ThemeStyle.cs b/RyzStudio/Windows/ThemedForms/ThemeStyle.cs new file mode 100644 index 0000000..71d1dee --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/ThemeStyle.cs @@ -0,0 +1,34 @@ +namespace RyzStudio.Windows.ThemedForms +{ + using System.Drawing; + + public struct ThemeStyle + { + public int BorderWidth; + public int BorderRadius; + public int BorderPadding; + public Color BorderColour; + public Color BackColour; + public Color ForeColour; + + public ThemeStyle(int borderWidth, int borderRadius, int borderPadding, Color borderColour, Color backColour) + { + this.BorderWidth = borderWidth; + this.BorderRadius = borderRadius; + this.BorderPadding = borderPadding; + this.BorderColour = borderColour; + this.BackColour = backColour; + this.ForeColour = Color.Black; + } + + public ThemeStyle(int borderWidth, int borderRadius, int borderPadding, Color borderColour, Color backColour, Color foreColour) + { + this.BorderWidth = borderWidth; + this.BorderRadius = borderRadius; + this.BorderPadding = borderPadding; + this.BorderColour = borderColour; + this.BackColour = backColour; + this.ForeColour = foreColour; + } + } +} diff --git a/RyzStudio/Windows/ThemedForms/UserControl.cs b/RyzStudio/Windows/ThemedForms/UserControl.cs new file mode 100644 index 0000000..2bb47f2 --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/UserControl.cs @@ -0,0 +1,54 @@ +namespace RyzStudio.Windows.ThemedForms +{ + using System; + using System.Drawing; + using System.Windows.Forms; + using RyzStudio.Drawing; + using System.ComponentModel; + + public partial class UserControl : System.Windows.Forms.UserControl + { + //protected ThemeStyle styleActive = new ThemeStyle(1, 3, 2, Color.FromArgb(112, 112, 112), Color.White); + protected ThemeStyle styleActive = new ThemeStyle(1, 3, 2, Color.FromArgb(212, 212, 212), Color.White); + + public UserControl() + { + InitializeComponent(); + } + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + + this.BackColor = Color.Transparent; + } + + + protected override void OnPaintBackground(PaintEventArgs e) + { + base.OnPaintBackground(e); + + Graphics g = e.Graphics; + //// g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; + //// g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; + //// g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; + //// g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + + updateBackground(g, styleActive); + } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new Padding Padding { get { return base.Padding; } set { base.Padding = value; } } + + protected virtual void updateBackground(Graphics g, ThemeStyle style) + { + int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding; + + this.Padding = new Padding(b, b, (b - 1), (b - 1)); + + Rectangoid area = new Rectangoid(this.ClientRectangle, style.BorderRadius, style.BorderWidth); + g.FillPath(new SolidBrush(style.BackColour), area.ToGraphicsPath()); + g.DrawPath(new Pen(new SolidBrush(style.BorderColour), style.BorderWidth), area.ToGraphicsPath()); + } + } +} \ No newline at end of file diff --git a/BookmarkTreeView.Designer.cs b/RyzStudio/Windows/ThemedForms/UserControl.designer.cs similarity index 80% rename from BookmarkTreeView.Designer.cs rename to RyzStudio/Windows/ThemedForms/UserControl.designer.cs index a085fe3..ea91b3c 100644 --- a/BookmarkTreeView.Designer.cs +++ b/RyzStudio/Windows/ThemedForms/UserControl.designer.cs @@ -1,13 +1,13 @@ -namespace bzit.bomg +namespace RyzStudio.Windows.ThemedForms { - partial class BookmarkTreeView + partial class UserControl { - /// + /// /// Required designer variable. /// private System.ComponentModel.IContainer components = null; - /// + /// /// Clean up any resources being used. /// /// true if managed resources should be disposed; otherwise, false. @@ -22,13 +22,14 @@ namespace bzit.bomg #region Component Designer generated code - /// - /// Required method for Designer support - do not modify + /// + /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; } #endregion diff --git a/SessionFileFormat.cs b/SessionFileFormat.cs deleted file mode 100644 index d9d8fb0..0000000 --- a/SessionFileFormat.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System.Xml; -using System.Windows.Forms; - -namespace bzit.bomg -{ - public class SessionFileFormat : RyzStudio.IO.SessionFileFormatBase - { - private MainForm parentForm = null; - - public SessionFileFormat(MainForm parent_form) - { - base.CONST_PRODUCT = "bomg"; - base.CONST_STREAM_FILE_NAME = "bookmarks.xml"; - base.CONST_KEYPASS = ""; - base.enableErrorReporting = true; - - parentForm = parent_form; - } - - protected override void loadFromXmlDocument(ref XmlDocument xml_doc) - { - XmlNodeList xnl = xml_doc.SelectNodes("bomg/b/g"); - if (xnl.Count <= 0) - { - MessageBox.Show("No bookmarks found.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return; - } - - parentForm.treeView1.Clear(); - TreeNode tn = parentForm.treeView1.Nodes.Add("", xnl.Item(0).Attributes["name"].InnerText, 0, 0); - foreach (XmlNode xn in xnl.Item(0)) - { - BookmarkItem bi = new BookmarkItem(); - - foreach (XmlNode xn2 in xn.ChildNodes) - { - switch (xn2.LocalName) - { - case "name": - bi.Fullpath = xn2.InnerText?.Trim(); - break; - case "address": - bi.SiteAddress = xn2.InnerText?.Trim(); - break; - case "description": - bi.Description = xn2.InnerText?.Trim(); - break; - case "created": - bi.Created = xn2.InnerText?.Trim(); - break; - default: break; - } - } - - parentForm.treeView1.AddBookmarkItem(bi.Fullpath, bi); - } - - tn.Expand(); - } - - protected override void saveToXmlTextWriter(ref XmlTextWriter writer) - { - if (parentForm.treeView1.Nodes.Count <= 0) - { - return; - } - - writer.Formatting = Formatting.Indented; - writer.WriteStartDocument(); - writer.WriteStartElement(CONST_PRODUCT); - writer.WriteStartElement("b"); - writer.WriteStartElement("g"); - writer.WriteAttributeString("name", parentForm.treeView1.Nodes[0].Text); - - foreach (TreeNode tn in parentForm.treeView1.NodeList) - { - BookmarkItem bi = (BookmarkItem)tn.Tag; - - writer.WriteStartElement("m"); - writer.WriteElementString("name", parentForm.treeView1.GetNodeFullPath(tn)); - writer.WriteElementString("address", bi.SiteAddress); - writer.WriteElementString("description", bi.Description); - writer.WriteElementString("created", bi.Created.ToString()); - writer.WriteEndElement(); - } - - writer.WriteEndElement(); - writer.WriteEndElement(); - writer.WriteEndElement(); - writer.WriteEndDocument(); - } - } -} \ No newline at end of file diff --git a/UpdateIconForm.Designer.cs b/UpdateIconForm.Designer.cs deleted file mode 100644 index ba005c6..0000000 --- a/UpdateIconForm.Designer.cs +++ /dev/null @@ -1,144 +0,0 @@ -namespace bzit.bomg -{ - partial class UpdateIconForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UpdateIconForm)); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.oToolTip = new System.Windows.Forms.ToolTip(this.components); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.progressBar1 = new System.Windows.Forms.ProgressBar(); - this.btnRun = new RyzStudio.Windows.Forms.BigButton(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 12); - this.label1.Margin = new System.Windows.Forms.Padding(3); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(45, 13); - this.label1.TabIndex = 0; - this.label1.Text = "Entries:"; - // - // label2 - // - this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label2.Location = new System.Drawing.Point(15, 59); - this.label2.Margin = new System.Windows.Forms.Padding(3); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(277, 13); - this.label2.TabIndex = 4; - this.label2.Text = "0/0"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // oToolTip - // - this.oToolTip.Active = false; - this.oToolTip.BackColor = System.Drawing.Color.IndianRed; - // - // pictureBox1 - // - this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.pictureBox1.BackColor = System.Drawing.Color.Transparent; - this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; - this.pictureBox1.ErrorImage = null; - this.pictureBox1.InitialImage = null; - this.pictureBox1.Location = new System.Drawing.Point(12, 77); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(32, 32); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; - this.pictureBox1.TabIndex = 60; - this.pictureBox1.TabStop = false; - // - // progressBar1 - // - 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.White; - this.progressBar1.Location = new System.Drawing.Point(12, 31); - this.progressBar1.Name = "progressBar1"; - this.progressBar1.Size = new System.Drawing.Size(280, 22); - this.progressBar1.Step = 1; - this.progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous; - this.progressBar1.TabIndex = 61; - // - // btnRun - // - this.btnRun.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnRun.BackColor = System.Drawing.Color.WhiteSmoke; - this.btnRun.Location = new System.Drawing.Point(196, 77); - this.btnRun.MaximumSize = new System.Drawing.Size(120, 32); - this.btnRun.MinimumSize = new System.Drawing.Size(32, 32); - this.btnRun.Name = "btnRun"; - this.btnRun.Padding = new System.Windows.Forms.Padding(4); - this.btnRun.Size = new System.Drawing.Size(96, 32); - this.btnRun.TabIndex = 3; - this.btnRun.Value = "&Run"; - this.btnRun.Click += new System.EventHandler(this.btnRun_Click); - // - // UpdateIconForm - // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; - this.BackColor = System.Drawing.Color.White; - this.ClientSize = new System.Drawing.Size(304, 121); - this.Controls.Add(this.progressBar1); - this.Controls.Add(this.pictureBox1); - this.Controls.Add(this.label1); - this.Controls.Add(this.btnRun); - this.Controls.Add(this.label2); - this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "UpdateIconForm"; - this.ShowInTaskbar = false; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Update Icons"; - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.ToolTip oToolTip; - private RyzStudio.Windows.Forms.BigButton btnRun; - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.ProgressBar progressBar1; - } -} \ No newline at end of file diff --git a/UpdateIconForm.cs b/UpdateIconForm.cs deleted file mode 100644 index e8dbec9..0000000 --- a/UpdateIconForm.cs +++ /dev/null @@ -1,121 +0,0 @@ -using System; -using System.ComponentModel; -using System.Windows.Forms; - -namespace bzit.bomg -{ - public partial class UpdateIconForm : Form - { - private MainForm parentForm = null; - private BackgroundWorker mainThread = null; - - public UpdateIconForm(MainForm parent) - { - InitializeComponent(); - - parentForm = parent; - - this.StartPosition = FormStartPosition.WindowsDefaultLocation; - - mainThread = new BackgroundWorker(); - mainThread.WorkerReportsProgress = mainThread.WorkerSupportsCancellation = true; - mainThread.DoWork += mainThread_DoWork; - mainThread.RunWorkerCompleted += mainThread_OnCompleted; - } - - protected override void OnShown(EventArgs e) - { - base.OnShown(e); - - int nodeCount = (int)parentForm.treeView1.NodeCountCalc; - progressBar1.Minimum = 0; - progressBar1.Value = 0; - progressBar1.Maximum = nodeCount; - - label2.Text = string.Concat("0", "/", nodeCount.ToString()); - } - - protected override void OnClosing(CancelEventArgs e) - { - base.OnClosing(e); - - if (mainThread.IsBusy) - { - e.Cancel = true; - } - } - - private void btnRun_Click(object sender, EventArgs e) - { - if (mainThread.IsBusy) - { - return; - } - - btnRun.Enabled = false; - pictureBox1.Image = Properties.Resources.aniZomq2x32; - mainThread.RunWorkerAsync(); - } - - private void mainThread_DoWork(object sender, DoWorkEventArgs e) - { - TreeNode[] nodeList = parentForm.treeView1.NodeList; - for (int i=0; i< nodeList.Length; i++) - { - if (progressBar1.InvokeRequired) - { - progressBar1.Invoke(new Action(() => progressBar1.Value = (i + 1) )); - } - else - { - progressBar1.Value = (i + 1); - } - - if (label2.InvokeRequired) - { - label2.Invoke(new Action(() => label2.Text = string.Concat((i + 1).ToString(), "/", progressBar1.Maximum.ToString()))); - } - else - { - label2.Text = string.Concat((i + 1).ToString(), "/", progressBar1.Maximum.ToString()); - } - - TreeNode node = nodeList[i]; - if (node == null) - { - continue; - } - - if (node.Tag == null) - { - continue; - } - - if (!(node.Tag is BookmarkItem)) - { - continue; - } - - BookmarkItem bookmarkItem = (BookmarkItem)node.Tag; - if (bookmarkItem == null) - { - continue; - } - - bookmarkItem.GetFaviconAddress(); - if (bookmarkItem.IconData == null) - { - continue; - } - - parentForm.treeView1.AddIcon(bookmarkItem); - } - } - - private void mainThread_OnCompleted(object sender, RunWorkerCompletedEventArgs e) - { - pictureBox1.Image = null; - btnRun.Enabled = true; - } - } -} \ No newline at end of file diff --git a/UpdateIconsForm.Designer.cs b/UpdateIconsForm.Designer.cs new file mode 100644 index 0000000..771436b --- /dev/null +++ b/UpdateIconsForm.Designer.cs @@ -0,0 +1,174 @@ +namespace bzit.bomg +{ + partial class UpdateIconsForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.label5 = new System.Windows.Forms.Label(); + this.button1 = new RyzStudio.Windows.ThemedForms.Button(); + this.button2 = new RyzStudio.Windows.ThemedForms.Button(); + this.horizontalSeparator1 = new RyzStudio.Windows.Forms.HorizontalSeparator(); + this.progressBar1 = new RyzStudio.Windows.ThemedForms.ProgressBar(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 25); + this.label1.Margin = new System.Windows.Forms.Padding(3); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(34, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Icons"; + // + // pictureBox1 + // + this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.pictureBox1.BackColor = System.Drawing.Color.Transparent; + this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; + this.pictureBox1.ErrorImage = null; + this.pictureBox1.InitialImage = null; + this.pictureBox1.Location = new System.Drawing.Point(112, 77); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(32, 32); + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; + this.pictureBox1.TabIndex = 60; + this.pictureBox1.TabStop = false; + // + // label5 + // + this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label5.ForeColor = System.Drawing.Color.OrangeRed; + this.label5.Location = new System.Drawing.Point(9, 77); + this.label5.Margin = new System.Windows.Forms.Padding(3); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(97, 32); + this.label5.TabIndex = 64; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // button1 + // + 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.DefaultImage = null; + this.button1.DownImage = null; + this.button1.LabelText = "&Update"; + this.button1.Location = new System.Drawing.Point(150, 77); + this.button1.Name = "button1"; + this.button1.OverImage = null; + this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + this.button1.Size = new System.Drawing.Size(108, 32); + this.button1.TabIndex = 1; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.button2.BackColor = System.Drawing.Color.Transparent; + this.button2.DefaultImage = null; + this.button2.DownImage = null; + this.button2.LabelText = "&Close"; + this.button2.Location = new System.Drawing.Point(264, 77); + this.button2.Name = "button2"; + this.button2.OverImage = null; + this.button2.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + this.button2.Size = new System.Drawing.Size(108, 32); + this.button2.TabIndex = 4; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // horizontalSeparator1 + // + this.horizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.horizontalSeparator1.Location = new System.Drawing.Point(12, 62); + this.horizontalSeparator1.Margin = new System.Windows.Forms.Padding(3, 10, 3, 10); + this.horizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2); + this.horizontalSeparator1.Name = "horizontalSeparator1"; + this.horizontalSeparator1.Size = new System.Drawing.Size(360, 2); + this.horizontalSeparator1.TabIndex = 65; + // + // progressBar1 + // + 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.BarColour = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(225)))), ((int)(((byte)(249))))); + this.progressBar1.BarTextColour = System.Drawing.SystemColors.ControlText; + this.progressBar1.Location = new System.Drawing.Point(96, 15); + this.progressBar1.Margin = new System.Windows.Forms.Padding(3, 10, 3, 10); + this.progressBar1.Maximum = 0; + this.progressBar1.Minimum = 0; + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + this.progressBar1.Size = new System.Drawing.Size(276, 32); + this.progressBar1.TabIndex = 66; + this.progressBar1.Value = 0; + // + // UpdateIconsForm + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(384, 121); + this.Controls.Add(this.progressBar1); + this.Controls.Add(this.horizontalSeparator1); + this.Controls.Add(this.label5); + this.Controls.Add(this.button1); + this.Controls.Add(this.button2); + this.Controls.Add(this.pictureBox1); + this.Controls.Add(this.label1); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "UpdateIconsForm"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Update Favicons"; + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.PictureBox pictureBox1; + private RyzStudio.Windows.ThemedForms.Button button2; + private RyzStudio.Windows.ThemedForms.Button button1; + private System.Windows.Forms.Label label5; + private RyzStudio.Windows.Forms.HorizontalSeparator horizontalSeparator1; + private RyzStudio.Windows.ThemedForms.ProgressBar progressBar1; + } +} \ No newline at end of file diff --git a/UpdateIconsForm.cs b/UpdateIconsForm.cs new file mode 100644 index 0000000..3bc0c29 --- /dev/null +++ b/UpdateIconsForm.cs @@ -0,0 +1,131 @@ +using bzit.bomg.Models; +using RyzStudio.Windows.Forms; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Threading.Tasks; +using System.Windows.Forms; +using Form = System.Windows.Forms.Form; +using Resources = bzit.bomg.Properties.Resources; + +namespace bzit.bomg +{ + public partial class UpdateIconsForm : Form + { + protected bool isBusy = false; + protected bool requestCancel = false; + protected BookmarkItemModel itemModel = null; + protected MainForm parentForm = null; + + public UpdateIconsForm(MainForm mainForm) : base() + { + InitializeComponent(); + + parentForm = mainForm; + + this.StartPosition = FormStartPosition.WindowsDefaultLocation; + } + + protected override void OnClosing(CancelEventArgs e) + { + base.OnClosing(e); + + if (this.IsBusy) + { + e.Cancel = true; + } + } + + protected bool IsBusy + { + get => isBusy; + set + { + isBusy = value; + ThreadControl.SetImage(pictureBox1, (value) ? Resources.aniZomq2x32 : null); + ThreadControl.SetEnable(button2, !value); + } + } + + private async void button1_Click(object sender, EventArgs e) + { + if (this.IsBusy) + { + requestCancel = true; + ThreadControl.SetText(button1, "&Cancelling..."); + return; + } + + this.IsBusy = true; + + await Task.Run(() => + { + ThreadControl.SetText(button1, "&Updating..."); + + if (requestCancel) + { + this.IsBusy = false; + + ThreadControl.SetText(button1, "&Update"); + + requestCancel = false; + return; + } + + List nodeList = parentForm.TreeView.GetBookmarkNodeList(); + + ThreadControl.SetValue(progressBar1, 0, nodeList.Count); + + for (int i = 0; i < nodeList.Count; i++) + { + if (requestCancel) + { + this.IsBusy = false; + + ThreadControl.SetText(button1, "&Update"); + + requestCancel = false; + return; + } + + ThreadControl.SetValue(progressBar1, (i + 1)); + + BookmarkItemViewModel viewModel = (BookmarkItemViewModel)nodeList[i].Tag; + BookmarkItemModel model = viewModel.ToModel(); + bool rv = model.UpdateFavicon(); + if (rv) + { + if (parentForm.TreeView.InvokeRequired) + { + parentForm.TreeView.Invoke(new MethodInvoker(() => + { + parentForm.TreeView.UpdateItem(nodeList[i], model.ToViewModel()); + })); + } + else + { + parentForm.TreeView.UpdateItem(nodeList[i], model.ToViewModel()); + } + } + } + + this.IsBusy = false; + + ThreadControl.SetText(button1, "&Update"); + + requestCancel = false; + }); + } + + private void button2_Click(object sender, EventArgs e) + { + if (this.IsBusy) + { + return; + } + + this.Close(); + } + + } +} \ No newline at end of file diff --git a/UpdateIconForm.resx b/UpdateIconsForm.resx similarity index 72% rename from UpdateIconForm.resx rename to UpdateIconsForm.resx index a6f44d9..d58980a 100644 --- a/UpdateIconForm.resx +++ b/UpdateIconsForm.resx @@ -117,32 +117,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 17 - - - - - AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApisVGJ4jEviWGxMQjhMNNAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAC+Syistj8mlK43I/o7N6/9utuL/P43I/yOEw6wigsIxAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAANZnNFjOXzIUxlMvvgcPl/8z0//+77vr/h9Hk/4nO8P9eo9f/JIXD8yKD - wo0ggcEbAAAAAAAAAAA8odAGOp/PZTicztt8v+D/x+78/8vy/v9k3dD/MtGn/yGpe/80r5D/iMvo/4HA - 6/9SltD/IoPC4CGBwW0ff8EKP6TSu3a83P++5fb/2/b//53o6/8206v/NtKr/1TY0f82t7v/I6mE/yGp - e/9Mtqj/hcXr/3Oy5P9Jj8r/IYLCwUGn0/nn+/7/0PP5/0XXt/841K3/T9nC/43i8v+V4f7/R8Xr/z67 - 4/8vrrD/I6uD/yOsgP9mvsH/gsPs/yOEw/hDqdT3p+3i/0DWsv9I2Ln/i+Tk/7Lq//+s5///e9n+/0fH - 7/9Cw+r/Qr3o/zyy3P8sraj/KLCH/4TTuv8lhsT+RqzV+5Hn1P9/5dj/yPH9/8jv//+56///kdv7/1XA - 8f9Hwfn/Orzw/0bE7P9EvOn/QrTm/zis1P+H0sz/J4nF/0iv1vjb9vj/2fP//9Xz//+86///iNX3/2jJ - 9f9Ls+n/jNr7/4vc//9Hw/n/N7Xs/0e+6P9Ht+f/j9Px/yqMx/pKsdfw4vj9/9Tz//+v5Pr/hc/x/37Q - 9f930PX/S7Dk/6/k+v+16f//muH//3fW/v8/vPX/PLTp/4/V8f8sjsjwTLPY++H4/v/N6/n/kdLt/4PM - 6/9uvuX/VbDb/zqTyP/O7Pr/2fX//7jq//+U3/7/dtX//6Tk//+D3Pv/LpHJ+0622Z9MtNn+pNnt/9Lr - 9f+93u3/lMne/4jC2/9vt9b/abne/4/X9f9+z/X/nNv4/6nj+v+Dyuz/UKXV/zGUy6YAAAAATrbZRk20 - 2cJ9xeD/0e73//b////w/v//y+37/0+s2v+K1/f/qeH5/5TW8v9hsdv/OJzOyDWZzU0AAAAAAAAAAAAA - AABOttoFTbXZZUuz2NuRz+X/5vj8/+P2/v+u3fL/seT3/3G/4f8+o9HgPKHQbDqfzwkAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAABNtdkWTLPYhEqx1++b1er/h8zn/0Sr1fNDqdSMQabTGgAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMs9grSrHYr0mv17xHrdYxAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAA/D+sQfAPrEHAA6xBAACsQQAArEEAAKxBAACsQQAArEEAAKxBAACsQQAArEEAAKxBgAGsQcAD - rEHwD6xB/D+sQQ== - - \ No newline at end of file diff --git a/Windows/Forms/BookmarkTreeView.cs b/Windows/Forms/BookmarkTreeView.cs new file mode 100644 index 0000000..6c9cbba --- /dev/null +++ b/Windows/Forms/BookmarkTreeView.cs @@ -0,0 +1,807 @@ +using bzit.bomg; +using bzit.bomg.Data; +using bzit.bomg.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.Text; +using System.Windows.Forms; +using Resources = bzit.bomg.Properties.Resources; + +namespace RyzStudio.Windows.Forms +{ + public class BookmarkTreeView : System.Windows.Forms.TreeView + { + public enum IconSet + { + Root = 0, + Folder1, + Folder2, + Default + } + + public enum NodeType + { + None = 0, + Root, + Folder, + Page + } + + public BookmarkTreeViewSNode SNode { get; set; } + + public event EventHandler OnNodeChanged = null; + + protected IconDatabase iconDatabase = null; + protected TreeNode draggingNode = null; + protected bool hasChanged = false; + + + public BookmarkTreeView() : base() + { + this.SNode = new BookmarkTreeViewSNode(this); + + if (this.ImageList == null) + { + this.ImageList = new ImageList(); + } + + this.ImageList.ColorDepth = ColorDepth.Depth16Bit; + this.ImageList.ImageSize = new Size(16, 16); + this.ImageList.TransparentColor = Color.Transparent; + + 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); + + this.PathSeparator = "\n"; + } + + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public bool AllowBeginEdit { get; set; } = false; + + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new ImageList ImageList { get => base.ImageList; set => base.ImageList = value; } + + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public bool HasChanged + { + get => hasChanged; + set + { + hasChanged = value; + + OnNodeChanged?.Invoke(null, null); + } + } + + #region public methods + + public bool InitialiseIconDatabase(out string message, string filename) + { + 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; + } + + public TreeNode AddFolder(TreeNode node) => this.AddFolder(node, "New Folder (" + DateTime.Now.ToString("yyyy-MM-dd-HHmmss") + ")"); + + public TreeNode AddFolder(TreeNode node, string name) + { + if (node == null) + { + return null; + } + + if (node.Tag != null) + { + return null; + } + + return node.Nodes.Add(encodePath(name), name, (int)IconSet.Folder1, (int)IconSet.Folder2); + } + + public void AddItem(List viewModelList) + { + this.Clear(); + + if (viewModelList == null) + { + return; + } + + foreach (BookmarkItemViewModel item in viewModelList) + { + AddItem(item); + } + + this.HasChanged = false; + } + + public void AddItem(BookmarkItemViewModel viewModel) + { + int iconIndex = addIcon(viewModel); + + TreeNode tn = new TreeNode(viewModel.SiteName, iconIndex, iconIndex); + tn.Tag = viewModel; + tn.ToolTipText = viewModel.ToString(); + + TreeNode tn2 = addFolderPath(viewModel.TreeviewPath); + + ThreadControl.Add(tn2, tn); + + this.HasChanged = true; + } + + public void AddItem(TreeNode treeNode, BookmarkItemViewModel viewModel) + { + if (treeNode == null) + { + return; + } + + int iconIndex = addIcon(viewModel); + + TreeNode tn = new TreeNode(viewModel.SiteName, iconIndex, iconIndex); + tn.Tag = viewModel; + tn.ToolTipText = viewModel.ToString(); + + treeNode.Nodes.Add(tn); + + this.HasChanged = true; + } + + public void AddOrUpdateItem(TreeNode treeNode, BookmarkItemViewModel viewModel) + { + switch (this.GetNodeType(treeNode)) + { + case NodeType.Root: + case NodeType.Folder: + AddItem(treeNode, viewModel); + break; + case NodeType.Page: + UpdateItem(treeNode, viewModel); + break; + default: + break; + } + } + + public void Clear() + { + ThreadControl.Clear(this); + + this.HasChanged = true; + } + + public void Clear(string name) + { + this.Nodes.Clear(); + this.Nodes.Add("", name?.Trim(), (int)IconSet.Root, (int)IconSet.Root); + + this.HasChanged = true; + } + + public void CloseIconDatabase() + { + iconDatabase.Close(); + } + + public int CountBookmarkItem() + { + int itemCount = 0; + + if (this.Nodes.Count <= 0) + { + return itemCount; + } + + foreach (TreeNode item in this.Nodes) + { + traverseBookmarkList(ref itemCount, item); + } + + return itemCount; + } + + + public NodeType GetNodeType(TreeNode node) + { + if (node.Tag == null) + { + if (node.Equals(this.Nodes[0])) + { + return NodeType.Root; + } + else + { + return NodeType.Folder; + } + } + else + { + if (node.Tag is BookmarkItemViewModel) + { + return NodeType.Page; + } + else + { + return NodeType.None; + } + } + } + + public 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 BookmarkItemViewModel GetViewModel(TreeNode node) => (BookmarkItemViewModel)node.Tag; + + 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 List GetBookmarkNodeList() + { + 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) + { + if (node == null) + { + return false; + } + + if (this.Nodes.Count <= 0) + { + return false; + } + + bool rt = false; + bool inclusive = false; + TreeNode tn = node; + while (true) + { + if (tn == null) + { + 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; + } + else + { + if (tn.NextNode != null) + { + tn = tn.NextNode; + inclusive = true; + } + else + { + while (true) + { + tn = tn.Parent; + if (tn == null) + { + break; + } + + if (tn.NextNode != null) + { + tn = tn.NextNode; + break; + } + } + + inclusive = true; + } + } + } + + return rt; + } + + public void UpdateItem(TreeNode treeNode, BookmarkItemViewModel viewModel) + { + if (treeNode == null) + { + return; + } + + int iconIndex = addIcon(viewModel); + + treeNode.Text = viewModel.SiteName; + treeNode.ImageIndex = iconIndex; + treeNode.SelectedImageIndex = iconIndex; + treeNode.Tag = viewModel; + treeNode.ToolTipText = viewModel.ToString(); + + this.HasChanged = true; + } + + #endregion + + #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 en = this.GetNodeAt(this.PointToClient(new Point(e.X, e.Y))); + if (en == null) + { + return; + } + + if (isNodeChild(draggingNode, en)) + { + return; + } + + TreeNode dn = draggingNode; + if (en.Tag == null) + { + dn.Parent.Nodes.Remove(dn); + en.Nodes.Insert(0, dn); + } + else + { + en.Parent.Nodes.Remove(dn); + en.Parent.Nodes.Insert(en.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 OnPreviewKeyDown(PreviewKeyDownEventArgs e) + { + TreeNode tn = this.SelectedNode; + if (tn == null) + { + return; + } + + NodeType nodeType = this.SNode.GetNodeType(); + + switch (e.KeyCode) + { + case Keys.Insert: + if (e.Modifiers == Keys.Shift) + { + if ((nodeType == NodeType.Root) || (nodeType == NodeType.Folder)) + { + this.SelectedNode = this.SNode.AddFolder(); + } + else if (nodeType == NodeType.Page) + { + this.SelectedNode = tn.Parent; + this.SelectedNode = this.SNode.AddFolder(); + } + } + + break; + case Keys.Delete: + if (!tn.IsEditing) + { + this.SNode.Delete(); + } + + break; + case Keys.F2: + if ((nodeType == NodeType.Root) || (nodeType == NodeType.Folder)) + { + this.AllowBeginEdit = true; + + this.SNode.Edit(); + } + + break; + case Keys.F3: + switch (nodeType) + { + case NodeType.Root: + case NodeType.Folder: + try + { + Clipboard.SetText(tn.Text ?? string.Empty); + } + catch + { + } + + break; + case NodeType.Page: + BookmarkItemViewModel viewModel = this.SNode.GetViewModel(); + if (viewModel != null) + { + try + { + Clipboard.SetText(viewModel.SiteAddress ?? string.Empty); + } + catch + { + } + } + + break; + default: + break; + } + + break; + case Keys.Up: + if (e.Modifiers == Keys.Control) + { + this.SNode.MoveUp(); + this.HasChanged = true; + } + + break; + case Keys.Down: + if (e.Modifiers == Keys.Control) + { + this.SNode.MoveDown(); + this.HasChanged = true; + } + + break; + default: break; + } + + base.OnPreviewKeyDown(e); + } + + #endregion + + protected int addIcon(BookmarkItemViewModel viewModel) => addIcon(viewModel.ToModel()); + + protected int addIcon(BookmarkItemModel model) + { + if (this.ImageList.Images.ContainsKey(model.SiteAddress)) + { + return this.ImageList.Images.IndexOfKey(model.SiteAddress); + } + + if (iconDatabase.HasIcon(model.SiteAddress)) + { + Image rs = iconDatabase.GetIcon(model.SiteAddress); + if (rs == null) + { + return (int)IconSet.Default; + } + else + { + ThreadControl.Add(this, this.ImageList, model.SiteAddress, rs); + + return this.ImageList.Images.IndexOfKey(model.SiteAddress); + } + } + + byte[] rawData; + Bitmap bmp = model.RetrieveFavicon(out rawData); + if (bmp == null) + { + return (int)IconSet.Default; + } + + ThreadControl.Add(this, this.ImageList, model.SiteAddress, bmp); + + iconDatabase.AddIcon(model.SiteAddress, rawData); + + return this.ImageList.Images.IndexOfKey(model.SiteAddress); + } + + 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 System.Web.HttpUtility.UrlDecode(value); + + protected string encodePath(string value) => System.Web.HttpUtility.UrlEncode(value); + + protected void traverseBookmarkList(List rs, TreeNode node) + { + foreach (TreeNode tn in node.Nodes) + { + NodeType nodeType = this.GetNodeType(tn); + if (nodeType == NodeType.Folder) + { + traverseBookmarkList(rs, tn); + } + else if (nodeType == NodeType.Page) + { + BookmarkItemViewModel nodeTag = this.GetViewModel(tn); + nodeTag.TreeviewPath = this.GetNodePath(tn); + + if (nodeTag != null) + { + rs.Add(nodeTag); + } + } + } + } + + protected void traverseBookmarkList(List rs, TreeNode node) + { + foreach (TreeNode tn in node.Nodes) + { + NodeType nodeType = this.GetNodeType(tn); + if (nodeType == NodeType.Folder) + { + traverseBookmarkList(rs, tn); + } + else if (nodeType == NodeType.Page) + { + BookmarkItemViewModel nodeTag = this.GetViewModel(tn); + nodeTag.TreeviewPath = this.GetNodePath(tn); + + if (nodeTag != null) + { + rs.Add(tn); + } + } + } + } + + protected void traverseBookmarkList(ref int itemCount, TreeNode node) + { + foreach (TreeNode tn in node.Nodes) + { + NodeType nodeType = this.GetNodeType(tn); + if (nodeType == NodeType.Folder) + { + traverseBookmarkList(ref itemCount, tn); + } + else if (nodeType == NodeType.Page) + { + itemCount++; + } + } + } + + protected bool isNodeChild(TreeNode drag_node, TreeNode drop_node) + { + TreeNode tn = drop_node; + while (true) + { + if (tn.Parent == null) + { + break; + } + + if (tn.Equals(drag_node)) + { + return true; + } + + tn = tn.Parent; + } + + return false; + } + + } +} \ No newline at end of file diff --git a/Windows/Forms/BookmarkTreeViewSNode.cs b/Windows/Forms/BookmarkTreeViewSNode.cs new file mode 100644 index 0000000..efd9dc0 --- /dev/null +++ b/Windows/Forms/BookmarkTreeViewSNode.cs @@ -0,0 +1,202 @@ +using bzit.bomg.Models; +using System; +using System.Windows.Forms; +using static RyzStudio.Windows.Forms.BookmarkTreeView; + +namespace RyzStudio.Windows.Forms +{ + public class BookmarkTreeViewSNode + { + protected BookmarkTreeView Treeview = null; + + public BookmarkTreeViewSNode(BookmarkTreeView treeview) + { + Treeview = treeview; + } + + protected TreeNode SelectedNode + { + get => this.Treeview.SelectedNode; + set => this.Treeview.SelectedNode = value; + } + + public TreeNode AddFolder() => this.Treeview.AddFolder(this.SelectedNode); + + public TreeNode AddFolder(string name) => this.Treeview.AddFolder(this.SelectedNode, name); + + public TreeNode AddItem(string name, object tag) + { + if (this.SelectedNode == null) + { + return null; + } + + if (this.SelectedNode.Tag != null) + { + return null; + } + + TreeNode tn = new TreeNode(name, (int)BookmarkTreeView.IconSet.Default, (int)BookmarkTreeView.IconSet.Default); + tn.Tag = tag; + + this.SelectedNode.Nodes.Add(tn); + + return tn; + } + + public void AddOrUpdateItem(BookmarkItemViewModel viewModel) + { + switch (this.GetNodeType()) + { + case NodeType.Root: + case NodeType.Folder: + Treeview.AddItem(this.SelectedNode, viewModel); + break; + case NodeType.Page: + Treeview.UpdateItem(this.SelectedNode, viewModel); + break; + default: + break; + } + } + + public void Delete() + { + if (this.SelectedNode == null) + { + return; + } + + if (this.Treeview.Nodes.Count <= 0) + { + return; + } + + if (this.SelectedNode.Equals(this.Treeview.Nodes[0])) + { + return; + } + + this.SelectedNode.Remove(); + } + + public void Edit() + { + if (this.SelectedNode == null) + { + return; + } + + if (this.SelectedNode.IsEditing) + { + return; + } + + switch (this.GetNodeType()) + { + case BookmarkTreeView.NodeType.Root: + case BookmarkTreeView.NodeType.Folder: + this.Treeview.AllowBeginEdit = true; + this.SelectedNode.BeginEdit(); + break; + case BookmarkTreeView.NodeType.Page: + this.Treeview.AllowBeginEdit = true; + this.SelectedNode.BeginEdit(); + break; + default: + break; + } + } + + public bool FindTextNode(string term) => this.Treeview.FindTextNode(this.SelectedNode, term); + + public BookmarkTreeView.NodeType GetNodeType() => this.Treeview.GetNodeType(this.SelectedNode); + + public BookmarkItemViewModel GetViewModel() => this.Treeview.GetViewModel(this.SelectedNode); + + public void MoveDown() + { + if (this.SelectedNode == null) + { + return; + } + + TreeNode tn = this.SelectedNode; + 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); + + this.SelectedNode = tn; + } + + public void MoveUp() + { + if (this.SelectedNode == null) + { + return; + } + + TreeNode tn = this.SelectedNode; + 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); + + this.SelectedNode = tn; + } + + public void Sort() + { + if (this.SelectedNode == null) + { + return; + } + + string[] tnv = new string[0]; + TreeNode[] tna = new TreeNode[0]; + + foreach (TreeNode tn2 in this.SelectedNode.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); + + this.SelectedNode.Nodes.Clear(); + + foreach (TreeNode tn2 in tna) + { + this.SelectedNode.Nodes.Add(tn2); + } + } + + } +} diff --git a/bomg-2.ico b/bomg-2.ico deleted file mode 100644 index 91a99b0..0000000 Binary files a/bomg-2.ico and /dev/null differ diff --git a/bomg-4.ico b/bomg-4.ico deleted file mode 100644 index b8eef31..0000000 Binary files a/bomg-4.ico and /dev/null differ diff --git a/bomg.csproj b/bomg.csproj index dabf678..288d65c 100644 --- a/bomg.csproj +++ b/bomg.csproj @@ -10,7 +10,7 @@ Properties bzit.bomg bomg - v4.6.2 + v4.7.2 512 @@ -55,7 +55,7 @@ - bomg-4.ico + bomg2.ico LocalIntranet @@ -77,18 +77,24 @@ bin\Release\ false + + false + - - packages\HtmlAgilityPack.1.11.2\lib\Net45\HtmlAgilityPack.dll + + packages\HtmlAgilityPack.1.11.24\lib\Net45\HtmlAgilityPack.dll - - packages\SharpZipLib.1.1.0\lib\net45\ICSharpCode.SharpZipLib.dll + + packages\SharpZipLib.1.2.0\lib\net45\ICSharpCode.SharpZipLib.dll + + + packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - packages\System.Data.SQLite.Core.1.0.110.0\lib\net46\System.Data.SQLite.dll + + packages\System.Data.SQLite.Core.1.0.113.1\lib\net46\System.Data.SQLite.dll @@ -96,15 +102,76 @@ - - + Form - - UpdateIconForm.cs + + LoadBookmarksForm.cs - - + + Form + + + UpdateIconsForm.cs + + + + + + + UserControl + + + HorizontalSeparator.cs + + + UserControl + + + MemoBox.cs + + + UserControl + + + TextBox.cs + + + UserControl + + + Button.cs + + + + + Form + + + Form.cs + + + UserControl + + + ProgressBar.cs + + + UserControl + + + ProgressBarInner.cs + + + + UserControl + + + UserControl.cs + + + + Form @@ -117,19 +184,12 @@ FindForm.cs - + Form - - NewSessionForm.cs + + TextBoxForm.cs - - Form - - - PasswordForm.cs - - @@ -142,30 +202,32 @@ - - - UserControl - - - BigButton.cs - - - UserControl - - - BigUserControl.cs - - + Component - - Component - - - BookmarkTreeView.cs - - - UpdateIconForm.cs + + LoadBookmarksForm.cs + + + UpdateIconsForm.cs + + + MemoBox.cs + + + TextBox.cs + + + Button.cs + + + Form.cs + + + ProgressBar.cs + + + ProgressBarInner.cs BookmarkEditForm.cs @@ -173,11 +235,8 @@ FindForm.cs - - NewSessionForm.cs - - - PasswordForm.cs + + TextBoxForm.cs ResXFileCodeGenerator @@ -192,9 +251,6 @@ MainForm.cs - - BigButton.cs - SettingsSingleFileGenerator @@ -207,21 +263,24 @@ - - - - + + + + + + + + + + + + + + + - - - - - - - - @@ -247,12 +306,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - +