Commit 7c95b060 authored by Ray's avatar Ray

0.2.0.082 beta (12/01/2017)

parents
/skye.sln
/bomg.csproj.user
/bin
/obj
/packages
/.vs/skye/v14/*.suo
This diff is collapsed.
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
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="oToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
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==
</value>
</data>
</root>
\ No newline at end of file
This diff is collapsed.
namespace bzit.bomg
{
partial class BookmarkTreeView
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
}
}
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
namespace bzit.bomg
{
partial class FindForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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
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;
<