commit 7c95b06064c5f49889f073953af9c4d75d31727a Author: Ray Date: Sun Jul 30 12:59:34 2017 +0100 0.2.0.082 beta (12/01/2017) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..be8a03f --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +/skye.sln +/bomg.csproj.user +/bin +/obj +/packages +/.vs/skye/v14/*.suo diff --git a/BookmarkEditForm.Designer.cs b/BookmarkEditForm.Designer.cs new file mode 100644 index 0000000..fe91676 --- /dev/null +++ b/BookmarkEditForm.Designer.cs @@ -0,0 +1,224 @@ +namespace bzit.bomg +{ + partial class BookmarkEditForm + { + /// + /// 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(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) + | 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 = 0; + 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) + | 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 = 1; + 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) + | 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 = 4; + 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 = 3; + 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(); + + } + + #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 pictureBox1; + private RyzStudio.Windows.Forms.BigButton button1; + } +} \ No newline at end of file diff --git a/BookmarkEditForm.cs b/BookmarkEditForm.cs new file mode 100644 index 0000000..25f3c02 --- /dev/null +++ b/BookmarkEditForm.cs @@ -0,0 +1,192 @@ +using System; +using System.ComponentModel; +using System.Windows.Forms; + +namespace bzit.bomg +{ + public partial class BookmarkEditForm : Form + { + private TreeNode parentNode = null; + private BookmarkItem bookmarkItem; + private bool isWorking = false; + + public BookmarkEditForm(ref TreeNode node) + { + InitializeComponent(); + + parentNode = node; + + 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 (parentNode.Tag is BookmarkItem) + { + bookmarkItem = (BookmarkItem)parentNode.Tag; + tbxName.Text = bookmarkItem.GetName(); + tbxAddress.Text = bookmarkItem.Address; + tbxDescription.Text = bookmarkItem.Description; + + if (parentNode.TreeView.ImageList != null) + { + if (parentNode.ImageIndex >= 0) + { + pbxIcon.Image = parentNode.TreeView.ImageList.Images[parentNode.ImageIndex]; + } + else + { + pbxIcon.Image = parentNode.TreeView.ImageList.Images[parentNode.ImageKey]; + } + } + } + } + } + + protected override void OnClosing(CancelEventArgs e) + { + base.OnClosing(e); + + if (this.IsWorking) + { + e.Cancel = true; + } + } + + public bool IsWorking + { + get { return isWorking; } + set + { + isWorking = value; + + tbxName.Enabled = tbxAddress.Enabled = tbxDescription.Enabled = !value; + btnSave.Enabled = !value; + button1.Enabled = !value; + + pictureBox1.Image = (value) ? Properties.Resources.aniZomq2x32 : null; + } + } + + private void textBox_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) + { + if (this.IsWorking) + { + return; + } + + if (e.KeyCode == Keys.Escape) + { + this.Close(); + } + } + + private void btnRetrievePage_Click(object sender, EventArgs e) + { + if (this.IsWorking) + { + return; + } + + if (string.IsNullOrWhiteSpace(tbxAddress.Text)) + { + return; + } + + this.IsWorking = true; + oToolTip.SetToolTip(pictureBox1, ""); + + BookmarkItem bi = new BookmarkItem(); + bi.OnRetrieveCompleted += bookmarkItem_OnRetrieveCompleted; + bi.RetrieveAsync(tbxAddress.Text.Trim()); + } + + private void btnSave_Click(object sender, EventArgs e) + { + if (this.IsWorking) + { + return; + } + + if (bookmarkItem == null) + { + bookmarkItem = new BookmarkItem(); + } + + bookmarkItem.ChangeName(tbxName.Text.Trim()); + bookmarkItem.Address = tbxAddress.Text.Trim(); + bookmarkItem.Description = tbxDescription.Text.Trim(); + + parentNode.Text = tbxName.Text.Trim(); +//// parentNode.ImageIndex = parentNode.SelectedImageIndex = 3; + parentNode.ToolTipText = string.Concat(bookmarkItem.Address, Environment.NewLine, bookmarkItem.Description).Trim(); + parentNode.Tag = bookmarkItem; + + BookmarkTreeView bookmarkTreeView = (BookmarkTreeView)parentNode.TreeView; + if (bookmarkTreeView != null) + { + parentNode.ImageIndex = parentNode.SelectedImageIndex = bookmarkTreeView.AddToIconList(bookmarkItem); + } + + this.Close(); + } + + protected void bookmarkItem_OnRetrieveCompleted(BookmarkItem sender, bool hasError, string message) + { + if (string.IsNullOrEmpty(sender.TempName)) + { + 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.TempName = sender.TempName; + + tbxName.Text = bookmarkItem.TempName; + + // don't replace with blank + if (!string.IsNullOrEmpty(sender.Description)) + { + bookmarkItem.Description = sender.Description; + } + } + } + else + { + bookmarkItem.TempName = sender.TempName; + + tbxName.Text = bookmarkItem.TempName; + + // 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 new file mode 100644 index 0000000..3b96111 --- /dev/null +++ b/BookmarkEditForm.resx @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 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 new file mode 100644 index 0000000..444cb2b --- /dev/null +++ b/BookmarkItem.cs @@ -0,0 +1,386 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.Net; +using System.Windows.Forms; + +namespace bzit.bomg +{ + public class BookmarkItem + { + public delegate void RetrieveCompleted(BookmarkItem sender, bool hasError, string message); + + 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.Address + Environment.NewLine; + rv += "Description=" + this.Description + Environment.NewLine; + rv += "Created=" + this.Created?.Trim(); + + return rv; + } + + #region public properties + + public TreeNode TreeViewNode + { + 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; + } + } + } + + [DefaultValue(null)] + public byte[] IconData { get; set; } + + public string Created { get; set; } + + public string TempName { get; set; } + + public string Fullpath { get; set; } + + public string IconAddress { get; set; } + + public string Address { get; set; } + + public string Description { get; set; } + + #endregion + + #region public methods + + public void Clear() + { + this.Fullpath = string.Empty; + this.Address = 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 PathDecode(this.Fullpath.Substring(this.Fullpath.LastIndexOf(pathSeparator) + 1)).Trim(); + } + + return PathDecode(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, PathEncode(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.Address); + } + catch (Exception exc) + { + hasRetrieveError = true; + retrieveErrorMessage = exc.Message; + return; + } + + HtmlAgilityPack.HtmlDocument document = new HtmlAgilityPack.HtmlDocument(); + document.LoadHtml(sourceCode); + + // 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.Address), 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.Address), "/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.Address = address; + this.mainThread.RunWorkerAsync(); + } + + #endregion + + #region events & delegate + + public RetrieveCompleted OnRetrieveCompleted = null; + + #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.Address); + } + catch (Exception exc) + { + hasRetrieveError = true; + retrieveErrorMessage = exc.Message; + return; + } + + HtmlAgilityPack.HtmlDocument document = new HtmlAgilityPack.HtmlDocument(); + document.LoadHtml(sourceCode); + + // parse title + HtmlAgilityPack.HtmlNodeCollection hnc = document.DocumentNode.SelectNodes("//title"); + if (hnc != null) + { + if (hnc.Count > 0) + { + this.TempName = WebUtility.HtmlDecode(hnc[0].InnerHtml).Trim(); + } + } + + // parse description + hnc = document.DocumentNode.SelectNodes("//meta"); + if (hnc != null) + { + foreach (HtmlAgilityPack.HtmlNode node in hnc) + { + if (node.Attributes["name"] == null) + { + continue; + } + + string nodeAttr = node.Attributes["name"].Value.Trim(); + if (nodeAttr.Equals("description", StringComparison.CurrentCultureIgnoreCase)) + { + if (!string.IsNullOrEmpty(this.Description)) + { + continue; + } + + if (node.Attributes["content"] != null) + { + this.Description = WebUtility.HtmlDecode(node.Attributes["content"].Value).Trim(); + break; + } + } + } + } + + // parse icon + 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.Address), 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.Address), "/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 + } + } + } + + protected void retrieveWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) + { + this.OnRetrieveCompleted?.Invoke(this, hasRetrieveError, retrieveErrorMessage); + } + +// protected string CustomDecode(string text) { return WebUtility.HtmlDecode(text); } + + ////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/BookmarkTreeView.Designer.cs b/BookmarkTreeView.Designer.cs new file mode 100644 index 0000000..a085fe3 --- /dev/null +++ b/BookmarkTreeView.Designer.cs @@ -0,0 +1,36 @@ +namespace bzit.bomg +{ + partial class BookmarkTreeView + { + /// + /// 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(); + } + + #endregion + } +} diff --git a/BookmarkTreeView.cs b/BookmarkTreeView.cs new file mode 100644 index 0000000..9b4c5d3 --- /dev/null +++ b/BookmarkTreeView.cs @@ -0,0 +1,125 @@ +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.Address + Environment.NewLine + tag.Description; + + // load icon + if (this.IconDatabase.HasIcon(tag.Address)) + { + try + { + Image icon = this.IconDatabase.GetIcon(tag.Address); + if (icon != null) + { + tn.TreeView.ImageList.Images.Add(tag.Address, icon); + tn.ImageKey = tn.SelectedImageKey = tag.Address; + } + } + catch + { + // do nothing + } + } + } + + public int AddToIconList(BookmarkItem sender) + { + Image rs = null; + if (this.IconDatabase.HasIcon(sender.Address)) + { + rs = this.IconDatabase.GetIcon(sender.Address); + } + else + { + if (this.IconDatabase.AddIcon(sender.Address, sender.IconData)) + { + rs = sender.Icon; + } + } + + if (rs != null) + { + this.ImageList.Images.Add(sender.Address, rs); + return this.ImageList.Images.IndexOfKey(sender.Address); + } + + return 3; + } + + public void AddIcon(BookmarkItem sender) + { + if (this.IconDatabase.HasIcon(sender.Address)) + { + return; + } + + this.IconDatabase.AddIcon(sender.Address, sender.IconData); + } + } +} \ No newline at end of file diff --git a/FindForm.Designer.cs b/FindForm.Designer.cs new file mode 100644 index 0000000..e22a971 --- /dev/null +++ b/FindForm.Designer.cs @@ -0,0 +1,118 @@ +namespace bzit.bomg +{ + partial class FindForm + { + /// + /// 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(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.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(96, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Find a search term"; + // + // 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 = "&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); + // + // 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.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 = "FindForm"; + this.ShowInTaskbar = false; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Find"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #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; + } +} \ No newline at end of file diff --git a/FindForm.cs b/FindForm.cs new file mode 100644 index 0000000..896c607 --- /dev/null +++ b/FindForm.cs @@ -0,0 +1,102 @@ +using System; +using System.Windows.Forms; + +namespace bzit.bomg +{ + public partial class FindForm : Form + { + private MainForm parentForm = null; + private bool findNextNew = false; + + public FindForm(MainForm form) + { + InitializeComponent(); + + 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); + } + + break; + case Keys.Escape: + this.Close(); + break; + default: break; + } + } + +#endregion + + } +} \ No newline at end of file diff --git a/FindForm.resx b/FindForm.resx new file mode 100644 index 0000000..dbc6f20 --- /dev/null +++ b/FindForm.resx @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATXJQDEFmRGgAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAhZZ0GGmGZrSFm + nP8RWpKHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAxcakGKmykrVSM + u/+ItN3/F16W/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABDfrYGO3iwrWOW + xP+cwOT/ZZjH/x5knOsAAAAAAAAAAAAAAAAAAAAA3bGOAtmtiZfWqITj06R+/dCfev3Nm3XkoZKJ3nSh + zP+qy+j/daPO/y9vp+snaqInAAAAAAAAAAAAAAAA5LyaAuG3lcDoya3/9eHN//fl0//35dH/893I/9+5 + m//Hp5D/ha3V/0B8tOs4dq4nAAAAAAAAAAAAAAAAAAAAAOjCoZft0Lb/+OjZ//XeyP/z2Lz/89a6//Tb + wf/35NL/37qc/5yTkfdKg7snAAAAAAAAAAAAAAAAAAAAAAAAAADsyKfj9+fX//bhzP/028H/9Nq///PY + vP/z17r/9NvB//Peyf/NnnrnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8M6t/fns3//138j/9d3F//Tc + wv/02sD/89m9//PXvP/45tP/06R+/QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPTTs/357eH/9uHM//Xf + yf/13sf/9NzD//Tbwf/02r//+OfW/9ephf0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD317jj+eve//fn + 1v/24cz/9eDK//XeyP/13cT/9uHL//Xi0P/br4vjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+tu8l/ji + zP/67uP/9+fW//bizv/24cv/9uPQ//nq3f/sz7T/37WSlwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPze + vwL6273A+eLN//rs3v/57uL/+e3i//jp2v/w1bz/57+ewOO7mQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA/N7AAvrcvpf52brj9ta3/fTTs/3xz67j7suql+vFpQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA//+sQf/nrEH/w6xB/4OsQf8DrEHAA6xBgAesQYAPrEGAH6xBgB+sQYAfrEGAH6xBgB+sQYAf + rEHAP6xB//+sQQ== + + + \ No newline at end of file diff --git a/IconDatabase.cs b/IconDatabase.cs new file mode 100644 index 0000000..44327d4 --- /dev/null +++ b/IconDatabase.cs @@ -0,0 +1,134 @@ +using System; +using System.Drawing; +using System.IO; +using RyzStudio.Data.SQLite; + +namespace bzit.bomg +{ + public class IconDatabase : SQLiteDatabase2 + { + public IconDatabase() + { + this.requiredTableList = new string[] { "bzt_app_bomg_icons" }; + } + + protected override bool Prepare() + { + if (dbConnection == null) + { + return false; + } + + return this.DoNonQuery(@" + CREATE TABLE bzt_app_bomg_icons + ( + ico_id INTEGER PRIMARY KEY, + ico_key TEXT, + ico_hash TEXT, + ico_content BLOB + ) + ") >= 0; + } + +#region public methods + + public bool HasIcon(string url) + { + return this.DoQueryExist("SELECT 1 FROM bzt_app_bomg_icons WHERE ico_key='" + SQLiteDatabase2.EscapeValue(url) + "'"); + } + +/* public bool AddIcon(string url, Image image) + { + if (string.IsNullOrWhiteSpace(url)) + { + return false; + } + + if (image == null) + { + return false; + } + + if (this.HasIcon(url)) + { + return this.DoNonQuery("UPDATE bzt_app_bomg_icons SET='" + imageToSQLString(image) + "' WHERE ico_key='" + SQLiteDatabase2.escapeValue(url) + "';") >= 0; + } + else + { + return this.DoNonQuery("INSERT INTO bzt_app_bomg_icons (ico_key, ico_content) VALUES ('" + SQLiteDatabase2.escapeValue(url) + "', '" + imageToSQLString(image) + "');") >= 0; + } + }*/ + + public bool AddIcon(string url, byte[] image) + { + if (string.IsNullOrWhiteSpace(url)) + { + return false; + } + + if (image == null) + { + return false; + } + + if (this.HasIcon(url)) + { + return this.DoNonQuery("UPDATE bzt_app_bomg_icons SET='" + bytesToSQLString(image) + "' WHERE ico_key='" + SQLiteDatabase2.EscapeValue(url) + "';") >= 0; + } + else + { + return this.DoNonQuery("INSERT INTO bzt_app_bomg_icons (ico_key, ico_content) VALUES ('" + SQLiteDatabase2.EscapeValue(url) + "', '" + bytesToSQLString(image) + "');") >= 0; + } + } + + public Image GetIcon(string url) + { + if (!this.HasIcon(url)) + { + return null; + } + + string rs = this.DoQuerySingle("SELECT ico_content FROM bzt_app_bomg_icons WHERE ico_key='" + SQLiteDatabase2.EscapeValue(url) + "'"); + return sqlStringToImage(rs); + } + + public void DeleteIcon(string url) + { + if (string.IsNullOrWhiteSpace(url)) + { + return; + } + + this.DoNonQuery("DELETE FROM bzt_app_bomg_icons WHERE ico_key='" + SQLiteDatabase2.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 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; + } + } +} \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9cecc1d --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + 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/MainForm.Designer.cs b/MainForm.Designer.cs new file mode 100644 index 0000000..579f3d9 --- /dev/null +++ b/MainForm.Designer.cs @@ -0,0 +1,786 @@ +namespace bzit.bomg +{ + partial class MainForm + { + /// + /// 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(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.toolStripMenuItem4, + this.toolStripSeparator3, + this.toolStripMenuItem8, + this.toolStripMenuItem6, + 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.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.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.newFileMenuItem, + this.openFileMenuItem, + this.toolStripSeparator1, + this.closeFileMenuItem, + this.toolStripSeparator4, + 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) + | 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.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.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.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(143, 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(140, 6); + // + // optionsToolMenuItem + // + 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(143, 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.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.toolStripMenuItem15, + this.toolStripMenuItem16, + this.toolStripSeparator5, + this.toolStripMenuItem14, + this.toolStripMenuItem9, + this.toolStripMenuItem11, + this.toolStripSeparator7, + this.sortToolStripMenuItem, + 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.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.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(); + + } + + #endregion + + 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.ToolStripMenuItem listViewMenuItem1; + private System.Windows.Forms.ToolStripMenuItem moveFileToToolStripMenuItem; + private System.Windows.Forms.ToolTip oToolTip1; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem8; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem6; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; + private System.Windows.Forms.ToolStrip toolStrip1; + private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton1; + private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton2; + 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; + private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton5; + private System.Windows.Forms.ToolStripMenuItem optionsToolMenuItem; + 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.ToolStripMenuItem toolStripMenuItem9; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem11; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator7; + 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; + private System.Windows.Forms.ToolStripButton openMenuBarItem; + private System.Windows.Forms.ToolStripButton saveMenuBarItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator9; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem14; + private System.Windows.Forms.ToolStripMenuItem sortToolStripMenuItem; + 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.ToolStripMenuItem toolStripMenuItem17; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem18; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator10; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem20; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator13; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem22; + 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; + } +} + diff --git a/MainForm.cs b/MainForm.cs new file mode 100644 index 0000000..63c61a7 --- /dev/null +++ b/MainForm.cs @@ -0,0 +1,840 @@ +using System; +using System.ComponentModel; +using System.IO; +using System.Windows.Forms; + +namespace bzit.bomg +{ + public partial class MainForm : Form + { + public enum AppMode + { + Clear = 0, + Open, + New + } + + protected AppMode appMode = AppMode.Clear; + protected SessionFileFormat sessionFileFormat = null; + protected string sessionFilename = null; + + public MainForm() + { + InitializeComponent(); + } + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + + this.IconDatabase = new IconDatabase(); + + // toolbar + viewHelpHelpMenuItem.Enabled = File.Exists(Path.ChangeExtension(Application.ExecutablePath, ".chm")); + + string iconDBPath = Path.ChangeExtension(Application.ExecutablePath, ".db"); + 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; + } + + }; + } + + 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) + { + if (i > (szr.Length - 1)) + { + 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++; + break; + } + + i++; + } + } + + protected override void OnFormClosing(FormClosingEventArgs e) + { + this.IconDatabase?.Close(); + + if (this.ApplicationMode == AppMode.Clear) + { + Application.Exit(); + return; + } + + if (!treeView1.HasChanged) + { + this.ApplicationMode = AppMode.Clear; + Application.Exit(); + return; + } + + if (this.ApplicationMode == AppMode.Open) + { + if (string.IsNullOrEmpty(sessionFilename)) + { + 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) + { + switch (MessageBox.Show("There was a problem saving bookmarks. Retry?", "Retry?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question)) + { + case DialogResult.Yes: + break; + case DialogResult.No: + this.ApplicationMode = AppMode.Clear; + Application.Exit(); + break; + case DialogResult.Cancel: + e.Cancel = true; + break; + default: break; + } + } + else + { + 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; + } + } + else + { + this.ApplicationMode = AppMode.Clear; + Application.Exit(); + return; + } + } + } + + #region public properties + + public AppMode ApplicationMode + { + get { return appMode; } + set + { + appMode = value; + switch (value) + { + case AppMode.Clear: + this.Text = Properties.Resources.app_name; + statusBarPanel2.Text = string.Empty; + + treeView1.Clear(); + + sessionFilename = null; + + closeFileMenuItem.Enabled = false; + saveFileMenuItem.Enabled = saveMenuBarItem.Enabled = false; + saveAsFileMenuItem.Enabled = false; + updateIconsToolMenuItem.Enabled = false; + + break; + case AppMode.Open: + closeFileMenuItem.Enabled = true; + saveFileMenuItem.Enabled = saveMenuBarItem.Enabled = false; + saveAsFileMenuItem.Enabled = true; + updateIconsToolMenuItem.Enabled = true; + + break; + case AppMode.New: + this.Text = Properties.Resources.app_name; + statusBarPanel2.Text = string.Empty; + + sessionFilename = null; + + closeFileMenuItem.Enabled = true; + saveFileMenuItem.Enabled = saveMenuBarItem.Enabled = false; + saveAsFileMenuItem.Enabled = true; + updateIconsToolMenuItem.Enabled = true; + + break; + } + } + } + + [DefaultValue(null)] + public IconDatabase IconDatabase { get; set; } + + #endregion + + #region Toolbar #1 + + /** + * File -> New + */ + private void newSessionToolStripMenuItem_Click(object sender, EventArgs e) + { + NewSessionForm oNewSession = new NewSessionForm(this); + oNewSession.ShowDialog(); + } + + /* + * File -> Open + */ + private void toolStripMenuItem2_Click(object sender, EventArgs e) + { + if (openFileDialog.ShowDialog() == DialogResult.OK) + { + sessionFilename = openFileDialog.FileName; + + OpenBookmarkFile(sessionFilename); + } + } + + /** + * File -> Close + */ + private void toolStripMenuItem3_Click(object sender, EventArgs e) + { + if (ApplicationMode == AppMode.Clear) + { + return; + } + + if (!treeView1.HasChanged) + { + ApplicationMode = AppMode.Clear; + return; + } + + if (ApplicationMode == AppMode.Open) + { + if (string.IsNullOrEmpty(sessionFilename)) + { + ApplicationMode = AppMode.Clear; + return; + } + + if (MessageBox.Show("Save changes to open bookmarks.", "Save?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) + { + ApplicationMode = AppMode.Clear; + return; + } + + bool rv = sessionFileFormat.saveToRyz(sessionFilename); + if (!rv) + { + 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; + } + } + } + + /** + * File -> Save + */ + private void importSnapshotToolStripMenuItem_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(sessionFilename)) + { + return; + } + + bool rv = sessionFileFormat.saveToRyz(sessionFilename); + if (rv) + { + treeView1.HasChanged = false; + } + } + + /** + * File -> Save As + */ + private void exportSnapshotToolStripMenuItem_Click(object sender, EventArgs e) + { + if (SaveBookmarkFile()) + { + ApplicationMode = AppMode.Open; + treeView1.HasChanged = false; + } + } + + /** + * 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) + { + FindForm frm = new FindForm(this); + frm.Show(); + } + + /** + * View -> Expand All + */ + private void expandAllToolStripMenuItem_Click(object sender, EventArgs e) + { + if (treeView1.SelectedNode == null) + { + treeView1.ExpandAll(); + } + else + { + treeView1.SelectedNode.ExpandAll(); + } + } + + /** + * View -> Collapse All + */ + private void collapseAllToolStripMenuItem_Click(object sender, EventArgs e) + { + if (treeView1.SelectedNode == null) + { + treeView1.CollapseAll(); + } + else + { + treeView1.SelectedNode.Collapse(false); + } + } + + /** + * Tools -> Refresh Icons + */ + private void toolStripMenuItem1_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(sessionFilename)) + { + return; + } + + if (this.ApplicationMode == AppMode.Clear) + { + return; + } + + UpdateIconForm frm = new UpdateIconForm(this); + frm.ShowDialog(); + } + + /** + * Tools -> Options + */ + private void optionsToolStripMenuItem1_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)) + { + return; + } + + try + { + System.Diagnostics.Process.Start(chm); + } + catch + { + // do nothing + } + } + + /** + * Help -> About + */ + private void aboutToolStripMenuItem1_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); + } + + /** + * ? -> 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) + { + openBookmark(treeView1.SelectedNode); + } + + /** + * Node -> Edit + */ + private void toolStripMenuItem8_Click(object sender, EventArgs e) + { + if (treeView1.SelectedNode == null) + { + 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) + { + return; + } + + foreach (TreeNode tn in treeView1.SelectedNode.Nodes) + { + if (tn.Tag == null) + { + continue; + } + + openBookmark(tn); + } + } + + /** + * Edit + */ + private void toolStripMenuItem9_Click(object sender, EventArgs e) + { + 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 = ""; + + rv = sessionFileFormat.saveToRyz(saveFileDialog.FileName); + break; + case 2: + PasswordForm oPassword = new PasswordForm(this); + sessionFileFormat.passkey = oPassword.ShowDialog(); + + rv = sessionFileFormat.saveToRyz(saveFileDialog.FileName); + if (rv) + { + 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; + } + + private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) + { + if (e.Node == null) + { + return; + } + + if (e.Node.Text.Equals("")) + { + 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); + } + } + } + + private void treeView2_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { openBookmark(e.Node); } + + private void treeView1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) + { + TreeNode tn = treeView1.SelectedNode; + if (tn == null) + { + return; + } + + 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.Address)) + { + return; + } + + try + { + Clipboard.SetText(bookmarkItem.Address.Trim()); + } + catch + { + // do nothing + } + + break; + case Keys.Enter: + openBookmark(tn); + break; + default: break; + } + } + + protected void openBookmark(TreeNode node) + { + if (node == null) + { + return; + } + + if (node.Tag == null) + { + return; + } + + if (!(node.Tag is BookmarkItem)) + { + return; + } + + BookmarkItem item = (BookmarkItem)node.Tag; + if (item == null) + { + return; + } + + if (string.IsNullOrEmpty(item.Address)) + { + return; + } + + int bookmarkAction; + if (!int.TryParse(this.IconDatabase.GetConfig("core.bookmark.action", string.Empty), out bookmarkAction)) + { + bookmarkAction = 0; + } + + 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.Address); + bookmarkCustom2 = bookmarkCustom2.Replace("%1", item.Address); + + try + { + System.Diagnostics.Process.Start(bookmarkCustom1, bookmarkCustom2); + } + catch + { + // do nothing + } + + break; + default: + try + { + System.Diagnostics.Process.Start(item.Address); + } + catch + { + // do nothing + } + + break; + } + } + } +} \ No newline at end of file diff --git a/MainForm.resx b/MainForm.resx new file mode 100644 index 0000000..5f46a11 --- /dev/null +++ b/MainForm.resx @@ -0,0 +1,544 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 412, 17 + + + 17, 17 + + + 307, 17 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADU + FwAAAk1TRnQBSQFMAgEBBwEAAVwBAgFcAQIBEAEAARABAAT/AREBAAj/AUIBTQE2BwABNgMAASgDAAFA + AwABIAMAAQEBAAEQBgABEBQAAZkBSgEYAS4BtwEdAbcBGQG3ARkBtwEZAbcBGQG3ARkBtwEZAbcBGQG3 + ARkBtwEdARcBLgGZAUoEAAGZAUoBGAEuAbcBHQG3ARkBtwEZAbcBGQG3ARkBtwEZAbcBGQG3ARkBtwEZ + AbcBHQEXAS4BmQFKBAABmQFKARgBLgG3AR0BtwEZAbcBGQG3ARkBtwEZAbcBGQG3ARkBtwEZAbcBGQG3 + AR0BFwEuAZkBSiQAAdcBIQHeAXcBvgFvAb4BbwG+AW8BvgFvAb4BbwHfAXcB3wF3Ad8BdwHfAXsB/wF7 + Af8BfwHXASEEAAHXASEB3gF3Ab4BbwG+AW8BvgFvAb4BbwG+AW8B3wF3Ad8BdwHfAXcB3wF7Af8BewH/ + AX8B1wEhBAAB1wEhAd4BdwG+AW8BvgFvAb4BbwG+A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9R1fb/T8fm/zte + ZtczMzMkAAAAAAAAAAAyMjIvSWhv5GKhsf930ej/ed/4/1nX9/9R1fb/UdX2/1HV9v9R1fb/TLnV/zdO + U7sxMTEQAAAAAAAAAAAAAAAAAAAAACwsLAEyMjIwNTc3eUhiacJWiZX7VrTM/1PU9P9R1fb/Saa+/zVB + RJczMzMEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMDAwEDIyMlU4SEyePWhz4zM3 + OG4AAAAAAAAAAAAAAAAAAAAAAAAAAP//rEH4P6xB4AOsQcABrEGAAaxBAAGsQQAArEEAAKxBAACsQQAA + rEEAAKxBgACsQYABrEGAA6xBwAesQfwfrEE= + + + \ No newline at end of file diff --git a/NewSessionForm.Designer.cs b/NewSessionForm.Designer.cs new file mode 100644 index 0000000..0a35947 --- /dev/null +++ b/NewSessionForm.Designer.cs @@ -0,0 +1,101 @@ +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 new file mode 100644 index 0000000..e7890ba --- /dev/null +++ b/NewSessionForm.cs @@ -0,0 +1,55 @@ +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/NewSessionForm.resx b/NewSessionForm.resx new file mode 100644 index 0000000..f427d71 --- /dev/null +++ b/NewSessionForm.resx @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAB0AAAA0AAAANgAAADYAAAA2AAAANgAAADYAAAA2AAAANgAAADYAAAA2AAAANgAA + ADMAAAAdAAAAAAAAAAAAAAA0+fn59fz8/P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/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/OptionsForm.Designer.cs b/OptionsForm.Designer.cs new file mode 100644 index 0000000..749a7c5 --- /dev/null +++ b/OptionsForm.Designer.cs @@ -0,0 +1,151 @@ +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 new file mode 100644 index 0000000..7e50850 --- /dev/null +++ b/OptionsForm.cs @@ -0,0 +1,44 @@ +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/OptionsForm.resx b/OptionsForm.resx new file mode 100644 index 0000000..9941254 --- /dev/null +++ b/OptionsForm.resx @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + + + + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAA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 3P/t7e3/29vb/8HBwfS9vb3+1tbW/9TU1P+vr6/+q6ur9MvLy//n5+f/tra2/4qKinsAAAAAAAAAAAAA + AADR0dGbzs7O/crKyufFxcUZwcHB597e3v/d3d3/sbGx57CwsBmrq6vnpqam/aKiopsAAAAAAAAAAAAA + AAAAAAAAAAAAANHR0SnOzs4Oy8vLAsfHx+rl5eX/5OTk/6urq+q1tbUCsbGxDqysrCkAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADLy8tjx8fHv8PDw7++vr5jAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA/D+sQeAHrEHAA6xBgAGsQYABrEHAA6xBAACsQQGArEEBgKxBAACsQcADrEGAAaxBgAGsQcAD + rEHgB6xB/D+sQQ== + + + \ No newline at end of file diff --git a/PasswordForm.Designer.cs b/PasswordForm.Designer.cs new file mode 100644 index 0000000..deaee9c --- /dev/null +++ b/PasswordForm.Designer.cs @@ -0,0 +1,102 @@ +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 new file mode 100644 index 0000000..5336a59 --- /dev/null +++ b/PasswordForm.cs @@ -0,0 +1,53 @@ +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/PasswordForm.resx b/PasswordForm.resx new file mode 100644 index 0000000..de6f015 --- /dev/null +++ b/PasswordForm.resx @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + 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/Program.cs b/Program.cs new file mode 100644 index 0000000..0898628 --- /dev/null +++ b/Program.cs @@ -0,0 +1,19 @@ +using System; +using System.Windows.Forms; + +namespace bzit.bomg +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + } +} \ No newline at end of file diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..21685e0 --- /dev/null +++ b/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Bookmark Manager")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Bookmark Manager")] +[assembly: AssemblyCopyright("Copyright © Ray Lam 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("e3ec71b2-edea-4f83-b5c9-3b74c9f6ba37")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 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.0.082")] +[assembly: AssemblyFileVersion("0.1.0.0")] diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs new file mode 100644 index 0000000..c4940a1 --- /dev/null +++ b/Properties/Resources.Designer.cs @@ -0,0 +1,230 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace bzit.bomg.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("bzit.bomg.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap aniZomq2x32 { + get { + object obj = ResourceManager.GetObject("aniZomq2x32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized string similar to Ray Lam. + /// + internal static string app_author { + get { + return ResourceManager.GetString("app_author", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bookmark Manager. + /// + internal static string app_name { + get { + return ResourceManager.GetString("app_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 0.2.0.082 beta. + /// + internal static string app_version { + get { + return ResourceManager.GetString("app_version", resourceCulture); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap cog { + get { + object obj = ResourceManager.GetObject("cog", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap comment { + get { + object obj = ResourceManager.GetObject("comment", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap disk { + get { + object obj = ResourceManager.GetObject("disk", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap folder { + get { + object obj = ResourceManager.GetObject("folder", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap folder_explore { + get { + object obj = ResourceManager.GetObject("folder_explore", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap folder_page { + get { + object obj = ResourceManager.GetObject("folder_page", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap help { + get { + object obj = ResourceManager.GetObject("help", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap magnifier { + get { + object obj = ResourceManager.GetObject("magnifier", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap page_white_disk { + get { + object obj = ResourceManager.GetObject("page_white_disk", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap page_white_gray_green { + get { + object obj = ResourceManager.GetObject("page_white_gray_green", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap page_white_star { + get { + object obj = ResourceManager.GetObject("page_white_star", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap page_white_world_bw { + get { + object obj = ResourceManager.GetObject("page_white_world_bw", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap transmit_blue { + get { + object obj = ResourceManager.GetObject("transmit_blue", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/Properties/Resources.resx b/Properties/Resources.resx new file mode 100644 index 0000000..bfb5c40 --- /dev/null +++ b/Properties/Resources.resx @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + ..\Resources\aniZomq2x32.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Ray Lam + + + Bookmark Manager + + + 0.2.0.082 beta + + + ..\Resources\cog.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\disk.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\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\help.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\page_white_disk.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\page_white_star.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\transmit_blue.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs new file mode 100644 index 0000000..2ced36b --- /dev/null +++ b/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace bzit.bomg.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/Properties/Settings.settings b/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..9706953 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# 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 new file mode 100644 index 0000000..ec9f1f8 Binary files /dev/null and b/References/SQLiteWrapper.dll differ diff --git a/References/sqlite3.dll b/References/sqlite3.dll new file mode 100644 index 0000000..c823a4d Binary files /dev/null and b/References/sqlite3.dll differ diff --git a/Resources/aniZomq2x32.gif b/Resources/aniZomq2x32.gif new file mode 100644 index 0000000..7df769e Binary files /dev/null and b/Resources/aniZomq2x32.gif differ diff --git a/Resources/bullet_key.ico b/Resources/bullet_key.ico new file mode 100644 index 0000000..88e2f20 Binary files /dev/null and b/Resources/bullet_key.ico differ diff --git a/Resources/cog.ico b/Resources/cog.ico new file mode 100644 index 0000000..737f1a8 Binary files /dev/null and b/Resources/cog.ico differ diff --git a/Resources/cog.png b/Resources/cog.png new file mode 100644 index 0000000..67de2c6 Binary files /dev/null and b/Resources/cog.png differ diff --git a/Resources/comment.png b/Resources/comment.png new file mode 100644 index 0000000..7bc9233 Binary files /dev/null and b/Resources/comment.png differ diff --git a/Resources/disk.png b/Resources/disk.png new file mode 100644 index 0000000..99d532e Binary files /dev/null and b/Resources/disk.png differ diff --git a/Resources/folder.png b/Resources/folder.png new file mode 100644 index 0000000..784e8fa Binary files /dev/null and b/Resources/folder.png differ diff --git a/Resources/folder_explore.png b/Resources/folder_explore.png new file mode 100644 index 0000000..d263435 Binary files /dev/null and b/Resources/folder_explore.png differ diff --git a/Resources/folder_page.png b/Resources/folder_page.png new file mode 100644 index 0000000..1ef6e11 Binary files /dev/null and b/Resources/folder_page.png differ diff --git a/Resources/help.png b/Resources/help.png new file mode 100644 index 0000000..5c87017 Binary files /dev/null and b/Resources/help.png differ diff --git a/Resources/magnifier.ico b/Resources/magnifier.ico new file mode 100644 index 0000000..26e6a2c Binary files /dev/null and b/Resources/magnifier.ico differ diff --git a/Resources/magnifier.png b/Resources/magnifier.png new file mode 100644 index 0000000..cf3d97f Binary files /dev/null and b/Resources/magnifier.png differ diff --git a/Resources/package_green.ico b/Resources/package_green.ico new file mode 100644 index 0000000..acc1ef0 Binary files /dev/null and b/Resources/package_green.ico differ diff --git a/Resources/page_white_disk.png b/Resources/page_white_disk.png new file mode 100644 index 0000000..1a80ac9 Binary files /dev/null and b/Resources/page_white_disk.png differ diff --git a/Resources/page_white_gray_green.png b/Resources/page_white_gray_green.png new file mode 100644 index 0000000..eb1fadf Binary files /dev/null and b/Resources/page_white_gray_green.png differ diff --git a/Resources/page_white_star.ico b/Resources/page_white_star.ico new file mode 100644 index 0000000..d4e1e07 Binary files /dev/null and b/Resources/page_white_star.ico differ diff --git a/Resources/page_white_star.png b/Resources/page_white_star.png new file mode 100644 index 0000000..3a1441c Binary files /dev/null and b/Resources/page_white_star.png differ diff --git a/Resources/page_white_world_bw.png b/Resources/page_white_world_bw.png new file mode 100644 index 0000000..2a2e8a9 Binary files /dev/null and b/Resources/page_white_world_bw.png differ diff --git a/Resources/transmit_blue.png b/Resources/transmit_blue.png new file mode 100644 index 0000000..b9c8d01 Binary files /dev/null and b/Resources/transmit_blue.png differ diff --git a/RyzStudio/Data/SQLite/SQLiteDatabase.cs b/RyzStudio/Data/SQLite/SQLiteDatabase.cs new file mode 100644 index 0000000..2ebab58 --- /dev/null +++ b/RyzStudio/Data/SQLite/SQLiteDatabase.cs @@ -0,0 +1,444 @@ +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/Data/SQLite/SQLiteDatabase2.cs b/RyzStudio/Data/SQLite/SQLiteDatabase2.cs new file mode 100644 index 0000000..b45bc56 --- /dev/null +++ b/RyzStudio/Data/SQLite/SQLiteDatabase2.cs @@ -0,0 +1,447 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Data.SQLite; +using System.IO; +using System.Text; + +namespace RyzStudio.Data.SQLite +{ + public class SQLiteDatabase2 + { + #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; + } + + public static string Encode64(string text) { return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); } + + #endregion + + protected SQLiteConnection dbConnection = null; + protected string dbLocation = string.Empty; + protected string lastError = ""; + + protected string[] requiredTableList = new string[0]; + + protected const string tableNameConfig = "ryz_app_xxxx_config"; + + #region public properties + + [Browsable(false)] + public SQLiteConnection DBConnection + { + get { return dbConnection; } + set { dbConnection = value; } + } + + [Browsable(false)] + public string DBLocation + { + get { return dbLocation; } + set { dbLocation = value; } + } + + public string LastError { get { return lastError; } } + + public int LastInsertID + { + get + { + if (dbConnection == 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 CreateMemory() + { + lastError = string.Empty; + + dbLocation = ":memory:"; + + try + { + dbConnection = new SQLiteConnection(string.Concat("Data Source=\"", dbLocation, "\";Version=3;UTF8Encoding=True;")); + dbConnection.Open(); + } + catch (Exception exc) + { + lastError = exc.Message; + return false; + } + + return true; + } + + public bool CreateSpecial(string filename, bool overwriteFile = false, string password = null) + { + bool rs = this.CreateFile(filename, overwriteFile, password); + if (!rs) + { + return false; + } + + rs = this.Prepare(); + if (!rs) + { + return false; + } + + return this.CheckRequiredTables(); + } + + public bool CreateFile(string filename, bool overwriteFile = false, string password = null) + { + if (File.Exists(filename)) + { + if (overwriteFile) + { + try + { + File.Delete(filename); + } + catch + { + return false; + } + } + else + { + return false; + } + } + + try + { + SQLiteConnection.CreateFile(filename); + } + catch + { + return false; + } + + return this.LoadFile(filename, password); + } + + public bool LoadFile(string filename, string password = null) + { + lastError = string.Empty; + + if (!File.Exists(filename)) + { + return false; + } + + dbLocation = filename; + + try + { + dbConnection = new SQLiteConnection(string.Concat("Data Source=\"", filename, "\";Version=3;UTF8Encoding=True;", (password == null) ? string.Empty : string.Concat("Password=", Encode64(password), ";"))); + dbConnection.Open(); + } + catch (Exception exc) + { + lastError = exc.Message; + return false; + } + + return true; + } + + public void Close() + { + if (dbConnection != null) + { + try + { + dbConnection.Close(); + } + catch + { + // do nothing + } + } + } + + #region query + + public DataTable DoQuery(string query) + { + lastError = string.Empty; + + if (dbConnection == null) + { + return null; + } + + try + { + SQLiteCommand command = new SQLiteCommand(query, dbConnection); + SQLiteDataReader dr = command.ExecuteReader(); + + DataTable dt = new DataTable(); + dt.Load(dr); + + return dt; + } + catch (Exception exc) + { + lastError = exc.Message; + return null; + } + } + + public DataTable DoQuery(string query, params string[] args) + { + string sql = SQLiteDatabase2.PrepareQuery(query, args); + + return DoQuery(sql); + } + + public int DoQueryCount(string query) + { + lastError = string.Empty; + + if (dbConnection == null) + { + return -1; + } + + DataTable dt = this.DoQuery(query); + if (dt == null) + { + return -1; + } + + return dt.Rows.Count; + } + + public int DoQueryCount(string query, params string[] args) + { + string sql = SQLiteDatabase2.PrepareQuery(query, args); + + return this.DoQueryCount(sql); + } + + public bool DoQueryExist(string query) + { + int rv = this.DoQueryCount(query); + + return (rv > 0); + } + + public bool DoQueryExist(string query, params string[] args) + { + string sql = SQLiteDatabase2.PrepareQuery(query, args); + + return this.DoQueryExist(sql); + } + + public string DoQuerySingle(string query) + { + lastError = string.Empty; + + if (dbConnection == null) + { + return string.Empty; + } + + DataTable dt = this.DoQuery(query); + + if (dt == null) + { + return string.Empty; + } + + if (dt.Columns.Count <= 0) + { + return string.Empty; + } + + if (dt.Rows.Count <= 0) + { + return string.Empty; + } + + if (dt.Rows[0][0] is byte[]) + { + return Encoding.UTF8.GetString(dt.Rows[0][0] as byte[]); + } + else + { + return dt.Rows[0][0].ToString(); + } + } + + public string DoQuerySingle(string query, params string[] args) + { + string sql = SQLiteDatabase2.PrepareQuery(query, args); + + return this.DoQuerySingle(sql); + } + + public int DoNonQuery(string query) + { + lastError = string.Empty; + + if (dbConnection == null) + { + return -1; + } + + int rv = 0; + + try + { + SQLiteCommand command = new SQLiteCommand(query, dbConnection); + rv = command.ExecuteNonQuery(); + } + catch (Exception exc) + { + lastError = exc.Message; + rv = -1; + } + + return rv; + } + + public int DoNonQuery(string query, params string[] args) + { + string sql = SQLiteDatabase2.PrepareQuery(query, args); + + return this.DoNonQuery(sql); + } + + public bool HasTable(string tableName) + { + lastError = string.Empty; + + if (dbConnection == null) + { + return false; + } + + int rv = this.DoQueryCount("SELECT 1 FROM sqlite_master WHERE type='table' AND name='" + EscapeSQL(tableName) + "'"); + + 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; + } + + #endregion + + public bool PrepareConfig() + { + if (this.HasTable(tableNameConfig)) + { + return true; + } + + int rv = this.DoNonQuery("CREATE TABLE " + tableNameConfig + " (cfg_name TEXT, cfg_value TEXT)"); + + return rv > 0; + } + + public bool SetConfig(string name, string value) + { + this.PrepareConfig(); + + 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) > 0; + } + + public string GetConfig(string name, string defaultValue = "") + { + this.PrepareConfig(); + + bool rv = this.DoQueryExist("SELECT 1 FROM " + tableNameConfig + " WHERE cfg_name='" + EscapeSQL(name) + "';"); + if (!rv) + { + return defaultValue; + } + + return this.DoQuerySingle("SELECT cfg_value FROM " + tableNameConfig + " WHERE cfg_name='" + EscapeSQL(name) + "';"); + } + + #endregion + + protected virtual bool Prepare() + { + return true; + } + } +} diff --git a/RyzStudio/Drawing/Rectangoid.cs b/RyzStudio/Drawing/Rectangoid.cs new file mode 100644 index 0000000..de846cb --- /dev/null +++ b/RyzStudio/Drawing/Rectangoid.cs @@ -0,0 +1,84 @@ +using System.Drawing; +using System.Drawing.Drawing2D; + +namespace RyzStudio.Drawing +{ + public struct Rectangoid + { + int X; + int Y; + int Width; + int Height; + 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(int x, int y, int width, int height) + { + X = x; + Y = y; + Width = width; + Height = height; + Radius = 0; + } + + 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 + 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 PointF GetOrigin() + { + PointF retval = new PointF(); + retval.X = ((float)Width / 2) + X; + retval.Y = ((float)Height / 2) + Y; + + return retval; + } + } +} \ No newline at end of file diff --git a/RyzStudio/IO/FileType.cs b/RyzStudio/IO/FileType.cs new file mode 100644 index 0000000..3c8b616 --- /dev/null +++ b/RyzStudio/IO/FileType.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace RyzStudio.IO +{ + public class FileType + { + protected static readonly byte[] BMP = { 66, 77 }; + protected static readonly byte[] GIF = { 71, 73, 70, 56 }; + protected static readonly byte[] ICO = { 0, 0, 1, 0 }; + protected static readonly byte[] JPG = { 255, 216, 255 }; + protected static readonly byte[] PNG = { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82 }; + + public static bool IsImage(byte[] byteArray) + { + if (byteArray == null) + { + return false; + } + + if (byteArray.Length <= 0) + { + return false; + } + + if (byteArray.Take(2).SequenceEqual(BMP)) + { + return true; + } + + if (byteArray.Take(4).SequenceEqual(GIF)) + { + return true; + } + + if (byteArray.Take(4).SequenceEqual(ICO)) + { + return true; + } + + if (byteArray.Take(3).SequenceEqual(JPG)) + { + return true; + } + + if (byteArray.Take(16).SequenceEqual(PNG)) + { + return true; + } + + return false; + } + } +} diff --git a/RyzStudio/IO/SessionFileFormatBase.cs b/RyzStudio/IO/SessionFileFormatBase.cs new file mode 100644 index 0000000..777ab4d --- /dev/null +++ b/RyzStudio/IO/SessionFileFormatBase.cs @@ -0,0 +1,285 @@ +using System; +using System.IO; +using System.Text; +using System.Xml; +using System.Windows.Forms; +using ICSharpCode.SharpZipLib.Zip; + +namespace RyzStudio.IO +{ + public abstract class SessionFileFormatBase + { + protected string CONST_KEYPASS = ""; + protected string CONST_PRODUCT = ""; + protected string CONST_STREAM_FILE_NAME = ""; + + protected bool enableErrorReporting = false; + protected string lastUsedFileName = ""; + + #region public properties + + public string passkey + { + get { return CONST_KEYPASS; } + set { CONST_KEYPASS = value; } + } + + /*public string LastFilename + { + get { return lastUsedFileName; } + set { lastUsedFileName = value; } + }*/ + + #endregion + + #region public methods + +/* public bool loadFromRyz() + { + return loadFromRyz(lastUsedFileName); + }*/ + + public bool loadFromRyz(string file_name) + { + lastUsedFileName = file_name; + if (!File.Exists(file_name)) + { + return false; + } + + bool rv = false; + + try + { + ZipInputStream zipIn = new ZipInputStream(File.OpenRead(file_name)); + zipIn.Password = CONST_KEYPASS; + ZipEntry theEntry = null; + + while ((theEntry = zipIn.GetNextEntry()) != null) + { + string streamFileName = Path.GetFileName(theEntry.Name); + if (streamFileName.Equals(CONST_STREAM_FILE_NAME)) + { + MemoryStream oxStream = new MemoryStream(); + StreamWriter streamWriter = new StreamWriter(oxStream); + int size = 2048; + byte[] data = new byte[size]; + while (true) + { + size = zipIn.Read(data, 0, data.Length); + if (size <= 0) break; + streamWriter.BaseStream.Write(data, 0, size); + } + + oxStream.Position = 0; + + StreamReader sr2 = new StreamReader(oxStream, Encoding.UTF8); + XmlDocument xDoc = new XmlDocument(); + xDoc.LoadXml(sr2.ReadToEnd()); + + loadFromXmlDocument(ref xDoc); + } + } + + zipIn.Close(); + + rv = true; + } + catch (Exception exc) + { + if (enableErrorReporting) + { + MessageBox.Show(exc.Message); + } + } + + return rv; + } + + public bool loadFromXml() { return loadFromXml(lastUsedFileName); } + + public bool loadFromXml(string file_name) + { + lastUsedFileName = file_name; + if (!File.Exists(file_name)) + { + return false; + } + + bool rv = false; + + try + { + StreamReader sr2 = new StreamReader(file_name, Encoding.UTF8); + XmlDocument xDoc = new XmlDocument(); + xDoc.LoadXml(sr2.ReadToEnd()); + + loadFromXmlDocument(ref xDoc); + sr2.Close(); + + rv = true; + } + catch (Exception exc) + { + if (enableErrorReporting) + { + MessageBox.Show(exc.Message); + } + } + + return rv; + } + +/* public bool saveToRyz() + { + return saveToRyz(lastUsedFileName); + } +*/ + + public bool saveToRyz(string file_name) + { + bool rv = false; + lastUsedFileName = file_name; + byte[] buffer = new byte[4096]; + + try + { + File.Delete(file_name); + FileInfo fileinfo1 = new FileInfo(file_name); + if (!Directory.Exists(fileinfo1.DirectoryName)) + { + Directory.CreateDirectory(fileinfo1.DirectoryName); + } + } + catch (Exception exc) + { + if (enableErrorReporting) + { + MessageBox.Show(exc.Message); + } + } + + try + { + ZipOutputStream zipOutStream1 = new ZipOutputStream(File.Create(file_name)); + zipOutStream1.SetLevel(9); + zipOutStream1.Password = CONST_KEYPASS; + + MemoryStream oxIndexStream = new MemoryStream(); + XmlTextWriter oxTW = new XmlTextWriter(oxIndexStream, Encoding.UTF8); + saveToXmlTextWriter(ref oxTW); + oxTW.Flush(); + + // write to file + zipOutStream1.PutNextEntry(new ZipEntry(CONST_STREAM_FILE_NAME)); + oxIndexStream.Position = 0; + StreamReader sr2 = new StreamReader(oxIndexStream, Encoding.UTF8); + int sourceBytes; + do + { + sourceBytes = sr2.BaseStream.Read(buffer, 0, buffer.Length); + zipOutStream1.Write(buffer, 0, sourceBytes); + } + while (sourceBytes > 0); + + sr2.Close(); + oxTW.Close(); + zipOutStream1.Finish(); + zipOutStream1.Close(); + + rv = true; + } + catch (Exception exc) + { + if (enableErrorReporting) + { + MessageBox.Show(exc.Message); + } + } + + return rv; + } + + public bool saveToXml() { return saveToXml(lastUsedFileName); } + + public bool saveToXml(string file_name) + { + bool rv = false; + + lastUsedFileName = file_name; + try + { + File.Delete(file_name); + FileInfo fileinfo1 = new FileInfo(file_name); + if (!Directory.Exists(fileinfo1.DirectoryName)) + { + Directory.CreateDirectory(fileinfo1.DirectoryName); + } + } + catch (Exception exc) + { + if (enableErrorReporting) + { + MessageBox.Show(exc.Message); + } + } + + try + { + XmlTextWriter oxTW = new XmlTextWriter(file_name, Encoding.UTF8); + saveToXmlTextWriter(ref oxTW); + oxTW.Flush(); + oxTW.Close(); + + rv = true; + } + catch (Exception exc) + { + if (enableErrorReporting) + { + MessageBox.Show(exc.Message); + } + } + + return rv; + } + + #endregion + + protected virtual void loadFromXmlDocument(ref XmlDocument xml_doc) { } + + protected virtual void saveToXmlTextWriter(ref XmlTextWriter writer) { } + + #region public methods (conversions) + + public int[] convIntArrayString(string s1, char c) + { + string[] sarr = s1.Split(c); + int[] iarr = new int[sarr.Length]; + for (int i = 0; i < sarr.Length; i++) + { + iarr[i] = Int32.Parse(sarr[i]); + } + + return iarr; + } + + public string convStringIntArray(int[] r, char s) + { + string t = null; + for (int i = 0; i < r.Length; i++) + { + if (i != 0) + { + t += s.ToString(); + } + + t += r[i].ToString(); + } + + return t; + } + +#endregion + } +} \ No newline at end of file diff --git a/RyzStudio/IO/SharpZipLib.cs b/RyzStudio/IO/SharpZipLib.cs new file mode 100644 index 0000000..b162124 --- /dev/null +++ b/RyzStudio/IO/SharpZipLib.cs @@ -0,0 +1,76 @@ +using System; +using System.IO; +using ICSharpCode.SharpZipLib.Zip; + +namespace RyzStudio.IO +{ + public class SharpZipLib + { + /// + /// Is zip file encrypted + /// + /// Filename + /// Is encrypted + public static bool IsZipEncrypted(string fn) + { + bool ret_val = false; + try + { + ZipInputStream zipIn = new ZipInputStream(System.IO.File.OpenRead(fn)); + ZipEntry theEntry = null; + while ((theEntry = zipIn.GetNextEntry()) != null) + { + if (theEntry.IsCrypted) + { + ret_val = true; + } + + break; + } + + zipIn.Close(); + } + catch + { + // do nothing + } + + return ret_val; + } + + public static void AddFile(ZipOutputStream zipstream, string filename, string prefixpath = null) + { + byte[] buffer = new byte[4096]; + + string f1 = ""; + if (prefixpath != null) + { + f1 = Path.GetDirectoryName(filename).TrimEnd('\\') + "\\"; + f1 = f1.Replace(prefixpath, "").TrimEnd('\\') + "\\"; + f1 = f1 + Path.GetFileName(filename); + f1 = f1.TrimStart('\\'); + } + + ZipEntry entry = new ZipEntry(f1); + entry.DateTime = DateTime.Now; + zipstream.PutNextEntry(entry); + + FileStream fs = File.OpenRead(filename); + int sourceBytes; + do + { + sourceBytes = fs.Read(buffer, 0, buffer.Length); + zipstream.Write(buffer, 0, sourceBytes); + } + while (sourceBytes > 0); + } + + public static void AddFolder(ZipOutputStream zipstream, string folderpath, string prefixpath = null) + { + foreach (string fn in Directory.GetFiles(folderpath, "*.*", System.IO.SearchOption.AllDirectories)) + { + AddFile(zipstream, fn, prefixpath); + } + } + } +} \ No newline at end of file diff --git a/RyzStudio/String.cs b/RyzStudio/String.cs new file mode 100644 index 0000000..c6c4510 --- /dev/null +++ b/RyzStudio/String.cs @@ -0,0 +1,36 @@ +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 new file mode 100644 index 0000000..6943f34 --- /dev/null +++ b/RyzStudio/Windows/Forms/BigButton.Designer.cs @@ -0,0 +1,64 @@ +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 new file mode 100644 index 0000000..5dd4ca2 --- /dev/null +++ b/RyzStudio/Windows/Forms/BigButton.cs @@ -0,0 +1,91 @@ +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/BigButton.resx b/RyzStudio/Windows/Forms/BigButton.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/RyzStudio/Windows/Forms/BigButton.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/Forms/BigUserControl.Designer.cs b/RyzStudio/Windows/Forms/BigUserControl.Designer.cs new file mode 100644 index 0000000..218b152 --- /dev/null +++ b/RyzStudio/Windows/Forms/BigUserControl.Designer.cs @@ -0,0 +1,37 @@ +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 new file mode 100644 index 0000000..400e7b9 --- /dev/null +++ b/RyzStudio/Windows/Forms/BigUserControl.cs @@ -0,0 +1,52 @@ +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/MovableTreeView.cs b/RyzStudio/Windows/Forms/MovableTreeView.cs new file mode 100644 index 0000000..40d1c8d --- /dev/null +++ b/RyzStudio/Windows/Forms/MovableTreeView.cs @@ -0,0 +1,726 @@ +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/SessionFileFormat.cs b/SessionFileFormat.cs new file mode 100644 index 0000000..39f92f8 --- /dev/null +++ b/SessionFileFormat.cs @@ -0,0 +1,93 @@ +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.Address = 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.Address); + 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 new file mode 100644 index 0000000..ba005c6 --- /dev/null +++ b/UpdateIconForm.Designer.cs @@ -0,0 +1,144 @@ +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 new file mode 100644 index 0000000..e8dbec9 --- /dev/null +++ b/UpdateIconForm.cs @@ -0,0 +1,121 @@ +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/UpdateIconForm.resx b/UpdateIconForm.resx new file mode 100644 index 0000000..a6f44d9 --- /dev/null +++ b/UpdateIconForm.resx @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + + + + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAA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y6YAAAAATrbZRk20 + 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/bomg-2.ico b/bomg-2.ico new file mode 100644 index 0000000..91a99b0 Binary files /dev/null and b/bomg-2.ico differ diff --git a/bomg-4.ico b/bomg-4.ico new file mode 100644 index 0000000..b8eef31 Binary files /dev/null and b/bomg-4.ico differ diff --git a/bomg.csproj b/bomg.csproj new file mode 100644 index 0000000..f2fee09 --- /dev/null +++ b/bomg.csproj @@ -0,0 +1,276 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {594B03D6-3F17-4AE9-911D-C338EBD99FDF} + WinExe + Properties + bzit.bomg + bomg + v4.5.2 + + + 512 + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + + bomg-4.ico + + + LocalIntranet + + + false + + + + true + + + AnyCPU + bin\Debug\ + false + + + AnyCPU + bin\Release\ + false + + + + packages\HtmlAgilityPack.1.4.9.5\lib\Net40\HtmlAgilityPack.dll + True + + + packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll + True + + + + + + packages\System.Data.SQLite.Core.1.0.105.1\lib\net451\System.Data.SQLite.dll + + + + + + + + + Form + + + OptionsForm.cs + + + + Form + + + UpdateIconForm.cs + + + + + Form + + + BookmarkEditForm.cs + + + Form + + + FindForm.cs + + + Form + + + NewSessionForm.cs + + + Form + + + PasswordForm.cs + + + + + + Form + + + MainForm.cs + + + + + + + + UserControl + + + BigButton.cs + + + UserControl + + + BigUserControl.cs + + + Component + + + Component + + + BookmarkTreeView.cs + + + OptionsForm.cs + + + UpdateIconForm.cs + + + BookmarkEditForm.cs + + + FindForm.cs + + + NewSessionForm.cs + + + PasswordForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + MainForm.cs + + + BigButton.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + + + + + + + + + + + + + + + + False + Microsoft .NET Framework 4 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + + + + + + 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}. + + + + + \ No newline at end of file diff --git a/packages.config b/packages.config new file mode 100644 index 0000000..8c48cbf --- /dev/null +++ b/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file