v6.0.2013.0919 合并数据建模工具、正则测试工具、通讯调试工具、图标水印处理工具nnhy authored at 2013-09-19 09:35:11
diff --git a/XCoder/FrmFrame.cs b/XCoder/FrmFrame.cs
new file mode 100644
index 0000000..9ef5bf0
--- /dev/null
+++ b/XCoder/FrmFrame.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+namespace XCoder
+{
+ public partial class FrmFrame : Form
+ {
+ public FrmFrame()
+ {
+ InitializeComponent();
+ }
+
+ private void FrmFrame_Load(object sender, EventArgs e)
+ {
+ var frm = new FrmMain();
+ frm.Parent = this;
+
+ this.Controls.Add(frm);
+ }
+ }
+}
diff --git a/XCoder/FrmFrame.Designer.cs b/XCoder/FrmFrame.Designer.cs
new file mode 100644
index 0000000..78da718
--- /dev/null
+++ b/XCoder/FrmFrame.Designer.cs
@@ -0,0 +1,47 @@
+namespace XCoder
+{
+ partial class FrmFrame
+ {
+ /// <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()
+ {
+ this.SuspendLayout();
+ //
+ // FrmFrame
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(742, 415);
+ this.Name = "FrmFrame";
+ this.Text = "FrmFrame";
+ this.Load += new System.EventHandler(this.FrmFrame_Load);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/XCoder/FrmMDI.cs b/XCoder/FrmMDI.cs
new file mode 100644
index 0000000..de4eb59
--- /dev/null
+++ b/XCoder/FrmMDI.cs
@@ -0,0 +1,143 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using NewLife.Reflection;
+using System.Reflection;
+
+namespace XCoder
+{
+ public partial class FrmMDI : Form
+ {
+ private int childFormNumber = 0;
+
+ public FrmMDI()
+ {
+ InitializeComponent();
+
+ this.Icon = FileSource.GetIcon();
+ }
+
+ private void ShowNewForm(object sender, EventArgs e)
+ {
+ var childForm = new FrmMain();
+ childForm.MdiParent = this;
+ //childForm.Text = "窗口 " + childFormNumber++;
+ childForm.Show();
+ }
+
+ void CreateForm<TForm>() where TForm : Form, new()
+ {
+ var childForm = new TForm();
+ childForm.MdiParent = this;
+ //childForm.Text = "窗口 " + childFormNumber++;
+ childForm.Show();
+ }
+
+ private void OpenFile(object sender, EventArgs e)
+ {
+ OpenFileDialog openFileDialog = new OpenFileDialog();
+ openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
+ openFileDialog.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*";
+ if (openFileDialog.ShowDialog(this) == DialogResult.OK)
+ {
+ string FileName = openFileDialog.FileName;
+ }
+ }
+
+ private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ SaveFileDialog saveFileDialog = new SaveFileDialog();
+ saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
+ saveFileDialog.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*";
+ if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
+ {
+ string FileName = saveFileDialog.FileName;
+ }
+ }
+
+ private void ExitToolsStripMenuItem_Click(object sender, EventArgs e)
+ {
+ this.Close();
+ }
+
+ private void CutToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ }
+
+ private void CopyToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ }
+
+ private void PasteToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ }
+
+ private void ToolBarToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ toolStrip.Visible = toolBarToolStripMenuItem.Checked;
+ }
+
+ private void StatusBarToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ statusStrip.Visible = statusBarToolStripMenuItem.Checked;
+ }
+
+ private void CascadeToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ LayoutMdi(MdiLayout.Cascade);
+ }
+
+ private void TileVerticalToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ LayoutMdi(MdiLayout.TileVertical);
+ }
+
+ private void TileHorizontalToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ LayoutMdi(MdiLayout.TileHorizontal);
+ }
+
+ private void ArrangeIconsToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ LayoutMdi(MdiLayout.ArrangeIcons);
+ }
+
+ private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ foreach (Form childForm in MdiChildren)
+ {
+ childForm.Close();
+ }
+ }
+
+ private void FrmMDI_Shown(object sender, EventArgs e)
+ {
+ var asm = AssemblyX.Create(Assembly.GetExecutingAssembly());
+ Text = String.Format("新生命超级码神工具 v{0} {1:HH:mm:ss}编译", asm.CompileVersion, asm.Compile);
+ }
+
+ private void 数据建模工具ToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ CreateForm<FrmMain>();
+ }
+
+ private void 正则表达式工具ToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ CreateForm<NewLife.XRegex.FrmMain>();
+ }
+
+ private void 通讯调试工具ToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ CreateForm<XCom.FrmMain>();
+ }
+
+ private void 图标水印处理工具ToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ CreateForm<XICO.FrmMain>();
+ }
+ }
+}
\ No newline at end of file
diff --git a/XCoder/FrmMDI.Designer.cs b/XCoder/FrmMDI.Designer.cs
new file mode 100644
index 0000000..f856394
--- /dev/null
+++ b/XCoder/FrmMDI.Designer.cs
@@ -0,0 +1,643 @@
+namespace XCoder
+{
+ partial class FrmMDI
+ {
+ /// <summary>
+ /// 必需的设计器变量。
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// 清理所有正在使用的资源。
+ /// </summary>
+ /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows 窗体设计器生成的代码
+
+ /// <summary>
+ /// 设计器支持所需的方法 - 不要
+ /// 使用代码编辑器修改此方法的内容。
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMDI));
+ this.menuStrip = new System.Windows.Forms.MenuStrip();
+ this.fileMenu = new System.Windows.Forms.ToolStripMenuItem();
+ this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
+ this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
+ this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.printPreviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.printSetupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
+ this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.editMenu = new System.Windows.Forms.ToolStripMenuItem();
+ this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
+ this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
+ this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.viewMenu = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolBarToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.statusBarToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolsMenu = new System.Windows.Forms.ToolStripMenuItem();
+ this.windowsMenu = new System.Windows.Forms.ToolStripMenuItem();
+ this.newWindowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.cascadeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.tileVerticalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.tileHorizontalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.closeAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.arrangeIconsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.helpMenu = new System.Windows.Forms.ToolStripMenuItem();
+ this.contentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.indexToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
+ this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStrip = new System.Windows.Forms.ToolStrip();
+ this.newToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.openToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.saveToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+ this.printToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.printPreviewToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
+ this.helpToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.statusStrip = new System.Windows.Forms.StatusStrip();
+ this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
+ this.toolTip = new System.Windows.Forms.ToolTip(this.components);
+ this.数据建模工具ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.正则表达式工具ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.通讯调试工具ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.图标水印处理工具ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.menuStrip.SuspendLayout();
+ this.toolStrip.SuspendLayout();
+ this.statusStrip.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // menuStrip
+ //
+ this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.fileMenu,
+ this.editMenu,
+ this.viewMenu,
+ this.toolsMenu,
+ this.windowsMenu,
+ this.helpMenu});
+ this.menuStrip.Location = new System.Drawing.Point(0, 0);
+ this.menuStrip.MdiWindowListItem = this.windowsMenu;
+ this.menuStrip.Name = "menuStrip";
+ this.menuStrip.Size = new System.Drawing.Size(632, 25);
+ this.menuStrip.TabIndex = 0;
+ this.menuStrip.Text = "MenuStrip";
+ //
+ // fileMenu
+ //
+ this.fileMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.newToolStripMenuItem,
+ this.openToolStripMenuItem,
+ this.toolStripSeparator3,
+ this.saveToolStripMenuItem,
+ this.saveAsToolStripMenuItem,
+ this.toolStripSeparator4,
+ this.printToolStripMenuItem,
+ this.printPreviewToolStripMenuItem,
+ this.printSetupToolStripMenuItem,
+ this.toolStripSeparator5,
+ this.exitToolStripMenuItem});
+ this.fileMenu.ImageTransparentColor = System.Drawing.SystemColors.ActiveBorder;
+ this.fileMenu.Name = "fileMenu";
+ this.fileMenu.Size = new System.Drawing.Size(58, 21);
+ this.fileMenu.Text = "文件(&F)";
+ //
+ // newToolStripMenuItem
+ //
+ this.newToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripMenuItem.Image")));
+ this.newToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;
+ this.newToolStripMenuItem.Name = "newToolStripMenuItem";
+ this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
+ this.newToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
+ this.newToolStripMenuItem.Text = "新建(&N)";
+ this.newToolStripMenuItem.Click += new System.EventHandler(this.ShowNewForm);
+ //
+ // openToolStripMenuItem
+ //
+ this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripMenuItem.Image")));
+ this.openToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;
+ this.openToolStripMenuItem.Name = "openToolStripMenuItem";
+ this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
+ this.openToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
+ this.openToolStripMenuItem.Text = "打开(&O)";
+ this.openToolStripMenuItem.Click += new System.EventHandler(this.OpenFile);
+ //
+ // toolStripSeparator3
+ //
+ this.toolStripSeparator3.Name = "toolStripSeparator3";
+ this.toolStripSeparator3.Size = new System.Drawing.Size(162, 6);
+ //
+ // saveToolStripMenuItem
+ //
+ this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image")));
+ this.saveToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;
+ this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
+ this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
+ this.saveToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
+ this.saveToolStripMenuItem.Text = "保存(&S)";
+ //
+ // saveAsToolStripMenuItem
+ //
+ this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
+ this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
+ this.saveAsToolStripMenuItem.Text = "另存为(&A)";
+ this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.SaveAsToolStripMenuItem_Click);
+ //
+ // toolStripSeparator4
+ //
+ this.toolStripSeparator4.Name = "toolStripSeparator4";
+ this.toolStripSeparator4.Size = new System.Drawing.Size(162, 6);
+ //
+ // printToolStripMenuItem
+ //
+ this.printToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printToolStripMenuItem.Image")));
+ this.printToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;
+ this.printToolStripMenuItem.Name = "printToolStripMenuItem";
+ this.printToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P)));
+ this.printToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
+ this.printToolStripMenuItem.Text = "打印(&P)";
+ //
+ // printPreviewToolStripMenuItem
+ //
+ this.printPreviewToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printPreviewToolStripMenuItem.Image")));
+ this.printPreviewToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;
+ this.printPreviewToolStripMenuItem.Name = "printPreviewToolStripMenuItem";
+ this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
+ this.printPreviewToolStripMenuItem.Text = "打印预览(&V)";
+ //
+ // printSetupToolStripMenuItem
+ //
+ this.printSetupToolStripMenuItem.Name = "printSetupToolStripMenuItem";
+ this.printSetupToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
+ this.printSetupToolStripMenuItem.Text = "打印设置";
+ //
+ // toolStripSeparator5
+ //
+ this.toolStripSeparator5.Name = "toolStripSeparator5";
+ this.toolStripSeparator5.Size = new System.Drawing.Size(162, 6);
+ //
+ // exitToolStripMenuItem
+ //
+ this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
+ this.exitToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
+ this.exitToolStripMenuItem.Text = "退出(&X)";
+ this.exitToolStripMenuItem.Click += new System.EventHandler(this.ExitToolsStripMenuItem_Click);
+ //
+ // editMenu
+ //
+ this.editMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.undoToolStripMenuItem,
+ this.redoToolStripMenuItem,
+ this.toolStripSeparator6,
+ this.cutToolStripMenuItem,
+ this.copyToolStripMenuItem,
+ this.pasteToolStripMenuItem,
+ this.toolStripSeparator7,
+ this.selectAllToolStripMenuItem});
+ this.editMenu.Name = "editMenu";
+ this.editMenu.Size = new System.Drawing.Size(59, 21);
+ this.editMenu.Text = "编辑(&E)";
+ //
+ // undoToolStripMenuItem
+ //
+ this.undoToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("undoToolStripMenuItem.Image")));
+ this.undoToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;
+ this.undoToolStripMenuItem.Name = "undoToolStripMenuItem";
+ this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z)));
+ this.undoToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
+ this.undoToolStripMenuItem.Text = "撤消(&U)";
+ //
+ // redoToolStripMenuItem
+ //
+ this.redoToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("redoToolStripMenuItem.Image")));
+ this.redoToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;
+ this.redoToolStripMenuItem.Name = "redoToolStripMenuItem";
+ this.redoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y)));
+ this.redoToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
+ this.redoToolStripMenuItem.Text = "重复(&R)";
+ //
+ // toolStripSeparator6
+ //
+ this.toolStripSeparator6.Name = "toolStripSeparator6";
+ this.toolStripSeparator6.Size = new System.Drawing.Size(158, 6);
+ //
+ // cutToolStripMenuItem
+ //
+ this.cutToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("cutToolStripMenuItem.Image")));
+ this.cutToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;
+ this.cutToolStripMenuItem.Name = "cutToolStripMenuItem";
+ this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
+ this.cutToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
+ this.cutToolStripMenuItem.Text = "剪切(&T)";
+ this.cutToolStripMenuItem.Click += new System.EventHandler(this.CutToolStripMenuItem_Click);
+ //
+ // copyToolStripMenuItem
+ //
+ this.copyToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("copyToolStripMenuItem.Image")));
+ this.copyToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;
+ this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
+ this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
+ this.copyToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
+ this.copyToolStripMenuItem.Text = "复制(&C)";
+ this.copyToolStripMenuItem.Click += new System.EventHandler(this.CopyToolStripMenuItem_Click);
+ //
+ // pasteToolStripMenuItem
+ //
+ this.pasteToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("pasteToolStripMenuItem.Image")));
+ this.pasteToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;
+ this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
+ this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
+ this.pasteToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
+ this.pasteToolStripMenuItem.Text = "粘贴(&P)";
+ this.pasteToolStripMenuItem.Click += new System.EventHandler(this.PasteToolStripMenuItem_Click);
+ //
+ // toolStripSeparator7
+ //
+ this.toolStripSeparator7.Name = "toolStripSeparator7";
+ this.toolStripSeparator7.Size = new System.Drawing.Size(158, 6);
+ //
+ // selectAllToolStripMenuItem
+ //
+ this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem";
+ this.selectAllToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));
+ this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
+ this.selectAllToolStripMenuItem.Text = "全选(&A)";
+ //
+ // viewMenu
+ //
+ this.viewMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolBarToolStripMenuItem,
+ this.statusBarToolStripMenuItem});
+ this.viewMenu.Name = "viewMenu";
+ this.viewMenu.Size = new System.Drawing.Size(60, 21);
+ this.viewMenu.Text = "视图(&V)";
+ //
+ // toolBarToolStripMenuItem
+ //
+ this.toolBarToolStripMenuItem.Checked = true;
+ this.toolBarToolStripMenuItem.CheckOnClick = true;
+ this.toolBarToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.toolBarToolStripMenuItem.Name = "toolBarToolStripMenuItem";
+ this.toolBarToolStripMenuItem.Size = new System.Drawing.Size(127, 22);
+ this.toolBarToolStripMenuItem.Text = "工具栏(&T)";
+ this.toolBarToolStripMenuItem.Click += new System.EventHandler(this.ToolBarToolStripMenuItem_Click);
+ //
+ // statusBarToolStripMenuItem
+ //
+ this.statusBarToolStripMenuItem.Checked = true;
+ this.statusBarToolStripMenuItem.CheckOnClick = true;
+ this.statusBarToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.statusBarToolStripMenuItem.Name = "statusBarToolStripMenuItem";
+ this.statusBarToolStripMenuItem.Size = new System.Drawing.Size(127, 22);
+ this.statusBarToolStripMenuItem.Text = "状态栏(&S)";
+ this.statusBarToolStripMenuItem.Click += new System.EventHandler(this.StatusBarToolStripMenuItem_Click);
+ //
+ // toolsMenu
+ //
+ this.toolsMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.数据建模工具ToolStripMenuItem,
+ this.正则表达式工具ToolStripMenuItem,
+ this.通讯调试工具ToolStripMenuItem,
+ this.图标水印处理工具ToolStripMenuItem});
+ this.toolsMenu.Name = "toolsMenu";
+ this.toolsMenu.Size = new System.Drawing.Size(59, 21);
+ this.toolsMenu.Text = "工具(&T)";
+ //
+ // windowsMenu
+ //
+ this.windowsMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.newWindowToolStripMenuItem,
+ this.cascadeToolStripMenuItem,
+ this.tileVerticalToolStripMenuItem,
+ this.tileHorizontalToolStripMenuItem,
+ this.closeAllToolStripMenuItem,
+ this.arrangeIconsToolStripMenuItem});
+ this.windowsMenu.Name = "windowsMenu";
+ this.windowsMenu.Size = new System.Drawing.Size(64, 21);
+ this.windowsMenu.Text = "窗口(&W)";
+ //
+ // newWindowToolStripMenuItem
+ //
+ this.newWindowToolStripMenuItem.Name = "newWindowToolStripMenuItem";
+ this.newWindowToolStripMenuItem.Size = new System.Drawing.Size(142, 22);
+ this.newWindowToolStripMenuItem.Text = "新建窗口(&N)";
+ this.newWindowToolStripMenuItem.Click += new System.EventHandler(this.ShowNewForm);
+ //
+ // cascadeToolStripMenuItem
+ //
+ this.cascadeToolStripMenuItem.Name = "cascadeToolStripMenuItem";
+ this.cascadeToolStripMenuItem.Size = new System.Drawing.Size(142, 22);
+ this.cascadeToolStripMenuItem.Text = "层叠(&C)";
+ this.cascadeToolStripMenuItem.Click += new System.EventHandler(this.CascadeToolStripMenuItem_Click);
+ //
+ // tileVerticalToolStripMenuItem
+ //
+ this.tileVerticalToolStripMenuItem.Name = "tileVerticalToolStripMenuItem";
+ this.tileVerticalToolStripMenuItem.Size = new System.Drawing.Size(142, 22);
+ this.tileVerticalToolStripMenuItem.Text = "垂直平铺(&V)";
+ this.tileVerticalToolStripMenuItem.Click += new System.EventHandler(this.TileVerticalToolStripMenuItem_Click);
+ //
+ // tileHorizontalToolStripMenuItem
+ //
+ this.tileHorizontalToolStripMenuItem.Name = "tileHorizontalToolStripMenuItem";
+ this.tileHorizontalToolStripMenuItem.Size = new System.Drawing.Size(142, 22);
+ this.tileHorizontalToolStripMenuItem.Text = "水平平铺(&H)";
+ this.tileHorizontalToolStripMenuItem.Click += new System.EventHandler(this.TileHorizontalToolStripMenuItem_Click);
+ //
+ // closeAllToolStripMenuItem
+ //
+ this.closeAllToolStripMenuItem.Name = "closeAllToolStripMenuItem";
+ this.closeAllToolStripMenuItem.Size = new System.Drawing.Size(142, 22);
+ this.closeAllToolStripMenuItem.Text = "全部关闭(&L)";
+ this.closeAllToolStripMenuItem.Click += new System.EventHandler(this.CloseAllToolStripMenuItem_Click);
+ //
+ // arrangeIconsToolStripMenuItem
+ //
+ this.arrangeIconsToolStripMenuItem.Name = "arrangeIconsToolStripMenuItem";
+ this.arrangeIconsToolStripMenuItem.Size = new System.Drawing.Size(142, 22);
+ this.arrangeIconsToolStripMenuItem.Text = "排列图标(&A)";
+ this.arrangeIconsToolStripMenuItem.Click += new System.EventHandler(this.ArrangeIconsToolStripMenuItem_Click);
+ //
+ // helpMenu
+ //
+ this.helpMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.contentsToolStripMenuItem,
+ this.indexToolStripMenuItem,
+ this.searchToolStripMenuItem,
+ this.toolStripSeparator8,
+ this.aboutToolStripMenuItem});
+ this.helpMenu.Name = "helpMenu";
+ this.helpMenu.Size = new System.Drawing.Size(61, 21);
+ this.helpMenu.Text = "帮助(&H)";
+ //
+ // contentsToolStripMenuItem
+ //
+ this.contentsToolStripMenuItem.Name = "contentsToolStripMenuItem";
+ this.contentsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F1)));
+ this.contentsToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
+ this.contentsToolStripMenuItem.Text = "目录(&C)";
+ //
+ // indexToolStripMenuItem
+ //
+ this.indexToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("indexToolStripMenuItem.Image")));
+ this.indexToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;
+ this.indexToolStripMenuItem.Name = "indexToolStripMenuItem";
+ this.indexToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
+ this.indexToolStripMenuItem.Text = "索引(&I)";
+ //
+ // searchToolStripMenuItem
+ //
+ this.searchToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("searchToolStripMenuItem.Image")));
+ this.searchToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Black;
+ this.searchToolStripMenuItem.Name = "searchToolStripMenuItem";
+ this.searchToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
+ this.searchToolStripMenuItem.Text = "搜索(&S)";
+ //
+ // toolStripSeparator8
+ //
+ this.toolStripSeparator8.Name = "toolStripSeparator8";
+ this.toolStripSeparator8.Size = new System.Drawing.Size(163, 6);
+ //
+ // aboutToolStripMenuItem
+ //
+ this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
+ this.aboutToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
+ this.aboutToolStripMenuItem.Text = "关于(&A) ... ...";
+ //
+ // toolStrip
+ //
+ this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.newToolStripButton,
+ this.openToolStripButton,
+ this.saveToolStripButton,
+ this.toolStripSeparator1,
+ this.printToolStripButton,
+ this.printPreviewToolStripButton,
+ this.toolStripSeparator2,
+ this.helpToolStripButton});
+ this.toolStrip.Location = new System.Drawing.Point(0, 25);
+ this.toolStrip.Name = "toolStrip";
+ this.toolStrip.Size = new System.Drawing.Size(632, 25);
+ this.toolStrip.TabIndex = 1;
+ this.toolStrip.Text = "ToolStrip";
+ //
+ // newToolStripButton
+ //
+ this.newToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.newToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripButton.Image")));
+ this.newToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;
+ this.newToolStripButton.Name = "newToolStripButton";
+ this.newToolStripButton.Size = new System.Drawing.Size(23, 22);
+ this.newToolStripButton.Text = "新建";
+ this.newToolStripButton.Click += new System.EventHandler(this.ShowNewForm);
+ //
+ // openToolStripButton
+ //
+ this.openToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.openToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripButton.Image")));
+ this.openToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;
+ this.openToolStripButton.Name = "openToolStripButton";
+ this.openToolStripButton.Size = new System.Drawing.Size(23, 22);
+ this.openToolStripButton.Text = "打开";
+ this.openToolStripButton.Click += new System.EventHandler(this.OpenFile);
+ //
+ // saveToolStripButton
+ //
+ this.saveToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.saveToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripButton.Image")));
+ this.saveToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;
+ this.saveToolStripButton.Name = "saveToolStripButton";
+ this.saveToolStripButton.Size = new System.Drawing.Size(23, 22);
+ this.saveToolStripButton.Text = "保存";
+ //
+ // toolStripSeparator1
+ //
+ this.toolStripSeparator1.Name = "toolStripSeparator1";
+ this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
+ //
+ // printToolStripButton
+ //
+ this.printToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.printToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("printToolStripButton.Image")));
+ this.printToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;
+ this.printToolStripButton.Name = "printToolStripButton";
+ this.printToolStripButton.Size = new System.Drawing.Size(23, 22);
+ this.printToolStripButton.Text = "打印";
+ //
+ // printPreviewToolStripButton
+ //
+ this.printPreviewToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.printPreviewToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("printPreviewToolStripButton.Image")));
+ this.printPreviewToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;
+ this.printPreviewToolStripButton.Name = "printPreviewToolStripButton";
+ this.printPreviewToolStripButton.Size = new System.Drawing.Size(23, 22);
+ this.printPreviewToolStripButton.Text = "打印预览";
+ //
+ // toolStripSeparator2
+ //
+ this.toolStripSeparator2.Name = "toolStripSeparator2";
+ this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
+ //
+ // helpToolStripButton
+ //
+ this.helpToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.helpToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("helpToolStripButton.Image")));
+ this.helpToolStripButton.ImageTransparentColor = System.Drawing.Color.Black;
+ this.helpToolStripButton.Name = "helpToolStripButton";
+ this.helpToolStripButton.Size = new System.Drawing.Size(23, 22);
+ this.helpToolStripButton.Text = "帮助";
+ //
+ // statusStrip
+ //
+ this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolStripStatusLabel});
+ this.statusStrip.Location = new System.Drawing.Point(0, 396);
+ this.statusStrip.Name = "statusStrip";
+ this.statusStrip.Size = new System.Drawing.Size(632, 22);
+ this.statusStrip.TabIndex = 2;
+ this.statusStrip.Text = "StatusStrip";
+ //
+ // toolStripStatusLabel
+ //
+ this.toolStripStatusLabel.Name = "toolStripStatusLabel";
+ this.toolStripStatusLabel.Size = new System.Drawing.Size(32, 17);
+ this.toolStripStatusLabel.Text = "状态";
+ //
+ // 数据建模工具ToolStripMenuItem
+ //
+ this.数据建模工具ToolStripMenuItem.Name = "数据建模工具ToolStripMenuItem";
+ this.数据建模工具ToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
+ this.数据建模工具ToolStripMenuItem.Text = "数据建模工具";
+ this.数据建模工具ToolStripMenuItem.Click += new System.EventHandler(this.数据建模工具ToolStripMenuItem_Click);
+ //
+ // 正则表达式工具ToolStripMenuItem
+ //
+ this.正则表达式工具ToolStripMenuItem.Name = "正则表达式工具ToolStripMenuItem";
+ this.正则表达式工具ToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
+ this.正则表达式工具ToolStripMenuItem.Text = "正则表达式工具";
+ this.正则表达式工具ToolStripMenuItem.Click += new System.EventHandler(this.正则表达式工具ToolStripMenuItem_Click);
+ //
+ // 通讯调试工具ToolStripMenuItem
+ //
+ this.通讯调试工具ToolStripMenuItem.Name = "通讯调试工具ToolStripMenuItem";
+ this.通讯调试工具ToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
+ this.通讯调试工具ToolStripMenuItem.Text = "通讯调试工具";
+ this.通讯调试工具ToolStripMenuItem.Click += new System.EventHandler(this.通讯调试工具ToolStripMenuItem_Click);
+ //
+ // 图标水印处理工具ToolStripMenuItem
+ //
+ this.图标水印处理工具ToolStripMenuItem.Name = "图标水印处理工具ToolStripMenuItem";
+ this.图标水印处理工具ToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
+ this.图标水印处理工具ToolStripMenuItem.Text = "图标水印处理工具";
+ this.图标水印处理工具ToolStripMenuItem.Click += new System.EventHandler(this.图标水印处理工具ToolStripMenuItem_Click);
+ //
+ // FrmMDI
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(632, 418);
+ this.Controls.Add(this.statusStrip);
+ this.Controls.Add(this.toolStrip);
+ this.Controls.Add(this.menuStrip);
+ this.IsMdiContainer = true;
+ this.MainMenuStrip = this.menuStrip;
+ this.Name = "FrmMDI";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "新生命超级码神工具";
+ this.Shown += new System.EventHandler(this.FrmMDI_Shown);
+ this.menuStrip.ResumeLayout(false);
+ this.menuStrip.PerformLayout();
+ this.toolStrip.ResumeLayout(false);
+ this.toolStrip.PerformLayout();
+ this.statusStrip.ResumeLayout(false);
+ this.statusStrip.PerformLayout();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+ #endregion
+
+
+ private System.Windows.Forms.MenuStrip menuStrip;
+ private System.Windows.Forms.ToolStrip toolStrip;
+ private System.Windows.Forms.StatusStrip statusStrip;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
+ private System.Windows.Forms.ToolStripMenuItem printSetupToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
+ private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel;
+ private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem tileHorizontalToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem fileMenu;
+ private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem printToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem printPreviewToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem editMenu;
+ private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem viewMenu;
+ private System.Windows.Forms.ToolStripMenuItem toolBarToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem statusBarToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem toolsMenu;
+ private System.Windows.Forms.ToolStripMenuItem windowsMenu;
+ private System.Windows.Forms.ToolStripMenuItem newWindowToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem cascadeToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem tileVerticalToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem closeAllToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem arrangeIconsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem helpMenu;
+ private System.Windows.Forms.ToolStripMenuItem contentsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem indexToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem searchToolStripMenuItem;
+ private System.Windows.Forms.ToolStripButton newToolStripButton;
+ private System.Windows.Forms.ToolStripButton openToolStripButton;
+ private System.Windows.Forms.ToolStripButton saveToolStripButton;
+ private System.Windows.Forms.ToolStripButton printToolStripButton;
+ private System.Windows.Forms.ToolStripButton printPreviewToolStripButton;
+ private System.Windows.Forms.ToolStripButton helpToolStripButton;
+ private System.Windows.Forms.ToolTip toolTip;
+ private System.Windows.Forms.ToolStripMenuItem 数据建模工具ToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem 正则表达式工具ToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem 通讯调试工具ToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem 图标水印处理工具ToolStripMenuItem;
+ }
+}
+
+
+
diff --git a/XCoder/FrmMDI.resx b/XCoder/FrmMDI.resx
new file mode 100644
index 0000000..6b39b87
--- /dev/null
+++ b/XCoder/FrmMDI.resx
@@ -0,0 +1,401 @@
+<?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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>224, 17</value>
+ </metadata>
+ <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <data name="newToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEKSURBVDhPrdNtS8JQFAdwv1R+h/oa+Y0kX4j0ohYhA4MF
+ hkYWZtBKEHEDe0KG5Vjzaeqcuod/3MFg5L3XvfDA4b6553c553BTqX2FVO/if5ZqCoqVFoRrOUzuW6SY
+ FQXxAemjDB+5uleZwIlQQfVJ4SPibZsJZM9uwuIoqa1clptMwPV8ECSCqMC59EwFgiCA7WxgjOwQODg8
+ pg/ztPRIBdYbD2PLgaZbfCBfrG0Bnh9gZq8xMBd418Z8IHdR3QKclQtzskTvZ4rOh8kHSH/xIIObzlfo
+ GzN0eyO8qnpyID64z/4E7bdfNFrfyYH44NSvIeTOAHcvWjIg2jfrZK4x2jG5sCv39YFD5w/f9fWWFNSd
+ PAAAAABJRU5ErkJggg==
+</value>
+ </data>
+ <data name="openToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJfSURBVDhPvZNbSBNgGIZ30UVXFmlRCEaWhF2IgSHVRUjS
+ SVFKs8JIE8pTBwzFNg9tOnVzJ6eudJjbdE2dVpZhWCEUikRoqaPEtCwoKsXMUMnT09xCkyzwph/em5/v
+ fb73+35+geB/nJxiMxKthctyE3k6K2lKI8vqG52sIyxe5TCdF5aTZYelSA1EJRcjqDNrWEqNNbK/dklI
+ KyE8UUVofIET0NtlZGKk1qEfwxamBg1YTSrqzdIlIWEJakLjtATHFiGorVAzPly1yDzzqYQpWxJV5XIq
+ S3MxFGehL8jkmlJEkSx1MbTaqGD8i3G+86zdTK8IbLFL6g/AjTIZ3z/qHbHnzE11CofuW/NpsMi4XZmL
+ 1ZCNRS/BpLvCdW06pWoROoXQmaZSn8vou0LmYr9pEVNfpWbmjQQGpIv11n7XnwY9yfAykc6aCC7GhCAw
+ 6LL51ieH90ruVKtoe6B0Fv0+wosoaA9nujWIiYcBvK7w4dyp/U5AmVbM11cSBlozqLcome0XQ3ecE9AZ
+ YzceZ7othInmfYw27maobjuSeC9OBLo5l1mizmCoS8hNs4KOJ/YkPUl2wBnoOMns08NMPj7IWNMehuv9
+ +FztTXvOaiKDPPHb6uIE6PJFdDdncsucD32Z8Nwe99lRJluCGXsUwEiDP4NWHz4Yt2BTuiKO3YzvNveF
+ pyzMS6XWJMd2N4F2jWBebcoVNMtWci9rFTXpazGkunP10kYiD23C39djAaCRpqARnyVPGE3ahWOOxZyO
+ COTIgZ3s3eXDDh8vvD3d8djgxro1Lqx3/RV9Wb/pH8U/ATEu7l+AbzRZAAAAAElFTkSuQmCC
+</value>
+ </data>
+ <data name="saveToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIpSURBVDhPrZPdS5NxFMf3L3TfTdBFtzU1hmuxGjzlHMqq
+ YVgRvT2RL+XSZZqoWJlGLV8gW+HSScvpJJxU+AamSI2hTCVLM1e0xKGm2EQw+PY7v+j5tTJv6gfn8vM5
+ zznn+6hU/+M9exoFla99GW3eJTx2L6CxIYL7jhnU1nyC/XYIN8qnUFoygcKC18jLHcWF80EovQns7QFq
+ qlex0VtZXYMxrReH057wUgTe1kUuqKz48lee4MjCCnabn0OtlmE55BEC96N5Ligt+byu4Cf8PryIOJMP
+ BZenccDcJATO+lkuuGR794fgV3hkMoJtkhfWnHGkpjiFoO5umAuys0ZjBL/Dg8EwNuvdkOUATCaHEFRX
+ feQC+UxAEawH9/g/YFNiA44cfYGkpFohuFk5je4usFMCx0++guXYAN82LYxmps+mzj/gPhy0dEKS7EJw
+ tWwSHT6wDABNrm/s7l9Rfn2OL5UWRjNnZgQVODm1HQZDhRBcKRyHpxl46FxjwYnCmJ4TU+YTNqSfK+Kd
+ k1MYvN8Dvb5MCGx5YwwGqu5EeWcSUEjitBKG3s5ibGoOcu417DW2cVi7xwWdrkgIKJaOe1A+mwQEn82/
+ hTeheYRmlnCx2I54vYvBjYjf9QDaxHwhyMwYZnMv85m3GjzYskNCS0c/fF2D6O7zY+DlEPaZLFDr6pHA
+ 4O2aOmg01ljB6VP9PJ6UMAoJ3ZlORdumhdHM1JWK4J0J2ULwL3/0d2xoOmtKzOuNAAAAAElFTkSuQmCC
+</value>
+ </data>
+ <data name="printToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIuSURBVDhPrZPtT5JRGMZZH/t/WltbrbbaTNTSasMyI5zO
+ SdEwJgUhywhTSe3FWlKjR+YC3UMWOEZMa2w6g8wSXTrdEiiwIExAw3i5ep5D4Ejc+uC9XdvZ2e7rd537
+ nMPh7HQZbVMYtH+EaXRmW9EjbmzLZQ3eu334tzZ+J+Hxr2DQOoGSc1fBrb6y1YRtZpVKpREMR+BwfSIa
+ sjthMI/DNeNFlUhNDAom0Ftc+Pw1nAdnyavROGYXl0HbnIRckK6lx8EqydC9gVAe3eqYhtPtQWWDCsfO
+ y6HRvsC9PutmCkXnM9I84pwndJaaJQdCMcwvhdBrsKOUL4Oyqx9P6DGUMkbkGE1teqgfDoEyv8MjowP6
+ l29xl7Lh+h0jxC1a8Bs7UF6jQPFZKU5fuIlunQUSlRbF2SHefvoKkVh8y9TZjUQyhfV4gszge3gdX75F
+ IW+nUCftYhLIMglUD0wwv/mA53YXKNNr3O8bhrpnALJ2HUTNPRBc7gCvoQXHBXIUnZHgIrNXKbyBgydF
+ GQNl9wB8/mDBBJG1DXgCq9gNDtEuigO+uA0l1VLsOVqTMWjuNGB6bgnM3HLFrn9EE5jzrWFsNkyaLX8N
+ TtQqcKBCuGmg1FDQ9NLwBuMIx9Lw/0xjcTmFiYVfGJ6Mot+xQshZHeGJSXMuQb2kFbJbOoxO+sjd/o/y
+ DNhjSFSPUVGnRJngGrjMMy2qasJhXiMOnbqE/eVC7Curx15ubY6co+/ET/4D4B0xm/qy5XMAAAAASUVO
+ RK5CYII=
+</value>
+ </data>
+ <data name="printPreviewToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHVSURBVDhPrdPfS1NhHMdx/xnpqosoK8KbCMxEiaic88eF
+ TpzEJChU6GY3GUH+aA3dEl2tJv7CY5yVOSuXm9aCIoPJ1IsGoW6y1CJxus2985ywdjzbuvELXx448Hl9
+ n+fhPDk5h1GiZ56DLUz6GXR9xuH8IHfWOVI4U/UMv+VkUW12ZNQ9lxHodLiYmPFnR4ZffckImJ+8lMP7
+ nfYo/WMfVUA8tsXUzBSWR3Zut5m4a+okv0SX/i6eij4FsL29hTg+zmvPNKHId76FIzgEEZ2hkSrDLTVi
+ E7wKwD3txeX2yN/iCfgV3WVlPYHZNoS2Wq8GugcnFUCXzc7yauRvOPwjzsJyDKd3nrLKSjXQ1TehADos
+ 3SytrsmTwxuJvfAOvoUoD0d8XC4tVQPSTaeWIDoRXW5CG3uTV2K8X4zy4tMmDc1GysrLMbU0KpFUIJlM
+ 8jUY5F6Hmd6B5zzzBrAKPhqajGi0Vxm4X4Vova5EUoGdWIL1n1H8gQAPLBb01wzU1NZRobmE+eY5Qo/P
+ s/uuGnv7jX/IPiCtmbrlTiv1JSeYNeaxZD3LmlNDk/7in6NIobwLuv92QdEV9MXHedN8mrrCo2iLT2V/
+ ZOl+W2kX+ceOUHgmVw7/BnddJB4ReMCSAAAAAElFTkSuQmCC
+</value>
+ </data>
+ <data name="undoToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGZSURBVDhPtZLbK8NhGMf9Ke7InZyJFpZjLEkMc5a5MYcc
+ kjleKDPakhxvnLblbCwpsRvuUHKDlIWcT/vt9uM3Sg4rfspbz93z+bzP835fL6//PEarC+OSwOiawNSm
+ gFksi13gV3fq5wXc1TUr0Gpy0jzuZGT1TeBR0mW5YnL7ze6GehZclBjuiNVsE1FiIyTfSlz9MQM2DwK3
+ sXX8ktENgWaTQO+iC5XuArlmi6iyNYJyp4mtWCYsb4qMzjsmxL5va1QPXFA++EzlsJMs3SPhRVZCC+ZF
+ 2PzarGiy4Z85hrzukJYJ53dBof6cpLYbsrufqR2+wTfJQGCO6b3RW6YlqtyOvPaIFrMHQVr7GcHVJyS0
+ Xb1OUqA7RTt2+1mgtpOoPafdkyC63oGs6oBw9RaBeSv4K2fwTe57FwSr5ohUb6LouEbT7/g5yq9R+SQa
+ xPEPKTXe0y3G+6u/8LEptHid9M4HMrQ70mCV/h5ZxS6pHQ+kNOzjpxiSJohvdIjwE/E1ewQoLdJg9wpK
+ MdaYmgOCcmalw5If6i/AC5d0EMEHlG+EAAAAAElFTkSuQmCC
+</value>
+ </data>
+ <data name="redoToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGTSURBVDhPzZLfK0NhHMb3p7jBknbBNpqbXRhmK1OzYmbK
+ IuR3Yck2P1aIXWyksU3YzNZqyq+khJu540qJULvRWkbnvNeP9xxR69AoF049V+f5ft7nfb6vSPRXX/Sc
+ IHJGEKYKHBPMx1lY11n8iM8Nc/IfEdiDLCa2WTijLEY3KIQqJ4Qb9h4SVFsfUda6B4XlAMqeBCweBgM+
+ FgP+d8jWBYFy8FoIDJ0SGGaeITeuobI3Dpkpxktu3kUbhXR4GXRTSID6KjoTfNqsVI4QC9XIHQpr56Eb
+ P+R/ykwRlBrDKNatomH2lU/StcJAat4XJnBEOMA9CtQu5CltnwZp8zbEGjeGfWkYFxhoJtOQNGwKAVMU
+ oLE/UbMnC7C4T8CJO1k9mYJ86AFi7ZIQ0L+cRL0zjZLGWBaAK0xB7yw1H0CiD/LD+VVzQsDCDkG7JwPV
+ 8C3twZ1lEBT23U4NtkvoZ15QbjnJvfevIEW07bqxa9RNv0DZd4UWV+b3IA6itd5A52RQM5b8PeAjmcaR
+ QhNdW84n/C8Mb8U3B7cnMS8kAAAAAElFTkSuQmCC
+</value>
+ </data>
+ <data name="cutToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGjSURBVDhPldO7S1thHMZx/wIHByeho1on8Va0eCvNYKJH
+ TmKaEqXBxGBriQgxahTRGo3XlBoJiFqJgpDLoAeHFoqlSyveQMVNRAQvqDhqt685EZzk8PrOv+fz8N5S
+ UgQWiSUw9jASUX4zs6Q8BtTw4fEp3YNTYkhwLs54aBHv4HQycHv3n5jyC8dnrxighiZnIgRnY2o5ZxfX
+ OFt7SE9LFQciK2uMBsOsb+3y5+8O5g8tzwPC0R+MTS0wEQrT0R/AIFvF29UtjHwL4+4LYHf1UtfwEZ1e
+ fh6gIjaXD7OtDZNzCMnmEweswzdYRq4wDRyj92xg6NimxruPoX0TXctPbcjiv+T9+A3GvkNKrN8pkAPo
+ XGtI3Qe8TYSL6+e1AbP/HPPQKRXO5WS4QJ5A795A6jqgslkh3/hVG6jznSD3H1HZpJBXO5YEahPt1Z3b
+ vLKEyCn/pA0YvxwhefYotcfJNTwcnN79j9LGKNmv7WS8yNYGarp2KWuMJdpHySx8l3w8ZY44L0tsZBZZ
+ yJP82sCb5lUKTZNkFTeQW9UjfnXCX/WJwXuRhekYxgs82gAAAABJRU5ErkJggg==
+</value>
+ </data>
+ <data name="copyToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHdSURBVDhPpZPfS1NhGID9U0oZUl3bfURqUmBQeFFQkEVX
+ u9CrriLDIKsZC5xtE3OWss3O9ESki5SZa2kyc65fk5ZBbTCVc3Q5p2f2uPNJsy3YBF947r73eX9831dW
+ tt+Qx7+gI42FBc7hIL3yO+7aZPbk1pMLwzEU4GrLU47WNZaWeEbDefmZrT909L3C6w9zvqm9tMQ5MiME
+ 3ghIHyAUVXnoeIk0oeIeV3D5FB6PKJgHlwUX78fyu+qVA7kONjYzqKtpYomkEBRGa/8iVVf8gtx+7G6f
+ ONft38Q0rHJT+kVzT5S+10v/CZqsCeRJlSMNQwIhsWTn1edeS2ksKikWYit8ii5hfxEXgjYpIwjNr3DJ
+ FOdww3MOnR2gsv7JjkCfdz2t5Sob7RGuWT7ywLWQ14H6W2P+5zr+uVWs0jSG0127AjWZ5vP3BDNfYwRC
+ Pxh7/42W7p3rvdGfxGiJc+FehDO3ZgVWaQpDXeeuoOrkZQppNs8KgZYdL6FozEXXGA2qeN4s82ggQEWN
+ ufgbaWydFIJ/K//toNP9lvITpuKCc9d9pDa2sA8GsXmmsT6bEpX1ZItzgoPH7xQX1Bi92W27BJX1Dgyn
+ bFTUdlBe3Z5NbuPAsduln/mePtN+D20D78LfVRyXXrkAAAAASUVORK5CYII=
+</value>
+ </data>
+ <data name="pasteToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJPSURBVDhPtZNZSJRhFIZ/6MJuihbqqquC6CaKCKqLjMIs
+ TJswEjMyJ2JUSkaZNB1SS1N0cpu0bIxcBjW3SpSUIhESh3YNx2iRSI2cJmsW18ni6f+/GHJaL6IDL+fm
+ e5dzOJ8k/Y/qas2m42oGzRUpaKN28UePpupCZqMi/wAOWw3jtksM9eeRpAmkMEvHeYMeY1aigI+gQp5y
+ NuJxNTDlqMVcqmNitIqkaBVPu5M5eSyYZPV6bF2HGG1bjjZy988CCtnjquNC9kF6LHk43xQz0q/nleUw
+ LWUqoiP8qUldxqNCidj9P4zUUJUv3D3OKxhSI0nXhaOPC+NEbCg6jYp4dTAxEQEUaVcIgfAgf98EteUG
+ pp31TNtNTAznYH8Sh7VqsUBf5SJ6Sudx3+gnyAoCNq31FTCbspm0VzA5mMnEs6OMP96Ls3U+BZVt5Jia
+ OXWunmSDmfiMMqJTjEQm5PoKlJdkMDZkZLxfw9iDYNx31vHu+hJB9pZn5jMO1xSDIw7CYk4TEqX/LlJW
+ kIbzeSbue4G4O1fjal/KUKUknJUqv9YlYKrroG/AJsi3uq3sCFV/EynJTeFD73FcHatw3liIvdGPgcuS
+ iP1p5gsf3bLzWwd9L21Yel8TFBFPoEzetnMP/pu3IBWdScR+N0YmL+B901yGq+dgvSChlWdWYnsTXJQT
+ FJvbaem0iq5g45qVSGfTE8SBeLfs7Rp5YbOdb1teCHLjzR7q2h76ChSkHZEvTIU6dDshWzcIZWXbysxe
+ t191keB3tU/etvLgb/jnz/wVkzX42dxSdscAAAAASUVORK5CYII=
+</value>
+ </data>
+ <data name="indexToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAKcSURBVDhPjZNbSNNRHMf3HPRcYu+9Gb32VhAJ9RASlOBb
+ b1aIFop5GXPeyrmp8zLNu21NR24q6qa2izbndKnzspI2hm5O866FFyg+/TfRyjT6wY8Dh/P5/r7nd85P
+ JDoj6po8lJZOkpMzTHa2nbPOnbofhsPpdq/T0DiH5s0sUul/Ch3BTuc6FSo3Vtsa78xBBszzaFs9SHIc
+ Zzs6CXf3LGO3f2PIuoPNusVA/zp6/SIt6hnB0cifQifhzq4QFvMWvb2rdHQu0y6Abbp5Wpq9qFQe5PIJ
+ cvNHDntzEtYbghHQYAjRql2gudlHbe0cFRUzKBTjFBSM8TTFzOMnRo5ht3szcmdt6zw63QKa134aG7y0
+ dgSRtW0SX7ZPnGwHSW0QecUUiY+M6DuGDwW0bdPIFS4amny8qvlEVbkHZek0dboQyVqotsKHBSED0Dj4
+ nfv5AdrNHrwBPyKxxIZWN4VEOoisZBRZ8Tgvi1zUq30kaUA3CotL22QWmrj1oC6yGpy73EhyUaR0InqW
+ asS/HMRkmSA9ox+x2BZ587yWFVQWInEEj00EIiJljQ6kmiUSEk2IMrM1lCj7WNoOMb8q3K/UgjRvkLuF
+ GxgmDgXCEXYRFrh2p4pK9TgtQwdEXa5E9KJ4RKg8IKQRs32ajYMvWB0fiRUH0f8msPN1PwKn5prwrgi9
+ sOxxIbrg1xeX5A6SkdVPSbkNX2gBVc8i8q7dYwcOobq81olPgKeFZqaUeYiNq/t7RjKyzDwXhLotn7mZ
+ Mkm364C9H2B8HyDmegmzi1DZvcb5q0rylZbThyxLbCEtvY+m9lmuxJsQ1/vR2vdQW3dJVsxyLkbB47S3
+ DI0H/z2lqhoXxUoHCQ87iLqUx8XoTG7fq0amsjEyFYrAPwG3BHAuW8RdOwAAAABJRU5ErkJggg==
+</value>
+ </data>
+ <data name="searchToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALKSURBVDhPldP7S5NRHMfx/peICCqIikr6oQsyK12o9Ni8
+ prl0mvMybc285uZMM+eWOrGsLStLLHPzEbtQaRdDrIjMbkaFl8nSogsrL7zz9EPLiqADB84Pz/d1nnO+
+ n7NgwS8jt0pGTEOlm3yrjLGui/2VLlIPnkdT1Myv3/6xzqvupMAm4+zu4crLfuThTpxDxWTISUimEyTm
+ OlHnnfo7csAiY3LItA50cP/jYwa/jpLTVorlRT4pl5RsMlcQZeol0tBIvP74fEQvftfmpr7PSqfHwY3J
+ Pvo/DzDo89Iy4iLJbkZhf8I6WxsBtWqkzCqis+r8iABKnDL2BxXUDulxvLXhHDZT98hJ6pkWNPUTRFW+
+ ZvnZcJacDmaDMZ2dadV+ILu8nXr3G0yyhb33tpPZF4LOYSCnae5Yxy5isjZiqKgizprC0hoFS8vDCNdU
+ +IEMcxsNl79S1NCA8qyCbXIk6jorNadcXO2+xZj3HW89XpoutBObp2VhaRDKRJMf0Bpbsbp9HGjyEmdQ
+ E9ywG11TCV3XuxFjegY++WYZnZzB1nie9dpwtsYV+oG9B1vIrH2F9tg3NNYhwnK1c+08zMi492ex58M0
+ z0amcPU8JTw2hsBIgx9IKT5HatlNEo9+Id4ySaTxNvvLTAyPT/zY2fN+Zq74G73PfNS39hIqRbBR0vkB
+ kTARkoTS+6gOeVAU9yEZdbR3XWfs/dzOo1Pcfe6jo/8zafpCQqRdlORnz8+CSFis3snOgtsszzazQhdD
+ si6L481u2noGsV/oJW1fIRGqHTRbYmi3p1NtypmPiISp0mvYkmElUJ2KUmNGSi5Cik4gTFIRFRGKTbeZ
+ sZMKZu/E4ziS9SciEiZCIvosWiVuW1yYOHOUMpDkkFU8LFzNsH0jE64I9iVt//cD+/3FCSApeCXX9GvZ
+ E7QMVfCa/wMEKJD1KxYTFLDoR/F3C6YE7SiFQhwAAAAASUVORK5CYII=
+</value>
+ </data>
+ <metadata name="toolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>337, 17</value>
+ </metadata>
+ <data name="newToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEKSURBVDhPrdNtS8JQFAdwv1R+h/oa+Y0kX4j0ohYhA4MF
+ hkYWZtBKEHEDe0KG5Vjzaeqcuod/3MFg5L3XvfDA4b6553c553BTqX2FVO/if5ZqCoqVFoRrOUzuW6SY
+ FQXxAemjDB+5uleZwIlQQfVJ4SPibZsJZM9uwuIoqa1clptMwPV8ECSCqMC59EwFgiCA7WxgjOwQODg8
+ pg/ztPRIBdYbD2PLgaZbfCBfrG0Bnh9gZq8xMBd418Z8IHdR3QKclQtzskTvZ4rOh8kHSH/xIIObzlfo
+ GzN0eyO8qnpyID64z/4E7bdfNFrfyYH44NSvIeTOAHcvWjIg2jfrZK4x2jG5sCv39YFD5w/f9fWWFNSd
+ PAAAAABJRU5ErkJggg==
+</value>
+ </data>
+ <data name="openToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJfSURBVDhPvZNbSBNgGIZ30UVXFmlRCEaWhF2IgSHVRUjS
+ SVFKs8JIE8pTBwzFNg9tOnVzJ6eudJjbdE2dVpZhWCEUikRoqaPEtCwoKsXMUMnT09xCkyzwph/em5/v
+ fb73+35+geB/nJxiMxKthctyE3k6K2lKI8vqG52sIyxe5TCdF5aTZYelSA1EJRcjqDNrWEqNNbK/dklI
+ KyE8UUVofIET0NtlZGKk1qEfwxamBg1YTSrqzdIlIWEJakLjtATHFiGorVAzPly1yDzzqYQpWxJV5XIq
+ S3MxFGehL8jkmlJEkSx1MbTaqGD8i3G+86zdTK8IbLFL6g/AjTIZ3z/qHbHnzE11CofuW/NpsMi4XZmL
+ 1ZCNRS/BpLvCdW06pWoROoXQmaZSn8vou0LmYr9pEVNfpWbmjQQGpIv11n7XnwY9yfAykc6aCC7GhCAw
+ 6LL51ieH90ruVKtoe6B0Fv0+wosoaA9nujWIiYcBvK7w4dyp/U5AmVbM11cSBlozqLcome0XQ3ecE9AZ
+ YzceZ7othInmfYw27maobjuSeC9OBLo5l1mizmCoS8hNs4KOJ/YkPUl2wBnoOMns08NMPj7IWNMehuv9
+ +FztTXvOaiKDPPHb6uIE6PJFdDdncsucD32Z8Nwe99lRJluCGXsUwEiDP4NWHz4Yt2BTuiKO3YzvNveF
+ pyzMS6XWJMd2N4F2jWBebcoVNMtWci9rFTXpazGkunP10kYiD23C39djAaCRpqARnyVPGE3ahWOOxZyO
+ COTIgZ3s3eXDDh8vvD3d8djgxro1Lqx3/RV9Wb/pH8U/ATEu7l+AbzRZAAAAAElFTkSuQmCC
+</value>
+ </data>
+ <data name="saveToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIpSURBVDhPrZPdS5NxFMf3L3TfTdBFtzU1hmuxGjzlHMqq
+ YVgRvT2RL+XSZZqoWJlGLV8gW+HSScvpJJxU+AamSI2hTCVLM1e0xKGm2EQw+PY7v+j5tTJv6gfn8vM5
+ zznn+6hU/+M9exoFla99GW3eJTx2L6CxIYL7jhnU1nyC/XYIN8qnUFoygcKC18jLHcWF80EovQns7QFq
+ qlex0VtZXYMxrReH057wUgTe1kUuqKz48lee4MjCCnabn0OtlmE55BEC96N5Ligt+byu4Cf8PryIOJMP
+ BZenccDcJATO+lkuuGR794fgV3hkMoJtkhfWnHGkpjiFoO5umAuys0ZjBL/Dg8EwNuvdkOUATCaHEFRX
+ feQC+UxAEawH9/g/YFNiA44cfYGkpFohuFk5je4usFMCx0++guXYAN82LYxmps+mzj/gPhy0dEKS7EJw
+ tWwSHT6wDABNrm/s7l9Rfn2OL5UWRjNnZgQVODm1HQZDhRBcKRyHpxl46FxjwYnCmJ4TU+YTNqSfK+Kd
+ k1MYvN8Dvb5MCGx5YwwGqu5EeWcSUEjitBKG3s5ibGoOcu417DW2cVi7xwWdrkgIKJaOe1A+mwQEn82/
+ hTeheYRmlnCx2I54vYvBjYjf9QDaxHwhyMwYZnMv85m3GjzYskNCS0c/fF2D6O7zY+DlEPaZLFDr6pHA
+ 4O2aOmg01ljB6VP9PJ6UMAoJ3ZlORdumhdHM1JWK4J0J2ULwL3/0d2xoOmtKzOuNAAAAAElFTkSuQmCC
+</value>
+ </data>
+ <data name="printToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIuSURBVDhPrZPtT5JRGMZZH/t/WltbrbbaTNTSasMyI5zO
+ SdEwJgUhywhTSe3FWlKjR+YC3UMWOEZMa2w6g8wSXTrdEiiwIExAw3i5ep5D4Ejc+uC9XdvZ2e7rd537
+ nMPh7HQZbVMYtH+EaXRmW9EjbmzLZQ3eu334tzZ+J+Hxr2DQOoGSc1fBrb6y1YRtZpVKpREMR+BwfSIa
+ sjthMI/DNeNFlUhNDAom0Ftc+Pw1nAdnyavROGYXl0HbnIRckK6lx8EqydC9gVAe3eqYhtPtQWWDCsfO
+ y6HRvsC9PutmCkXnM9I84pwndJaaJQdCMcwvhdBrsKOUL4Oyqx9P6DGUMkbkGE1teqgfDoEyv8MjowP6
+ l29xl7Lh+h0jxC1a8Bs7UF6jQPFZKU5fuIlunQUSlRbF2SHefvoKkVh8y9TZjUQyhfV4gszge3gdX75F
+ IW+nUCftYhLIMglUD0wwv/mA53YXKNNr3O8bhrpnALJ2HUTNPRBc7gCvoQXHBXIUnZHgIrNXKbyBgydF
+ GQNl9wB8/mDBBJG1DXgCq9gNDtEuigO+uA0l1VLsOVqTMWjuNGB6bgnM3HLFrn9EE5jzrWFsNkyaLX8N
+ TtQqcKBCuGmg1FDQ9NLwBuMIx9Lw/0xjcTmFiYVfGJ6Mot+xQshZHeGJSXMuQb2kFbJbOoxO+sjd/o/y
+ DNhjSFSPUVGnRJngGrjMMy2qasJhXiMOnbqE/eVC7Curx15ubY6co+/ET/4D4B0xm/qy5XMAAAAASUVO
+ RK5CYII=
+</value>
+ </data>
+ <data name="printPreviewToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHVSURBVDhPrdPfS1NhHMdx/xnpqosoK8KbCMxEiaic88eF
+ TpzEJChU6GY3GUH+aA3dEl2tJv7CY5yVOSuXm9aCIoPJ1IsGoW6y1CJxus2985ywdjzbuvELXx448Hl9
+ n+fhPDk5h1GiZ56DLUz6GXR9xuH8IHfWOVI4U/UMv+VkUW12ZNQ9lxHodLiYmPFnR4ZffckImJ+8lMP7
+ nfYo/WMfVUA8tsXUzBSWR3Zut5m4a+okv0SX/i6eij4FsL29hTg+zmvPNKHId76FIzgEEZ2hkSrDLTVi
+ E7wKwD3txeX2yN/iCfgV3WVlPYHZNoS2Wq8GugcnFUCXzc7yauRvOPwjzsJyDKd3nrLKSjXQ1TehADos
+ 3SytrsmTwxuJvfAOvoUoD0d8XC4tVQPSTaeWIDoRXW5CG3uTV2K8X4zy4tMmDc1GysrLMbU0KpFUIJlM
+ 8jUY5F6Hmd6B5zzzBrAKPhqajGi0Vxm4X4Vova5EUoGdWIL1n1H8gQAPLBb01wzU1NZRobmE+eY5Qo/P
+ s/uuGnv7jX/IPiCtmbrlTiv1JSeYNeaxZD3LmlNDk/7in6NIobwLuv92QdEV9MXHedN8mrrCo2iLT2V/
+ ZOl+W2kX+ceOUHgmVw7/BnddJB4ReMCSAAAAAElFTkSuQmCC
+</value>
+ </data>
+ <data name="helpToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAKcSURBVDhPjZNbSNNRHMf3HPRcYu+9Gb32VhAJ9RASlOBb
+ b1aIFop5GXPeyrmp8zLNu21NR24q6qa2izbndKnzspI2hm5O866FFyg+/TfRyjT6wY8Dh/P5/r7nd85P
+ JDoj6po8lJZOkpMzTHa2nbPOnbofhsPpdq/T0DiH5s0sUul/Ch3BTuc6FSo3Vtsa78xBBszzaFs9SHIc
+ Zzs6CXf3LGO3f2PIuoPNusVA/zp6/SIt6hnB0cifQifhzq4QFvMWvb2rdHQu0y6Abbp5Wpq9qFQe5PIJ
+ cvNHDntzEtYbghHQYAjRql2gudlHbe0cFRUzKBTjFBSM8TTFzOMnRo5ht3szcmdt6zw63QKa134aG7y0
+ dgSRtW0SX7ZPnGwHSW0QecUUiY+M6DuGDwW0bdPIFS4amny8qvlEVbkHZek0dboQyVqotsKHBSED0Dj4
+ nfv5AdrNHrwBPyKxxIZWN4VEOoisZBRZ8Tgvi1zUq30kaUA3CotL22QWmrj1oC6yGpy73EhyUaR0InqW
+ asS/HMRkmSA9ox+x2BZ587yWFVQWInEEj00EIiJljQ6kmiUSEk2IMrM1lCj7WNoOMb8q3K/UgjRvkLuF
+ GxgmDgXCEXYRFrh2p4pK9TgtQwdEXa5E9KJ4RKg8IKQRs32ajYMvWB0fiRUH0f8msPN1PwKn5prwrgi9
+ sOxxIbrg1xeX5A6SkdVPSbkNX2gBVc8i8q7dYwcOobq81olPgKeFZqaUeYiNq/t7RjKyzDwXhLotn7mZ
+ Mkm364C9H2B8HyDmegmzi1DZvcb5q0rylZbThyxLbCEtvY+m9lmuxJsQ1/vR2vdQW3dJVsxyLkbB47S3
+ DI0H/z2lqhoXxUoHCQ87iLqUx8XoTG7fq0amsjEyFYrAPwG3BHAuW8RdOwAAAABJRU5ErkJggg==
+</value>
+ </data>
+ <metadata name="statusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+ <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>131, 17</value>
+ </metadata>
+ <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>51</value>
+ </metadata>
+</root>
\ No newline at end of file
diff --git a/XCoder/Program.cs b/XCoder/Program.cs
index 5fbf124..8165737 100644
--- a/XCoder/Program.cs
+++ b/XCoder/Program.cs
@@ -76,7 +76,7 @@ namespace XCoder
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new FrmMain());
+ Application.Run(new FrmMDI());
}
static void Update(Boolean isAsync = true)
diff --git a/XCoder/Properties/AssemblyInfo.cs b/XCoder/Properties/AssemblyInfo.cs
index 57b3900..97616a4 100644
--- a/XCoder/Properties/AssemblyInfo.cs
+++ b/XCoder/Properties/AssemblyInfo.cs
@@ -28,10 +28,12 @@ using System.Runtime.InteropServices;
// 内部版本号
// 修订号
//
-[assembly: AssemblyVersion("5.1.*")]
-[assembly: AssemblyFileVersion("5.1.2013.0906")]
+[assembly: AssemblyVersion("6.0.*")]
+[assembly: AssemblyFileVersion("6.0.2013.0919")]
/*
+ * v6.0.2013.0919 合并数据建模工具、正则测试工具、通讯调试工具、图标水印处理工具
+ *
* v5.1.2013.0906 更新扩展查询模版,默认的FindByxx/FindAllByxx函数里面,缓存查找采用__.xx名称,而不要用_.xx,后面默认得到字段名,不适合内存查找
*
* v5.1.2013.0307 增强数据模型,生成代码时可使用$(属性名)作为输出路径的一部分,支持IDataTable的属性和扩展属性(主要)
diff --git a/XCoder/UpdateInfo.txt b/XCoder/UpdateInfo.txt
index 92156d8..d00a845 100644
--- a/XCoder/UpdateInfo.txt
+++ b/XCoder/UpdateInfo.txt
@@ -1,4 +1,6 @@
-v5.1.2013.0906 更新扩展查询模版,默认的FindByxx/FindAllByxx函数里面,缓存查找采用__.xx名称,而不要用_.xx,后面默认得到字段名,不适合内存查找
+v6.0.2013.0919 合并数据建模工具、正则测试工具、通讯调试工具、图标水印处理工具
+
+v5.1.2013.0906 更新扩展查询模版,默认的FindByxx/FindAllByxx函数里面,缓存查找采用__.xx名称,而不要用_.xx,后面默认得到字段名,不适合内存查找
v5.1.2013.0307 增强数据模型,生成代码时可使用$(属性名)作为输出路径的一部分,支持IDataTable的属性和扩展属性(主要)
diff --git a/XCoder/XCoder.csproj b/XCoder/XCoder.csproj
index 7e45c58..44e48c1 100644
--- a/XCoder/XCoder.csproj
+++ b/XCoder/XCoder.csproj
@@ -55,12 +55,25 @@
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.EnterpriseServices" />
+ <Reference Include="System.Management" />
<Reference Include="System.Messaging" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="FrmFrame.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="FrmFrame.Designer.cs">
+ <DependentUpon>FrmFrame.cs</DependentUpon>
+ </Compile>
+ <Compile Include="FrmMDI.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="FrmMDI.Designer.cs">
+ <DependentUpon>FrmMDI.cs</DependentUpon>
+ </Compile>
<Compile Include="NewModelForm\AddField.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -85,6 +98,36 @@
<DependentUpon>NewModel.cs</DependentUpon>
</Compile>
<Compile Include="NewModelForm\WinFormHelper.cs" />
+ <Compile Include="XCom\Com.cs" />
+ <Compile Include="XCom\Config.cs" />
+ <Compile Include="XCom\DataReceivedEventArgs.cs" />
+ <Compile Include="XCom\FrmMain.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="XCom\FrmMain.designer.cs">
+ <DependentUpon>FrmMain.cs</DependentUpon>
+ </Compile>
+ <Compile Include="XCom\IOHelper.cs" />
+ <Compile Include="XICO\FrmMain.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="XICO\FrmMain.designer.cs">
+ <DependentUpon>FrmMain.cs</DependentUpon>
+ </Compile>
+ <Compile Include="XICO\IconFile.cs" />
+ <Compile Include="XRegex\FileResource.cs" />
+ <Compile Include="XRegex\FrmMain.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="XRegex\FrmMain.designer.cs">
+ <DependentUpon>FrmMain.cs</DependentUpon>
+ </Compile>
+ <EmbeddedResource Include="FrmFrame.resx">
+ <DependentUpon>FrmFrame.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="FrmMDI.resx">
+ <DependentUpon>FrmMDI.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="NewModelForm\AddField.resx">
<DependentUpon>AddField.cs</DependentUpon>
</EmbeddedResource>
@@ -257,9 +300,32 @@
<EmbeddedResource Include="Template\页面ExtAspNet\类名Form.aspx" />
</ItemGroup>
<ItemGroup>
+ <EmbeddedResource Include="XCom\FrmMain.resx">
+ <DependentUpon>FrmMain.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="XICO\FrmMain.resx">
+ <DependentUpon>FrmMain.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="XRegex\FrmMain.resx">
+ <DependentUpon>FrmMain.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="数据库命名规范.txt" />
</ItemGroup>
<ItemGroup>
+ <Content Include="XICO\leaf.png" />
+ <Content Include="XRegex\Pattern\Html\无嵌套标记.txt" />
+ <Content Include="XRegex\Pattern\SQL查询\嵌套查询.txt" />
+ <Content Include="XRegex\Pattern\SQL查询\简单.txt" />
+ <Content Include="XRegex\Pattern\平衡组\完整示例.txt" />
+ <Content Include="XRegex\Pattern\平衡组\完整示例固化分组.txt" />
+ <Content Include="XRegex\Pattern\平衡组\标准.txt" />
+ <Content Include="XRegex\Pattern\平衡组\标准固化分组.txt" />
+ <Content Include="XRegex\Pattern\网页\最外层嵌套.txt" />
+ <Content Include="XRegex\Sample\SQL查询\MSSQL表结构.txt" />
+ <Content Include="XRegex\Sample\SQL查询\普通嵌套查询.txt" />
+ <Content Include="XRegex\Sample\SQL查询\普通查询.txt" />
+ <Content Include="XRegex\Sample\平衡组\算术表达式.txt" />
+ <Content Include="XRegex\Sample\网页\最外层嵌套.txt" />
<Content Include="路线图.txt" />
</ItemGroup>
<ItemGroup />
diff --git a/XCoder/XCom/Com.cs b/XCoder/XCom/Com.cs
new file mode 100644
index 0000000..f387439
--- /dev/null
+++ b/XCoder/XCom/Com.cs
@@ -0,0 +1,193 @@
+using System;
+using System.IO.Ports;
+using System.Text;
+using System.Threading;
+using NewLife;
+using NewLife.Log;
+
+namespace XCom
+{
+ class Com : DisposeBase
+ {
+ #region 属性
+ private SerialPort _Serial;
+ /// <summary>串口</summary>
+ public SerialPort Serial { get { return _Serial; } set { _Serial = value; } }
+
+ private Int32 _BytesOfReceived;
+ /// <summary>收到字节数</summary>
+ public Int32 BytesOfReceived { get { return _BytesOfReceived; } set { _BytesOfReceived = value; } }
+
+ private Int32 _BytesOfSent;
+ /// <summary>已发送字节数</summary>
+ public Int32 BytesOfSent { get { return _BytesOfSent; } set { _BytesOfSent = value; } }
+
+ private Encoding _Encoding = Encoding.Default;
+ /// <summary>编码</summary>
+ public Encoding Encoding { get { return _Encoding; } set { _Encoding = value; } }
+ #endregion
+
+ #region 构造
+ protected override void OnDispose(bool disposing)
+ {
+ base.OnDispose(disposing);
+
+ if (_Serial != null && _Serial.IsOpen)
+ {
+ try
+ {
+ _Serial.Close();
+ _Serial.Dispose();
+ }
+ catch { }
+ }
+ }
+ #endregion
+
+ #region 方法
+ public Com Open()
+ {
+ if (!Serial.IsOpen) Serial.Open();
+
+ return this;
+ }
+
+ public void Write(String str) { Write(Encoding.GetBytes(str)); }
+
+ /// <summary>写入数据</summary>
+ /// <param name="buffer"></param>
+ /// <param name="offset"></param>
+ /// <param name="count"></param>
+ public void Write(Byte[] buffer, Int32 offset = 0, Int32 count = -1)
+ {
+ Open();
+
+ WriteLog("Write:{0}", BitConverter.ToString(buffer));
+
+ if (count < 0) count = buffer.Length - offset;
+
+ var sp = Serial;
+ lock (sp)
+ {
+ _BytesOfSent += count;
+
+ sp.Write(buffer, offset, count);
+ }
+ }
+
+ public String ReadString()
+ {
+ var buf = new Byte[10240];
+ var size = Read(buf);
+ if (size <= 0) return null;
+
+ return Encoding.GetString(buf, 0, size);
+ }
+
+ /// <summary>从串口中读取指定长度的数据,一般是一帧</summary>
+ /// <param name="buffer"></param>
+ /// <param name="offset"></param>
+ /// <param name="count"></param>
+ /// <returns></returns>
+ public Int32 Read(Byte[] buffer, Int32 offset = 0, Int32 count = -1)
+ {
+ Open();
+
+ if (count < 0) count = buffer.Length - offset;
+
+ // 读取数据
+ var bufstart = offset;
+ var bufend = offset + count;
+ var sp = Serial;
+ lock (sp)
+ {
+ // 等待1秒,直到有数据为止
+ var timeout = sp.ReadTimeout;
+ if (timeout <= 0) timeout = 100;
+
+ var end = DateTime.Now.AddMilliseconds(timeout);
+ while (sp.BytesToRead <= 0 && sp.IsOpen && end > DateTime.Now) Thread.SpinWait(1);
+
+ try
+ {
+ var size = sp.BytesToRead;
+ // 计算还有多少可用空间
+ if (offset + size > bufend) size = bufend - offset;
+ var data = new Byte[size];
+ size = sp.Read(data, 0, data.Length);
+ if (size > 0)
+ {
+ buffer.Write(offset, data, 0, size);
+ offset += size;
+ }
+
+ _BytesOfReceived += size;
+ }
+ catch { }
+ }
+
+ WriteLog("Read:{0}", BitConverter.ToString(buffer, bufstart, offset - bufstart));
+
+ return offset - bufstart;
+ }
+ #endregion
+
+ #region 异步接收
+ /// <summary>开始监听</summary>
+ public void Listen()
+ {
+ Open();
+
+ Serial.DataReceived += new SerialDataReceivedEventHandler(DataReceived);
+ //serial.ErrorReceived += new SerialErrorReceivedEventHandler(port_ErrorReceived);
+ }
+
+ void DataReceived(object sender, SerialDataReceivedEventArgs e)
+ {
+ // 发送者必须保持一定间隔,每个报文不能太大,否则会因为粘包拆包而出错
+ try
+ {
+ var sp = sender as SerialPort;
+ var count = 0;
+ while (sp.BytesToRead > count)
+ {
+ count = sp.BytesToRead;
+ // 暂停一会,可能还有数据
+ Thread.Sleep(1);
+ }
+ if (sp.BytesToRead > 0)
+ {
+ var buf = new byte[sp.BytesToRead];
+ count = sp.Read(buf, 0, buf.Length);
+ if (count != buf.Length) buf = buf.ReadBytes(0, count);
+
+ if (Received != null)
+ {
+ _BytesOfReceived += buf.Length;
+
+ var e2 = new DataReceivedEventArgs { Data = buf };
+ Received(this, e2);
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ WriteLog("Error " + ex.Message);
+ }
+ }
+
+ /// <summary>数据到达事件,事件里调用<see cref="Read"/>读取数据</summary>
+ public event EventHandler<DataReceivedEventArgs> Received;
+ #endregion
+
+ #region 日志
+ /// <summary>输出日志</summary>
+ /// <param name="formart"></param>
+ /// <param name="args"></param>
+ public static void WriteLog(String formart, params Object[] args)
+ {
+ XTrace.WriteLine(formart, args);
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/XCoder/XCom/Config.cs b/XCoder/XCom/Config.cs
new file mode 100644
index 0000000..f45bae0
--- /dev/null
+++ b/XCoder/XCom/Config.cs
@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.IO.Ports;
+using System.Text;
+using System.Xml.Serialization;
+using NewLife.Xml;
+
+namespace XCom
+{
+ [XmlConfigFile("XCom.config")]
+ public class Config : XmlConfig<Config>
+ {
+ private String _PortName = "COM1";
+ /// <summary>串口名</summary>
+ [Description("串口名")]
+ public String PortName { get { return _PortName; } set { _PortName = value; } }
+
+ private Int32 _BaudRate = 115200;
+ /// <summary>波特率</summary>
+ [Description("波特率")]
+ public Int32 BaudRate { get { return _BaudRate; } set { _BaudRate = value; } }
+
+ private Int32 _DataBits = 8;
+ /// <summary>数据位</summary>
+ [Description("数据位")]
+ public Int32 DataBits { get { return _DataBits; } set { _DataBits = value; } }
+
+ private StopBits _StopBits = StopBits.One;
+ /// <summary>停止位</summary>
+ [Description("停止位 None/One/Two/OnePointFive")]
+ public StopBits StopBits { get { return _StopBits; } set { _StopBits = value; } }
+
+ private Parity _Parity = Parity.None;
+ /// <summary>奇偶校验</summary>
+ [Description("奇偶校验 None/Odd/Even/Mark/Space")]
+ public Parity Parity { get { return _Parity; } set { _Parity = value; } }
+
+ private Encoding _Encoding = Encoding.Default;
+ [XmlIgnore]
+ public Encoding Encoding { get { return _Encoding; } set { _Encoding = value; } }
+
+ /// <summary>编码</summary>
+ [Description("编码 gb2312/us-ascii/utf-8")]
+ public String WebEncoding { get { return _Encoding.WebName; } set { _Encoding = Encoding.GetEncoding(value); } }
+
+ private Boolean _HexShow;
+ /// <summary>十六进制显示</summary>
+ [Description("十六进制显示")]
+ public Boolean HexShow { get { return _HexShow; } set { _HexShow = value; } }
+
+ private Boolean _HexSend;
+ /// <summary>十六进制发送</summary>
+ [Description("十六进制发送")]
+ public Boolean HexSend { get { return _HexSend; } set { _HexSend = value; } }
+
+ private DateTime _LastUpdate;
+ /// <summary>最后更新时间</summary>
+ [Description("最后更新时间")]
+ public DateTime LastUpdate { get { return _LastUpdate; } set { _LastUpdate = value; } }
+ }
+}
\ No newline at end of file
diff --git a/XCoder/XCom/DataReceivedEventArgs.cs b/XCoder/XCom/DataReceivedEventArgs.cs
new file mode 100644
index 0000000..dcf92d2
--- /dev/null
+++ b/XCoder/XCom/DataReceivedEventArgs.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace XCom
+{
+ class DataReceivedEventArgs : EventArgs
+ {
+ private Byte[] _Data;
+ /// <summary>数据</summary>
+ public Byte[] Data { get { return _Data; } set { _Data = value; } }
+ }
+}
\ No newline at end of file
diff --git a/XCoder/XCom/FrmMain.cs b/XCoder/XCom/FrmMain.cs
new file mode 100644
index 0000000..e06c5c5
--- /dev/null
+++ b/XCoder/XCom/FrmMain.cs
@@ -0,0 +1,262 @@
+using System;
+using System.Drawing;
+using System.IO.Ports;
+using System.Reflection;
+using System.Text;
+using System.Windows.Forms;
+using NewLife.IO;
+using NewLife.Log;
+using NewLife.Reflection;
+using NewLife.Security;
+
+namespace XCom
+{
+ public partial class FrmMain : Form
+ {
+ Com _Com;
+
+ public FrmMain()
+ {
+ InitializeComponent();
+
+ var asmx = AssemblyX.Entry;
+ this.Text = asmx.Title;
+ }
+
+ private void FrmMain_Load(object sender, EventArgs e)
+ {
+ LoadInfo();
+
+ gbReceive.Tag = gbReceive.Text;
+ gbSend.Tag = gbSend.Text;
+
+ var ms = FileSource.GetFileResource(Assembly.GetExecutingAssembly(), "leaf.ico");
+ this.Icon = new Icon(ms);
+ }
+
+ void LoadInfo()
+ {
+ //cbName.DataSource = SerialPort.GetPortNames();
+ //cbName.DataSource = IOHelper.GetPortNames();
+ ShowPorts();
+ cbStopBit.DataSource = Enum.GetValues(typeof(StopBits));
+ cbParity.DataSource = Enum.GetValues(typeof(Parity));
+
+ cbStopBit.SelectedItem = StopBits.One;
+
+ cbBaundrate.DataSource = new Int32[] { 1200, 2400, 4800, 9600, 14400, 19200, 38400, 56000, 57600, 115200, 194000 };
+ //cbBaundrate.SelectedItem = 115200;
+
+ cbDataBit.DataSource = new Int32[] { 5, 6, 7, 8 };
+ //cbDataBit.SelectedItem = 8;
+
+ cbEncoding.DataSource = new String[] { Encoding.Default.WebName, Encoding.ASCII.WebName, Encoding.UTF8.WebName };
+ //cbEncoding.SelectedItem = Encoding.Default.WebName;
+
+ var cfg = Config.Current;
+ cbName.SelectedItem = cfg.PortName;
+ cbBaundrate.SelectedItem = cfg.BaudRate;
+ cbDataBit.SelectedItem = cfg.DataBits;
+ cbStopBit.SelectedItem = cfg.StopBits;
+ cbParity.SelectedItem = cfg.Parity;
+ cbEncoding.SelectedItem = cfg.WebEncoding;
+
+ chkHEXShow.Checked = cfg.HexShow;
+ chkHEXSend.Checked = cfg.HexSend;
+ }
+
+ void SaveInfo()
+ {
+ try
+ {
+ var cfg = Config.Current;
+ cfg.PortName = cbName.SelectedItem + "";
+ cfg.BaudRate = (Int32)cbBaundrate.SelectedItem;
+ cfg.DataBits = (Int32)cbDataBit.SelectedItem;
+ cfg.StopBits = (StopBits)cbStopBit.SelectedItem;
+ cfg.Parity = (Parity)cbParity.SelectedItem;
+ //cfg.Encoding = (Encoding)cbEncoding.SelectedItem;
+ cfg.WebEncoding = cbEncoding.SelectedItem + "";
+
+ cfg.HexSend = chkHEXSend.Checked;
+ cfg.HexShow = chkHEXShow.Checked;
+
+ cfg.Save();
+ }
+ catch (Exception ex)
+ {
+ XTrace.WriteException(ex);
+ }
+ }
+
+ String _ports = null;
+ DateTime _nextport = DateTime.MinValue;
+ void ShowPorts()
+ {
+ if (_nextport > DateTime.Now) return;
+ _nextport = DateTime.Now.AddSeconds(1);
+
+ var ps = IOHelper.GetPortNames();
+ var str = String.Join(",", ps);
+ if (_ports != str)
+ {
+ _ports = str;
+ cbName.DataSource = ps;
+ }
+ }
+
+ private void btnConnect_Click(object sender, EventArgs e)
+ {
+ var btn = sender as Button;
+ if (btn.Text == "打开串口")
+ {
+ var name = cbName.SelectedItem + "";
+ if (String.IsNullOrEmpty(name))
+ {
+ MessageBox.Show("请选择串口!", this.Text);
+ cbName.Focus();
+ return;
+ }
+ var p = name.IndexOf("(");
+ if (p > 0) name = name.Substring(0, p);
+
+ SaveInfo();
+ var cfg = Config.Current;
+
+ // 如果上次没有关闭,则关闭
+ if (_Com != null) _Com.Dispose();
+
+ var sp = new SerialPort(name, cfg.BaudRate, cfg.Parity, cfg.DataBits, cfg.StopBits);
+ sp.Open();
+ sp.DtrEnable = chkDTR.Checked;
+ sp.BreakState = chkBreak.Checked;
+ sp.RtsEnable = chkRTS.Checked;
+
+ _Com = new Com { Serial = sp };
+
+ // 计算编码
+ //if (!String.IsNullOrEmpty(cfg.Encoding) && !cfg.Encoding.EqualIgnoreCase("Default")) _Com.Encoding = Encoding.GetEncoding(cfg.Encoding);
+ _Com.Encoding = cfg.Encoding;
+
+ _Com.Received += _Com_Received;
+ _Com.Listen();
+
+ gbSet.Enabled = false;
+ gbSet2.Enabled = false;
+ //gbSet3.Enabled = true;
+ //timer1.Enabled = true;
+ btn.Text = "关闭串口";
+ }
+ else
+ {
+ if (_Com != null)
+ {
+ _Com.Dispose();
+ _Com = null;
+ }
+
+ gbSet.Enabled = true;
+ gbSet2.Enabled = true;
+ //gbSet3.Enabled = false;
+ //timer1.Enabled = false;
+ btn.Text = "打开串口";
+
+ ShowPorts();
+ }
+ }
+
+ void _Com_Received(object sender, DataReceivedEventArgs e)
+ {
+ if (e.Data == null || e.Data.Length < 1) return;
+
+ var line = "";
+ if (chkHEXShow.Checked)
+ line = e.Data.ToHex();
+ else
+ line = _Com.Encoding.GetString(e.Data);
+
+ XTrace.UseWinFormWriteLog(txtReceive, line, 100000);
+ }
+
+ Int32 lastReceive = 0;
+ Int32 lastSend = 0;
+ private void timer1_Tick(object sender, EventArgs e)
+ {
+ if (_Com != null)
+ {
+ if (_Com.BytesOfReceived != lastReceive)
+ {
+ gbReceive.Text = (gbReceive.Tag + "").Replace("0", _Com.BytesOfReceived + "");
+ lastReceive = _Com.BytesOfReceived;
+ }
+ if (_Com.BytesOfSent != lastSend)
+ {
+ gbSend.Text = (gbSend.Tag + "").Replace("0", _Com.BytesOfSent + "");
+ lastSend = _Com.BytesOfSent;
+ }
+ }
+ else
+ {
+ ShowPorts();
+ }
+ }
+
+ private void btnSend_Click(object sender, EventArgs e)
+ {
+ var str = txtSend.Text;
+ if (String.IsNullOrEmpty(str))
+ {
+ MessageBox.Show("发送内容不能为空!", this.Text);
+ txtSend.Focus();
+ return;
+ }
+
+ // 16进制发送
+ Byte[] data = null;
+ if (chkHEXSend.Checked)
+ data = DataHelper.FromHex(str);
+ else
+ data = _Com.Encoding.GetBytes(str);
+
+ // 多次发送
+ var count = 1;
+ if (chkMutilSend.Checked) count = (Int32)numMutilSend.Value;
+
+ for (int i = 0; i < count; i++)
+ {
+ _Com.Write(data);
+ }
+ }
+
+ private void btnClearSend_Click(object sender, EventArgs e)
+ {
+ if (_Com != null && _Com.Serial != null) _Com.Serial.DiscardOutBuffer();
+ txtSend.Clear();
+ }
+
+ private void btnSendReceive_Click(object sender, EventArgs e)
+ {
+ if (_Com != null && _Com.Serial != null) _Com.Serial.DiscardInBuffer();
+ txtReceive.Clear();
+ }
+
+ private void btnClear_Click(object sender, EventArgs e)
+ {
+ if (_Com != null)
+ {
+ _Com.BytesOfReceived = 0;
+ _Com.BytesOfSent = 0;
+ }
+ }
+
+ private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
+ {
+ if (_Com != null) _Com.Dispose();
+ }
+
+ private void cbEncoding_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ if (_Com != null) _Com.Encoding = Encoding.GetEncoding(cbEncoding.SelectedItem + "");
+ }
+ }
+}
\ No newline at end of file
diff --git a/XCoder/XCom/FrmMain.designer.cs b/XCoder/XCom/FrmMain.designer.cs
new file mode 100644
index 0000000..5358456
--- /dev/null
+++ b/XCoder/XCom/FrmMain.designer.cs
@@ -0,0 +1,566 @@
+namespace XCom
+{
+ partial class FrmMain
+ {
+ /// <summary>
+ /// 必需的设计器变量。
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// 清理所有正在使用的资源。
+ /// </summary>
+ /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows 窗体设计器生成的代码
+
+ /// <summary>
+ /// 设计器支持所需的方法 - 不要
+ /// 使用代码编辑器修改此方法的内容。
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.gbSet = new System.Windows.Forms.GroupBox();
+ this.cbParity = new System.Windows.Forms.ComboBox();
+ this.label5 = new System.Windows.Forms.Label();
+ this.cbStopBit = new System.Windows.Forms.ComboBox();
+ this.label4 = new System.Windows.Forms.Label();
+ this.cbDataBit = new System.Windows.Forms.ComboBox();
+ this.label3 = new System.Windows.Forms.Label();
+ this.cbBaundrate = new System.Windows.Forms.ComboBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this.cbName = new System.Windows.Forms.ComboBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.gbSet2 = new System.Windows.Forms.GroupBox();
+ this.chkRTS = new System.Windows.Forms.CheckBox();
+ this.chkBreak = new System.Windows.Forms.CheckBox();
+ this.chkDTR = new System.Windows.Forms.CheckBox();
+ this.gbStatus = new System.Windows.Forms.GroupBox();
+ this.chkRLSD = new System.Windows.Forms.CheckBox();
+ this.chkRing = new System.Windows.Forms.CheckBox();
+ this.chkDSR = new System.Windows.Forms.CheckBox();
+ this.chkCTS = new System.Windows.Forms.CheckBox();
+ this.gbSet3 = new System.Windows.Forms.GroupBox();
+ this.cbEncoding = new System.Windows.Forms.ComboBox();
+ this.label6 = new System.Windows.Forms.Label();
+ this.numMutilSend = new System.Windows.Forms.NumericUpDown();
+ this.btnClear = new System.Windows.Forms.Button();
+ this.btnSendReceive = new System.Windows.Forms.Button();
+ this.btnClearSend = new System.Windows.Forms.Button();
+ this.chkMutilSend = new System.Windows.Forms.CheckBox();
+ this.chkHEXShow = new System.Windows.Forms.CheckBox();
+ this.chkHEXSend = new System.Windows.Forms.CheckBox();
+ this.gbReceive = new System.Windows.Forms.GroupBox();
+ this.txtReceive = new System.Windows.Forms.TextBox();
+ this.gbSend = new System.Windows.Forms.GroupBox();
+ this.btnMutilSend = new System.Windows.Forms.Button();
+ this.btnSend = new System.Windows.Forms.Button();
+ this.txtSend = new System.Windows.Forms.TextBox();
+ this.btnConnect = new System.Windows.Forms.Button();
+ this.timer1 = new System.Windows.Forms.Timer(this.components);
+ this.gbSet.SuspendLayout();
+ this.gbSet2.SuspendLayout();
+ this.gbStatus.SuspendLayout();
+ this.gbSet3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.numMutilSend)).BeginInit();
+ this.gbReceive.SuspendLayout();
+ this.gbSend.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // gbSet
+ //
+ this.gbSet.Controls.Add(this.cbParity);
+ this.gbSet.Controls.Add(this.label5);
+ this.gbSet.Controls.Add(this.cbStopBit);
+ this.gbSet.Controls.Add(this.label4);
+ this.gbSet.Controls.Add(this.cbDataBit);
+ this.gbSet.Controls.Add(this.label3);
+ this.gbSet.Controls.Add(this.cbBaundrate);
+ this.gbSet.Controls.Add(this.label2);
+ this.gbSet.Controls.Add(this.cbName);
+ this.gbSet.Controls.Add(this.label1);
+ this.gbSet.Location = new System.Drawing.Point(12, 12);
+ this.gbSet.Name = "gbSet";
+ this.gbSet.Size = new System.Drawing.Size(157, 156);
+ this.gbSet.TabIndex = 0;
+ this.gbSet.TabStop = false;
+ this.gbSet.Text = "串口配置";
+ //
+ // cbParity
+ //
+ this.cbParity.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cbParity.FormattingEnabled = true;
+ this.cbParity.Location = new System.Drawing.Point(71, 127);
+ this.cbParity.Name = "cbParity";
+ this.cbParity.Size = new System.Drawing.Size(80, 20);
+ this.cbParity.TabIndex = 9;
+ //
+ // label5
+ //
+ this.label5.AutoSize = true;
+ this.label5.Location = new System.Drawing.Point(24, 131);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(41, 12);
+ this.label5.TabIndex = 8;
+ this.label5.Text = "校验:";
+ //
+ // cbStopBit
+ //
+ this.cbStopBit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cbStopBit.FormattingEnabled = true;
+ this.cbStopBit.Location = new System.Drawing.Point(71, 101);
+ this.cbStopBit.Name = "cbStopBit";
+ this.cbStopBit.Size = new System.Drawing.Size(80, 20);
+ this.cbStopBit.TabIndex = 7;
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Location = new System.Drawing.Point(12, 105);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(53, 12);
+ this.label4.TabIndex = 6;
+ this.label4.Text = "停止位:";
+ //
+ // cbDataBit
+ //
+ this.cbDataBit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cbDataBit.FormattingEnabled = true;
+ this.cbDataBit.Location = new System.Drawing.Point(71, 75);
+ this.cbDataBit.Name = "cbDataBit";
+ this.cbDataBit.Size = new System.Drawing.Size(80, 20);
+ this.cbDataBit.TabIndex = 5;
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(12, 79);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(53, 12);
+ this.label3.TabIndex = 4;
+ this.label3.Text = "数据位:";
+ //
+ // cbBaundrate
+ //
+ this.cbBaundrate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cbBaundrate.FormattingEnabled = true;
+ this.cbBaundrate.Location = new System.Drawing.Point(71, 49);
+ this.cbBaundrate.Name = "cbBaundrate";
+ this.cbBaundrate.Size = new System.Drawing.Size(80, 20);
+ this.cbBaundrate.TabIndex = 3;
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(12, 53);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(53, 12);
+ this.label2.TabIndex = 2;
+ this.label2.Text = "波特率:";
+ //
+ // cbName
+ //
+ this.cbName.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cbName.FormattingEnabled = true;
+ this.cbName.Location = new System.Drawing.Point(71, 23);
+ this.cbName.Name = "cbName";
+ this.cbName.Size = new System.Drawing.Size(80, 20);
+ this.cbName.TabIndex = 1;
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(24, 27);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(41, 12);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "端口:";
+ //
+ // gbSet2
+ //
+ this.gbSet2.Controls.Add(this.chkRTS);
+ this.gbSet2.Controls.Add(this.chkBreak);
+ this.gbSet2.Controls.Add(this.chkDTR);
+ this.gbSet2.Location = new System.Drawing.Point(12, 212);
+ this.gbSet2.Name = "gbSet2";
+ this.gbSet2.Size = new System.Drawing.Size(157, 70);
+ this.gbSet2.TabIndex = 1;
+ this.gbSet2.TabStop = false;
+ this.gbSet2.Text = "线路控制";
+ //
+ // chkRTS
+ //
+ this.chkRTS.AutoSize = true;
+ this.chkRTS.Location = new System.Drawing.Point(14, 42);
+ this.chkRTS.Name = "chkRTS";
+ this.chkRTS.Size = new System.Drawing.Size(42, 16);
+ this.chkRTS.TabIndex = 2;
+ this.chkRTS.Text = "RTS";
+ this.chkRTS.UseVisualStyleBackColor = true;
+ //
+ // chkBreak
+ //
+ this.chkBreak.AutoSize = true;
+ this.chkBreak.Location = new System.Drawing.Point(81, 20);
+ this.chkBreak.Name = "chkBreak";
+ this.chkBreak.Size = new System.Drawing.Size(54, 16);
+ this.chkBreak.TabIndex = 1;
+ this.chkBreak.Text = "Break";
+ this.chkBreak.UseVisualStyleBackColor = true;
+ //
+ // chkDTR
+ //
+ this.chkDTR.AutoSize = true;
+ this.chkDTR.Location = new System.Drawing.Point(14, 20);
+ this.chkDTR.Name = "chkDTR";
+ this.chkDTR.Size = new System.Drawing.Size(42, 16);
+ this.chkDTR.TabIndex = 0;
+ this.chkDTR.Text = "DTR";
+ this.chkDTR.UseVisualStyleBackColor = true;
+ //
+ // gbStatus
+ //
+ this.gbStatus.Controls.Add(this.chkRLSD);
+ this.gbStatus.Controls.Add(this.chkRing);
+ this.gbStatus.Controls.Add(this.chkDSR);
+ this.gbStatus.Controls.Add(this.chkCTS);
+ this.gbStatus.ForeColor = System.Drawing.Color.Red;
+ this.gbStatus.Location = new System.Drawing.Point(12, 288);
+ this.gbStatus.Name = "gbStatus";
+ this.gbStatus.Size = new System.Drawing.Size(157, 72);
+ this.gbStatus.TabIndex = 2;
+ this.gbStatus.TabStop = false;
+ this.gbStatus.Text = "线路状态(只读)";
+ //
+ // chkRLSD
+ //
+ this.chkRLSD.AutoSize = true;
+ this.chkRLSD.Enabled = false;
+ this.chkRLSD.Location = new System.Drawing.Point(81, 42);
+ this.chkRLSD.Name = "chkRLSD";
+ this.chkRLSD.Size = new System.Drawing.Size(48, 16);
+ this.chkRLSD.TabIndex = 6;
+ this.chkRLSD.Text = "RLSD";
+ this.chkRLSD.UseVisualStyleBackColor = true;
+ //
+ // chkRing
+ //
+ this.chkRing.AutoSize = true;
+ this.chkRing.Enabled = false;
+ this.chkRing.Location = new System.Drawing.Point(14, 42);
+ this.chkRing.Name = "chkRing";
+ this.chkRing.Size = new System.Drawing.Size(48, 16);
+ this.chkRing.TabIndex = 5;
+ this.chkRing.Text = "RING";
+ this.chkRing.UseVisualStyleBackColor = true;
+ //
+ // chkDSR
+ //
+ this.chkDSR.AutoSize = true;
+ this.chkDSR.Enabled = false;
+ this.chkDSR.Location = new System.Drawing.Point(81, 20);
+ this.chkDSR.Name = "chkDSR";
+ this.chkDSR.Size = new System.Drawing.Size(42, 16);
+ this.chkDSR.TabIndex = 4;
+ this.chkDSR.Text = "DSR";
+ this.chkDSR.UseVisualStyleBackColor = true;
+ //
+ // chkCTS
+ //
+ this.chkCTS.AutoSize = true;
+ this.chkCTS.Enabled = false;
+ this.chkCTS.Location = new System.Drawing.Point(14, 20);
+ this.chkCTS.Name = "chkCTS";
+ this.chkCTS.Size = new System.Drawing.Size(42, 16);
+ this.chkCTS.TabIndex = 3;
+ this.chkCTS.Text = "CTS";
+ this.chkCTS.UseVisualStyleBackColor = true;
+ //
+ // gbSet3
+ //
+ this.gbSet3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.gbSet3.Controls.Add(this.cbEncoding);
+ this.gbSet3.Controls.Add(this.label6);
+ this.gbSet3.Controls.Add(this.numMutilSend);
+ this.gbSet3.Controls.Add(this.btnClear);
+ this.gbSet3.Controls.Add(this.btnSendReceive);
+ this.gbSet3.Controls.Add(this.btnClearSend);
+ this.gbSet3.Controls.Add(this.chkMutilSend);
+ this.gbSet3.Controls.Add(this.chkHEXShow);
+ this.gbSet3.Controls.Add(this.chkHEXSend);
+ this.gbSet3.Location = new System.Drawing.Point(12, 366);
+ this.gbSet3.Name = "gbSet3";
+ this.gbSet3.Size = new System.Drawing.Size(157, 145);
+ this.gbSet3.TabIndex = 3;
+ this.gbSet3.TabStop = false;
+ this.gbSet3.Text = "辅助";
+ //
+ // cbEncoding
+ //
+ this.cbEncoding.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cbEncoding.FormattingEnabled = true;
+ this.cbEncoding.Location = new System.Drawing.Point(55, 16);
+ this.cbEncoding.Name = "cbEncoding";
+ this.cbEncoding.Size = new System.Drawing.Size(80, 20);
+ this.cbEncoding.TabIndex = 16;
+ this.cbEncoding.SelectedIndexChanged += new System.EventHandler(this.cbEncoding_SelectedIndexChanged);
+ //
+ // label6
+ //
+ this.label6.AutoSize = true;
+ this.label6.Location = new System.Drawing.Point(8, 20);
+ this.label6.Name = "label6";
+ this.label6.Size = new System.Drawing.Size(41, 12);
+ this.label6.TabIndex = 15;
+ this.label6.Text = "编码:";
+ //
+ // numMutilSend
+ //
+ this.numMutilSend.Location = new System.Drawing.Point(88, 62);
+ this.numMutilSend.Maximum = new decimal(new int[] {
+ 10000,
+ 0,
+ 0,
+ 0});
+ this.numMutilSend.Name = "numMutilSend";
+ this.numMutilSend.Size = new System.Drawing.Size(53, 21);
+ this.numMutilSend.TabIndex = 14;
+ this.numMutilSend.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
+ this.numMutilSend.Value = new decimal(new int[] {
+ 10,
+ 0,
+ 0,
+ 0});
+ //
+ // btnClear
+ //
+ this.btnClear.Location = new System.Drawing.Point(39, 115);
+ this.btnClear.Name = "btnClear";
+ this.btnClear.Size = new System.Drawing.Size(75, 23);
+ this.btnClear.TabIndex = 11;
+ this.btnClear.Text = "重新计数";
+ this.btnClear.UseVisualStyleBackColor = true;
+ this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
+ //
+ // btnSendReceive
+ //
+ this.btnSendReceive.Location = new System.Drawing.Point(82, 86);
+ this.btnSendReceive.Name = "btnSendReceive";
+ this.btnSendReceive.Size = new System.Drawing.Size(75, 23);
+ this.btnSendReceive.TabIndex = 9;
+ this.btnSendReceive.Text = "清接收区";
+ this.btnSendReceive.UseVisualStyleBackColor = true;
+ this.btnSendReceive.Click += new System.EventHandler(this.btnSendReceive_Click);
+ //
+ // btnClearSend
+ //
+ this.btnClearSend.Location = new System.Drawing.Point(6, 86);
+ this.btnClearSend.Name = "btnClearSend";
+ this.btnClearSend.Size = new System.Drawing.Size(75, 23);
+ this.btnClearSend.TabIndex = 7;
+ this.btnClearSend.Text = "清发送区";
+ this.btnClearSend.UseVisualStyleBackColor = true;
+ this.btnClearSend.Click += new System.EventHandler(this.btnClearSend_Click);
+ //
+ // chkMutilSend
+ //
+ this.chkMutilSend.AutoSize = true;
+ this.chkMutilSend.Location = new System.Drawing.Point(6, 64);
+ this.chkMutilSend.Name = "chkMutilSend";
+ this.chkMutilSend.Size = new System.Drawing.Size(72, 16);
+ this.chkMutilSend.TabIndex = 3;
+ this.chkMutilSend.Text = "连续发送";
+ this.chkMutilSend.UseVisualStyleBackColor = true;
+ //
+ // chkHEXShow
+ //
+ this.chkHEXShow.AutoSize = true;
+ this.chkHEXShow.Location = new System.Drawing.Point(76, 42);
+ this.chkHEXShow.Name = "chkHEXShow";
+ this.chkHEXShow.Size = new System.Drawing.Size(66, 16);
+ this.chkHEXShow.TabIndex = 2;
+ this.chkHEXShow.Text = "HEX显示";
+ this.chkHEXShow.UseVisualStyleBackColor = true;
+ //
+ // chkHEXSend
+ //
+ this.chkHEXSend.AutoSize = true;
+ this.chkHEXSend.Location = new System.Drawing.Point(6, 42);
+ this.chkHEXSend.Name = "chkHEXSend";
+ this.chkHEXSend.Size = new System.Drawing.Size(66, 16);
+ this.chkHEXSend.TabIndex = 1;
+ this.chkHEXSend.Text = "HEX发送";
+ this.chkHEXSend.UseVisualStyleBackColor = true;
+ //
+ // gbReceive
+ //
+ this.gbReceive.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.gbReceive.Controls.Add(this.txtReceive);
+ this.gbReceive.Location = new System.Drawing.Point(175, 12);
+ this.gbReceive.Name = "gbReceive";
+ this.gbReceive.Size = new System.Drawing.Size(561, 329);
+ this.gbReceive.TabIndex = 4;
+ this.gbReceive.TabStop = false;
+ this.gbReceive.Text = "接收区:已接收0字节";
+ //
+ // txtReceive
+ //
+ this.txtReceive.BackColor = System.Drawing.Color.White;
+ this.txtReceive.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.txtReceive.Location = new System.Drawing.Point(3, 17);
+ this.txtReceive.Multiline = true;
+ this.txtReceive.Name = "txtReceive";
+ this.txtReceive.ReadOnly = true;
+ this.txtReceive.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+ this.txtReceive.Size = new System.Drawing.Size(555, 309);
+ this.txtReceive.TabIndex = 0;
+ //
+ // gbSend
+ //
+ this.gbSend.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.gbSend.Controls.Add(this.btnMutilSend);
+ this.gbSend.Controls.Add(this.btnSend);
+ this.gbSend.Controls.Add(this.txtSend);
+ this.gbSend.Location = new System.Drawing.Point(178, 347);
+ this.gbSend.Name = "gbSend";
+ this.gbSend.Size = new System.Drawing.Size(558, 164);
+ this.gbSend.TabIndex = 5;
+ this.gbSend.TabStop = false;
+ this.gbSend.Text = "发送区:已发送0字节";
+ //
+ // btnMutilSend
+ //
+ this.btnMutilSend.Location = new System.Drawing.Point(390, 127);
+ this.btnMutilSend.Name = "btnMutilSend";
+ this.btnMutilSend.Size = new System.Drawing.Size(87, 29);
+ this.btnMutilSend.TabIndex = 2;
+ this.btnMutilSend.Text = "多项发送";
+ this.btnMutilSend.UseVisualStyleBackColor = true;
+ //
+ // btnSend
+ //
+ this.btnSend.Location = new System.Drawing.Point(64, 127);
+ this.btnSend.Name = "btnSend";
+ this.btnSend.Size = new System.Drawing.Size(87, 29);
+ this.btnSend.TabIndex = 1;
+ this.btnSend.Text = "发送";
+ this.btnSend.UseVisualStyleBackColor = true;
+ this.btnSend.Click += new System.EventHandler(this.btnSend_Click);
+ //
+ // txtSend
+ //
+ this.txtSend.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.txtSend.BackColor = System.Drawing.Color.White;
+ this.txtSend.Location = new System.Drawing.Point(0, 20);
+ this.txtSend.Multiline = true;
+ this.txtSend.Name = "txtSend";
+ this.txtSend.Size = new System.Drawing.Size(555, 101);
+ this.txtSend.TabIndex = 0;
+ //
+ // btnConnect
+ //
+ this.btnConnect.Location = new System.Drawing.Point(60, 177);
+ this.btnConnect.Name = "btnConnect";
+ this.btnConnect.Size = new System.Drawing.Size(87, 29);
+ this.btnConnect.TabIndex = 3;
+ this.btnConnect.Text = "打开串口";
+ this.btnConnect.UseVisualStyleBackColor = true;
+ this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click);
+ //
+ // timer1
+ //
+ this.timer1.Enabled = true;
+ this.timer1.Interval = 300;
+ this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
+ //
+ // FrmMain
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(740, 516);
+ this.Controls.Add(this.btnConnect);
+ this.Controls.Add(this.gbSend);
+ this.Controls.Add(this.gbReceive);
+ this.Controls.Add(this.gbSet3);
+ this.Controls.Add(this.gbStatus);
+ this.Controls.Add(this.gbSet2);
+ this.Controls.Add(this.gbSet);
+ this.Name = "FrmMain";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "串口调试工具";
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmMain_FormClosing);
+ this.Load += new System.EventHandler(this.FrmMain_Load);
+ this.gbSet.ResumeLayout(false);
+ this.gbSet.PerformLayout();
+ this.gbSet2.ResumeLayout(false);
+ this.gbSet2.PerformLayout();
+ this.gbStatus.ResumeLayout(false);
+ this.gbStatus.PerformLayout();
+ this.gbSet3.ResumeLayout(false);
+ this.gbSet3.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.numMutilSend)).EndInit();
+ this.gbReceive.ResumeLayout(false);
+ this.gbReceive.PerformLayout();
+ this.gbSend.ResumeLayout(false);
+ this.gbSend.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.GroupBox gbSet;
+ private System.Windows.Forms.ComboBox cbParity;
+ private System.Windows.Forms.Label label5;
+ private System.Windows.Forms.ComboBox cbStopBit;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.ComboBox cbDataBit;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.ComboBox cbBaundrate;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.ComboBox cbName;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.GroupBox gbSet2;
+ private System.Windows.Forms.GroupBox gbStatus;
+ private System.Windows.Forms.CheckBox chkRTS;
+ private System.Windows.Forms.CheckBox chkBreak;
+ private System.Windows.Forms.CheckBox chkDTR;
+ private System.Windows.Forms.CheckBox chkCTS;
+ private System.Windows.Forms.CheckBox chkRLSD;
+ private System.Windows.Forms.CheckBox chkRing;
+ private System.Windows.Forms.CheckBox chkDSR;
+ private System.Windows.Forms.GroupBox gbSet3;
+ private System.Windows.Forms.Button btnClear;
+ private System.Windows.Forms.Button btnSendReceive;
+ private System.Windows.Forms.Button btnClearSend;
+ private System.Windows.Forms.CheckBox chkMutilSend;
+ private System.Windows.Forms.CheckBox chkHEXShow;
+ private System.Windows.Forms.CheckBox chkHEXSend;
+ private System.Windows.Forms.GroupBox gbReceive;
+ private System.Windows.Forms.TextBox txtReceive;
+ private System.Windows.Forms.GroupBox gbSend;
+ private System.Windows.Forms.TextBox txtSend;
+ private System.Windows.Forms.NumericUpDown numMutilSend;
+ private System.Windows.Forms.Button btnMutilSend;
+ private System.Windows.Forms.Button btnSend;
+ private System.Windows.Forms.Button btnConnect;
+ private System.Windows.Forms.Timer timer1;
+ private System.Windows.Forms.ComboBox cbEncoding;
+ private System.Windows.Forms.Label label6;
+ }
+}
+
diff --git a/XCoder/XCom/FrmMain.resx b/XCoder/XCom/FrmMain.resx
new file mode 100644
index 0000000..6999fbf
--- /dev/null
+++ b/XCoder/XCom/FrmMain.resx
@@ -0,0 +1,123 @@
+<?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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+</root>
\ No newline at end of file
diff --git a/XCoder/XCom/IOHelper.cs b/XCoder/XCom/IOHelper.cs
new file mode 100644
index 0000000..2232ee1
--- /dev/null
+++ b/XCoder/XCom/IOHelper.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.IO.Ports;
+using System.Management;
+using System.Text;
+
+namespace XCom
+{
+ static class IOHelper
+ {
+ /// <summary>向字节数组写入一片数据</summary>
+ /// <param name="data"></param>
+ /// <param name="srcOffset"></param>
+ /// <param name="buf"></param>
+ /// <param name="offset"></param>
+ /// <param name="count"></param>
+ /// <returns></returns>
+ public static Byte[] Write(this Byte[] data, Int32 srcOffset, Byte[] buf, Int32 offset = 0, Int32 count = -1)
+ {
+ if (count <= 0) count = data.Length - offset;
+
+ Buffer.BlockCopy(buf, srcOffset, data, offset, count);
+
+ return data;
+ }
+
+ public static String[] GetPortNames()
+ {
+ var names = SerialPort.GetPortNames();
+ if (names == null || names.Length < 1) return names;
+
+ var dic = MulGetHardwareInfo();
+ for (int i = 0; i < names.Length; i++)
+ {
+ var des = "";
+ if (dic.TryGetValue(names[i], out des))
+ names[i] = String.Format("{0}({1})", names[i], des);
+ }
+
+ return names;
+ }
+
+ /// <summary>取硬件信息</summary>
+ /// <returns></returns>
+ static Dictionary<String, String> MulGetHardwareInfo()
+ {
+ var dic = new Dictionary<String, String>();
+ var searcher = new ManagementObjectSearcher("select * from Win32_SerialPort");
+ var moc = searcher.Get();
+ foreach (var hardInfo in moc)
+ {
+ //foreach (var item in hardInfo.Properties)
+ //{
+ // var name2 = item.Name;
+ // var obj = item.Value;
+ // name2 = name2 + " " + obj + "";
+ //}
+ var name = hardInfo.Properties["DeviceID"].Value.ToString();
+ if (!String.IsNullOrEmpty(name))
+ {
+ //dic.Add(name, hardInfo.Properties["Caption"].Value.ToString());
+ dic.Add(name, hardInfo.Properties["Description"].Value.ToString());
+ }
+
+ }
+ return dic;
+ }
+ }
+}
\ No newline at end of file
diff --git a/XCoder/XICO/FrmMain.cs b/XCoder/XICO/FrmMain.cs
new file mode 100644
index 0000000..c76413f
--- /dev/null
+++ b/XCoder/XICO/FrmMain.cs
@@ -0,0 +1,85 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+namespace XICO
+{
+ public partial class FrmMain : Form
+ {
+ public FrmMain()
+ {
+ InitializeComponent();
+
+ //AllowDrop = true;
+ picSrc.AllowDrop = true;
+ }
+
+ private void label3_Click(object sender, EventArgs e)
+ {
+ fontDialog1.Font = lbFont.Font;
+ if (fontDialog1.ShowDialog() != DialogResult.OK) return;
+
+ lbFont.Font = fontDialog1.Font;
+ }
+
+ private void label4_Click(object sender, EventArgs e)
+ {
+ colorDialog1.Color = lbFont.ForeColor;
+ if (colorDialog1.ShowDialog() != DialogResult.OK) return;
+
+ lbFont.ForeColor = colorDialog1.Color;
+ label4.ForeColor = colorDialog1.Color;
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ var brush = new SolidBrush(lbFont.ForeColor);
+
+ var bmp = new Bitmap(picSrc.Image);
+ var g = Graphics.FromImage(bmp);
+ //g.DrawImage(picSrc.Image, 0, 0);
+ g.DrawString(txt.Text, lbFont.Font, brush, 0, 0);
+ g.Dispose();
+
+ picDes.Image = bmp;
+ picDes.Refresh();
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+
+ }
+
+ private void txt_TextChanged(object sender, EventArgs e)
+ {
+ var str = txt.Text;
+ if (String.IsNullOrEmpty(str)) str = "字体样板";
+ lbFont.Text = str;
+ }
+
+ private void picSrc_DragDrop(object sender, DragEventArgs e)
+ {
+ var fs = (String[])e.Data.GetData(DataFormats.FileDrop);
+ if (fs != null && fs.Length > 0)
+ {
+ try
+ {
+ picSrc.Load(fs[0]);
+ }
+ catch { }
+ }
+ }
+
+ private void picSrc_DragEnter(object sender, DragEventArgs e)
+ {
+ if (e.Data.GetDataPresent(DataFormats.FileDrop))
+ e.Effect = DragDropEffects.Link;
+ else
+ e.Effect = DragDropEffects.None;
+ }
+ }
+}
\ No newline at end of file
diff --git a/XCoder/XICO/FrmMain.designer.cs b/XCoder/XICO/FrmMain.designer.cs
new file mode 100644
index 0000000..dd498c7
--- /dev/null
+++ b/XCoder/XICO/FrmMain.designer.cs
@@ -0,0 +1,193 @@
+namespace XICO
+{
+ partial class FrmMain
+ {
+ /// <summary>
+ /// 必需的设计器变量。
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// 清理所有正在使用的资源。
+ /// </summary>
+ /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows 窗体设计器生成的代码
+
+ /// <summary>
+ /// 设计器支持所需的方法 - 不要
+ /// 使用代码编辑器修改此方法的内容。
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.picSrc = new System.Windows.Forms.PictureBox();
+ this.picDes = new System.Windows.Forms.PictureBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this.fontDialog1 = new System.Windows.Forms.FontDialog();
+ this.colorDialog1 = new System.Windows.Forms.ColorDialog();
+ this.txt = new System.Windows.Forms.TextBox();
+ this.lbFont = new System.Windows.Forms.Label();
+ this.button1 = new System.Windows.Forms.Button();
+ this.button2 = new System.Windows.Forms.Button();
+ this.label3 = new System.Windows.Forms.Label();
+ this.label4 = new System.Windows.Forms.Label();
+ ((System.ComponentModel.ISupportInitialize)(this.picSrc)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.picDes)).BeginInit();
+ this.SuspendLayout();
+ //
+ // picSrc
+ //
+ this.picSrc.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.picSrc.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
+ this.picSrc.Cursor = System.Windows.Forms.Cursors.Default;
+ this.picSrc.Location = new System.Drawing.Point(12, 206);
+ this.picSrc.Name = "picSrc";
+ this.picSrc.Size = new System.Drawing.Size(256, 256);
+ this.picSrc.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
+ this.picSrc.TabIndex = 0;
+ this.picSrc.TabStop = false;
+ this.picSrc.DragDrop += new System.Windows.Forms.DragEventHandler(this.picSrc_DragDrop);
+ this.picSrc.DragEnter += new System.Windows.Forms.DragEventHandler(this.picSrc_DragEnter);
+ //
+ // picDes
+ //
+ this.picDes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.picDes.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
+ this.picDes.Location = new System.Drawing.Point(274, 206);
+ this.picDes.Name = "picDes";
+ this.picDes.Size = new System.Drawing.Size(256, 256);
+ this.picDes.TabIndex = 1;
+ this.picDes.TabStop = false;
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(22, 17);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(41, 12);
+ this.label1.TabIndex = 2;
+ this.label1.Text = "文本:";
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(22, 67);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(41, 12);
+ this.label2.TabIndex = 3;
+ this.label2.Text = "字体:";
+ //
+ // txt
+ //
+ this.txt.Location = new System.Drawing.Point(69, 13);
+ this.txt.Name = "txt";
+ this.txt.Size = new System.Drawing.Size(106, 21);
+ this.txt.TabIndex = 5;
+ this.txt.Text = "文字";
+ this.txt.TextChanged += new System.EventHandler(this.txt_TextChanged);
+ //
+ // lbFont
+ //
+ this.lbFont.AutoSize = true;
+ this.lbFont.Font = new System.Drawing.Font("微软雅黑", 70F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.lbFont.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
+ this.lbFont.Location = new System.Drawing.Point(69, 67);
+ this.lbFont.Name = "lbFont";
+ this.lbFont.Size = new System.Drawing.Size(428, 124);
+ this.lbFont.TabIndex = 6;
+ this.lbFont.Text = "字体样板";
+ this.lbFont.Click += new System.EventHandler(this.label3_Click);
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(201, 10);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(94, 47);
+ this.button1.TabIndex = 7;
+ this.button1.Text = "加水印";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // button2
+ //
+ this.button2.Location = new System.Drawing.Point(320, 10);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(94, 47);
+ this.button2.TabIndex = 8;
+ this.button2.Text = "制作图标";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(22, 42);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(41, 12);
+ this.label3.TabIndex = 9;
+ this.label3.Text = "颜色:";
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.label4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
+ this.label4.Location = new System.Drawing.Point(69, 42);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(83, 12);
+ this.label4.TabIndex = 10;
+ this.label4.Text = "点击更改颜色";
+ this.label4.Click += new System.EventHandler(this.label4_Click);
+ //
+ // FrmMain
+ //
+ this.AllowDrop = true;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(540, 472);
+ this.Controls.Add(this.label4);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.button2);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.lbFont);
+ this.Controls.Add(this.txt);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.label1);
+ this.Controls.Add(this.picDes);
+ this.Controls.Add(this.picSrc);
+ this.Name = "FrmMain";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "ICO图标水印工具";
+ ((System.ComponentModel.ISupportInitialize)(this.picSrc)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.picDes)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.PictureBox picSrc;
+ private System.Windows.Forms.PictureBox picDes;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.FontDialog fontDialog1;
+ private System.Windows.Forms.ColorDialog colorDialog1;
+ private System.Windows.Forms.TextBox txt;
+ private System.Windows.Forms.Label lbFont;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.Label label4;
+ }
+}
+
diff --git a/XCoder/XICO/FrmMain.resx b/XCoder/XICO/FrmMain.resx
new file mode 100644
index 0000000..dc075ae
--- /dev/null
+++ b/XCoder/XICO/FrmMain.resx
@@ -0,0 +1,126 @@
+<?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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="fontDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+ <metadata name="colorDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>139, 17</value>
+ </metadata>
+</root>
\ No newline at end of file
diff --git a/XCoder/XICO/IconFile.cs b/XCoder/XICO/IconFile.cs
new file mode 100644
index 0000000..0f1a278
--- /dev/null
+++ b/XCoder/XICO/IconFile.cs
@@ -0,0 +1,510 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.IO;
+
+namespace Test
+{
+ /// <summary>ICON文件</summary>
+ /// <remarks>http://blogs.msdn.com/b/oldnewthing/archive/2010/10/18/10077133.aspx</remarks>
+ public class IconFile
+ {
+ #region 属性
+ private ushort _Reserved = 0;
+ private ushort _Type = 1;
+ private ushort _Count = 1;
+ private IList<IconItem> Items = new List<IconItem>();
+
+ /// <summary>返回图形数量</summary>
+ public int Count { get { return _Count; } }
+ #endregion
+
+ #region 构造
+ public IconFile() { }
+
+ public IconFile(string file) { Load(file); }
+ #endregion
+
+ #region 基本方法
+ public void Load(String file)
+ {
+ using (var fs = File.OpenRead(file))
+ {
+ Load(fs);
+ }
+ }
+
+ /// <summary>读取</summary>
+ /// <param name="stream"></param>
+ public void Load(Stream stream)
+ {
+ var reader = new BinaryReader(stream);
+ _Reserved = reader.ReadUInt16();
+ _Type = reader.ReadUInt16();
+ _Count = reader.ReadUInt16();
+
+ if (_Type != 1 || _Reserved != 0) return;
+
+ for (ushort i = 0; i < _Count; i++)
+ {
+ Items.Add(new IconItem(reader));
+ }
+ }
+
+ public void Save(String file)
+ {
+ using (var fs = File.Create(file))
+ {
+ Save(fs);
+ }
+ }
+
+ /// <summary>保存ICO</summary>
+ /// <param name="stream"></param>
+ public void Save(Stream stream)
+ {
+ var writer = new BinaryWriter(stream);
+
+ writer.Write(_Reserved);
+ writer.Write(_Type);
+ writer.Write((ushort)Items.Count);
+
+ foreach (var item in Items)
+ {
+ item.Save(writer);
+ }
+ foreach (var item in Items)
+ {
+ writer.Write(item.Data);
+ }
+ }
+
+ /// <summary>根据索引返回图形</summary>
+ /// <param name="index"></param>
+ /// <returns></returns>
+ public Bitmap Get(int index)
+ {
+ var inf = new BitmapInfo(Items[index].Data);
+ return inf.IconBmp;
+ }
+
+ public void Add(Image bmp, Int16 size)
+ {
+ // 缩放图片到目标大小
+ var ico = new Bitmap(bmp, size, size);
+
+ var ms = new MemoryStream();
+ ico.Save(ms, ImageFormat.Png);
+
+ var item = new IconItem();
+ // bmp要跳过14字节,还要修改高度,png不用
+ //ms.Position = 14;
+ //item.Data = new byte[ms.Length - 14];
+ //ms.Read(item.Data, 0, item.Data.Length);
+ item.Data = ms.ToArray();
+ item.Size = (uint)item.Data.Length;
+
+ item.Width = (Byte)size;
+ item.Height = (Byte)size;
+
+ ////BMP图形和ICO的高不一样 ICO的高是BMP的2倍
+ //var h = BitConverter.ToInt32(item.Data, 8);
+ //h *= 2;
+ //var buf = BitConverter.GetBytes(h);
+ //Buffer.BlockCopy(buf, 0, item.Data, 8, buf.Length);
+
+ Items.Add(item);
+
+ ResetOffset();
+ }
+
+ public void RemoveAt(int index)
+ {
+ Items.RemoveAt(index);
+
+ ResetOffset();
+ }
+
+ /// <summary>重新设置数据偏移</summary>
+ void ResetOffset()
+ {
+ _Count = (UInt16)Items.Count;
+
+ var idx = (UInt32)(6 + _Count * 16);
+ foreach (var item in Items)
+ {
+ item.Offset = idx;
+ idx += item.Size;
+ }
+ }
+ #endregion
+
+ #region 静态方法
+ public static void Convert(String srcfile, String desfile, params Int16[] sizes)
+ {
+ using (var bmp = new Bitmap(srcfile))
+ {
+ var ico = new IconFile();
+ //ico.Add(bmp, size);
+ foreach (var item in sizes)
+ {
+ ico.Add(bmp, item);
+ }
+ ico.Save(desfile);
+ }
+ }
+ #endregion
+
+ private class IconItem
+ {
+ #region 属性
+ private byte _Width = 16;
+ /// <summary>图像宽度,以象素为单位。一个字节</summary>
+ public byte Width { get { return _Width; } set { _Width = value; } }
+
+ private byte _Height = 16;
+ /// <summary>图像高度,以象素为单位。一个字节</summary>
+ public byte Height { get { return _Height; } set { _Height = value; } }
+
+ private byte _ColorCount = 0;
+ /// <summary>图像中的颜色数(如果是>=8bpp的位图则为0)</summary>
+ public byte ColorCount { get { return _ColorCount; } set { _ColorCount = value; } }
+
+ private byte _Reserved = 0; //4
+ /// <summary>保留字必须是0</summary>
+ public byte Reserved { get { return _Reserved; } set { _Reserved = value; } }
+
+ private ushort _Planes = 1;
+ /// <summary>为目标设备说明位面数,其值将总是被设为1</summary>
+ public ushort Planes { get { return _Planes; } set { _Planes = value; } }
+
+ private ushort _BitCount = 32; //8
+ /// <summary>每象素所占位数。</summary>
+ public ushort BitCount { get { return _BitCount; } set { _BitCount = value; } }
+
+ private uint _Size = 0;
+ /// <summary>字节大小。</summary>
+ public uint Size { get { return _Size; } set { _Size = value; } }
+
+ private uint _Offset = 0; //16
+ /// <summary>起点偏移位置。</summary>
+ public uint Offset { get { return _Offset; } set { _Offset = value; } }
+
+ private byte[] _Data;
+ /// <summary>图形数据</summary>
+ public byte[] Data { get { return _Data; } set { _Data = value; } }
+ #endregion
+
+ #region 构造
+ public IconItem() { }
+
+ public IconItem(BinaryReader reader) { Load(reader); }
+ #endregion
+
+ #region 方法
+ public IconItem Load(BinaryReader reader)
+ {
+ _Width = reader.ReadByte();
+ _Height = reader.ReadByte();
+ _ColorCount = reader.ReadByte();
+ _Reserved = reader.ReadByte();
+
+ _Planes = reader.ReadUInt16();
+ _BitCount = reader.ReadUInt16();
+ _Size = reader.ReadUInt32();
+ _Offset = reader.ReadUInt32();
+
+ var ms = reader.BaseStream;
+ var p = ms.Position;
+ ms.Position = _Offset;
+ _Data = reader.ReadBytes((Int32)_Size);
+ ms.Position = p;
+
+ return this;
+ }
+
+ public IconItem Save(BinaryWriter writer)
+ {
+ writer.Write(_Width);
+ writer.Write(_Height);
+ writer.Write(_ColorCount);
+ writer.Write(_Reserved);
+
+ writer.Write(_Planes);
+ writer.Write(_BitCount);
+ writer.Write(_Size);
+ writer.Write(_Offset);
+
+ return this;
+ }
+ #endregion
+ }
+
+ private class BitmapInfo
+ {
+ #region 属性
+ public IList<Color> ColorTable = new List<Color>();
+
+ private uint biSize = 40;
+ /// <summary>
+ /// 占4位,位图信息头(Bitmap Info Header)的长度,一般为$28
+ /// </summary>
+ public uint InfoSize { get { return biSize; } set { biSize = value; } }
+
+ private uint biWidth;
+ /// <summary>
+ /// 占4位,位图的宽度,以象素为单位
+ /// </summary>
+ public uint Width { get { return biWidth; } set { biWidth = value; } }
+
+ private uint biHeight;
+ /// <summary>
+ /// 占4位,位图的高度,以象素为单位
+ /// </summary>
+ public uint Height { get { return biHeight; } set { biHeight = value; } }
+
+ private ushort biPlanes = 1;
+ /// <summary>
+ /// 占2位,位图的位面数(注:该值将总是1)
+ /// </summary>
+ public ushort Planes { get { return biPlanes; } set { biPlanes = value; } }
+
+ private ushort biBitCount;
+ /// <summary>
+ /// 占2位,每个象素的位数,设为32(32Bit位图)
+ /// </summary>
+ public ushort BitCount { get { return biBitCount; } set { biBitCount = value; } }
+
+ private uint biCompression = 0;
+ /// <summary>
+ /// 占4位,压缩说明,设为0(不压缩)
+ /// </summary>
+ public uint Compression { get { return biCompression; } set { biCompression = value; } }
+
+ private uint biSizeImage;
+ /// <summary>
+ /// 占4位,用字节数表示的位图数据的大小。该数必须是4的倍数
+ /// </summary>
+ public uint SizeImage { get { return biSizeImage; } set { biSizeImage = value; } }
+
+ private uint biXPelsPerMeter;
+ /// <summary>
+ /// 占4位,用象素/米表示的水平分辨率
+ /// </summary>
+ public uint XPelsPerMeter { get { return biXPelsPerMeter; } set { biXPelsPerMeter = value; } }
+
+ private uint biYPelsPerMeter;
+ /// <summary>
+ /// 占4位,用象素/米表示的垂直分辨率
+ /// </summary>
+ public uint YPelsPerMeter { get { return biYPelsPerMeter; } set { biYPelsPerMeter = value; } }
+
+ private uint biClrUsed;
+ /// <summary>
+ /// 占4位,位图使用的颜色数
+ /// </summary>
+ public uint ClrUsed { get { return biClrUsed; } set { biClrUsed = value; } }
+
+ private uint biClrImportant;
+ /// <summary>占4位,指定重要的颜色数(到此处刚好40个字节,$28)</summary>
+ public uint ClrImportant { get { return biClrImportant; } set { biClrImportant = value; } }
+
+ private Bitmap _IconBitMap;
+ /// <summary>图形</summary>
+ public Bitmap IconBmp { get { return _IconBitMap; } set { _IconBitMap = value; } }
+ #endregion
+
+ public BitmapInfo(byte[] data)
+ {
+ var reader = new BinaryReader(new MemoryStream(data));
+
+ #region 基本数据
+ biSize = reader.ReadUInt32();
+ if (biSize != 40) return;
+
+ biWidth = reader.ReadUInt32();
+ biHeight = reader.ReadUInt32();
+ biPlanes = reader.ReadUInt16();
+ biBitCount = reader.ReadUInt16();
+ biCompression = reader.ReadUInt32();
+ biSizeImage = reader.ReadUInt32();
+ biXPelsPerMeter = reader.ReadUInt32();
+ biYPelsPerMeter = reader.ReadUInt32();
+ biClrUsed = reader.ReadUInt32();
+ biClrImportant = reader.ReadUInt32();
+ #endregion
+
+ int count = RgbCount();
+ if (count == -1) return;
+
+ for (int i = 0; i != count; i++)
+ {
+ byte Blue = reader.ReadByte();
+ byte Green = reader.ReadByte();
+ byte Red = reader.ReadByte();
+ byte Reserved = reader.ReadByte();
+ ColorTable.Add(Color.FromArgb((int)Reserved, (int)Red, (int)Green, (int)Blue));
+ }
+
+ int Size = (int)(biBitCount * biWidth) / 8; // 象素的大小*象素数 /字节数
+ if ((double)Size < biBitCount * biWidth / 8) Size++; //如果是 宽19*4(16色)/8 =9.5 就+1;
+ if (Size < 4) Size = 4;
+ byte[] WidthByte = new byte[Size];
+
+ _IconBitMap = new Bitmap((int)biWidth, (int)(biHeight / 2));
+ for (int i = (int)(biHeight / 2); i != 0; i--)
+ {
+ //for (int z = 0; z != Size; z++)
+ //{
+ // WidthByte[z] = data[idx + z];
+ //}
+ //idx += Size;
+ WidthByte = reader.ReadBytes(Size);
+ IconSet(_IconBitMap, i - 1, WidthByte);
+ }
+
+ //取掩码
+ int MaskSize = (int)(biWidth / 8);
+ if ((double)MaskSize < biWidth / 8) MaskSize++; //如果是 宽19*4(16色)/8 =9.5 就+1;
+ if (MaskSize < 4) MaskSize = 4;
+ byte[] MashByte = new byte[MaskSize];
+ for (int i = (int)(biHeight / 2); i != 0; i--)
+ {
+ //for (int z = 0; z != MaskSize; z++)
+ //{
+ // MashByte[z] = data[idx + z];
+ //}
+ //idx += MaskSize;
+ MashByte = reader.ReadBytes(MaskSize);
+ IconMask(_IconBitMap, i - 1, MashByte);
+ }
+ }
+
+ private int RgbCount()
+ {
+ switch (biBitCount)
+ {
+ case 1:
+ return 2;
+ case 4:
+ return 16;
+ case 8:
+ return 256;
+ case 24:
+ return 0;
+ case 32:
+ return 0;
+ default:
+ return -1;
+ }
+ }
+
+ private void IconSet(Bitmap IconImage, int RowIndex, byte[] ImageByte)
+ {
+ int idx = 0;
+ switch (biBitCount)
+ {
+ case 1:
+ #region 一次读8位 绘制8个点
+ for (int i = 0; i != ImageByte.Length; i++)
+ {
+ var MyArray = new BitArray(new byte[] { ImageByte[i] });
+
+ if (idx >= IconImage.Width) return;
+ IconImage.SetPixel(idx, RowIndex, ColorTable[GetBitNumb(MyArray[7])]);
+ idx++;
+ if (idx >= IconImage.Width) return;
+ IconImage.SetPixel(idx, RowIndex, ColorTable[GetBitNumb(MyArray[6])]);
+ idx++;
+ if (idx >= IconImage.Width) return;
+ IconImage.SetPixel(idx, RowIndex, ColorTable[GetBitNumb(MyArray[5])]);
+ idx++;
+ if (idx >= IconImage.Width) return;
+ IconImage.SetPixel(idx, RowIndex, ColorTable[GetBitNumb(MyArray[4])]);
+ idx++;
+ if (idx >= IconImage.Width) return;
+ IconImage.SetPixel(idx, RowIndex, ColorTable[GetBitNumb(MyArray[3])]);
+ idx++;
+ if (idx >= IconImage.Width) return;
+ IconImage.SetPixel(idx, RowIndex, ColorTable[GetBitNumb(MyArray[2])]);
+ idx++;
+ if (idx >= IconImage.Width) return;
+ IconImage.SetPixel(idx, RowIndex, ColorTable[GetBitNumb(MyArray[1])]);
+ idx++;
+ if (idx >= IconImage.Width) return;
+ IconImage.SetPixel(idx, RowIndex, ColorTable[GetBitNumb(MyArray[0])]);
+ idx++;
+ }
+ #endregion
+ break;
+ case 4:
+ #region 一次读8位 绘制2个点
+ for (int i = 0; i != ImageByte.Length; i++)
+ {
+ int High = ImageByte[i] >> 4; //取高4位
+ int Low = ImageByte[i] - (High << 4); //取低4位
+ if (idx >= IconImage.Width) return;
+ IconImage.SetPixel(idx, RowIndex, ColorTable[High]);
+ idx++;
+ if (idx >= IconImage.Width) return;
+ IconImage.SetPixel(idx, RowIndex, ColorTable[Low]);
+ idx++;
+ }
+ #endregion
+ break;
+ case 8:
+ #region 一次读8位 绘制一个点
+ for (int i = 0; i != ImageByte.Length; i++)
+ {
+ if (idx >= IconImage.Width) return;
+ IconImage.SetPixel(idx, RowIndex, ColorTable[ImageByte[i]]);
+ idx++;
+ }
+ #endregion
+ break;
+ case 24:
+ #region 一次读24位 绘制一个点
+ for (int i = 0; i != ImageByte.Length / 3; i++)
+ {
+ if (i >= IconImage.Width) return;
+ IconImage.SetPixel(i, RowIndex, Color.FromArgb(ImageByte[idx + 2], ImageByte[idx + 1], ImageByte[idx]));
+ idx += 3;
+ }
+ #endregion
+ break;
+ case 32:
+ #region 一次读32位 绘制一个点
+ for (int i = 0; i != ImageByte.Length / 4; i++)
+ {
+ if (i >= IconImage.Width) return;
+
+ IconImage.SetPixel(i, RowIndex, Color.FromArgb(ImageByte[idx + 2], ImageByte[idx + 1], ImageByte[idx]));
+ idx += 4;
+ }
+ #endregion
+ break;
+ default:
+ break;
+ }
+ }
+
+ private void IconMask(Bitmap IconImage, int RowIndex, byte[] MaskByte)
+ {
+ var Set = new BitArray(MaskByte);
+ int idx = 0;
+ for (int i = Set.Count; i != 0; i--)
+ {
+ if (idx >= IconImage.Width) return;
+
+ var SetColor = IconImage.GetPixel(idx, RowIndex);
+ if (!Set[i - 1]) IconImage.SetPixel(idx, RowIndex, Color.FromArgb(255, SetColor.R, SetColor.G, SetColor.B));
+ idx++;
+ }
+ }
+
+ private int GetBitNumb(bool BitArray) { return BitArray ? 1 : 0; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/XCoder/XICO/leaf.png b/XCoder/XICO/leaf.png
new file mode 100644
index 0000000..00d4a68
Binary files /dev/null and b/XCoder/XICO/leaf.png differ
diff --git a/XCoder/XRegex/FileResource.cs b/XCoder/XRegex/FileResource.cs
new file mode 100644
index 0000000..dd5fcd1
--- /dev/null
+++ b/XCoder/XRegex/FileResource.cs
@@ -0,0 +1,100 @@
+using System;
+using System.Drawing;
+using System.IO;
+using System.Reflection;
+using System.Threading;
+using System.Windows.Forms;
+
+namespace NewLife.XRegex
+{
+ /// <summary>
+ /// 文件资源
+ /// </summary>
+ public static class FileResource
+ {
+ /// <summary>
+ /// 开始检查模版,模版文件夹不存在时,释放模版
+ /// </summary>
+ public static void CheckTemplate()
+ {
+ ThreadPool.QueueUserWorkItem(delegate(Object state)
+ {
+ try
+ {
+ ReleaseTemplateFiles("Pattern");
+ ReleaseTemplateFiles("Sample");
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.ToString());
+ }
+ });
+ }
+
+ /// <summary>
+ /// 释放模版文件
+ /// </summary>
+ /// <param name="name"></param>
+ public static void ReleaseTemplateFiles(String name)
+ {
+ String path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, name);
+ if (Directory.Exists(path)) return;
+
+ String[] ss = Assembly.GetExecutingAssembly().GetManifestResourceNames();
+ if (ss == null || ss.Length <= 0) return;
+
+ // 取命名空间
+ String prefix = typeof(FileResource).FullName;
+ prefix = prefix.Substring(0, prefix.LastIndexOf("."));
+ prefix += "." + name + ".";
+
+ //找到资源名
+ foreach (String item in ss)
+ {
+ if (item.StartsWith(prefix))
+ {
+ String fileName = item.Substring(prefix.Length);
+ fileName = fileName.Replace(".", @"\");
+ // 最后一个斜杠变回圆点
+ Char[] cc = fileName.ToCharArray();
+ cc[fileName.LastIndexOf("\\")] = '.';
+ fileName = new String(cc);
+ fileName = Path.Combine(path, fileName);
+
+ ReleaseFile(item, fileName);
+ }
+ }
+ }
+
+ /// <summary>
+ /// 读取资源,并写入到文件
+ /// </summary>
+ /// <param name="name"></param>
+ /// <param name="fileName"></param>
+ static void ReleaseFile(String name, String fileName)
+ {
+ try
+ {
+ Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name);
+ if (stream == null) return;
+
+ Byte[] buffer = new Byte[stream.Length];
+ Int32 count = stream.Read(buffer, 0, buffer.Length);
+
+ String p = Path.GetDirectoryName(fileName);
+ if (!String.IsNullOrEmpty(p) && !Directory.Exists(p)) Directory.CreateDirectory(p);
+
+ File.WriteAllBytes(fileName, buffer);
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.ToString());
+ }
+ }
+
+ public static Icon GetIcon()
+ {
+ return new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream(typeof(FileResource), "leaf.ico"));
+ }
+ }
+}
\ No newline at end of file
diff --git a/XCoder/XRegex/FrmMain.cs b/XCoder/XRegex/FrmMain.cs
new file mode 100644
index 0000000..0f8fa3a
--- /dev/null
+++ b/XCoder/XRegex/FrmMain.cs
@@ -0,0 +1,545 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.IO;
+using System.Reflection;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading;
+using System.Windows.Forms;
+
+namespace NewLife.XRegex
+{
+ public partial class FrmMain : Form
+ {
+ #region 窗体初始化
+ public FrmMain()
+ {
+ InitializeComponent();
+
+ this.Icon = FileResource.GetIcon();
+
+ FileResource.CheckTemplate();
+ }
+
+ private void FrmMain_Shown(object sender, EventArgs e)
+ {
+ Text += " V" + FileVersion;
+
+ GetOption();
+ }
+
+ private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
+ {
+ // 关闭前保存正则和内容
+ Save(txtPattern.Text, "Pattern");
+ Save(txtContent.Text, "Sample");
+ }
+
+ void Save(String content, String name)
+ {
+ if (String.IsNullOrEmpty(content)) return;
+
+ String p = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, name);
+ p = Path.Combine(p, "最近");
+
+ #region 预处理
+ if (Directory.Exists(p))
+ {
+ // 拿出所有文件
+ String[] files = Directory.GetFiles(p, "*.txt", SearchOption.TopDirectoryOnly);
+ if (files != null && files.Length > 0)
+ {
+ // 内容比对
+ List<String> list = new List<String>();
+ foreach (String item in files)
+ {
+ String content2 = File.ReadAllText(item);
+ if (content2 == content)
+ File.Delete(item);
+ else
+ list.Add(item);
+ }
+
+ // 是否超标
+ if (list.Count >= 10)
+ {
+ // 文件排序
+ list.Sort();
+
+ // 删除最后的
+ for (int i = list.Count - 1; i >= 10; i--)
+ {
+ File.Delete(list[i]);
+ }
+ }
+ }
+ }
+ else
+ Directory.CreateDirectory(p);
+ #endregion
+
+ // 写入
+ String file = String.Format("{0:yyyy-MM-dd_HHmmss}.txt", DateTime.Now);
+ file = Path.Combine(p, file);
+ File.WriteAllText(file, content);
+ }
+ #endregion
+
+ #region 正则匹配
+ private void radioButton1_CheckedChanged(object sender, EventArgs e)
+ {
+ RadioButton rb = sender as RadioButton;
+ if (rb.Checked)
+ {
+ button2.Text = "正则匹配";
+ groupBox3.Text = "匹配结果";
+ splitContainer3.Visible = true;
+ rtReplace.Visible = false;
+ panel1.Visible = false;
+ }
+ else
+ {
+ button2.Text = "正则替换";
+ groupBox3.Text = "替换内容";
+ splitContainer3.Visible = false;
+ rtReplace.Visible = true;
+ panel1.Visible = true;
+ }
+ }
+
+ void GetReg(out String pattern, out RegexOptions options)
+ {
+ pattern = txtPattern.SelectedText;
+ options = RegexOptions.None;
+
+ if (String.IsNullOrEmpty(txtPattern.Text)) return;
+ if (String.IsNullOrEmpty(pattern)) pattern = txtPattern.Text;
+
+ if (chkIgnoreCase.Checked) options |= RegexOptions.IgnoreCase;
+ if (chkMultiline.Checked) options |= RegexOptions.Multiline;
+ if (chkIgnorePatternWhitespace.Checked) options |= RegexOptions.IgnorePatternWhitespace;
+ if (chkSingleline.Checked) options |= RegexOptions.Singleline;
+ }
+
+ Boolean ProcessAsync(Action<Regex> callback, Int32 timeout)
+ {
+ String pattern;
+ RegexOptions options;
+ GetReg(out pattern, out options);
+
+ Boolean isSuccess = false;
+ AutoResetEvent e = new AutoResetEvent(false);
+ Thread thread = new Thread(new ThreadStart(delegate
+ {
+ try
+ {
+ // 如果正则表达式过于复杂,创建对象时可能需要花很长时间,甚至超时
+ Regex reg = new Regex(pattern, options);
+ callback(reg);
+
+ isSuccess = true;
+ }
+ catch (ThreadAbortException) { }
+ catch (Exception ex)
+ {
+ ShowError(ex.Message);
+ }
+ finally
+ {
+ e.Set();
+ }
+ }));
+
+ lbStatus.Text = "准备开始!";
+ thread.Start();
+ //if (!are.WaitOne(5000))
+ //{
+ // thread.Abort();
+ // ShowError("执行正则表达式超时!");
+ // return;
+ //}
+ Boolean b = false;
+ for (int i = 0; i < timeout / 100; i++)
+ {
+ if (e.WaitOne(100))
+ {
+ b = true;
+ break;
+ }
+
+ lbStatus.Text = String.Format("正在处理…… {0:n1}s/{1:n1}s", (Double)i / 10, timeout / 1000);
+ }
+ if (!b)
+ {
+ thread.Abort();
+ ShowError("执行正则表达式超时!");
+ }
+ return isSuccess;
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ if (String.IsNullOrEmpty(txtPattern.Text)) return;
+ String content = txtContent.Text;
+ if (String.IsNullOrEmpty(content)) return;
+
+ // 是否替换
+ Boolean isReplace = !radioButton1.Checked;
+ String replacement = rtReplace.Text;
+ if (isReplace && String.IsNullOrEmpty(replacement)) return;
+
+ Regex r = null;
+ MatchCollection ms = null;
+ Int32 count = 0;
+
+ // 异步执行,防止超时
+ Boolean isSuccess = ProcessAsync(delegate(Regex reg)
+ {
+ r = reg;
+ ms = reg.Matches(content);
+ if (ms != null) count = ms.Count;
+ if (isReplace && count > 0) content = reg.Replace(content, replacement);
+ }, 5000);
+
+ lvMatch.Tag = r;
+ lvMatch.Items.Clear();
+ lvGroup.Items.Clear();
+ lvCapture.Items.Clear();
+
+ if (!isSuccess || count < 1) return;
+
+ lbStatus.Text = String.Format("成功{0} {1} 项!", !isReplace ? "匹配" : "替换", count);
+
+ int i = 1;
+ foreach (Match match in ms)
+ {
+ ListViewItem item = lvMatch.Items.Add(i.ToString());
+ item.SubItems.Add(match.Value);
+ item.SubItems.Add(String.Format("({0},{1},{2})", txtContent.GetLineFromCharIndex(match.Index), match.Index, match.Length));
+ item.Tag = match;
+ i++;
+ }
+
+ if (isReplace) txtContent.Text = content;
+ }
+
+ private void button5_Click(object sender, EventArgs e)
+ {
+ if (String.IsNullOrEmpty(txtPattern.Text)) return;
+ String replacement = rtReplace.Text;
+ if (String.IsNullOrEmpty(replacement)) return;
+
+ // 获取文件
+ String[] files = GetFiles();
+ lbStatus.Text = String.Format("共有符合条件的文件 {0} 个!", files.Length);
+
+ MatchCollection ms = null;
+ Int32 count = 0;
+
+ // 异步执行,防止超时
+ Boolean isSuccess = ProcessAsync(delegate(Regex reg)
+ {
+ foreach (String item in files)
+ {
+ String content = File.ReadAllText(item);
+ ms = reg.Matches(content);
+ if (ms != null) count = ms.Count;
+ // 有匹配项才替换
+ if (count > 0)
+ {
+ String content2 = reg.Replace(content, replacement);
+ // 有改变才更新文件
+ if (content != content2) File.WriteAllText(item, content2);
+ }
+ }
+ }, 1000 * files.Length);
+
+ if (!isSuccess || count < 1) return;
+
+ lbStatus.Text = String.Format("成功替换 {0} 项!", count);
+
+ txtContent.Text = File.ReadAllText(files[0]);
+ }
+ #endregion
+
+ #region 选择匹配项
+ private void lvMatch_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ if (lvMatch.SelectedItems == null || lvMatch.SelectedItems.Count < 1) return;
+
+ // 当前选择项
+ Match m = lvMatch.SelectedItems[0].Tag as Match;
+ //rtContent.SelectedText = m.Value;
+ txtContent.Select(m.Index, m.Length);
+ txtContent.ScrollToCaret();
+
+ // 分组的选择是否与当前一致
+ Match m2 = lvGroup.Tag as Match;
+ if (m2 != null && m2 == m) return;
+
+ lvGroup.Tag = m;
+ lvGroup.Items.Clear();
+ lvCapture.Items.Clear();
+
+ Regex reg = lvMatch.Tag as Regex;
+ for (int i = 0; i < m.Groups.Count; i++)
+ {
+ Group g = m.Groups[i];
+ ListViewItem item = lvGroup.Items.Add(i.ToString());
+ item.SubItems.Add(reg.GroupNameFromNumber(i));
+ item.SubItems.Add(g.Value);
+ item.SubItems.Add(String.Format("({0},{1},{2})", txtContent.GetLineFromCharIndex(g.Index), g.Index, g.Length));
+ item.Tag = g;
+ }
+ }
+
+ private void lvGroup_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ if (lvGroup.SelectedItems == null || lvGroup.SelectedItems.Count < 1) return;
+
+ // 当前选择项
+ Group g = lvGroup.SelectedItems[0].Tag as Group;
+ //rtContent.SelectedText = g.Value;
+ txtContent.Select(g.Index, g.Length);
+ txtContent.ScrollToCaret();
+
+ // 分组的选择是否与当前一致
+ Group g2 = lvCapture.Tag as Group;
+ if (g2 != null && g2 == g) return;
+
+ lvCapture.Tag = g;
+ lvCapture.Items.Clear();
+
+ for (int i = 0; i < g.Captures.Count; i++)
+ {
+ Capture c = g.Captures[i];
+ ListViewItem item = lvCapture.Items.Add(i.ToString());
+ item.SubItems.Add(c.Value);
+ item.SubItems.Add(String.Format("({0},{1},{2})", txtContent.GetLineFromCharIndex(c.Index), c.Index, c.Length));
+ item.Tag = g.Captures[i];
+ }
+ }
+
+ private void lvCapture_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ if (lvCapture.SelectedItems == null || lvCapture.SelectedItems.Count < 1) return;
+
+ // 当前选择项
+ Capture c = lvCapture.SelectedItems[0].Tag as Capture;
+ //rtContent.SelectedText = c.Value;
+ txtContent.Select(c.Index, c.Length);
+ txtContent.ScrollToCaret();
+ }
+ #endregion
+
+ #region 辅助函数
+ void ShowError(String msg)
+ {
+ MessageBox.Show(msg, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+
+ private static String _FileVersion;
+ /// <summary>
+ /// 文件版本
+ /// </summary>
+ public static String FileVersion
+ {
+ get
+ {
+ if (String.IsNullOrEmpty(_FileVersion))
+ {
+ Assembly asm = Assembly.GetExecutingAssembly();
+ AssemblyFileVersionAttribute av = Attribute.GetCustomAttribute(asm, typeof(AssemblyFileVersionAttribute)) as AssemblyFileVersionAttribute;
+ if (av != null) _FileVersion = av.Version;
+ if (String.IsNullOrEmpty(_FileVersion)) _FileVersion = "1.0";
+ }
+ return _FileVersion;
+ }
+ }
+
+ ///// <summary>
+ ///// 找兄弟控件
+ ///// </summary>
+ ///// <typeparam name="T"></typeparam>
+ ///// <param name="src"></param>
+ ///// <returns></returns>
+ //T FindBrotherControl<T>(Control src) where T : Control
+ //{
+
+ //}
+ #endregion
+
+ #region 菜单
+ private void ptMenu_Opening(object sender, CancelEventArgs e)
+ {
+ for (int i = ptMenu.Items.Count - 1; i >= 1; i--)
+ {
+ ptMenu.Items.RemoveAt(i);
+ }
+ LoadMenuTree(ptMenu.Items, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Pattern"));
+ }
+
+ private void txtMenu_Opening(object sender, CancelEventArgs e)
+ {
+ for (int i = txtMenu.Items.Count - 1; i >= 1; i--)
+ {
+ txtMenu.Items.RemoveAt(i);
+ }
+ LoadMenuTree(txtMenu.Items, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Sample"));
+ }
+
+ /// <summary>
+ /// 加载菜单树
+ /// </summary>
+ /// <param name="items"></param>
+ /// <param name="path"></param>
+ void LoadMenuTree(ToolStripItemCollection items, String path)
+ {
+ // 遍历目录
+
+ String[] dirs = Directory.GetDirectories(path, "*", SearchOption.TopDirectoryOnly);
+ if (dirs != null && dirs.Length > 0)
+ {
+ foreach (String item in dirs)
+ {
+ String name = item;
+ if (name.Contains("\\")) name = name.Substring(name.LastIndexOf("\\") + 1);
+
+ ToolStripMenuItem menu = new ToolStripMenuItem(name);
+ menu.Click += MenuItem_Click;
+
+ LoadMenuTree(menu.DropDownItems, Path.Combine(path, item));
+
+ // 有子项目才加入菜单
+ if (menu.DropDownItems.Count > 0) items.Add(menu);
+ }
+ }
+ // 遍历文件
+ String[] files = Directory.GetFiles(path, "*.txt", SearchOption.TopDirectoryOnly);
+ if (files != null && files.Length > 0)
+ {
+ foreach (String item in files)
+ {
+ ToolStripMenuItem menu = new ToolStripMenuItem(Path.GetFileNameWithoutExtension(item));
+ menu.Click += MenuItem_Click;
+ menu.Tag = Path.Combine(path, item);
+
+ items.Add(menu);
+ }
+ }
+ }
+
+ private void MenuItem_Click(object sender, EventArgs e)
+ {
+ ToolStripMenuItem menu = sender as ToolStripMenuItem;
+ if (menu == null) return;
+
+ // 找文件路径
+ String file = (String)menu.Tag;
+ if (String.IsNullOrEmpty(file)) return;
+ if (!File.Exists(file)) return;
+
+ // 找内容区域
+ ToolStripItem item = menu;
+ while (item.OwnerItem != null) item = item.OwnerItem;
+
+ ContextMenuStrip cms = item.Owner as ContextMenuStrip;
+ if (cms == null) return;
+
+ TextBoxBase rt = null;
+ if (txtPattern.ContextMenuStrip == cms)
+ rt = txtPattern;
+ else if (txtContent.ContextMenuStrip == cms)
+ rt = txtContent;
+
+ if (rt == null) return;
+
+ String content = File.ReadAllText(file);
+ rt.SelectedText = content;
+ }
+ #endregion
+
+ #region 打开目录
+ private void button4_Click(object sender, EventArgs e)
+ {
+ Button btn = sender as Button;
+ GetFolder(btn);
+ if (!String.IsNullOrEmpty(folderBrowserDialog1.SelectedPath)) GetFiles();
+ }
+
+ void GetFolder(Button btn)
+ {
+ FolderBrowserDialog fb = folderBrowserDialog1;
+
+ if (fb.ShowDialog() != DialogResult.OK) return;
+ btn.Tag = fb.SelectedPath;
+ toolTip1.SetToolTip(btn, fb.SelectedPath);
+
+ lbStatus.Text = String.Format("选择目录:{0}", fb.SelectedPath);
+ }
+
+ String[] GetFiles()
+ {
+ // 获取目录,如果没有选择,则打开选择
+ Button btn = button4;
+ String path = btn.Tag == null ? null : (String)btn.Tag;
+ if (String.IsNullOrEmpty(path))
+ {
+ GetFolder(btn);
+ path = btn.Tag == null ? null : (String)btn.Tag;
+ }
+ // 如果还是没有目录,退出
+ if (String.IsNullOrEmpty(path) || !Directory.Exists(path)) return null;
+
+ // 获取文件
+ String[] files = Directory.GetFiles(path, textBox2.Text, SearchOption.AllDirectories);
+ if (files == null || files.Length < 1)
+ {
+ ShowError("没有符合条件的文件!");
+ return null;
+ }
+ lbStatus.Text = String.Format("共有符合条件的文件 {0} 个!", files.Length);
+
+ // 第一个文件内容进入内容窗口
+ try
+ {
+ txtContent.Text = File.ReadAllText(files[0]);
+ }
+ catch { }
+
+ return files;
+ }
+ #endregion
+
+ #region 正则选项
+ private void checkBox1_CheckedChanged(object sender, EventArgs e)
+ {
+ var chk = sender as CheckBox;
+ if (chk == null) return;
+
+ GetOption();
+ }
+
+ void GetOption()
+ {
+ var sb = new StringBuilder();
+ foreach (var item in chkIgnoreCase.Parent.Controls)
+ {
+ var chk = item as CheckBox;
+ if (chk != null && chk.Checked)
+ {
+ if (sb.Length > 0) sb.Append(" | ");
+
+ var name = chk.Name;
+ if (name.StartsWith("chk")) name = name.Substring(3);
+
+ sb.AppendFormat("RegexOptions.{0}", name);
+ }
+ }
+
+ txtOption.Text = sb.ToString();
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/XCoder/XRegex/FrmMain.designer.cs b/XCoder/XRegex/FrmMain.designer.cs
new file mode 100644
index 0000000..70ff705
--- /dev/null
+++ b/XCoder/XRegex/FrmMain.designer.cs
@@ -0,0 +1,649 @@
+namespace NewLife.XRegex
+{
+ partial class FrmMain
+ {
+ /// <summary>
+ /// 必需的设计器变量。
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// 清理所有正在使用的资源。
+ /// </summary>
+ /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows 窗体设计器生成的代码
+
+ /// <summary>
+ /// 设计器支持所需的方法 - 不要
+ /// 使用代码编辑器修改此方法的内容。
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.txtOption = new System.Windows.Forms.TextBox();
+ this.txtPattern = new System.Windows.Forms.TextBox();
+ this.ptMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.正则ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.chkSingleline = new System.Windows.Forms.CheckBox();
+ this.chkIgnorePatternWhitespace = new System.Windows.Forms.CheckBox();
+ this.chkMultiline = new System.Windows.Forms.CheckBox();
+ this.chkIgnoreCase = new System.Windows.Forms.CheckBox();
+ this.groupBox2 = new System.Windows.Forms.GroupBox();
+ this.txtContent = new System.Windows.Forms.TextBox();
+ this.txtMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.例子ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.radioButton2 = new System.Windows.Forms.RadioButton();
+ this.radioButton1 = new System.Windows.Forms.RadioButton();
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.textBox2 = new System.Windows.Forms.TextBox();
+ this.button4 = new System.Windows.Forms.Button();
+ this.label1 = new System.Windows.Forms.Label();
+ this.button5 = new System.Windows.Forms.Button();
+ this.button2 = new System.Windows.Forms.Button();
+ this.groupBox3 = new System.Windows.Forms.GroupBox();
+ this.splitContainer3 = new System.Windows.Forms.SplitContainer();
+ this.lvMatch = new System.Windows.Forms.ListView();
+ this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.columnHeader8 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.splitContainer4 = new System.Windows.Forms.SplitContainer();
+ this.lvGroup = new System.Windows.Forms.ListView();
+ this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.columnHeader9 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.lvCapture = new System.Windows.Forms.ListView();
+ this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.columnHeader10 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.rtReplace = new System.Windows.Forms.RichTextBox();
+ this.statusStrip1 = new System.Windows.Forms.StatusStrip();
+ this.lbStatus = new System.Windows.Forms.ToolStripStatusLabel();
+ this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+ this.splitContainer2 = new System.Windows.Forms.SplitContainer();
+ this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
+ this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
+ this.groupBox1.SuspendLayout();
+ this.ptMenu.SuspendLayout();
+ this.groupBox2.SuspendLayout();
+ this.txtMenu.SuspendLayout();
+ this.panel1.SuspendLayout();
+ this.groupBox3.SuspendLayout();
+ this.splitContainer3.Panel1.SuspendLayout();
+ this.splitContainer3.Panel2.SuspendLayout();
+ this.splitContainer3.SuspendLayout();
+ this.splitContainer4.Panel1.SuspendLayout();
+ this.splitContainer4.Panel2.SuspendLayout();
+ this.splitContainer4.SuspendLayout();
+ this.statusStrip1.SuspendLayout();
+ this.splitContainer1.Panel1.SuspendLayout();
+ this.splitContainer1.Panel2.SuspendLayout();
+ this.splitContainer1.SuspendLayout();
+ this.splitContainer2.Panel1.SuspendLayout();
+ this.splitContainer2.Panel2.SuspendLayout();
+ this.splitContainer2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // groupBox1
+ //
+ this.groupBox1.Controls.Add(this.txtOption);
+ this.groupBox1.Controls.Add(this.txtPattern);
+ this.groupBox1.Controls.Add(this.chkSingleline);
+ this.groupBox1.Controls.Add(this.chkIgnorePatternWhitespace);
+ this.groupBox1.Controls.Add(this.chkMultiline);
+ this.groupBox1.Controls.Add(this.chkIgnoreCase);
+ this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.groupBox1.Location = new System.Drawing.Point(0, 0);
+ this.groupBox1.Name = "groupBox1";
+ this.groupBox1.Size = new System.Drawing.Size(760, 149);
+ this.groupBox1.TabIndex = 0;
+ this.groupBox1.TabStop = false;
+ this.groupBox1.Text = "正则表达式";
+ //
+ // txtOption
+ //
+ this.txtOption.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.txtOption.Location = new System.Drawing.Point(421, 18);
+ this.txtOption.Name = "txtOption";
+ this.txtOption.ReadOnly = true;
+ this.txtOption.Size = new System.Drawing.Size(333, 21);
+ this.txtOption.TabIndex = 14;
+ //
+ // txtPattern
+ //
+ this.txtPattern.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.txtPattern.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
+ this.txtPattern.ContextMenuStrip = this.ptMenu;
+ this.txtPattern.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.txtPattern.Location = new System.Drawing.Point(6, 42);
+ this.txtPattern.Multiline = true;
+ this.txtPattern.Name = "txtPattern";
+ this.txtPattern.Size = new System.Drawing.Size(748, 94);
+ this.txtPattern.TabIndex = 13;
+ //
+ // ptMenu
+ //
+ this.ptMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.正则ToolStripMenuItem});
+ this.ptMenu.Name = "ptMenu";
+ this.ptMenu.Size = new System.Drawing.Size(101, 26);
+ this.ptMenu.Opening += new System.ComponentModel.CancelEventHandler(this.ptMenu_Opening);
+ //
+ // 正则ToolStripMenuItem
+ //
+ this.正则ToolStripMenuItem.Name = "正则ToolStripMenuItem";
+ this.正则ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
+ this.正则ToolStripMenuItem.Text = "正则";
+ this.正则ToolStripMenuItem.Click += new System.EventHandler(this.MenuItem_Click);
+ //
+ // chkSingleline
+ //
+ this.chkSingleline.AutoSize = true;
+ this.chkSingleline.Checked = true;
+ this.chkSingleline.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.chkSingleline.Location = new System.Drawing.Point(106, 20);
+ this.chkSingleline.Name = "chkSingleline";
+ this.chkSingleline.Size = new System.Drawing.Size(72, 16);
+ this.chkSingleline.TabIndex = 6;
+ this.chkSingleline.Text = "单行模式";
+ this.toolTip1.SetToolTip(this.chkSingleline, "使用单行模式,其中句点 (.)匹配每个字符(而不是与除 \\n 之外的每个字符匹配)。 ");
+ this.chkSingleline.UseVisualStyleBackColor = true;
+ this.chkSingleline.Click += new System.EventHandler(this.checkBox1_CheckedChanged);
+ //
+ // chkIgnorePatternWhitespace
+ //
+ this.chkIgnorePatternWhitespace.AutoSize = true;
+ this.chkIgnorePatternWhitespace.Checked = true;
+ this.chkIgnorePatternWhitespace.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.chkIgnorePatternWhitespace.Location = new System.Drawing.Point(280, 20);
+ this.chkIgnorePatternWhitespace.Name = "chkIgnorePatternWhitespace";
+ this.chkIgnorePatternWhitespace.Size = new System.Drawing.Size(120, 16);
+ this.chkIgnorePatternWhitespace.TabIndex = 4;
+ this.chkIgnorePatternWhitespace.Text = "忽略正则中的空白";
+ this.toolTip1.SetToolTip(this.chkIgnorePatternWhitespace, "从模式中排除保留的空白并启用数字符号 ( #) 后的注释。");
+ this.chkIgnorePatternWhitespace.UseVisualStyleBackColor = true;
+ this.chkIgnorePatternWhitespace.Click += new System.EventHandler(this.checkBox1_CheckedChanged);
+ //
+ // chkMultiline
+ //
+ this.chkMultiline.AutoSize = true;
+ this.chkMultiline.Checked = true;
+ this.chkMultiline.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.chkMultiline.Location = new System.Drawing.Point(193, 20);
+ this.chkMultiline.Name = "chkMultiline";
+ this.chkMultiline.Size = new System.Drawing.Size(72, 16);
+ this.chkMultiline.TabIndex = 3;
+ this.chkMultiline.Text = "多线模式";
+ this.toolTip1.SetToolTip(this.chkMultiline, "使用多线模式,其中 ^ 和 $ 匹配每行的开头和末尾(不是输入字符串的开头和末尾)。 ");
+ this.chkMultiline.UseVisualStyleBackColor = true;
+ this.chkMultiline.Click += new System.EventHandler(this.checkBox1_CheckedChanged);
+ //
+ // chkIgnoreCase
+ //
+ this.chkIgnoreCase.AutoSize = true;
+ this.chkIgnoreCase.Checked = true;
+ this.chkIgnoreCase.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.chkIgnoreCase.Location = new System.Drawing.Point(7, 20);
+ this.chkIgnoreCase.Name = "chkIgnoreCase";
+ this.chkIgnoreCase.Size = new System.Drawing.Size(84, 16);
+ this.chkIgnoreCase.TabIndex = 2;
+ this.chkIgnoreCase.Text = "忽略大小写";
+ this.toolTip1.SetToolTip(this.chkIgnoreCase, "使用不区分大小写的匹配");
+ this.chkIgnoreCase.UseVisualStyleBackColor = true;
+ this.chkIgnoreCase.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
+ this.chkIgnoreCase.Click += new System.EventHandler(this.checkBox1_CheckedChanged);
+ //
+ // groupBox2
+ //
+ this.groupBox2.Controls.Add(this.txtContent);
+ this.groupBox2.Controls.Add(this.radioButton2);
+ this.groupBox2.Controls.Add(this.radioButton1);
+ this.groupBox2.Controls.Add(this.panel1);
+ this.groupBox2.Controls.Add(this.button2);
+ this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.groupBox2.Location = new System.Drawing.Point(0, 0);
+ this.groupBox2.Name = "groupBox2";
+ this.groupBox2.Size = new System.Drawing.Size(760, 191);
+ this.groupBox2.TabIndex = 1;
+ this.groupBox2.TabStop = false;
+ this.groupBox2.Text = "数据源";
+ //
+ // txtContent
+ //
+ this.txtContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.txtContent.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+ this.txtContent.ContextMenuStrip = this.txtMenu;
+ this.txtContent.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.txtContent.Location = new System.Drawing.Point(6, 42);
+ this.txtContent.Multiline = true;
+ this.txtContent.Name = "txtContent";
+ this.txtContent.Size = new System.Drawing.Size(748, 143);
+ this.txtContent.TabIndex = 14;
+ //
+ // txtMenu
+ //
+ this.txtMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.例子ToolStripMenuItem});
+ this.txtMenu.Name = "txtMenu";
+ this.txtMenu.Size = new System.Drawing.Size(101, 26);
+ this.txtMenu.Opening += new System.ComponentModel.CancelEventHandler(this.txtMenu_Opening);
+ //
+ // 例子ToolStripMenuItem
+ //
+ this.例子ToolStripMenuItem.Name = "例子ToolStripMenuItem";
+ this.例子ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
+ this.例子ToolStripMenuItem.Text = "例子";
+ this.例子ToolStripMenuItem.Click += new System.EventHandler(this.MenuItem_Click);
+ //
+ // radioButton2
+ //
+ this.radioButton2.AutoSize = true;
+ this.radioButton2.Location = new System.Drawing.Point(63, 16);
+ this.radioButton2.Name = "radioButton2";
+ this.radioButton2.Size = new System.Drawing.Size(47, 16);
+ this.radioButton2.TabIndex = 12;
+ this.radioButton2.TabStop = true;
+ this.radioButton2.Text = "替换";
+ this.radioButton2.UseVisualStyleBackColor = true;
+ //
+ // radioButton1
+ //
+ this.radioButton1.AutoSize = true;
+ this.radioButton1.Checked = true;
+ this.radioButton1.Location = new System.Drawing.Point(9, 16);
+ this.radioButton1.Name = "radioButton1";
+ this.radioButton1.Size = new System.Drawing.Size(47, 16);
+ this.radioButton1.TabIndex = 11;
+ this.radioButton1.TabStop = true;
+ this.radioButton1.Text = "匹配";
+ this.radioButton1.UseVisualStyleBackColor = true;
+ this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
+ //
+ // panel1
+ //
+ this.panel1.Controls.Add(this.textBox2);
+ this.panel1.Controls.Add(this.button4);
+ this.panel1.Controls.Add(this.label1);
+ this.panel1.Controls.Add(this.button5);
+ this.panel1.Location = new System.Drawing.Point(355, 13);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(284, 28);
+ this.panel1.TabIndex = 10;
+ //
+ // textBox2
+ //
+ this.textBox2.Location = new System.Drawing.Point(139, 3);
+ this.textBox2.Name = "textBox2";
+ this.textBox2.Size = new System.Drawing.Size(56, 21);
+ this.textBox2.TabIndex = 5;
+ this.textBox2.Text = "*.*";
+ //
+ // button4
+ //
+ this.button4.Location = new System.Drawing.Point(7, 2);
+ this.button4.Name = "button4";
+ this.button4.Size = new System.Drawing.Size(75, 23);
+ this.button4.TabIndex = 4;
+ this.button4.Text = "打开目录";
+ this.button4.UseVisualStyleBackColor = true;
+ this.button4.Click += new System.EventHandler(this.button4_Click);
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(98, 7);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(35, 12);
+ this.label1.TabIndex = 6;
+ this.label1.Text = "过滤:";
+ //
+ // button5
+ //
+ this.button5.Location = new System.Drawing.Point(203, 2);
+ this.button5.Name = "button5";
+ this.button5.Size = new System.Drawing.Size(75, 23);
+ this.button5.TabIndex = 7;
+ this.button5.Text = "全部替换";
+ this.button5.UseVisualStyleBackColor = true;
+ this.button5.Click += new System.EventHandler(this.button5_Click);
+ //
+ // button2
+ //
+ this.button2.Location = new System.Drawing.Point(132, 13);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(75, 23);
+ this.button2.TabIndex = 1;
+ this.button2.Text = "正则匹配";
+ this.toolTip1.SetToolTip(this.button2, "如果正则中选中部分文本,则以选中部分文本作为匹配用正则。");
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
+ //
+ // groupBox3
+ //
+ this.groupBox3.Controls.Add(this.splitContainer3);
+ this.groupBox3.Controls.Add(this.rtReplace);
+ this.groupBox3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.groupBox3.Location = new System.Drawing.Point(0, 0);
+ this.groupBox3.Name = "groupBox3";
+ this.groupBox3.Size = new System.Drawing.Size(760, 169);
+ this.groupBox3.TabIndex = 2;
+ this.groupBox3.TabStop = false;
+ this.groupBox3.Text = "匹配结果";
+ //
+ // splitContainer3
+ //
+ this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.splitContainer3.Location = new System.Drawing.Point(3, 17);
+ this.splitContainer3.Name = "splitContainer3";
+ //
+ // splitContainer3.Panel1
+ //
+ this.splitContainer3.Panel1.Controls.Add(this.lvMatch);
+ //
+ // splitContainer3.Panel2
+ //
+ this.splitContainer3.Panel2.Controls.Add(this.splitContainer4);
+ this.splitContainer3.Size = new System.Drawing.Size(754, 149);
+ this.splitContainer3.SplitterDistance = 221;
+ this.splitContainer3.TabIndex = 0;
+ //
+ // lvMatch
+ //
+ this.lvMatch.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
+ this.lvMatch.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+ this.columnHeader1,
+ this.columnHeader2,
+ this.columnHeader8});
+ this.lvMatch.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.lvMatch.FullRowSelect = true;
+ this.lvMatch.GridLines = true;
+ this.lvMatch.HideSelection = false;
+ this.lvMatch.Location = new System.Drawing.Point(0, 0);
+ this.lvMatch.MultiSelect = false;
+ this.lvMatch.Name = "lvMatch";
+ this.lvMatch.Size = new System.Drawing.Size(221, 149);
+ this.lvMatch.TabIndex = 0;
+ this.lvMatch.UseCompatibleStateImageBehavior = false;
+ this.lvMatch.View = System.Windows.Forms.View.Details;
+ this.lvMatch.SelectedIndexChanged += new System.EventHandler(this.lvMatch_SelectedIndexChanged);
+ //
+ // columnHeader1
+ //
+ this.columnHeader1.Text = "顺序";
+ this.columnHeader1.Width = 36;
+ //
+ // columnHeader2
+ //
+ this.columnHeader2.Text = "匹配项";
+ this.columnHeader2.Width = 118;
+ //
+ // columnHeader8
+ //
+ this.columnHeader8.Text = "位置";
+ //
+ // splitContainer4
+ //
+ this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.splitContainer4.Location = new System.Drawing.Point(0, 0);
+ this.splitContainer4.Name = "splitContainer4";
+ //
+ // splitContainer4.Panel1
+ //
+ this.splitContainer4.Panel1.Controls.Add(this.lvGroup);
+ //
+ // splitContainer4.Panel2
+ //
+ this.splitContainer4.Panel2.Controls.Add(this.lvCapture);
+ this.splitContainer4.Size = new System.Drawing.Size(529, 149);
+ this.splitContainer4.SplitterDistance = 314;
+ this.splitContainer4.TabIndex = 0;
+ //
+ // lvGroup
+ //
+ this.lvGroup.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
+ this.lvGroup.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+ this.columnHeader3,
+ this.columnHeader4,
+ this.columnHeader7,
+ this.columnHeader9});
+ this.lvGroup.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.lvGroup.FullRowSelect = true;
+ this.lvGroup.GridLines = true;
+ this.lvGroup.HideSelection = false;
+ this.lvGroup.Location = new System.Drawing.Point(0, 0);
+ this.lvGroup.MultiSelect = false;
+ this.lvGroup.Name = "lvGroup";
+ this.lvGroup.Size = new System.Drawing.Size(314, 149);
+ this.lvGroup.TabIndex = 0;
+ this.lvGroup.UseCompatibleStateImageBehavior = false;
+ this.lvGroup.View = System.Windows.Forms.View.Details;
+ this.lvGroup.SelectedIndexChanged += new System.EventHandler(this.lvGroup_SelectedIndexChanged);
+ //
+ // columnHeader3
+ //
+ this.columnHeader3.Text = "顺序";
+ this.columnHeader3.Width = 36;
+ //
+ // columnHeader4
+ //
+ this.columnHeader4.Text = "名称";
+ //
+ // columnHeader7
+ //
+ this.columnHeader7.Text = "匹配项";
+ this.columnHeader7.Width = 124;
+ //
+ // columnHeader9
+ //
+ this.columnHeader9.Text = "位置";
+ //
+ // lvCapture
+ //
+ this.lvCapture.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
+ this.lvCapture.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+ this.columnHeader5,
+ this.columnHeader6,
+ this.columnHeader10});
+ this.lvCapture.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.lvCapture.FullRowSelect = true;
+ this.lvCapture.GridLines = true;
+ this.lvCapture.HideSelection = false;
+ this.lvCapture.Location = new System.Drawing.Point(0, 0);
+ this.lvCapture.MultiSelect = false;
+ this.lvCapture.Name = "lvCapture";
+ this.lvCapture.Size = new System.Drawing.Size(211, 149);
+ this.lvCapture.TabIndex = 0;
+ this.lvCapture.UseCompatibleStateImageBehavior = false;
+ this.lvCapture.View = System.Windows.Forms.View.Details;
+ this.lvCapture.SelectedIndexChanged += new System.EventHandler(this.lvCapture_SelectedIndexChanged);
+ //
+ // columnHeader5
+ //
+ this.columnHeader5.Text = "顺序";
+ this.columnHeader5.Width = 36;
+ //
+ // columnHeader6
+ //
+ this.columnHeader6.Text = "匹配项";
+ this.columnHeader6.Width = 109;
+ //
+ // columnHeader10
+ //
+ this.columnHeader10.Text = "位置";
+ //
+ // rtReplace
+ //
+ this.rtReplace.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+ this.rtReplace.DetectUrls = false;
+ this.rtReplace.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.rtReplace.Font = new System.Drawing.Font("新宋体", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.rtReplace.HideSelection = false;
+ this.rtReplace.Location = new System.Drawing.Point(3, 17);
+ this.rtReplace.Name = "rtReplace";
+ this.rtReplace.Size = new System.Drawing.Size(754, 149);
+ this.rtReplace.TabIndex = 1;
+ this.rtReplace.Text = "";
+ this.rtReplace.Visible = false;
+ //
+ // statusStrip1
+ //
+ this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.lbStatus});
+ this.statusStrip1.Location = new System.Drawing.Point(0, 540);
+ this.statusStrip1.Name = "statusStrip1";
+ this.statusStrip1.Size = new System.Drawing.Size(784, 22);
+ this.statusStrip1.TabIndex = 3;
+ this.statusStrip1.Text = "statusStrip1";
+ //
+ // lbStatus
+ //
+ this.lbStatus.Name = "lbStatus";
+ this.lbStatus.Size = new System.Drawing.Size(44, 17);
+ this.lbStatus.Text = "已就绪";
+ //
+ // splitContainer1
+ //
+ this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.splitContainer1.Location = new System.Drawing.Point(12, 12);
+ this.splitContainer1.Name = "splitContainer1";
+ this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
+ //
+ // splitContainer1.Panel1
+ //
+ this.splitContainer1.Panel1.Controls.Add(this.groupBox1);
+ //
+ // splitContainer1.Panel2
+ //
+ this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
+ this.splitContainer1.Size = new System.Drawing.Size(760, 517);
+ this.splitContainer1.SplitterDistance = 149;
+ this.splitContainer1.TabIndex = 4;
+ //
+ // splitContainer2
+ //
+ this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.splitContainer2.Location = new System.Drawing.Point(0, 0);
+ this.splitContainer2.Name = "splitContainer2";
+ this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
+ //
+ // splitContainer2.Panel1
+ //
+ this.splitContainer2.Panel1.Controls.Add(this.groupBox2);
+ //
+ // splitContainer2.Panel2
+ //
+ this.splitContainer2.Panel2.Controls.Add(this.groupBox3);
+ this.splitContainer2.Size = new System.Drawing.Size(760, 364);
+ this.splitContainer2.SplitterDistance = 191;
+ this.splitContainer2.TabIndex = 0;
+ //
+ // folderBrowserDialog1
+ //
+ this.folderBrowserDialog1.ShowNewFolderButton = false;
+ //
+ // FrmMain
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(784, 562);
+ this.Controls.Add(this.splitContainer1);
+ this.Controls.Add(this.statusStrip1);
+ this.Name = "FrmMain";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "新生命正则表达式工具";
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmMain_FormClosing);
+ this.Shown += new System.EventHandler(this.FrmMain_Shown);
+ this.groupBox1.ResumeLayout(false);
+ this.groupBox1.PerformLayout();
+ this.ptMenu.ResumeLayout(false);
+ this.groupBox2.ResumeLayout(false);
+ this.groupBox2.PerformLayout();
+ this.txtMenu.ResumeLayout(false);
+ this.panel1.ResumeLayout(false);
+ this.panel1.PerformLayout();
+ this.groupBox3.ResumeLayout(false);
+ this.splitContainer3.Panel1.ResumeLayout(false);
+ this.splitContainer3.Panel2.ResumeLayout(false);
+ this.splitContainer3.ResumeLayout(false);
+ this.splitContainer4.Panel1.ResumeLayout(false);
+ this.splitContainer4.Panel2.ResumeLayout(false);
+ this.splitContainer4.ResumeLayout(false);
+ this.statusStrip1.ResumeLayout(false);
+ this.statusStrip1.PerformLayout();
+ this.splitContainer1.Panel1.ResumeLayout(false);
+ this.splitContainer1.Panel2.ResumeLayout(false);
+ this.splitContainer1.ResumeLayout(false);
+ this.splitContainer2.Panel1.ResumeLayout(false);
+ this.splitContainer2.Panel2.ResumeLayout(false);
+ this.splitContainer2.ResumeLayout(false);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.GroupBox groupBox1;
+ private System.Windows.Forms.GroupBox groupBox2;
+ private System.Windows.Forms.GroupBox groupBox3;
+ private System.Windows.Forms.StatusStrip statusStrip1;
+ private System.Windows.Forms.ToolStripStatusLabel lbStatus;
+ private System.Windows.Forms.SplitContainer splitContainer1;
+ private System.Windows.Forms.SplitContainer splitContainer2;
+ private System.Windows.Forms.CheckBox chkIgnorePatternWhitespace;
+ private System.Windows.Forms.ToolTip toolTip1;
+ private System.Windows.Forms.CheckBox chkMultiline;
+ private System.Windows.Forms.CheckBox chkIgnoreCase;
+ private System.Windows.Forms.SplitContainer splitContainer3;
+ private System.Windows.Forms.ListView lvMatch;
+ private System.Windows.Forms.SplitContainer splitContainer4;
+ private System.Windows.Forms.ListView lvGroup;
+ private System.Windows.Forms.ListView lvCapture;
+ private System.Windows.Forms.ColumnHeader columnHeader1;
+ private System.Windows.Forms.ColumnHeader columnHeader2;
+ private System.Windows.Forms.ColumnHeader columnHeader3;
+ private System.Windows.Forms.ColumnHeader columnHeader4;
+ private System.Windows.Forms.ColumnHeader columnHeader5;
+ private System.Windows.Forms.ColumnHeader columnHeader6;
+ private System.Windows.Forms.ColumnHeader columnHeader7;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox textBox2;
+ private System.Windows.Forms.Button button4;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.Button button5;
+ private System.Windows.Forms.ContextMenuStrip ptMenu;
+ private System.Windows.Forms.ContextMenuStrip txtMenu;
+ private System.Windows.Forms.ToolStripMenuItem 正则ToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem 例子ToolStripMenuItem;
+ private System.Windows.Forms.CheckBox chkSingleline;
+ private System.Windows.Forms.ColumnHeader columnHeader8;
+ private System.Windows.Forms.ColumnHeader columnHeader9;
+ private System.Windows.Forms.ColumnHeader columnHeader10;
+ private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
+ private System.Windows.Forms.RadioButton radioButton2;
+ private System.Windows.Forms.RadioButton radioButton1;
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.RichTextBox rtReplace;
+ private System.Windows.Forms.TextBox txtPattern;
+ private System.Windows.Forms.TextBox txtContent;
+ private System.Windows.Forms.TextBox txtOption;
+ }
+}
+
diff --git a/XCoder/XRegex/FrmMain.resx b/XCoder/XRegex/FrmMain.resx
new file mode 100644
index 0000000..0d51bcd
--- /dev/null
+++ b/XCoder/XRegex/FrmMain.resx
@@ -0,0 +1,138 @@
+<?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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="ptMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>239, 17</value>
+ </metadata>
+ <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>138, 17</value>
+ </metadata>
+ <metadata name="txtMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>404, 17</value>
+ </metadata>
+ <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+ <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>138, 17</value>
+ </metadata>
+ <metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>505, 17</value>
+ </metadata>
+</root>
\ No newline at end of file
diff --git "a/XCoder/XRegex/Pattern/Html/\346\227\240\345\265\214\345\245\227\346\240\207\350\256\260.txt" "b/XCoder/XRegex/Pattern/Html/\346\227\240\345\265\214\345\245\227\346\240\207\350\256\260.txt"
new file mode 100644
index 0000000..8317555
--- /dev/null
+++ "b/XCoder/XRegex/Pattern/Html/\346\227\240\345\265\214\345\245\227\346\240\207\350\256\260.txt"
@@ -0,0 +1 @@
+<(?<标记>\w+)(?:[^>]*)>(?<内容>[^<]*)</\1>
\ No newline at end of file
diff --git "a/XCoder/XRegex/Pattern/SQL\346\237\245\350\257\242/\345\265\214\345\245\227\346\237\245\350\257\242.txt" "b/XCoder/XRegex/Pattern/SQL\346\237\245\350\257\242/\345\265\214\345\245\227\346\237\245\350\257\242.txt"
new file mode 100644
index 0000000..4a90297
--- /dev/null
+++ "b/XCoder/XRegex/Pattern/SQL\346\237\245\350\257\242/\345\265\214\345\245\227\346\237\245\350\257\242.txt"
@@ -0,0 +1,10 @@
+#一个非常简单的SQL查询语句匹配
+(?isx-m)
+^
+\bSelect\s+(?<选择列>(?>[^()]+?|\((?<Open>)|\)(?<-Open>))*?(?(Open)(?!)))
+\s+From\s+(?<数据表>(?>[^()]+?|\((?<Open>)|\)(?<-Open>))*?(?(Open)(?!)))
+(?:\s+Where\s+(?<条件>(?>[^()]+?|\((?<Open>)|\)(?<-Open>))*?(?(Open)(?!))))?
+(?:\s+Group\s+By\s+(?<分组>(?>[^()]+?|\((?<Open>)|\)(?<-Open>))*?(?(Open)(?!))))?
+(?:\s+Having\s+(?<分组条件>(?>[^()]+?|\((?<Open>)|\)(?<-Open>))*?(?(Open)(?!))))?
+(?:\s+Order\s+By\s+(?<排序>(?>[^()]+?|\((?<Open>)|\)(?<-Open>))*?(?(Open)(?!))))?
+$
\ No newline at end of file
diff --git "a/XCoder/XRegex/Pattern/SQL\346\237\245\350\257\242/\347\256\200\345\215\225.txt" "b/XCoder/XRegex/Pattern/SQL\346\237\245\350\257\242/\347\256\200\345\215\225.txt"
new file mode 100644
index 0000000..6d43e10
--- /dev/null
+++ "b/XCoder/XRegex/Pattern/SQL\346\237\245\350\257\242/\347\256\200\345\215\225.txt"
@@ -0,0 +1,9 @@
+#一个非常简单的SQL查询语句匹配
+^
+\bSelect\s+(?<选择列>.*)
+\s+From\s+(?<数据表>.+?)
+(?:\s+Where\s+(?<条件>.+?))?
+(?:\s+Group\s+By\s+(?<分组>.+?))?
+(?:\s+Having\s+(?<分组条件>.+?))?
+(?:\s+Order\s+By\s+(?<排序>.+?))?
+$
\ No newline at end of file
diff --git "a/XCoder/XRegex/Pattern/\345\271\263\350\241\241\347\273\204/\345\256\214\346\225\264\347\244\272\344\276\213.txt" "b/XCoder/XRegex/Pattern/\345\271\263\350\241\241\347\273\204/\345\256\214\346\225\264\347\244\272\344\276\213.txt"
new file mode 100644
index 0000000..16e0325
--- /dev/null
+++ "b/XCoder/XRegex/Pattern/\345\271\263\350\241\241\347\273\204/\345\256\214\346\225\264\347\244\272\344\276\213.txt"
@@ -0,0 +1,10 @@
+\( #普通字符“(”
+ ( #分组构造,用来限定量词“*”修饰范围
+ [^()]+ #非括弧的其它任意字符
+ | #分支结构
+ \( (?<Open>) #命名捕获组,遇到开括弧Open计数加1
+ | #分支结构
+ \) (?<-Open>) #狭义平衡组,遇到闭括弧Open计数减1
+ )* #以上子串出现0次或任意多次
+ (?(Open)(?!)) #判断是否还有'OPEN',有则说明不配对,什么都不匹配
+\) #普通闭括弧
\ No newline at end of file
diff --git "a/XCoder/XRegex/Pattern/\345\271\263\350\241\241\347\273\204/\345\256\214\346\225\264\347\244\272\344\276\213\345\233\272\345\214\226\345\210\206\347\273\204.txt" "b/XCoder/XRegex/Pattern/\345\271\263\350\241\241\347\273\204/\345\256\214\346\225\264\347\244\272\344\276\213\345\233\272\345\214\226\345\210\206\347\273\204.txt"
new file mode 100644
index 0000000..55f5089
--- /dev/null
+++ "b/XCoder/XRegex/Pattern/\345\271\263\350\241\241\347\273\204/\345\256\214\346\225\264\347\244\272\344\276\213\345\233\272\345\214\226\345\210\206\347\273\204.txt"
@@ -0,0 +1,10 @@
+\( #普通字符“(”
+ (?> #分组构造,用来限定量词“*”修饰范围,>表示固化分组,匹配失败时不回溯,性能较高
+ [^()]+ #非括弧的其它任意字符
+ | #分支结构
+ \( (?<Open>) #命名捕获组,遇到开括弧Open计数加1
+ | #分支结构
+ \) (?<-Open>) #狭义平衡组,遇到闭括弧Open计数减1
+ )* #以上子串出现0次或任意多次
+ (?(Open)(?!)) #判断是否还有'OPEN',有则说明不配对,什么都不匹配
+\) #普通闭括弧
\ No newline at end of file
diff --git "a/XCoder/XRegex/Pattern/\345\271\263\350\241\241\347\273\204/\346\240\207\345\207\206.txt" "b/XCoder/XRegex/Pattern/\345\271\263\350\241\241\347\273\204/\346\240\207\345\207\206.txt"
new file mode 100644
index 0000000..a9a17a5
--- /dev/null
+++ "b/XCoder/XRegex/Pattern/\345\271\263\350\241\241\347\273\204/\346\240\207\345\207\206.txt"
@@ -0,0 +1 @@
+(?:[^()]+|\((?<Open>)|\)(?<-Open>))*(?(Open)(?!))
\ No newline at end of file
diff --git "a/XCoder/XRegex/Pattern/\345\271\263\350\241\241\347\273\204/\346\240\207\345\207\206\345\233\272\345\214\226\345\210\206\347\273\204.txt" "b/XCoder/XRegex/Pattern/\345\271\263\350\241\241\347\273\204/\346\240\207\345\207\206\345\233\272\345\214\226\345\210\206\347\273\204.txt"
new file mode 100644
index 0000000..a8e4b7f
--- /dev/null
+++ "b/XCoder/XRegex/Pattern/\345\271\263\350\241\241\347\273\204/\346\240\207\345\207\206\345\233\272\345\214\226\345\210\206\347\273\204.txt"
@@ -0,0 +1 @@
+(?>[^()]+|\((?<Open>)|\)(?<-Open>))*(?(Open)(?!))
\ No newline at end of file
diff --git "a/XCoder/XRegex/Pattern/\347\275\221\351\241\265/\346\234\200\345\244\226\345\261\202\345\265\214\345\245\227.txt" "b/XCoder/XRegex/Pattern/\347\275\221\351\241\265/\346\234\200\345\244\226\345\261\202\345\265\214\345\245\227.txt"
new file mode 100644
index 0000000..8ac333a
--- /dev/null
+++ "b/XCoder/XRegex/Pattern/\347\275\221\351\241\265/\346\234\200\345\244\226\345\261\202\345\265\214\345\245\227.txt"
@@ -0,0 +1,11 @@
+(?isx) #匹配模式,忽略大小写,“.”匹配任意字符
+<div[^>]*> #开始标记“<div...>”
+ (?> #分组构造,用来限定量词“*”修饰范围
+ <div[^>]*> (?<Open>) #命名捕获组,遇到开始标记,入栈,Open计数加1
+ | #分支结构
+ </div> (?<-Open>) #狭义平衡组,遇到结束标记,出栈,Open计数减1
+ | #分支结构
+ (?:(?!</?div\b).)* #右侧不为开始或结束标记的任意字符
+ )* #以上子串出现0次或任意多次
+ (?(Open)(?!)) #判断是否还有'OPEN',有则说明不配对,什么都不匹配
+</div> #结束标记“</div>”
\ No newline at end of file
diff --git "a/XCoder/XRegex/Sample/SQL\346\237\245\350\257\242/MSSQL\350\241\250\347\273\223\346\236\204.txt" "b/XCoder/XRegex/Sample/SQL\346\237\245\350\257\242/MSSQL\350\241\250\347\273\223\346\236\204.txt"
new file mode 100644
index 0000000..95a2d29
--- /dev/null
+++ "b/XCoder/XRegex/Sample/SQL\346\237\245\350\257\242/MSSQL\350\241\250\347\273\223\346\236\204.txt"
@@ -0,0 +1,22 @@
+SELECT
+表名=d.name,--case when a.colorder=1 then d.name else '' end,
+字段序号=a.colorder,
+字段名=a.name,
+标识=case when COLUMNPROPERTY( a.id,a.name,'IsIdentity')=1 then '√'else '' end,
+主键=case when exists(SELECT 1 FROM sysobjects where xtype='PK' and name in (
+SELECT name FROM sysindexes WHERE indid in(
+ SELECT indid FROM sysindexkeys WHERE id = a.id AND colid=a.colid
+))) then '√' else '' end,
+类型=b.name,
+占用字节数=a.length,
+长度=COLUMNPROPERTY(a.id,a.name,'PRECISION'),
+小数位数=isnull(COLUMNPROPERTY(a.id,a.name,'Scale'),0),
+允许空=case when a.isnullable=1 then '√'else '' end,
+默认值=isnull(e.text,''),
+字段说明=isnull(g.[value],'')
+FROM syscolumns a
+left join systypes b on a.xtype=b.xusertype
+inner join sysobjects d on a.id=d.id and d.xtype='U' and d.name<>'dtproperties'
+left join syscomments e on a.cdefault=e.id
+left join sysproperties g on a.id=g.id and a.colid=g.smallid
+order by a.id,a.colorder
\ No newline at end of file
diff --git "a/XCoder/XRegex/Sample/SQL\346\237\245\350\257\242/\346\231\256\351\200\232\345\265\214\345\245\227\346\237\245\350\257\242.txt" "b/XCoder/XRegex/Sample/SQL\346\237\245\350\257\242/\346\231\256\351\200\232\345\265\214\345\245\227\346\237\245\350\257\242.txt"
new file mode 100644
index 0000000..58d25a4
--- /dev/null
+++ "b/XCoder/XRegex/Sample/SQL\346\237\245\350\257\242/\346\231\256\351\200\232\345\265\214\345\245\227\346\237\245\350\257\242.txt"
@@ -0,0 +1,6 @@
+Select Top 5 CategoryID, Count(*) as ProductCount
+From (Select * From Product Where IsEnable=1) as XCode_Temp_1
+Where IsDelete=0
+Group By CategoryID
+Having Count(*)>10
+Order By Count(*) Desc
\ No newline at end of file
diff --git "a/XCoder/XRegex/Sample/SQL\346\237\245\350\257\242/\346\231\256\351\200\232\346\237\245\350\257\242.txt" "b/XCoder/XRegex/Sample/SQL\346\237\245\350\257\242/\346\231\256\351\200\232\346\237\245\350\257\242.txt"
new file mode 100644
index 0000000..4860127
--- /dev/null
+++ "b/XCoder/XRegex/Sample/SQL\346\237\245\350\257\242/\346\231\256\351\200\232\346\237\245\350\257\242.txt"
@@ -0,0 +1,6 @@
+Select Top 5 CategoryID, Count(*) as ProductCount
+From Product as XCode_Temp_1
+Where IsDelete=0
+Group By CategoryID
+Having Count(*)>10
+Order By Count(*) Desc
\ No newline at end of file
diff --git "a/XCoder/XRegex/Sample/\345\271\263\350\241\241\347\273\204/\347\256\227\346\234\257\350\241\250\350\276\276\345\274\217.txt" "b/XCoder/XRegex/Sample/\345\271\263\350\241\241\347\273\204/\347\256\227\346\234\257\350\241\250\350\276\276\345\274\217.txt"
new file mode 100644
index 0000000..fdbbbf8
--- /dev/null
+++ "b/XCoder/XRegex/Sample/\345\271\263\350\241\241\347\273\204/\347\256\227\346\234\257\350\241\250\350\276\276\345\274\217.txt"
@@ -0,0 +1 @@
+a+(b*(c+d))/e+f-(g/(h-i))*j
\ No newline at end of file
diff --git "a/XCoder/XRegex/Sample/\347\275\221\351\241\265/\346\234\200\345\244\226\345\261\202\345\265\214\345\245\227.txt" "b/XCoder/XRegex/Sample/\347\275\221\351\241\265/\346\234\200\345\244\226\345\261\202\345\265\214\345\245\227.txt"
new file mode 100644
index 0000000..11529ed
--- /dev/null
+++ "b/XCoder/XRegex/Sample/\347\275\221\351\241\265/\346\234\200\345\244\226\345\261\202\345\265\214\345\245\227.txt"
@@ -0,0 +1,9 @@
+<div id="0">
+ 0
+</div>
+<div id="1">
+ 1
+ <div id="2">
+ 2
+</div>
+</div>
\ No newline at end of file