Changed: improved source code parsing for title, description and favicon
This commit is contained in:
parent
6e951b6fa5
commit
aecc5ac043
346
BookmarkEditForm.Designer.cs
generated
346
BookmarkEditForm.Designer.cs
generated
@ -28,182 +28,182 @@ namespace bzit.bomg
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.components = new System.ComponentModel.Container();
|
this.components = new System.ComponentModel.Container();
|
||||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BookmarkEditForm));
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BookmarkEditForm));
|
||||||
this.label1 = new System.Windows.Forms.Label();
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
this.tbxAddress = new System.Windows.Forms.TextBox();
|
this.tbxAddress = new System.Windows.Forms.TextBox();
|
||||||
this.tbxName = new System.Windows.Forms.TextBox();
|
this.tbxName = new System.Windows.Forms.TextBox();
|
||||||
this.label2 = new System.Windows.Forms.Label();
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
this.tbxDescription = new System.Windows.Forms.TextBox();
|
this.tbxDescription = new System.Windows.Forms.TextBox();
|
||||||
this.oToolTip = new System.Windows.Forms.ToolTip(this.components);
|
this.oToolTip = new System.Windows.Forms.ToolTip(this.components);
|
||||||
this.label3 = new System.Windows.Forms.Label();
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
this.pbxIcon = new System.Windows.Forms.PictureBox();
|
this.pbxIcon = new System.Windows.Forms.PictureBox();
|
||||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||||
this.button1 = new RyzStudio.Windows.Forms.BigButton();
|
this.button1 = new RyzStudio.Windows.Forms.BigButton();
|
||||||
this.btnSave = new RyzStudio.Windows.Forms.BigButton();
|
this.btnSave = new RyzStudio.Windows.Forms.BigButton();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pbxIcon)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.pbxIcon)).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// label1
|
// label1
|
||||||
//
|
//
|
||||||
this.label1.AutoSize = true;
|
this.label1.AutoSize = true;
|
||||||
this.label1.Location = new System.Drawing.Point(12, 12);
|
this.label1.Location = new System.Drawing.Point(12, 12);
|
||||||
this.label1.Margin = new System.Windows.Forms.Padding(3);
|
this.label1.Margin = new System.Windows.Forms.Padding(3);
|
||||||
this.label1.Name = "label1";
|
this.label1.Name = "label1";
|
||||||
this.label1.Size = new System.Drawing.Size(39, 13);
|
this.label1.Size = new System.Drawing.Size(39, 13);
|
||||||
this.label1.TabIndex = 0;
|
this.label1.TabIndex = 0;
|
||||||
this.label1.Text = "Name:";
|
this.label1.Text = "Name:";
|
||||||
//
|
//
|
||||||
// tbxAddress
|
// tbxAddress
|
||||||
//
|
//
|
||||||
this.tbxAddress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
this.tbxAddress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.tbxAddress.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
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.Location = new System.Drawing.Point(12, 78);
|
||||||
this.tbxAddress.MaxLength = 4096;
|
this.tbxAddress.MaxLength = 4096;
|
||||||
this.tbxAddress.Name = "tbxAddress";
|
this.tbxAddress.Name = "tbxAddress";
|
||||||
this.tbxAddress.Size = new System.Drawing.Size(240, 22);
|
this.tbxAddress.Size = new System.Drawing.Size(240, 22);
|
||||||
this.tbxAddress.TabIndex = 0;
|
this.tbxAddress.TabIndex = 1;
|
||||||
this.tbxAddress.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.textBox_PreviewKeyDown);
|
this.tbxAddress.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.textBox_PreviewKeyDown);
|
||||||
//
|
//
|
||||||
// tbxName
|
// tbxName
|
||||||
//
|
//
|
||||||
this.tbxName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
this.tbxName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.tbxName.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
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.Location = new System.Drawing.Point(12, 31);
|
||||||
this.tbxName.MaxLength = 4096;
|
this.tbxName.MaxLength = 4096;
|
||||||
this.tbxName.Name = "tbxName";
|
this.tbxName.Name = "tbxName";
|
||||||
this.tbxName.Size = new System.Drawing.Size(212, 22);
|
this.tbxName.Size = new System.Drawing.Size(212, 22);
|
||||||
this.tbxName.TabIndex = 1;
|
this.tbxName.TabIndex = 0;
|
||||||
this.tbxName.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.textBox_PreviewKeyDown);
|
this.tbxName.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.textBox_PreviewKeyDown);
|
||||||
//
|
//
|
||||||
// label2
|
// label2
|
||||||
//
|
//
|
||||||
this.label2.AutoSize = true;
|
this.label2.AutoSize = true;
|
||||||
this.label2.Location = new System.Drawing.Point(12, 59);
|
this.label2.Location = new System.Drawing.Point(12, 59);
|
||||||
this.label2.Margin = new System.Windows.Forms.Padding(3);
|
this.label2.Margin = new System.Windows.Forms.Padding(3);
|
||||||
this.label2.Name = "label2";
|
this.label2.Name = "label2";
|
||||||
this.label2.Size = new System.Drawing.Size(51, 13);
|
this.label2.Size = new System.Drawing.Size(51, 13);
|
||||||
this.label2.TabIndex = 4;
|
this.label2.TabIndex = 4;
|
||||||
this.label2.Text = "Address:";
|
this.label2.Text = "Address:";
|
||||||
//
|
//
|
||||||
// tbxDescription
|
// tbxDescription
|
||||||
//
|
//
|
||||||
this.tbxDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
this.tbxDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.tbxDescription.BackColor = System.Drawing.SystemColors.Window;
|
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.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.Location = new System.Drawing.Point(12, 125);
|
||||||
this.tbxDescription.MaxLength = 4096;
|
this.tbxDescription.MaxLength = 4096;
|
||||||
this.tbxDescription.Multiline = true;
|
this.tbxDescription.Multiline = true;
|
||||||
this.tbxDescription.Name = "tbxDescription";
|
this.tbxDescription.Name = "tbxDescription";
|
||||||
this.tbxDescription.Size = new System.Drawing.Size(240, 84);
|
this.tbxDescription.Size = new System.Drawing.Size(240, 84);
|
||||||
this.tbxDescription.TabIndex = 2;
|
this.tbxDescription.TabIndex = 2;
|
||||||
this.tbxDescription.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.textBox_PreviewKeyDown);
|
this.tbxDescription.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.textBox_PreviewKeyDown);
|
||||||
//
|
//
|
||||||
// oToolTip
|
// oToolTip
|
||||||
//
|
//
|
||||||
this.oToolTip.Active = false;
|
this.oToolTip.Active = false;
|
||||||
this.oToolTip.BackColor = System.Drawing.Color.IndianRed;
|
this.oToolTip.BackColor = System.Drawing.Color.IndianRed;
|
||||||
//
|
//
|
||||||
// label3
|
// label3
|
||||||
//
|
//
|
||||||
this.label3.AutoSize = true;
|
this.label3.AutoSize = true;
|
||||||
this.label3.Location = new System.Drawing.Point(12, 106);
|
this.label3.Location = new System.Drawing.Point(12, 106);
|
||||||
this.label3.Margin = new System.Windows.Forms.Padding(3);
|
this.label3.Margin = new System.Windows.Forms.Padding(3);
|
||||||
this.label3.Name = "label3";
|
this.label3.Name = "label3";
|
||||||
this.label3.Size = new System.Drawing.Size(69, 13);
|
this.label3.Size = new System.Drawing.Size(69, 13);
|
||||||
this.label3.TabIndex = 55;
|
this.label3.TabIndex = 55;
|
||||||
this.label3.Text = "Description:";
|
this.label3.Text = "Description:";
|
||||||
//
|
//
|
||||||
// pbxIcon
|
// pbxIcon
|
||||||
//
|
//
|
||||||
this.pbxIcon.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
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.BackColor = System.Drawing.SystemColors.Window;
|
||||||
this.pbxIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
|
this.pbxIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
|
||||||
this.pbxIcon.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
this.pbxIcon.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||||
this.pbxIcon.ErrorImage = null;
|
this.pbxIcon.ErrorImage = null;
|
||||||
this.pbxIcon.InitialImage = null;
|
this.pbxIcon.InitialImage = null;
|
||||||
this.pbxIcon.Location = new System.Drawing.Point(230, 31);
|
this.pbxIcon.Location = new System.Drawing.Point(230, 31);
|
||||||
this.pbxIcon.Name = "pbxIcon";
|
this.pbxIcon.Name = "pbxIcon";
|
||||||
this.pbxIcon.Size = new System.Drawing.Size(22, 22);
|
this.pbxIcon.Size = new System.Drawing.Size(22, 22);
|
||||||
this.pbxIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
|
this.pbxIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
|
||||||
this.pbxIcon.TabIndex = 57;
|
this.pbxIcon.TabIndex = 57;
|
||||||
this.pbxIcon.TabStop = false;
|
this.pbxIcon.TabStop = false;
|
||||||
//
|
//
|
||||||
// pictureBox1
|
// pictureBox1
|
||||||
//
|
//
|
||||||
this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
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.BackColor = System.Drawing.Color.Transparent;
|
||||||
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
|
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
|
||||||
this.pictureBox1.ErrorImage = null;
|
this.pictureBox1.ErrorImage = null;
|
||||||
this.pictureBox1.InitialImage = null;
|
this.pictureBox1.InitialImage = null;
|
||||||
this.pictureBox1.Location = new System.Drawing.Point(12, 227);
|
this.pictureBox1.Location = new System.Drawing.Point(12, 227);
|
||||||
this.pictureBox1.Name = "pictureBox1";
|
this.pictureBox1.Name = "pictureBox1";
|
||||||
this.pictureBox1.Size = new System.Drawing.Size(32, 32);
|
this.pictureBox1.Size = new System.Drawing.Size(32, 32);
|
||||||
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
|
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
|
||||||
this.pictureBox1.TabIndex = 60;
|
this.pictureBox1.TabIndex = 60;
|
||||||
this.pictureBox1.TabStop = false;
|
this.pictureBox1.TabStop = false;
|
||||||
//
|
//
|
||||||
// button1
|
// button1
|
||||||
//
|
//
|
||||||
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
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.BackColor = System.Drawing.Color.WhiteSmoke;
|
||||||
this.button1.Location = new System.Drawing.Point(118, 227);
|
this.button1.Location = new System.Drawing.Point(118, 227);
|
||||||
this.button1.MaximumSize = new System.Drawing.Size(120, 32);
|
this.button1.MaximumSize = new System.Drawing.Size(120, 32);
|
||||||
this.button1.MinimumSize = new System.Drawing.Size(32, 32);
|
this.button1.MinimumSize = new System.Drawing.Size(32, 32);
|
||||||
this.button1.Name = "button1";
|
this.button1.Name = "button1";
|
||||||
this.button1.Padding = new System.Windows.Forms.Padding(4);
|
this.button1.Padding = new System.Windows.Forms.Padding(4);
|
||||||
this.button1.Size = new System.Drawing.Size(32, 32);
|
this.button1.Size = new System.Drawing.Size(32, 32);
|
||||||
this.button1.TabIndex = 4;
|
this.button1.TabIndex = 3;
|
||||||
this.button1.Value = "";
|
this.button1.Value = "";
|
||||||
this.button1.Click += new System.EventHandler(this.btnRetrievePage_Click);
|
this.button1.Click += new System.EventHandler(this.btnRetrievePage_Click);
|
||||||
//
|
//
|
||||||
// btnSave
|
// btnSave
|
||||||
//
|
//
|
||||||
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
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.BackColor = System.Drawing.Color.WhiteSmoke;
|
||||||
this.btnSave.Location = new System.Drawing.Point(156, 227);
|
this.btnSave.Location = new System.Drawing.Point(156, 227);
|
||||||
this.btnSave.MaximumSize = new System.Drawing.Size(120, 32);
|
this.btnSave.MaximumSize = new System.Drawing.Size(120, 32);
|
||||||
this.btnSave.MinimumSize = new System.Drawing.Size(32, 32);
|
this.btnSave.MinimumSize = new System.Drawing.Size(32, 32);
|
||||||
this.btnSave.Name = "btnSave";
|
this.btnSave.Name = "btnSave";
|
||||||
this.btnSave.Padding = new System.Windows.Forms.Padding(4);
|
this.btnSave.Padding = new System.Windows.Forms.Padding(4);
|
||||||
this.btnSave.Size = new System.Drawing.Size(96, 32);
|
this.btnSave.Size = new System.Drawing.Size(96, 32);
|
||||||
this.btnSave.TabIndex = 3;
|
this.btnSave.TabIndex = 4;
|
||||||
this.btnSave.Value = "&OK";
|
this.btnSave.Value = "&OK";
|
||||||
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
|
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
|
||||||
//
|
//
|
||||||
// BookmarkEditForm
|
// BookmarkEditForm
|
||||||
//
|
//
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||||
this.BackColor = System.Drawing.Color.White;
|
this.BackColor = System.Drawing.Color.White;
|
||||||
this.ClientSize = new System.Drawing.Size(264, 271);
|
this.ClientSize = new System.Drawing.Size(264, 271);
|
||||||
this.Controls.Add(this.button1);
|
this.Controls.Add(this.button1);
|
||||||
this.Controls.Add(this.pictureBox1);
|
this.Controls.Add(this.pictureBox1);
|
||||||
this.Controls.Add(this.pbxIcon);
|
this.Controls.Add(this.pbxIcon);
|
||||||
this.Controls.Add(this.tbxDescription);
|
this.Controls.Add(this.tbxDescription);
|
||||||
this.Controls.Add(this.label3);
|
this.Controls.Add(this.label3);
|
||||||
this.Controls.Add(this.tbxName);
|
this.Controls.Add(this.tbxName);
|
||||||
this.Controls.Add(this.label1);
|
this.Controls.Add(this.label1);
|
||||||
this.Controls.Add(this.tbxAddress);
|
this.Controls.Add(this.tbxAddress);
|
||||||
this.Controls.Add(this.btnSave);
|
this.Controls.Add(this.btnSave);
|
||||||
this.Controls.Add(this.label2);
|
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.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.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||||
this.MaximizeBox = false;
|
this.MaximizeBox = false;
|
||||||
this.MinimizeBox = false;
|
this.MinimizeBox = false;
|
||||||
this.Name = "BookmarkEditForm";
|
this.Name = "BookmarkEditForm";
|
||||||
this.ShowInTaskbar = false;
|
this.ShowInTaskbar = false;
|
||||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||||
this.Text = "Edit Bookmark";
|
this.Text = "Edit Bookmark";
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pbxIcon)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.pbxIcon)).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
this.PerformLayout();
|
this.PerformLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ namespace bzit.bomg
|
|||||||
{
|
{
|
||||||
bookmarkItem = (BookmarkItem)parentNode.Tag;
|
bookmarkItem = (BookmarkItem)parentNode.Tag;
|
||||||
tbxName.Text = bookmarkItem.GetName();
|
tbxName.Text = bookmarkItem.GetName();
|
||||||
tbxAddress.Text = bookmarkItem.Address;
|
tbxAddress.Text = bookmarkItem.SiteAddress;
|
||||||
tbxDescription.Text = bookmarkItem.Description;
|
tbxDescription.Text = bookmarkItem.Description;
|
||||||
|
|
||||||
if (parentNode.TreeView.ImageList != null)
|
if (parentNode.TreeView.ImageList != null)
|
||||||
@ -125,12 +125,12 @@ namespace bzit.bomg
|
|||||||
}
|
}
|
||||||
|
|
||||||
bookmarkItem.ChangeName(tbxName.Text.Trim());
|
bookmarkItem.ChangeName(tbxName.Text.Trim());
|
||||||
bookmarkItem.Address = tbxAddress.Text.Trim();
|
bookmarkItem.SiteAddress = tbxAddress.Text.Trim();
|
||||||
bookmarkItem.Description = tbxDescription.Text.Trim();
|
bookmarkItem.Description = tbxDescription.Text.Trim();
|
||||||
|
|
||||||
parentNode.Text = tbxName.Text.Trim();
|
parentNode.Text = tbxName.Text.Trim();
|
||||||
//// parentNode.ImageIndex = parentNode.SelectedImageIndex = 3;
|
//// parentNode.ImageIndex = parentNode.SelectedImageIndex = 3;
|
||||||
parentNode.ToolTipText = string.Concat(bookmarkItem.Address, Environment.NewLine, bookmarkItem.Description).Trim();
|
parentNode.ToolTipText = string.Concat(bookmarkItem.SiteAddress, Environment.NewLine, bookmarkItem.Description).Trim();
|
||||||
parentNode.Tag = bookmarkItem;
|
parentNode.Tag = bookmarkItem;
|
||||||
|
|
||||||
BookmarkTreeView bookmarkTreeView = (BookmarkTreeView)parentNode.TreeView;
|
BookmarkTreeView bookmarkTreeView = (BookmarkTreeView)parentNode.TreeView;
|
||||||
@ -144,13 +144,13 @@ namespace bzit.bomg
|
|||||||
|
|
||||||
protected void bookmarkItem_OnRetrieveCompleted(BookmarkItem sender, bool hasError, string message)
|
protected void bookmarkItem_OnRetrieveCompleted(BookmarkItem sender, bool hasError, string message)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(sender.TempName))
|
if (string.IsNullOrEmpty(sender.SiteName))
|
||||||
{
|
{
|
||||||
if (MessageBox.Show("The page could not be retrieved or the title is blank. Do you want to keep your original title?", "Keep original?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
|
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;
|
bookmarkItem.SiteName = sender.SiteName;
|
||||||
|
|
||||||
tbxName.Text = bookmarkItem.TempName;
|
tbxName.Text = bookmarkItem.SiteName;
|
||||||
|
|
||||||
// don't replace with blank
|
// don't replace with blank
|
||||||
if (!string.IsNullOrEmpty(sender.Description))
|
if (!string.IsNullOrEmpty(sender.Description))
|
||||||
@ -161,9 +161,9 @@ namespace bzit.bomg
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bookmarkItem.TempName = sender.TempName;
|
bookmarkItem.SiteName = sender.SiteName;
|
||||||
|
|
||||||
tbxName.Text = bookmarkItem.TempName;
|
tbxName.Text = bookmarkItem.SiteName;
|
||||||
|
|
||||||
// don't replace with blank
|
// don't replace with blank
|
||||||
if (!string.IsNullOrEmpty(sender.Description))
|
if (!string.IsNullOrEmpty(sender.Description))
|
||||||
|
508
BookmarkItem.cs
508
BookmarkItem.cs
@ -1,9 +1,11 @@
|
|||||||
using System;
|
using HtmlAgilityPack;
|
||||||
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using HtmlDocument = HtmlAgilityPack.HtmlDocument;
|
||||||
|
|
||||||
namespace bzit.bomg
|
namespace bzit.bomg
|
||||||
{
|
{
|
||||||
@ -11,9 +13,22 @@ namespace bzit.bomg
|
|||||||
{
|
{
|
||||||
public delegate void RetrieveCompleted(BookmarkItem sender, bool hasError, string message);
|
public delegate void RetrieveCompleted(BookmarkItem sender, bool hasError, string message);
|
||||||
|
|
||||||
protected const char pathSeparator = '|';
|
public RetrieveCompleted OnRetrieveCompleted { get; set; } = null;
|
||||||
|
|
||||||
protected TreeNode treeNode = null;
|
public TreeNode TreeViewNode { get; protected set; }
|
||||||
|
|
||||||
|
public byte[] IconData { get; set; } = null;
|
||||||
|
|
||||||
|
public string SiteName { get; set; } = null;
|
||||||
|
public string SiteAddress { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
public string IconAddress { get; protected set; }
|
||||||
|
public string Fullpath { get; set; }
|
||||||
|
public string Created { get; set; }
|
||||||
|
|
||||||
|
protected const char pathSeparator = '|';
|
||||||
|
|
||||||
|
//protected TreeNode treeNode = null;
|
||||||
protected BackgroundWorker mainThread = null;
|
protected BackgroundWorker mainThread = null;
|
||||||
|
|
||||||
protected bool hasRetrieveError = false;
|
protected bool hasRetrieveError = false;
|
||||||
@ -28,7 +43,7 @@ namespace bzit.bomg
|
|||||||
{
|
{
|
||||||
string rv = "";
|
string rv = "";
|
||||||
rv += "Name=" + this.Fullpath + Environment.NewLine;
|
rv += "Name=" + this.Fullpath + Environment.NewLine;
|
||||||
rv += "Address=" + this.Address + Environment.NewLine;
|
rv += "Address=" + this.SiteAddress + Environment.NewLine;
|
||||||
rv += "Description=" + this.Description + Environment.NewLine;
|
rv += "Description=" + this.Description + Environment.NewLine;
|
||||||
rv += "Created=" + this.Created?.Trim();
|
rv += "Created=" + this.Created?.Trim();
|
||||||
|
|
||||||
@ -37,18 +52,18 @@ namespace bzit.bomg
|
|||||||
|
|
||||||
#region public properties
|
#region public properties
|
||||||
|
|
||||||
public TreeNode TreeViewNode
|
|
||||||
{
|
//{
|
||||||
get
|
// get
|
||||||
{
|
// {
|
||||||
return this.treeNode;
|
// return this.treeNode;
|
||||||
}
|
// }
|
||||||
|
|
||||||
set
|
// set
|
||||||
{
|
// {
|
||||||
this.treeNode = value;
|
// this.treeNode = value;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
public Bitmap Icon
|
public Bitmap Icon
|
||||||
{
|
{
|
||||||
@ -71,20 +86,7 @@ namespace bzit.bomg
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[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
|
#endregion
|
||||||
|
|
||||||
@ -93,7 +95,7 @@ namespace bzit.bomg
|
|||||||
public void Clear()
|
public void Clear()
|
||||||
{
|
{
|
||||||
this.Fullpath = string.Empty;
|
this.Fullpath = string.Empty;
|
||||||
this.Address = string.Empty;
|
this.SiteAddress = string.Empty;
|
||||||
this.Description = string.Empty;
|
this.Description = string.Empty;
|
||||||
this.Created = string.Empty;
|
this.Created = string.Empty;
|
||||||
|
|
||||||
@ -110,17 +112,17 @@ namespace bzit.bomg
|
|||||||
{
|
{
|
||||||
if (this.Fullpath.Contains(pathSeparator.ToString()))
|
if (this.Fullpath.Contains(pathSeparator.ToString()))
|
||||||
{
|
{
|
||||||
return PathDecode(this.Fullpath.Substring(this.Fullpath.LastIndexOf(pathSeparator) + 1)).Trim();
|
return decodePath(this.Fullpath.Substring(this.Fullpath.LastIndexOf(pathSeparator) + 1)).Trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
return PathDecode(this.Fullpath).Trim();
|
return decodePath(this.Fullpath).Trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ChangeName(string newName)
|
public void ChangeName(string newName)
|
||||||
{
|
{
|
||||||
string prefix = (this.Fullpath.Contains(pathSeparator.ToString()) ? this.Fullpath.Substring(0, this.Fullpath.IndexOf(pathSeparator)).Trim() : string.Empty);
|
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()));
|
this.Fullpath = string.Concat(prefix, pathSeparator, encodePath(newName.Trim()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GetFaviconAddress()
|
public void GetFaviconAddress()
|
||||||
@ -137,7 +139,7 @@ namespace bzit.bomg
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
sourceCode = webClient.DownloadString(this.Address);
|
sourceCode = webClient.DownloadString(this.SiteAddress);
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
@ -149,67 +151,98 @@ namespace bzit.bomg
|
|||||||
HtmlAgilityPack.HtmlDocument document = new HtmlAgilityPack.HtmlDocument();
|
HtmlAgilityPack.HtmlDocument document = new HtmlAgilityPack.HtmlDocument();
|
||||||
document.LoadHtml(sourceCode);
|
document.LoadHtml(sourceCode);
|
||||||
|
|
||||||
// parse icon
|
// favicon
|
||||||
HtmlAgilityPack.HtmlNodeCollection hnc = document.DocumentNode.SelectNodes("//link");
|
this.IconAddress = parseSiteIcon(document);
|
||||||
if (hnc != null)
|
if (!string.IsNullOrWhiteSpace(this.IconAddress))
|
||||||
{
|
{
|
||||||
foreach (HtmlAgilityPack.HtmlNode node in hnc)
|
Uri iconAddressURI;
|
||||||
{
|
bool rv = Uri.TryCreate(new Uri(this.SiteAddress), this.IconAddress, out iconAddressURI);
|
||||||
if (node.Attributes["rel"] == null)
|
if (rv)
|
||||||
{
|
{
|
||||||
continue;
|
this.IconAddress = iconAddressURI.ToString();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
string nodeAttr = node.Attributes["rel"].Value.Trim();
|
// load favicon image
|
||||||
if (nodeAttr.ToLower().Contains("icon"))
|
if (!string.IsNullOrEmpty(this.IconAddress))
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(this.IconAddress))
|
try
|
||||||
{
|
{
|
||||||
continue;
|
this.IconData = webClient.DownloadData(this.IconAddress);
|
||||||
}
|
|
||||||
|
|
||||||
if (node.Attributes["href"] != null)
|
if (!RyzStudio.IO.FileType.IsImage(this.IconData))
|
||||||
{
|
{
|
||||||
Uri iconPath;
|
this.IconData = null;
|
||||||
bool rv = Uri.TryCreate(new Uri(this.Address), WebUtility.HtmlDecode(node.Attributes["href"].Value).Trim(), out iconPath);
|
}
|
||||||
if (rv)
|
}
|
||||||
{
|
catch
|
||||||
this.IconAddress = iconPath.ToString();
|
{
|
||||||
}
|
this.IconData = null;
|
||||||
|
this.IconAddress = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
//// parse icon
|
||||||
}
|
//HtmlAgilityPack.HtmlNodeCollection hnc = document.DocumentNode.SelectNodes("//link");
|
||||||
}
|
// if (hnc != null)
|
||||||
}
|
// {
|
||||||
}
|
// foreach (HtmlAgilityPack.HtmlNode node in hnc)
|
||||||
|
// {
|
||||||
|
// if (node.Attributes["rel"] == null)
|
||||||
|
// {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
|
||||||
// default favicon
|
// string nodeAttr = node.Attributes["rel"].Value.Trim();
|
||||||
if (string.IsNullOrEmpty(this.IconAddress))
|
// if (nodeAttr.ToLower().Contains("icon"))
|
||||||
{
|
// {
|
||||||
Uri iconPath;
|
// if (!string.IsNullOrEmpty(this.IconAddress))
|
||||||
if (Uri.TryCreate(new Uri(this.Address), "/favicon.ico", out iconPath))
|
// {
|
||||||
{
|
// continue;
|
||||||
this.IconAddress = iconPath.ToString();
|
// }
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// load icon image
|
// if (node.Attributes["href"] != null)
|
||||||
if (!string.IsNullOrEmpty(this.IconAddress))
|
// {
|
||||||
{
|
// Uri iconPath;
|
||||||
try
|
// bool rv = Uri.TryCreate(new Uri(this.SiteAddress), WebUtility.HtmlDecode(node.Attributes["href"].Value).Trim(), out iconPath);
|
||||||
{
|
// if (rv)
|
||||||
this.IconData = webClient.DownloadData(this.IconAddress);
|
// {
|
||||||
|
// this.IconAddress = iconPath.ToString();
|
||||||
|
// }
|
||||||
|
|
||||||
if (!RyzStudio.IO.FileType.IsImage(this.IconData))
|
// break;
|
||||||
{
|
// }
|
||||||
this.IconData = null;
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
catch
|
|
||||||
{
|
// // default favicon
|
||||||
// do nothing
|
// if (string.IsNullOrEmpty(this.IconAddress))
|
||||||
}
|
// {
|
||||||
}
|
// Uri iconPath;
|
||||||
|
// if (Uri.TryCreate(new Uri(this.SiteAddress), "/favicon.ico", out iconPath))
|
||||||
|
// {
|
||||||
|
// this.IconAddress = iconPath.ToString();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // load icon image
|
||||||
|
// if (!string.IsNullOrEmpty(this.IconAddress))
|
||||||
|
// {
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// this.IconData = webClient.DownloadData(this.IconAddress);
|
||||||
|
|
||||||
|
// if (!RyzStudio.IO.FileType.IsImage(this.IconData))
|
||||||
|
// {
|
||||||
|
// this.IconData = null;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// catch
|
||||||
|
// {
|
||||||
|
// // do nothing
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RetrieveAsync()
|
public void RetrieveAsync()
|
||||||
@ -229,17 +262,12 @@ namespace bzit.bomg
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Address = address;
|
this.SiteAddress = address;
|
||||||
this.mainThread.RunWorkerAsync();
|
this.mainThread.RunWorkerAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region events & delegate
|
|
||||||
|
|
||||||
public RetrieveCompleted OnRetrieveCompleted = null;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
protected void retrieveWorker_DoWork(object sender, DoWorkEventArgs e)
|
protected void retrieveWorker_DoWork(object sender, DoWorkEventArgs e)
|
||||||
{
|
{
|
||||||
@ -254,11 +282,11 @@ namespace bzit.bomg
|
|||||||
WebClient webClient = new WebClient();
|
WebClient webClient = new WebClient();
|
||||||
webClient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore);
|
webClient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore);
|
||||||
|
|
||||||
string sourceCode = string.Empty;
|
string sourceCode = string.Empty;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
sourceCode = webClient.DownloadString(this.Address);
|
sourceCode = webClient.DownloadString(this.SiteAddress);
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
@ -267,92 +295,28 @@ namespace bzit.bomg
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
HtmlAgilityPack.HtmlDocument document = new HtmlAgilityPack.HtmlDocument();
|
HtmlDocument document = new HtmlDocument();
|
||||||
document.LoadHtml(sourceCode);
|
document.LoadHtml(sourceCode);
|
||||||
|
|
||||||
// parse title
|
// title
|
||||||
HtmlAgilityPack.HtmlNodeCollection hnc = document.DocumentNode.SelectNodes("//title");
|
this.SiteName = parseSiteTitle(document);
|
||||||
if (hnc != null)
|
|
||||||
{
|
|
||||||
if (hnc.Count > 0)
|
|
||||||
{
|
|
||||||
this.TempName = WebUtility.HtmlDecode(hnc[0].InnerHtml).Trim();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// parse description
|
// description
|
||||||
hnc = document.DocumentNode.SelectNodes("//meta");
|
this.Description = parseSiteDescription(document);
|
||||||
if (hnc != null)
|
|
||||||
{
|
|
||||||
foreach (HtmlAgilityPack.HtmlNode node in hnc)
|
|
||||||
{
|
|
||||||
if (node.Attributes["name"] == null)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
string nodeAttr = node.Attributes["name"].Value.Trim();
|
// favicon
|
||||||
if (nodeAttr.Equals("description", StringComparison.CurrentCultureIgnoreCase))
|
this.IconAddress = parseSiteIcon(document);
|
||||||
{
|
if (!string.IsNullOrWhiteSpace(this.IconAddress))
|
||||||
if (!string.IsNullOrEmpty(this.Description))
|
{
|
||||||
{
|
Uri iconAddressURI;
|
||||||
continue;
|
bool rv = Uri.TryCreate(new Uri(this.SiteAddress), this.IconAddress, out iconAddressURI);
|
||||||
}
|
if (rv)
|
||||||
|
{
|
||||||
|
this.IconAddress = iconAddressURI.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (node.Attributes["content"] != null)
|
// load favicon image
|
||||||
{
|
|
||||||
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))
|
if (!string.IsNullOrEmpty(this.IconAddress))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -366,8 +330,9 @@ namespace bzit.bomg
|
|||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
// do nothing
|
this.IconData = null;
|
||||||
}
|
this.IconAddress = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -376,11 +341,184 @@ namespace bzit.bomg
|
|||||||
this.OnRetrieveCompleted?.Invoke(this, hasRetrieveError, retrieveErrorMessage);
|
this.OnRetrieveCompleted?.Invoke(this, hasRetrieveError, retrieveErrorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// protected string CustomDecode(string text) { return WebUtility.HtmlDecode(text); }
|
protected string encodePath(string text) => System.Web.HttpUtility.UrlEncode(text);
|
||||||
|
|
||||||
////protected string PathEncode(string text) { return RyzStudio.String.EncodeTo64(text); }
|
protected string decodePath(string text) => System.Web.HttpUtility.UrlDecode(text);
|
||||||
////protected string PathDecode(string text) { return RyzStudio.String.DecodeFrom64(text); }
|
|
||||||
protected string PathEncode(string text) { return System.Web.HttpUtility.UrlEncodeUnicode(text); }
|
protected string parseTagValue(HtmlDocument doc, string xpath, string defaultValue = "")
|
||||||
protected string PathDecode(string text) { return System.Web.HttpUtility.UrlDecode(text); }
|
{
|
||||||
}
|
HtmlNodeCollection hnc = doc.DocumentNode.SelectNodes(xpath);
|
||||||
|
if (hnc == null)
|
||||||
|
{
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hnc.Count <= 0)
|
||||||
|
{
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (HtmlNode hn in hnc)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(hn.InnerHtml))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
string rs = WebUtility.HtmlDecode(hn.InnerHtml)?.Replace("\r", "")?.Replace("\n", " ")?.Trim();
|
||||||
|
if (string.IsNullOrWhiteSpace(rs))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rs;
|
||||||
|
}
|
||||||
|
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected string parseTagValue_Attr(HtmlDocument doc, string xpath, string attr, string defaultValue = "")
|
||||||
|
{
|
||||||
|
HtmlNodeCollection hnc = doc.DocumentNode.SelectNodes(xpath);
|
||||||
|
if (hnc == null)
|
||||||
|
{
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hnc.Count <= 0)
|
||||||
|
{
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (HtmlNode hn in hnc)
|
||||||
|
{
|
||||||
|
if (hn.Attributes[attr] == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(hn.Attributes[attr].Value))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return System.Web.HttpUtility.HtmlDecode(hn.Attributes[attr].Value?.Trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected string parseSiteTitle(HtmlDocument doc)
|
||||||
|
{
|
||||||
|
string rs = null;
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(rs))
|
||||||
|
{
|
||||||
|
rs = parseTagValue(doc, "//title", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(rs))
|
||||||
|
{
|
||||||
|
rs = parseTagValue_Attr(doc, "//meta[@property='og:title']", "content", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(rs))
|
||||||
|
{
|
||||||
|
rs = parseTagValue_Attr(doc, "//meta[@name='twitter:title']", "content", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(rs))
|
||||||
|
{
|
||||||
|
rs = parseTagValue_Attr(doc, "//meta[@property='og:site_name']", "content", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(rs))
|
||||||
|
{
|
||||||
|
rs = parseTagValue_Attr(doc, "//meta[@itemprop='name']", "content", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
return rs;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected string parseSiteDescription(HtmlDocument doc)
|
||||||
|
{
|
||||||
|
string rs = null;
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(rs))
|
||||||
|
{
|
||||||
|
rs = parseTagValue_Attr(doc, "//meta[@name='description']", "content", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(rs))
|
||||||
|
{
|
||||||
|
rs = parseTagValue_Attr(doc, "//meta[@property='og:description']", "content", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(rs))
|
||||||
|
{
|
||||||
|
rs = parseTagValue_Attr(doc, "//meta[@name='twitter:description']", "content", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(rs))
|
||||||
|
{
|
||||||
|
rs = parseTagValue_Attr(doc, "//meta[@property='og:description']", "content", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(rs))
|
||||||
|
{
|
||||||
|
rs = parseTagValue_Attr(doc, "//meta[@itemprop='description']", "content", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
return rs;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected string parseSiteIcon(HtmlDocument doc)
|
||||||
|
{
|
||||||
|
string rs = null;
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(rs))
|
||||||
|
{
|
||||||
|
rs = parseTagValue_Attr(doc, "//link[@rel='shortcut icon']", "href", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(rs))
|
||||||
|
{
|
||||||
|
rs = parseTagValue_Attr(doc, "//link[@rel='icon']", "href", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(rs))
|
||||||
|
{
|
||||||
|
rs = parseTagValue_Attr(doc, "//link[@rel='apple-touch-icon']", "href", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(rs))
|
||||||
|
{
|
||||||
|
rs = parseTagValue_Attr(doc, "//link[@rel='apple-touch-icon-precomposed']", "href", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(rs))
|
||||||
|
{
|
||||||
|
rs = parseTagValue_Attr(doc, "//meta[@property='og:image']", "content", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(rs))
|
||||||
|
{
|
||||||
|
rs = parseTagValue_Attr(doc, "//meta[@name='twitter:image']", "content", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(rs))
|
||||||
|
{
|
||||||
|
rs = parseTagValue_Attr(doc, "//meta[@property='og:image']", "content", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(rs))
|
||||||
|
{
|
||||||
|
rs = parseTagValue_Attr(doc, "//meta[@itemprop='image']", "content", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
return rs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
@ -67,18 +67,18 @@ namespace bzit.bomg
|
|||||||
|
|
||||||
TreeNode tn = AddBookmarkPageFullPath(name.Trim(), 3);
|
TreeNode tn = AddBookmarkPageFullPath(name.Trim(), 3);
|
||||||
tn.Tag = tag;
|
tn.Tag = tag;
|
||||||
tn.ToolTipText = tag.Address + Environment.NewLine + tag.Description;
|
tn.ToolTipText = tag.SiteAddress + Environment.NewLine + tag.Description;
|
||||||
|
|
||||||
// load icon
|
// load icon
|
||||||
if (this.IconDatabase.HasIcon(tag.Address))
|
if (this.IconDatabase.HasIcon(tag.SiteAddress))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Image icon = this.IconDatabase.GetIcon(tag.Address);
|
Image icon = this.IconDatabase.GetIcon(tag.SiteAddress);
|
||||||
if (icon != null)
|
if (icon != null)
|
||||||
{
|
{
|
||||||
tn.TreeView.ImageList.Images.Add(tag.Address, icon);
|
tn.TreeView.ImageList.Images.Add(tag.SiteAddress, icon);
|
||||||
tn.ImageKey = tn.SelectedImageKey = tag.Address;
|
tn.ImageKey = tn.SelectedImageKey = tag.SiteAddress;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
@ -91,13 +91,13 @@ namespace bzit.bomg
|
|||||||
public int AddToIconList(BookmarkItem sender)
|
public int AddToIconList(BookmarkItem sender)
|
||||||
{
|
{
|
||||||
Image rs = null;
|
Image rs = null;
|
||||||
if (this.IconDatabase.HasIcon(sender.Address))
|
if (this.IconDatabase.HasIcon(sender.SiteAddress))
|
||||||
{
|
{
|
||||||
rs = this.IconDatabase.GetIcon(sender.Address);
|
rs = this.IconDatabase.GetIcon(sender.SiteAddress);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (this.IconDatabase.AddIcon(sender.Address, sender.IconData))
|
if (this.IconDatabase.AddIcon(sender.SiteAddress, sender.IconData))
|
||||||
{
|
{
|
||||||
rs = sender.Icon;
|
rs = sender.Icon;
|
||||||
}
|
}
|
||||||
@ -105,8 +105,8 @@ namespace bzit.bomg
|
|||||||
|
|
||||||
if (rs != null)
|
if (rs != null)
|
||||||
{
|
{
|
||||||
this.ImageList.Images.Add(sender.Address, rs);
|
this.ImageList.Images.Add(sender.SiteAddress, rs);
|
||||||
return this.ImageList.Images.IndexOfKey(sender.Address);
|
return this.ImageList.Images.IndexOfKey(sender.SiteAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 3;
|
return 3;
|
||||||
@ -114,12 +114,12 @@ namespace bzit.bomg
|
|||||||
|
|
||||||
public void AddIcon(BookmarkItem sender)
|
public void AddIcon(BookmarkItem sender)
|
||||||
{
|
{
|
||||||
if (this.IconDatabase.HasIcon(sender.Address))
|
if (this.IconDatabase.HasIcon(sender.SiteAddress))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.IconDatabase.AddIcon(sender.Address, sender.IconData);
|
this.IconDatabase.AddIcon(sender.SiteAddress, sender.IconData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
12
MainForm.cs
12
MainForm.cs
@ -743,14 +743,14 @@ namespace bzit.bomg
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(bookmarkItem.Address))
|
if (string.IsNullOrEmpty(bookmarkItem.SiteAddress))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Clipboard.SetText(bookmarkItem.Address.Trim());
|
Clipboard.SetText(bookmarkItem.SiteAddress.Trim());
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@ -788,7 +788,7 @@ namespace bzit.bomg
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(item.Address))
|
if (string.IsNullOrEmpty(item.SiteAddress))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -810,8 +810,8 @@ namespace bzit.bomg
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bookmarkCustom1 = bookmarkCustom1.Replace("%1", item.Address);
|
bookmarkCustom1 = bookmarkCustom1.Replace("%1", item.SiteAddress);
|
||||||
bookmarkCustom2 = bookmarkCustom2.Replace("%1", item.Address);
|
bookmarkCustom2 = bookmarkCustom2.Replace("%1", item.SiteAddress);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -826,7 +826,7 @@ namespace bzit.bomg
|
|||||||
default:
|
default:
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
System.Diagnostics.Process.Start(item.Address);
|
System.Diagnostics.Process.Start(item.SiteAddress);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("0.2.0.083")]
|
[assembly: AssemblyVersion("0.2.1.001")]
|
||||||
[assembly: AssemblyFileVersion("0.1.0.0")]
|
[assembly: AssemblyFileVersion("0.1.0.0")]
|
||||||
|
2
Properties/Resources.Designer.cs
generated
2
Properties/Resources.Designer.cs
generated
@ -89,7 +89,7 @@ namespace bzit.bomg.Properties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to 0.2.0.083 beta.
|
/// Looks up a localized string similar to 0.2.1.001 beta.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string app_version {
|
internal static string app_version {
|
||||||
get {
|
get {
|
||||||
|
@ -128,7 +128,7 @@
|
|||||||
<value>Bookmark Manager</value>
|
<value>Bookmark Manager</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="app_version" xml:space="preserve">
|
<data name="app_version" xml:space="preserve">
|
||||||
<value>0.2.0.083 beta</value>
|
<value>0.2.1.001 beta</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="cog" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="cog" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\cog.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\cog.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
@ -40,7 +40,7 @@ namespace bzit.bomg
|
|||||||
bi.Fullpath = xn2.InnerText?.Trim();
|
bi.Fullpath = xn2.InnerText?.Trim();
|
||||||
break;
|
break;
|
||||||
case "address":
|
case "address":
|
||||||
bi.Address = xn2.InnerText?.Trim();
|
bi.SiteAddress = xn2.InnerText?.Trim();
|
||||||
break;
|
break;
|
||||||
case "description":
|
case "description":
|
||||||
bi.Description = xn2.InnerText?.Trim();
|
bi.Description = xn2.InnerText?.Trim();
|
||||||
@ -78,7 +78,7 @@ namespace bzit.bomg
|
|||||||
|
|
||||||
writer.WriteStartElement("m");
|
writer.WriteStartElement("m");
|
||||||
writer.WriteElementString("name", parentForm.treeView1.GetNodeFullPath(tn));
|
writer.WriteElementString("name", parentForm.treeView1.GetNodeFullPath(tn));
|
||||||
writer.WriteElementString("address", bi.Address);
|
writer.WriteElementString("address", bi.SiteAddress);
|
||||||
writer.WriteElementString("description", bi.Description);
|
writer.WriteElementString("description", bi.Description);
|
||||||
writer.WriteElementString("created", bi.Created.ToString());
|
writer.WriteElementString("created", bi.Created.ToString());
|
||||||
writer.WriteEndElement();
|
writer.WriteEndElement();
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<configuration>
|
|
||||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/></startup></configuration>
|
|
@ -206,7 +206,6 @@
|
|||||||
<EmbeddedResource Include="RyzStudio\Windows\Forms\BigButton.resx">
|
<EmbeddedResource Include="RyzStudio\Windows\Forms\BigButton.resx">
|
||||||
<DependentUpon>BigButton.cs</DependentUpon>
|
<DependentUpon>BigButton.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<None Include="app.config" />
|
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
<None Include="Properties\Settings.settings">
|
<None Include="Properties\Settings.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
@ -219,7 +218,6 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="bomg-2.ico" />
|
|
||||||
<Content Include="bomg-4.ico" />
|
<Content Include="bomg-4.ico" />
|
||||||
<None Include="Resources\page_white_world_bw.png" />
|
<None Include="Resources\page_white_world_bw.png" />
|
||||||
<None Include="Resources\page_white_gray_green.png" />
|
<None Include="Resources\page_white_gray_green.png" />
|
||||||
|
31
bomg.sln
Normal file
31
bomg.sln
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio 15
|
||||||
|
VisualStudioVersion = 15.0.28307.168
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bomg", "bomg.csproj", "{594B03D6-3F17-4AE9-911D-C338EBD99FDF}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{594B03D6-3F17-4AE9-911D-C338EBD99FDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{594B03D6-3F17-4AE9-911D-C338EBD99FDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{594B03D6-3F17-4AE9-911D-C338EBD99FDF}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
|
{594B03D6-3F17-4AE9-911D-C338EBD99FDF}.Debug|x86.Build.0 = Debug|x86
|
||||||
|
{594B03D6-3F17-4AE9-911D-C338EBD99FDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{594B03D6-3F17-4AE9-911D-C338EBD99FDF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{594B03D6-3F17-4AE9-911D-C338EBD99FDF}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
{594B03D6-3F17-4AE9-911D-C338EBD99FDF}.Release|x86.Build.0 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {3FF38EC6-A04F-4999-AA1C-771FA6DAC156}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
Reference in New Issue
Block a user